Atari, Atari5200: disable "attract mode" on mouse or joystick input

Fixes #736.
This commit is contained in:
Christian Groessler
2018-09-04 23:08:38 +02:00
committed by Oliver Schmidt
parent 70a131e09a
commit d199ca1460
6 changed files with 111 additions and 41 deletions

View File

@@ -89,6 +89,8 @@ YMin: .res 2 ; Y1 value of bounding box
XMax: .res 2 ; X2 value of bounding box
YMax: .res 2 ; Y2 value of bounding box
Buttons: .res 1 ; Button mask
OldDir: .res 1 ; previous direction bits
OldButton: .res 1 ; previous buttons
Temp: .res 1 ; Temporary value used in the int handler
@@ -336,9 +338,24 @@ IRQ:
jsr CPREP
; Check if user activity occurred, and if yes, disable "attract mode"
lda Buttons
cmp OldButton
beq @ChkDir
sta OldButton
lda #0
sta ATRACT ; disable "attract mode"
@ChkDir:lda Temp
cmp OldDir
beq @ChkCnt
sta OldDir
lda #0
sta ATRACT
; Check left/right
lda Temp ; Read joystick #0
@ChkCnt:lda Temp ; Read joystick #0
and #(JOY::LEFT | JOY::RIGHT)
beq @SkipX ;
@@ -437,4 +454,3 @@ IRQ:
@SkipY: jsr CDRAW
clc ; Interrupt not "handled"
rts