SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

NEStra version 0.66 of December 14, 1999

Nestra is a Nintendo Entertainment System emulator, which uses x86 assembly language optimizations and code translation to achieve fast emulation with relatively modest CPU requirements.

To compile, simply run make.

Keyboard control is as follows. Change it if you want (in x11.c):

Arrow keys - move
Space Bar - Button A

Z,X,D      - Button B
Tab        - Select
Return     - Start
Pause/Break- Reset
Escape     - Exit

Emulation speed can be adjusted by pressing the numbers 1 thru 8, with 1 being normal speed and 2 being double speed, etc. This is helpful for skipping thru boring intros and such. Pressing ` will run the emulator at half-speed. Zero makes it stop.

Emulation speed is regulated by the system clock and not the CPU speed. If the CPU is unable to draw a frame within the scheduled time, the emulator will skip frames to catch up to the correct timing.

If the game uses save memory, this data is stored in the same directory as the ROM image, unless the directory ~/.nestra exists, in which case all save files will be stored there instead. This allows different users to each have their own saved games.

On 8-bit displays, normally only the minimum number of colors are allocated. This is sufficient for most games, however if you experience color flickering, you may need to use the -s option to allocate the full color palette.

The program works as follows: The compiler translates the 6502 code to native code and executes it. The translated code then calls the input/output functions as necessary.

This was developed on Linux/x86, and users have reported that it works with FreeBSD. It should be possible to make it run on other processor types by replacing the translation table with one for your CPU (and changing the byte-order if necessary). See the comments in table.x86 for a description of the format.

The current version supports only X11 displays, and all the user interface code is contained in the file x11.c. This code provides two functions, InitDisplay() and UpdateDisplay(), which are called at startup and 60 times per second respectively. All data is passed through global variables. If you want to use a different display type, you should need only replace these two functions with ones which support your display.

Files

emu.c - main() and startup code
dynrec.c - Dynamic recompiler
io.c - Input/output register interface mapper.c - Memory mapper

x11.c     - X11 display
fb.c      - Framebuffer/pixmap display

pixels.c - Pixmap drawing code
d6502.c - 6502 disassembler
x86.S - x86 assembler code interface table.x86 - Translation table for dynamic recompiler comptbl.c - Compiles table.x86

See the file BUGS for a list of known problems.


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.