2018-02-27 04:13:18 +00:00
|
|
|
;;; ============================================================
|
|
|
|
;;;
|
2017-09-15 04:13:54 +00:00
|
|
|
;;; More Apple II Symbols
|
2018-02-27 04:13:18 +00:00
|
|
|
;;;
|
|
|
|
;;; ============================================================
|
2017-09-15 04:13:54 +00:00
|
|
|
|
|
|
|
;;; Zero Page
|
|
|
|
|
|
|
|
COUT_HOOK := $36
|
|
|
|
|
2018-03-07 16:12:30 +00:00
|
|
|
;;; Other Pages
|
|
|
|
|
|
|
|
IN := $200
|
|
|
|
|
|
|
|
|
2017-09-15 04:13:54 +00:00
|
|
|
;;; Soft Switches
|
|
|
|
|
|
|
|
SPKR := $C030
|
|
|
|
ROMIN2 := $C082
|
|
|
|
|
2018-01-06 05:03:10 +00:00
|
|
|
NEWVIDEO := $C029 ; IIgs - new video modes
|
2018-04-28 04:28:09 +00:00
|
|
|
;; Bit 7 = 1 = Enable Super-Hi-Res
|
|
|
|
;; Bit 6 = 1 = Linearize SHR
|
|
|
|
;; Bit 5 = 0 = Color DHR, 1 = B/W DHR
|
|
|
|
;; Bits 4-0 must be 0
|
|
|
|
|
2017-12-31 20:04:22 +00:00
|
|
|
SHADOW := $C035 ; IIgs - inhibit shadowing
|
|
|
|
|
2018-02-20 04:18:58 +00:00
|
|
|
AN3_ON := $C05F ; AppleColor Adapter Card / Le Chat Mauve
|
2018-02-01 18:00:17 +00:00
|
|
|
AN3_OFF := $C05E
|
2018-03-07 16:12:30 +00:00
|
|
|
|
|
|
|
RAMWORKS_BANK := $C071 ; RAMWorks bank selection ???
|
|
|
|
|
2018-02-01 18:00:17 +00:00
|
|
|
HR1_ON := $C0B3
|
|
|
|
HR1_OFF := $C0B2
|
|
|
|
HR2_ON := $C0B5
|
|
|
|
HR2_OFF := $C0B4
|
|
|
|
HR3_ON := $C0B7
|
|
|
|
HR3_OFF := $C0B6
|
|
|
|
|
2017-09-15 04:13:54 +00:00
|
|
|
|
2018-02-27 04:13:18 +00:00
|
|
|
;;; ============================================================
|
|
|
|
;;; Monitor ROM
|
|
|
|
;;; ============================================================
|
2017-12-31 02:02:15 +00:00
|
|
|
|
|
|
|
;;; Monitor
|
|
|
|
INIT := $FB2F
|
2019-03-28 02:26:46 +00:00
|
|
|
SETPWRC := $FB6F
|
2018-04-01 16:27:39 +00:00
|
|
|
VERSION := $FBB3
|
2017-12-31 02:02:15 +00:00
|
|
|
BELL1 := $FBDD
|
|
|
|
VTAB := $FC22
|
2018-03-03 04:06:58 +00:00
|
|
|
VTABZ := $FC24
|
2017-12-31 02:02:15 +00:00
|
|
|
HOME := $FC58
|
2018-03-03 04:06:58 +00:00
|
|
|
PRBYTE := $FDDA
|
2017-12-31 02:02:15 +00:00
|
|
|
COUT := $FDED
|
2019-03-28 02:26:46 +00:00
|
|
|
MOVE := $FE2C
|
2017-12-31 02:02:15 +00:00
|
|
|
SETKBD := $FE89
|
|
|
|
SETVID := $FE93
|
2018-01-05 17:42:32 +00:00
|
|
|
MONZ := $FF69
|
|
|
|
|
2018-04-01 16:27:39 +00:00
|
|
|
F8VERSION := $06
|
|
|
|
|
2018-01-05 17:42:32 +00:00
|
|
|
;;; Miscellaneous
|
|
|
|
IRQ_VECTOR := $3FE
|
2018-01-13 03:06:55 +00:00
|
|
|
|
2019-03-17 22:34:18 +00:00
|
|
|
ID_BYTE_FB1E := $FB1E ; $AC = Laser 128
|
2018-01-13 03:06:55 +00:00
|
|
|
ID_BYTE_FBB3 := $FBB3 ; $06 = IIe or later
|
|
|
|
ID_BYTE_FBC0 := $FBC0 ; $EA = IIe, $E0 = IIe enh/IIgs, $00 = IIc/IIc+
|
2019-01-13 22:36:34 +00:00
|
|
|
ID_BYTE_FBBF := $FBBF ; IIc ROM version ($05 = IIc+)
|
2018-11-17 04:44:03 +00:00
|
|
|
ID_BYTE_FE1F := $FE1F ; RTS ($60) on pre-IIgs, clears carry on IIgs
|
2018-02-27 04:13:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
;;; ============================================================
|
|
|
|
;;; Applesoft Basic ROM
|
|
|
|
;;; ============================================================
|
|
|
|
|
|
|
|
;;; Zero Page
|
|
|
|
|
2018-04-15 22:41:35 +00:00
|
|
|
LINNUM := $50 ; Line number, unsigned word
|
2018-02-27 04:13:18 +00:00
|
|
|
ERRFLG := $D8
|
2019-07-12 04:18:48 +00:00
|
|
|
CHRGET := $B1 ; Routine called by ROM
|
2018-02-27 04:13:18 +00:00
|
|
|
TXTPTR := $B8
|
2018-04-15 22:41:35 +00:00
|
|
|
FAC := $9D
|
2018-04-19 05:37:52 +00:00
|
|
|
SHIFT_SIGN_EXT := $A4 ; Zero before using FP ops
|
2018-02-27 04:13:18 +00:00
|
|
|
|
|
|
|
;;; Entry Points
|
2018-04-15 22:41:35 +00:00
|
|
|
GIVAYF := $E2F2 ; FAC from signed integer in (Y,A)
|
|
|
|
CONINT := $E6FB ; FAC = X as unsigned byte
|
|
|
|
GETADR := $E752 ; FAC to unsigned integer in LINNUM
|
|
|
|
FADDH := $E7A0 ; Add 0.5 to FAC
|
|
|
|
FSUB := $E7A7 ; FAC = (Y,A) - FAC
|
|
|
|
FSUBT := $E7AA ; FAC = ARG - FAC
|
|
|
|
FADD := $E7BE ; FAC = (Y,A) + FAC
|
|
|
|
FADDT := $E7C1 ; FAC = ARG + FAC
|
|
|
|
ZERO_FAC := $E84E ; FAC = 0
|
|
|
|
LOG := $E941 ; FAC = LOG(FAC)
|
|
|
|
FMULT := $E97F ; FAC = (Y,A) * FAC
|
|
|
|
FMULTT := $E982 ; FAC = ARG * FAC
|
|
|
|
DIV10 := $EA55 ; FAC = FAC / 10
|
|
|
|
FDIV := $EA66 ; FAC = (Y,A) / FAC
|
|
|
|
FDIVT := $EA69 ; FAC = ARG / FAC
|
|
|
|
LOAD_ARG := $EAE3 ; ARG = (Y,A)
|
|
|
|
MOVFM := $EAF9 ; FAC = (Y,A)
|
|
|
|
LOAD_FAC := $EAF9 ; FAC = (Y,A)
|
|
|
|
MOVMF := $EB2B ; (Y,X) = FAC
|
|
|
|
ROUND := $EB2B ; Round FAC, store at (Y,X)
|
|
|
|
ARG_TO_FAC := $EB53 ; ARG = FAC
|
|
|
|
FAC_TO_ARG_R := $EB63 ; FAC = ARG, rounded
|
|
|
|
SGN := $EB90 ; FAC = SGN(FAC)
|
|
|
|
FLOAT := $EB93 ; FAC = A as signed byte
|
|
|
|
FLOAT1 := $EB9B ; FAC from unsigned integer in FAC+1,2 eX
|
|
|
|
FLOAT2 := $EBA0 ; FAC from unsigned integer in FAC+1,2 eX, carry set = positive
|
|
|
|
ABS := $EBAF ; FAC = ABS(FAC)
|
|
|
|
FCOMP := $EBB2 ; FAC <=> (Y,A), result in A
|
|
|
|
QINT := $EBF2 ; FAC to signed integer in FAC+1...FAC+4 (e < 32)
|
|
|
|
INT := $EC23 ; FAC = INT(FAC)
|
2018-02-27 04:13:18 +00:00
|
|
|
FIN := $EC4A ; Parse TEXTPTR to FAC (first char in A, C set if digit)
|
2018-04-15 22:41:35 +00:00
|
|
|
FOUT := $ED34 ; FAC as string to FBUFFR (trashes FAC)
|
|
|
|
SQR := $EE8D ; FAC = SQR(FAC)
|
|
|
|
NEGOP := $EED0 ; FAC = -FAC
|
|
|
|
EXP := $EF09 ; FAC = EXP(FAC)
|
|
|
|
RND := $EFAE ; FAC = RND(FAC)
|
|
|
|
COS := $EFEA ; FAC = COS(FAC)
|
|
|
|
SIN := $EFF1 ; FAC = SIN(FAC)
|
|
|
|
TAN := $F03A ; FAC = SIN(FAC)
|
|
|
|
ATN := $F09E ; FAC = ATN(FAC)
|
|
|
|
|
|
|
|
;;; Constants
|
|
|
|
CON_ONE := $E913 ; 1
|
|
|
|
CON_SQR_HALF := $E92D ; SQR(1/2)
|
|
|
|
CON_SQR_TWO := $E932 ; SQR(2)
|
|
|
|
CON_NEG_HALF := $E937 ; -1/2
|
|
|
|
CON_LOG_TWO := $E93C ; LOG(2)
|
|
|
|
CON_TEN := $E950 ; 10
|
|
|
|
CON_BILLION := $ED14 ; 1E9
|
|
|
|
CON_HALF := $EE64 ; 1/2
|
|
|
|
CON_LOG2_E := $EEDB ; Log(E) base 2 ????
|
|
|
|
CON_HALF_PI := $F063 ; pi/2
|
|
|
|
CON_TWO_PI := $F06B ; pi/*2
|
|
|
|
CON_QUARTER := $F070 ; 1/4
|
|
|
|
|
|
|
|
;;; Other
|
2018-02-27 04:13:18 +00:00
|
|
|
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
|
2018-12-02 00:11:25 +00:00
|
|
|
RDALTZP := $C016
|
2018-02-27 04:13:18 +00:00
|
|
|
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
|
2019-03-28 02:26:46 +00:00
|
|
|
RESETVEC := $03F2
|
2018-02-27 04:13:18 +00:00
|
|
|
|
|
|
|
|
2018-05-03 16:01:57 +00:00
|
|
|
;;; ============================================================
|
|
|
|
;;; Disk II / IWM I/O locations
|
|
|
|
;;; ============================================================
|
|
|
|
|
|
|
|
;;; $C0nX, n = slot + 8 -- c/o http://archive.li/ewHUL
|
|
|
|
PHASE0 := $C080 ; Stepper motor phase 0
|
|
|
|
PHASE1 := $C082 ; Stepper motor phase 1
|
|
|
|
PHASE2 := $C084 ; Stepper motor phase 2
|
|
|
|
PHASE3 := $C086 ; Stepper motor phase 3
|
|
|
|
DISABLE := $C088 ; Turn disk drive off
|
|
|
|
ENABLE := $C089 ; Turn disk drive on
|
|
|
|
SELECT := $C08A ; Select drive 1 or 2
|
|
|
|
SELECT1 := $C08A ; Select drive 1
|
|
|
|
SELECT2 := $C08B ; Select drive 2
|
|
|
|
XMIT := $C08C ; Get/set bits to/from disk
|
|
|
|
TESTWP := $C08D ; Test WP mode (then WPRES has result)
|
|
|
|
DATA := $C08D ; Write data to buffer (then XMIT to send)
|
|
|
|
WPRES := $C08E ; WP mode test result
|
|
|
|
RDMODE := $C08E ; Turn off write mode
|
|
|
|
WRMODE := $C08F ; Turn on write mode
|
|
|
|
|
|
|
|
|
2018-02-27 04:13:18 +00:00
|
|
|
;;; ============================================================
|
|
|
|
;;; Mouse Peripheral Card
|
|
|
|
;;; ============================================================
|
|
|
|
|
|
|
|
;;; Firmware Routines
|
|
|
|
|
2018-12-28 23:46:09 +00:00
|
|
|
SETMOUSE = $12
|
|
|
|
SERVEMOUSE = $13
|
|
|
|
READMOUSE = $14
|
|
|
|
CLEARMOUSE = $15
|
|
|
|
POSMOUSE = $16
|
|
|
|
CLAMPMOUSE = $17
|
|
|
|
HOMEMOUSE = $18
|
|
|
|
INITMOUSE = $19
|
2018-02-27 04:13:18 +00:00
|
|
|
|
|
|
|
;;; Constants
|
|
|
|
|
2018-12-28 23:46:09 +00:00
|
|
|
CLAMP_X = 0
|
|
|
|
CLAMP_Y = 1
|
2018-02-27 04:13:18 +00:00
|
|
|
|
2018-12-28 23:46:09 +00:00
|
|
|
MOUSE_MODE_OFF = $00
|
|
|
|
MOUSE_MODE_TRANS= $01
|
|
|
|
MOUSE_MODE_INT = $03
|
|
|
|
MOUSE_MODE_BTN = $05
|
2018-02-27 04:13:18 +00:00
|
|
|
|
|
|
|
;;; 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)
|
|
|
|
;;; ============================================================
|
|
|
|
|
2018-12-28 23:46:09 +00:00
|
|
|
CHAR_MASK = $7F
|
|
|
|
CASE_MASK = $DF
|
|
|
|
|
|
|
|
CHAR_CTRL_C = $03
|
|
|
|
CHAR_LEFT = $08
|
|
|
|
CHAR_TAB = $09
|
|
|
|
CHAR_DOWN = $0A
|
|
|
|
CHAR_UP = $0B
|
|
|
|
CHAR_RETURN = $0D
|
|
|
|
CHAR_CTRL_O = $0F
|
|
|
|
CHAR_RIGHT = $15
|
|
|
|
CHAR_ESCAPE = $1B
|
|
|
|
CHAR_DELETE = $7F
|