mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 17:30:50 +00:00
Changes by Karri Kaksonen to implement interruptor support.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4144 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
773e05b5f3
commit
d95321f489
@ -19,11 +19,12 @@
|
|||||||
.export _exit
|
.export _exit
|
||||||
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
||||||
|
|
||||||
.import initlib, donelib
|
.import callirq, initlib, donelib
|
||||||
.import zerobss
|
.import zerobss
|
||||||
.import callmain
|
.import callmain
|
||||||
.import _main
|
.import _main
|
||||||
.import __BSS_LOAD__
|
.import __BSS_LOAD__
|
||||||
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__
|
.import __RAM_START__, __RAM_SIZE__
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
@ -132,9 +133,21 @@ sloop: ldy SuzyInitReg,x
|
|||||||
|
|
||||||
jsr zerobss
|
jsr zerobss
|
||||||
|
|
||||||
|
; If we have IRQ functions, set the IRQ vector
|
||||||
|
; as Lynx is a console there is not much point in releasing the IRQ
|
||||||
|
|
||||||
|
lda #<__INTERRUPTOR_COUNT__
|
||||||
|
beq NoIRQ1
|
||||||
|
lda #<IRQStub
|
||||||
|
ldx #>IRQStub
|
||||||
|
sei
|
||||||
|
sta INTVECTL
|
||||||
|
stx INTVECTH
|
||||||
|
cli
|
||||||
|
|
||||||
; Call module constructors
|
; Call module constructors
|
||||||
|
|
||||||
jsr initlib
|
NoIRQ1: jsr initlib
|
||||||
|
|
||||||
; Push arguments and call main
|
; Push arguments and call main
|
||||||
|
|
||||||
@ -149,3 +162,14 @@ _exit: jsr donelib ; Run module destructors
|
|||||||
noret: bra noret
|
noret: bra noret
|
||||||
|
|
||||||
|
|
||||||
|
IRQStub:
|
||||||
|
phy
|
||||||
|
phx
|
||||||
|
pha
|
||||||
|
cld
|
||||||
|
jsr callirq
|
||||||
|
pla
|
||||||
|
plx
|
||||||
|
ply
|
||||||
|
rti
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user