diff --git a/b.s b/b.s index 2eed2b2..0e3a1b9 100644 --- a/b.s +++ b/b.s @@ -4,65 +4,44 @@ .include "apple2.inc" .include "prodos.inc" +;;; Miscellaneous + RESETVEC := $3F2 -RAMRDOFF := $C002 -RAMRDON := $C003 -RAMWRTOFF := $C004 -RAMWRTON := $C005 -ALTZPOFF := $C008 -ALTZPON := $C009 -ROMINNW := $C082 -ROMINWB1 := $C089 +COL80HPOS := $57B + +;;; I/O Soft Switches / Firmware + +RAMRDOFF := $C002 ; If 80STORE Off: Read Main Mem $0200-$BFFF +RAMRDON := $C003 ; If 80STORE Off: Read Aux Mem $0200-$BFFF +RAMWRTOFF := $C004 ; If 80STORE Off: Write Main Mem $0200-$BFFF +RAMWRTON := $C005 ; If 80STORE Off: Write Aux Mem $0200-$BFFF +ALTZPOFF := $C008 ; Main Stack and Zero Page +ALTZPON := $C009 ; Aux Stack and Zero Page +ROMINNW := $C082 ; Read ROM; no write +ROMINWB1 := $C089 ; Read ROM; write RAM bank 1 + SLOT3 := $C300 -MON_SETTXT := $FB39 -MON_TABV := $FB5B +;;; Monitor + +SETTXT := $FB39 +TABV := $FB5B SETPWRC := $FB6F BELL1 := $FBDD -MON_HOME := $FC58 +HOME := $FC58 COUT := $FDED SETINV := $FE80 SETNORM := $FE84 -COL80HPOS := $057B - -;;; ProDOS -BITMAP := $BF58 -BITMAP_SIZE := $18 ; Bits for pages $00 to $BF -DEVNUM := $BF30 ; Most recent accessed device -DEVCNT := $BF31 ; Number of on-line devices minus 1 -DEVLST := $BF32 ; Up to 14 units - -.scope DirectoryHeader - entry_length := $23 - entries_per_block := $24 - file_count := $25 - - size := $2B -.endscope - -.scope FileEntry - storage_type := $00 ; high nibble - name_length := $00 ; low nibble - file_name := $01 - file_type := $10 - access := $1E -.endscope - -.scope FileType - Directory := $0F - System := $FF -.endscope - -;;; ASCII +;;; ASCII/Key codes ASCII_TAB := $9 ASCII_DOWN := $A ; down arrow ASCII_UP := $B ; up arrow ASCII_CR := $D ASCII_RIGHT := $15 ; right arrow -ASCII_SYN := $16 ; scroll up -ASCII_ETB := $17 ; scroll down +ASCII_SYN := $16 ; scroll text window up +ASCII_ETB := $17 ; scroll text window down ASCII_EM := $19 ; move cursor to upper left ASCII_ESCAPE := $1B @@ -330,10 +309,10 @@ finish_read: ;;; ------------------------------------------------------------ .proc draw_screen - jsr MON_SETTXT ; TEXT - jsr MON_HOME ; HOME + jsr SETTXT ; TEXT + jsr HOME ; HOME lda #23 ; VTAB 23 - jsr MON_TABV + jsr TABV ;; Print help text ldy #0 @@ -506,8 +485,8 @@ resize_prefix_and_open_jmp: ;;; ------------------------------------------------------------ .proc launch_sys_file - jsr MON_SETTXT - jsr MON_HOME + jsr SETTXT + jsr HOME lda #HI(ASCII_RIGHT) ; Right arrow jsr COUT @@ -579,7 +558,7 @@ done: rts sbc page_start inc a inc a - jsr MON_TABV + jsr TABV lda types_table,x bmi name ; is sys file? diff --git a/prodos.inc b/prodos.inc index c5a3c42..49b4344 100644 --- a/prodos.inc +++ b/prodos.inc @@ -1,15 +1,24 @@ -;;; ------------------------------ +;;; ------------------------------------------------------------ ;;; ProDOS MLI -;;; ------------------------------ +;;; ------------------------------------------------------------ -;;; Entry point -MLI := $BF00 +;;; ------------------------------------------------------------ +;;; ProDOS Global Page -;;; Date/Time -DATELO := $BF90 -DATEHI := $BF91 -TIMELO := $BF92 -TIMEHI := $BF93 +MLI := $BF00 ; Entry point +DEVNUM := $BF30 ; Most recent accessed device +DEVCNT := $BF31 ; Number of on-line devices minus 1 +DEVLST := $BF32 ; Up to 14 units +BITMAP := $BF58 +BITMAP_SIZE := $18 ; Bits for pages $00 to $BF +DATELO := $BF90 ; Date lo +DATEHI := $BF91 ; Date hi +TIMELO := $BF92 ; Time lo +TIMEHI := $BF93 ; Time hi + + +;;; ------------------------------------------------------------ +;;; MLI Calls ;;; Housekeeping Calls CREATE := $C0 @@ -20,6 +29,7 @@ GET_FILE_INFO := $C4 ON_LINE := $C5 SET_PREFIX := $C6 GET_PREFIX := $C7 + ;;; Filing Calls OPEN := $C8 NEWLINE := $C9 @@ -33,16 +43,20 @@ SET_EOF := $D0 GET_EOF := $D1 SET_BUF := $D2 GET_BUF := $D3 + ;;; System Calls GET_TIME := $82 ALLOC_INTERRUPT := $40 DEALLOC_INTERRUPT := $41 QUIT := $65 + ;;; Direct Disk Access Commands READ_BLOCK := $80 WRITE_BLOCK := $71 +;;; ------------------------------------------------------------ ;;; File Types + FT_TYPELESS := $00 FT_BAD := $01 FT_TEXT := $04 @@ -53,10 +67,36 @@ FT_BASIC := $FC FT_SYSTEM := $FF - +;;; ------------------------------------------------------------ ;;; Macros + .macro MLI_CALL op, addr jsr MLI .byte op .addr addr .endmacro + + +;;; ------------------------------------------------------------ +;;; Structures + +.scope DirectoryHeader + entry_length := $23 + entries_per_block := $24 + file_count := $25 + + size := $2B +.endscope + +.scope FileEntry + storage_type := $00 ; high nibble + name_length := $00 ; low nibble + file_name := $01 + file_type := $10 + access := $1E +.endscope + +.scope FileType + Directory := $0F + System := $FF +.endscope