mirror of
https://github.com/mgcaret/rom4x.git
synced 2024-09-27 18:56:31 +00:00
Update code comments and Rakefile
This commit is contained in:
parent
680318ef47
commit
aa0ee5829a
@ -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"
|
#include "iic+.defs"
|
||||||
.text
|
.text
|
||||||
* = $cff9 ; 7 bytes available here
|
* = $cff9 ; 7 bytes available here, but don't count on $CFFF
|
||||||
lda #$a9 ; lda opcode
|
lda #$a9 ; lda opcode
|
||||||
nop ; jmp/jsr $cffa does lda #$ea
|
nop ; jmp/jsr $cffa does lda #$ea
|
||||||
jmp $fbdf ; jump to bell1 hijack
|
jmp $fbdf ; jump to bell1 hijack
|
||||||
|
@ -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
|
.text
|
||||||
* = $fbdf
|
* = $fbdf
|
||||||
sta $c028
|
sta $c028
|
||||||
|
13
rom5x/B1_C53D_patch_out_rom_cksum.s
Normal file
13
rom5x/B1_C53D_patch_out_rom_cksum.s
Normal 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
|
||||||
|
|
@ -1,8 +1,7 @@
|
|||||||
#include "iic+.defs"
|
#include "iic+.defs"
|
||||||
.text
|
.text
|
||||||
* = boot5x ; 234 bytes available, code assembles to 231 when
|
* = boot5x ; 234 bytes available, code assembles to 231
|
||||||
; next line uncommented
|
jsr titl5x ; "Apple IIc +"
|
||||||
jsr titl5x ; TODO "Apple IIc +"
|
|
||||||
jsr rdrecov ; try to recover ramdisk
|
jsr rdrecov ; try to recover ramdisk
|
||||||
lda power2 + rx_mslot ; get action saved by reset5x
|
lda power2 + rx_mslot ; get action saved by reset5x
|
||||||
beq boot4 ; if zero, continue boot
|
beq boot4 ; if zero, continue boot
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "iic+.defs"
|
#include "iic+.defs"
|
||||||
.text
|
.text
|
||||||
* = misc5x ; max 306 bytes
|
* = misc5x ; max 306 bytes
|
||||||
bra domenu
|
bra domenu ; Display menu
|
||||||
bra dobann
|
bra dobann ; Display banner (title + By MG)
|
||||||
bra gtkey
|
bra gtkey ; get a key
|
||||||
bra confirm
|
bra confirm ; ask SURE?
|
||||||
bra ntitle
|
bra ntitle ; display "Apple IIc +"
|
||||||
dobann jsr ntitle
|
dobann jsr ntitle
|
||||||
ldx #(msg2-msg1) ; msg display entry point
|
ldx #(msg2-msg1) ; msg display entry point
|
||||||
jmp disp
|
jmp disp
|
||||||
@ -50,10 +50,11 @@ confirm pha
|
|||||||
plp
|
plp
|
||||||
rts
|
rts
|
||||||
; display "Apple IIc +" in a convoluted manner
|
; display "Apple IIc +" in a convoluted manner
|
||||||
; ultimately, the rts instruction here "rts" to swrts2
|
; we push the address of swrts/swrts2 onto the stack
|
||||||
; which switches banks and "rts" to the title/banner firmware call
|
; and then the address of the title routine
|
||||||
; which then "rts" to swrts (same addr as swrts2, but main bank)
|
; we then jump to swrts2 which switches banks and RTS to
|
||||||
; which then actually rts to our caller
|
; 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
|
ntitle lda #>(swrts2-1) ; put return addr of swrts/swrts2 on stack
|
||||||
pha
|
pha
|
||||||
lda #<(swrts2-1)
|
lda #<(swrts2-1)
|
||||||
@ -62,11 +63,6 @@ ntitle lda #>(swrts2-1) ; put return addr of swrts/swrts2 on stack
|
|||||||
pha
|
pha
|
||||||
lda #<(banner-1)
|
lda #<(banner-1)
|
||||||
pha
|
pha
|
||||||
;lda #>(swrts2-1) ; put swrts on the stack
|
|
||||||
;pha
|
|
||||||
;lda #<(swrts2-1)
|
|
||||||
;pha
|
|
||||||
;rts ; jump to swrts2
|
|
||||||
jmp swrts2 ; jump to swrts2
|
jmp swrts2 ; jump to swrts2
|
||||||
; msg format
|
; msg format
|
||||||
; A byte < $20 indicates high byte of address.
|
; A byte < $20 indicates high byte of address.
|
||||||
|
@ -8,10 +8,10 @@ chk2: cmp #$ea ; boot patch
|
|||||||
bne dowait
|
bne dowait
|
||||||
jmp boot5x
|
jmp boot5x
|
||||||
dowait: jsr $fcb5 ; do delay if anything else
|
dowait: jsr $fcb5 ; do delay if anything else
|
||||||
lda #>($fbe2-1)
|
lda #>($fbe2-1) ; return to other bank here
|
||||||
pha
|
pha ; by pushing address onto
|
||||||
lda #<($fbe2-1)
|
lda #<($fbe2-1) ; the stack
|
||||||
pha
|
pha
|
||||||
lda #$00 ; in case someone assumes this
|
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
|
; 28 bytes, will have to move if we get bigger
|
||||||
|
@ -12,6 +12,7 @@ end
|
|||||||
desc "Clean object files"
|
desc "Clean object files"
|
||||||
task :clean do
|
task :clean do
|
||||||
sh "rm -f #{dest_rom}"
|
sh "rm -f #{dest_rom}"
|
||||||
|
sh "rm -f sf512_#{dest_rom}"
|
||||||
sh "rm -f *.o65"
|
sh "rm -f *.o65"
|
||||||
sh "rm -f *.o65.lbl"
|
sh "rm -f *.o65.lbl"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user