overlay 6

This commit is contained in:
Joshua Bell 2018-02-20 20:36:46 -08:00
parent 6225082ec6
commit 8ac6630bcf
8 changed files with 184 additions and 43 deletions

View File

@ -79,6 +79,29 @@ label := *
.endmacro .endmacro
;;; ==================================================
;;; Relays from Main to Aux (params must be in ZP or LC)
MGTK_RELAY := $D000
DESKTOP_RELAY := $D040
.macro MGTK_RELAY_CALL call, addr
.if .paramcount > 1
yax_call MGTK_RELAY, (call), (addr)
.else
yax_call MGTK_RELAY, (call), 0
.endif
.endmacro
.macro DESKTOP_RELAY_CALL call, addr
.if .paramcount > 1
yax_call DESKTOP_RELAY, (call), (addr)
.else
yax_call DESKTOP_RELAY, (call), 0
.endif
.endmacro
;;; ================================================== ;;; ==================================================
;;; Internals - Windows (paths) and Icons (files) ;;; Internals - Windows (paths) and Icons (files)

View File

@ -4,7 +4,7 @@ CAFLAGS = --target apple2enh --list-bytes 0
CCFLAGS = --config asm.cfg CCFLAGS = --config asm.cfg
TARGETS = loader.built mgtk.built desktop.built invoker.built \ TARGETS = loader.built mgtk.built desktop.built invoker.built \
ovl1.built ovl5.built ovl1.built ovl5.built ovl6.built
.PHONY: clean all .PHONY: clean all
all: $(TARGETS) all: $(TARGETS)

View File

@ -18,13 +18,6 @@ INVOKER_FILENAME := $280 ; File to invoke (PREFIX must be set)
dummy0000 := $0000 ; overwritten by self-modified code dummy0000 := $0000 ; overwritten by self-modified code
dummy1234 := $1234 ; overwritten by self-modified code dummy1234 := $1234 ; overwritten by self-modified code
.macro MGTK_RELAY_CALL call, addr
.if .paramcount > 1
yax_call MGTK_RELAY, (call), (addr)
.else
yax_call MGTK_RELAY, (call), 0
.endif
.endmacro
;;; ================================================== ;;; ==================================================
;;; Segment loaded into AUX $851F-$BFFF (follows MGTK) ;;; Segment loaded into AUX $851F-$BFFF (follows MGTK)
@ -4111,8 +4104,9 @@ addr: .addr 0
;;; ================================================== ;;; ==================================================
;;; MGTK call from main>aux, call in Y, params at (X,A) ;;; MGTK call from main>aux, call in Y, params at (X,A)
.proc MGTK_RELAY
.assert * = $D000, error, "Entry point mismatch" .proc MGTK_RELAY_IMPL
.assert * = MGTK_RELAY, error, "Entry point mismatch"
sty addr-1 sty addr-1
stax addr stax addr
sta RAMRDON sta RAMRDON
@ -4142,7 +4136,8 @@ addr: .addr 0
;;; ================================================== ;;; ==================================================
;;; DESKTOP call from main>aux, call in Y params at (X,A) ;;; DESKTOP call from main>aux, call in Y params at (X,A)
.proc DESKTOP_RELAY .proc DESKTOP_RELAY_IMPL
.assert * = DESKTOP_RELAY, error, "Entry point mismatch"
sty addr-1 sty addr-1
stax addr stax addr
sta RAMRDON sta RAMRDON
@ -4155,16 +4150,6 @@ addr: .addr 0
rts rts
.endproc .endproc
.macro DESKTOP_RELAY_CALL call, addr
ldy #(call)
.if .paramcount > 1
ldax #(addr)
.else
ldax #0
.endif
jsr DESKTOP_RELAY
.endmacro
;;; ================================================== ;;; ==================================================
;;; Used/Free icon map (Aux $1F80 - $1FFF) ;;; Used/Free icon map (Aux $1F80 - $1FFF)

BIN
desktop/orig/DESKTOP2_ovl6 Normal file

Binary file not shown.

View File

