If you are using Debian/Ubuntu, just do:
$ sudo apt-get install libsdl2-dev
In Windows, get SDL2.dll
, put it into the current directory, and run Optcarrot.
$ ruby tools/run-tests.rb
You can use stackprof.
$ gem install stackprof
$ bin/optcarrot --benchmark --stackprof examples/Lan_Master.nes
$ stackprof stackprof-cpu.dump
$ bin/optcarrot --benchmark --stackprof-mode=object examples/Lan_Master.nes
$ stackprof stackprof-object.dump
See doc/benchmark.md
.
$ gem build optcarrot.gemspec
$ gem install optcarrot-*.gem
- NROM (0)
- MMC1 (1)
- UxROM (2)
- CNROM (3)
- MMC3 (4)
Optcarrot supports loading a ROM in a ZIP file. zlib
library is required.
$ bin/optcarrot examples/alter_ego.zip
(Optcarrot::ROM.zip_extract
in lib/optcarrot/rom.rb
parses a ZIP file.)
$ bin/optcarrot --video=png --video-output=foo.png -f 30 examples/Lan_Master.nes
$ bin/optcarrot --video=gif --video-output=foo.gif -f 30 examples/Lan_Master.nes
$ bin/optcarrot --video=sixel --audio=ao --input=term examples/Lan_Master.nes
Each encoder is implemented in lib/optcarrot/driver/*_video.rb
.
You must get a commercial ROM in a legal way. You can buy a cartridge, and read ROM data from it. (I heard this is legal since NES cartridges are not encrypted at all, but I am not a laywer. Do at your own risk.)
I created my own ROM reader based on "HongKong with Arduino". See also tools/reader.rb
. It requires arduino_firmata
.
Or, there are many interesting free ROMs that fans created. Some of them are bundled in examples/
directory.
OPTimization carrot. Ruby developers will obtain a reward (able to play NES games!) if they successfully achieve Ruby3x3.