Fix bugs from first pass on real hardware

This commit is contained in:
mgcaret 2017-03-10 20:33:23 -08:00
parent 53d96913a1
commit 680318ef47
5 changed files with 22 additions and 34 deletions

View File

@ -2,7 +2,7 @@
.text
* = boot5x ; 234 bytes available, code assembles to 231 when
; next line uncommented
; jsr ntitle ; TODO "Apple IIc +"
jsr titl5x ; TODO "Apple IIc +"
jsr rdrecov ; try to recover ramdisk
lda power2 + rx_mslot ; get action saved by reset5x
beq boot4 ; if zero, continue boot

View File

@ -5,6 +5,7 @@
bra dobann
bra gtkey
bra confirm
bra ntitle
dobann jsr ntitle
ldx #(msg2-msg1) ; msg display entry point
jmp disp
@ -21,10 +22,7 @@ kbdin lda kbd ; get key
sta ($0),y ; put it on screen
rts
; display message, input x = message start relative to msg1
disp stz $0 ; load some safe defaults
lda #$40
sta $1
ldy #$0 ; needs to be zero
disp ldy #$0 ; needs to be zero
disp0 lda msg1,x ; get message byte
bne disp1 ; proceed if nonzero
rts ; exit if 0
@ -56,19 +54,20 @@ confirm pha
; which switches banks and "rts" to the title/banner firmware call
; which then "rts" to swrts (same addr as swrts2, but main bank)
; which then actually rts to our caller
ntitle lda #>(swrts2-1) ; put return addr of swrts2 on stack
ntitle lda #>(swrts2-1) ; put return addr of swrts/swrts2 on stack
pha
lda #<(swrts2-1)
pha
lda #>(banner-1)
lda #>(banner-1) ; put addr of the Title routine on the stack
pha
lda #<(banner-1)
pha
lda #>(swrts2-1)
pha
lda #<(swrts2-1)
pha
rts ; jump to swrts2
;lda #>(swrts2-1) ; put swrts on the stack
;pha
;lda #<(swrts2-1)
;pha
;rts ; jump to swrts2
jmp swrts2 ; jump to swrts2
; msg format
; A byte < $20 indicates high byte of address.
; Next byte must be low byte of address. Anything
@ -84,7 +83,7 @@ msg1 = *
.db $04,$2e,"6 Boot 5.25"
; .db $04,$ae,"7 Accelerator"
.db $07,$5f,"By M.G."
msg2 .db $07,$db,"ROM 5X 02/08/17"
msg2 .db $07,$db,"ROM 5X 02/10/17"
.db $05,$ae,$00 ; cursor pos in menu
msg3 .db $05,$b0,"SURE? ",$00

View File

@ -6,11 +6,11 @@
pha
lda #<(rst5xrtn-1)
pha ; note that this stays on stack
asl butn1 ; closed apple
asl butn1 ; option (closed apple)
bcs ckdiag
exitrst jmp swrts2
; check to see if both apples are down
ckdiag bit butn0 ; open apple
; check to see if cmd_option (both apples) are down
ckdiag bit butn0 ; command (open apple)
bmi exitrst ; return to RESET.X
; present menu because only closed apple is down
menu jsr menu5x ; display menu
@ -33,7 +33,7 @@ doconf jsr conf5x
ckkey2 sec
sbc #$b0 ; ascii->number
bmi menu ; < 0 not valid
cmp #$08 ; we will use 7 for accelerator later
cmp #$07 ; we will use 7 for accelerator later
bpl menu ; > 7 not valid
sta power2 + rx_mslot ; for boot5x
stz softev + 1 ; deinit coldstart

View File

@ -33,12 +33,16 @@ task :build_rom => [:assemble] do
bnum = $1.to_i(16)
badd = $2.to_i(16)
addr = bnum * 16384 + badd - rom_base
puts "Loading #{t} into bank #{bnum} @ #{badd.to_s(16)}, file addr #{addr.to_s(16)}"
fc = File.read(t)
fl = fc.bytes.count
puts "Loading #{t} into bank #{bnum} @ $#{badd.to_s(16)}, file addr $#{addr.to_s(16)}, len $#{fl.to_s(16)} (#{fl})"
nzc = 0
fc.each_byte do |b|
nzc += 1 if rom.getbyte(addr) != 0
rom.setbyte(addr, b)
addr += 1
end
puts "\tNote: patched over #{nzc} nonzero bytes!" if nzc > 0
else
puts "I dont know where to load #{t}"
end

View File

@ -50,21 +50,6 @@ menu5x = misc5x
bann5x = menu5x+2
gkey5x = bann5x+2
conf5x = gkey5x+2
titl5x = conf5x+2
banner = $fb60
; macros
#define psa(addr) \
lda #>(addr-1) \
pha \
lda #<(addr-1) \
pha \
jsr swrts2
#define rtj(addr) \
psa(addr) \
rts
#define rtl(addr) \
psa(addr) \
jmp swrts2