Shop OBEX P1 Docs P2 Docs Learn Events
PacMan Hardware Emulator — Parallax Forums

PacMan Hardware Emulator

BaggersBaggers Posts: 3,019
edited 2012-12-06 09:53 in Propeller 1
Some of you may, or may not know, but since I have been back on the prop in the last two weeks, or so, of spare time, I have been working on doing a PacMan hardware emulator.

I have the display emulated, on a separate prop, as it was proving too much memory for one prop, as the graphics has 4K of background characters, and 4K of sprites, and 2K of screen ram, + 32bytes of sprite info, this is all working on a separate prop, to free up space.
I have however run out of room on the second prop, as it was taken up by 16K of code ROM + 2K of screen ram ( incase it needs to read it ) + 1K of ram + the QZ80 emulator which eats a big chunk.

I was going to do it initially on my dracblade, but on getting it out the drawer, I accidentally bent what I think was a regulator, as it went under the cupboard, and thus I don't know which piece it was.
Coley is popping around on Monday to look at fixing it for me, so I'll move it over to that.
So I was doing it on two proto-boards with pins 0-15 wired together for coms, but unfortunately ran out of ram space once getting the roms and z80 emu started and getting the system variables in.

Once my Dracblade is working again I'll continue with it, and post vids, demos, and source.

Also, this will probably be the first thing I convert for PropII when it's out.

