Update code comments and Rakefile

This commit is contained in:
mgcaret 2017-03-11 00:19:40 -08:00
parent 680318ef47
commit aa0ee5829a
7 changed files with 55 additions and 22 deletions

View File

@ -1,6 +1,13 @@
; This is the dispatch routine to call the primary ROM 5X
; functions of intercepting RESET and the boot process.
; If one enters at $CFF9, the command $A9 is loaded and
; we go to the BELL1 hijack. If entering at $CFFA, we
; load the command $EA and proceed the same way.
; thus we get two dispatch codes in 6 bytes.
#include "iic+.defs"
.text
* = $cff9 ; 7 bytes available here
* = $cff9 ; 7 bytes available here, but don't count on $CFFF
lda #$a9 ; lda opcode
nop ; jmp/jsr $cffa does lda #$ea
jmp $fbdf ; jump to bell1 hijack

View File

@ -1,3 +1,20 @@
; Hijack the BELL1 monitor routine to do our bidding.
; BELL1 implements the beep sound heard on reset or
; Ctrl-G, etc. It starts with
; LDA #$40
; JSR WAIT ; delay .1 sec
; followed by code to actually beep the speaker
; In our case, BELL1 always loads the accumulator with
; a fixed number, and executes a 3-byte instruction
; Well, it turns out that to switch banks we need
; 3 bytes, and as luck would have it the other bank
; is empty here.
; So the routine on the other side is the ROM 5X
; dispatcher. It will take what is in the accumulator
; and use that to determine the next action.
; Obviously, $40 should beep the speaker, anything
; else can do whatever we want.
.text
* = $fbdf
sta $c028

View File

@ -0,0 +1,13 @@
; Patch the Apple IIc+ diagnostics to skip the ROM checksum test.
; We should really examine the routine at $D249 in the aux firmware
; to see if we can calculate a new checksum.
; the $D249 routine copies a small routine into the zero page that
; calculates the checksum. It returns with carry set = error and
; carry clear = OK. So we just patch the JSR to always clear the
; carry. For now.
* = $C53D
.text
nop
nop
clc

View File

@ -1,8 +1,7 @@
#include "iic+.defs"
.text
* = boot5x ; 234 bytes available, code assembles to 231 when
; next line uncommented
jsr titl5x ; TODO "Apple IIc +"
* = boot5x ; 234 bytes available, code assembles to 231
jsr titl5x ; "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

@ -1,11 +1,11 @@
#include "iic+.defs"
.text
* = misc5x ; max 306 bytes
bra domenu
bra dobann
bra gtkey
bra confirm
bra ntitle
bra domenu ; Display menu
bra dobann ; Display banner (title + By MG)
bra gtkey ; get a key
bra confirm ; ask SURE?
bra ntitle ; display "Apple IIc +"
dobann jsr ntitle
ldx #(msg2-msg1) ; msg display entry point
jmp disp
@ -50,10 +50,11 @@ confirm pha
plp
rts
; display "Apple IIc +" in a convoluted manner
; ultimately, the rts instruction here "rts" to swrts2
; 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
; we push the address of swrts/swrts2 onto the stack
; and then the address of the title routine
; we then jump to swrts2 which switches banks and RTS to
; display "Apple IIc +", which then RTS to swrts, which
; switches banks back to here and RTS to our caller.
ntitle lda #>(swrts2-1) ; put return addr of swrts/swrts2 on stack
pha
lda #<(swrts2-1)
@ -62,11 +63,6 @@ ntitle lda #>(swrts2-1) ; put return addr of swrts/swrts2 on stack
pha
lda #<(banner-1)
pha
;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.

View File

@ -8,10 +8,10 @@ chk2: cmp #$ea ; boot patch
bne dowait
jmp boot5x
dowait: jsr $fcb5 ; do delay if anything else
lda #>($fbe2-1)
pha
lda #<($fbe2-1)
lda #>($fbe2-1) ; return to other bank here
pha ; by pushing address onto
lda #<($fbe2-1) ; the stack
pha
lda #$00 ; in case someone assumes this
jmp swrts2
jmp swrts2 ; back to other bank
; 28 bytes, will have to move if we get bigger

View File

@ -12,6 +12,7 @@ end
desc "Clean object files"
task :clean do
sh "rm -f #{dest_rom}"
sh "rm -f sf512_#{dest_rom}"
sh "rm -f *.o65"
sh "rm -f *.o65.lbl"
end