@ -9,9 +9,6 @@
.include "../desktop.inc" .include "../desktop.inc"
.include "../macros.inc" .include "../macros.inc"
MGTK_RELAY := $D000
DESKTOP_RELAY := $D040
;;; ================================================== ;;; ==================================================
;;; Overlay for Disk Copy ;;; Overlay for Disk Copy
;;; ================================================== ;;; ==================================================
@ -78,9 +75,9 @@ str_desktop2:
start: lda #$80 start: lda #$80
sta ptr sta ptr
yax_call DESKTOP_RELAY, $6, $0 DESKTOP_RELAY_CALL $6, $0
yax_call MGTK_RELAY, MGTK::CloseAll, $0 MGTK_RELAY_CALL MGTK::CloseAll, $0
yax_call MGTK_RELAY, MGTK::SetZP1, ptr MGTK_RELAY_CALL MGTK::SetZP1, ptr
;; Copy menu bar up to language card, and use it. ;; Copy menu bar up to language card, and use it.
ldx #.sizeof(menu_bar) ldx #.sizeof(menu_bar)
@ -88,7 +85,7 @@ start: lda #$80
sta $D400,x sta $D400,x
dex dex
bpl :- bpl :-
yax_call MGTK_RELAY, MGTK::SetMenu, menu_target MGTK_RELAY_CALL MGTK::SetMenu, menu_target
;; Clear most of the system bitmap ;; Clear most of the system bitmap
ldx #BITMAP_SIZE - 3 ldx #BITMAP_SIZE - 3

View File

@ -8,9 +8,6 @@
.include "../desktop.inc" .include "../desktop.inc"
.include "../macros.inc" .include "../macros.inc"
MGTK_RELAY := $D000
DESKTOP_RELAY := $D040
;;; ================================================== ;;; ==================================================
;;; Overlay for File Copy ;;; Overlay for File Copy
;;; ================================================== ;;; ==================================================
@ -87,11 +84,11 @@ L7052: lda winfo12
addr_call L5E0A, $DA67 ; "Copy a File ..." addr_call L5E0A, $DA67 ; "Copy a File ..."
addr_call L5E57, $DA77 ; "Source filename:" addr_call L5E57, $DA77 ; "Source filename:"
addr_call L5E6F, $DA88 ; "Destination filename:" addr_call L5E6F, $DA88 ; "Destination filename:"
yax_call MGTK_RELAY, MGTK::SetPenMode, $D202 ; penXOR MGTK_RELAY_CALL MGTK::SetPenMode, $D202 ; penXOR
yax_call MGTK_RELAY, MGTK::FrameRect, $DA9E MGTK_RELAY_CALL MGTK::FrameRect, $DA9E
yax_call MGTK_RELAY, MGTK::FrameRect, $DAAA MGTK_RELAY_CALL MGTK::FrameRect, $DAAA
yax_call MGTK_RELAY, MGTK::InitPort, $D239 ; grafport3 MGTK_RELAY_CALL MGTK::InitPort, $D239 ; grafport3
yax_call MGTK_RELAY, MGTK::SetPort, $D239 MGTK_RELAY_CALL MGTK::SetPort, $D239
rts rts
.macro entry arg1, arg2 .macro entry arg1, arg2
@ -182,7 +179,7 @@ L7156: lda path_buf0,x
beq L7162 beq L7162
dex dex
bne L7156 bne L7156
L7162: ldy #$02 L7162: ldy #2
dex dex
L7165: cpx path_buf0 L7165: cpx path_buf0
beq L7178 beq L7178
@ -212,8 +209,8 @@ L7192: lda #$40
L7198: addr_call L647C, path_buf1 L7198: addr_call L647C, path_buf1
bne L7192 bne L7192
yax_call MGTK_RELAY, MGTK::CloseWindow, winfo15 MGTK_RELAY_CALL MGTK::CloseWindow, winfo15
yax_call MGTK_RELAY, MGTK::CloseWindow, winfo12 MGTK_RELAY_CALL MGTK::CloseWindow, winfo12
lda #0 lda #0
sta $50A8 sta $50A8
lda #0 lda #0
@ -231,8 +228,8 @@ L71C0: copy16 #path_buf0, $6
;;; ================================================== ;;; ==================================================
L71D8: yax_call MGTK_RELAY, MGTK::CloseWindow, winfo15 L71D8: MGTK_RELAY_CALL MGTK::CloseWindow, winfo15
yax_call MGTK_RELAY, MGTK::CloseWindow, winfo12 MGTK_RELAY_CALL MGTK::CloseWindow, winfo12
lda #0 lda #0
sta $D8EC sta $D8EC
jsr L55BA jsr L55BA
@ -282,7 +279,7 @@ L7209: lda L709B+1,x
bit $D8F0 bit $D8F0
bpl L726D bpl L726D
jsr L5E87 jsr L5E87
lda #$00 lda #0
jsr L6227 jsr L6227
jsr L5F5B jsr L5F5B
jsr L6161 jsr L6161

