php-terminal-gameboy-emulator

A PHP Terminal GameBoy Emulator

  • 所有者: gabrielrcouto/php-terminal-gameboy-emulator
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Build Status
Software License
Packagist

Want to play Dr Mario or Pokémon on your server terminal? That's for you!

Table of Contents

Why

Some people will ask me: "Why you did that?"

Well, a friend asked me "What PHP can do?". I thought about that awhile and
the idea came up. With PHP7's performance improvement now it's possible to
emulate some systems :smile: and, come on, that's funny! :dancers:

It's based on the GameBoy JS Emulator.

Requirements

The following PHP versions are supported:

  • PHP 5.6
  • PHP 7
  • HHVM

You will need a good terminal! I've tested only on MacOSX and Linux. I'm sorry
about that Windows guys :disappointed:

Installation

Using composer:

$ composer g require gabrielrcouto/php-terminal-gameboy-emulator:dev-master

Using PHAR:

$ wget https://raw.githubusercontent.com/gabrielrcouto/php-terminal-gameboy-emulator/master/bin/php-gameboy.phar
$ chmod +x php-gameboy.phar
$ mv php-gameboy.phar /usr/local/bin/php-gameboy

Running

Your roms are loaded from the directory you are running the php-gameboy command.

$ php-gameboy drmario.gb
$ php-gameboy pokemon.gbc

If you like to run this emulator locally, simple clone the repository:

$ git clone https://github.com/gabrielrcouto/php-terminal-gameboy-emulator.git
$ cd php-terminal-gameboy-emulator
$ composer install -o

For running roms, pass the full path to your rom or put then in the php-terminal-gameboy-emulator folder:

$ bin/php-gameboy pokemon.gbc
$ bin/php-gameboy /full/path/to/your/rom/drmario.gb

Controls

_n_________________, _, _______________, _, ,-------------., .---------., `---------', `---------------', _, _, W, _         ,-., A   D, ,-. "._,", S, "._," Dot, _  _ Comma, // //, // //    \\\\\\, N  M      \\\\\\ ,, ________...______,"
  • Left = A
  • Up = W
  • Down = S
  • Right = D
  • A = Comma (,)
  • B = Dot (.)
  • Select = N
  • Start = M

Tests

You can use the following command to run the most common checks, such as php -l, phpcs:

$ ant check

TO-DO

Converting from the JS paradigm was a lot of work, and I still need to adapt somethings like:

  • Code standard - PSRs, please!
  • Array of functions - Maybe in PHP it's not the best approach
  • Pixel auxiliary array - Very CPU intensive to convert RGBA every time
  • Classes - Core is too big!
  • Profiling and otimizing - XHProf to find the most intensive functions
  • Save/Restore - I need to save my Pokémon, please!

Credits

@gabrielrcouto

The purpose of this project was to study all the capabilities of PHP.

It does not have any commercial or profitable intentions.

The user is responsible to use this code and its content in the terms of the law.

The author is completely against piracy and respects all the copyrights, trademarks and patents of Nintendo.

主要指標

概覽
名稱與所有者gabrielrcouto/php-terminal-gameboy-emulator
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證
所有者活动
創建於2016-02-21 20:09:45
推送於2020-11-02 20:29:49
最后一次提交2018-01-15 21:30:08
發布數1
最新版本名稱0.1.0 (發布於 )
第一版名稱0.1.0 (發布於 )
用户参与
星數1.6k
關注者數81
派生數112
提交數92
已啟用問題?
問題數20
打開的問題數6
拉請求數27
打開的拉請求數1
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?