--- /dev/null
+;
+; C64 generic definitions. Stolen from Elite128
+;
+
+
+; ---------------------------------------------------------------------------
+; Zero page, Commodore stuff
+
+ST := $90 ; IEC status byte
+
+TIME := $A0 ; 60HZ clock
+FNAM_LEN := $B7 ; Length of filename
+SECADR := $B9 ; Secondary address
+DEVNUM := $BA ; Device number
+FNAM := $BB ; Address of filename
+FNAM_BANK := $C7 ; Bank for filename
+KEY_COUNT := $D0 ; Number of keys in input buffer
+FKEY_COUNT := $D1 ; Characters for function key
+MODE := $D7 ; 40/80 column mode flag
+CURS_X := $EC ; Cursor column
+CURS_Y := $EB ; Cursor row
+SCREEN_PTR := $E0 ; Pointer to current char in text screen
+CRAM_PTR := $E2 ; Pointer to current char in color RAM
+
+CHARCOLOR := $F1
+RVS := $F3 ; Reverse output flag
+SCROLL := $F8 ; Disable scrolling flag
+
+BASIC_BUF := $200 ; Location of command-line
+BASIC_BUF_LEN = 162 ; Maximum length of command-line
+
+FETCH := $2A2 ; Fetch subroutine in RAM
+FETVEC := $2AA ; Vector patch location for FETCH
+STASH := $2AF ; Stash routine in RAM
+STAVEC := $2B9 ; Vector patch location for STASH
+PALFLAG := $A03 ; $FF=PAL, $00=NTSC
+INIT_STATUS := $A04 ; Flag: Reset/NMI Status
+FKEY_LEN := $1000 ; Function key lengths
+FKEY_TEXT := $100A ; Function key texts
+
+; ---------------------------------------------------------------------------
+; Kernal routines
+
+; Direct entries
+CURS_SET := $CD57
+CURS_ON := $CD6F
+CURS_OFF := $CD9F
+CLRSCR := $C142
+KBDREAD := $C006
+NEWLINE := $C363
+PRINT := $C322
+NMIEXIT := $FF33
+INDFET := $FF74
+
+; ---------------------------------------------------------------------------
+; Vectors
+
+IRQVec := $0314
+BRKVec := $0316
+NMIVec := $0318
+KeyStoreVec := $033C
+
+; ---------------------------------------------------------------------------
+; I/O: VIC
+
+VIC := $D000
+VIC_SPR0_X := $D000
+VIC_SPR0_Y := $D001
+VIC_SPR1_X := $D002
+VIC_SPR1_Y := $D003
+VIC_SPR2_X := $D004
+VIC_SPR2_Y := $D005
+VIC_SPR3_X := $D006
+VIC_SPR3_Y := $D007
+VIC_SPR4_X := $D008
+VIC_SPR4_Y := $D009
+VIC_SPR5_X := $D00A
+VIC_SPR5_Y := $D00B
+VIC_SPR6_X := $D00C
+VIC_SPR6_Y := $D00D
+VIC_SPR7_X := $D00E
+VIC_SPR7_Y := $D00F
+VIC_SPR_HI_X := $D010
+VIC_SPR_ENA := $D015
+VIC_SPR_EXP_Y := $D017
+VIC_SPR_EXP_X := $D01D
+VIC_SPR_MCOLOR := $D01C
+VIC_SPR_BG_PRIO := $D01B
+
+VIC_SPR_MCOLOR0 := $D025
+VIC_SPR_MCOLOR1 := $D026
+
+VIC_SPR0_COLOR := $D027
+VIC_SPR1_COLOR := $D028
+VIC_SPR2_COLOR := $D029
+VIC_SPR3_COLOR := $D02A
+VIC_SPR4_COLOR := $D02B
+VIC_SPR5_COLOR := $D02C
+VIC_SPR6_COLOR := $D02D
+VIC_SPR7_COLOR := $D02E
+
+VIC_CTRL1 := $D011
+VIC_CTRL2 := $D016
+
+VIC_HLINE := $D012
+
+VIC_VIDEO_ADR := $D018
+
+VIC_IRR := $D019 ; Interrupt request register
+VIC_IMR := $D01A ; Interrupt mask register
+
+VIC_BORDERCOLOR := $D020
+VIC_BG_COLOR0 := $D021
+VIC_BG_COLOR1 := $D022
+VIC_BG_COLOR2 := $D023
+VIC_BG_COLOR3 := $D024
+
+; 128 stuff:
+VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
+VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
+
+
+; ---------------------------------------------------------------------------
+; I/O: SID
+
+SID := $D400
+SID_S1Lo := $D400
+SID_S1Hi := $D401
+SID_PB1Lo := $D402
+SID_PB1Hi := $D403
+SID_Ctl1 := $D404
+SID_AD1 := $D405
+SID_SUR1 := $D406
+
+SID_S2Lo := $D407
+SID_S2Hi := $D408
+SID_PB2Lo := $D409
+SID_PB2Hi := $D40A
+SID_Ctl2 := $D40B
+SID_AD2 := $D40C
+SID_SUR2 := $D40D
+
+SID_S3Lo := $D40E
+SID_S3Hi := $D40F
+SID_PB3Lo := $D410
+SID_PB3Hi := $D411
+SID_Ctl3 := $D412
+SID_AD3 := $D413
+SID_SUR3 := $D414
+
+SID_FltLo := $D415
+SID_FltHi := $D416
+SID_FltCtl := $D417
+SID_Amp := $D418
+SID_ADConv1 := $D419
+SID_ADConv2 := $D41A
+SID_Noise := $D41B
+SID_Read3 := $D41C
+
+; ---------------------------------------------------------------------------
+; I/O: VDC (128 only)
+
+VDC_INDEX := $D600
+VDC_DATA := $D601
+
+; ---------------------------------------------------------------------------
+; I/O: CIAs
+
+CIA1 := $DC00
+CIA1_PRA := $DC00
+CIA1_PRB := $DC01
+CIA1_DDRA := $DC02
+CIA1_DDRB := $DC03
+CIA1_TOD10 := $DC08
+CIA1_TODSEC := $DC09
+CIA1_TODMIN := $DC0A
+CIA1_TODHR := $DC0B
+CIA1_ICR := $DC0D
+CIA1_CRA := $DC0E
+CIA1_CRB := $DC0F
+
+CIA2 := $DD00
+CIA2_PRA := $DD00
+CIA2_PRB := $DD01
+CIA2_DDRA := $DD02
+CIA2_DDRB := $DD03
+CIA2_TOD10 := $DD08
+CIA2_TODSEC := $DD09
+CIA2_TODMIN := $DD0A
+CIA2_TODHR := $DD0B
+CIA2_ICR := $DD0D
+CIA2_CRA := $DD0E
+CIA2_CRB := $DD0F
+
+; ---------------------------------------------------------------------------
+; I/O: MMU
+
+MMU_CR := $FF00
+MMU_CFG_CC65 := %00001110 ; Bank 0 with kernal ROM
+MMU_CFG_RAM0 := %00111111 ; Bank 0 full RAM
+MMU_CFG_RAM1 := %01111111 ; Bank 1 full RAM
+
+; ---------------------------------------------------------------------------
+; Super CPU
+
+SCPU_VIC_Bank1 := $D075
+SCPU_Slow := $D07A
+SCPU_Fast := $D07B
+SCPU_EnableRegs := $D07E
+SCPU_DisableRegs:= $D07F
+SCPU_Detect := $D0BC
+
+
--- /dev/null
+;
+; C64 generic definitions. Stolen from Elite128
+;
+
+
+; ---------------------------------------------------------------------------
+; Zero page, Commodore stuff
+
+ST := $90 ; IEC status byte
+
+TIME := $A0 ; 60 HZ clock
+FNAM_LEN := $B7 ; Length of filename
+SECADR := $B9 ; Secondary address
+DEVNUM := $BA ; Device number
+FNAM := $BB ; Pointer to filename
+KEY_COUNT := $C6 ; Number of keys in input buffer
+RVS := $C7 ; Reverse flag
+CURS_FLAG := $CC ; 1 = cursor off
+CURS_BLINK := $CD ; Blink counter
+CURS_CHAR := $CE ; Character under the cursor
+CURS_STATE := $CF ; Cursor blink state
+SCREEN_PTR := $D1 ; Pointer to current char in text screen
+CURS_X := $D3 ; Cursor column
+CURS_Y := $D6 ; Cursor row
+CRAM_PTR := $F3 ; Pointer to current char in color RAM
+
+BASIC_BUF := $200 ; Location of command-line
+BASIC_BUF_LEN = 89 ; Maximum length of command-line
+
+CHARCOLOR := $286
+CURS_COLOR := $287 ; Color under the cursor
+PALFLAG := $2A6 ; $01 = PAL, $00 = NTSC
+
+
+; ---------------------------------------------------------------------------
+; Kernal routines
+
+; Direct entries
+CLRSCR := $E544
+KBDREAD := $E5B4
+NMIEXIT := $FEBC
+
+; ---------------------------------------------------------------------------
+; Vector and other locations
+
+IRQVec := $0314
+BRKVec := $0316
+NMIVec := $0318
+
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 40
+YSIZE = 25
+
+; ---------------------------------------------------------------------------
+; I/O: VIC
+
+VIC := $D000
+VIC_SPR0_X := $D000
+VIC_SPR0_Y := $D001
+VIC_SPR1_X := $D002
+VIC_SPR1_Y := $D003
+VIC_SPR2_X := $D004
+VIC_SPR2_Y := $D005
+VIC_SPR3_X := $D006
+VIC_SPR3_Y := $D007
+VIC_SPR4_X := $D008
+VIC_SPR4_Y := $D009
+VIC_SPR5_X := $D00A
+VIC_SPR5_Y := $D00B
+VIC_SPR6_X := $D00C
+VIC_SPR6_Y := $D00D
+VIC_SPR7_X := $D00E
+VIC_SPR7_Y := $D00F
+VIC_SPR_HI_X := $D010
+VIC_SPR_ENA := $D015
+VIC_SPR_EXP_Y := $D017
+VIC_SPR_EXP_X := $D01D
+VIC_SPR_MCOLOR := $D01C
+VIC_SPR_BG_PRIO := $D01B
+
+VIC_SPR_MCOLOR0 := $D025
+VIC_SPR_MCOLOR1 := $D026
+
+VIC_SPR0_COLOR := $D027
+VIC_SPR1_COLOR := $D028
+VIC_SPR2_COLOR := $D029
+VIC_SPR3_COLOR := $D02A
+VIC_SPR4_COLOR := $D02B
+VIC_SPR5_COLOR := $D02C
+VIC_SPR6_COLOR := $D02D
+VIC_SPR7_COLOR := $D02E
+
+VIC_CTRL1 := $D011
+VIC_CTRL2 := $D016
+
+VIC_HLINE := $D012
+
+VIC_VIDEO_ADR := $D018
+
+VIC_IRR := $D019 ; Interrupt request register
+VIC_IMR := $D01A ; Interrupt mask register
+
+VIC_BORDERCOLOR := $D020
+VIC_BG_COLOR0 := $D021
+VIC_BG_COLOR1 := $D022
+VIC_BG_COLOR2 := $D023
+VIC_BG_COLOR3 := $D024
+
+; 128 stuff:
+VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
+VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
+
+
+; ---------------------------------------------------------------------------
+; I/O: SID
+
+SID := $D400
+SID_S1Lo := $D400
+SID_S1Hi := $D401
+SID_PB1Lo := $D402
+SID_PB1Hi := $D403
+SID_Ctl1 := $D404
+SID_AD1 := $D405
+SID_SUR1 := $D406
+
+SID_S2Lo := $D407
+SID_S2Hi := $D408
+SID_PB2Lo := $D409
+SID_PB2Hi := $D40A
+SID_Ctl2 := $D40B
+SID_AD2 := $D40C
+SID_SUR2 := $D40D
+
+SID_S3Lo := $D40E
+SID_S3Hi := $D40F
+SID_PB3Lo := $D410
+SID_PB3Hi := $D411
+SID_Ctl3 := $D412
+SID_AD3 := $D413
+SID_SUR3 := $D414
+
+SID_FltLo := $D415
+SID_FltHi := $D416
+SID_FltCtl := $D417
+SID_Amp := $D418
+SID_ADConv1 := $D419
+SID_ADConv2 := $D41A
+SID_Noise := $D41B
+SID_Read3 := $D41C
+
+; ---------------------------------------------------------------------------
+; I/O: VDC (128 only)
+
+VDC_INDEX := $D600
+VDC_DATA := $D601
+
+; ---------------------------------------------------------------------------
+; I/O: CIAs
+
+CIA1 := $DC00
+CIA1_PRA := $DC00
+CIA1_PRB := $DC01
+CIA1_DDRA := $DC02
+CIA1_DDRB := $DC03
+CIA1_TOD10 := $DC08
+CIA1_TODSEC := $DC09
+CIA1_TODMIN := $DC0A
+CIA1_TODHR := $DC0B
+CIA1_ICR := $DC0D
+CIA1_CRA := $DC0E
+CIA1_CRB := $DC0F
+
+CIA2 := $DD00
+CIA2_PRA := $DD00
+CIA2_PRB := $DD01
+CIA2_DDRA := $DD02
+CIA2_DDRB := $DD03
+CIA2_TOD10 := $DD08
+CIA2_TODSEC := $DD09
+CIA2_TODMIN := $DD0A
+CIA2_TODHR := $DD0B
+CIA2_ICR := $DD0D
+CIA2_CRA := $DD0E
+CIA2_CRB := $DD0F
+
+; ---------------------------------------------------------------------------
+; Super CPU
+
+SCPU_VIC_Bank1 := $D075
+SCPU_Slow := $D07A
+SCPU_Fast := $D07B
+SCPU_EnableRegs := $D07E
+SCPU_DisableRegs:= $D07F
+SCPU_Detect := $D0BC
+
+
+; ---------------------------------------------------------------------------
+; Processor Port at $01
+
+LORAM = $01 ; Enable the basic rom
+HIRAM = $02 ; Enable the kernal rom
+IOEN = $04 ; Enable I/O
+CASSDATA = $08 ; Cassette data
+CASSPLAY = $10 ; Cassette: Play
+CASSMOT = $20 ; Cassette motor on
+TP_FAST = $80 ; Switch Rossmoeller TurboProcess to fast mode
+
+RAMONLY = $F8 ; (~(LORAM | HIRAM | IOEN)) & $FF
+
+
--- /dev/null
+;
+; Zero page variables and I/O definitions for the CBM 510
+;
+; Taken from a kernal disassembly done by myself in 2000/2001.
+;
+; Ullrich von Bassewitz, 13.09.2001
+
+
+;-----------------------------------------------------------------------------
+; Zeropage stuff
+
+ExecReg = $0000
+IndReg = $0001
+
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 40
+YSIZE = 25
+
+;-----------------------------------------------------------------------------
+; I/O Definitions
+
+; I/O $d800: VIC
+
+VIC_SPR0_X = $00
+VIC_SPR0_Y = $01
+VIC_SPR1_X = $02
+VIC_SPR1_Y = $03
+VIC_SPR2_X = $04
+VIC_SPR2_Y = $05
+VIC_SPR3_X = $06
+VIC_SPR3_Y = $07
+VIC_SPR4_X = $08
+VIC_SPR4_Y = $09
+VIC_SPR5_X = $0A
+VIC_SPR5_Y = $0B
+VIC_SPR6_X = $0C
+VIC_SPR6_Y = $0D
+VIC_SPR7_X = $0E
+VIC_SPR7_Y = $0F
+VIC_SPR_HI_X = $10
+VIC_SPR_ENA = $15
+VIC_SPR_EXP_Y = $17
+VIC_SPR_EXP_X = $1D
+VIC_SPR_MCOLOR = $1C
+VIC_SPR_BG_PRIO = $1B
+
+VIC_SPR_MCOLOR0 = $25
+VIC_SPR_MCOLOR1 = $26
+
+VIC_SPR0_COLOR = $27
+VIC_SPR1_COLOR = $28
+VIC_SPR2_COLOR = $29
+VIC_SPR3_COLOR = $2A
+VIC_SPR4_COLOR = $2B
+VIC_SPR5_COLOR = $2C
+VIC_SPR6_COLOR = $2D
+VIC_SPR7_COLOR = $2E
+
+VIC_CTRL1 = $11
+VIC_CTRL2 = $16
+
+VIC_HLINE = $12
+
+VIC_VIDEO_ADR = $18
+
+VIC_IRR = $19 ; Interrupt request register
+VIC_IMR = $1A ; Interrupt mask register
+
+VIC_BORDERCOLOR = $20
+VIC_BG_COLOR0 = $21
+VIC_BG_COLOR1 = $22
+VIC_BG_COLOR2 = $23
+VIC_BG_COLOR3 = $24
+
+
+
+; I/O $da00: SID 6581
+
+SID_S1Lo = $00
+SID_S1Hi = $01
+SID_PB1Lo = $02
+SID_PB1Hi = $03
+SID_Ctl1 = $04
+SID_AD1 = $05
+SID_SUR1 = $06
+
+SID_S2Lo = $07
+SID_S2Hi = $08
+SID_PB2Lo = $09
+SID_PB2Hi = $0A
+SID_Ctl2 = $0B
+SID_AD2 = $0C
+SID_SUR2 = $0D
+
+SID_S3Lo = $0E
+SID_S3Hi = $0F
+SID_PB3Lo = $10
+SID_PB3Hi = $11
+SID_Ctl3 = $12
+SID_AD3 = $13
+SID_SUR3 = $14
+
+SID_FltLo = $15
+SID_FltHi = $16
+SID_FltCtl = $17
+SID_Amp = $18
+SID_ADConv1 = $19
+SID_ADConv2 = $1A
+SID_Noise = $1B
+SID_Read3 = $1C
+
+
+; I/O $db00: CIA 6526 Inter Process Communication
+; I/O $dc00: CIA 6526
+
+.struct CIA
+ PRA .byte
+ PRB .byte
+ DDRA .byte
+ DDRB .byte
+ .union
+ .struct
+ TALO .byte
+ TAHI .byte
+ .endstruct
+ TA .word
+ .endunion
+ .union
+ .struct
+ TBLO .byte
+ TBHI .byte
+ .endstruct
+ TB .word
+ .endunion
+ TOD10 .byte
+ TODSEC .byte
+ TODMIN .byte
+ TODHR .byte
+ SDR .byte
+ ICR .byte
+ CRA .byte
+ CRB .byte
+.endstruct
+
+
+; I/O $dd00: ACIA 6551
+
+.struct ACIA
+ DATA .byte
+ STATUS .byte
+ CMD .byte
+ CTRL .BYTE
+.endstruct
+
+
+; I/O $de00: Triport #1 6525
+; I/O $df00: Triport #2 6525
+
+.struct TPI
+ PRA .byte
+ PRB .byte
+ .union
+ PRC .byte
+ INT .byte
+ .endunion
+ DDRA .byte
+ DDRB .byte
+ .union
+ DDRC .byte
+ IMR .byte
+ .endunion
+ CR .byte
+ AIR .byte
+.endstruct
+
+
+; Out video memory address
+
+COLOR_RAM = $D400 ; System bank
+
--- /dev/null
+;
+; Zeropage and I/O definitions for the CBM 610
+;
+; Taken from a kernal disassembly done by myself in 1987.
+;
+; Ullrich von Bassewitz, 28.09.1998
+
+
+; ---------------------------------------------------------------------------
+; Zeropage registers
+
+ExecReg = $00
+IndReg = $01
+
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 80
+YSIZE = 25
+
+; ---------------------------------------------------------------------------
+; I/O definitions
+
+
+; I/O $d800: CRTC 6545
+
+.struct CRTC
+ ADDR .byte
+ DATA .byte
+.endstruct
+
+; I/O $db00: CIA 6526 Inter Process Communication
+;
+; IPCcia = $db00
+
+.struct CIA
+ PRA .byte
+ PRB .byte
+ DDRA .byte
+ DDRB .byte
+ .union
+ .struct
+ TALO .byte
+ TAHI .byte
+ .endstruct
+ TA .word
+ .endunion
+ .union
+ .struct
+ TBLO .byte
+ TBHI .byte
+ .endstruct
+ TB .word
+ .endunion
+ TOD10 .byte
+ TODSEC .byte
+ TODMIN .byte
+ TODHR .byte
+ SDR .byte
+ ICR .byte
+ CRA .byte
+ CRB .byte
+.endstruct
+
+
+; I/O $dc00: CIA 6526
+;
+; cia = $dc00
+
+
+
+; I/O $dd00: ACIA 6551
+;
+; acia = $dd00
+
+.struct ACIA
+ DATA .byte
+ STATUS .byte
+ CMD .byte
+ CTRL .BYTE
+.endstruct
+
+
+; I/O $de00: Triport #1 6525
+;
+; tpi1 = $de00
+
+.struct TPI
+ PRA .byte
+ PRB .byte
+ .union
+ PRC .byte
+ INT .byte
+ .endunion
+ DDRA .byte
+ DDRB .byte
+ .union
+ DDRC .byte
+ IMR .byte
+ .endunion
+ CR .byte
+ AIR .byte
+.endstruct
+
+
+; I/O $df00: Triport #2 6525
+
+; tpi2 = $df00
+
+
--- /dev/null
+;
+; NES definitions. By Groepaz/Hitmem.
+;
+
+
+;; FIXME: optimize zeropage usage
+
+SCREEN_PTR = $62 ;2
+CRAM_PTR = $64 ;2
+CHARCOLOR = $66
+BGCOLOR = $67
+RVS = $68
+CURS_X = $69
+CURS_Y = $6a
+
+tickcount = $6b ;2
+
+VBLANK_FLAG = $70
+
+ringbuff = $0200
+ringwrite = $71
+ringread = $72
+ringcount = $73
+
+ppuhi = $74
+ppulo = $75
+ppuval = $76
+
+screenrows = (30-1)
+charsperline = 32
+xsize = charsperline
+
+;; PPU defines
+
+PPU_CTRL1 = $2000
+PPU_CTRL2 = $2001
+PPU_STATUS = $2002
+PPU_SPR_ADDR = $2003
+PPU_SPR_IO = $2004
+PPU_VRAM_ADDR1 = $2005
+PPU_VRAM_ADDR2 = $2006
+PPU_VRAM_IO = $2007
+
+;; APU defines
+
+APU_PULSE1CTRL = $4000 ; Pulse #1 Control Register (W)
+APU_PULSE1RAMP = $4001 ; Pulse #1 Ramp Control Register (W)
+APU_PULSE1FTUNE = $4002 ; Pulse #1 Fine Tune (FT) Register (W)
+APU_PULSE1CTUNE = $4003 ; Pulse #1 Coarse Tune (CT) Register (W)
+APU_PULSE2CTRL = $4004 ; Pulse #2 Control Register (W)
+APU_PULSE2RAMP = $4005 ; Pulse #2 Ramp Control Register (W)
+APU_PULSE2FTUNE = $4006 ; Pulse #2 Fine Tune Register (W)
+APU_PULSE2STUNE = $4007 ; Pulse #2 Coarse Tune Register (W)
+APU_TRICTRL1 = $4008 ; Triangle Control Register #1 (W)
+APU_TRICTRL2 = $4009 ; Triangle Control Register #2 (?)
+APU_TRIFREQ1 = $400A ; Triangle Frequency Register #1 (W)
+APU_TRIFREQ2 = $400B ; Triangle Frequency Register #2 (W)
+APU_NOISECTRL = $400C ; Noise Control Register #1 (W)
+;;APU_ = $400D ; Unused (???)
+APU_NOISEFREQ1 = $400E ; Noise Frequency Register #1 (W)
+APU_NOISEFREQ2 = $400F ; Noise Frequency Register #2 (W)
+APU_MODCTRL = $4010 ; Delta Modulation Control Register (W)
+APU_MODDA = $4011 ; Delta Modulation D/A Register (W)
+APU_MODADDR = $4012 ; Delta Modulation Address Register (W)
+APU_MODLEN = $4013 ; Delta Modulation Data Length Register (W)
+APU_SPR_DMA = $4014 ; Sprite DMA Register (W)
+APU_CHANCTRL = $4015 ; Sound/Vertical Clock Signal Register (R)
+APU_PAD1 = $4016 ; Joypad #1 (RW)
+APU_PAD2 = $4017 ; Joypad #2/SOFTCLK (RW)
+
+
+CH_HLINE = 11
+CH_VLINE = 14
+CH_ULCORNER = 176
+CH_URCORNER = 174
+CH_LLCORNER = 173
+CH_LRCORNER = 189
+CH_TTEE = 178
+CH_RTEE = 179
+CH_BTEE = 177
+CH_LTEE = 171
+CH_CROSS = 123
+CH_CURS_UP = 145
+CH_CURS_DOWN = 17
+CH_CURS_LEFT = 157
+CH_CURS_RIGHT = 29
+CH_PI = 126
+CH_DEL = 20
+CH_INS = 148
+CH_ENTER = 10
+CH_STOP = 3
+CH_ESC = 27
+
--- /dev/null
+;
+; Plus/4 generic definitions.
+;
+
+
+; ---------------------------------------------------------------------------
+; Zero page, Commodore stuff
+
+TMPPTR := $22 ; Temporary ptr used by BASIC
+ST := $90 ; IEC status byte
+TIME := $A3 ; 60HZ clock
+FNAM_LEN := $AB ; Length of filename
+LFN := $AC ; Logical file number
+SECADR := $AD ; Secondary address
+DEVNUM := $AE ; Device number
+FNAM := $AF ; Pointer to filename for OPEN
+KEY_COUNT := $EF ; Number of keys in input buffer
+RVS := $C2 ; Reverse flag
+CURS_X := $CA ; Cursor column
+CURS_Y := $CD ; Cursor row
+SCREEN_PTR := $C8 ; Pointer to current char in text screen
+CRAM_PTR := $EA ; Pointer to current char in color RAM
+
+BASIC_BUF := $200 ; Location of command-line
+BASIC_BUF_LEN = 89 ; Maximum length of command-line
+
+FNBUF := $25E ; Buffer for filename
+FETCH := $494 ; lda (zp),y from RAM
+CHARCOLOR := $53B
+FKEY_COUNT := $55D ; Characters for function key
+FKEY_SPACE := $55F ; Function key definitions
+FKEY_ORIG := $F3D2 ; Original definitions
+
+; ---------------------------------------------------------------------------
+; Kernal routines
+
+; Direct entries
+CLRSCR := $D88B
+KBDREAD := $D8C1
+
+; ---------------------------------------------------------------------------
+; Vector and other locations
+
+IRQVec := $0314
+BRKVec := $0316
+NMIVec := $0318
+
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 40
+YSIZE = 25
+
+; ---------------------------------------------------------------------------
+; I/O
+
+TED_T1LO := $FF00
+TED_T1HI := $FF01
+TED_T2LO := $FF02
+TED_T2HI := $FF03
+TED_T3LO := $FF04
+TED_T4HI := $FF05
+TED_MULTI1 := $FF07
+TED_KBD := $FF08
+TED_CURSHI := $FF0C
+TED_CURSLO := $FF0D
+TED_V1FRQLO := $FF0E
+TED_V2FRQLO := $FF0F
+TED_V2FRQHI := $FF10
+TED_BGCOLOR := $FF15
+TED_COLOR1 := $FF16
+TED_COLOR2 := $FF17
+TED_COLOR3 := $FF18
+TED_BORDERCOLOR := $FF19
+TED_VLINEHI := $FF1C
+TED_VLINELO := $FF1D
+TED_HPOS := $FF1E
+TED_ROMSEL := $FF3E
+TED_RAMSEL := $FF3F
+
+; ---------------------------------------------------------------------------
+; RAM/ROM selection addresses
+
+ENABLE_ROM := TED_ROMSEL
+ENABLE_RAM := TED_RAMSEL
+
+
--- /dev/null
+; supervision symbols
+
+; supervision 65c02s
+; in cc65 up to 2.9.1 65c02 means 65c02s
+.pc02
+
+lcd_addr = $4000
+LCD_LINESIZE = $30
+LCD_WIDTH = 160
+LCD_HEIGHT = 160
+; 2 bit per pixel, packed
+
+lcd_width = $2000
+lcd_height = $2001
+lcd_xpos = $2002 ; in pixel, bit 0+1 not used
+lcd_ypos = $2003 ; weird
+
+sv_port_r = $2021
+sv_port_w = $2022
+
+sv_timer_count = $2023
+; read for quitting
+sv_timer_quit = $2024
+
+; bit 0 timer, bit 1 dma
+sv_irq_source = $2027
+SV_IRQ_REQUEST_TIMER = 1
+SV_IRQ_REQUEST_DMA = 2
+
+; bit 5,6,7 select bank at 0x8000
+sv_bank = $2026
+SV_NMI_ENABLE_ON = 1
+SV_IRQ_ENABLE_TIMER = 2
+SV_IRQ_ENABLE_DMA = 4
+SV_LCD_ON = 8
+SV_TIMER_MODE_240Hz = $10 ; else 15360
+
+
+; low activ/pressed
+sv_control = $2020
+SV_RIGHT = 1
+SV_LEFT = 2
+SV_DOWN = 4
+SV_UP = 8
+SV_BUTTONB = $10
+SV_BUTTONA = $20
+SV_SELECT = $40
+SV_START = $80
+
+; frequency=125000/counter
+sv_audio_right_counter = $2010 ;word
+sv_audio_left_counter = $2014
+SV_AUDIO_ON =$40
+;bits 0..3 volume
+; bit 4 ?
+; bit 5 ?
+sv_audio_right_control = $2012
+sv_audio_left_control = $2016
+; write activates tone for x/60 sec (0 means 256)
+sv_audio_right_timer = $2013
+sv_audio_left_timer = $2017
+
+
+;read for irq quitting
+sv_dma_quit = $2025
+sv_dma_on = $201c
+; bit 7 true start, false stop
+sv_dma_start = $2018 ; word
+sv_dma_size = $201a ; *32 samples
+sv_dma_control = $201b
+; bit 0,1 speed: 0 15360, 11 15360/4
+; bit 2,3 volume: 0 silent, 11 loud
+
+sv_noise_volume = $2028 ; and frequency
+sv_noise_timer = $2029
+sv_noise_control = $202a
--- /dev/null
+;
+; Vic20 generic definitions. Stolen mostly from c64.inc - Steve Schmidtke
+;
+
+
+; ---------------------------------------------------------------------------
+; Zero page, Commodore stuff
+
+ST := $90 ; IEC status byte
+
+TIME := $A0 ; 60HZ clock
+FNAM_LEN := $B7 ; Length of filename
+SECADR := $B9 ; Secondary address
+DEVNUM := $BA ; Device number
+FNAM := $BB ; Pointer to filename
+KEY_COUNT := $C6 ; Number of keys in input buffer
+RVS := $C7 ; Reverse flag
+CURS_FLAG := $CC ; 1 = cursor off
+CURS_BLINK := $CD ; Blink counter
+CURS_CHAR := $CE ; Character under the cursor
+CURS_STATE := $CF ; Cursor blink state
+SCREEN_PTR := $D1 ; Pointer to current char in text screen
+CURS_X := $D3 ; Cursor column
+CURS_Y := $D6 ; Cursor row
+CRAM_PTR := $F3 ; Pointer to current char in color RAM
+
+BASIC_BUF := $200 ; Location of command-line
+BASIC_BUF_LEN = 89 ; Maximum length of command-line
+
+CHARCOLOR := $286
+CURS_COLOR := $287 ; Color under the cursor
+
+
+; ---------------------------------------------------------------------------
+; Screen size
+
+XSIZE = 22
+YSIZE = 23
+
+; ---------------------------------------------------------------------------
+; Kernal routines
+
+; Direct entries
+CLRSCR := $E55F
+KBDREAD := $E5CF
+
+; ---------------------------------------------------------------------------
+; Vector and other locations
+
+IRQVec := $0314
+BRKVec := $0316
+NMIVec := $0318
+
+; ---------------------------------------------------------------------------
+; I/O: 6560 VIC
+
+VIC := $9000
+VIC_LINES := $9003 ; Screen lines, bit 7 is bit 0 from VIC_HLINE
+VIC_HLINE := $9004 ; Rasterline, bits 1-8
+VIC_COLOR := $900F ; Border and background color
+
+; ---------------------------------------------------------------------------
+; I/O: 6522 VIA1
+
+VIA1 := $9110
+VIA1_JOY := $9111
+VIA1_DDRB := $9112
+VIA1_DDRA := $9113
+
+; ---------------------------------------------------------------------------
+; I/O: 6522 VIA2
+
+VIA2 := $9120
+VIA2_JOY := $9120
+VIA2_DDRB := $9122
+VIA2_DDRA := $9123
+
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../apple2 -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../apple2 -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I ../apple2 -I ../../include
#--------------------------------------------------------------------------
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
+++ /dev/null
-;
-; C64 generic definitions. Stolen from Elite128
-;
-
-
-; ---------------------------------------------------------------------------
-; Zero page, Commodore stuff
-
-ST := $90 ; IEC status byte
-
-TIME := $A0 ; 60HZ clock
-FNAM_LEN := $B7 ; Length of filename
-SECADR := $B9 ; Secondary address
-DEVNUM := $BA ; Device number
-FNAM := $BB ; Address of filename
-FNAM_BANK := $C7 ; Bank for filename
-KEY_COUNT := $D0 ; Number of keys in input buffer
-FKEY_COUNT := $D1 ; Characters for function key
-MODE := $D7 ; 40/80 column mode flag
-CURS_X := $EC ; Cursor column
-CURS_Y := $EB ; Cursor row
-SCREEN_PTR := $E0 ; Pointer to current char in text screen
-CRAM_PTR := $E2 ; Pointer to current char in color RAM
-
-CHARCOLOR := $F1
-RVS := $F3 ; Reverse output flag
-SCROLL := $F8 ; Disable scrolling flag
-
-BASIC_BUF := $200 ; Location of command-line
-BASIC_BUF_LEN = 162 ; Maximum length of command-line
-
-FETCH := $2A2 ; Fetch subroutine in RAM
-FETVEC := $2AA ; Vector patch location for FETCH
-STASH := $2AF ; Stash routine in RAM
-STAVEC := $2B9 ; Vector patch location for STASH
-PALFLAG := $A03 ; $FF=PAL, $00=NTSC
-INIT_STATUS := $A04 ; Flag: Reset/NMI Status
-FKEY_LEN := $1000 ; Function key lengths
-FKEY_TEXT := $100A ; Function key texts
-
-; ---------------------------------------------------------------------------
-; Kernal routines
-
-; Direct entries
-CURS_SET := $CD57
-CURS_ON := $CD6F
-CURS_OFF := $CD9F
-CLRSCR := $C142
-KBDREAD := $C006
-NEWLINE := $C363
-PRINT := $C322
-NMIEXIT := $FF33
-INDFET := $FF74
-
-; ---------------------------------------------------------------------------
-; Vectors
-
-IRQVec := $0314
-BRKVec := $0316
-NMIVec := $0318
-KeyStoreVec := $033C
-
-; ---------------------------------------------------------------------------
-; I/O: VIC
-
-VIC := $D000
-VIC_SPR0_X := $D000
-VIC_SPR0_Y := $D001
-VIC_SPR1_X := $D002
-VIC_SPR1_Y := $D003
-VIC_SPR2_X := $D004
-VIC_SPR2_Y := $D005
-VIC_SPR3_X := $D006
-VIC_SPR3_Y := $D007
-VIC_SPR4_X := $D008
-VIC_SPR4_Y := $D009
-VIC_SPR5_X := $D00A
-VIC_SPR5_Y := $D00B
-VIC_SPR6_X := $D00C
-VIC_SPR6_Y := $D00D
-VIC_SPR7_X := $D00E
-VIC_SPR7_Y := $D00F
-VIC_SPR_HI_X := $D010
-VIC_SPR_ENA := $D015
-VIC_SPR_EXP_Y := $D017
-VIC_SPR_EXP_X := $D01D
-VIC_SPR_MCOLOR := $D01C
-VIC_SPR_BG_PRIO := $D01B
-
-VIC_SPR_MCOLOR0 := $D025
-VIC_SPR_MCOLOR1 := $D026
-
-VIC_SPR0_COLOR := $D027
-VIC_SPR1_COLOR := $D028
-VIC_SPR2_COLOR := $D029
-VIC_SPR3_COLOR := $D02A
-VIC_SPR4_COLOR := $D02B
-VIC_SPR5_COLOR := $D02C
-VIC_SPR6_COLOR := $D02D
-VIC_SPR7_COLOR := $D02E
-
-VIC_CTRL1 := $D011
-VIC_CTRL2 := $D016
-
-VIC_HLINE := $D012
-
-VIC_VIDEO_ADR := $D018
-
-VIC_IRR := $D019 ; Interrupt request register
-VIC_IMR := $D01A ; Interrupt mask register
-
-VIC_BORDERCOLOR := $D020
-VIC_BG_COLOR0 := $D021
-VIC_BG_COLOR1 := $D022
-VIC_BG_COLOR2 := $D023
-VIC_BG_COLOR3 := $D024
-
-; 128 stuff:
-VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
-VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
-
-
-; ---------------------------------------------------------------------------
-; I/O: SID
-
-SID := $D400
-SID_S1Lo := $D400
-SID_S1Hi := $D401
-SID_PB1Lo := $D402
-SID_PB1Hi := $D403
-SID_Ctl1 := $D404
-SID_AD1 := $D405
-SID_SUR1 := $D406
-
-SID_S2Lo := $D407
-SID_S2Hi := $D408
-SID_PB2Lo := $D409
-SID_PB2Hi := $D40A
-SID_Ctl2 := $D40B
-SID_AD2 := $D40C
-SID_SUR2 := $D40D
-
-SID_S3Lo := $D40E
-SID_S3Hi := $D40F
-SID_PB3Lo := $D410
-SID_PB3Hi := $D411
-SID_Ctl3 := $D412
-SID_AD3 := $D413
-SID_SUR3 := $D414
-
-SID_FltLo := $D415
-SID_FltHi := $D416
-SID_FltCtl := $D417
-SID_Amp := $D418
-SID_ADConv1 := $D419
-SID_ADConv2 := $D41A
-SID_Noise := $D41B
-SID_Read3 := $D41C
-
-; ---------------------------------------------------------------------------
-; I/O: VDC (128 only)
-
-VDC_INDEX := $D600
-VDC_DATA := $D601
-
-; ---------------------------------------------------------------------------
-; I/O: CIAs
-
-CIA1 := $DC00
-CIA1_PRA := $DC00
-CIA1_PRB := $DC01
-CIA1_DDRA := $DC02
-CIA1_DDRB := $DC03
-CIA1_TOD10 := $DC08
-CIA1_TODSEC := $DC09
-CIA1_TODMIN := $DC0A
-CIA1_TODHR := $DC0B
-CIA1_ICR := $DC0D
-CIA1_CRA := $DC0E
-CIA1_CRB := $DC0F
-
-CIA2 := $DD00
-CIA2_PRA := $DD00
-CIA2_PRB := $DD01
-CIA2_DDRA := $DD02
-CIA2_DDRB := $DD03
-CIA2_TOD10 := $DD08
-CIA2_TODSEC := $DD09
-CIA2_TODMIN := $DD0A
-CIA2_TODHR := $DD0B
-CIA2_ICR := $DD0D
-CIA2_CRA := $DD0E
-CIA2_CRB := $DD0F
-
-; ---------------------------------------------------------------------------
-; I/O: MMU
-
-MMU_CR := $FF00
-MMU_CFG_CC65 := %00001110 ; Bank 0 with kernal ROM
-MMU_CFG_RAM0 := %00111111 ; Bank 0 full RAM
-MMU_CFG_RAM1 := %01111111 ; Bank 1 full RAM
-
-; ---------------------------------------------------------------------------
-; Super CPU
-
-SCPU_VIC_Bank1 := $D075
-SCPU_Slow := $D07A
-SCPU_Fast := $D07B
-SCPU_EnableRegs := $D07E
-SCPU_DisableRegs:= $D07F
-SCPU_Detect := $D0BC
-
-
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I. -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
.destructor _reset_brk
.export _brk_a, _brk_x, _brk_y, _brk_sr, _brk_pc
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
.bss
.include "em-kernel.inc"
.include "em-error.inc"
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
.macpack generic
.export _cgetc
.import cursor
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
; --------------------------------------------------------------------------
.export _clrscr
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
_clrscr = CLRSCR
.export _textcolor, _bgcolor, _bordercolor
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
_textcolor:
ldx CHARCOLOR ; get old value
.exportzp CURS_X, CURS_Y
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
.import popa, _gotoxy
.import PLOT
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
_cputcxy:
.import __INTERRUPTOR_COUNT__
.include "zeropage.inc"
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
; ------------------------------------------------------------------------
; /* Return the video mode the machine is using */
;
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
.include "get_tv.inc"
.export _kbhit
.import return0, return1
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
_kbhit:
lda KEY_COUNT ; Get number of characters
.constructor initmainargs, 24
.import __argc, __argv
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
.export __randomize
.import _srand
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
__randomize:
ldx TED_VLINELO ; Use TED rasterline as high byte
.export _revers
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
.proc _revers
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
+++ /dev/null
-;
-; C64 generic definitions. Stolen from Elite128
-;
-
-
-; ---------------------------------------------------------------------------
-; Zero page, Commodore stuff
-
-ST := $90 ; IEC status byte
-
-TIME := $A0 ; 60 HZ clock
-FNAM_LEN := $B7 ; Length of filename
-SECADR := $B9 ; Secondary address
-DEVNUM := $BA ; Device number
-FNAM := $BB ; Pointer to filename
-KEY_COUNT := $C6 ; Number of keys in input buffer
-RVS := $C7 ; Reverse flag
-CURS_FLAG := $CC ; 1 = cursor off
-CURS_BLINK := $CD ; Blink counter
-CURS_CHAR := $CE ; Character under the cursor
-CURS_STATE := $CF ; Cursor blink state
-SCREEN_PTR := $D1 ; Pointer to current char in text screen
-CURS_X := $D3 ; Cursor column
-CURS_Y := $D6 ; Cursor row
-CRAM_PTR := $F3 ; Pointer to current char in color RAM
-
-BASIC_BUF := $200 ; Location of command-line
-BASIC_BUF_LEN = 89 ; Maximum length of command-line
-
-CHARCOLOR := $286
-CURS_COLOR := $287 ; Color under the cursor
-PALFLAG := $2A6 ; $01 = PAL, $00 = NTSC
-
-
-; ---------------------------------------------------------------------------
-; Kernal routines
-
-; Direct entries
-CLRSCR := $E544
-KBDREAD := $E5B4
-NMIEXIT := $FEBC
-
-; ---------------------------------------------------------------------------
-; Vector and other locations
-
-IRQVec := $0314
-BRKVec := $0316
-NMIVec := $0318
-
-; ---------------------------------------------------------------------------
-; Screen size
-
-XSIZE = 40
-YSIZE = 25
-
-; ---------------------------------------------------------------------------
-; I/O: VIC
-
-VIC := $D000
-VIC_SPR0_X := $D000
-VIC_SPR0_Y := $D001
-VIC_SPR1_X := $D002
-VIC_SPR1_Y := $D003
-VIC_SPR2_X := $D004
-VIC_SPR2_Y := $D005
-VIC_SPR3_X := $D006
-VIC_SPR3_Y := $D007
-VIC_SPR4_X := $D008
-VIC_SPR4_Y := $D009
-VIC_SPR5_X := $D00A
-VIC_SPR5_Y := $D00B
-VIC_SPR6_X := $D00C
-VIC_SPR6_Y := $D00D
-VIC_SPR7_X := $D00E
-VIC_SPR7_Y := $D00F
-VIC_SPR_HI_X := $D010
-VIC_SPR_ENA := $D015
-VIC_SPR_EXP_Y := $D017
-VIC_SPR_EXP_X := $D01D
-VIC_SPR_MCOLOR := $D01C
-VIC_SPR_BG_PRIO := $D01B
-
-VIC_SPR_MCOLOR0 := $D025
-VIC_SPR_MCOLOR1 := $D026
-
-VIC_SPR0_COLOR := $D027
-VIC_SPR1_COLOR := $D028
-VIC_SPR2_COLOR := $D029
-VIC_SPR3_COLOR := $D02A
-VIC_SPR4_COLOR := $D02B
-VIC_SPR5_COLOR := $D02C
-VIC_SPR6_COLOR := $D02D
-VIC_SPR7_COLOR := $D02E
-
-VIC_CTRL1 := $D011
-VIC_CTRL2 := $D016
-
-VIC_HLINE := $D012
-
-VIC_VIDEO_ADR := $D018
-
-VIC_IRR := $D019 ; Interrupt request register
-VIC_IMR := $D01A ; Interrupt mask register
-
-VIC_BORDERCOLOR := $D020
-VIC_BG_COLOR0 := $D021
-VIC_BG_COLOR1 := $D022
-VIC_BG_COLOR2 := $D023
-VIC_BG_COLOR3 := $D024
-
-; 128 stuff:
-VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
-VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
-
-
-; ---------------------------------------------------------------------------
-; I/O: SID
-
-SID := $D400
-SID_S1Lo := $D400
-SID_S1Hi := $D401
-SID_PB1Lo := $D402
-SID_PB1Hi := $D403
-SID_Ctl1 := $D404
-SID_AD1 := $D405
-SID_SUR1 := $D406
-
-SID_S2Lo := $D407
-SID_S2Hi := $D408
-SID_PB2Lo := $D409
-SID_PB2Hi := $D40A
-SID_Ctl2 := $D40B
-SID_AD2 := $D40C
-SID_SUR2 := $D40D
-
-SID_S3Lo := $D40E
-SID_S3Hi := $D40F
-SID_PB3Lo := $D410
-SID_PB3Hi := $D411
-SID_Ctl3 := $D412
-SID_AD3 := $D413
-SID_SUR3 := $D414
-
-SID_FltLo := $D415
-SID_FltHi := $D416
-SID_FltCtl := $D417
-SID_Amp := $D418
-SID_ADConv1 := $D419
-SID_ADConv2 := $D41A
-SID_Noise := $D41B
-SID_Read3 := $D41C
-
-; ---------------------------------------------------------------------------
-; I/O: VDC (128 only)
-
-VDC_INDEX := $D600
-VDC_DATA := $D601
-
-; ---------------------------------------------------------------------------
-; I/O: CIAs
-
-CIA1 := $DC00
-CIA1_PRA := $DC00
-CIA1_PRB := $DC01
-CIA1_DDRA := $DC02
-CIA1_DDRB := $DC03
-CIA1_TOD10 := $DC08
-CIA1_TODSEC := $DC09
-CIA1_TODMIN := $DC0A
-CIA1_TODHR := $DC0B
-CIA1_ICR := $DC0D
-CIA1_CRA := $DC0E
-CIA1_CRB := $DC0F
-
-CIA2 := $DD00
-CIA2_PRA := $DD00
-CIA2_PRB := $DD01
-CIA2_DDRA := $DD02
-CIA2_DDRB := $DD03
-CIA2_TOD10 := $DD08
-CIA2_TODSEC := $DD09
-CIA2_TODMIN := $DD0A
-CIA2_TODHR := $DD0B
-CIA2_ICR := $DD0D
-CIA2_CRA := $DD0E
-CIA2_CRB := $DD0F
-
-; ---------------------------------------------------------------------------
-; Super CPU
-
-SCPU_VIC_Bank1 := $D075
-SCPU_Slow := $D07A
-SCPU_Fast := $D07B
-SCPU_EnableRegs := $D07E
-SCPU_DisableRegs:= $D07F
-SCPU_Detect := $D0BC
-
-
-; ---------------------------------------------------------------------------
-; Processor Port at $01
-
-LORAM = $01 ; Enable the basic rom
-HIRAM = $02 ; Enable the kernal rom
-IOEN = $04 ; Enable I/O
-CASSDATA = $08 ; Cassette data
-CASSPLAY = $10 ; Cassette: Play
-CASSMOT = $20 ; Cassette motor on
-TP_FAST = $80 ; Switch Rossmoeller TurboProcess to fast mode
-
-RAMONLY = $F8 ; (~(LORAM | HIRAM | IOEN)) & $FF
-
-
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
+++ /dev/null
-;
-; Zero page variables and I/O definitions for the CBM 510
-;
-; Taken from a kernal disassembly done by myself in 2000/2001.
-;
-; Ullrich von Bassewitz, 13.09.2001
-
-
-;-----------------------------------------------------------------------------
-; Zeropage stuff
-
-ExecReg = $0000
-IndReg = $0001
-
-; ---------------------------------------------------------------------------
-; Screen size
-
-XSIZE = 40
-YSIZE = 25
-
-;-----------------------------------------------------------------------------
-; I/O Definitions
-
-; I/O $d800: VIC
-
-VIC_SPR0_X = $00
-VIC_SPR0_Y = $01
-VIC_SPR1_X = $02
-VIC_SPR1_Y = $03
-VIC_SPR2_X = $04
-VIC_SPR2_Y = $05
-VIC_SPR3_X = $06
-VIC_SPR3_Y = $07
-VIC_SPR4_X = $08
-VIC_SPR4_Y = $09
-VIC_SPR5_X = $0A
-VIC_SPR5_Y = $0B
-VIC_SPR6_X = $0C
-VIC_SPR6_Y = $0D
-VIC_SPR7_X = $0E
-VIC_SPR7_Y = $0F
-VIC_SPR_HI_X = $10
-VIC_SPR_ENA = $15
-VIC_SPR_EXP_Y = $17
-VIC_SPR_EXP_X = $1D
-VIC_SPR_MCOLOR = $1C
-VIC_SPR_BG_PRIO = $1B
-
-VIC_SPR_MCOLOR0 = $25
-VIC_SPR_MCOLOR1 = $26
-
-VIC_SPR0_COLOR = $27
-VIC_SPR1_COLOR = $28
-VIC_SPR2_COLOR = $29
-VIC_SPR3_COLOR = $2A
-VIC_SPR4_COLOR = $2B
-VIC_SPR5_COLOR = $2C
-VIC_SPR6_COLOR = $2D
-VIC_SPR7_COLOR = $2E
-
-VIC_CTRL1 = $11
-VIC_CTRL2 = $16
-
-VIC_HLINE = $12
-
-VIC_VIDEO_ADR = $18
-
-VIC_IRR = $19 ; Interrupt request register
-VIC_IMR = $1A ; Interrupt mask register
-
-VIC_BORDERCOLOR = $20
-VIC_BG_COLOR0 = $21
-VIC_BG_COLOR1 = $22
-VIC_BG_COLOR2 = $23
-VIC_BG_COLOR3 = $24
-
-
-
-; I/O $da00: SID 6581
-
-SID_S1Lo = $00
-SID_S1Hi = $01
-SID_PB1Lo = $02
-SID_PB1Hi = $03
-SID_Ctl1 = $04
-SID_AD1 = $05
-SID_SUR1 = $06
-
-SID_S2Lo = $07
-SID_S2Hi = $08
-SID_PB2Lo = $09
-SID_PB2Hi = $0A
-SID_Ctl2 = $0B
-SID_AD2 = $0C
-SID_SUR2 = $0D
-
-SID_S3Lo = $0E
-SID_S3Hi = $0F
-SID_PB3Lo = $10
-SID_PB3Hi = $11
-SID_Ctl3 = $12
-SID_AD3 = $13
-SID_SUR3 = $14
-
-SID_FltLo = $15
-SID_FltHi = $16
-SID_FltCtl = $17
-SID_Amp = $18
-SID_ADConv1 = $19
-SID_ADConv2 = $1A
-SID_Noise = $1B
-SID_Read3 = $1C
-
-
-; I/O $db00: CIA 6526 Inter Process Communication
-; I/O $dc00: CIA 6526
-
-.struct CIA
- PRA .byte
- PRB .byte
- DDRA .byte
- DDRB .byte
- .union
- .struct
- TALO .byte
- TAHI .byte
- .endstruct
- TA .word
- .endunion
- .union
- .struct
- TBLO .byte
- TBHI .byte
- .endstruct
- TB .word
- .endunion
- TOD10 .byte
- TODSEC .byte
- TODMIN .byte
- TODHR .byte
- SDR .byte
- ICR .byte
- CRA .byte
- CRB .byte
-.endstruct
-
-
-; I/O $dd00: ACIA 6551
-
-.struct ACIA
- DATA .byte
- STATUS .byte
- CMD .byte
- CTRL .BYTE
-.endstruct
-
-
-; I/O $de00: Triport #1 6525
-; I/O $df00: Triport #2 6525
-
-.struct TPI
- PRA .byte
- PRB .byte
- .union
- PRC .byte
- INT .byte
- .endunion
- DDRA .byte
- DDRB .byte
- .union
- DDRC .byte
- IMR .byte
- .endunion
- CR .byte
- AIR .byte
-.endstruct
-
-
-; Out video memory address
-
-COLOR_RAM = $D400 ; System bank
-
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
+++ /dev/null
-;
-; Zeropage and I/O definitions for the CBM 610
-;
-; Taken from a kernal disassembly done by myself in 1987.
-;
-; Ullrich von Bassewitz, 28.09.1998
-
-
-; ---------------------------------------------------------------------------
-; Zeropage registers
-
-ExecReg = $00
-IndReg = $01
-
-; ---------------------------------------------------------------------------
-; Screen size
-
-XSIZE = 80
-YSIZE = 25
-
-; ---------------------------------------------------------------------------
-; I/O definitions
-
-
-; I/O $d800: CRTC 6545
-
-.struct CRTC
- ADDR .byte
- DATA .byte
-.endstruct
-
-; I/O $db00: CIA 6526 Inter Process Communication
-;
-; IPCcia = $db00
-
-.struct CIA
- PRA .byte
- PRB .byte
- DDRA .byte
- DDRB .byte
- .union
- .struct
- TALO .byte
- TAHI .byte
- .endstruct
- TA .word
- .endunion
- .union
- .struct
- TBLO .byte
- TBHI .byte
- .endstruct
- TB .word
- .endunion
- TOD10 .byte
- TODSEC .byte
- TODMIN .byte
- TODHR .byte
- SDR .byte
- ICR .byte
- CRA .byte
- CRB .byte
-.endstruct
-
-
-; I/O $dc00: CIA 6526
-;
-; cia = $dc00
-
-
-
-; I/O $dd00: ACIA 6551
-;
-; acia = $dd00
-
-.struct ACIA
- DATA .byte
- STATUS .byte
- CMD .byte
- CTRL .BYTE
-.endstruct
-
-
-; I/O $de00: Triport #1 6525
-;
-; tpi1 = $de00
-
-.struct TPI
- PRA .byte
- PRB .byte
- .union
- PRC .byte
- INT .byte
- .endunion
- DDRA .byte
- DDRB .byte
- .union
- DDRC .byte
- IMR .byte
- .endunion
- CR .byte
- AIR .byte
-.endstruct
-
-
-; I/O $df00: Triport #2 6525
-
-; tpi2 = $df00
-
-
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
+++ /dev/null
-;
-; NES definitions. By Groepaz/Hitmem.
-;
-
-
-;; FIXME: optimize zeropage usage
-
-SCREEN_PTR = $62 ;2
-CRAM_PTR = $64 ;2
-CHARCOLOR = $66
-BGCOLOR = $67
-RVS = $68
-CURS_X = $69
-CURS_Y = $6a
-
-tickcount = $6b ;2
-
-VBLANK_FLAG = $70
-
-ringbuff = $0200
-ringwrite = $71
-ringread = $72
-ringcount = $73
-
-ppuhi = $74
-ppulo = $75
-ppuval = $76
-
-screenrows = (30-1)
-charsperline = 32
-xsize = charsperline
-
-;; PPU defines
-
-PPU_CTRL1 = $2000
-PPU_CTRL2 = $2001
-PPU_STATUS = $2002
-PPU_SPR_ADDR = $2003
-PPU_SPR_IO = $2004
-PPU_VRAM_ADDR1 = $2005
-PPU_VRAM_ADDR2 = $2006
-PPU_VRAM_IO = $2007
-
-;; APU defines
-
-APU_PULSE1CTRL = $4000 ; Pulse #1 Control Register (W)
-APU_PULSE1RAMP = $4001 ; Pulse #1 Ramp Control Register (W)
-APU_PULSE1FTUNE = $4002 ; Pulse #1 Fine Tune (FT) Register (W)
-APU_PULSE1CTUNE = $4003 ; Pulse #1 Coarse Tune (CT) Register (W)
-APU_PULSE2CTRL = $4004 ; Pulse #2 Control Register (W)
-APU_PULSE2RAMP = $4005 ; Pulse #2 Ramp Control Register (W)
-APU_PULSE2FTUNE = $4006 ; Pulse #2 Fine Tune Register (W)
-APU_PULSE2STUNE = $4007 ; Pulse #2 Coarse Tune Register (W)
-APU_TRICTRL1 = $4008 ; Triangle Control Register #1 (W)
-APU_TRICTRL2 = $4009 ; Triangle Control Register #2 (?)
-APU_TRIFREQ1 = $400A ; Triangle Frequency Register #1 (W)
-APU_TRIFREQ2 = $400B ; Triangle Frequency Register #2 (W)
-APU_NOISECTRL = $400C ; Noise Control Register #1 (W)
-;;APU_ = $400D ; Unused (???)
-APU_NOISEFREQ1 = $400E ; Noise Frequency Register #1 (W)
-APU_NOISEFREQ2 = $400F ; Noise Frequency Register #2 (W)
-APU_MODCTRL = $4010 ; Delta Modulation Control Register (W)
-APU_MODDA = $4011 ; Delta Modulation D/A Register (W)
-APU_MODADDR = $4012 ; Delta Modulation Address Register (W)
-APU_MODLEN = $4013 ; Delta Modulation Data Length Register (W)
-APU_SPR_DMA = $4014 ; Sprite DMA Register (W)
-APU_CHANCTRL = $4015 ; Sound/Vertical Clock Signal Register (R)
-APU_PAD1 = $4016 ; Joypad #1 (RW)
-APU_PAD2 = $4017 ; Joypad #2/SOFTCLK (RW)
-
-
-CH_HLINE = 11
-CH_VLINE = 14
-CH_ULCORNER = 176
-CH_URCORNER = 174
-CH_LLCORNER = 173
-CH_LRCORNER = 189
-CH_TTEE = 178
-CH_RTEE = 179
-CH_BTEE = 177
-CH_LTEE = 171
-CH_CROSS = 123
-CH_CURS_UP = 145
-CH_CURS_DOWN = 17
-CH_CURS_LEFT = 157
-CH_CURS_RIGHT = 29
-CH_PI = 126
-CH_DEL = 20
-CH_INS = 148
-CH_ENTER = 10
-CH_STOP = 3
-CH_ESC = 27
-
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
.include "joy-kernel.inc"
.include "joy-error.inc"
- .include "../plus4/plus4.inc"
+ .include "plus4.inc"
.macpack generic
+++ /dev/null
-;
-; Plus/4 generic definitions.
-;
-
-
-; ---------------------------------------------------------------------------
-; Zero page, Commodore stuff
-
-TMPPTR := $22 ; Temporary ptr used by BASIC
-ST := $90 ; IEC status byte
-TIME := $A3 ; 60HZ clock
-FNAM_LEN := $AB ; Length of filename
-LFN := $AC ; Logical file number
-SECADR := $AD ; Secondary address
-DEVNUM := $AE ; Device number
-FNAM := $AF ; Pointer to filename for OPEN
-KEY_COUNT := $EF ; Number of keys in input buffer
-RVS := $C2 ; Reverse flag
-CURS_X := $CA ; Cursor column
-CURS_Y := $CD ; Cursor row
-SCREEN_PTR := $C8 ; Pointer to current char in text screen
-CRAM_PTR := $EA ; Pointer to current char in color RAM
-
-BASIC_BUF := $200 ; Location of command-line
-BASIC_BUF_LEN = 89 ; Maximum length of command-line
-
-FNBUF := $25E ; Buffer for filename
-FETCH := $494 ; lda (zp),y from RAM
-CHARCOLOR := $53B
-FKEY_COUNT := $55D ; Characters for function key
-FKEY_SPACE := $55F ; Function key definitions
-FKEY_ORIG := $F3D2 ; Original definitions
-
-; ---------------------------------------------------------------------------
-; Kernal routines
-
-; Direct entries
-CLRSCR := $D88B
-KBDREAD := $D8C1
-
-; ---------------------------------------------------------------------------
-; Vector and other locations
-
-IRQVec := $0314
-BRKVec := $0316
-NMIVec := $0318
-
-; ---------------------------------------------------------------------------
-; Screen size
-
-XSIZE = 40
-YSIZE = 25
-
-; ---------------------------------------------------------------------------
-; I/O
-
-TED_T1LO := $FF00
-TED_T1HI := $FF01
-TED_T2LO := $FF02
-TED_T2HI := $FF03
-TED_T3LO := $FF04
-TED_T4HI := $FF05
-TED_MULTI1 := $FF07
-TED_KBD := $FF08
-TED_CURSHI := $FF0C
-TED_CURSLO := $FF0D
-TED_V1FRQLO := $FF0E
-TED_V2FRQLO := $FF0F
-TED_V2FRQHI := $FF10
-TED_BGCOLOR := $FF15
-TED_COLOR1 := $FF16
-TED_COLOR2 := $FF17
-TED_COLOR3 := $FF18
-TED_BORDERCOLOR := $FF19
-TED_VLINEHI := $FF1C
-TED_VLINELO := $FF1D
-TED_HPOS := $FF1E
-TED_ROMSEL := $FF3E
-TED_RAMSEL := $FF3F
-
-; ---------------------------------------------------------------------------
-; RAM/ROM selection addresses
-
-ENABLE_ROM := TED_ROMSEL
-ENABLE_RAM := TED_RAMSEL
-
-
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS = -t $(SYS) -I../../asminc
+AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
+++ /dev/null
-; supervision symbols
-
-; supervision 65c02s
-; in cc65 up to 2.9.1 65c02 means 65c02s
-.pc02
-
-lcd_addr = $4000
-LCD_LINESIZE = $30
-LCD_WIDTH = 160
-LCD_HEIGHT = 160
-; 2 bit per pixel, packed
-
-lcd_width = $2000
-lcd_height = $2001
-lcd_xpos = $2002 ; in pixel, bit 0+1 not used
-lcd_ypos = $2003 ; weird
-
-sv_port_r = $2021
-sv_port_w = $2022
-
-sv_timer_count = $2023
-; read for quitting
-sv_timer_quit = $2024
-
-; bit 0 timer, bit 1 dma
-sv_irq_source = $2027
-SV_IRQ_REQUEST_TIMER = 1
-SV_IRQ_REQUEST_DMA = 2
-
-; bit 5,6,7 select bank at 0x8000
-sv_bank = $2026
-SV_NMI_ENABLE_ON = 1
-SV_IRQ_ENABLE_TIMER = 2
-SV_IRQ_ENABLE_DMA = 4
-SV_LCD_ON = 8
-SV_TIMER_MODE_240Hz = $10 ; else 15360
-
-
-; low activ/pressed
-sv_control = $2020
-SV_RIGHT = 1
-SV_LEFT = 2
-SV_DOWN = 4
-SV_UP = 8
-SV_BUTTONB = $10
-SV_BUTTONA = $20
-SV_SELECT = $40
-SV_START = $80
-
-; frequency=125000/counter
-sv_audio_right_counter = $2010 ;word
-sv_audio_left_counter = $2014
-SV_AUDIO_ON =$40
-;bits 0..3 volume
-; bit 4 ?
-; bit 5 ?
-sv_audio_right_control = $2012
-sv_audio_left_control = $2016
-; write activates tone for x/60 sec (0 means 256)
-sv_audio_right_timer = $2013
-sv_audio_left_timer = $2017
-
-
-;read for irq quitting
-sv_dma_quit = $2025
-sv_dma_on = $201c
-; bit 7 true start, false stop
-sv_dma_start = $2018 ; word
-sv_dma_size = $201a ; *32 samples
-sv_dma_control = $201b
-; bit 0,1 speed: 0 15360, 11 15360/4
-; bit 2,3 volume: 0 silent, 11 loud
-
-sv_noise_volume = $2028 ; and frequency
-sv_noise_timer = $2029
-sv_noise_control = $202a
CC = ../../src/cc65/cc65
LD = ../../src/ld65/ld65
-AFLAGS=-t $(SYS) -I../../asminc
+AFLAGS=-t $(SYS) --forget-inc-paths -I../../asminc
CFLAGS=-Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
+++ /dev/null
-;
-; Vic20 generic definitions. Stolen mostly from c64.inc - Steve Schmidtke
-;
-
-
-; ---------------------------------------------------------------------------
-; Zero page, Commodore stuff
-
-ST := $90 ; IEC status byte
-
-TIME := $A0 ; 60HZ clock
-FNAM_LEN := $B7 ; Length of filename
-SECADR := $B9 ; Secondary address
-DEVNUM := $BA ; Device number
-FNAM := $BB ; Pointer to filename
-KEY_COUNT := $C6 ; Number of keys in input buffer
-RVS := $C7 ; Reverse flag
-CURS_FLAG := $CC ; 1 = cursor off
-CURS_BLINK := $CD ; Blink counter
-CURS_CHAR := $CE ; Character under the cursor
-CURS_STATE := $CF ; Cursor blink state
-SCREEN_PTR := $D1 ; Pointer to current char in text screen
-CURS_X := $D3 ; Cursor column
-CURS_Y := $D6 ; Cursor row
-CRAM_PTR := $F3 ; Pointer to current char in color RAM
-
-BASIC_BUF := $200 ; Location of command-line
-BASIC_BUF_LEN = 89 ; Maximum length of command-line
-
-CHARCOLOR := $286
-CURS_COLOR := $287 ; Color under the cursor
-
-
-; ---------------------------------------------------------------------------
-; Screen size
-
-XSIZE = 22
-YSIZE = 23
-
-; ---------------------------------------------------------------------------
-; Kernal routines
-
-; Direct entries
-CLRSCR := $E55F
-KBDREAD := $E5CF
-
-; ---------------------------------------------------------------------------
-; Vector and other locations
-
-IRQVec := $0314
-BRKVec := $0316
-NMIVec := $0318
-
-; ---------------------------------------------------------------------------
-; I/O: 6560 VIC
-
-VIC := $9000
-VIC_LINES := $9003 ; Screen lines, bit 7 is bit 0 from VIC_HLINE
-VIC_HLINE := $9004 ; Rasterline, bits 1-8
-VIC_COLOR := $900F ; Border and background color
-
-; ---------------------------------------------------------------------------
-; I/O: 6522 VIA1
-
-VIA1 := $9110
-VIA1_JOY := $9111
-VIA1_DDRB := $9112
-VIA1_DDRA := $9113
-
-; ---------------------------------------------------------------------------
-; I/O: 6522 VIA2
-
-VIA2 := $9120
-VIA2_JOY := $9120
-VIA2_DDRB := $9122
-VIA2_DDRA := $9123
-