rom4x/rom5x/B1_DB63_reset5x.s

48 lines
1.1 KiB
ArmAsm
Raw Normal View History

2017-03-19 03:00:43 +00:00
.code
.psc02
.include "iic+.defs"
.org reset5x ; max 157 bytes
2017-02-12 19:53:47 +00:00
stz power2 + rx_mslot ; action = normal reset
lda #>(rst5xrtn-1) ; common case
pha
lda #<(rst5xrtn-1)
pha ; note that this stays on stack
asl butn1 ; option (closed apple)
2017-02-12 19:53:47 +00:00
bcs ckdiag
2017-03-19 03:00:43 +00:00
exitrst: jmp swrts2
; check to see if cmd_option (both apples) are down
2017-03-19 03:00:43 +00:00
ckdiag: bit butn0 ; command (open apple)
2017-02-12 19:53:47 +00:00
bmi exitrst ; return to RESET.X
; present menu because only closed apple is down
2017-03-19 03:00:43 +00:00
menu: jsr menu5x ; display menu
2017-02-12 19:53:47 +00:00
jsr gkey5x
cmp #$b0 ; "0"
bne ckkey1
ldx #$ff ; reset stack
txs
lda #>(monitor-1) ; monitor entry on stack
pha
lda #<(monitor-1)
pha
jmp swrts2 ; rts to enter monitor
2017-03-19 03:00:43 +00:00
ckkey1: cmp #$b2 ; "2"
2017-02-12 19:53:47 +00:00
beq doconf
cmp #$b4 ; "4"
bne ckkey2
2017-03-19 03:00:43 +00:00
doconf: jsr conf5x
2017-02-12 19:53:47 +00:00
bne menu ; go back to menu4x
ckkey2: cmp #$b7 ; "7"
bne ckkey3
jsr $fd02 ; accelerator menu
bra menu
ckkey3: sec
2017-02-12 19:53:47 +00:00
sbc #$b0 ; ascii->number
bmi menu ; < 0 not valid
cmp #$07 ; we will use 7 for accelerator later
2017-02-12 19:53:47 +00:00
bpl menu ; > 7 not valid
sta power2 + rx_mslot ; for boot5x
stz softev + 1 ; deinit coldstart
stz pwerdup ; ditto
bra exitrst