How to use motonesemu

Preparation:

First you will need to prepare NES ROM image to use this emulator. Please go google and find some NES ROM image. Since this emulator is a study purpose application, ONLY mapper 0 ROM is supported. Please be careful.

Play:

After extracting (or source building) the package, type following command.
# cd motonesemu-0.9.0/bin
# ./nesemu path-to-nes-image.nes

Then two windows will open. One is VGA display window and the other is NES joypad window. In order to play the game, your joypad input will be emulated from the keyboard input. Think of your keyboard as the large joypad controller. The left hand cross key is mapped following key entry.

Left buttun: S or A key
Up button: Q, W, E or R key
Right button: D or F key
Down button: Z, X, C, V or B key
The right hand button is mapped following key entry as well.
Select button: Tab key
Start button: Enter key
A button: : or ] key
B button: L or ; key
You must set the window focus on the joypad window when you input the above key entry.

Terminate:

To terminate the emulation, press ctrl-C on the shell (not on the joypad window!).

Description:

There are two binary executable, and one shell script and one jpeg image file are enclosed in the package. The binary executable files are motonesemu and vgadisp. Motonesemu is the emulator itself, and vgadisp is the VGA console application. shell script, nesemu is application integration utility script.
Imagine you play the real NES. You turn on the TV, and set the TV channel to the specific channel that NES is set to. Then turn on the NES. You grip the joypad controller and start playing the game. The VGA window is the TV. NES is the motonesemu executable. The joypad controller is the joypad window. For your convenience, all of the above process to start game is automated by the shell script. So, in order to press "start button", you will need to grab the joypad controller and press the button. The grab action is emulated by setting the controller window active (focused). Then pressing start button is emulated by pressing enter key etc.

Expert Mode:

You can use motonesemu command instead of using nesemu script when debugging or hack or whatever if you wanted. Nesemu script is a simpleautomated game playing script. It simply start vgadisp application and start motonesemu. Then clean up the application resources when it's done. If you use motonesemu command directly, you must clean up the application resource by yourself. That is shared memory. After using motonesemu command, type following command to see the shared memory.
# icps
Find shared memory that either motonesemu or vgadisp created and free it with ipcrm -m command
# ipcrm -m xxxxx

motonesemu command has debug option. Try using motonesemu with "-d" option. The emulator stops at the very first instruction after reset. You will see the following output from the emulator console.
# ./motonesemu -d xxxx.nes
motonesemu start...
joypad key entry:
select button: <Tab>
start button: <Enter>
up key: Q, W, E, R
down key: Z, X, C, V, B
left key: A, S
right key: D, F
A button: <:>, <]>
B button: L, <;>
cpu clock started.
c033: 78 SEI
motonesemu:

Enter "h" (help) command on the emulator debug console.
motonesemu: h
unknown command [h].
command:
s: step
c: continue
b addr: set break point
(break point can be set only 1 address.)
del: delete break point
m addr size: memory dump
show: show registers
pshow: show ppu registers
v addr size: vram dump
da addr size: disassemble
d1 on/off: debug log level 1 (dump instruction on execution)
d2 on/off: debug log level 2 (dump reg status for each instruction)
d3 on/off: debug log level 3 (dump load/store data value)
d4 on/off: debug log level 4 (dump vram data write)
q: quit emulator

The above command is supported by the emulator debug mode. You can try and see the NES ROM image internal.