aboutsummaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
Diffstat (limited to 'asm')
-rw-r--r--asm/crt0.asm17
-rw-r--r--asm/isr.asm4
2 files changed, 18 insertions, 3 deletions
diff --git a/asm/crt0.asm b/asm/crt0.asm
index 6f92149..523c39e 100644
--- a/asm/crt0.asm
+++ b/asm/crt0.asm
@@ -10,7 +10,22 @@ start:
ld i, a
ld sp, #0x0000
di
-
+ ;; Init PIO and check for KEY2
+ ld a, #PIO_MODE_3
+ out (PORT_B_CTRL), a
+ ld a, #0x7F
+ out (PORT_B_CTRL), a
+ in a, (PORT_B_DATA)
+ and #0x02 ; is KEY2 pressed? If so, start booloader
+ jr NZ, main
+ ;; Load payload (bootloader)
+ ld HL, #0x7000
+ ld DE, #0x8000
+ ld BC, #0x1000
+ ldir
+ ;; Start bootloader
+ jp 0x8000
+main:
call gsinit
call _main
1$:
diff --git a/asm/isr.asm b/asm/isr.asm
index ad810e5..4a160a0 100644
--- a/asm/isr.asm
+++ b/asm/isr.asm
@@ -4,7 +4,7 @@
_ctc0_isr_ptr::
.dw #0
_ctc1_isr_ptr::
- .dw #_ctc1_isr
+ .dw #0
_ctc2_isr_ptr::
.dw #_timer
_ctc3_isr_ptr::
@@ -14,4 +14,4 @@ _port_a_isr_ptr::
_port_b_isr_ptr::
.dw #_input_event
_rx_isr_ptr::
- .dw #_rx_isr
+ .dw #0