From 6eb9613a28541db95de86a233d9d6e3dac724f7b Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Sun, 10 Dec 2017 20:22:34 -0800 Subject: [PATCH] More tidying, size assert --- Makefile | 2 +- bbb.s => bbb.system.s | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) rename bbb.s => bbb.system.s (98%) diff --git a/Makefile b/Makefile index a934e1a..30b08a1 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ CC65 = ~/dev/cc65/bin CAFLAGS = --target apple2enh --list-bytes 0 CCFLAGS = --config apple2-asm.cfg -TARGETS = bbb.SYS +TARGETS = bbb.system.SYS bbb2.system.SYS .PHONY: clean all all: $(TARGETS) diff --git a/bbb.s b/bbb.system.s similarity index 98% rename from bbb.s rename to bbb.system.s index 0e3a1b9..93e18db 100644 --- a/bbb.s +++ b/bbb.system.s @@ -103,15 +103,14 @@ ASCII_ESCAPE := $1B num_entries := $68 ; length of |filenames| curr_len := $69 ; length of current entry name curr_ptr := $6C ; address of current entry name (in |filenames|) - page_start := $73 ; index of first entry shown on screen prefix_depth := $6B ; 0 = root entry_length := $6E entries_per_block := $6F file_count := $70 ; 2 bytes - entry_num := $72 + page_start := $73 ; index of first entry shown on screen max_entries := 128 ; max # of entries; more are ignored types_table := $74 ; high bit clear = dir, set = sys @@ -128,8 +127,8 @@ ASCII_ESCAPE := $1B stz RESETVEC lda #>bbb sta RESETVEC+1 + jsr SETPWRC ; update validity check byte - jsr SETPWRC lda #$A0 jsr SLOT3 ; Activate 80-Column Firmware @@ -144,7 +143,7 @@ ASCII_ESCAPE := $1B ;; Find device lda #2 - sta $60 + sta mark_params ldx DEVCNT ; max device num stx next_device_num lda DEVNUM @@ -213,7 +212,7 @@ check_device: sta read_params_request lda #1 - sta entry_num ; ??? + sta entry_num stz mark_position+1 stz mark_position+2 @@ -451,7 +450,7 @@ done: rts next_drive: jmp next_device -dec_resize_prefix_and_open: +inc_resize_prefix_and_open: inx resize_prefix_and_open_jmp: @@ -476,7 +475,7 @@ resize_prefix_and_open_jmp: ldy current_entry lda types_table,y - bpl dec_resize_prefix_and_open ; is directory??? + bpl inc_resize_prefix_and_open ; is directory??? ;; nope, system file, so... ;; fall through @@ -511,11 +510,11 @@ cout_string_hpos: sta CH .proc cout_string - lda help_string,y +loop: lda help_string,y beq done jsr COUT iny - bne cout_string + bne loop done: rts .endproc @@ -650,6 +649,8 @@ trans: .word 0 read_params_ref_num := read_params::ref_num read_params_request := read_params::request + .assert read_params::request - bbb <= $300, error, "Must fit in $300 bytes" + ;;; ------------------------------------------------------------ .res $13FF-*-2, 0