Jump to content
IGNORED

Equate tables


AlanD

Recommended Posts

I haven't been programming for very long but have been working with classic games for quite a while. A few old-timers may remember me from #classic and #rgvc. Anyway, I have wanted to start trying to program on the 5200 again and thought I would share a file with you that I acquired from some old disks from Atari. This file may be helpful to some of you programming either the 5200 or Atari8 computers. I originally modified it for TASM but if anyone knows what changes are needed for the cureent 'best' assmebler to use I would be interested in help on it. Please share any comments about it with me so I can improve it.

 

Moderator Edit: Alans 8-Bit Equate file is located here: http://aland.roarvgm.com/tech.html

Link to comment
Share on other sites

I originally modified this file for TASM which allows conditional compiles. If you set the value of ATARI=1 it will use the second set of baseline values in the compile and not the first set. That is used mainly to declare where the gtia and pokey are located based on the system you are programming. The location of every memory location is from those baseline values. For example if you set the compile for 5200:

 

POKEY .EQU $E800 ;Pokey Base

 

would compile but in Atari8 mode:

 

POKEY .EQU $D200 ;Pokey Base

 

would compile. That way when the later lines are declared it will put them in different pages:

 

STIMER .EQU POKEY+$09 ;Start Timer

KBCODE .EQU POKEY+$09 ;Keyboard Code

 

would have a different value when compiled depending on what system you are compiling it for. By doing it this way all that is needed is to change the value of ATARI in your source and it will then compile for an Atari8 vice 5200. Of course this won't clear up any problems with controllers or with the memory map but should help somewhat.

AlanD

Link to comment
Share on other sites

Thanks Dan. That did it.

 

I overlooked that information earlier thinking they were talking about the console keys for some reason.

 

I set POKMSK to enable the break key (added 128 decimal to my current value), set up my vector pointer, and wow...the top fire button now goes to my routine.

 

Pretty cool.

Link to comment
Share on other sites

Tempest - I did a simple test to see if I could get this to work. Here is my hack.

 

I set the VBREAK vector to point to my routine...

 

lda #$00

sta VBREAK

 

lda #$b0

sta VBREAK+1

 

I really did this the same way I did my other code by just using the routine's label as the reference to point to but that code would not display here for some reason. It must have something to do with the # and > sequence

 

Set POKMSK and IRQEN to enable the break key interrupt. To do this I added 128 decimal (#$80) to my current value of #$40.

 

; Set POKMSK and IRQEN to #$C0 (192 decimal)

lda #$C0

sta POKMSK ; to enable the "other key" interrupt and break key

sta IRQEN

 

Do an org $b000 before the routine...again done because of limitations on the board.

 

Then inside the routine I changed the size of my player between 1 and 0. Before leaving the routine I do a pla (pull accumulator off the stack) and rti (return from interrupt). I did the pla because the VIMIRQ did a pha before it was being called. This works (on vss I can't get my second fire button to work on any game for Atari800Win) but I would like to look at it a little closer.

Link to comment
Share on other sites

I was mistaken about the upper fire buttons, they are not read via the keypad scanning. These buttons behave like the Shift keys on the 8-bit keyboard. So the state of these button can be read from bit 6 of the KBCODE register, and according to the Analog article these button can also generate a Break key interrupt.

 

I have to admit this was one of the hardest parts of the 5200 emulation to get working properly.

 

Dan

Link to comment
Share on other sites

quote:

Originally posted by AlanD:

--- Also has anyone taken a look at the equates and found them useful? Thoughts or suggestions for improvement?

 

Alan I briefly looked at these and they seem fine. I think everyone (at least visiting this board) that is programming for PAM should use this table so when or if we share code we will all use the same equates.

 

I thought it was pretty interesting that you use the equate VTRIGR for $020C instead of VBREAK since the top fire button triggers this interrupt.

 

[ 10-02-2001: Message edited by: DEBRO ]

Link to comment
Share on other sites

I had never noticed that. Actually this file came from a disk that a friend received from Atari R&D. I took the equate file on the disk and made it work in TASM which was the assmebler I was using. I had not even noticed that that was the name they had given it. I assumed that whatever was in there was the standard Atari label for all the locations. I figured the original programmer would know better than I what was right. I haven't tried to convert it over to DASM as I have never used that assembler before. I'll eventually do that as it seems that is the assembler of choice by people here.

AlanD

Link to comment
Share on other sites

Exactly what I was doing. When I would start a new program I would begin with:

 

ATARI=1 (or 0 depending on system programming for)

#INCLUDE equates.txt

 

This set up all the equates for that system and worked perfectly for me. I'm glad that it turns out to work right with DASM. Now I have to read up on DASM and start using it so that I can exchange code more easily with others here. Thanks for trying it out and giving me your inputs.

AlanD

Link to comment
Share on other sites

  • 4 years later...

BUMP!

 

I'm trying to get the upper fire buttons to work. This thread has some info about it, but i'm still unsure of a number of things.

 

Lower Firebuttons are easy ..

 

lda TRIG0

bne TrigCont1 ;if Trigger0 not pressed go to TrigCont1

...

 

Upper Firebuttons? Am I understanding this correctly, that they are part of the keypad reading scan? For Keys, I have a KBCODE vector which sets the CH variable, which I check in the VBI if Reset, Start, #3, #5, etc were pressed. Here is my KBCodeVector:

 

;-----------------------------------------------------------------KBCodeVector
; KBCodeVector
;
; This is our Keypad continuation vector routine. The default Keyboard IRQ
; vector reads the KBCODE and converts the value for us but only
; stores this value in the accumulator.
;
; The default Keypad continuation vector just pops the stack and returns from
; the interrupt so the key press value is lost unless we store it somewhere.
                                                   
KBCodeVector
; Debounce logic here: rwl 8/08/03
; on entry A=key just pressed
CMP KEYLAST
BNE KEYOK
LDY KEYDB;SAME KEY, CHECK DEBOUNCE TIMER  -- sample code has ldx
BNE KEYDONE;IF DEBOUNCE ISN'T 0, REJECT THE KEY
KEYOK
STA CH	;sample had "KEY"                  
STA KEYLAST	;STORE KEYPRESS
KEYDONE
LDA #$03	;RESET DEBOUNCE TIMER
STA KEYDB

JMP XITVBL	;

 

 

One older post said "bit 6 of the KBCODE register" reflects the status of the Upper fire buttons. Does anybody have any sample code to help? (For now, I'm using the #6 key for a certain Adv II function, but I'd like to map it to the upper firebuttons...)

Link to comment
Share on other sites

Thanks! Now, I wonder if Atari800win has support for button 2? I can't recall ever using it.

 

so I'd LDA SKCTL, then if I mask off bit '4' with an AND #%00001000, if that bit = '1', then the button was pressed. sound correct?

 

Well, it seems in A800win, that it thinks it is always pressed! Is some kind of way to debounce the upper trig?

Edited by Cafeman
Link to comment
Share on other sites

Thanks!  Now, I wonder if Atari800win has support for button 2? I can't recall ever using it.

 

so I'd LDA SKCTL, then if I mask off bit '4' with an AND #%00001000, if that bit = '1', then the button was pressed. sound correct?

988900[/snapback]

 

IIRC, you test for '0', e.g.:

 

lda SKCTL

and #$08

bne not_pressed

 

:)

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