$A000 and in an order that does not change. jsr $A000 prints a character on this ROM and on the next one. 6502-VDP.inc gives every slot its name, so you will write jsr Chrout.$A0D8 to $A0FE are reserved. Each is a real jump to a bare RTS, so calling one is harmless now and may do something later. Do not put your own code there.| Addr | Name | In / out |
|---|---|---|
| $A000 | Chrout | Output char (dispatched by IO_MODE) in A = character to output |
| $A003 | Chrin | Input char from buffer |
| $A090 | PrintStr | Print NUL-terminated string (A=lo, Y=hi); clobbers A,Y,STR_PTR in A = string address low, Y = string address high · out A, Y clobbered; X preserved; clobbers STR_PTR (Chrout preserves it) |
| $A093 | PrintCRLF | Print CR+LF |
| $A096 | PrintDecU16 | Print unsigned 16-bit decimal (A=lo, X=hi), no leading zeros in A = value low, X = value high |
| $A006 | WriteBuffer | Write byte to input buffer |
| $A009 | ReadBuffer | Read byte from input buffer |
| $A00C | BufferSize | Get buffer count |
| $A00F | SetIOMode | Set IO_MODE in A = mode (bit 0: 0=video, 1=serial) |
| $A012 | GetIOMode | Get IO_MODE out A = current IO_MODE |
| Addr | Name | In / out |
|---|---|---|
| $A015 | InitVideo | Text-mode console: registers, the card's font, palette row 0 |
| $A018 | VideoClear | Clear video screen |
| $A01B | VideoPutChar | Write char at cursor in A = character to write |
| $A02A | VideoChroutRaw | Output char to video (raw, no control-code handling) in A = character code (0-255) |
| $A01E | VideoSetCursor | Set cursor (X=col, Y=row) in X = column (0-39), Y = row (0-23), on the screen as shown |
| $A021 | VideoGetCursor | Get cursor position out X = column (0-39), Y = row (0-23) |
| $A024 | VideoScroll | Scroll screen up one line |
| $A027 | VideoSetColor | Set the pen and the border (A = fg<<4 | bg) in A = fg<<4 | bg. VID_PEN = A, and register 7 = A, so the border follows |
| Addr | Name | In / out |
|---|---|---|
| $A02D | InitSID | Initialize SID |
| $A030 | Beep | Play beep tone |
| $A033 | SidPlayNote | Play note (A=voice, X=freqLo, Y=freqHi) in A = voice (0-2), X = frequency low byte, Y = frequency high byte |
| $A036 | SidSilence | Silence all voices |
| $A039 | SidSetVolume | Set SID master volume (A=0-15) in A = volume (0-15); upper nibble of SID_MODE_VOL is cleared (no filter) |
| Addr | Name | In / out |
|---|---|---|
| $A045 | InitKB | Initialize GPIO/VIA keyboard |
| $A048 | ReadJoystick1 | Read joystick 1 out A = joystick bitmask (active-low bits: R-L-D-U-Y-X-B-A) |
| $A04B | ReadJoystick2 | Read joystick 2 out A = joystick bitmask (active-low bits: R-L-D-U-Y-X-B-A) |
| $A099 | KBDisable | Release both encoders and settle; ports free for raw read |
| $A09C | KBEnable | Re-enable both encoders |
| Addr | Name | In / out |
|---|---|---|
| $A07E | FsLoadFileAddr | Load named file to FS_IO_ADDR in STR_PTR = filename, FS_IO_ADDR = destination address |
| $A081 | FsSaveFileAddr | Save FS_FILE_SIZE bytes from FS_IO_ADDR to named file in STR_PTR = filename, FS_IO_ADDR = source address, FS_FILE_SIZE = byte count |
| $A03C | FsLoadFile | Load file from CF in STR_PTR ($02-$03) points to null-terminated filename · out Carry clear = success, FS_FILE_SIZE = bytes loaded; Carry set = file not found or read error |
| $A03F | FsSaveFile | Save file to CF in STR_PTR ($02-$03) points to null-terminated filename; FS_FILE_SIZE ($034A-$034B) = number of bytes to save · out Carry clear = success, Carry set = error (directory full or write error) |
| $A042 | FsDeleteFile | Delete file from CF in STR_PTR ($02-$03) points to null-terminated filename · out Carry clear = success, Carry set = file not found or error |
| $A084 | FsFormatDisk | Zero the current disk's directory sector out Carry clear = success, Carry set = write error |
| $A087 | FsSetDisk | Select current CF disk (A=0-255) in A = disk number (0-255) |
| $A08A | FsGetDisk | Get current CF disk (A=disk) out A = current disk number |
| $A08D | FsPrintDisk | Print "DISK n" + CRLF via Chrout |
| Addr | Name | In / out |
|---|---|---|
| $A06C | StReadSector | Read CF sector in CF_LBA ($26-$29) = LBA address, CF_BUF_PTR ($24-$25) = destination pointer · out Carry clear = success, Carry set = error; CF_BUF_PTR advanced by 512 bytes on success |
| $A06F | StWriteSector | Write CF sector in CF_LBA ($26-$29) = LBA address, CF_BUF_PTR ($24-$25) = source pointer · out Carry clear = success, Carry set = error; CF_BUF_PTR advanced by 512 bytes on success |
| $A072 | StWaitReady | Wait CF ready out Carry clear = ready, Carry set = error or timeout |
| Addr | Name | In / out |
|---|---|---|
| $A04E | InitSC | Initialize serial 6551 |
| $A051 | SerialChrout | Direct serial output (bypass IO_MODE) |
| $A054 | XModemLoad | Receive binary via XModem in XFER_PTR = destination address (set by caller) · out Carry clear = success, XFER_PTR past last byte written; XFER_REMAIN = total bytes received; Carry set = transfer failed |
| $A057 | XModemSave | Send binary via XModem in XFER_PTR = source address, XFER_REMAIN = byte count (set by caller) · out Carry clear = success, Carry set = transfer failed |
| Addr | Name | In / out |
|---|---|---|
| $A05A | RtcReadTime | Read RTC time out A = hours (binary), X = minutes (binary), Y = seconds (binary) |
| $A05D | RtcReadDate | Read RTC date out A = day of month (binary), X = month (binary), Y = year (binary); RTC_BUF_CENT = century (binary) |
| $A060 | RtcWriteTime | Set RTC time in A = hours (binary), X = minutes (binary), Y = seconds (binary) |
| $A063 | RtcWriteDate | Set RTC date in A = day of month (binary), X = month (binary), Y = year (binary); RTC_BUF_CENT = century (binary) |
| $A066 | RtcReadNVRAM | Read NVRAM byte in X = NVRAM address ($00-$FF) · out A = data byte |
| $A069 | RtcWriteNVRAM | Write NVRAM byte in X = NVRAM address ($00-$FF), A = data byte |
| $A09F | NvStat | Slot status (X=slot) → A=status, Y=owner ID in X = slot (0-15) · out A = NV_EMPTY / NV_VALID / NV_BAD, Y = owner ID, C clear; C set on no RTC or bad slot (A, Y undefined) |
| $A0A2 | NvRead | Copy a valid slot's payload (X=slot, A/Y=dest lo/hi) in X = slot (0-15), A/Y = destination lo/hi · out A = status, Y = owner ID; C clear and the buffer written only if A = NV_VALID; C set on no RTC or bad slot (A, Y undefined), or a slot that is not valid (A = its status, Y = its owner ID) — the buffer is untouched |
| $A0A5 | NvWrite | Write a slot (X=slot, A/Y=src lo/hi, NV_ID=owner ID) in X = slot (0-15), A/Y = source lo/hi, NV_ID = owner ID ($01-$FF) · out C clear; C set on no RTC, bad slot, or NV_ID = 0 (nothing written) |
| $A0A8 | NvErase | Zero all 16 bytes of a slot (X=slot) in X = slot (0-15) · out C clear; C set on no RTC or bad slot |
| $A0AB | NvFind | Lowest slot owned by A ($00 = first free) → X in A = owner ID · out X = slot, C clear; C set if no slot matched (X undefined) |
| $A0AE | NvFormat | Erase all 16 slots out C clear; C set on no RTC |
| Addr | Name | In / out |
|---|---|---|
| $A075 | SysDelay | Delay A=cnt_lo, X=cnt_hi centiseconds in A = count low byte, X = count high byte |
| $A078 | KernalInit | Initialize all hardware (caller must reset SP; no cli); rts when done |
| $A07B | KernalVersion | Get BIOS version (A=major, X=minor) out A = major version, X = minor version |
| Addr | Name | In / out |
|---|---|---|
| $A0B1 | VdpInfo | Card found at boot → A=VDP_FW, X=VDP_CAPS, Y=$AC; carry set if none out A = VDP_FW (STAT5), X = VDP_CAPS (STAT6), Y = VDP_ID ($AC); with no card A = X = Y = 0 and carry set |
| $A0B4 | VdpWriteReg | Write register (A=value, X=0-127), keeping VID_MODE and the LxCTRL shadows in A = value, X = register (0-127) · out carry set, and nothing written, if no card or X > 127 |
| $A0B7 | VdpSetMode | Write VMODE (A=1-4); carry set if out of range in A = mode (1-4) · out carry set, and nothing written, if no card or A is out of range |
| $A0BA | VdpPoke | Write VRAM byte A at X/Y = address lo/hi (all 64 KB) in A = value, X = address low, Y = address high ($0000-$FFFF) · out carry set, and nothing written, if no card |
| $A0BD | VdpPeek | Read VRAM byte at X/Y = address lo/hi → A in X = address low, Y = address high ($0000-$FFFF) · out A = the byte; carry set, and nothing read, if no card |
| $A0C0 | VdpSetPalette | Palette entry X = 0-255 ← A = $0R, Y = $GB (at $FC00 + 2X) in X = entry (0-255), A = $0R, Y = $GB · out carry set, and nothing written, if no card |
| $A0C3 | WaitVBlank | Return at the start of the next vertical blank (STAT0 untouched) |
| $A0C6 | VdpLoadFile | Load named file (STR_PTR) into VRAM at FS_IO_ADDR, exactly FS_FILE_SIZE bytes in STR_PTR = filename, FS_IO_ADDR = VRAM address · out Carry clear = loaded, FS_FILE_SIZE = bytes written; Carry set = no video card (nothing read), or not found or read error |
| $A0C9 | VdpLoadFont | Copy built-in font A into L0PAT and wait for it in A = font ID · out carry set, and nothing written, if no card or A is not $00 |
| $A0CC | VdpSprite | Sprite X = 0-63 ← VDP_P0-P3 = Y, X lo, pattern, attributes (table at $2000) in X = sprite (0-63), VDP_P0 = Y, VDP_P1 = X bits 7:0, VDP_P2 = pattern,; VDP_P3 = attributes (b7 = X bit 8, b6 priority, b5:4 flips, b3:0 sub-palette; SPEC §10) · out carry set, and nothing written, if no card or X > 63 |
| $A0CF | VdpSetScroll | Layer X = 0-1 scroll: A = x lo, Y = y, VDP_P0 = x bit 8 in X = layer (0-1), A = x bits 7:0, Y = y, VDP_P0 = x bit 8 (0 or not) · out carry set, and nothing written, if no card or X > 1 |
| $A0D2 | VdpLayer | Layer X = 0-1 off (A = 0) or on in X = layer (0-1), A = 0 to hide, anything else to show · out carry set, and nothing written, if no card or X > 1 |
| $A0D5 | VdpStatus | Read status register X = 0-15 on port A → A in X = status register (0-15) · out A = its value; carry set, and nothing read, if no card or X > 15 |