Merge remote-tracking branch 'upstream/master' into something_to_pull
This commit is contained in:
commit
f5e7e92a35
22 changed files with 192 additions and 134 deletions
|
@ -78,9 +78,9 @@
|
||||||
.byte
|
.byte
|
||||||
CSHOW .addr
|
CSHOW .addr
|
||||||
.byte
|
.byte
|
||||||
CDRAW .addr
|
CPREP .addr
|
||||||
.byte
|
.byte
|
||||||
CMOVE .addr
|
CDRAW .addr
|
||||||
.byte
|
.byte
|
||||||
CMOVEX .addr
|
CMOVEX .addr
|
||||||
.byte
|
.byte
|
||||||
|
@ -94,8 +94,8 @@
|
||||||
.struct MOUSE_CALLBACKS
|
.struct MOUSE_CALLBACKS
|
||||||
HIDE .addr ; Hide the mouse cursor
|
HIDE .addr ; Hide the mouse cursor
|
||||||
SHOW .addr ; Show the mouse cursor
|
SHOW .addr ; Show the mouse cursor
|
||||||
|
PREP .addr ; Prepare to move the mouse cursor
|
||||||
DRAW .addr ; Draw the mouse cursor
|
DRAW .addr ; Draw the mouse cursor
|
||||||
MOVE .addr ; Prepare to move the mouse cursor
|
|
||||||
MOVEX .addr ; Move the mouse cursor to X coord
|
MOVEX .addr ; Move the mouse cursor to X coord
|
||||||
MOVEY .addr ; Move the mouse cursor to Y coord
|
MOVEY .addr ; Move the mouse cursor to Y coord
|
||||||
.endstruct
|
.endstruct
|
||||||
|
|
44
cfg/atari-cart.cfg
Normal file
44
cfg/atari-cart.cfg
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
FEATURES {
|
||||||
|
STARTADDRESS: default = $2000;
|
||||||
|
}
|
||||||
|
SYMBOLS {
|
||||||
|
__CARTSIZE__: type = weak, value = $2000; # possible values: $2000 and $4000
|
||||||
|
__CART_HEADER__: type = import;
|
||||||
|
__STACKSIZE__: type = weak, value = $0800; # 2k stack
|
||||||
|
__STARTADDRESS__: type = export, value = %S;
|
||||||
|
__RESERVED_MEMORY__: type = export, value = $0000;
|
||||||
|
__CARTFLAGS__: type = weak, value = $01; # see documentation for other possible values
|
||||||
|
}
|
||||||
|
MEMORY {
|
||||||
|
ZP: file = "", define = yes, start = $0082, size = $007E;
|
||||||
|
RAM: file = "", define = yes, start = %S, size = __CARTSIZE__;
|
||||||
|
ROM: file = %O, define = yes, start = $C000 - __CARTSIZE__, size = __CARTSIZE__ - 6, fill = yes, fillval = $FF;
|
||||||
|
CARTID: file = %O, start = $BFFA, size = $0006;
|
||||||
|
}
|
||||||
|
SEGMENTS {
|
||||||
|
STARTUP: load = ROM, type = ro, define = yes, optional = yes;
|
||||||
|
LOWCODE: load = ROM, type = ro, define = yes, optional = yes;
|
||||||
|
INIT: load = ROM, type = ro, optional = yes;
|
||||||
|
CODE: load = ROM, type = ro, define = yes;
|
||||||
|
RODATA: load = ROM, type = ro, optional = yes;
|
||||||
|
DATA: load = ROM, run = RAM, type = rw, define = yes, optional = yes;
|
||||||
|
BSS: load = RAM, type = bss, define = yes, optional = yes;
|
||||||
|
CARTHDR: load = CARTID, type = ro;
|
||||||
|
ZEROPAGE: load = ZP, type = zp;
|
||||||
|
EXTZP: load = ZP, type = zp, optional = yes;
|
||||||
|
}
|
||||||
|
FEATURES {
|
||||||
|
CONDES: type = constructor,
|
||||||
|
label = __CONSTRUCTOR_TABLE__,
|
||||||
|
count = __CONSTRUCTOR_COUNT__,
|
||||||
|
segment = INIT;
|
||||||
|
CONDES: type = destructor,
|
||||||
|
label = __DESTRUCTOR_TABLE__,
|
||||||
|
count = __DESTRUCTOR_COUNT__,
|
||||||
|
segment = RODATA;
|
||||||
|
CONDES: type = interruptor,
|
||||||
|
label = __INTERRUPTOR_TABLE__,
|
||||||
|
count = __INTERRUPTOR_COUNT__,
|
||||||
|
segment = RODATA,
|
||||||
|
import = __CALLIRQ__;
|
||||||
|
}
|
|
@ -88,7 +88,17 @@ struct mouse_callbacks {
|
||||||
/* Hide the mouse cursor. */
|
/* Hide the mouse cursor. */
|
||||||
|
|
||||||
void (*show) (void);
|
void (*show) (void);
|
||||||
/* Show the mouse cursor */
|
/* Show the mouse cursor. */
|
||||||
|
|
||||||
|
void (*prep) (void);
|
||||||
|
/* Prepare to move the mouse cursor. This function is called,
|
||||||
|
* even when the cursor is currently invisible.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void (*draw) (void);
|
||||||
|
/* Draw the mouse cursor. This function is called,
|
||||||
|
* even when the cursor is currently invisible.
|
||||||
|
*/
|
||||||
|
|
||||||
void __fastcall__ (*movex) (int x);
|
void __fastcall__ (*movex) (int x);
|
||||||
/* Move the mouse cursor to the new X coordinate. This function is called,
|
/* Move the mouse cursor to the new X coordinate. This function is called,
|
||||||
|
|
|
@ -26,8 +26,8 @@ visible:.res 1
|
||||||
_mouse_def_callbacks:
|
_mouse_def_callbacks:
|
||||||
.addr hide
|
.addr hide
|
||||||
.addr show
|
.addr show
|
||||||
|
.addr prep
|
||||||
.addr draw
|
.addr draw
|
||||||
.addr move
|
|
||||||
.addr movex
|
.addr movex
|
||||||
.addr movey
|
.addr movey
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ hide:
|
||||||
; Fall through
|
; Fall through
|
||||||
|
|
||||||
; Prepare to move the mouse cursor.
|
; Prepare to move the mouse cursor.
|
||||||
move:
|
prep:
|
||||||
jsr getcursor ; Cursor visible at current position?
|
jsr getcursor ; Cursor visible at current position?
|
||||||
bne done ; No, we're done
|
bne done ; No, we're done
|
||||||
lda backup ; Get character at cursor position
|
lda backup ; Get character at cursor position
|
||||||
|
|
|
@ -57,8 +57,8 @@ status := $0778
|
||||||
; Callback table, set by the kernel before INSTALL is called
|
; Callback table, set by the kernel before INSTALL is called
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ done: rts
|
||||||
beq :+
|
beq :+
|
||||||
|
|
||||||
; Remove the cursor at the old position
|
; Remove the cursor at the old position
|
||||||
update: jsr CMOVE
|
update: jsr CPREP
|
||||||
|
|
||||||
; Get and set the new X position
|
; Get and set the new X position
|
||||||
ldy slot
|
ldy slot
|
||||||
|
|
23
libsrc/atari/carthdr.s
Normal file
23
libsrc/atari/carthdr.s
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
; Cartridge "header"
|
||||||
|
; (In fact, it's at the end of the cartridge, so more a "trailer".)
|
||||||
|
;
|
||||||
|
; Christian Groessler, 06-Jan-2014
|
||||||
|
|
||||||
|
.ifndef __ATARIXL__
|
||||||
|
|
||||||
|
.export __CART_HEADER__: absolute = 1
|
||||||
|
|
||||||
|
.import __CARTSIZE__, __CARTFLAGS__, cartinit, cartstart
|
||||||
|
|
||||||
|
.include "atari.inc"
|
||||||
|
|
||||||
|
.segment "CARTHDR"
|
||||||
|
|
||||||
|
.word cartstart ; start routine
|
||||||
|
.byte 0 ; must be zero
|
||||||
|
.byte <__CARTFLAGS__
|
||||||
|
.word cartinit ; init routine
|
||||||
|
|
||||||
|
.assert (__CARTSIZE__ = $2000 || __CARTSIZE__ = $4000), error, "Cartridge size must either be $2000 or $4000"
|
||||||
|
|
||||||
|
.endif ; .ifndef __ATARIXL__
|
11
libsrc/atari/cartinit.s
Normal file
11
libsrc/atari/cartinit.s
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
; Cartridge init routine
|
||||||
|
;
|
||||||
|
; Christian Groessler, 06-Jan-2014
|
||||||
|
|
||||||
|
.ifndef __ATARIXL__
|
||||||
|
|
||||||
|
.export cartinit
|
||||||
|
|
||||||
|
cartinit: rts
|
||||||
|
|
||||||
|
.endif ; .ifndef __ATARIXL__
|
20
libsrc/atari/cartstart.s
Normal file
20
libsrc/atari/cartstart.s
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
; Cartridge start routine
|
||||||
|
;
|
||||||
|
; Christian Groessler, 06-Jan-2014
|
||||||
|
|
||||||
|
.ifndef __ATARIXL__
|
||||||
|
|
||||||
|
.export cartstart
|
||||||
|
|
||||||
|
.import start, copydata
|
||||||
|
|
||||||
|
.include "atari.inc"
|
||||||
|
|
||||||
|
; start routine of cartridge
|
||||||
|
; copy data segment to RAM and chain to entry point of crt0.s
|
||||||
|
|
||||||
|
cartstart: jsr copydata
|
||||||
|
jsr start ; run program
|
||||||
|
jmp (DOSVEC) ; return to DOS
|
||||||
|
|
||||||
|
.endif ; .ifndef __ATARIXL__
|
|
@ -22,55 +22,41 @@ MOUSE_SPR_NMASK = .lobyte(.not MOUSE_SPR_MASK) ; Negative mask
|
||||||
VIC_SPR_X = (VIC_SPR0_X + 2*MOUSE_SPR) ; Sprite X register
|
VIC_SPR_X = (VIC_SPR0_X + 2*MOUSE_SPR) ; Sprite X register
|
||||||
VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Hide the mouse pointer. Always called with interrupts disabled.
|
; Hide the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc hide
|
hide:
|
||||||
|
|
||||||
lda #MOUSE_SPR_NMASK
|
lda #MOUSE_SPR_NMASK
|
||||||
and VIC_SPR_ENA
|
and VIC_SPR_ENA
|
||||||
sta VIC_SPR_ENA
|
sta VIC_SPR_ENA
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Show the mouse pointer. Always called with interrupts disabled.
|
; Show the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc show
|
show:
|
||||||
|
|
||||||
lda #MOUSE_SPR_MASK
|
lda #MOUSE_SPR_MASK
|
||||||
ora VIC_SPR_ENA
|
ora VIC_SPR_ENA
|
||||||
sta VIC_SPR_ENA
|
sta VIC_SPR_ENA
|
||||||
rts
|
; Fall through
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
|
||||||
; Draw the mouse pointer. Always called with interrupts disabled.
|
|
||||||
|
|
||||||
.proc draw
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Prepare to move the mouse pointer. Always called with interrupts disabled.
|
; Prepare to move the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc move
|
prep:
|
||||||
|
; Fall through
|
||||||
|
|
||||||
|
; --------------------------------------------------------------------------
|
||||||
|
; Draw the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
|
draw:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Move the mouse pointer X position to the value in a/x. Always called with
|
; Move the mouse pointer X position to the value in a/x. Always called with
|
||||||
; interrupts disabled.
|
; interrupts disabled.
|
||||||
|
|
||||||
.proc movex
|
movex:
|
||||||
|
|
||||||
; Add the X correction and set the low byte. This frees A.
|
; Add the X correction and set the low byte. This frees A.
|
||||||
|
|
||||||
|
@ -92,27 +78,22 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
sta VIC_SPR_HI_X
|
sta VIC_SPR_HI_X
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Move the mouse pointer Y position to the value in a/x. Always called with
|
; Move the mouse pointer Y position to the value in a/x. Always called with
|
||||||
; interrupts disabled.
|
; interrupts disabled.
|
||||||
|
|
||||||
.proc movey
|
movey:
|
||||||
|
|
||||||
clc
|
clc
|
||||||
ldx PALFLAG
|
ldx PALFLAG
|
||||||
bne @L1
|
bne @L2
|
||||||
adc #50 ; FIXME: Should be NTSC, is PAL value
|
adc #50 ; FIXME: Should be NTSC, is PAL value
|
||||||
sta VIC_SPR_Y ; Set Y position
|
sta VIC_SPR_Y ; Set Y position
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@L1: adc #50 ; Add PAL correction
|
@L2: adc #50 ; Add PAL correction
|
||||||
sta VIC_SPR_Y ; Set Y position
|
sta VIC_SPR_Y ; Set Y position
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Callback structure
|
; Callback structure
|
||||||
|
|
||||||
|
@ -121,7 +102,7 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
_mouse_def_callbacks:
|
_mouse_def_callbacks:
|
||||||
.addr hide
|
.addr hide
|
||||||
.addr show
|
.addr show
|
||||||
|
.addr prep
|
||||||
.addr draw
|
.addr draw
|
||||||
.addr move
|
|
||||||
.addr movex
|
.addr movex
|
||||||
.addr movey
|
.addr movey
|
||||||
|
|
|
@ -50,8 +50,8 @@ HEADER:
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||||
; MUST return carry clear.
|
; MUST return carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
lda SID_ADConv1 ; Get mouse X movement
|
lda SID_ADConv1 ; Get mouse X movement
|
||||||
ldy OldPotX
|
ldy OldPotX
|
||||||
jsr MoveCheck ; Calculate movement vector
|
jsr MoveCheck ; Calculate movement vector
|
||||||
|
|
|
@ -49,8 +49,8 @@ LIBREF: .addr $0000
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X co-ord.
|
CMOVEX: jmp $0000 ; Move the cursor to X co-ord.
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y co-ord.
|
CMOVEY: jmp $0000 ; Move the cursor to Y co-ord.
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioctls, for now
|
||||||
; MUST return carry clear.
|
; MUST return carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
|
|
||||||
; Record the state of the buttons.
|
; Record the state of the buttons.
|
||||||
; Try to avoid crosstalk between the keyboard and the lightpen.
|
; Try to avoid crosstalk between the keyboard and the lightpen.
|
||||||
|
|
|
@ -49,8 +49,8 @@ HEADER:
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||||
; MUST return carry clear.
|
; MUST return carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
lda #$7F
|
lda #$7F
|
||||||
sta CIA1_PRA
|
sta CIA1_PRA
|
||||||
lda CIA1_PRB ; Read joystick #0
|
lda CIA1_PRB ; Read joystick #0
|
||||||
|
|
|
@ -46,8 +46,8 @@ HEADER:
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||||
; (so be careful).
|
; (so be careful).
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
lda #$7F
|
lda #$7F
|
||||||
sta CIA1_PRA
|
sta CIA1_PRA
|
||||||
lda CIA1_PRB ; Read port #1
|
lda CIA1_PRB ; Read port #1
|
||||||
|
|
|
@ -22,55 +22,41 @@ MOUSE_SPR_NMASK = .lobyte(.not MOUSE_SPR_MASK) ; Negative mask
|
||||||
VIC_SPR_X = (VIC_SPR0_X + 2*MOUSE_SPR) ; Sprite X register
|
VIC_SPR_X = (VIC_SPR0_X + 2*MOUSE_SPR) ; Sprite X register
|
||||||
VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Hide the mouse pointer. Always called with interrupts disabled.
|
; Hide the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc hide
|
hide:
|
||||||
|
|
||||||
lda #MOUSE_SPR_NMASK
|
lda #MOUSE_SPR_NMASK
|
||||||
and VIC_SPR_ENA
|
and VIC_SPR_ENA
|
||||||
sta VIC_SPR_ENA
|
sta VIC_SPR_ENA
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Show the mouse pointer. Always called with interrupts disabled.
|
; Show the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc show
|
show:
|
||||||
|
|
||||||
lda #MOUSE_SPR_MASK
|
lda #MOUSE_SPR_MASK
|
||||||
ora VIC_SPR_ENA
|
ora VIC_SPR_ENA
|
||||||
sta VIC_SPR_ENA
|
sta VIC_SPR_ENA
|
||||||
rts
|
; Fall through
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
|
||||||
; Draw the mouse pointer. Always called with interrupts disabled.
|
|
||||||
|
|
||||||
.proc draw
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Prepare to move the mouse pointer. Always called with interrupts disabled.
|
; Prepare to move the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc move
|
prep:
|
||||||
|
; Fall through
|
||||||
|
|
||||||
|
; --------------------------------------------------------------------------
|
||||||
|
; Draw the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
|
draw:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Move the mouse pointer X position to the value in a/x. Always called with
|
; Move the mouse pointer X position to the value in a/x. Always called with
|
||||||
; interrupts disabled.
|
; interrupts disabled.
|
||||||
|
|
||||||
.proc movex
|
movex:
|
||||||
|
|
||||||
; Add the X correction and set the low byte. This frees A.
|
; Add the X correction and set the low byte. This frees A.
|
||||||
|
|
||||||
|
@ -92,20 +78,15 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
sta VIC_SPR_HI_X
|
sta VIC_SPR_HI_X
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Move the mouse pointer Y position to the value in a/x. Always called with
|
; Move the mouse pointer Y position to the value in a/x. Always called with
|
||||||
; interrupts disabled.
|
; interrupts disabled.
|
||||||
|
|
||||||
.proc movey
|
movey:
|
||||||
|
|
||||||
add #50 ; Y correction (first visible line)
|
add #50 ; Y correction (first visible line)
|
||||||
sta VIC_SPR_Y ; Set Y position
|
sta VIC_SPR_Y ; Set Y position
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Callback structure
|
; Callback structure
|
||||||
|
|
||||||
|
@ -114,7 +95,7 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
_mouse_def_callbacks:
|
_mouse_def_callbacks:
|
||||||
.addr hide
|
.addr hide
|
||||||
.addr show
|
.addr show
|
||||||
|
.addr prep
|
||||||
.addr draw
|
.addr draw
|
||||||
.addr move
|
|
||||||
.addr movex
|
.addr movex
|
||||||
.addr movey
|
.addr movey
|
||||||
|
|
|
@ -69,8 +69,8 @@ HEADER:
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||||
; MUST return carry clear.
|
; MUST return carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
|
|
||||||
; Record the state of the buttons.
|
; Record the state of the buttons.
|
||||||
; Avoid crosstalk between the keyboard and the mouse.
|
; Avoid crosstalk between the keyboard and the mouse.
|
||||||
|
|
|
@ -49,8 +49,8 @@ LIBREF: .addr $0000
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X co-ord.
|
CMOVEX: jmp $0000 ; Move the cursor to X co-ord.
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y co-ord.
|
CMOVEY: jmp $0000 ; Move the cursor to Y co-ord.
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioctls, for now
|
||||||
; MUST return carry clear.
|
; MUST return carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
|
|
||||||
; Record the state of the buttons.
|
; Record the state of the buttons.
|
||||||
; Try to avoid crosstalk between the keyboard and the lightpen.
|
; Try to avoid crosstalk between the keyboard and the lightpen.
|
||||||
|
|
|
@ -68,8 +68,8 @@ HEADER:
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||||
; MUST return carry clear.
|
; MUST return carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
|
|
||||||
; Avoid crosstalk between the keyboard and a joystick.
|
; Avoid crosstalk between the keyboard and a joystick.
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ HEADER:
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
CMOVEX: jmp $0000 ; Move the cursor to X coord
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
CMOVEY: jmp $0000 ; Move the cursor to Y coord
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||||
; (so be careful).
|
; (so be careful).
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
lda #$7F
|
lda #$7F
|
||||||
sta CIA1_PRA
|
sta CIA1_PRA
|
||||||
lda CIA1_PRB ; Read port #1
|
lda CIA1_PRB ; Read port #1
|
||||||
|
|
|
@ -27,8 +27,7 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Hide the mouse pointer. Always called with interrupts disabled.
|
; Hide the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc hide
|
hide:
|
||||||
|
|
||||||
ldy #15
|
ldy #15
|
||||||
sty IndReg
|
sty IndReg
|
||||||
|
|
||||||
|
@ -41,13 +40,10 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
sty IndReg
|
sty IndReg
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Show the mouse pointer. Always called with interrupts disabled.
|
; Show the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc show
|
show:
|
||||||
|
|
||||||
ldy #15
|
ldy #15
|
||||||
sty IndReg
|
sty IndReg
|
||||||
|
|
||||||
|
@ -58,34 +54,25 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
|
|
||||||
ldy ExecReg
|
ldy ExecReg
|
||||||
sty IndReg
|
sty IndReg
|
||||||
rts
|
; Fall through
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
|
||||||
; Draw the mouse pointer. Always called with interrupts disabled.
|
|
||||||
|
|
||||||
.proc draw
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Prepare to move the mouse pointer. Always called with interrupts disabled.
|
; Prepare to move the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
.proc move
|
prep:
|
||||||
|
; Fall through
|
||||||
|
|
||||||
|
; --------------------------------------------------------------------------
|
||||||
|
; Draw the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
|
draw:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Move the mouse pointer x position to the value in .XA. Always called with
|
; Move the mouse pointer x position to the value in .XA. Always called with
|
||||||
; interrupts disabled.
|
; interrupts disabled.
|
||||||
|
|
||||||
.proc movex
|
movex:
|
||||||
|
|
||||||
ldy #15
|
ldy #15
|
||||||
sty IndReg
|
sty IndReg
|
||||||
|
|
||||||
|
@ -112,16 +99,13 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
@L1: lda (vic),y ; Get high x bits of all sprites
|
@L1: lda (vic),y ; Get high x bits of all sprites
|
||||||
ora #MOUSE_SPR_MASK ; Set high bit for sprite
|
ora #MOUSE_SPR_MASK ; Set high bit for sprite
|
||||||
sta (vic),y
|
sta (vic),y
|
||||||
bnz @L0 ; branch always
|
bnz @L0 ; Branch always
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Move the mouse pointer y position to the value in .XA. Always called with
|
; Move the mouse pointer y position to the value in .XA. Always called with
|
||||||
; interrupts disabled.
|
; interrupts disabled.
|
||||||
|
|
||||||
.proc movey
|
movey:
|
||||||
|
|
||||||
ldy #15
|
ldy #15
|
||||||
sty IndReg
|
sty IndReg
|
||||||
|
|
||||||
|
@ -133,8 +117,6 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
sty IndReg
|
sty IndReg
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Callback structure
|
; Callback structure
|
||||||
|
|
||||||
|
@ -143,7 +125,7 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||||
_mouse_def_callbacks:
|
_mouse_def_callbacks:
|
||||||
.addr hide
|
.addr hide
|
||||||
.addr show
|
.addr show
|
||||||
|
.addr prep
|
||||||
.addr draw
|
.addr draw
|
||||||
.addr move
|
|
||||||
.addr movex
|
.addr movex
|
||||||
.addr movey
|
.addr movey
|
||||||
|
|
|
@ -53,8 +53,8 @@ LIBREF: .addr $0000
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to X co-ord.
|
CMOVEX: jmp $0000 ; Move the cursor to X co-ord.
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to Y co-ord.
|
CMOVEY: jmp $0000 ; Move the cursor to Y co-ord.
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioctls, for now
|
||||||
; MUST return carry clear.
|
; MUST return carry clear.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
ldx #15 ; To system bank
|
ldx #15 ; To system bank
|
||||||
stx IndReg
|
stx IndReg
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ HEADER:
|
||||||
|
|
||||||
CHIDE: jmp $0000 ; Hide the cursor
|
CHIDE: jmp $0000 ; Hide the cursor
|
||||||
CSHOW: jmp $0000 ; Show the cursor
|
CSHOW: jmp $0000 ; Show the cursor
|
||||||
|
CPREP: jmp $0000 ; Prepare to move the cursor
|
||||||
CDRAW: jmp $0000 ; Draw the cursor
|
CDRAW: jmp $0000 ; Draw the cursor
|
||||||
CMOVE: jmp $0000 ; Prepare to move the cursor
|
|
||||||
CMOVEX: jmp $0000 ; Move the cursor to x co-ord.
|
CMOVEX: jmp $0000 ; Move the cursor to x co-ord.
|
||||||
CMOVEY: jmp $0000 ; Move the cursor to y co-ord.
|
CMOVEY: jmp $0000 ; Move the cursor to y co-ord.
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioctls, for now
|
||||||
; Reads joystick 2.
|
; Reads joystick 2.
|
||||||
;
|
;
|
||||||
|
|
||||||
IRQ: jsr CMOVE
|
IRQ: jsr CPREP
|
||||||
ldy #15 ; Switch to the system bank
|
ldy #15 ; Switch to the system bank
|
||||||
sty IndReg
|
sty IndReg
|
||||||
|
|
||||||
|
|
|
@ -32,26 +32,32 @@ hide := MouseOff
|
||||||
|
|
||||||
show := MouseUp
|
show := MouseUp
|
||||||
|
|
||||||
|
; --------------------------------------------------------------------------
|
||||||
|
; Prepare to move the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
|
prep:
|
||||||
|
; Fall through
|
||||||
|
|
||||||
|
; --------------------------------------------------------------------------
|
||||||
|
; Draw the mouse pointer. Always called with interrupts disabled.
|
||||||
|
|
||||||
|
draw:
|
||||||
|
; Fall through
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Move the mouse pointer X position to the value in .XA. Always called with
|
; Move the mouse pointer X position to the value in .XA. Always called with
|
||||||
; interrupts disabled.
|
; interrupts disabled.
|
||||||
|
|
||||||
.proc movex
|
movex:
|
||||||
|
; Fall through
|
||||||
rts
|
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Move the mouse pointer Y position to the value in .XA. Always called with
|
; Move the mouse pointer Y position to the value in .XA. Always called with
|
||||||
; interrupts disabled.
|
; interrupts disabled.
|
||||||
|
|
||||||
.proc movey
|
movey:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
; --------------------------------------------------------------------------
|
||||||
; Callback structure
|
; Callback structure
|
||||||
|
|
||||||
|
@ -60,7 +66,7 @@ show := MouseUp
|
||||||
_mouse_def_callbacks:
|
_mouse_def_callbacks:
|
||||||
.addr hide
|
.addr hide
|
||||||
.addr show
|
.addr show
|
||||||
|
.addr prep
|
||||||
|
.addr draw
|
||||||
.addr movex
|
.addr movex
|
||||||
.addr movey
|
.addr movey
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue