.import zerobss
.import push0, callmain
.import RESTOR, BSOUT, CLRCH
- .import __IRQFUNC_COUNT__
+ .import __INTERRUPTOR_COUNT__
.import __RAM_START__, __RAM_SIZE__
.include "zeropage.inc"
jsr initlib
-; Set the bank for the file name to our execution bank. We must do this,
-; *after* calling constructors, because some of them may depend on the
+; Set the bank for the file name to our execution bank. We must do this,
+; *after* calling constructors, because some of them may depend on the
; original value of this register.
lda #0
; If we have IRQ functions, chain our stub into the IRQ vector
- lda #<__IRQFUNC_COUNT__
+ lda #<__INTERRUPTOR_COUNT__
beq NoIRQ1
lda IRQVec
ldx IRQVec+1
; chained it.
_exit: pha ; Save the return code on stack
- lda #<__IRQFUNC_COUNT__
+ lda #<__INTERRUPTOR_COUNT__
beq NoIRQ2
lda IRQInd+1
ldx IRQInd+2
.import zerobss, push0
.import callmain
.import RESTOR, BSOUT, CLRCH
- .import __IRQFUNC_COUNT__
+ .import __INTERRUPTOR_COUNT__
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.include "zeropage.inc"
; If we have IRQ functions, chain our stub into the IRQ vector
- lda #<__IRQFUNC_COUNT__
+ lda #<__INTERRUPTOR_COUNT__
beq NoIRQ1
lda IRQVec
ldx IRQVec+1
; chained it.
_exit: pha ; Save the return code on stack
- lda #<__IRQFUNC_COUNT__
+ lda #<__INTERRUPTOR_COUNT__
beq NoIRQ2
lda IRQInd+1
ldx IRQInd+2
.import push0, callmain
.import __CHARRAM_START__, __CHARRAM_SIZE__, __VIDRAM_START__
.import __BSS_RUN__, __BSS_SIZE__, __EXTZP_RUN__
- .import __IRQFUNC_COUNT__
+ .import __INTERRUPTOR_COUNT__
.import scnkey, UDTIM
.include "zeropage.inc"
; Call module constructors, enable chained IRQs afterwards.
jsr initlib
- lda #.lobyte(__IRQFUNC_COUNT__*2)
+ lda #.lobyte(__INTERRUPTOR_COUNT__*2)
sta irqcount
; Enable interrupts
.import callirq_y, initlib, donelib
.import push0, callmain
.import __BSS_RUN__, __BSS_SIZE__, __EXTZP_RUN__
- .import __IRQFUNC_COUNT__
+ .import __INTERRUPTOR_COUNT__
.import scnkey, UDTIM
.include "zeropage.inc"
; Call module constructors, enable chained IRQs afterwards.
Init: jsr initlib
- lda #.lobyte(__IRQFUNC_COUNT__*2)
+ lda #.lobyte(__INTERRUPTOR_COUNT__*2)
sta irqcount
; Enable interrupts
.import callirq_y, initlib, donelib
.import push0, callmain, zerobss
- .import __IRQFUNC_COUNT__
+ .import __INTERRUPTOR_COUNT__
.include "zeropage.inc"
.include "plus4.inc"
; Initialize irqcount, which means that from now own custom linked in IRQ
; handlers (via condes) will be called.
- lda #.lobyte(__IRQFUNC_COUNT__*2)
+ lda #.lobyte(__INTERRUPTOR_COUNT__*2)
sta irqcount
; Push arguments and call main()
bne dobreak
; It's an IRQ and RAM is enabled. If we have handlers, call them. We will use
-; a flag here instead of loading __IRQFUNC_COUNT__ directly, since the condes
-; function is not reentrant. The irqcount flag will be set/reset from the main
-; code, to avoid races.
+; a flag here instead of loading __INTERRUPTOR_COUNT__ directly, since the
+; condes function is not reentrant. The irqcount flag will be set/reset from
+; the main code, to avoid races.
ldy irqcount
beq @L1
.export callirq
.export callirq_y ; Same but with Y preloaded
- .import __IRQFUNC_TABLE__, __IRQFUNC_COUNT__
+ .import __INTERRUPTOR_TABLE__, __INTERRUPTOR_COUNT__
.code
.data
callirq:
- ldy #.lobyte(__IRQFUNC_COUNT__*2)
+ ldy #.lobyte(__INTERRUPTOR_COUNT__*2)
callirq_y:
dey
- lda __IRQFUNC_TABLE__,y
+ lda __INTERRUPTOR_TABLE__,y
sta jmpvec+2 ; Modify code below
dey
- lda __IRQFUNC_TABLE__,y
+ lda __INTERRUPTOR_TABLE__,y
sta jmpvec+1 ; Modify code below
sty index+1 ; Modify code below
jmpvec: jsr $FFFF ; Patched at runtime
count = __DESTRUCTOR_COUNT__;
# condes functions with type 2 are called in the interrupt
CONDES: segment = RODATA,
- type = 2,
- label = __IRQFUNC_TABLE__,
- count = __IRQFUNC_COUNT__;
+ type = interruptor,
+ label = __INTERRUPTOR_TABLE__,
+ count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__ = $800; # 2K stack
count = __DESTRUCTOR_COUNT__;
# condes functions with type 2 are called in the interrupt
CONDES: segment = RODATA,
- type = 2,
- label = __IRQFUNC_TABLE__,
- count = __IRQFUNC_COUNT__;
+ type = interruptor,
+ label = __INTERRUPTOR_TABLE__,
+ count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__ = $800; # 2K stack
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__;
CONDES: segment = RODATA,
- type = 2,
- label = __IRQFUNC_TABLE__,
- count = __IRQFUNC_COUNT__;
+ type = interruptor,
+ label = __INTERRUPTOR_TABLE__,
+ count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__ = $781; # ~2K stack
count = __DESTRUCTOR_COUNT__;
# condes functions with type 2 are called in the interrupt
CONDES: segment = RODATA,
- type = 2,
- label = __IRQFUNC_TABLE__,
- count = __IRQFUNC_COUNT__;
+ type = interruptor,
+ label = __INTERRUPTOR_TABLE__,
+ count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__ = $800; # 2K stack
count = __DESTRUCTOR_COUNT__;
# condes functions with type 2 are called in the interrupt
CONDES: segment = RODATA,
- type = 2,
- label = __IRQFUNC_TABLE__,
- count = __IRQFUNC_COUNT__;
+ type = interruptor,
+ label = __INTERRUPTOR_TABLE__,
+ count = __INTERRUPTOR_COUNT__;
}
SYMBOLS {
__STACKSIZE__ = $800; # 2K stack