Jump to content

Photo

A quick way to check for the existence of POKEY at a specific address?

Pokey

2 replies to this topic

#1 PacManPlus OFFLINE  

PacManPlus

    River Patroller

  • 4,904 posts
  • Atari 7800 & NES Developer
  • Location:Florida

Posted Mon Jan 14, 2019 8:31 AM

A thought just occurred to me.

 

When I was putting the Pokey code into Pac-Man 320 / Ms. Pac-Man 320, there was a bug which occurred when the Pokey was not activated;  The 'Random' address would always return the same number.

 

Could this be a quick / easy way to check for the existence of a Pokey at a specific address?  I.E. read the Random address, say 5 times, and if the same value comes out all 5 times Pokey is not there.

 

Is this reliable?


Edited by PacManPlus, Mon Jan 14, 2019 8:32 AM.


#2 RevEng ONLINE  

RevEng

    Bit Player

  • 5,108 posts
  • Location:bottom of the stack

Posted Mon Jan 14, 2019 11:08 AM

In the 7800basic pokey detection I do that, more or less...

-put pokey in reset and wait a few cycles.
-read in 5 bytes. If any aren't 0xff then return with pokey-not-detected
-take pokey out of reset and wait a few cycles.
-read in 5 bytes. If any aren't 0xff then return with pokey-detected.

I wrote it that way, because I was never confident about how universal the "test a specific sequence of pseudo-rand bytes" method was.

Your simplified "just" 5 bytes test might work great, but I worry it might be fooled by a floating bus. Most of the time floating values reflect the previous value on the bus, but on some consoles they're a bit less predictable.

I had to update my own code to work around previous-on-bus floating values, when someone tested it with a Concerto that didn't have pokey plugged in, and it "detected" a pokey. So I don't think it's a purely theoretical concern.

#3 PacManPlus OFFLINE  

PacManPlus

    River Patroller

  • Topic Starter
  • 4,904 posts
  • Atari 7800 & NES Developer
  • Location:Florida

Posted Mon Jan 14, 2019 11:29 AM

Wow - ok...  Thank you for the explanation.







Also tagged with one or more of these keywords: Pokey

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users