Move prodos defs to inc

This commit is contained in:
Joshua Bell 2017-12-09 16:29:06 -08:00
parent 6a0a6c5ad9
commit b7074e04f7
2 changed files with 79 additions and 60 deletions

79
b.s
View File

@ -4,65 +4,44 @@
.include "apple2.inc" .include "apple2.inc"
.include "prodos.inc" .include "prodos.inc"
;;; Miscellaneous
RESETVEC := $3F2 RESETVEC := $3F2
RAMRDOFF := $C002 COL80HPOS := $57B
RAMRDON := $C003
RAMWRTOFF := $C004 ;;; I/O Soft Switches / Firmware
RAMWRTON := $C005
ALTZPOFF := $C008 RAMRDOFF := $C002 ; If 80STORE Off: Read Main Mem $0200-$BFFF
ALTZPON := $C009 RAMRDON := $C003 ; If 80STORE Off: Read Aux Mem $0200-$BFFF
ROMINNW := $C082 RAMWRTOFF := $C004 ; If 80STORE Off: Write Main Mem $0200-$BFFF
ROMINWB1 := $C089 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 SLOT3 := $C300
MON_SETTXT := $FB39 ;;; Monitor
MON_TABV := $FB5B
SETTXT := $FB39
TABV := $FB5B
SETPWRC := $FB6F SETPWRC := $FB6F
BELL1 := $FBDD BELL1 := $FBDD
MON_HOME := $FC58 HOME := $FC58
COUT := $FDED COUT := $FDED
SETINV := $FE80 SETINV := $FE80
SETNORM := $FE84 SETNORM := $FE84
COL80HPOS := $057B ;;; ASCII/Key codes
;;; 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_TAB := $9 ASCII_TAB := $9
ASCII_DOWN := $A ; down arrow ASCII_DOWN := $A ; down arrow
ASCII_UP := $B ; up arrow ASCII_UP := $B ; up arrow
ASCII_CR := $D ASCII_CR := $D
ASCII_RIGHT := $15 ; right arrow ASCII_RIGHT := $15 ; right arrow
ASCII_SYN := $16 ; scroll up ASCII_SYN := $16 ; scroll text window up
ASCII_ETB := $17 ; scroll down ASCII_ETB := $17 ; scroll text window down
ASCII_EM := $19 ; move cursor to upper left ASCII_EM := $19 ; move cursor to upper left
ASCII_ESCAPE := $1B ASCII_ESCAPE := $1B
@ -330,10 +309,10 @@ finish_read:
;;; ------------------------------------------------------------ ;;; ------------------------------------------------------------
.proc draw_screen .proc draw_screen
jsr MON_SETTXT ; TEXT jsr SETTXT ; TEXT
jsr MON_HOME ; HOME jsr HOME ; HOME
lda #23 ; VTAB 23 lda #23 ; VTAB 23
jsr MON_TABV jsr TABV
;; Print help text ;; Print help text
ldy #0 ldy #0
@ -506,8 +485,8 @@ resize_prefix_and_open_jmp:
;;; ------------------------------------------------------------ ;;; ------------------------------------------------------------
.proc launch_sys_file .proc launch_sys_file
jsr MON_SETTXT jsr SETTXT
jsr MON_HOME jsr HOME
lda #HI(ASCII_RIGHT) ; Right arrow lda #HI(ASCII_RIGHT) ; Right arrow
jsr COUT jsr COUT
@ -579,7 +558,7 @@ done: rts
sbc page_start sbc page_start
inc a inc a
inc a inc a
jsr MON_TABV jsr TABV
lda types_table,x lda types_table,x
bmi name ; is sys file? bmi name ; is sys file?

View File

@ -1,15 +1,24 @@
;;; ------------------------------ ;;; ------------------------------------------------------------
;;; ProDOS MLI ;;; ProDOS MLI
;;; ------------------------------ ;;; ------------------------------------------------------------
;;; Entry point ;;; ------------------------------------------------------------
MLI := $BF00 ;;; ProDOS Global Page
;;; Date/Time MLI := $BF00 ; Entry point
DATELO := $BF90 DEVNUM := $BF30 ; Most recent accessed device
DATEHI := $BF91 DEVCNT := $BF31 ; Number of on-line devices minus 1
TIMELO := $BF92 DEVLST := $BF32 ; Up to 14 units
TIMEHI := $BF93 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 ;;; Housekeeping Calls
CREATE := $C0 CREATE := $C0
@ -20,6 +29,7 @@ GET_FILE_INFO := $C4
ON_LINE := $C5 ON_LINE := $C5
SET_PREFIX := $C6 SET_PREFIX := $C6
GET_PREFIX := $C7 GET_PREFIX := $C7
;;; Filing Calls ;;; Filing Calls
OPEN := $C8 OPEN := $C8
NEWLINE := $C9 NEWLINE := $C9
@ -33,16 +43,20 @@ SET_EOF := $D0
GET_EOF := $D1 GET_EOF := $D1
SET_BUF := $D2 SET_BUF := $D2
GET_BUF := $D3 GET_BUF := $D3
;;; System Calls ;;; System Calls
GET_TIME := $82 GET_TIME := $82
ALLOC_INTERRUPT := $40 ALLOC_INTERRUPT := $40
DEALLOC_INTERRUPT := $41 DEALLOC_INTERRUPT := $41
QUIT := $65 QUIT := $65
;;; Direct Disk Access Commands ;;; Direct Disk Access Commands
READ_BLOCK := $80 READ_BLOCK := $80
WRITE_BLOCK := $71 WRITE_BLOCK := $71
;;; ------------------------------------------------------------
;;; File Types ;;; File Types
FT_TYPELESS := $00 FT_TYPELESS := $00
FT_BAD := $01 FT_BAD := $01
FT_TEXT := $04 FT_TEXT := $04
@ -53,10 +67,36 @@ FT_BASIC := $FC
FT_SYSTEM := $FF FT_SYSTEM := $FF
;;; ------------------------------------------------------------
;;; Macros ;;; Macros
.macro MLI_CALL op, addr .macro MLI_CALL op, addr
jsr MLI jsr MLI
.byte op .byte op
.addr addr .addr addr
.endmacro .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