From 095f87813e8f4d4fe84229310d907145861b789f Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Fri, 4 Oct 2019 18:29:35 -0700 Subject: [PATCH] BYE.SYSTEM: Chain rather than QUITing immediately. Fixes #4 --- bbb/README.md | 4 +- bbb/buhbye.system.s | 5 +- bbb/bye.system.s | 138 ++++++++++++++++++++------------------------ 3 files changed, 68 insertions(+), 79 deletions(-) diff --git a/bbb/README.md b/bbb/README.md index 9a39298..94556ba 100644 --- a/bbb/README.md +++ b/bbb/README.md @@ -42,7 +42,9 @@ Since I really liked the look of _Bird's Better Bye_ I used this as the boot system for my virtual hard drive (occuring after some [clock drivers](https://github.com/a2stuff/cricket)). -## Buh-Bye +This is a modified version that chains to the next `.SYSTEM` file instead of immediately launching the selector. You can follow it with `QUIT.SYSTEM` in your driver sequence if you want to show the selector on startup. + +## BUHBYE.SYSTEM But... I really wanted a way to quickly scroll through my games list. So I set out to improve _Bird's Better Bye_ by disassembling it (and diff --git a/bbb/buhbye.system.s b/bbb/buhbye.system.s index 87e2a4c..d61f7f6 100644 --- a/bbb/buhbye.system.s +++ b/bbb/buhbye.system.s @@ -34,7 +34,7 @@ ;;; Installer ;;; ------------------------------------------------------------ - install_size := $300 ; must fit in $D100...$D3FF = $300 + max_size = $300 .proc maybe_install_driver @@ -667,7 +667,8 @@ cout: jmp COUT ;;; ------------------------------------------------------------ .endproc - .assert .sizeof(selector) <= install_size, error, "Must fit in $300 bytes" + .assert .sizeof(selector) <= max_size, error, "Must fit in $300 bytes" + install_size = .sizeof(selector) poporg ;;; ************************************************************ diff --git a/bbb/bye.system.s b/bbb/bye.system.s index 62d18d8..68bc886 100644 --- a/bbb/bye.system.s +++ b/bbb/bye.system.s @@ -1,17 +1,22 @@ ;;; Disassembly of BYE.SYSTEM (Bird's Better Bye) +;;; Modifications by Joshua Bell inexorabletash@gmail.com +;;; * installs, then chains to next .SYSTEM file .setcpu "65C02" + .linecont + + .feature string_escapes + .include "apple2.inc" .include "apple2.mac" .include "../inc/apple2.inc" + .include "../inc/macros.inc" .include "../inc/prodos.inc" .include "../inc/ascii.inc" -;;; ------------------------------------------------------------ - -.define HI(char) (char|$80) - +;;; ************************************************************ + .include "../inc/driver_preamble.inc" +;;; ************************************************************ ;;; ------------------------------------------------------------ @@ -23,21 +28,63 @@ ;;; area is Apple's dispatcher code. ;;; ------------------------------------------------------------ -;;; Entry point +;;; Installer ;;; ------------------------------------------------------------ - ;; Loads at $2000 but executed at $1000. + max_size = $300 - .org $2000 +.proc maybe_install_driver + + src := install_src + end := install_src + install_size + dst := $D100 ; Install location in ProDOS (bank 2) + + src_ptr := $19 + dst_ptr := $1B + + sta ALTZPOFF + lda ROMIN + lda ROMIN + lda #>src + sta src_ptr+1 + lda #dst + sta dst_ptr+1 + lda #end + bne loop + lda src_ptr + cmp #src - sta src_ptr+1 - lda #dst - sta dst_ptr+1 - lda #end - bne loop - lda src_ptr - cmp #