janE 6502 - Just ANother Emulator or one of the best, smallest?

Home of

janE 6502


janE 6502 is an emulator program which is able to interpret programs written for 6502-like microprocessors on a PC-based host system. It offers a very high degree of formalization and can be used for very thin and hopefully reliable applications, whenever old or vintage pieces of software shall be re-used. It is following a unique approach: it makes extensive use of the inherent numerical order contained in the instruction set itself, rather trying to compute as much as possible out of these given informations than simply gathering a bunch of sub-programs for every single instruction encountered. Thus it is possible to cover multiple machine instructions often in just 1 single line of pascal code. Possibly this could be useful for efficient hardware implementations or 'homebrew' computers.

requirements

The emulator source has been successfully compiled under Delphi Professional Version 4.(operating system: Win2k professional). Since it makes use of fundamental language statements only, a port to another Pascal dialect should be possible.

download

Source code: janE6502b_source.zip zipped file size: a whopping of 3100 Bytes. The source code is a bit compressed, but the advantage is, you can overlook it at a glance without flipping pages, print it onto a single sheet and take it with you in the pocket wherever you want ;-)

With janE 6502, incredibly small yet powerful emulators of 6502-based systems can be built. As an example, a C64-like system follows:
  • Executable file: c164j.zip zipped file size: 7,9 KB
Important:
  • You will need two files, "BASIC" and "KERNAL" in the same directory. The files are not included in the above package.
  • It would be a good idea also to install an appropriate font, e.g. CBM.TTF created by Christan Vogelgsang. (as contained in VICE package, while VICE not necessarily makes use of it).
Further reading ...(below )...

Page under construction, Date: 26.7.2010
..... to be completed ... ;-)

C164j - Whats this


C164j is a basic c64 emulator in less than 10 kilobytes. Its source code fits on a single page of ordinary paper. It uses the JANE6502 emulator core which offers high accuracy and reliability while being of extremely small size, and is entirely written in pascal programming language. The C164j is one of the most compact emulator systems, as opposed to most of current vintage computer emulators which range from several hundred up to 1000 kilobytes in size.

system requirements

The emulator program has been successfully tested on an AMD Sempron system with 1.6 Ghz (operating system: Win2k professional).It has also been tested on an old AM 486 PC clocked 133 Mhz under Windows 95. Here the emulator already used up 60% of all CPU resources while running in an idle loop(cursor flashing, waiting for keyboard input). It lost some characters while scrolling the screen contents or executing a Basic program. As a conclusion, the emulator should be running good and come close to the original speed on any PC clocked at 400 Mhz or above, but no liability can be taken for this.

download

Executable file: c164j.zip zipped file size: 7,9 KB
Source code: c164j_JANE6502_sources.zip zipped file size: 7.65 KB.

how to install

No special installation procedure provided. Simply put the file into an empty directory, unzip it and start it from there. Important: On startup, the C164j.exe file expects two firmware files also to be present in the same directory as C164j. They are called BASIC and KERNAL (without any file extensions) and should be of exact size 8192 bytes each. I kept those files out of the distributed package in order to keep it really slim :-)

keys

alt+space+'L' Load disk file
alt+space+'A' sAve disk file
Alt+F4 exit program 1
Ctrl "C=" key
ESC STOP
1 On some systems this may not work. Use mouse instead, or call system menu by alt+space and choose "Close" then.

auto-warp mode:

The program is a two-threaded application. Thanks to the smart recognition of branch loops in JANE6502, the worker thread is able to detect idle states and return its time slice to the operating system whenever possible. During calculations, the program draws all CPU resources it can get. Whenever the emulated BASIC program waits for user input, the non-emulated c164j falls into an idle state. To the program itself, this appears to be completely transparent. After finished with calculation, the power saving mode gets active again, saving your power supply or batteries.

Video raster counter register:

JANE6502 offers an internal cycle counter,which serves here as a basis for an experimental kind of VIC raster counter register ($D012). This is in part a demo or merely an experimental feature, because the emulator concentrates on the central processing unit and leaves most peripherals outside. Nevertheless, the emulated raster counter is working. It increments every 64 (emulated) µ-seconds and it is also partially responsible for the quite 'naturalistic' delay when starting up the engine because the kernal relies on it to count up to a certain value. Just try:
PRINT PEEK(53266)
and you'll get every time some other number out of the range {0..255}.

Speed:

µP Speed
compared to real 6502 /C64
Am486 133 Mhz 25%
Pentium Class
AMD 1600 Mhz
800 - 1000% 1

1 Speed is slowed down during screen activity (e.g. calling $FFD2 or writing to screen buffer). This allows for better reading screen contents.

known issues

Keyboard: Some keys or key combinations may lack functioning. This is by design, it could be foreseen that a better or more flexible keyboard management would not make sense since the screen would not be able to display all and every of those fine keys. (see below: "graphics capabilities") ;-) The "*" can be found on the numeric keypad, usually on the right hand side of keyboard. Pressing Ctrl+ESC or similar key combinations (esp. "accelerator keys") while the emulator window has the focus can cause to mess up the keyboard translation and you may have to restart the emulator. In order to circumvent this, just put the focus onto another window before using those key combinations. Another possibility is, to activate the system menu.
Very limited graphics capabilities, text mode only, no sound. If you wish to change colours, you probably have to change the source code. Better screen display can be accomplished by installing a CBM.TTF font (see below) into the fonts directory of your windows system. On startup, the emulator will use the characters from this font, which may result in a very naturalistic look and feel.
File operation limited: Since very little, almost no peripheral devices are emulated, LOAD and SAVE won't work as expected. The good news is, a replacement for these commands have been integrated into the system menu. However, Loading and Saving is possible in direct mode only, not while a basic program is running. Doing so could cause unpredictable results. The use of other file operations like PRINT#, INPUT#, CMD, CLOSE ... and so on should be avoided for the same reason.
System Time TI$ retarded: The internal system time of the emulated C64 is by 2% too late. This is due to the fact that the underlying windows host system isn't a real time operating system, while the C64 almost is, and the emulation simply uses windows' multimedia timer in order to drive the interrupt routine in the simulated C64. The interrupt has to take place 60 times per second, which equals to the AC frequency in the U.S.. This frequency has a time period of 1/60 sec., which gives 16.6667 ms. Unfortunately, the Multimedia Timer has a resolution of 1 ms (accuracy may be less) so the emulator creates an interrupt every 17 mS instead, hence the deviation.

helpful resources


"Whodunnit"

SJANDA is...

... is a fat opinionated computer nerd who loves vintage computers and has, beside other things, created several small utility programs.

Site is under construction, date of last modification: 25.7.2010

date of last counter reset: 25.7.2010