Jump to content
IGNORED

Pokey RNG


psycho

Recommended Posts

I am implementing Centipede in an FPGA and I am having a problem. I have looked for the exact RNG algo. for 2 days now but I can't find it. It would seem that when Centipede runs, if the RNG does not produce proper results, it resets. I get the thing to go into attract mode sometimes but not very often. I am pulling my hair out. Also, it seems as though the color ram is based off the RNG???

 

This is a learning exorcise. I have never worked with a 6502 or anything Atari before. But, I think once I get this problem straitened out, I should be on my way.

 

Anyone have the *exact* RNG algo?

 

Thanks,

psycho

Link to comment
Share on other sites

The random number generator in the Pokey is actually driven off the polynomial counters that are used to add noise to the sound. You can take a look a the source code for the MAME emulator, I am pretty sure the algorithm it uses is accurate. You can find the source here http://mamedev.org/source/src/emu/sound/index.html in the Pokey.c file.

 

Dan

Link to comment
Share on other sites

I find it kinda weird that the game would rely on a certain sequence of random numbers to be produced.

 

The sequence occurs AFAIK, at whatever clock speed Pokey is running at, so in most applications (paired with 6502s), it's very hard to read the same sequence twice, if you consider the usual fact that stuff like screen DMA, interrupts and refresh steals are occurring.

 

But, you might also consider the fact that maybe they have some sort of clever self-test that verifies the Pokey is OK by checking some random numbers, or (long-shot) maybe they verify that a genuine Pokey is in use as a measure to prevent bootleggers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...