GNW64 - Game & Watch Emulator for the C64
Disclaimer
This project is in an early stage and should be considered a proof of concept.
Intro
There are a lot of Game & Watch (GNW) Games ported to the C64, but all of them are ports, trying to mimic the original behaviour more or less precise. The GNW64 on the other hand, emulates the CPU of the early Game & Watch Games to give a closer experience to the original (see bugs).
Features
-
Emulation of the Sharp S5A-CPU
-
Plays unmodified, original ROM-Files (taken from MAME)
-
Uses custom display routines tailored to each game
-
Support for SuperCPU, C128 2 MHz mode and U64 Turbo mode
-
Supported Games so far:
-
Ball (ac-01)
-
Vermin (mt-03)
-
Fire (rc-04)
-
Helmet (cn-07)
Implementation
Most of the emulatio…
GNW64 - Game & Watch Emulator for the C64
Disclaimer
This project is in an early stage and should be considered a proof of concept.
Intro
There are a lot of Game & Watch (GNW) Games ported to the C64, but all of them are ports, trying to mimic the original behaviour more or less precise. The GNW64 on the other hand, emulates the CPU of the early Game & Watch Games to give a closer experience to the original (see bugs).
Features
-
Emulation of the Sharp S5A-CPU
-
Plays unmodified, original ROM-Files (taken from MAME)
-
Uses custom display routines tailored to each game
-
Support for SuperCPU, C128 2 MHz mode and U64 Turbo mode
-
Supported Games so far:
-
Ball (ac-01)
-
Vermin (mt-03)
-
Fire (rc-04)
-
Helmet (cn-07)
Implementation
Most of the emulation is adapted from MAME, and follows a classic emulator design: the ROM is loaded into memory, opcodes are decoded, and instructions are executed.
After a frame’s worth of cycles has been processed, a display routine is called to show or hide objects based on values stored in RAM. Each ROM uses its own display routine. The watch and score are rendered using sprites, while the remaining elements are shown or hidden by modifying screen RAM colours. The game itself is a hires bitmap.
Several optimisations have been applied. For example, the shift registers originally used to drive the LCD are not emulated. Instead, the required information is read directly from the emulated RAM. This improves performance but introduces some limitations (see below).
Limitations
Speed
While the SM5A is only clocked at 16kHz, the emulation reaches only 1/3 of the speed on a stock C64. The Sharp CPU is quite strange and includes many opcodes which are not easily ported to the 6502. There is also some kind of IRQ/HALT which needs to be taken care of.
Full-speed emulation is available on SuperCPU and Ultimate 64 Turbo (Set Turbo Control to U64 Turbo Registers). On a C128 (in C64 mode), the emulator runs at approximately 66% speed.
Display
Because each Game & Watch title uses different LCD wiring, a dedicated display routine is required per game. Each ROM set therefore includes a display routine that is loaded into a fixed memory location and called by the emulator. This requires manual work for every supported game.
Since the LCD-Circutry, and especially the 7-segment-displays, are not emulated and required values are just read from RAM, some functionality cannot be implemented. F.ex., the alarm-clock in Helmet cannot be displayed correctly using this technique (afaifo).
Audio
Not yet implemented.
Input
Currently, only one layout is supported:
- Start/Select (Joystick Fire)
- Game A (Joystick Down)
- Game B (Joystick Up)
- Move Player/Set Time (Joystick Left/Right)
Known Bugs
The emulation of the DIV-Timer is not accurate. This causes the RNG to fail, causing differences in gameplay compared to the original (f.ex. in BALL the game does not speed up as it should, in FIRE, the jumpers are spawn too regularely, in HELMET the door is closed too often etc.).
The segments flicker - in the originals the LCD reacts too slow to notice.
In VERMIN during game-play, the watch is still displayed instead of the score.
Questions?
E-Mail Sabbi at d@c64.ch