From 3f9f64a504db80a1b5c5066e5dd3c9ac934d9106 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Mon, 19 Feb 2018 20:18:58 -0800 Subject: [PATCH] Start work on first overlay --- desktop/Makefile | 2 +- desktop/README.md | 1 + desktop/ovl1.s | 125 ++++++++++++++++++++++++++++++++++++++++++++++ desktop/res/go.sh | 2 +- inc/apple2.inc | 2 +- 5 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 desktop/ovl1.s diff --git a/desktop/Makefile b/desktop/Makefile index 5dca6aa..623f644 100644 --- a/desktop/Makefile +++ b/desktop/Makefile @@ -3,7 +3,7 @@ CC65 = ~/dev/cc65/bin CAFLAGS = --target apple2enh --list-bytes 0 CCFLAGS = --config asm.cfg -TARGETS = loader.built mgtk.built desktop.built invoker.built +TARGETS = loader.built mgtk.built desktop.built invoker.built ovl1.built .PHONY: clean all all: $(TARGETS) diff --git a/desktop/README.md b/desktop/README.md index 3275262..44fbb50 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -24,6 +24,7 @@ The file is broken down into multiple segments: * segment 6: main - A$0290-$03EF, L$0160, mark $012E80 (Invoker) * overlays dynamically loaded for these actions: * disk copy - A$0800, L$0200, mark $012FE0 + * _(there's a $2F00 gap here - TBD)_ * format/erase - A$0800, L$1400, mark $0160E0 * selector - A$9000, L$1000, mark $0174E0 * common - A$5000, L$2000, mark $0184E0 (used by selector, copy, delete) diff --git a/desktop/ovl1.s b/desktop/ovl1.s new file mode 100644 index 0000000..cd2aa00 --- /dev/null +++ b/desktop/ovl1.s @@ -0,0 +1,125 @@ + + .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" + +L1800 := $1800 +MGTK_RELAY := $D000 +DESKTOP_RELAY := $D040 + +;;; ================================================== +;;; Overlay for Disk Copy +;;; ================================================== + + .org $800 + +.proc disk_copy_overlay + jmp start + +;;; ================================================== +;;; Menu - relocated up ot $D400 + + menu_target := $D400 + +.proc menu_bar + DEFINE_MENU_BAR 1 + DEFINE_MENU_BAR_ITEM 1, menu_target + (menu_label - menu_bar), menu_target + (menu - menu_bar) + +menu: DEFINE_MENU 1 + DEFINE_MENU_ITEM menu_target + (item_label - menu_bar) + +menu_label: + PASCAL_STRING " Disk copy version 1.1 " +item_label: + PASCAL_STRING "Rien" +.endproc + +;;; ================================================== + +L0842: .byte 3 + .addr str_desktop2 + .addr $1C00 + +L0847: .byte $00,$02 +L0849: .byte $00,$E0,$31,$01,$04 +L084E: .byte $00,$00,$18,$00,$02,$00,$00,$01 + .byte $00 + +str_desktop2: + PASCAL_STRING "DeskTop2" + + ptr := $6 + +start: lda #$80 + sta ptr + yax_call DESKTOP_RELAY, $6, $0 + yax_call MGTK_RELAY, MGTK::CloseAll, $0 + yax_call MGTK_RELAY, MGTK::SetZP1, ptr + + ;; Copy menu bar up to language card, and use it. + ldx #.sizeof(menu_bar) +L0881: lda menu_bar,x + sta $D400,x + dex + bpl L0881 + yax_call MGTK_RELAY, MGTK::SetMenu, menu_target + + ;; Clear most of the system bitmap + ldx #BITMAP_SIZE - 3 + lda #0 +: sta BITMAP+1,x + dex + bpl :- + + + ldy #$C8 + lda #$42 + ldx #$08 + jsr L08D3 + lda L0847 + sta L084E + sta L0849 + ldy #$CE + lda #$48 + ldx #$08 + jsr L08D3 + ldy #$CA + lda #$4D + ldx #$08 + jsr L08D3 + ldy #$CC + lda #$55 + ldx #$08 + jsr L08D3 + sta ALTZPOFF + lda $C082 + jmp L1800 + +L08D3: sty L08E7 + sta L08E8 + stx L08E9 + php + sei + sta ALTZPOFF + lda $C082 + jsr MLI +L08E7: brk +L08E8: brk +L08E9: brk + tax + sta ALTZPON + lda LCBANK1 + lda LCBANK1 + plp + txa +L08F6: bne L08F6 + rts + + PAD_TO $A00 +.endproc \ No newline at end of file diff --git a/desktop/res/go.sh b/desktop/res/go.sh index 492c339..2951726 100755 --- a/desktop/res/go.sh +++ b/desktop/res/go.sh @@ -31,7 +31,7 @@ function stats { #do_make clean do_make all -TARGETS="loader mgtk desktop invoker" +TARGETS="loader mgtk desktop invoker ovl1" # Verify original and output match echo "Verifying diffs:" diff --git a/inc/apple2.inc b/inc/apple2.inc index ecbdd1c..d5c0f8e 100644 --- a/inc/apple2.inc +++ b/inc/apple2.inc @@ -14,7 +14,7 @@ ROMIN2 := $C082 NEWVIDEO := $C029 ; IIgs - new video modes SHADOW := $C035 ; IIgs - inhibit shadowing -AN3_ON := $C05F ; Le Chat Mauve +AN3_ON := $C05F ; AppleColor Adapter Card / Le Chat Mauve AN3_OFF := $C05E HR1_ON := $C0B3 HR1_OFF := $C0B2