Replay - the Classics ===================== Version: 0.03 Date: May 7, 1997 By: Kevin Brisley Important: -=-=-=-=-= ** Do not ask me for ROMs or where you can get them. You will be ignored. ** This progam is not to be distributed on CDROM without my explicit permission. ** This program must only be redistributed in it's original archive. It must not be distributed with any ROM images included! ------------------------------------------------------------------------------- Contents: 1.0 Introduction 2.0 .KEG Files 3.0 Installation 3.1 DOS 3.2 UNIX 4.0 Usage 5.0 Troubleshooting 6.0 Included .KEGs 6.1 Amidar & Amidar (Japanese) 6.2 Bagman 6.3 Burgertime & Burgertime (Data East) 6.4 Centipede 6.5 Crush Roller 6.6 Donkey Kong 6.7 Donkey Kong 3 6.8 Donkey Kong Jr. 6.9 Mario Bros. 6.10 Millipede 6.11 PacMan, Ms. Pac Man & Variants (excluding Super PacMan) 6.12 Pengo & Penta 6.13 Pooyan 6.14 Super PacMan 6.15 Time Pilot 6.16 Turtles 7.0 Contacting the Author: 8.0 Thank You's 9.0 Copyright Notices ------------------------------------------------------------------------------- 1.0 Introduction: -=-=-=-=-=-=-=-=- Once again, after a lengthy period, I finally managed to get a new version of 'Replay' out. This is the third publically available version. The same three processor emulations are included in this release (Z80, 6502 and 6809) but in addition, there are ASM cores for all three processors in the DOS version to hopefully give a speed boost. That means that there are now 6 emulation cores compiled into the executable (one of the reasons for its size :-). The other big change is a new expression parser for values in the graphics layer section of the .KEG files. Originally, I had just hacked in the ability to specify a value or a memory location with one bit operation and an offset allowed on it. This was very limiting and prevented me from implementing a lot of games. I've torn this out and replaced it with a lex&yacc analyser/parser which allows for complete flexibility and complex expressions. The only downside is a performance hit which is only noticable with really complex expressions. The thinking behind Replay is that most of the classic arcade games have numerous similarities. In these games, you'll find one ore more Z80, 6502 or 6809 CPU, some sort of character based playfield, usually some sprites, some memory mapped I/O, etc. Replay attempts to take advantage of this fact. Each game that Replay runs is specified by a resource file. This resource file describes the game, where the ROMs go, what the screen resolution is, where the video RAM is located, etc. Replay then reads this resource file and uses it's generic routines to create the emulation. My hope is that people will be able to add games to Replay simply by creating a resource file (.KEG) for it. There are still some limitations with this version: 1) No sound. 2) Not all games are glitch-free. Future versions will offer more support. ------------------------------------------------------------------------------- 2.0 .KEG Files: -=-=-=-=-=-=-=- The .KEG files are specified in a simple 'language' that basically consists of a bunch of label/value pairs. If you are familiar with X-resource files in X-Windows, you'll probably recognize the style of the .KEG files. However, the are not true X type resources as there is no pattern matching. I probably should have used lex&yacc to create a real specification language, but this was easier to implement for a first run at it and lex&yacc is now used for for values in the graphics layers to provide flexibility. The format for the .KEG files is starting to settle down be may still change in the future, so keep that it mind if you attempt to write one. I still haven't got around to creating a document detailing how to write a .KEG file (it's been too much fun working on the emulator). Hopefully I'll find some time in the near future. In the mean time, send me e-mail if you want to know anything, I'd be glad to give you a hand. ------------------------------------------------------------------------------- 3.0 Installation: -=-=-=-=-=-=-=-=- 3.1 DOS: -------- 1) Create a directory for replay (e.g. md c:\replay). 2) Change to the replay directory (.e.g cd c:\replay). 3) Unzip replay.zip (with -d if you are using pkunzip) (e.g. pkunzip -d c:\temp\replay.zip). 4) Place the ROMs for the games in the directories under the replay directory. (e.g. cd c:\temp\replay\btime ; pkunzip c:\temp\btimerom.zip). 3.2 Unix: --------- 1) Use gzip to uncompress the file (e.g. gzip -d replay.tgz). 2) Untar the file (e.g. tar xvf replay.tar). 3) Place the ROMs for the games in the directories under the replay directory. (e.g. cd replay/btime ; tar xvf /tmp/btimerom.tar). ------------------------------------------------------------------------------- 4.0 Usage: -=-=-=-=-= $ replay where the are: -game : run the specified game directly, bypassing all menus. valid s can be found in replay.nfo as the 'ID:' field. -info : specify an alternate info file (default is ./replay.nfo). -frameskip : skip this many frames each time around. If you're desparate for performance, give this a try. -vesa : (DOS only) force the use of 640x480 Vesa mode. -nojoy : (DOS only) disable joystick. -altvid : (DOS only) use the alternate funky tweaked mode with distinctly visible scan lines. Use the arrow keys and 'Enter' to navigate through the menus. 'Esc' to return to the previous menu. The following keys are used internally by Replay while playing a game: ESC - Return to game menu. F1 - Save the game \ Saving and loading are currently broken. I may F2 - Load the game. / fix this in the future. F3 - Reset the game. F10 - Toggle speed throttling on/off. ------------------------------------------------------------------------------- 5.0 Troubleshooting: -=-=-=-=-=-=-=-=-=-= "It's too fast" Cool, I wish I had that problem. Make sure speed throttling is on (try tapping F10). "It's too slow" Try the -frameskip command line option. "It doesn't seem to work under Win95" Allegro timers used to cause a problem but they're gone now and Replay should run under Win95. Let me know if you have problems. "I can't get the joystick to work under Linux" That's because there's only joystick support in DOS. "It doesn't work on my computer" Well, I've only tested it on mine where it works. You'll have to mail me the details. ------------------------------------------------------------------------------- 6.0 Included KEGs -=-=-=-=-=-=-=-=- 26 KEGs are included in this version. The supported games are: Amidar, Amidar (Japanese), Bagman, Burgertime, Burgertime (Data East), Centipede, Crush Roller, Donkey Kong, Donkey Kong 3, Donkey Kong Jr., Hangly Man, Mario Bros., Millipede, Ms. Pac Man, Pac Man, Pac Man (Namco), Pac Man 4X, Pac Man H, Pac Man Plus, Pengo, Penta, Pooyan, Puck Man, Super Pac Man, Time Pilot and Turtles. All Keys mentioned below are configurable from the associated .KEG file. 6.1 Amidar & Amidar (Japanese) ------------------------------ 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Jump. - No know issues. 6.2 Bagman ---------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Jump. - No know issues. 6.3 Burgertime & Burgertime (Data East) --------------------------------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin into slot 1. 4 - Insert coin into slot 2. arrows - Chef movement. space - Pepper. - The first game supported by Replay and the first 6502 game supported. - Some sprite glitches that don't affect play. I took way longer than I had hoped to get this game working, mainly because the ROMs are encrypted. Although not encrypted enough to make it immediately obvious. After you get going though you start to realize that something isn't quite right. Basically, the encrypting involves only the opcodes (not the data) and only at certain locations in the code. Here is what I've figured out so far, if anyone can figure the last bit out, I will be eternally grateful! Please let me know if you have any ideas. Here's the deal...only the opcodes are encrypted and only some of them are encrypted. To decrypt an opcode, the following bit shuffle is used (assuming bits are numbered in the following manner: 7654321): 0 -> 0 1 -> 1 2 -> 3 3 -> 5 4 -> 4 5 -> 6 6 -> 7 7 -> 2 So for example, a PHP opcode ($08, 00001000) would be decrypted to a JSR $____ opcode ($20, 00100000). Now the other piece of the puzzle is when to do the decryption. I have determined that the only time a decryption occurs is if the address the opcode appears at an address with bits 2 and 8 set (i.e. xxxxxxx1xxxxx1xx). Unfortunately, not all addresses of that form have encrypted opcodes on them. So I need to find out what determines whether or not an opcode on such an address is encrypted. I will place a couple of files on my web site that list all of the addresses of the above type that I've found that have encrypted opcodes on them and all of the addresses that don't. 6.4 Centipede ------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Fire. - You always start with 18 credits. 6.5 Crush Roller ---------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. - Characters move over overlapping roads when they should go under. - I think the crushed enemies are wrong. 6.6 Donkey Kong --------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Jump. - No known issues. 6.7 Donkey Kong 3 ----------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Fire. - Colour totally wrong. - Character set of title screen and high scores wrong. 6.8 Donkey Kong Jr ------------------ 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Jump. - No know issues. 6.9 Mario Bros. --------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Player 1 Movement. space - Player 1 Jump. ijkl - Player 2 Movement. a - Player 2 Jump. - Colour totally wrong. - Character set of title screen and high scores wrong. - Sprite folding problem with title screen. 6.10 Millipede -------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Fire. - Unix version doesn't handle TNT explosions properly. 6.11 PacMan, Ms. Pac Man & Variants (excluding Super PacMan) ------------------------------------------------------------ 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - PacMan movement. - The first Z80 game supported. - The high-score and credit text is missing. 6.12 Pengo & Penta ------------------ 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Pengo movement. space - Push. - The sunset, iceberg scene isn't right. 6.13 Pooyan ----------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Fire. - No known issues. 6.14 Super PacMan ----------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Super PacMan movement. space - Super PacMan speed. - The first 6809 game supported. - Not sure if the colours are correct? - Some of the sprites in the intermissions aren't quite right. - Coin-up not working quite correctly. - After entering a high score, the game stops. You can reset (F3) to continue on. 6.15 Time Pilot --------------- 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. space - Fire. - No known issues. 6.16 Turtles ------------ 1 - Start 1 player game. 2 - Start 2 player game. 3 - Insert coin. arrows - Movement. - No known issues. ------------------------------------------------------------------------------- 7.0 Contacting the Author: -=-=-=-=-=-=-=-=-=-=-=-=-= Please feel free to let me know of any bugs you find, or suggestions you have for improving the emulator. You can e-mail me and I'm also subscribed to the MUL8R mailing list. Name: Kevin Brisley e-mail: kevin@isgtec.com www: http://www.geocities.com/SiliconValley/Pines/4454 ------------------------------------------------------------------------------- 8.0 Thank You's -=-=-=-=-=-=-=- Sergio Munoz for initially pointing me in the right direction. Michael M. Morrison for sharing what he knew about Burgertime. Marat Fayzullin for his portable 6502 emulation package which I referenced while writing mine. Marcel de Kogel for his Z80 emulation package used in all versions. Neil Bradley for his M6502 emulation core which is used in the DOS version. Ishmair for his MAZE Z80 emulation core which is used in the DOS version. John Manfreda for his ASM 6809 emulation core which is used in the DOS version. Nicola Salmoria whose Mame emulator provided the tweaked VGA modes I use and whose generic graphics routines where the inspiration for the generic routines in Replay. Nicola and the other Mame contributors for information used to construct some of the included .KEG files. John Butler for information on Super-Pac's big sprites. Tom Chesser & Paul Thorn for their help on the finer points of schematic reading. ------------------------------------------------------------------------------- 9.0 Copyright Notices -=-=-=-=-=-=-=-=-=-=-= Replay Multi-Game Arcade Emulator Copyright(c) 1997 Kevin Brisley Version 0.03 Multi-6502 Emulation Engine Copyright(c) 1997 Neil Bradley Version 0.2 6809.obj Copyright(c) 1997 John Manfreda Version 5/1/97 MAZE Copyright(c) 1997 Ishmair Version 0.24 Z80Em Portable Zilog Z80 Emulator Copyright(c) 1996,1997 Marcel de Kogel Version 1.1