Author Topic: Debugging home-made DK/Pac-Man arcade ROMs?  (Read 4940 times)

Offline chupo_cro

  • New Member
  • *
  • Posts: 6
  • Karma: +0/-0
Debugging home-made DK/Pac-Man arcade ROMs?
« on: June 26, 2017, 03:28:08 PM »
Hi all,

my first post here.

For quite a long time I've had an idea of making a game that would run on an original arcade hardware and I hope someone here would know how to solve at least some of the problems. There are 2 groups of main problems when I am thinking on how to create the code and produce the files.

#1
Assuming I already did produce ROM files for targeted arcade machine (e.g. Donkey Kong hardware or Pac-Man hardware), is there a way to somehow bypass the ROM files hash check against the database of working ROMs so FB Alpha could run my own ROMs? It would be impossible to develop the game if I'd have to recompile FB Alpha everytime I make some changes to the game code - just to update the database with the new checksums.

#2
Since I am better with Z80 than 6502 I searched for dissasembled ROMs of arcade games based on Z80 CPU and I found fully disassembled and commented Donkey Kong and Pac-Man/Ms. Pac-Man ROMs from which I could easily decipher how to use the additional hardware used in those machines to make my own games. I could then use z88dk or some other crosscompiler to produce the code but the question is - how would I then produce the ROM files? Is there some tool for producing the ROM files targeting Donkey Kong or Pac-Man hardware, using raw .hex files as an input? Or is there some other convenient way of 'putting the code into the ROM files'?

I am BTW very interested in dissasembled source code of any arcade game (especially Scramble) regardless of the main CPU and would appreciate any information or link. I could, of course, run disassembler and produce the code from any ROM file but it would take months (if not years) to decipher all hardware ports and memory maps.
« Last Edit: July 03, 2017, 09:28:05 PM by chupo_cro »
Chupo_cro

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: Debugging home-made DK/Pac-Man arcade ROMs?
« Reply #1 on: June 26, 2017, 05:33:00 PM »
Hi, for the first question: you could set up your game to mimic a clone of an already existing game, for example if you're doing something based on Pac Man, you could use one of the many pacman clones using its romset names.  When you launch the game it will complain the crc's do not match, but it will still go on to emulate the game.  When your game is complete and ready to be released we could then add an entry for the game.   (if you wish)

best regards,
- dink

Offline chupo_cro

  • New Member
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Debugging home-made DK/Pac-Man arcade ROMs?
« Reply #2 on: June 26, 2017, 05:55:32 PM »
Hi,

what you described sounds great!! :-) That solves #1 completely, thank you very much for the reply!!

Best Regards,
Chupo_cro

Offline jan_klaassen

  • FBNeo Dev
  • ******
  • Posts: 315
  • Karma: +10/-0
Re: Debugging home-made DK/Pac-Man arcade ROMs?
« Reply #3 on: June 26, 2017, 06:51:29 PM »
You can create a romset in e.g. the pacman driver and use existing graphics or whatever by making yours a clone.
  • IIRC, to avoid fba complaining about crc's, set them to 0 in the rom definitions. Make sure the name and size match though.
  • FBA wants plain binary data in a zip file. It's probably easiest to let your toolchain spit out binary files, and then use a little shell/python/whatever script to put them in the zip file.
If you're willing to do some work, fba's debugger can probably be made to deal with more than just 68K disassembly without too much hassle (real debugging will be harder). I'm integrating the one from my builds now, which has some extra functionality (e.g. disassemble to a file) so yell if you want the source for that, or just wait a bit.

Or look at MAME.

Offline chupo_cro

  • New Member
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Debugging home-made DK/Pac-Man arcade ROMs?
« Reply #4 on: June 26, 2017, 10:18:04 PM »
Thank you very much for the info!

I have in the meantime found some more Pac-Man hardware resources that look promising:

http://umlautllama.com/projects/pacdocs/

https://code.google.com/archive/p/bleu-romtools/

These might be a good starting point.

I am looking forward for your enhanced debugger.
Chupo_cro

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: Debugging home-made DK/Pac-Man arcade ROMs?
« Reply #5 on: June 26, 2017, 11:54:36 PM »
Nothing beats MAME's debugger, I think it's your best bet for debug-related things :)

Offline chupo_cro

  • New Member
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Debugging home-made DK/Pac-Man arcade ROMs?
« Reply #6 on: June 28, 2017, 10:22:16 PM »
I've made some progress. I've set up a toolchain using SjASMPlus so I can compile the test code and produce pacman.6e ROM file for pacman.zip ROM set in seconds.

I can run the code with FB Alpha using pacman.zip file name and I can debug the code using MAME debugger.

MAME doesn't allow running the ROMs with bad checksums from the launcher but it does allow to run them from command line (with or without -debug switch).

I did some code to initialize the stack pointer and interrupts and to fill the video and color RAM while resetting the watchdog timer and the code works as expected but I still have to make something to show on the screen.

I disassembled pacman.zip (Midway hardware) and puckmanb.zip (bootleg on Namco hardware), interestingly Pac-Man on Namco hardware is using IM 2 and does not check the ROM checksum while Pac-Man on Namco hardware is using IM 1 and does check the ROMs.

I tried to run hello world for Pac-Man hardware from pacdocs website but there was only a black screen. There is a note: 'You may have to flip the service switch for this to start.', but pressing 'service mode' didn't make any changes :-/

However, I think I will upon some more research be able to make a working ROM set for Pac-Man hardware.
Chupo_cro

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: Debugging home-made DK/Pac-Man arcade ROMs?
« Reply #7 on: June 29, 2017, 12:03:53 AM »
Sounds like a good start at least :)  Don't give up - you'll get it!

best regards,
- dink

Offline chupo_cro

  • New Member
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Debugging home-made DK/Pac-Man arcade ROMs?
« Reply #8 on: June 30, 2017, 11:42:10 AM »
Thank you very much :-)

I've made a routine to show text string on the screen, here is the source code in case anyone would be interested.

I would still prefer to use Scramble hardware (because Pac-Man HW doesn't support background scroll) but couldn't find any documentation. I thought it would be easier to find the Scramble documentation because i read:

Quote
Apparently, Scramble's board was especially easy to re-use; several games were hacked to play on it. A long-running joke with MAME enthusiasts is that anything can be run on Scramble hardware - N64 games, your toaster, your automatic garage door, etc. :?) (Ironically, Scramble itself was hacked to play on Galaxian hardware!)

on MAME FAQ pages :-/ But the only Scramble HW docs I could find were not even nearly as detailed as the docs I found for Pac-Man HW.
Chupo_cro