Work on interrupts

This commit is contained in:
Kyle Cardoza 2024-03-30 14:27:36 -04:00
parent 1d22547834
commit 022f276a28
2 changed files with 11 additions and 7 deletions

View File

@ -11,6 +11,10 @@
#define long_i rep #0b00010000 #define long_i rep #0b00010000
#define short_reg sep #0b00110000
#define long_reg rep #0b00110000
#ifdef __CALYPSI_CODE_MODEL_SMALL__ #ifdef __CALYPSI_CODE_MODEL_SMALL__
#define libcode code #define libcode code

View File

@ -31,8 +31,8 @@ interrupts_init:
long_a long_a
sei sei
lda #.near(cop_handler_native) lda ##.near(cop_handler_native)
sta 0x00FFB4 sta long:0x00FFB4
rts rts
@ -44,7 +44,7 @@ cop_handler_native:
; Set the data bank register to 0. ; Set the data bank register to 0.
pha pha
lda #0 lda ##0
short_a short_a
pha pha
plb plb
@ -66,21 +66,21 @@ cop_handler_native:
; modifying anything but the X register. ; modifying anything but the X register.
; Now, we do an indirect, indexed jump through the jump table. ; Now, we do an indirect, indexed jump through the jump table.
jsr (cop_jump_table,x) jsr (.kbank(cop_jump_table),x)
; And we're done. ; And we're done.
plb plb
rti rti
cop_jump_table: cop_jump_table:
.word .near(cop_reset) .word .word0(cop_exit)
.word .near(cop_get_version) .word .word0(cop_get_version)
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------
.extern __program_start .extern __program_start
cop_reset: cop_exit:
jmp long:__program_start jmp long:__program_start
; ----------------------------------------------------------------------------- ; -----------------------------------------------------------------------------