Comments

  • doggiedocdoggiedoc Posts: 2,243
    edited 2012-12-01 14:33
    Sounds very cool. I will enjoy following your progress!

    Paul
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-12-01 15:24
    I was going to do it initially on my dracblade, but on getting it out the drawer, I accidentally bent what I think was a regulator, as it went under the cupboard, and thus I don't know which piece it was.

    Oh no!

    Well, it probably was the 5 pin 5V regulator as that is the component that sticks up the most. So if you can't find it, you could replace that with any old 7805 regulator. I don't know which board version you have but some of them had spare pads for other regulators.
  • BaggersBaggers Posts: 3,019
    edited 2012-12-01 15:35
    Thanks doggiedoc :)

    Dr_Acula, Yes, it's a 5pin one, so it'll be the voltage regulator. The board has Propeller Zicog V2 on it, if that's any help :D
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-12-01 18:11
    I'm at work so can't look up the board. But in general terms, if you remove that 5 pin 5V regulator and just leave all the other components as they are, you can probably jury rig a 7805 somewhere on the board. Input from the DC connector to the 7805, and gnd and output to anywhere on the board you can find a spare pad that is 5V. If the pads for the 5 pin regulator have not been damaged you could use those pads. Looking at the schematic for the LM2575 Input is pin 1. Gnd is pin 3. And the 5V output goes out of pin 2 and goes through the inductor, and that won't matter here. So it would be a 7805 with two of its legs crossed.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2012-12-02 03:52
    Baggers wrote: »
    Some of you may, or may not know, but since I have been back on the prop in the last two weeks, or so, of spare time, I have been working on doing a PacMan hardware emulator.

    I have the display emulated, on a separate prop, as it was proving too much memory for one prop, as the graphics has 4K of background characters, and 4K of sprites, and 2K of screen ram, + 32bytes of sprite info, this is all working on a separate prop, to free up space.
    I have however run out of room on the second prop, as it was taken up by 16K of code ROM + 2K of screen ram ( incase it needs to read it ) + 1K of ram + the QZ80 emulator which eats a big chunk.

    I was going to do it initially on my dracblade, but on getting it out the drawer, I accidentally bent what I think was a regulator, as it went under the cupboard, and thus I don't know which piece it was.
    Coley is popping around on Monday to look at fixing it for me, so I'll move it over to that.
    So I was doing it on two proto-boards with pins 0-15 wired together for coms, but unfortunately ran out of ram space once getting the roms and z80 emu started and getting the system variables in.

    Once my Dracblade is working again I'll continue with it, and post vids, demos, and source.

    Also, this will probably be the first thing I convert for PropII when it's out.

    As a curious young man, I would love to know how those old video game arcades work. They don't have much memory to spare back then, and only stuck with a Z80, but it works wonders! Now we have the graphic cards which squeezes out billions of numbers together per second, and huge pool of memory.

    I just bumped into a list of arcade manuals and you can guess a bit more of how it works. It's not reverse-engineering, but on understanding how these work. Here's the link: http://www.mikesarcade.com/arcade/manuals.html Find the "Pac Man" and you will get the manual.

    I love to see the results of the work. I wanna build one myself too in the future. :)
  • doggiedocdoggiedoc Posts: 2,243
    edited 2012-12-02 04:56
    Nice link John - I just spent a while perusing the Battlezone manual and schematics! Really cool! I think Battlezone was my favorite arcade game in the 80s. That really takes me back. I looked at the PacMan manual too. I could get lost for hours in those.
  • ColeyColey Posts: 1,110
    edited 2012-12-03 00:29
    Dr_Acula wrote: »
    I'm at work so can't look up the board. But in general terms, if you remove that 5 pin 5V regulator and just leave all the other components as they are, you can probably jury rig a 7805 somewhere on the board. Input from the DC connector to the 7805, and gnd and output to anywhere on the board you can find a spare pad that is 5V. If the pads for the 5 pin regulator have not been damaged you could use those pads. Looking at the schematic for the LM2575 Input is pin 1. Gnd is pin 3. And the 5V output goes out of pin 2 and goes through the inductor, and that won't matter here. So it would be a 7805 with two of its legs crossed.

    Hey Drac,

    Have you got a schematic of the dracblade available, if so can you post a link please.

    Many thanks,

    Coely
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-12-03 00:35
    The v5 schematic is here http://smarthome.jigsy.com/files/documents/Propeller_v5.pdf

    I think this might be an earlier version, but the power supply part didn't change except for extra pads for other regulators.
  • BaggersBaggers Posts: 3,019
    edited 2012-12-03 00:55
    Thanks John for the link, so others can use it, I already had that, as I have a PacMan board, as I recently wrote Manic Miner to run on PacMan hardware :D ( I called it PacManicMinerMan, as in ManicMiner inside PacMan ) the reason I wrote it, is because during the late eighties early nineties, I converted a couple of arcade games, to the home computers for Ocean, and I had always wanted to make an arcade game, even since before then, but didn't know anywhere in the UK that I could, as there was no google back then lol :) Anyway, I accidentally came across the PacMan memory map, and thought to myself, I just have to try it, and wrote a quick hello world program, and then when it worked, picked a game, and Manic Miner was simple enough a game to work with the hardware spec, I just had to compress a 48K game into 16K :)
  • Heater.Heater. Posts: 21,230
    edited 2012-12-03 02:13
    Baggers,

    Are you the first to practice the art of inverse retro. Taking a game and porting to hardware that is older than he game?

    This could start a whole new trend.
  • Mark_TMark_T Posts: 1,981
    edited 2012-12-03 06:44
    That makes a change from porting everything to MineCraft.
  • BaggersBaggers Posts: 3,019
    edited 2012-12-03 12:24
    Heater. wrote: »
    Baggers,

    Are you the first to practice the art of inverse retro. Taking a game and porting to hardware that is older than he game?

    This could start a whole new trend.

    I have no idea Heater, quite possibly so :)

    Would be nice to start a whole new trend!
  • BaggersBaggers Posts: 3,019
    edited 2012-12-03 12:26
    Dr_Acula, the board is a Zicog V2 board, not a dracblade, according to Coley.
    Do you have the schematic for that?

    Cheers,
    Jim.
  • Heater.Heater. Posts: 21,230
    edited 2012-12-03 12:31
    Baggers,

    ..the board is a Zicog V2 board..

    Interesting, as far as I know ZiCog has never made such a board.
  • BaggersBaggers Posts: 3,019
    edited 2012-12-03 14:32
    Coley has it at the moment, but I'm sure it has ZiCog written on it, just before V2, I may have mis-remembered it as it was a while after he left, that I posted that. But I'm pretty certain it said ZiCog on the board.

    I too thought it was strange, as I thought it was a Dracblade, all this time! :)
  • ColeyColey Posts: 1,110
    edited 2012-12-03 15:05
    Jim, it's fixed and I have also put a couple of pins in to socket the crystal ;-)

    It does have 'Propeller Zicog V2' on the board, having never seen a Dracblade before I guess I had nothing to compare it to....

    ZicogV2.jpg



    The only thing I haven't done is to try to program it but the 5V and 3V3 LED's are lit and the voltages are correct.

    Will pop it in the post to you tomorrow.

    Regards,

    Coley
    512 x 597 - 132K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-12-03 15:10
    Ah, yes that was one of my boards made specifically to run the amazing Zicog emulation.

    Glad to hear you have it working again.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2012-12-03 17:24
    Baggers wrote: »
    Thanks John for the link, so others can use it, I already had that, as I have a PacMan board, as I recently wrote Manic Miner to run on PacMan hardware :D ( I called it PacManicMinerMan, as in ManicMiner inside PacMan ) the reason I wrote it, is because during the late eighties early nineties, I converted a couple of arcade games, to the home computers for Ocean, and I had always wanted to make an arcade game, even since before then, but didn't know anywhere in the UK that I could, as there was no google back then lol :) Anyway, I accidentally came across the PacMan memory map, and thought to myself, I just have to try it, and wrote a quick hello world program, and then when it worked, picked a game, and Manic Miner was simple enough a game to work with the hardware spec, I just had to compress a 48K game into 16K :)

    There's no graphics chip on those old arcades and I begin to wonder did they use discrete components for all that. I saw the seperate v-sync, h-sync, R, G and B lines inside with individual ROMs and RAMs connected to these as well. They have other ROMs and RAMs for the game data.

    It's tough to understand these, but if I can get the picture, voila, I get to create my own video generator. :)
  • BaggersBaggers Posts: 3,019
    edited 2012-12-04 03:53
    Coley, cheers bud :)

    Dr_Acula, yeah, I'm glad too, great little board!

    John, yes, I think it was discrete components for it, back in the early days, the graphics ROMs in PacMan are separate to the game code ROMs, one 4K EEPROM for background tiles, and one 4K EEPROM for sprite images, and 4 x 4K EEPROMs for the game code+data.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2012-12-04 09:11
    Baggers wrote: »
    Coley, cheers bud :)

    Dr_Acula, yeah, I'm glad too, great little board!

    John, yes, I think it was discrete components for it, back in the early days, the graphics ROMs in PacMan are separate to the game code ROMs, one 4K EEPROM for background tiles, and one 4K EEPROM for sprite images, and 4 x 4K EEPROMs for the game code+data.

    Back then, there wasn't FPGA or wasn't much custom circuits - hence the discrete components on the video board.

    I tried 'dissecting' the Pacman video board for a few minutes to see that some of the graphics RAMs are indeed serial-like. It has a parallel address, but with a serial data out. I guessed the serial out leads to another batch of multiplexing circuitries and then forms a continuous burst of 256-pixels for each color channel. Pretty amazing for discrete components.

    Plus, games like that probably rely on a lot of mid-screen interrupts (when it reach 120 h-blanks) and end-screen interrupts (exactly 240 h-blanks) to the processor to 'force' the processor to calculate anything in the game, from collision detection to other stuff.

    I admit I have very limited knowledge on these, since I just glanced the schematics for like 1 hour.
  • JT CookJT Cook Posts: 487
    edited 2012-12-04 16:59
    Baggers wrote: »
    the reason I wrote it, is because during the late eighties early nineties, I converted a couple of arcade games, to the home computers for Ocean

    Not to derail the topic, but what were the arcade games you ported for Ocean and what computers were they for?
  • BaggersBaggers Posts: 3,019
    edited 2012-12-05 02:32
    JT Cook wrote: »
    Not to derail the topic, but what were the arcade games you ported for Ocean and what computers were they for?

    Hi JT Cook,
    They were Cabal and Midnight Resistance, for the ZX Spectrum ( 48K and 128K tape and disk ) and Amstrad CPC range ( 64K and 128K tape and disk ).
  • Ahle2Ahle2 Posts: 1,179
    edited 2012-12-06 06:32
    Baggers wrote: »
    They were Cabal and Midnight Resistance, for the ZX Spectrum ( 48K and 128K tape and disk ) and Amstrad CPC range ( 64K and 128K tape and disk ).
    Love both games, but on the Amiga and C64 of course. ;)

    Ocean did a bland job (technically) on porting games to the Amiga though. The only quality (technically speaking) Ocean games from the pre SNES era was Pang and Toki.
    Btw, It's amazing that the Amiga (a computer from 1985) actually outperforms a SNES (a gaming consol from 1990) in some areas when it comes to games.
  • BaggersBaggers Posts: 3,019
    edited 2012-12-06 09:53
    Ahle2 wrote: »
    Love both games, but on the Amiga and C64 of course. ;)

    Of course :D as you have a 6581 as your Avatar, you would be slightly biased towards Commodore versions :D
    Ahle2 wrote: »
    Ocean did a bland job (technically) on porting games to the Amiga though. The only quality (technically speaking) Ocean games from the pre SNES era was Pang and Toki.
    Btw, It's amazing that the Amiga (a computer from 1985) actually outperforms a SNES (a gaming consol from 1990) in some areas when it comes to games.
    Very true, Pang and Toki were great!
Sign In or Register to comment.