Jump to content
IGNORED

5200 second fire button


~llama

Recommended Posts

ok, i'm working on my 5200 emulator (VSX, search for it - ive trolled enough :D) and its based on Atari800Win PLus, which doesnt emulate the second fire button for the 5200 controller.

 

I'm trying my best to implement this second fire button soon, because it really affects gameplay on certain titles, but... i'm reading through the internal Atari memos to 5200 programmers about the 5200 controllers and keyboard and can't really find much about the second fire button, other than that the first is a "hard" trigger (dedicated) and the second is "soft" (not dedicated, defined by the programmer, is what i took it to mean) so... what is the real difference between the two 5200 fire buttons? i'm very confused, and need to figure out so i can implement it.

 

Thanks in advance :D

Link to comment
Share on other sites

The top button on the controllers works like the Atari 8-bit Shift key. When pressed bit 3 of SKSTAT ($E80F) will be set to 1. A press of this button will also trigger a Break Key interrupt (bit 7 of IRQEN/IRQST). Since this button is sorta part of the keypad you can only read the button state of the controller that is currently selected by bit 0,1 of CONSOL ($C01F).

 

Dan

Link to comment
Share on other sites

A press of this button will also trigger a Break Key interrupt (bit 7 of IRQEN/IRQST).

IIRC this is the problem with the upper fire button emulation in Atari800WinPLus. It's been a long time since I analyzed it but I think it caused the BRK interrupt to occur even though you didn't enable it. So if the vector location was set to 0 it would jump to $00.

 

I think during Super Pac-man you didn't notice this until you pressed another key because it hit a variable that would RTI out but it never restored the a,x, or y registers. It's been a long time since I looked at this so I could be totally off. Just know that it did the BRK even though it was disabled.

Link to comment
Share on other sites

IIRC this is the problem with the upper fire button emulation in Atari800WinPLus. It's been a long time since I analyzed it but I think it caused the BRK interrupt to occur even though you didn't enable it. So if the vector location was set to 0 it would jump to $00.

 

I just dug through the code and this is exactly the problem, so... then the question becomes how can the emulator determine whether the VBREAK is disabled or enabled... i guess i'll disassemble some cartridge ROMs, starting with Super Pac Man...

 

how does a real 5200 determine whether VBREAK is enabled or not? ive dug through all of the 5200 documentation i have here, is there anywhere really great where i can get a hold of really heavy-duty 5200-specific docs? (i have the PDF of Rob Zdybel's memos to "All PAM Programmers") because i dont have anything here about how to determine whether the cart has a VBREAK routine.

Link to comment
Share on other sites

no editing, but i feel dumb. I'm gonna just take a wild guess that on a real 5200, if the cart doesnt have a VBREAK routine, theres no VBREAK generated with the upper fire button because theres no way to do it without the routine, but the emulator always generates a VBREAK whether the cart has a routine for it or not.

 

am i right?

Link to comment
Share on other sites

Atari800Win is pretty bad at emulating the 5200 keypads. Using POKEY in non-debounce mode is actually pretty tricky. When I was working on keypad routines it took me a while to figure out why they worked in the emulator, but not on real hardware.

 

-Bry

Link to comment
Share on other sites

Atari800Win is pretty bad at emulating the 5200 keypads. Using POKEY in non-debounce mode is actually pretty tricky. When I was working on keypad routines it took me a while to figure out why they worked in the emulator, but not on real hardware.

 

   -Bry

 

Thats one of the things im working on :) first this pesky upper fire button and then the rest of the keypad :D

 

what im doing with this emulator is taking the Atari800Win PLus code and removing all the non-5200 code, and then making it a really good 5200 emulator :)

Link to comment
Share on other sites

 

how does a real 5200 determine whether VBREAK is enabled or not? ive dug through all of the 5200 documentation i have here, is there anywhere really great where i can get a hold of really heavy-duty 5200-specific docs? (i have the PDF of Rob Zdybel's memos to "All PAM Programmers") because i dont have anything here about how to determine whether the cart has a VBREAK routine.

 

All the interrupts are controlled by the POKEY IREQN register ($E80E). Bit 7 specifically controlls the break interrupt. When set to 0 the interrupt is disable, set to 1 it is enabled. I believe that disabling the interrupt only prevents it from generating an IRQ to the processor, but the IRQ Status register still registers the interrupt.

 

Dan

Link to comment
Share on other sites

Atari800Win is pretty bad at emulating the 5200 keypads. Using POKEY in non-debounce mode is actually pretty tricky. When I was working on keypad routines it took me a while to figure out why they worked in the emulator, but not on real hardware.

 

   -Bry

 

From my study of the 5200 hardware I was under the unsumption the if de-bounce was enabled, the keypad would register any keypresses. Due to the way the keypad is wired, a single keypress actually registers 4 different keycodes which would always look like a key bounce. Am I incorrect about this?

 

Dan

Link to comment
Share on other sites

ive dug through all of the 5200 documentation i have here, is there anywhere really great where i can get a hold of really heavy-duty 5200-specific docs? (i have the PDF of Rob Zdybel's memos to "All PAM Programmers") because i dont have anything here about how to determine whether the cart has a VBREAK routine.

 

I have links to a lot of good documentation on the 5200/Atari 8-bits:

 

http://www.atarihq.com/danb/a5200.shtml

 

There is minimanl 5200 specific info out there, so you have to rely alot on the Atari 8-bit docs. At that link you can find an annotated version of the Analog Magazine Article on the Atari 5200, this is the best description of the differences between the 5200 and 8-bit.

 

The other documents I highly recommends are Mapping the Atari, De-Re-Atari, both at (http://www.atariarchives.org/), and the Hardware Reference Manual which you can get a link to from my site.

 

Dan

Link to comment
Share on other sites

Atari800Win is pretty bad at emulating the 5200 keypads. Using POKEY in non-debounce mode is actually pretty tricky. When I was working on keypad routines it took me a while to figure out why they worked in the emulator, but not on real hardware.

 

   -Bry

 

From my study of the 5200 hardware I was under the unsumption the if de-bounce was enabled, the keypad would register any keypresses. Due to the way the keypad is wired, a single keypress actually registers 4 different keycodes which would always look like a key bounce. Am I incorrect about this?

 

Dan

 

If you mean, "wouldn't register any keypresses," then you're right. Pokey will discard all presses with debounce enabled because it appears that multiple keys are being held down. Instead, in non-debounce mode, it returns an interrupt every time Pokey hits a code that brings the input line low. This returns a rapid shower of interrupts, so it's probably better to ignore them after the 1st one, and let your VBL routine re-enable them.

 

-Bry

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...