WIP: 5200 runs on a800 (fire to skip menu)

This commit is contained in:
2022-09-26 11:37:42 -04:00
parent 174dbe0bed
commit 95303380e7
7 changed files with 77 additions and 70 deletions
+9 -9
View File
@@ -624,20 +624,20 @@ SetPokey
lda trackn_audf+0
ldx trackn_audc+0
sta $d200
stx $d201
sta AUDF1
stx AUDC1
lda trackn_audf+1
ldx trackn_audc+1
sta $d200+2
stx $d201+2
sta AUDF2
stx AUDC2
lda trackn_audf+2
ldx trackn_audc+2
sta $d200+4
stx $d201+4
sta AUDF3
stx AUDC3
lda trackn_audf+3
ldx trackn_audc+3
sta $d200+6
stx $d201+6
sty $d208
sta AUDF4
stx AUDC4
sty AUDCTL
rts
RMTPLAYEREND
+3 -3
View File
@@ -1,6 +1,6 @@
.proc talk
; Maximum text length is 63 characters!!!
L0 dta d"CTO XYEB"
L0 dta d"CYKA BLAT"
L1 dta d"DIE!"
L2 dta d"EAT MY SHORTS!"
L3 dta d"YOU'RE TOAST!"
@@ -47,7 +47,7 @@ L43 dta d"THIS IS YOUR BRAIN ON SCORCH."
L44 dta d"TAKE THIS!"
L45 dta d"THIS SCREEN AIN'T BIG ENOUGH FOR THE BOTH OF US."
L46 dta d"DIE, ALIEN SWINE!"
L47 dta d"SAY ARRGGHHHHH...."
L47 dta d"AWRUK!!!"
L48 dta d"I SHALL OIL MY TURRET WITH YOUR BLOOD."
L49 dta d"DIE, TANK-SCUM!"
L50 dta d"I'M GONNA BREAK YOUR FACE!"
@@ -104,7 +104,7 @@ L99 dta d"JOIN THE ARMY, SEE THE WORLD THEY SAID."
L100 dta d"IT WASN'T JUST A JOB IT WAS AN ADVENTURE!"
L101 dta d"I DIDN'T LIKE VIOLENCE ANYWAY!"
L102 dta d"I THOUGHT YOU LIKED ME?"
L103 dta d"SUCH SENSELESS VIOLENCE! I DON'T UNDERSTAND IT."
L103 dta d"CTO XYEB"
L104 dta d"I THINK THIS GUY'S A LITTLE CRAZY."
L105 dta d"SOMEHOW I DON'T FEEL LIKE KILLING ANYMORE."
L106 dta d"HEY! KILLIN' AIN'T COOL."
+2 -1
View File
@@ -45,7 +45,8 @@
@ lda vcount
bne @-
mwa #:1 VVBLKD
lda #$40 ;Enable IRQ interrupts
mva #$40 nmien
;Enable IRQ interrupts
sta pokmsk
sta irqen
cli
+5 -6
View File
@@ -11,8 +11,8 @@ POKMSK = $00 ;pokmsk at $00 on Atari 5200 instead of $10 on Atari
RTCLOK = $01 ;Actually $01/$02
CRITIC = $03
ATRACT = $04 ;attact at $04 on Atari 5200 instead of $4D on Atari XL
DLPTRS = $05 ;sdlstl at $05/$06 on Atari 5200 instead of $230 on Atari XL
DMACTLS = $07 ;sdmactl at $07 on Atari 5200 instead of $22f on Atari XL
DLPTRS = $05 ;DLPTRS at $05/$06 on Atari 5200 instead of $230 on Atari XL
DMACTLS = $07 ;DMACTLS at $07 on Atari 5200 instead of $22f on Atari XL
SSKCTL = skctl ;There is no shadow on Atari 5200
PCOLR0 EQU $08 ;P0 COLOR
PCOLR1 EQU $09 ;P1 COLOR
@@ -34,7 +34,9 @@ PADDL6 EQU $17
PADDL7 EQU $18
STICK0 = $19 ;There is no stick0 but we will make the analog stick look like a digital one and store it here
STRIG0 = $1a ;There is no strig0 but we will make this the shadow of the TRIG0 ($c010) of GTIA
chbas = $1b ;There is no strig0 but we will make this the shadow of the CHBASE
chbas = $1b ;There is no CHBAS but we will make this the shadow of the CHBASE
CONSOL = $1c ;There are no console keys on Atari 5200, so we replace console h/w reads with a new shadow based on the keypad keys
consol_reset = $07;The constant value representing that no consol key is pressed
; PAGE 2
VIMIRQ EQU $0200 ;IMMED IRQ VECTOR
@@ -57,9 +59,6 @@ ROM_SETTINGS = $bfe8 ; game ROM info start (24 bytes total, 20b title, 2b year,
; HARDWARE REGISTERS
; GTIA
CONSOL = $280 ;There are no console keys on Atari 5200, so we replace console h/w reads with a new shadow based on the keypad keys
consol_reset = $07 ;The constant value representing that no consol key is pressed
; ---------------------------------------------------------------------------
POKEY EQU $EB00
; ---------------------------------------------------------------------------
+45 -38
View File
@@ -6,7 +6,7 @@
;Miami & Warsaw 2022
;---------------------------------------------------
.def target = 800 ;5200 ; or 800
.def TARGET = 800; 5200 ; or 800
;---------------------------------------------------
OPT r+ ; saves 12 bytes :O
@@ -222,9 +222,11 @@ FirstSTART
lda #$ff ;initial value
sta sfx_effect
lda #0
jsr RmtSongSelect
RMTSong 0
.IF TARGET = 5200
mva #$0f STICK0
.ENDIF
VMAIN VBLinterrupt,7 ;jsr SetVBL
START
@@ -1104,8 +1106,9 @@ MakeTanksVisible
ldy dliCounter
lda dliColorsBack,y
ldy dliColorsFore
nop
nop
.IF TARGET = 800
nop ; necessary on 800 because DLIs take less time, jitter visible without it
.ENDIF
nop
sta COLPF1
sty COLPF2
@@ -1152,7 +1155,7 @@ ColoredLines
cmp #9
beq CreditsScroll
tay
lda GameOverColoursTable-3,y ; -2 becouse this is DLI nr 2 and -1 (labels line)
lda GameOverColoursTable-3,y ; -2 because this is DLI nr 2 and -1 (labels line)
ldy #$0a ; text colour (brightnes)
STA WSYNC
sta COLPF2
@@ -1186,8 +1189,9 @@ EndOfDLI_GO
.proc DLIinterruptText
;sta dliA
pha
lda #TextBackgroundColor
sta WSYNC
mva #TextBackgroundColor COLPF2
sta COLPF2
mva #TextForegroundColor COLPF3
;lda dliA
pla
@@ -1231,32 +1235,35 @@ lab2
; ------- RMT -------
SkipRMTVBL
exitVBL
.IF target = 5200
; center = 114 ;Read analog stick and make it look like a digital stick
; threshold = 60
;
; lda pot0 ;Read POT0 value (horizontal position)
; cmp #center+threshold ;Compare with right threshold
; rol stick0 ;Feed carry into digital stick value
; cmp #center-threshold ;Compare with left threshold
; rol stick0 ;Feed carry into digital stick value
;
; lda pot1 ;Read POT1 value (vertical position)
; cmp #center+threshold ;Compare with down threshold
; rol stick0 ;Feed carry into digital stick value
; cmp #center-threshold ;Compare with down threshold
; rol stick0 ;Feed carry into digital stick value
;
; lda stick0 ;0 indicates a press so the right/down values need to be inverted
; eor #2+8
; and #$0f
; sta stick0
;
; mva trig0 strig0 ;Move hardware to shadow
;
; lda skstat ;Reset consol key shadow is no key is pressed anymore
; and #4
; seq:mva #consol_reset consol
.IF TARGET = 5200
center = 114 ;Read analog stick and make it look like a digital stick
threshold = 60
lda paddl0 ;Read POT0 value (horizontal position)
cmp #center+threshold ;Compare with right threshold
rol stick0 ;Feed carry into digital stick value
cmp #center-threshold ;Compare with left threshold
rol stick0 ;Feed carry into digital stick value
lda paddl1 ;Read POT1 value (vertical position)
cmp #center+threshold ;Compare with down threshold
rol stick0 ;Feed carry into digital stick value
cmp #center-threshold ;Compare with down threshold
rol stick0 ;Feed carry into digital stick value
lda stick0 ;0 indicates a press so the right/down values need to be inverted
eor #2+8
and #$0f
sta stick0
mva trig0 strig0 ;Move hardware to shadow
mva chbas chbase
lda skstat ;Reset consol key shadow is no key is pressed anymore
and #4
seq:mva #consol_reset consol
pla
tay
pla
@@ -1536,6 +1543,7 @@ SetRandomWalls
;--------------------------------------------------
jsr WaitForKeyRelease
@
.IF TARGET = 800
lda SKSTAT
cmp #$ff
beq checkJoyGetKey ; key not pressed, check Joy
@@ -1548,7 +1556,7 @@ SetRandomWalls
bne getkeyend
mvx #$80 escFlag
bne getkeyend
.ENDIF
checkJoyGetKey
;------------JOY-------------
;happy happy joy joy
@@ -1584,15 +1592,13 @@ getkeyend
;--------------------------------------------------
.proc WaitForKeyRelease
;--------------------------------------------------
.IF TARGET = 5200
rts
.ELSE
lda STICK0
and #$0f
cmp #$0f
bne WaitForKeyRelease
lda STRIG0
beq WaitForKeyRelease
.IF TARGET = 800
lda SKSTAT
cmp #$ff
bne WaitForKeyRelease
@@ -1637,6 +1643,7 @@ noKey
.endp
MakeDarkScreen
mva #0 dmactls ; dark screen
sta dmactl
; and wait one frame :)
.proc WaitOneFrame
lda CONSOL
@@ -1678,7 +1685,7 @@ noingame
.proc CopyFromROM
;-------------------------------------------------
;copy from CART to RAM
; trashes Y
; trashes: Y
; temp: source
; temp2: destination
; modify: destination-end
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.