1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-05 08:05:51 +00:00
cc65/libsrc/creativision/irq.s
Christian Groessler e6530d68dd Fix joystick driver. Add interruptor support.
Note that the joystick driver doesn't support combined movements (like
left/up or right/down). This should be fixed.
2017-02-15 15:45:49 +01:00

41 lines
892 B
ArmAsm

;
; IRQ handling (CreatiVision version)
;
.export initirq, doneirq
.import callirq, irq2
.include "creativision.inc"
; ------------------------------------------------------------------------
.segment "ONCE"
initirq:
lda #<IRQStub
ldx #>IRQStub
jmp setvec
; ------------------------------------------------------------------------
.code
doneirq:
lda #<BIOS_IRQ2_ADDR
ldx #>BIOS_IRQ2_ADDR
setvec: sei
sta irq2+1
stx irq2+2
cli
rts
; ------------------------------------------------------------------------
.segment "CODE"
IRQStub:
cld ; Just to be sure
jsr callirq ; Call the functions
jmp BIOS_IRQ2_ADDR ; Jump to the BIOS IRQ vector