diff --git a/desk.acc/calculator.s b/desk.acc/calculator.s index 289b661..09623bd 100644 --- a/desk.acc/calculator.s +++ b/desk.acc/calculator.s @@ -2,8 +2,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" - .include "../inc/applesoft.inc" .include "../inc/prodos.inc" .include "../mgtk.inc" @@ -908,7 +906,7 @@ loop: lda routine,x lda event_params::modifiers bne bail lda event_params::key - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE bne trydel lda calc_p bne clear ; empty state? diff --git a/desk.acc/date.s b/desk.acc/date.s index f9a57f2..f18450e 100644 --- a/desk.acc/date.s +++ b/desk.acc/date.s @@ -3,7 +3,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" .include "../inc/prodos.inc" - .include "../inc/auxmem.inc" .include "../mgtk.inc" .include "../desktop.inc" ; redraw icons after window move; font; glyphs @@ -328,20 +327,20 @@ init_window: lda event_params::modifiers bne input_loop lda event_params::key - cmp #KEY_RETURN + cmp #CHAR_RETURN bne :+ jmp on_ok -: cmp #KEY_ESCAPE +: cmp #CHAR_ESCAPE bne :+ jmp on_cancel -: cmp #KEY_LEFT +: cmp #CHAR_LEFT beq on_key_left - cmp #KEY_RIGHT + cmp #CHAR_RIGHT beq on_key_right - cmp #KEY_DOWN + cmp #CHAR_DOWN beq on_key_down - cmp #KEY_UP + cmp #CHAR_UP bne input_loop on_key_up: diff --git a/desk.acc/puzzle.s b/desk.acc/puzzle.s index 23c1703..e1faa51 100644 --- a/desk.acc/puzzle.s +++ b/desk.acc/puzzle.s @@ -2,7 +2,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" .include "../inc/prodos.inc" .include "../mgtk.inc" @@ -772,7 +771,7 @@ check_key: lda event_params::modifiers bne :+ lda event_params::key - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE beq destroy : rts .endproc diff --git a/desk.acc/show.image.file.s b/desk.acc/show.image.file.s index 500f831..b2091ec 100644 --- a/desk.acc/show.image.file.s +++ b/desk.acc/show.image.file.s @@ -3,7 +3,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" .include "../inc/prodos.inc" - .include "../inc/auxmem.inc" .include "../mgtk.inc" .include "../desktop.inc" ; get selection, font @@ -383,7 +382,7 @@ on_key: lda event_params::modifiers bne input_loop lda event_params::key - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE beq exit bne input_loop diff --git a/desk.acc/show.text.file.s b/desk.acc/show.text.file.s index d557537..534d855 100644 --- a/desk.acc/show.text.file.s +++ b/desk.acc/show.text.file.s @@ -1,9 +1,8 @@ .setcpu "6502" .include "apple2.inc" - .include "../inc/ascii.inc" + .include "../inc/apple2.inc" .include "../inc/prodos.inc" - .include "../inc/auxmem.inc" .include "../mgtk.inc" .include "../desktop.inc" ; get/clear selection, font @@ -1046,7 +1045,7 @@ more: ldy drawtext_params::textlen and #$7F ; clear high bit sta ($06),y inc L0945 - cmp #ASCII_RETURN + cmp #CHAR_RETURN beq finish_text_run cmp #' ' ; space character bne :+ @@ -1055,7 +1054,7 @@ more: ldy drawtext_params::textlen lda L0945 sta L0946 pla -: cmp #ASCII_TAB +: cmp #CHAR_TAB bne :+ jmp handle_tab @@ -1090,9 +1089,9 @@ more: ldy drawtext_params::textlen finish_text_run: jsr draw_text_run ldy drawtext_params::textlen lda ($06),y - cmp #ASCII_TAB + cmp #CHAR_TAB beq tab - cmp #ASCII_RETURN + cmp #CHAR_RETURN bne :+ tab: inc drawtext_params::textlen : clc diff --git a/desktop/desktop.s b/desktop/desktop.s index bcf49b0..c78c649 100644 --- a/desktop/desktop.s +++ b/desktop/desktop.s @@ -2,7 +2,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" .include "../inc/prodos.inc" .include "../mgtk.inc" .include "../desktop.inc" @@ -3626,7 +3625,7 @@ LBB9A: cmp #MGTK::event_kind_key_down and #$7F bit alert_action bpl LBBEE - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE bne LBBC3 MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR MGTK_RELAY2_CALL MGTK::PaintRect, cancel_rect @@ -3648,7 +3647,7 @@ LBBE3: cmp #'A' beq LBBCC jmp LBB87 -LBBEE: cmp #KEY_RETURN +LBBEE: cmp #CHAR_RETURN bne LBC09 MGTK_RELAY2_CALL MGTK::SetPenMode, penXOR MGTK_RELAY2_CALL MGTK::PaintRect, try_again_rect @@ -8475,13 +8474,13 @@ L5584: jsr get_event L5595: lda event_params+1 and #$7F - cmp #KEY_RETURN + cmp #CHAR_RETURN beq L55D1 - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE beq L55D1 - cmp #KEY_LEFT + cmp #CHAR_LEFT beq L55BE - cmp #KEY_RIGHT + cmp #CHAR_RIGHT bne L5584 ldx L544A inx @@ -8664,13 +8663,13 @@ L5732: jsr get_event L5743: lda event_params_key and #$7F - cmp #KEY_RETURN + cmp #CHAR_RETURN beq L578B - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE beq L578B - cmp #KEY_LEFT + cmp #CHAR_LEFT beq L5772 - cmp #KEY_RIGHT + cmp #CHAR_RIGHT bne L5732 ldx L578C inx @@ -8729,9 +8728,9 @@ loop: jsr get_event cmp #MGTK::event_kind_key_down bne loop lda event_params_key - cmp #KEY_RETURN + cmp #CHAR_RETURN beq done - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE bne :+ done: lda #$00 @@ -8744,12 +8743,12 @@ done: lda #$00 bmi :+ jmp vertical -: cmp #KEY_RIGHT +: cmp #CHAR_RIGHT bne :+ jsr scroll_right jmp loop -: cmp #KEY_LEFT +: cmp #CHAR_LEFT bne vertical jsr scroll_left jmp loop @@ -8760,12 +8759,12 @@ vertical: bmi :+ jmp loop -: cmp #KEY_DOWN +: cmp #CHAR_DOWN bne :+ jsr scroll_down jmp loop -: cmp #KEY_UP +: cmp #CHAR_UP bne loop jsr scroll_up jmp loop @@ -17143,7 +17142,7 @@ start: yax_call JT_MLI_RELAY, CLOSE, close_params cmp #MGTK::event_kind_key_down bne nope lda event_params_key - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE bne nope lda #$FF bne done @@ -17484,11 +17483,11 @@ LA6F7: jsr LB9B8 bne LA71A lda event_params_key and #$7F - cmp #KEY_LEFT + cmp #CHAR_LEFT bne LA710 jmp LA815 -LA710: cmp #KEY_RIGHT +LA710: cmp #CHAR_RIGHT bne LA717 jmp LA820 @@ -17496,7 +17495,7 @@ LA717: return #$FF LA71A: lda event_params_key and #$7F - cmp #KEY_LEFT + cmp #CHAR_LEFT bne LA72E bit LD8ED bpl LA72B @@ -17504,7 +17503,7 @@ LA71A: lda event_params_key LA72B: jmp LA82B -LA72E: cmp #KEY_RIGHT +LA72E: cmp #CHAR_RIGHT bne LA73D bit LD8ED bpl LA73A @@ -17512,23 +17511,23 @@ LA72E: cmp #KEY_RIGHT LA73A: jmp LA83E -LA73D: cmp #KEY_RETURN +LA73D: cmp #CHAR_RETURN bne LA749 bit LD8E7 bvs LA717 jmp LA851 -LA749: cmp #KEY_ESCAPE +LA749: cmp #CHAR_ESCAPE bne LA755 bit LD8E7 bmi LA717 jmp LA86F -LA755: cmp #KEY_DELETE +LA755: cmp #CHAR_DELETE bne LA75C jmp LA88D -LA75C: cmp #KEY_UP +LA75C: cmp #CHAR_UP bne LA76B bit LD8ED bmi LA768 @@ -17536,7 +17535,7 @@ LA75C: cmp #KEY_UP LA768: jmp L0D14 -LA76B: cmp #KEY_DOWN +LA76B: cmp #CHAR_DOWN bne LA77A bit LD8ED bmi LA777 @@ -17558,7 +17557,7 @@ LA77A: bit LD8E7 beq LA806 cmp #'a' beq LA806 - cmp #KEY_RETURN + cmp #CHAR_RETURN beq LA7E8 LA79B: bit LD8F5 @@ -17698,9 +17697,9 @@ jump_relay: bne :- lda event_params_key and #$7F - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE beq close - cmp #KEY_RETURN + cmp #CHAR_RETURN bne :- jmp close diff --git a/desktop/loader.s b/desktop/loader.s index b259e09..7180578 100644 --- a/desktop/loader.s +++ b/desktop/loader.s @@ -2,7 +2,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" .include "../inc/prodos.inc" .include "../macros.inc" diff --git a/desktop/mgtk.s b/desktop/mgtk.s index 9b90ad3..ad1c20f 100644 --- a/desktop/mgtk.s +++ b/desktop/mgtk.s @@ -2,9 +2,7 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" .include "../inc/prodos.inc" - .include "../inc/mouse.inc" .include "../mgtk.inc" .include "../desktop.inc" .include "../macros.inc" @@ -8009,7 +8007,7 @@ L8056: jsr L7EE2 pha jsr L8035 pla - cmp #KEY_ESCAPE + cmp #CHAR_ESCAPE bne try_return lda #0 sta L7D80 @@ -8019,13 +8017,13 @@ L8056: jsr L7EE2 rts try_return: - cmp #KEY_RETURN + cmp #CHAR_RETURN bne try_up jsr L7E8C jmp L7EAD try_up: - cmp #KEY_UP + cmp #CHAR_UP bne try_down L8081: dec L7D7B bpl L8091 @@ -8043,7 +8041,7 @@ L8091: ldx L7D7B L80A0: jmp L800F try_down: - cmp #KEY_DOWN + cmp #CHAR_DOWN bne try_right L80A7: inc L7D7B ldx L7D7A @@ -8064,7 +8062,7 @@ L80BE: ldx L7D7B L80CD: jmp L800F try_right: - cmp #KEY_RIGHT + cmp #CHAR_RIGHT bne try_left lda #0 sta L7D7B @@ -8077,7 +8075,7 @@ try_right: L80E8: jmp L800F try_left: - cmp #KEY_LEFT + cmp #CHAR_LEFT bne nope lda #0 sta L7D7B diff --git a/desktop/ovl1.s b/desktop/ovl1.s index 11dec35..46bbb3b 100644 --- a/desktop/ovl1.s +++ b/desktop/ovl1.s @@ -2,7 +2,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" .include "../inc/prodos.inc" .include "../mgtk.inc" .include "../desktop.inc" diff --git a/desktop/ovl1a.s b/desktop/ovl1a.s index 4143bcd..8f3b560 100644 --- a/desktop/ovl1a.s +++ b/desktop/ovl1a.s @@ -2,7 +2,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" .include "../inc/prodos.inc" .include "../mgtk.inc" .include "../desktop.inc" diff --git a/desktop/ovl2.s b/desktop/ovl2.s index 79f1093..f2a3d60 100644 --- a/desktop/ovl2.s +++ b/desktop/ovl2.s @@ -2,7 +2,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" .include "../inc/prodos.inc" .include "../mgtk.inc" .include "../desktop.inc" diff --git a/desktop/ovl34567.s b/desktop/ovl34567.s index bb443a8..59a0837 100644 --- a/desktop/ovl34567.s +++ b/desktop/ovl34567.s @@ -3,7 +3,6 @@ .include "apple2.inc" .include "../inc/apple2.inc" - .include "../inc/auxmem.inc" .include "../inc/prodos.inc" .include "../mgtk.inc" .include "../desktop.inc" diff --git a/inc/apple2.inc b/inc/apple2.inc index d5c0f8e..854d1a3 100644 --- a/inc/apple2.inc +++ b/inc/apple2.inc @@ -1,6 +1,8 @@ -;;; ------------------------------ +;;; ============================================================ +;;; ;;; More Apple II Symbols -;;; ------------------------------ +;;; +;;; ============================================================ ;;; Zero Page @@ -23,15 +25,10 @@ HR2_OFF := $C0B4 HR3_ON := $C0B7 HR3_OFF := $C0B6 -;;; Key Codes -KEY_RETURN := $0D -KEY_ESCAPE := $1B -KEY_LEFT := $08 -KEY_DOWN := $0A -KEY_UP := $0B -KEY_RIGHT := $15 -KEY_DELETE := $7F +;;; ============================================================ +;;; Monitor ROM +;;; ============================================================ ;;; Monitor INIT := $FB2F @@ -49,3 +46,125 @@ IRQ_VECTOR := $3FE ID_BYTE_FBB3 := $FBB3 ; $06 = IIe or later ID_BYTE_FBC0 := $FBC0 ; $EA = IIe, $E0 = IIe enh/IIgs, $00 = IIc/IIc+ ID_BYTE_FE1F := $FE1F ; RTS ($60) on pre-IIgs + + +;;; ============================================================ +;;; Applesoft Basic ROM +;;; ============================================================ + +;;; Zero Page + +ERRFLG := $D8 +TXTPTR := $B8 + +;;; Entry Points +FSUB := $E7A7 +FADD := $E7BE +FMULT := $E97F +FDIV := $EA66 +ROUND := $EB2B ; Round FAC, store at (y,x) +FLOAT := $EB93 ; A as signed byte into FAC +FIN := $EC4A ; Parse TEXTPTR to FAC (first char in A, C set if digit) +FOUT := $ED34 ; FAC as string to FBUFFR + + +FBUFFR := $100 + + +;;; ============================================================ +;;; Aux Memory / Extended 80 Column Card +;;; ============================================================ + +;;; Softswitches +RAMRDOFF := $C002 +RAMRDON := $C003 +RAMWRTOFF := $C004 +RAMWRTON := $C005 +ALTZPOFF := $C008 +ALTZPON := $C009 + +CLR80VID := $C00C +SET80VID := $C00D +RD80STORE := $C018 +RDPAGE2 := $C01C + +PAGE2OFF := $C054 +PAGE2ON := $C055 +HIRESON := $C056 +HIRESOFF := $C057 +DHIRESON := $C05E +DHIRESOFF := $C05F + +;;; Routines +SLOT3ENTRY := $C300 +AUXMOVE := $C311 ; carry set main>aux, carry clear aux>main +XFER := $C314 + +;;; Zero Page Locations +STARTLO := $3C +STARTHI := $3D +ENDLO := $3E +ENDHI := $3F +DESTINATIONLO := $42 +DESTINATIONHI := $43 + +;;; Other Locations +XFERSTARTLO := $03ED +XFERSTARTHI := $03EE + + +;;; ============================================================ +;;; Mouse Peripheral Card +;;; ============================================================ + +;;; Firmware Routines + +SETMOUSE := $12 +SERVEMOUSE := $13 +READMOUSE := $14 +CLEARMOUSE := $15 +POSMOUSE := $16 +CLAMPMOUSE := $17 +HOMEMOUSE := $18 +INITMOUSE := $19 + +;;; Constants + +CLAMP_X := 0 +CLAMP_Y := 1 + +MOUSE_MODE_OFF := $00 +MOUSE_MODE_TRANS:= $01 +MOUSE_MODE_INT := $03 +MOUSE_MODE_BTN := $05 + +;;; RAM Locations + +CLAMP_MIN_LO := $478 +CLAMP_MIN_HI := $578 +CLAMP_MAX_LO := $4F8 +CLAMP_MAX_HI := $5F8 + +;;; RAM Locations +;;; (Add $Cn where n is slot to these) + +MOUSE_X_LO := $03B8 +MOUSE_X_HI := $04B8 +MOUSE_Y_LO := $0438 +MOUSE_Y_HI := $0538 +MOUSE_STATUS := $06B8 +MOUSE_MODE := $0738 + + +;;; ============================================================ +;;; Character Constants (Screen/Key Codes) +;;; ============================================================ + +CHAR_LEFT := $08 +CHAR_TAB := $09 +CHAR_DOWN := $0A +CHAR_UP := $0B +CHAR_RETURN := $0D +CHAR_RIGHT := $15 +CHAR_ESCAPE := $1B +CHAR_DELETE := $7F diff --git a/inc/applesoft.inc b/inc/applesoft.inc deleted file mode 100644 index bf11566..0000000 --- a/inc/applesoft.inc +++ /dev/null @@ -1,21 +0,0 @@ -;;; ------------------------------ -;;; Applesoft Basic -;;; ------------------------------ - -;;; Zero Page - -ERRFLG := $D8 -TXTPTR := $B8 - -;;; Entry Points -FSUB := $E7A7 -FADD := $E7BE -FMULT := $E97F -FDIV := $EA66 -ROUND := $EB2B ; Round FAC, store at (y,x) -FLOAT := $EB93 ; A as signed byte into FAC -FIN := $EC4A ; Parse TEXTPTR to FAC (first char in A, C set if digit) -FOUT := $ED34 ; FAC as string to FBUFFR - - -FBUFFR := $100 diff --git a/inc/ascii.inc b/inc/ascii.inc deleted file mode 100644 index c9e8d2c..0000000 --- a/inc/ascii.inc +++ /dev/null @@ -1,6 +0,0 @@ -;;; ------------------------------ -;;; ASCII Code Points -;;; ------------------------------ - -ASCII_TAB := $09 -ASCII_RETURN := $0D diff --git a/inc/auxmem.inc b/inc/auxmem.inc deleted file mode 100644 index c87fc7e..0000000 --- a/inc/auxmem.inc +++ /dev/null @@ -1,38 +0,0 @@ -;;; ------------------------------ -;;; Aux Memory -;;; ------------------------------ - -;;; Softswitches -RAMRDOFF := $C002 -RAMRDON := $C003 -RAMWRTOFF := $C004 -RAMWRTON := $C005 -ALTZPOFF := $C008 -ALTZPON := $C009 - -CLR80VID := $C00C -SET80VID := $C00D -RD80STORE := $C018 -RDPAGE2 := $C01C - -PAGE2OFF := $C054 -PAGE2ON := $C055 -HIRESON := $C056 -HIRESOFF := $C057 -DHIRESON := $C05E -DHIRESOFF := $C05F - -;;; Routines -SLOT3ENTRY := $C300 -AUXMOVE := $C311 ; carry set main>aux, carry clear aux>main -XFER := $C314 - -STARTLO := $3C -STARTHI := $3D -ENDLO := $3E -ENDHI := $3F -DESTINATIONLO := $42 -DESTINATIONHI := $43 - -XFERSTARTLO := $03ED -XFERSTARTHI := $03EE diff --git a/inc/mouse.inc b/inc/mouse.inc deleted file mode 100644 index 70c51c1..0000000 --- a/inc/mouse.inc +++ /dev/null @@ -1,42 +0,0 @@ -;;; ------------------------------ -;;; Mouse Peripheral Card -;;; ------------------------------ - -;;; Firmware Routines - -SETMOUSE := $12 -SERVEMOUSE := $13 -READMOUSE := $14 -CLEARMOUSE := $15 -POSMOUSE := $16 -CLAMPMOUSE := $17 -HOMEMOUSE := $18 -INITMOUSE := $19 - -;;; Constants - -CLAMP_X := 0 -CLAMP_Y := 1 - -MOUSE_MODE_OFF := $00 -MOUSE_MODE_TRANS:= $01 -MOUSE_MODE_INT := $03 -MOUSE_MODE_BTN := $05 - - -;;; RAM Locations - -CLAMP_MIN_LO := $478 -CLAMP_MIN_HI := $578 -CLAMP_MAX_LO := $4F8 -CLAMP_MAX_HI := $5F8 - -;;; RAM Locations -;;; (Add $Cn where n is slot to these) - -MOUSE_X_LO := $03B8 -MOUSE_X_HI := $04B8 -MOUSE_Y_LO := $0438 -MOUSE_Y_HI := $0538 -MOUSE_STATUS := $06B8 -MOUSE_MODE := $0738 diff --git a/inc/prodos.inc b/inc/prodos.inc index 73b2418..cfb9f3e 100644 --- a/inc/prodos.inc +++ b/inc/prodos.inc @@ -1,6 +1,8 @@ -;;; ------------------------------------------------------------ +;;; ============================================================ +;;; ;;; ProDOS MLI -;;; ------------------------------------------------------------ +;;; +;;; ============================================================ ;;; Entry point / Global Page MLI := $BF00 ; Entry point @@ -18,8 +20,9 @@ MACHID := $BF98 ; Machine ID ;;; Patch Locations SELECTOR := $D100 -;;; ------------------------------------------------------------ +;;; ============================================================ ;;; MLI Calls +;;; ============================================================ ;;; Housekeeping Calls CREATE := $C0 @@ -55,8 +58,9 @@ QUIT := $65 READ_BLOCK := $80 WRITE_BLOCK := $81 -;;; ------------------------------------------------------------ +;;; ============================================================ ;;; Device Types (low nibble of unit number in DEVLST) +;;; ============================================================ DT_DISKII := $0 DT_PROFILE := $4 @@ -70,8 +74,9 @@ DT_RAM := $F ;;; bit 1-0 = number of volumes (0-1) ;;; "You should ignore the low nibble in the unit number..." -;;; ------------------------------------------------------------ +;;; ============================================================ ;;; File Types +;;; ============================================================ FT_TYPELESS := $00 FT_BAD := $01 @@ -83,21 +88,24 @@ FT_S16 := $B3 ; IIgs Application Program FT_BASIC := $FC FT_SYSTEM := $FF -;;; ------------------------------------------------------------ +;;; ============================================================ ;;; Storage Types +;;; ============================================================ ST_STANDARD_FILE := $01 ST_LINKED_DIRECTORY := $0D ST_VOLUME_DIRECTORY := $0F -;;; ------------------------------------------------------------ +;;; ============================================================ ;;; Errors +;;; ============================================================ PDERR_PATH_NOT_FOUND := $44 PDERR_VOL_NOT_FOUND := $45 -;;; ------------------------------------------------------------ +;;; ============================================================ ;;; Macros +;;; ============================================================ .macro MLI_CALL op, addr jsr MLI @@ -339,4 +347,4 @@ param_count: .byte 2 pathname: .addr pn new_pathname: .addr np .endproc -.endmacro \ No newline at end of file +.endmacro