mirror of
https://github.com/cc65/cc65.git
synced 2024-10-13 06:24:18 +00:00
PM base isn't hardcoded anymore, we now get it from the startup code
git-svn-id: svn://svn.cc65.org/cc65/trunk@450 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
6e6d36b89d
commit
9c35f5278a
@ -15,7 +15,7 @@
|
|||||||
.export _mouse_show, _mouse_hide, _mouse_move
|
.export _mouse_show, _mouse_hide, _mouse_move
|
||||||
.export _mouse_buttons
|
.export _mouse_buttons
|
||||||
|
|
||||||
.import popa,popax
|
.import popa,popax,mouse_pm0
|
||||||
|
|
||||||
.include "atari.inc"
|
.include "atari.inc"
|
||||||
|
|
||||||
@ -32,11 +32,8 @@ defymax = 211 ; default y maximum
|
|||||||
|
|
||||||
pmsize = 16 ; y size pm shape
|
pmsize = 16 ; y size pm shape
|
||||||
|
|
||||||
xinit = 100 ; init. x pos.
|
xinit = defxmin ; init. x pos.
|
||||||
yinit = 100 ; init. y pos.
|
yinit = defymin ; init. y pos.
|
||||||
|
|
||||||
pmb = $2800 ; pm base memory
|
|
||||||
pm0 = pmb+$400 ; pm 0 memory
|
|
||||||
|
|
||||||
;--------------------------------------------------------------------
|
;--------------------------------------------------------------------
|
||||||
; Initialize mouse routines
|
; Initialize mouse routines
|
||||||
@ -52,13 +49,11 @@ _mouse_init:
|
|||||||
cmp #MAX_TYPE+1
|
cmp #MAX_TYPE+1
|
||||||
bcc setup
|
bcc setup
|
||||||
|
|
||||||
ifail:
|
ifail: lda #0 ; init. failed
|
||||||
lda #0 ; init. failed
|
|
||||||
tax
|
tax
|
||||||
rts
|
rts
|
||||||
|
|
||||||
setup:
|
setup: tax
|
||||||
tax
|
|
||||||
lda lvectab,x
|
lda lvectab,x
|
||||||
sta mouse_vec+1
|
sta mouse_vec+1
|
||||||
lda hvectab,x
|
lda hvectab,x
|
||||||
@ -108,7 +103,7 @@ setup:
|
|||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
lda #1
|
lda #1
|
||||||
sta mouse_on
|
stx mouse_on
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;--------------------------------------------------------------------
|
;--------------------------------------------------------------------
|
||||||
@ -404,13 +399,21 @@ vbi_jmp:
|
|||||||
;--------------------------------------------------------------------
|
;--------------------------------------------------------------------
|
||||||
; initialize mouse pm
|
; initialize mouse pm
|
||||||
|
|
||||||
pminit: ldx #0
|
pminit: lda mouse_pm0
|
||||||
|
sta mpatch1+2
|
||||||
|
sta mpatch2+2
|
||||||
|
sta mpatch3+2
|
||||||
|
|
||||||
|
ldx #0
|
||||||
txa
|
txa
|
||||||
clpm: sta pm0,x
|
mpatch1:
|
||||||
|
clpm: sta $1000,x ; will be patched
|
||||||
inx
|
inx
|
||||||
bne clpm
|
bne clpm
|
||||||
|
|
||||||
lda #>pmb
|
lda mouse_pm0
|
||||||
|
sec
|
||||||
|
sbc #4
|
||||||
sta PMBASE
|
sta PMBASE
|
||||||
|
|
||||||
lda #62
|
lda #62
|
||||||
@ -435,7 +438,8 @@ drwpm: lda mousex
|
|||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
fmp2: lda mskpm,y
|
fmp2: lda mskpm,y
|
||||||
sta pm0,x
|
mpatch2:
|
||||||
|
sta $1000,x ; will be patched
|
||||||
inx
|
inx
|
||||||
iny
|
iny
|
||||||
cpy #pmsize
|
cpy #pmsize
|
||||||
@ -450,7 +454,8 @@ clrpm: lda omy
|
|||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
tya
|
tya
|
||||||
fmp1: sta pm0,x
|
mpatch3:
|
||||||
|
fmp1: sta $1000,x ; will be patched
|
||||||
inx
|
inx
|
||||||
iny
|
iny
|
||||||
cpy #pmsize
|
cpy #pmsize
|
||||||
|
Loading…
Reference in New Issue
Block a user