Makefile tidying, unify headers
This commit is contained in:
parent
d10429b3a0
commit
cf891e061f
22
bbb/Makefile
22
bbb/Makefile
|
@ -2,7 +2,13 @@
|
||||||
CAFLAGS = --target apple2enh --list-bytes 0
|
CAFLAGS = --target apple2enh --list-bytes 0
|
||||||
LDFLAGS = --config apple2-asm.cfg
|
LDFLAGS = --config apple2-asm.cfg
|
||||||
|
|
||||||
TARGETS = bye.system.SYS buhbye.system.SYS
|
OUTDIR = out
|
||||||
|
|
||||||
|
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)
|
||||||
|
|
||||||
|
TARGETS = \
|
||||||
|
$(OUTDIR)/bye.system.SYS \
|
||||||
|
$(OUTDIR)/buhbye.system.SYS
|
||||||
|
|
||||||
# For timestamps
|
# For timestamps
|
||||||
MM = $(shell date "+%-m")
|
MM = $(shell date "+%-m")
|
||||||
|
@ -11,17 +17,19 @@ YY = $(shell date "+%-y")
|
||||||
DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY)
|
DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY)
|
||||||
|
|
||||||
.PHONY: clean all
|
.PHONY: clean all
|
||||||
all: $(TARGETS)
|
all: $(OUTDIR) $(TARGETS)
|
||||||
|
|
||||||
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)
|
$(OUTDIR):
|
||||||
|
mkdir -p $(OUTDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o
|
rm -f $(OUTDIR)/*.o
|
||||||
rm -f $(TARGETS)
|
rm -f $(OUTDIR)/*.list
|
||||||
|
rm -f $(OUTDIR)/$(TARGETS)
|
||||||
|
|
||||||
%.o: %.s $(HEADERS)
|
$(OUTDIR)/%.o: %.s $(HEADERS)
|
||||||
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
|
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
|
||||||
|
|
||||||
%.SYS: %.o
|
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
|
||||||
ld65 $(LDFLAGS) -o $@ $<
|
ld65 $(LDFLAGS) -o $@ $<
|
||||||
xattr -wx prodos.AuxType '00 20' $@
|
xattr -wx prodos.AuxType '00 20' $@
|
||||||
|
|
|
@ -15,37 +15,7 @@
|
||||||
.include "../inc/apple2.inc"
|
.include "../inc/apple2.inc"
|
||||||
.include "../inc/macros.inc"
|
.include "../inc/macros.inc"
|
||||||
.include "../inc/prodos.inc"
|
.include "../inc/prodos.inc"
|
||||||
|
.include "../inc/ascii.inc"
|
||||||
;;; Miscellaneous
|
|
||||||
|
|
||||||
COL80HPOS := $57B
|
|
||||||
|
|
||||||
;;; I/O Soft Switches / Firmware
|
|
||||||
|
|
||||||
ROMINNW := $C082 ; Read ROM; no write
|
|
||||||
ROMINWB1 := $C089 ; Read ROM; write RAM bank 1
|
|
||||||
|
|
||||||
SLOT3 := $C300
|
|
||||||
|
|
||||||
;;; Monitor
|
|
||||||
|
|
||||||
SETTXT := $FB39
|
|
||||||
TABV := $FB5B
|
|
||||||
SETPWRC := $FB6F
|
|
||||||
BELL1 := $FBDD
|
|
||||||
SETINV := $FE80
|
|
||||||
|
|
||||||
;;; 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 text window up
|
|
||||||
ASCII_ETB := $17 ; scroll text window down
|
|
||||||
ASCII_EM := $19 ; move cursor to upper left
|
|
||||||
ASCII_ESCAPE := $1B
|
|
||||||
|
|
||||||
|
|
||||||
;;; ************************************************************
|
;;; ************************************************************
|
||||||
.include "../inc/driver_preamble.inc"
|
.include "../inc/driver_preamble.inc"
|
||||||
|
@ -75,7 +45,7 @@ ASCII_ESCAPE := $1B
|
||||||
src_ptr := $19
|
src_ptr := $19
|
||||||
dst_ptr := $1B
|
dst_ptr := $1B
|
||||||
|
|
||||||
sta ALTZPOFF
|
sta ALTZPOFF ; TODO: Necessary?
|
||||||
lda ROMIN ; write bank 2
|
lda ROMIN ; write bank 2
|
||||||
lda ROMIN
|
lda ROMIN
|
||||||
|
|
||||||
|
@ -107,7 +77,7 @@ loop: lda (src_ptr) ; *src_ptr = *dst_ptr
|
||||||
cmp #<end
|
cmp #<end
|
||||||
bne loop
|
bne loop
|
||||||
|
|
||||||
sta ALTZPOFF
|
sta ALTZPOFF ; TODO: Necessary?
|
||||||
sta ROMINWB1
|
sta ROMINWB1
|
||||||
sta ROMINWB1
|
sta ROMINWB1
|
||||||
|
|
||||||
|
@ -158,7 +128,6 @@ loop: lda (src_ptr) ; *src_ptr = *dst_ptr
|
||||||
;;; ------------------------------------------------------------
|
;;; ------------------------------------------------------------
|
||||||
|
|
||||||
cld ; ProDOS protocol for QUIT routine
|
cld ; ProDOS protocol for QUIT routine
|
||||||
lda ROMINNW ; Page in ROM for reads, writes ignored
|
|
||||||
|
|
||||||
lda #$A0
|
lda #$A0
|
||||||
jsr SLOT3 ; Activate 80-Column Firmware
|
jsr SLOT3 ; Activate 80-Column Firmware
|
||||||
|
|
|
@ -2,64 +2,16 @@
|
||||||
|
|
||||||
.setcpu "65C02"
|
.setcpu "65C02"
|
||||||
.include "apple2.inc"
|
.include "apple2.inc"
|
||||||
.include "prodos.inc"
|
.include "apple2.mac"
|
||||||
|
|
||||||
;;; Miscellaneous
|
.include "../inc/apple2.inc"
|
||||||
|
.include "../inc/prodos.inc"
|
||||||
RESETVEC := $3F2
|
.include "../inc/ascii.inc"
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
;;; Monitor
|
|
||||||
|
|
||||||
SETTXT := $FB39
|
|
||||||
TABV := $FB5B
|
|
||||||
SETPWRC := $FB6F
|
|
||||||
BELL1 := $FBDD
|
|
||||||
HOME := $FC58
|
|
||||||
COUT := $FDED
|
|
||||||
SETINV := $FE80
|
|
||||||
SETNORM := $FE84
|
|
||||||
|
|
||||||
;;; 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 text window up
|
|
||||||
ASCII_ETB := $17 ; scroll text window down
|
|
||||||
ASCII_EM := $19 ; move cursor to upper left
|
|
||||||
ASCII_ESCAPE := $1B
|
|
||||||
|
|
||||||
;;; ------------------------------------------------------------
|
;;; ------------------------------------------------------------
|
||||||
|
|
||||||
.define HI(char) (char|$80)
|
.define HI(char) (char|$80)
|
||||||
|
|
||||||
.macro HIASCII arg
|
|
||||||
.repeat .strlen(arg), i
|
|
||||||
.byte .strat(arg, i) | $80
|
|
||||||
.endrep
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro HIASCIIZ arg
|
|
||||||
HIASCII arg
|
|
||||||
.byte 0
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;;; ------------------------------------------------------------
|
;;; ------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -121,7 +73,7 @@ ASCII_ESCAPE := $1B
|
||||||
;;; ------------------------------------------------------------
|
;;; ------------------------------------------------------------
|
||||||
|
|
||||||
cld ; ProDOS protocol for QUIT routine
|
cld ; ProDOS protocol for QUIT routine
|
||||||
lda ROMINNW ; Page in ROM for reads, writes ignored
|
lda ROMIN2 ; Page in ROM for reads, writes ignored
|
||||||
|
|
||||||
;; Point reset vector at this routine
|
;; Point reset vector at this routine
|
||||||
stz RESETVEC
|
stz RESETVEC
|
||||||
|
@ -197,7 +149,7 @@ check_device:
|
||||||
lda open_params_ref_num
|
lda open_params_ref_num
|
||||||
sta read_params_ref_num
|
sta read_params_ref_num
|
||||||
sta mark_ref_num
|
sta mark_ref_num
|
||||||
lda #DirectoryHeader::size
|
lda #.sizeof(SubdirectoryHeader)
|
||||||
sta read_params_request
|
sta read_params_request
|
||||||
stz read_params_request+1
|
stz read_params_request+1
|
||||||
jsr do_read
|
jsr do_read
|
||||||
|
@ -205,7 +157,7 @@ check_device:
|
||||||
|
|
||||||
;; Store entry_length/entries_per_block/file_count
|
;; Store entry_length/entries_per_block/file_count
|
||||||
ldx #3
|
ldx #3
|
||||||
: lda read_buffer + DirectoryHeader::entry_length,x
|
: lda read_buffer + SubdirectoryHeader::entry_length,x
|
||||||
sta entry_length,x
|
sta entry_length,x
|
||||||
dex
|
dex
|
||||||
bpl :-
|
bpl :-
|
||||||
|
@ -256,7 +208,7 @@ carry: inc mark_position+1
|
||||||
bcs finish_read2
|
bcs finish_read2
|
||||||
|
|
||||||
inc entry_num
|
inc entry_num
|
||||||
lda read_buffer + FileEntry::storage_type
|
lda read_buffer + FileEntry::storage_type_name_length
|
||||||
and #$F0 ; mask off storage_type
|
and #$F0 ; mask off storage_type
|
||||||
beq floop ; inactive file entry
|
beq floop ; inactive file entry
|
||||||
dec file_count
|
dec file_count
|
||||||
|
@ -269,9 +221,9 @@ carry: inc mark_position+1
|
||||||
|
|
||||||
;; Check file type
|
;; Check file type
|
||||||
lda read_buffer + FileEntry::file_type
|
lda read_buffer + FileEntry::file_type
|
||||||
cmp #FileType::Directory
|
cmp #FT_DIRECTORY
|
||||||
beq :+
|
beq :+
|
||||||
cmp #FileType::System
|
cmp #FT_SYSTEM
|
||||||
bne next_file_entry
|
bne next_file_entry
|
||||||
|
|
||||||
;; Check to see if we have room
|
;; Check to see if we have room
|
||||||
|
@ -603,7 +555,8 @@ cout: jmp COUT
|
||||||
|
|
||||||
string_start := *
|
string_start := *
|
||||||
.proc help_string
|
.proc help_string
|
||||||
HIASCIIZ "RETURN: Select | TAB: Chg Vol | ESC: Back"
|
scrcode "RETURN: Select | TAB: Chg Vol | ESC: Back"
|
||||||
|
.byte 0
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
;; Mousetext sequence: Enable, folder left, folder right, disable
|
;; Mousetext sequence: Enable, folder left, folder right, disable
|
||||||
|
@ -714,7 +667,7 @@ loop: lda (src_ptr)
|
||||||
lda src_ptr
|
lda src_ptr
|
||||||
cmp #<end
|
cmp #<end
|
||||||
bne loop
|
bne loop
|
||||||
lda (src_ptr) ; WTF??
|
lda (src_ptr)
|
||||||
sta (dst_ptr)
|
sta (dst_ptr)
|
||||||
sta ALTZPOFF
|
sta ALTZPOFF
|
||||||
sta ROMINWB1
|
sta ROMINWB1
|
||||||
|
|
102
bbb/prodos.inc
102
bbb/prodos.inc
|
@ -1,102 +0,0 @@
|
||||||
;;; ------------------------------------------------------------
|
|
||||||
;;; ProDOS MLI
|
|
||||||
;;; ------------------------------------------------------------
|
|
||||||
|
|
||||||
;;; ------------------------------------------------------------
|
|
||||||
;;; ProDOS Global Page
|
|
||||||
|
|
||||||
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
|
|
||||||
DESTROY := $C1
|
|
||||||
RENAME := $C2
|
|
||||||
SET_FILE_INFO := $C3
|
|
||||||
GET_FILE_INFO := $C4
|
|
||||||
ON_LINE := $C5
|
|
||||||
SET_PREFIX := $C6
|
|
||||||
GET_PREFIX := $C7
|
|
||||||
|
|
||||||
;;; Filing Calls
|
|
||||||
OPEN := $C8
|
|
||||||
NEWLINE := $C9
|
|
||||||
READ := $CA
|
|
||||||
WRITE := $CB
|
|
||||||
CLOSE := $CC
|
|
||||||
FLUSH := $CD
|
|
||||||
SET_MARK := $CE
|
|
||||||
GET_MARK := $CF
|
|
||||||
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
|
|
||||||
FT_BINARY := $06
|
|
||||||
FT_DIRECTORY := $0F
|
|
||||||
FT_SRC := $B0 ; IIgs system type; re-used?
|
|
||||||
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
|
|
|
@ -17,6 +17,7 @@
|
||||||
.include "../inc/apple2.inc"
|
.include "../inc/apple2.inc"
|
||||||
.include "../inc/macros.inc"
|
.include "../inc/macros.inc"
|
||||||
.include "../inc/prodos.inc"
|
.include "../inc/prodos.inc"
|
||||||
|
.include "../inc/ascii.inc"
|
||||||
|
|
||||||
;;; ************************************************************
|
;;; ************************************************************
|
||||||
.include "../inc/driver_preamble.inc"
|
.include "../inc/driver_preamble.inc"
|
||||||
|
@ -97,7 +98,7 @@ init_ssc:
|
||||||
|
|
||||||
: jsr readbyte
|
: jsr readbyte
|
||||||
bcs cricket_not_found ; timeout
|
bcs cricket_not_found ; timeout
|
||||||
cmp #HI($0D) ; = CR ?
|
cmp #HI(ASCII_CR)
|
||||||
beq cricket_found
|
beq cricket_found
|
||||||
digit: cmp #HI('0') ; < '0' ?
|
digit: cmp #HI('0') ; < '0' ?
|
||||||
bcc cricket_not_found
|
bcc cricket_not_found
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
.include "../inc/apple2.inc"
|
.include "../inc/apple2.inc"
|
||||||
.include "../inc/macros.inc"
|
.include "../inc/macros.inc"
|
||||||
|
.include "../inc/ascii.inc"
|
||||||
|
|
||||||
.org $2000
|
.org $2000
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
loop: lda INPUT_BUFFER,x
|
loop: lda INPUT_BUFFER,x
|
||||||
jsr sendbyte
|
jsr sendbyte
|
||||||
inx
|
inx
|
||||||
cmp #HI($0D) ; = CR
|
cmp #HI(ASCII_CR)
|
||||||
bne loop
|
bne loop
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
.include "../inc/apple2.inc"
|
.include "../inc/apple2.inc"
|
||||||
.include "../inc/macros.inc"
|
.include "../inc/macros.inc"
|
||||||
|
.include "../inc/ascii.inc"
|
||||||
|
|
||||||
.org $2000
|
.org $2000
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
loop: lda INPUT_BUFFER,x
|
loop: lda INPUT_BUFFER,x
|
||||||
jsr sendbyte
|
jsr sendbyte
|
||||||
inx
|
inx
|
||||||
cmp #HI($0D) ; = CR
|
cmp #HI(ASCII_CR)
|
||||||
bne loop
|
bne loop
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
.include "../inc/apple2.inc"
|
.include "../inc/apple2.inc"
|
||||||
.include "../inc/macros.inc"
|
.include "../inc/macros.inc"
|
||||||
|
.include "../inc/ascii.inc"
|
||||||
|
|
||||||
.org $2000
|
.org $2000
|
||||||
|
|
||||||
|
@ -84,7 +85,7 @@ init_ssc:
|
||||||
|
|
||||||
: jsr readbyte
|
: jsr readbyte
|
||||||
bcs cricket_not_found ; timeout
|
bcs cricket_not_found ; timeout
|
||||||
cmp #HI($0D) ; = CR ?
|
cmp #HI(ASCII_CR)
|
||||||
beq cricket_found
|
beq cricket_found
|
||||||
digit: cmp #HI('0') ; < '0' ?
|
digit: cmp #HI('0') ; < '0' ?
|
||||||
bcc cricket_not_found
|
bcc cricket_not_found
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
;;; Soft Switches
|
;;; Soft Switches
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
|
;;; I/O Soft Switches / Firmware
|
||||||
|
|
||||||
RAMRDOFF := $C002
|
RAMRDOFF := $C002
|
||||||
RAMRDON := $C003
|
RAMRDON := $C003
|
||||||
RAMWRTOFF := $C004
|
RAMWRTOFF := $C004
|
||||||
|
@ -24,6 +26,7 @@ RDPAGE2 := $C01C
|
||||||
BANKSEL := $C073 ; Select RamWorks bank
|
BANKSEL := $C073 ; Select RamWorks bank
|
||||||
|
|
||||||
ROMIN2 := $C082 ; Read ROM; no write
|
ROMIN2 := $C082 ; Read ROM; no write
|
||||||
|
ROMINWB1 := $C089 ; Read ROM; write RAM bank 1
|
||||||
RWRAM1 := $C08B ; Read/write RAM bank 1
|
RWRAM1 := $C08B ; Read/write RAM bank 1
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
@ -36,19 +39,36 @@ STATUS := $C089 + $20 ; ACIA Status/Reset Register
|
||||||
COMMAND := $C08A + $20 ; ACIA Command Register (read/write)
|
COMMAND := $C08A + $20 ; ACIA Command Register (read/write)
|
||||||
CONTROL := $C08B + $20 ; ACIA Control Register (read/write)
|
CONTROL := $C08B + $20 ; ACIA Control Register (read/write)
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
;;; Other Slots
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
SLOT3 := $C300
|
||||||
|
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
;;; Monitor ROM routines
|
;;; Monitor ROM routines
|
||||||
;;; ============================================================
|
;;; ============================================================
|
||||||
|
|
||||||
INIT := $FB2F
|
INIT := $FB2F
|
||||||
|
SETTXT := $FB39
|
||||||
|
TABV := $FB5B
|
||||||
|
SETPWRC := $FB6F
|
||||||
|
BELL1 := $FBDD
|
||||||
HOME := $FC58
|
HOME := $FC58
|
||||||
GETLN := $FD6A ; with prompt character
|
GETLN := $FD6A ; with prompt character
|
||||||
GETLN2 := $FD6F ; no prompt character
|
GETLN2 := $FD6F ; no prompt character
|
||||||
CROUT := $FD8E
|
CROUT := $FD8E
|
||||||
PRBYTE := $FDDA
|
PRBYTE := $FDDA
|
||||||
COUT := $FDED
|
COUT := $FDED
|
||||||
|
SETINV := $FE80
|
||||||
SETNORM := $FE84
|
SETNORM := $FE84
|
||||||
SETKBD := $FE89
|
SETKBD := $FE89
|
||||||
SETVID := $FE93
|
SETVID := $FE93
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
;;; Well-known RAM locations
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
INPUT_BUFFER := $200
|
INPUT_BUFFER := $200
|
||||||
|
RESETVEC := $3F2
|
||||||
|
COL80HPOS := $57B
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
;;; ============================================================
|
||||||
|
;;; ASCII Code Points (also used as key codes)
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
ASCII_TAB := $09 ; tab
|
||||||
|
ASCII_DOWN := $0A ; down arrow
|
||||||
|
ASCII_UP := $0B ; up arrow
|
||||||
|
ASCII_CR := $0D ; carriage return
|
||||||
|
ASCII_RIGHT := $15 ; right arrow
|
||||||
|
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 ; escape
|
|
@ -117,11 +117,11 @@ self_name: .res 16
|
||||||
|
|
||||||
;; Update reset vector - ProDOS QUIT
|
;; Update reset vector - ProDOS QUIT
|
||||||
lda #<quit
|
lda #<quit
|
||||||
sta $03F2
|
sta RESETVEC
|
||||||
lda #>quit
|
lda #>quit
|
||||||
sta $03F3
|
sta RESETVEC+1
|
||||||
eor #$A5
|
eor #$A5
|
||||||
sta $03F4
|
sta RESETVEC+2
|
||||||
|
|
||||||
;; Quit 80-column firmware
|
;; Quit 80-column firmware
|
||||||
lda #$95 ; Ctrl+U (quit 80 col firmware)
|
lda #$95 ; Ctrl+U (quit 80 col firmware)
|
||||||
|
@ -130,10 +130,11 @@ self_name: .res 16
|
||||||
;; Reset I/O
|
;; Reset I/O
|
||||||
sta CLR80VID
|
sta CLR80VID
|
||||||
sta CLRALTCHAR
|
sta CLRALTCHAR
|
||||||
jsr SETVID
|
sta CLR80COL
|
||||||
jsr SETKBD
|
|
||||||
jsr SETNORM
|
jsr SETNORM
|
||||||
jsr INIT
|
jsr INIT
|
||||||
|
jsr SETVID
|
||||||
|
jsr SETKBD
|
||||||
jsr HOME
|
jsr HOME
|
||||||
|
|
||||||
;; Update System Bit Map
|
;; Update System Bit Map
|
||||||
|
|
|
@ -2,7 +2,12 @@
|
||||||
CAFLAGS = --target apple2enh --list-bytes 0
|
CAFLAGS = --target apple2enh --list-bytes 0
|
||||||
LDFLAGS = --config apple2-asm.cfg
|
LDFLAGS = --config apple2-asm.cfg
|
||||||
|
|
||||||
TARGETS = quit.system.SYS
|
OUTDIR = out
|
||||||
|
|
||||||
|
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)
|
||||||
|
|
||||||
|
TARGETS = \
|
||||||
|
$(OUTDIR)/quit.system.SYS
|
||||||
|
|
||||||
# For timestamps
|
# For timestamps
|
||||||
MM = $(shell date "+%-m")
|
MM = $(shell date "+%-m")
|
||||||
|
@ -11,17 +16,19 @@ YY = $(shell date "+%-y")
|
||||||
DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY)
|
DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY)
|
||||||
|
|
||||||
.PHONY: clean all
|
.PHONY: clean all
|
||||||
all: $(TARGETS)
|
all: $(OUTDIR) $(TARGETS)
|
||||||
|
|
||||||
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)
|
$(OUTDIR):
|
||||||
|
mkdir -p $(OUTDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o
|
rm -f $(OUTDIR)/*.o
|
||||||
rm -f $(TARGETS)
|
rm -f $(OUTDIR)/*.list
|
||||||
|
rm -f $(OUTDIR)/$(TARGETS)
|
||||||
|
|
||||||
%.o: %.s $(HEADERS)
|
$(OUTDIR)/%.o: %.s $(HEADERS)
|
||||||
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
|
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
|
||||||
|
|
||||||
%.SYS: %.o
|
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
|
||||||
ld65 $(LDFLAGS) -o $@ $<
|
ld65 $(LDFLAGS) -o $@ $<
|
||||||
xattr -wx prodos.AuxType '00 20' $@
|
xattr -wx prodos.AuxType '00 20' $@
|
||||||
|
|
|
@ -6,7 +6,8 @@ OUTDIR = out
|
||||||
|
|
||||||
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)
|
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)
|
||||||
|
|
||||||
TARGETS = $(OUTDIR)/ram.drv.system.SYS
|
TARGETS = \
|
||||||
|
$(OUTDIR)/ram.drv.system.SYS
|
||||||
|
|
||||||
# For timestamps
|
# For timestamps
|
||||||
MM = $(shell date "+%-m")
|
MM = $(shell date "+%-m")
|
||||||
|
@ -23,12 +24,11 @@ $(OUTDIR):
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OUTDIR)/*.o
|
rm -f $(OUTDIR)/*.o
|
||||||
rm -f $(OUTDIR)/*.list
|
rm -f $(OUTDIR)/*.list
|
||||||
rm -f $(TARGETS)
|
rm -f $(OUTDIR)/$(TARGETS)
|
||||||
|
|
||||||
$(OUTDIR)/%.o: %.s $(HEADERS)
|
$(OUTDIR)/%.o: %.s $(HEADERS)
|
||||||
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
|
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
|
||||||
|
|
||||||
# System Files .SYS
|
|
||||||
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
|
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
|
||||||
ld65 $(LDFLAGS) -o '$@' $<
|
ld65 $(LDFLAGS) -o $@ $<
|
||||||
xattr -wx prodos.AuxType '00 20' $@
|
xattr -wx prodos.AuxType '00 20' $@
|
||||||
|
|
Loading…
Reference in New Issue