From 9b98a09067cfd60ccfc254744824ffbb0589f303 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Wed, 19 Jun 2019 20:21:10 -0700 Subject: [PATCH] rearrange config/data --- inc/prodos.inc | 4 ++++ ram.drv.system.s | 42 ++++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/inc/prodos.inc b/inc/prodos.inc index b3ccfb3..637e44e 100644 --- a/inc/prodos.inc +++ b/inc/prodos.inc @@ -29,6 +29,10 @@ SELECTOR := $D100 BLOCK_SIZE = $200 +PATHNAME := $280 +SYS_ADDR := $2000 ; Load address for SYS files +SYS_LEN = $BF00 - SYS_ADDR ; Maximum SYS file length + ;;; ============================================================ ;;; MLI Calls ;;; ============================================================ diff --git a/ram.drv.system.s b/ram.drv.system.s index 5911465..ed27caa 100644 --- a/ram.drv.system.s +++ b/ram.drv.system.s @@ -17,25 +17,6 @@ .include "opcodes.inc" -zp_sig_addr := $06 - -zpproc_addr := $B0 -zpproc_relay_addr := $2D0 - -PATHNAME := $280 - -data_buf := $1C00 ; I/O when chaining to next SYS file -driver_target := $FF00 ; Install location in ProDOS - - -kMaxUsableBanks = 24 ; Why is this capped so low??? - ; (driver has room for another ~20?) - -SYS_ADDR := $2000 ; Load address for SYS files -SYS_LEN = $BF00 - SYS_ADDR ; Maximum SYS file length - - .define PRODUCT "RAMWorks RAM Disk" - ;;; ============================================================ ;; SYS files load at $2000; relocates self to $1000 @@ -92,10 +73,12 @@ sys_start: ;; Save most recent device for later, when chaining ;; to next .SYSTEM file. lda DEVNUM - sta read_block_params_unit_num + sta devnum rts .endproc +devnum: .byte 0 +self_name: .res 16 ;;; ============================================================ ;;; Find and invoke the next .SYSTEM file @@ -149,6 +132,8 @@ cloop: iny ;; Read directory and look for .SYSTEM files; find this ;; one, and invoke the following one. read_dir: + lda devnum + sta read_block_params_unit_num jsr read_block lda data_buf + VolumeDirectoryHeader::entry_length @@ -363,6 +348,20 @@ found_self_flag: ;;; ============================================================ ;;; Configuration Parameters + .define PRODUCT "RAMWorks RAM Disk" + +zp_sig_addr := $06 + +zpproc_addr := $B0 +zpproc_relay_addr := $2D0 + +data_buf := $1C00 ; I/O when chaining to next SYS file +driver_target := $FF00 ; Install location in ProDOS + + +kMaxUsableBanks = 24 ; Why is this capped so low??? + ; (driver has room for another ~20?) + banks_to_reserve: .byte 0 ; banks to reserve (e.g. for AppleWorks) unitnum: .byte $03 ; S3D1; could be $B for S3D2 @@ -1055,9 +1054,8 @@ map1 := *+2 ; len: $80 map2 := *+2+$80 ; len: $80 stash_00 := *+2+$100 ; len: $80 stash_01 := *+2+$180 ; len: $80 -self_name := *+2+$200 ; len: 65 - .assert self_name + 64 < data_buf, error, "Too long" + .assert stash_01+$80 < data_buf, error, "Too long" ;;; ============================================================ ;;; End of relocated code