139
desktop/ovl6.s Normal file
View File

@ -0,0 +1,139 @@
.setcpu "6502"
.include "apple2.inc"
.include "../inc/apple2.inc"
.include "../inc/auxmem.inc"
.include "../inc/prodos.inc"
.include "../mgtk.inc"
.include "../desktop.inc"
.include "../macros.inc"
;;; ==================================================
;;; Overlay for File Delete
;;; ==================================================
.proc file_delete_overlay
.org $7000
winfo12 := $D5B7
winfo15 := $D5F1
path_buf0 := $D402
path_buf1 := $D443
path_buf2 := $D484
grafport3 := $D239
L4030 := $4030
;;; Routines in common overlay segment ($5000-$6FFF)
L5106 := $5106
L55BA := $55BA
L5CF7 := $5CF7
L5E0A := $5E0A
L5E57 := $5E57
L5E87 := $5E87
L5F5B := $5F5B
L606D := $606D
L6161 := $6161
L61B1 := $61B1
L62C8 := $62C8
L647C := $647C
L6D27 := $6D27
L6D30 := $6D30
jsr L5CF7
jsr L704D
jsr L5E87
jsr L5F5B
jsr L6161
jsr L61B1
jsr L606D
jsr L7026
jsr L6D30
jsr L6D27
lda #$FF
sta $D8EC
jmp L5106
L7026: ldx L7086
L7029: lda L7087,x
sta $6D1E,x
dex
lda L7087,x
sta $6D1E,x
dex
dex
bpl L7029
lda #$00
sta path_buf0
sta $51AE
lda #$01
sta path_buf2
lda #$06
sta path_buf2+1 ; ???
rts
L704D: lda winfo12
jsr L62C8
addr_call L5E0A, $DAB6 ; "Delete a File ..."
addr_call L5E57, $DAC8 ; "File to delete:"
yax_call MGTK_RELAY, MGTK::SetPenMode, $D202 ; penXOR
yax_call MGTK_RELAY, MGTK::FrameRect, $DA9E
yax_call MGTK_RELAY, MGTK::InitPort, grafport3
yax_call MGTK_RELAY, MGTK::SetPort, grafport3
rts
.macro entry arg1, arg2
.byte arg1
.addr arg2
.endmacro
L7086: .byte $29 ; length of the following data block
L7087: entry 0, L70B1
entry 0, L70EA
entry 0, $6593
entry 0, $664E
entry 0, $6DC2
entry 0, $6DD0
entry 0, $6E1D
entry 0, $69C6
entry 0, $6A18
entry 0, $6A53
entry 0, $6AAC
entry 0, $6B01
entry 0, $6B44
entry 0, $66D8
L70B1: addr_call L647C, path_buf0
beq L70C0
lda #$40
jsr L4030
rts
L70C0: yax_call MGTK_RELAY, MGTK::CloseWindow, winfo15
yax_call MGTK_RELAY, MGTK::CloseWindow, winfo12
lda #0
sta $D8EC
jsr L55BA
copy16 #path_buf0, $6
ldx $50AA
txs
lda #0
rts
.byte 0
L70EA: yax_call MGTK_RELAY, MGTK::CloseWindow, winfo15
yax_call MGTK_RELAY, MGTK::CloseWindow, winfo12
lda #0
sta $D8EC
jsr L55BA
ldx $50AA
txs
lda #$FF
rts
PAD_TO $7800
.endproc

View File

@ -31,7 +31,7 @@ function stats {
#do_make clean #do_make clean
do_make all do_make all
TARGETS="loader mgtk desktop invoker ovl1 ovl5" TARGETS="loader mgtk desktop invoker ovl1 ovl5 ovl6"
# Verify original and output match # Verify original and output match
echo "Verifying diffs:" echo "Verifying diffs:"