1
0
mirror of https://github.com/cc65/cc65.git synced 2024-08-31 07:29:23 +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:
cpg 2000-11-19 22:59:05 +00:00
parent 6e6d36b89d
commit 9c35f5278a

View File

@ -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"
@ -25,18 +25,15 @@ AMIGA_MOUSE = 2 ; device Amiga mouse
MAX_TYPE = 3 ; first illegal device type MAX_TYPE = 3 ; first illegal device type
; the default values force the mouse cursor inside the test screen (no access to border) ; the default values force the mouse cursor inside the test screen (no access to border)
defxmin = 48 ; default x minimum defxmin = 48 ; default x minimum
defymin = 32 ; default y minimum defymin = 32 ; default y minimum
defxmax = 204 ; default x maximum defxmax = 204 ; default x maximum
defymax = 211 ; default y maximum 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