1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-18 15:05:14 +00:00

fix bug where the high byte of X and Y positions were destroyed of

the user had lifted the pen
This commit is contained in:
Christian Groessler 2014-01-11 01:49:21 +01:00
parent ecd10e632a
commit 1fd7c2b318

View File

@ -89,6 +89,8 @@ visible: .res 1
.rodata
; (We use ".proc" because we want to define both a label and a scope.)
.proc DefVars
.word SCREEN_HEIGHT/2 ; YPos
.word SCREEN_WIDTH/2 ; XPos
@ -328,8 +330,6 @@ IRQ:
; Check for a pressed button and place the result into Buttons
ldx #0
stx XPos+1
stx YPos+1
stx Buttons
lda PORTA ; get other buttons
@ -362,6 +362,10 @@ IRQ:
beq @L03
jsr CHIDE
@L03: ldx #0
stx XPos+1
stx YPos+1
; Get cursor position
; -------------------
; The touch pad is read thru the paddle potentiometers. The possible
@ -378,7 +382,7 @@ IRQ:
; X
@L03: ldx PADDL0 ; get X postion
ldx PADDL0 ; get X postion
dex ; decrement, since it's 1-based
stx XPos
txa