From feb2a2a0ecbccbb77c5356c0f1376bb5795bb997 Mon Sep 17 00:00:00 2001 From: Zellyn Hunter Date: Sat, 23 Feb 2013 22:19:53 -0800 Subject: [PATCH] Moved apple2.org here from go6502 --- docs/apple2.org | 277 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 docs/apple2.org diff --git a/docs/apple2.org b/docs/apple2.org new file mode 100644 index 0000000..b5adead --- /dev/null +++ b/docs/apple2.org @@ -0,0 +1,277 @@ +Apple II notes + +** Memory Map + +|---------+-------------------------------------------| +| Page | Use | +|---------+-------------------------------------------| +| $00 | Page Zero | +| $01 | System stack | +| $02 | Input buffer | +| $03 | Monitor vector locations | +| $04-$07 | Text/Lo-Res Primary | +| $08-$0B | Text/Lo-Res Secondary | +| $0C-$1F | Free RAM | +| $20-$3F | Hires Primary | +| $40-$5F | Hires Secondary | +| $60-$BF | Free RAM | +| $C0 | I/O and softswitches | +| $C1-$C7 | ROM for seven peripheral cards | +| $C8-$CF | switchable ROM for peripheral cards | +| $D0-$D7 | empty ROM socket #1 / Programmer's Aid #1 | +| $D8-$DF | empty ROM socket #2 | +| $E0-$F7 | Integer BASIC ROM | +| $F8-$FF | Monitor ROM | +|---------+-------------------------------------------| + +* Integer Basic Map + +|-------------+---------------------------------| +| Address | Use | +|-------------+---------------------------------| +| $E000-$F424 | BASIC | +| $F425-$F4FB | Floating point math package 1/2 | +| $F4FC-$F4FF | ??? (4 bytes) | +| $F500-$F63C | Miniassembler | +| $F63D-$F65D | Floating point math package 2/2 | +| $F65E-$F665 | ??? (8 bytes) | +| $F666-$F668 | Miniassembler entry point | +| $F669-$F688 | ??? (32 bytes) | +| $F689-$F7FC | SWEET 16 interpreter | +| $F800-$FFFF | Monitor | +|-------------+---------------------------------| + +* I/O and softswitches + +|---------+--------+------------------------------------------------------------------| +| Address | Dec | Use | +|---------+--------+------------------------------------------------------------------| +| $C00X | -16384 | Read keyboard: High bit = key pressed | +| $C01X | -16368 | Set to 0 to clear keyboard strobe | +| $C01A | -16358 | Read: High bit 1 = TEXT switch "ON" | +| $C01B | -16357 | Read: High bit 1 = MIXED switch "ON" | +| $C01C | -16356 | Read: High bit 1 = PAGE2 switch "ON" | +| $C01D | -16355 | Read: High bit 1 = HIRES switch "ON" | +| $C02X | | Casette output toggle | +| $C03X | -16336 | Speaker toggle | +| $C04X | | Output strobe to Game I/O connector | +| $C050 | -16304 | Set graphics mode | +| $C051 | -16303 | Set text mode | +| $C052 | -16302 | Set bottom 4 lines graphics | +| $C053 | -16301 | Set bottom 4 lines text | +| $C054 | -16300 | Display primary page | +| $C055 | -16299 | Display secondary page | +| $C056 | -16298 | Set HIRES graphics mode | +| $C057 | -16297 | Set color graphics mode | +| $CØ58 | -l6296 | Clear Game I/O ANØ output | +| $CØ59 | -l6295 | Set Game I/O ANØ output | +| $CØ5A | -l6294 | Clear Game I/O ANl output | +| $CØ5B | -l6293 | Set Game I/O ANl output | +| $CØ5C | -l6292 | Clear Game I/O AN2 output | +| $CØ5D | -l629l | Set Game I/O AN2 output | +| $CØ5E | -l629Ø | Clear Game I/O AN3 output | +| $CØ5F | -l6289 | Set Game I/O AN3 output | +| $C060/8 | | Tape in (bit 7) | +| $C061/9 | -16287 | "SW1": PDL(0) switch: High bit 1 = "on" | +| $C062/A | -16286 | "SW2": PDL(1) switch: High bit 1 = "on" | +| $C063/B | -16285 | "SW3": PDL(2) switch: High bit 1 = "on" | +| $C064/C | | Paddle 0 timer output: state of timer output in high bit | +| $C065/D | | Paddle 1 timer output: state of timer output in high bit | +| $C066/E | | Paddle 2 timer output: state of timer output in high bit | +| $C067/F | | Paddle 3 timer output: state of timer output in high bit | +| $C064 | | Paddle0 | +| $C07X | | Trigger paddle timers during \Zero_2 | +| $C08X | | Device select 0: Pin 41 on Peripheral Connector low during 0_2 | +| $C09X | | Device select 1: Pin 41 on Peripheral Connector low during 0_2 | +| $C0AX | | Device select 2: Pin 41 on Peripheral Connector low during 0_2 | +| $C0BX | | Device select 3: Pin 41 on Peripheral Connector low during 0_2 | +| $C0CX | | Device select 4: Pin 41 on Peripheral Connector low during 0_2 | +| $C0DX | | Device select 5: Pin 41 on Peripheral Connector low during 0_2 | +| $C0EX | | Device select 6: Pin 41 on Peripheral Connector low during 0_2 | +| $C0FX | | Device select 7: Pin 41 on Peripheral Connector low during 0_2 | +| $C10X | | Device select (8): Pin 41 on Peripheral Connector low during 0_2 | +| $C11X | | Device select (9): Pin 41 on Peripheral Connector low during 0_2 | +| $C12X | | Device select (A): Pin 41 on Peripheral Connector low during 0_2 | +| $C13X | | Device select (B): Pin 41 on Peripheral Connector low during 0_2 | +| $C14X | | Device select (C): Pin 41 on Peripheral Connector low during 0_2 | +| $C15X | | Device select (D): Pin 41 on Peripheral Connector low during 0_2 | +| $C16X | | Device select (E): Pin 41 on Peripheral Connector low during 0_2 | +| $C17X | | Device select (F): Pin 41 on Peripheral Connector low during 0_2 | +| $C1XX | | I/O Select 1: Pin 1 on Peripheral Connector low during 0_2 | +| $C2XX | | I/O Select 2: Pin 1 on Peripheral Connector low during 0_2 | +| $C3XX | | I/O Select 3: Pin 1 on Peripheral Connector low during 0_2 | +| $C4XX | | I/O Select 4: Pin 1 on Peripheral Connector low during 0_2 | +| $C5XX | | I/O Select 5: Pin 1 on Peripheral Connector low during 0_2 | +| $C6XX | | I/O Select 6: Pin 1 on Peripheral Connector low during 0_2 | +| $C7XX | | I/O Select 7: Pin 1 on Peripheral Connector low during 0_2 | +| $C8XX | | I/O Select (8): Pin 1 on Peripheral Connector low during 0_2 | +| $C9XX | | I/O Select (9): Pin 1 on Peripheral Connector low during 0_2 | +| $CAXX | | I/O Select (A): Pin 1 on Peripheral Connector low during 0_2 | +| $CBXX | | I/O Select (B): Pin 1 on Peripheral Connector low during 0_2 | +| $CCXX | | I/O Select (C): Pin 1 on Peripheral Connector low during 0_2 | +| $CDXX | | I/O Select (D): Pin 1 on Peripheral Connector low during 0_2 | +| $CEXX | | I/O Select (E): Pin 1 on Peripheral Connector low during 0_2 | +| $CFXX | | I/O Select (F): Pin 1 on Peripheral Connector low during 0_2 | +| $CFFF | | switchable peripheral ROM - find out more | +| | | | +| | | | + +* Page 00 + +|---------+---------+----------------------------------------------------------------| +| Address | Dec | Description | +|---------+---------+----------------------------------------------------------------| +| $00-$1F | | Register area for "sweet 16" | +| $18 | | (DOS) first track of data | +| $19 | | (DOS) first sector of data | +| $1A | | (DOS) number of sectors to load | +| $1B | | (DOS) HIGH BYTE of buffer (LO is always 0) | +| $1A/B | | Shape pointer used by DRAW and XDRAW | +| $1C | | Last color used (HCOLOR converted to its color byte) | +| $20 | 32 | Left edge of window (0-39) | +| $21 | 33 | Width of the window (0 to 40 - Left) | +| $22 | 34 | Top edge of window (0-23) | +| $23 | 35 | Bottom of window (0-23) Bottom > Top | +| $24 | 36 | HTAB: 0-39 | +| $25 | 37 | VTAB: 0-23 | +| $2B | 43 | Boot SLOT * 16 | +| $2C | 44 | Lo-res line end-point | +| $30 | 48 | Lores color * 17 | +| $32 | 50 | Inverse($3F), Flash($7F), Normal($FF), Invisible($80) | +| $33 | | Prompt-char | +| $4A/B | 74-75 | LOMEM address (INT) | +| $4C/D | 76-77 | HIMEM address (INT) | +| $4E-$4F | 78-79 | 16-bit number, randomized with each key entry | +| | 214 | Poke 255 to auto-run program | +| | 212 | Error code flag in decimal | +| | 216 | High bit set if error detected: zero to clear | +| | 222 | Error code | +| | 224-226 | HIRES GR X&Y coordinates | +| $E4 | 228 | Color being used {0=0:42=1:85=2:127=3:128=4:170=5:213=6:255=7} | +| $E6 | 230 | HIRES PLOTTING PAGE (32=1/64=2/96=3) | +| $E7 | 231 | SCALE of shape | +| $EA | 234 | COLLISION COUNTER for shapes | +| | 241 | 256-SPEED | +| $F3 | 243 | FLASH MASK | +| $F9 | 249 | ROT | + +* Page 03 + +|-------------+--------------------------------------| +| Address | Description | +|-------------+--------------------------------------| +| $0320/1 | Low-endian HIRES X coordinate: 0-279 | +| $0322 | HIRES Y coordinate: 0-159 | +| $0324/5 | Start address of SHAPE TABLE | +| $032C | COLOR for HIRES | +| $03F8 | CTRL-Y in Monitor with JSR here | +| $03FB | NMI | +| $03FE-$03FF | IRQ sent to this address | +| | | + +* Basic locations + +|---------+------+--------------------------------| +| Address | Dec | Description | +|---------+------+--------------------------------| +| | 2049 | Set to 1 for "list protection" | + +* DOS routines +|---------+-------+-------------| +| Address | Dec | Description | +|---------+-------+-------------| +| | 42350 | Catalog | + +* Monitor routines +|---------+-------+-------+------------------------------------------------------------| +| Address | Dec | Dec | Description | +|---------+-------+-------+------------------------------------------------------------| +| | $F3D4 | -3116 | HGR2 | +| | $F3DE | -3106 | HGR | +| | $F3F2 | -3086 | CLEAR HIRES SCREEN | +| | $F3F6 | -3082 | CLEAR HIRES SCREEN to HCOLOR | +| | $FB2F | -1233 | TEXT | +| | $FB40 | -1216 | GR | +| | $FB60 | -1184 | PRINT "APPLE ][" | +| | $FBE4 | -1052 | RING BELL | +| | $FBF4 | -1036 | MOVE CURSOR RIGHT | +| | $FC10 | -1008 | MOVE CURSOR LEFT | +| | $FC1A | -998 | MOVE CURSOR UP 1 LINE | +| | $FC58 | -936 | HOME | +| | $FD0C | -756 | WAIT FOR KEYPRESS | +| | $FD67 | -665 | GET a LINE of input with PROMPT, LINE FEED, and wait. | +| | $FD6A | -662 | GET a LINE of input with PROMPT, NO LINE FEED, and wait. | +| | $FD6F | -657 | GET a LINE of input with NO PROMPT or LINE FEED, and wait. | +| | $FE80 | -384 | INVERSE | +| | $FE84 | -380 | NORMAL | +| | $FECA | -310 | WRITE to tape | +| | $FEFD | -259 | READ from tape | +| | | | | + + + +** References +- http://apple2history.org/history/ah03/ +- http://www.textfiles.com/apple/peekpk.txt +- http://www.textfiles.com/apple/peekpoke.app +- http://www.textfiles.com/apple/peeks.pokes.2 +- http://www.applefritter.com/node/24236 +- http://www.easy68k.com/paulrsm/6502/index.html - Information about firmware + +* Language card +Install in slot 0. +Replaces RAM chip in E3 with a cable to the card. +Contains "autostart ROM" +Adds Esc-ijkm movement +Ctrl-S stop/start program listings + +** Autostart ROM details +$3F0/1 Break vector: $59,$FA +$3F2/3 Reset vector: $03, $E0 (for non-disk systems after power-up reset) +$3F4 Powered up mask: $45 + +** Memory details +|-------------+-------------------------| +| Address | Description | +|-------------+-------------------------| +| $D000-$DFFF | 4K bank-switched memory | +| $E000-$F7FF | RAM | +| $F800-$FFFF | Language card ROM | +|-------------+-------------------------| + +* Control codes +Bit 2 is ignored. +Bit 3 chooses which RAM banks is switched in to $D000-$DFFF. +When RAM is deselected (and write-enabled), it can be written but not read. +When RAM is deselected, Language Card ROM is mapped to $F800-$FFFF. +Power-on RESET initializes ROM to read mode, and RAM to write mode, +and selects the second 4K bank for $D000-$DFFF. + +|----------------+---------------+---------------------------------------------------| +| Second 4K Bank | First 4K Bank | Description | +|----------------+---------------+---------------------------------------------------| +| $C080 | $C088 | Select RAM read. Write-protect RAM | +| $C081 | $C089 | Deselect RAM reaad (enable ROM) | +| | | Two or more successive reads = write-enable RAM | +| $C082 | $C08A | Deselect RAM read (enable ROM). Write-protect RAM | +| $C083 | $C08B | Select RAM read. | +| | | Two or more successive reads = write-enable RAM | +|----------------+---------------+---------------------------------------------------| + +* Revisions +** II +- Integer Basic +- Revision 0 + - Only 4 hires colors: black, white, violet, green +- Revision 1 + - 6 hires colors + - Color killer + - power-on-reset + - auto-start + - 24k memory map problem (?!) + - keyboard strobe flip flop connected to reset +** II+ +- Applesoft +- Usually with 16k "Language Card" +** IIe +- 80-column card