1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00
Pull to fix extra changes in PR #863
This commit is contained in:
Bas Wassink 2019-03-24 20:49:53 +01:00
commit 96d0b00a76
313 changed files with 10597 additions and 7389 deletions

View File

@ -45,20 +45,6 @@ KBDREPEAT := $028a
KBDREPEATRATE := $028b
KBDREPEATDELAY := $028c
; ---------------------------------------------------------------------------
; 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

View File

@ -37,14 +37,6 @@ KBDREPEAT := $28a
KBDREPEATRATE := $28b
KBDREPEATDELAY := $28c
; ---------------------------------------------------------------------------
; Kernal routines
; Direct entries
CLRSCR := $E544
KBDREAD := $E5B4
NMIEXIT := $FEBC
; ---------------------------------------------------------------------------
; Vector and other locations

View File

@ -1,9 +1,13 @@
; Convert characters to screen codes
; Helper macro that converts and outputs one character
; Macro that converts one character.
; scrbyte() can be used as an instruction operand
.define scrbyte(code) (<(.strat ("h@dbdlhh", code >> 5) << 4) ^ code)
; Helper macro that stores one character
.macro _scrcode char
.if (char < 256)
.byte <(.strat ("h@dbdlhh", char >> 5) << 4) ^ char
.byte scrbyte {char}
.else
.error "scrcode: Character constant out of range"
.endif
@ -38,13 +42,9 @@
; Anything else is an error
.else
.error "scrcode: invalid argument type"
.endif
; Call the macro recursively with the remaining args
scrcode arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
.endmacro

View File

@ -82,3 +82,28 @@ UDTIM := $FFEA
PLOT := $FFF0
IOBASE := $FFF3
.endif
; ---------------------------------------------------------------------------
; Kernal routines, direct entries
.if .def(__VIC20__)
CLRSCR := $E55F
KBDREAD := $E5CF
.elseif .def(__C64__)
CLRSCR := $E544
KBDREAD := $E5B4
NMIEXIT := $FEBC
.elseif .def(__C128__)
CLRSCR := $C142
KBDREAD := $C006
NMIEXIT := $FF33
NEWLINE := $C363
PRINT := $C322
CURS_SET := $CD57
CURS_ON := $CD6F
CURS_OFF := $CD9F
INDFET := $FF74
.elseif .def(__C16__)
CLRSCR := $D88B
KBDREAD := $D8C1
.endif

View File

@ -103,7 +103,7 @@
;------------------------------------------------------------------------------
; The mouse API version, stored in MOUSE_HDR::VERSION
MOUSE_API_VERSION = $05
MOUSE_API_VERSION = $06
;------------------------------------------------------------------------------
; Bitmapped mouse driver flags, stored in MOUSE_HDR::FLAGS.

View File

@ -37,13 +37,6 @@ KBDREPEAT := $540
KBDREPEATRATE := $541
KBDREPEATDELAY := $542
; ---------------------------------------------------------------------------
; Kernal routines
; Direct entries
CLRSCR := $D88B
KBDREAD := $D8C1
; ---------------------------------------------------------------------------
; Vector and other locations
@ -90,5 +83,3 @@ TED_RAMSEL := $FF3F
ENABLE_ROM := TED_ROMSEL
ENABLE_RAM := TED_RAMSEL

View File

@ -41,15 +41,15 @@
VERSION .byte 1 ; Interface version
LIBREF .addr ; Library reference
JUMPTAB .struct
INSTALL .addr ; INSTALL routine
UNINSTALL .addr ; UNINSTALL routine
OPEN .addr ; OPEN routine
CLOSE .addr ; CLOSE routine
GET .addr ; GET routine
PUT .addr ; PUT routine
STATUS .addr ; STATUS routine
IOCTL .addr ; IOCTL routine
IRQ .addr ; IRQ routine
SER_INSTALL .addr ; SER_INSTALL routine
SER_UNINSTALL .addr ; SER_UNINSTALL routine
SER_OPEN .addr ; SER_OPEN routine
SER_CLOSE .addr ; SER_CLOSE routine
SER_GET .addr ; SER_GET routine
SER_PUT .addr ; SER_PUT routine
SER_STATUS .addr ; SER_STATUS routine
SER_IOCTL .addr ; SER_IOCTL routine
SER_IRQ .addr ; SER_IRQ routine
.endstruct
.endstruct
@ -160,4 +160,3 @@ SER_STATUS_DSR = $40 ; NOT data set ready
.global _ser_ioctl
.global _ser_clear_ptr

View File

@ -63,7 +63,7 @@ _SMCDesignator: statement
ldy #opcode
sty _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_TransferOpcode'"
.error "Invalid usage of macro 'SMC_TransferOpcode'"
.endif
.endmacro
@ -75,7 +75,7 @@ _SMCDesignator: statement
.elseif .match ({register}, y)
ldy _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_LoadOpcode'"
.error "Invalid usage of macro 'SMC_LoadOpcode'"
.endif
.endmacro
@ -87,7 +87,7 @@ _SMCDesignator: statement
.elseif .match ({register}, y)
sty _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_StoreOpcode'"
.error "Invalid usage of macro 'SMC_StoreOpcode'"
.endif
.endmacro
@ -102,7 +102,7 @@ _SMCDesignator: statement
ldy #(<(destination - _SMCDesignator - 2))
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_ChangeBranch'"
.error "Invalid usage of macro 'SMC_ChangeBranch'"
.endif
.endmacro
@ -117,7 +117,7 @@ _SMCDesignator: statement
ldy value
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_TransferValue'"
.error "Invalid usage of macro 'SMC_TransferValue'"
.endif
.endmacro
@ -129,7 +129,7 @@ _SMCDesignator: statement
.elseif .match ({register}, y)
ldy _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_LoadValue'"
.error "Invalid usage of macro 'SMC_LoadValue'"
.endif
.endmacro
@ -141,7 +141,7 @@ _SMCDesignator: statement
.elseif .match ({register}, y)
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_StoreValue'"
.error "Invalid usage of macro 'SMC_StoreValue'"
.endif
.endmacro
@ -169,7 +169,7 @@ SMC_StoreValue label, register
ldy value
sty _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_TransferHighByte'"
.error "Invalid usage of macro 'SMC_TransferHighByte'"
.endif
.endmacro
@ -181,7 +181,7 @@ SMC_StoreValue label, register
.elseif .match ({register}, y)
ldy _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_LoadHighByte'"
.error "Invalid usage of macro 'SMC_LoadHighByte'"
.endif
.endmacro
@ -193,7 +193,7 @@ SMC_StoreValue label, register
.elseif .match ({register}, y)
sty _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_StoreHighByte'"
.error "Invalid usage of macro 'SMC_StoreHighByte'"
.endif
.endmacro
@ -241,7 +241,7 @@ SMC_StoreValue label, register
sty _SMCDesignator+2
.endif
.else
.error "Invalid usage of macro 'SMC_TransferAddressSingle'"
.error "Invalid usage of macro 'SMC_TransferAddressSingle'"
.endif
.endmacro

View File

@ -54,9 +54,18 @@ IRQSVY := $23 ; Used to save Y when a BRK call occurs
IRQSVP := $24 ; Used to save P when a BRK call occurs
ADSCR := $26
SCRNB := $28 ; Id of the current window
ADKBD := $2A ; Address ASCII conversion table
PTR_READ_DEST := $2C ; Used for XFREAD and XWRITE only in TELEMON 3.x
ADCLK := $40 ; Address for clock display
TIMEUS := $42
TIMEUD := $44
HRSX := $46
HRSY := $47
@ -64,6 +73,9 @@ XLPRBI := $48 ; Printer flag (b7)
HRSX40 := $49
HRSX6 := $4A
ADHRS := $4B ; Hires screen address (word)
HRS1 := $4D
HRS2 := $4F
HRS3 := $51
@ -72,6 +84,8 @@ HRS5 := $55
HRSFB := $57
VABKP1 := $58
; RS232T
; b0-b3 : speed
; 1111 => 19200 bps (please note that telestrat can't handle this speed without stopping all IRQ except ACIA's one)
@ -103,6 +117,18 @@ RS232T := $59
; : 11 SPACE SENT, reception not tested
RS232C := $5A
INDRS := $5B
ACC1E := $60
ACC1M := $61
ACC1S := $65
FLGMEN := $68
ADMEN := $69
FLSVS := $89
FLERR := $8B
VARLNG := $8C
VARAPL := $D0
@ -195,14 +221,20 @@ XDECAL = $18
XTEXT = $19
XHIRES = $1A
XEFFHI = $1B ; Clear hires screen
XFILLM = $1C
XMINMA = $1F
XVARS = $24 ; Only in TELEMON 3.x, in TELEMON 2.4, it's XNOMFI ($24)
XCRLF = $25 ; Jump a line and return to the beginning of the line
XDECAY = $26
XFREAD = $27 ; Only in TELEMON 3.x (bank 7 of Orix)
XBINDX = $28 ; Convert a number into hex and displays on channel 0
XDECIM = $29
XHEXA = $2A ; Convert a number into hex
XEDT = $2D ; Launch editor
XINSER = $2E
XSCELG = $2F ; Search a line in editor mode
XOPEN = $30 ; Only in TELEMON 3.x (bank 7 of Orix)
XECRPR = $33 ; Displays prompt
@ -212,7 +244,12 @@ XSCRSE = $36
XSCRNE = $39 ; Load charset from rom to ram
XCLOSE = $3A ; Only in TELEMON 3.x close file (bank 7 of Orix)
XFWRITE = $3B ; Only in TELEMON 3.x write file (bank 7 of Orix)
XWRCLK = $3E ; Update clock
; Clock primitive
XRECLK = $3C ; Reset clock
XCLCL = $3D ; Close clock
XWRCLK = $3E ; Displays clock in the adress in A & Y registers
XSONPS = $40 ; Send data to PSG register (14 values)
XOUPS = $42 ; Send Oups sound into PSG
XPLAY = $43 ; Play a sound
@ -222,7 +259,17 @@ XZAP = $46 ; Send Zap sound to PSG
XSHOOT = $47
XMKDIR = $4B ; Create a folder. Only available in TELEMON 3.x (bank 7 of Orix)
XRM = $4D ; Remove a folder or a file. Only available in TELEMON 3.x (bank 7 of Orix)
XGOKBD = $52
XGOKBD = $52
; Buffer management
XECRBU = $54 ; Write A or AY in the buffer
XLISBU = $55 ; Read A or AY in the buffer
XTSTBU = $56
XVIDBU = $57 ; Flush the buffer
XINIBU = $58 ; Initialize the buffer X
XDEFBU = $59 ; Reset all value of the buffer
XBUSY = $5A ; Test if the buffer is empty
XMALLOC = $5B ; Only in TELEMON 3.x (bank 7 of Orix)
XFREE = $62 ; Only in TELEMON 3.x (bank 7 of Orix)
XSOUT = $67 ; Send accumulator value (A) to RS232, available in TELEMON 2.4 & 3.x : if RS232 buffer is full, the Oric Telestrat freezes
@ -256,28 +303,83 @@ BUFTRV := $100
; Page $200
BNKST := $200 ; Used to store signature of 8 bank (length : 8 bytes)
TABDRV := $208
DRVDEF := $20C
FLGTEL := $20D
KOROM := $20E ; Used to compute the size of all rom bank. The result is store here. The value is in KB
KORAM := $20F ; Used to compute the size of all ram bank. The result is store here. The value is in KB
; Time management
TIMED := $210
TIMES := $211
TIMEM := $212
TIMEH := $213
FLGCLK := $214
FLGCLK_FLAG := $215
FLGCUR := $216 ; Cursor management flag
; screens position managements
FLGCUR_STATE := $217 ; Cursor state flag
ADSCRL := $218
ADSCRH := $21C
SCRX := $220
SCRY := $224
SCRDX := $228
SCRFX := $22C
SCRDY := $230
SCRFY := $234
SCRBAL := $238
SCRBAH := $23C
SCRCT := $240
SCRCF := $244
FLGSCR := $248
CURSCR := $24C
HARD_COPY_HIRES := $250 ; Hard copy vector
SCRTXT := $256
SCRHIR := $25C
SCRTRA := $262 ; 6 bytes lenfth
; Keyboard management
KBDCOL := $268 ; 8 bytes length
KBDFLG_KEY := $270 ; 0 if no key pressed
KBDVRR := $272
KBDVRL := $273
FLGKBD := $275
KBDFCT := $276
KBDSHT := $278
KBDKEY := $279
KBDCTC := $27E
LPRX := $286
LPRY := $287
LPRFX := $288
LPRFY := $289
FLGLPR := $28A
; Joysticks management
FLGJCK := $28C
JCGVAL := $28D
JCDVAL := $28E
JCKTAB := $29D
HRSPAT := $2AA ; Hires pattern : it's used to draw pattern for a line or a circle
ADIOB := $2BE
HRSERR := $2AB
IOTAB0 := $2AE
IOTAB1 := $2B2
IOTAB2 := $2B6
IOTAB3 := $2BA
ADIOB := $2BE ; 48 bytes length
FLGRST := $2EE
CSRND := $2EF
VNMI := $2F4
ADIODB_VECTOR := $2f7 ; 3 bytes length
IRQVECTOR := $2FA
VAPLIC := $2FD
@ -310,6 +412,9 @@ MAX_BUFEDT_LENGTH=110
CH376_DATA := $340
CH376_COMMAND := $341
; RAM overlays buffer
BUFBUF := $c080
; ---------------------------------------------------------------------------
; Stratsed vectors
; Stratsed is the main OS for Telestrat
@ -367,5 +472,5 @@ XRWTS := $FFAA
; MACRO
.macro BRK_TELEMON value
.byte $00,value
.byte $00,value
.endmacro

View File

@ -41,13 +41,6 @@ KBDREPEATDELAY := $28c
XSIZE = 22
YSIZE = 23
; ---------------------------------------------------------------------------
; Kernal routines
; Direct entries
CLRSCR := $E55F
KBDREAD := $E5CF
; ---------------------------------------------------------------------------
; Vector and other locations

24
cfg/atari-asm-xex.cfg Normal file
View File

@ -0,0 +1,24 @@
FEATURES {
STARTADDRESS: default = $2E00;
}
SYMBOLS {
__STARTADDRESS__: type = export, value = %S;
}
MEMORY {
ZP: file = "", define = yes, start = $0082, size = $007E;
MAIN: file = %O, define = yes, start = %S, size = $BC20 - %S;
}
FILES {
%O: format = atari;
}
FORMATS {
atari: runad = start;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes;
EXTZP: load = ZP, type = zp, optional = yes; # to enable modules to be able to link to C and assembler programs
CODE: load = MAIN, type = rw, define = yes;
RODATA: load = MAIN, type = ro optional = yes;
DATA: load = MAIN, type = rw optional = yes;
BSS: load = MAIN, type = bss, optional = yes, define = yes;
}

56
cfg/atari-xex.cfg Normal file
View File

@ -0,0 +1,56 @@
# Sample linker configuration for C programs using the Atari binary file support.
# Use with: cl65 -tatari -Catari-c-xex.cfg prog.c -o prog.xex
FEATURES {
STARTADDRESS: default = $2000;
}
SYMBOLS {
__SYSTEM_CHECK__: type = import; # force inclusion of "system check" load chunk
__STACKSIZE__: type = weak, value = $0800; # 2k stack
__STARTADDRESS__: type = export, value = %S;
__RESERVED_MEMORY__: type = weak, value = $0000;
__SYSCHKHDR__: type = export, value = 0; # Disable system check header
__SYSCHKTRL__: type = export, value = 0; # Disable system check trailer
}
MEMORY {
ZP: file = "", define = yes, start = $0082, size = $007E;
# "system check" load chunk
SYSCHKCHNK: file = %O, start = $2E00, size = $0300;
# "main program" load chunk
MAIN: file = %O, define = yes, start = %S, size = $BC20 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S;
}
FILES {
%O: format = atari;
}
FORMATS {
atari: runad = start,
initad = SYSCHKCHNK: __SYSTEM_CHECK__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp, optional = yes;
SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes;
STARTUP: load = MAIN, type = ro, define = yes;
LOWBSS: load = MAIN, type = rw, optional = yes; # not zero initialized
LOWCODE: load = MAIN, type = ro, define = yes, optional = yes;
ONCE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
}
FEATURES {
CONDES: type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__,
segment = ONCE;
CONDES: type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__,
segment = RODATA;
CONDES: type = interruptor,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__,
segment = RODATA,
import = __CALLIRQ__;
}

79
cfg/atarixl-xex.cfg Normal file
View File

@ -0,0 +1,79 @@
# Sample linker configuration for C programs using the Atari binary file support.
# Use with: cl65 -tatarixl -Catarixl-c-xex.cfg prog.c -o prog.xex
FEATURES {
STARTADDRESS: default = $2400;
}
SYMBOLS {
__SYSTEM_CHECK__: type = import; # force inclusion of "system check" load chunk
__STACKSIZE__: type = weak, value = $0800; # 2k stack
__STARTADDRESS__: type = export, value = %S;
__SYSCHKHDR__: type = export, value = 0; # Disable system check header
__SYSCHKTRL__: type = export, value = 0; # Disable system check trailer
}
MEMORY {
ZP: file = "", define = yes, start = $0082, size = $007E;
# "system check" load chunk
SYSCHKCHNK: file = %O, start = $2E00, size = $0300;
# "shadow RAM preparation" load chunk
SRPREPCHNK: file = %O, define = yes, start = %S, size = $7C20 - %S - $07FF; # $07FF: space for temp. chargen buffer, 1K aligned
# "main program" load chunk
MAIN: file = %O, define = yes, start = %S + __LOWBSS_SIZE__, size = $D000 - __STACKSIZE__ - %S - __LOWBSS_SIZE__;
# memory beneath the ROM preceeding the character generator
HIDDEN_RAM2: file = "", define = yes, start = $D800, size = $0800;
# address of relocated character generator (same addess as ROM version)
CHARGEN: file = "", define = yes, start = $E000, size = $0400;
# memory beneath the ROM
HIDDEN_RAM: file = "", define = yes, start = $E400, size = $FFFA - $E400;
# UNUSED - hide
UNUSED: file = "", start = $0, size = $10;
}
FILES {
%O: format = atari;
}
FORMATS {
atari: runad = start,
initad = SYSCHKCHNK: __SYSTEM_CHECK__,
initad = SRPREPCHNK: sramprep;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp, optional = yes;
SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes;
LOWBSS: load = SRPREPCHNK, type = bss, define = yes; # shared btw. SRPREPCHNK and RAM, not zero initialized
SRPREP: load = SRPREPCHNK, type = rw, define = yes;
SHADOW_RAM: load = SRPREPCHNK, run = HIDDEN_RAM, type = rw, define = yes, optional = yes;
SHADOW_RAM2: load = SRPREPCHNK, run = HIDDEN_RAM2, type = rw, define = yes, optional = yes;
STARTUP: load = MAIN, type = ro, define = yes;
LOWCODE: load = MAIN, type = ro, define = yes, optional = yes;
ONCE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro, define = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
SRPREPHDR: load = UNUSED, type = ro;
SRPREPTRL: load = UNUSED, type = ro;
}
FEATURES {
CONDES: type = constructor,
label = __CONSTRUCTOR_TABLE__,
count = __CONSTRUCTOR_COUNT__,
segment = ONCE;
CONDES: type = destructor,
label = __DESTRUCTOR_TABLE__,
count = __DESTRUCTOR_COUNT__,
segment = RODATA;
CONDES: type = interruptor,
label = __INTERRUPTOR_TABLE__,
count = __INTERRUPTOR_COUNT__,
segment = RODATA,
import = __CALLIRQ__;
}

View File

@ -1,15 +1,19 @@
FEATURES {
STARTADDRESS: default = $4000;
}
SYMBOLS {
__BACKBUFSIZE__: type = weak, value = $2000;
__HIMEM__: type = weak, value = $C000 - __BACKBUFSIZE__;
__OVERLAYSIZE__: type = weak, value = $0000;
__OVERLAYADDR__: type = weak, value = $C000 - __BACKBUFSIZE__ - __OVERLAYSIZE__;
__STACKSIZE__: type = weak, value = $0400;
__OVERLAYADDR__: type = weak, value = __HIMEM__ - __OVERLAYSIZE__;
__STACKSIZE__: type = weak, value = $0400; # 1k stack
__STACKADDR__: type = weak, value = $2000 - __STACKSIZE__;
}
MEMORY {
CVT: file = %O, start = $0, size = $20000;
ZP: define = yes, start = $80, size = $1A + $06;
EXT: define = yes, start = $0C00, size = __STACKADDR__ - $0C00;
VLIR0: define = yes, start = $4000, size = __OVERLAYADDR__ - $4000;
EXT: define = yes, start = $0C00, size = __STACKADDR__ - __EXT_START__;
VLIR0: define = yes, start = %S, size = __OVERLAYADDR__ - %S;
VLIR1: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR2: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR3: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;

View File

@ -1,14 +1,18 @@
FEATURES {
STARTADDRESS: default = $0400;
}
SYMBOLS {
__BACKBUFSIZE__: type = weak, value = $2000;
__HIMEM__: type = weak, value = $8000 - __BACKBUFSIZE__;
__OVERLAYSIZE__: type = weak, value = $0000;
__OVERLAYADDR__: type = weak, value = $8000 - __BACKBUFSIZE__ - __OVERLAYSIZE__;
__STACKSIZE__: type = weak, value = $0400;
__OVERLAYADDR__: type = weak, value = __HIMEM__ - __OVERLAYSIZE__;
__STACKSIZE__: type = weak, value = $0400; # 1k stack
__STACKADDR__: type = weak, value = __OVERLAYADDR__ - __STACKSIZE__;
}
MEMORY {
CVT: file = %O, start = $0, size = $40000;
ZP: define = yes, start = $58, size = $1A + $06;
VLIR0: define = yes, start = $0400, size = __STACKADDR__ - $0400;
VLIR0: define = yes, start = %S, size = __STACKADDR__ - %S;
VLIR1: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR2: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR3: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;

View File

@ -1,13 +1,17 @@
FEATURES {
STARTADDRESS: default = $1001;
}
SYMBOLS {
__LOADADDR__: type = import;
__EXEHDR__: type = import;
__STACKSIZE__: type = weak, value = $0800; # 2k stack
__HIMEM__: type = weak, value = $FD00;
}
MEMORY {
ZP: file = "", define = yes, start = $0002, size = $001A;
LOADADDR: file = %O, start = $0FFF, size = $0002;
HEADER: file = %O, start = $1001, size = $000C;
MAIN: file = %O, define = yes, start = $100D, size = $ECF3 - __STACKSIZE__;
ZP: file = "", define = yes, start = $0002, size = $001A;
LOADADDR: file = %O, start = %S - 2, size = $0002;
HEADER: file = %O, define = yes, start = %S, size = $000D;
MAIN: file = %O, define = yes, start = __HEADER_LAST__, size = __HIMEM__ - __MAIN_START__ - __STACKSIZE__;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
@ -15,8 +19,8 @@ SEGMENTS {
EXEHDR: load = HEADER, type = ro;
STARTUP: load = MAIN, type = ro;
LOWCODE: load = MAIN, type = ro, optional = yes;
ONCE: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = ro;
ONCE: load = MAIN, type = ro, optional = yes;
RODATA: load = MAIN, type = ro;
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = bss;

View File

@ -2,7 +2,7 @@ SYMBOLS {
__ORIXHDR__: type = import;
__STACKSIZE__: type = weak, value = $0800; # 2K stack
__GRAB__: type = weak, value = 0; # 0=don't grab graphics RAM, 1=grab graphics RAM
__RAMEND__: type = weak, value = $9800 + $1C00 * __GRAB__;
__RAMEND__: type = weak, value = $9800 + $1C00 * __GRAB__;
}
MEMORY {
ZP: file = "", define = yes, start = $00B0, size = $003A;

View File

@ -46,7 +46,7 @@ clean:
$(RM) -r ../html ../info
install:
$(if $(PREFIX),,$(error variable `PREFIX' must be set))
$(if $(PREFIX),,$(error variable "PREFIX" must be set))
ifeq ($(wildcard ../html),../html)
$(INSTALL) -d $(DESTDIR)$(htmldir)
$(INSTALL) -m0644 ../html/*.* $(DESTDIR)$(htmldir)

View File

@ -32,7 +32,7 @@ more information.
<sect>Binary format<p>
The standard binary file format generated by the linker for the
Apple&nbsp;&rsqb;&lsqb; target is an <url name="AppleSingle"
Apple&nbsp;&rsqb;&lsqb; target is an <url name="AppleSingle"
url="http://kaiser-edv.de/documents/AppleSingle_AppleDouble.pdf"> file.
The default load address is &dollar;803.
@ -492,7 +492,7 @@ files show up in a directory as <tt/&lt;NO DATE&gt;/.
There's no common interface to set realtime clocks so if a realtme clock <bf/IS/
present there's just nothing to do. However, if there's <bf/NO/ realtime clock present,
the user might very well be interest to "manually" set the RAM location in order to
the user might very well be interested to "manually" set the RAM location in order to
have timestamps. But he surely doesn't want to manually set the RAM location over and
over again. Rather he wants to set it just once after booting ProDOS 8.
@ -580,18 +580,18 @@ url="ca65.html" name="assembler manual">.
ProDOS associates a file type and an auxiliary type with each file.
These type specifications are separate from the file's name, unlike
Windows which uses the file name's suffix (a.k.a.
extension) to specify the file type. For example, <tt/.exe/,
extension) to specify the file type. For example, <tt/.exe/,
<tt/.doc/, or <tt/.bat/.
The ProDOS low-level
Machine-Language Interface (MLI) functions for creating and opening
The ProDOS low-level
Machine-Language Interface (MLI) functions for creating and opening
files require these types to be specified. And if they don't match
with the file being opened, the operation may fail.
In contrast, the ISO C function <tt/fopen()/ and the POSIX function
<tt/open()/ have no parameter to specify either a file type or an
auxiliary type. Therefore, some additional mechanism for specifying
the file types is needed.
the file types is needed.
<tag>Specifying the File Type and Auxiliary Type</tag>
There are two global variables provided that allow the file type
@ -603,7 +603,7 @@ url="ca65.html" name="assembler manual">.
extern unsigned char _filetype; /* Default: PRODOS_T_BIN */
extern unsigned int _auxtype; /* Default: 0 */
</verb>
</tscreen>
</tscreen>
The header file <tt/apple2_filetype.h/ also defines many values
that can be used to set these variables. It is included in
@ -614,26 +614,26 @@ url="ca65.html" name="assembler manual">.
<tag>Example</tag>
A text file cannot be created with just the
standard C functions because they default to the binary type
standard C functions because they default to the binary type
<tt/PRODOS_T_BIN/. The <tt/_filetype/ variable must be set to
<tt/PRODOS_T_TXT/ to create a text file.
For a text file,
<tt/PRODOS_T_TXT/ to create a text file.
For a text file,
<tt/_auxtype/ specifies the record length. A zero record
length text file is referred to as a sequential text file.
This is equivalent to text files on
This is equivalent to text files on
other operating systems, except that the line terminator is a
carriage return instead of a line-feed (Linux/BSD/MacOS) or
carriage return instead of a line-feed (Linux/BSD/MacOS) or
carriage return, line-feed pair (Windows).
The "sequential" text file terminology is in contrast to a
The "sequential" text file terminology is in contrast to a
"random-access" text file which would
have a fixed-length, non-zero record length, so that the
have a fixed-length, non-zero record length, so that the
file position of any individual record can be calculated.
For this example, the
<tt/_auxtype/ does not need to be set because it defaults to
the desired value, which is zero. To be more explicit,
the desired value, which is zero. To be more explicit,
<tt/_auxtype/ can also be set to <tt/PRODOS_AUX_T_TXT_SEQ/
which is defined as zero.
@ -670,7 +670,7 @@ url="ca65.html" name="assembler manual">.
}
}
</verb>
</tscreen>
</tscreen>
</descrip><p>
@ -686,14 +686,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -32,7 +32,7 @@ more information.
<sect>Binary format<p>
The standard binary file format generated by the linker for the
enhanced&nbsp;Apple&nbsp;//e target is an <url name="AppleSingle"
enhanced&nbsp;Apple&nbsp;//e target is an <url name="AppleSingle"
url="http://kaiser-edv.de/documents/AppleSingle_AppleDouble.pdf"> file.
The default load address is &dollar;803.
@ -493,7 +493,7 @@ files show up in a directory as <tt/&lt;NO DATE&gt;/.
There's no common interface to set realtime clocks so if a realtme clock <bf/IS/
present there's just nothing to do. However, if there's <bf/NO/ realtime clock present,
the user might very well be interest to "manually" set the RAM location in order to
the user might very well be interested to "manually" set the RAM location in order to
have timestamps. But he surely doesn't want to manually set the RAM location over and
over again. Rather he wants to set it just once after booting ProDOS 8.
@ -586,18 +586,18 @@ url="ca65.html" name="assembler manual">.
ProDOS associates a file type and an auxiliary type with each file.
These type specifications are separate from the file's name, unlike
Windows which uses the file name's suffix (a.k.a.
extension) to specify the file type. For example, <tt/.exe/,
extension) to specify the file type. For example, <tt/.exe/,
<tt/.doc/, or <tt/.bat/.
The ProDOS low-level
Machine-Language Interface (MLI) functions for creating and opening
The ProDOS low-level
Machine-Language Interface (MLI) functions for creating and opening
files require these types to be specified. And if they don't match
with the file being opened, the operation may fail.
In contrast, the ISO C function <tt/fopen()/ and the POSIX function
<tt/open()/ have no parameter to specify either a file type or an
auxiliary type. Therefore, some additional mechanism for specifying
the file types is needed.
the file types is needed.
<tag>Specifying the File Type and Auxiliary Type</tag>
There are two global variables provided that allow the file type
@ -609,7 +609,7 @@ url="ca65.html" name="assembler manual">.
extern unsigned char _filetype; /* Default: PRODOS_T_BIN */
extern unsigned int _auxtype; /* Default: 0 */
</verb>
</tscreen>
</tscreen>
The header file <tt/apple2_filetype.h/ also defines many values
that can be used to set these variables. It is included in
@ -620,26 +620,26 @@ url="ca65.html" name="assembler manual">.
<tag>Example</tag>
A text file cannot be created with just the
standard C functions because they default to the binary type
standard C functions because they default to the binary type
<tt/PRODOS_T_BIN/. The <tt/_filetype/ variable must be set to
<tt/PRODOS_T_TXT/ to create a text file.
For a text file,
<tt/PRODOS_T_TXT/ to create a text file.
For a text file,
<tt/_auxtype/ specifies the record length. A zero record
length text file is referred to as a sequential text file.
This is equivalent to text files on
This is equivalent to text files on
other operating systems, except that the line terminator is a
carriage return instead of a line-feed (Linux/BSD/MacOS) or
carriage return instead of a line-feed (Linux/BSD/MacOS) or
carriage return, line-feed pair (Windows).
The "sequential" text file terminology is in contrast to a
The "sequential" text file terminology is in contrast to a
"random-access" text file which would
have a fixed-length, non-zero record length, so that the
have a fixed-length, non-zero record length, so that the
file position of any individual record can be calculated.
For this example, the
<tt/_auxtype/ does not need to be set because it defaults to
the desired value, which is zero. To be more explicit,
the desired value, which is zero. To be more explicit,
<tt/_auxtype/ can also be set to <tt/PRODOS_AUX_T_TXT_SEQ/
which is defined as zero.
@ -676,7 +676,7 @@ url="ca65.html" name="assembler manual">.
}
}
</verb>
</tscreen>
</tscreen>
</descrip><p>
@ -692,14 +692,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -30,17 +30,17 @@ for the cc65 compiler. ar65 is part of this suite.
The archiver is called as follows:
<tscreen><verb>
Usage: ar65 <operation ...> lib file|module ...
Operations are some of:
r Add modules
d Delete modules
t List library table
v Increase verbosity (put before other operation)
x Extract modules
V Print the archiver version
Usage: ar65 <operation ...> lib file|module ...
Operations are some of:
r Add modules
d Delete modules
t List library table
v Increase verbosity (put before other operation)
x Extract modules
V Print the archiver version
</verb></tscreen>
You may add modules to a library using the `r' command (`a' is deprecated). If the library
You may add modules to a library using the <tt/'r'/ command ('a' is deprecated). If the library
does not exist, it is created (and a warning message is printed which you
may ignore if creation of the library was your intention). You may
specify any number of modules on the command line following the library.
@ -52,45 +52,45 @@ has a newer timestamp than the one to add.
Here's an example:
<tscreen><verb>
ar65 r mysubs.lib sub1.o sub2.o
ar65 r mysubs.lib sub1.o sub2.o
</verb></tscreen>
This will add two modules to the library `mysubs.lib' creating the
This will add two modules to the library 'mysubs.lib' creating the
library if necessary. If the library contains modules named sub1.o or
sub2.o, they are replaced by the new ones.
Modules names in the library are stored without the path, so, using
<tscreen><verb>
ar65 v v r mysubs.lib ofiles/sub1.o ofiles/sub2.o
ar65 v v r mysubs.lib ofiles/sub1.o ofiles/sub2.o
</verb></tscreen>
will verbose add two modules named `sub1.o' and `sub2.o' to the library.
will verbose add two modules named 'sub1.o' and 'sub2.o' to the library.
Deleting modules from a library is done with the `d' command. You may not
Deleting modules from a library is done with the <tt/'d'/ command. You may not
give a path when naming the modules.
Example:
<tscreen><verb>
ar65 d mysubs.lib sub1.o
ar65 d mysubs.lib sub1.o
</verb></tscreen>
This will delete the module named `sub1.o' from the library, printing an
This will delete the module named 'sub1.o' from the library, printing an
error if the library does not contain that module.
The `t' command prints a table of all modules in the library (`l' is deprecated).
The <tt/'t'/ command prints a table of all modules in the library ('l' is deprecated).
Any module names on the command line are ignored.
Example:
<tscreen><verb>
ar65 tv mysubs.lib
ar65 tv mysubs.lib
</verb></tscreen>
Using the `x' command, you may extract modules from the library. The
Using the <tt/'x'/ command, you may extract modules from the library. The
modules named on the command line are extracted from the library and put
into the current directory.
@ -103,11 +103,11 @@ this is not a problem.
Example for extracting a module from the library:
<tscreen><verb>
ar65 x mysubs.lib sub1.o
ar65 x mysubs.lib sub1.o
</verb></tscreen>
The `V' command prints the version number of the assembler. If you send
The <tt/'V'/ command prints the version number of the assembler. If you send
any suggestions or bugfixes, please include your version number.
In addition to these operations, the archiver will check for, and warn
@ -131,17 +131,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -203,6 +203,19 @@ is <it/left out/, keep this in mind.
The values you assign to the two symbols <tt/__AUTOSTART__/ and <tt/__EXEHDR__/
don't matter.
<sect2><tt/atari-asm-xex.cfg/<p>
This config file allows writing multi segment binaries easily, without having to
write the header explicitly on each segment.
It is similar to the <tt/atari-asm.cfg/ above, but uses the ATARI (xex) file
format support on LD65 instead of the standard binary output, so it does not
have the <tt/__AUTOSTART/ nor the <tt/__EXEHDR__/ symbols.
Note that each <tt/MEMORY/ area in the configuration file will have it's own
segment in the output file with the correct headers, and you can specify and
init address INITAD) for each memory area.
<sect2><tt/atari-cart.cfg/<p>
This config file can be used to create 8K or 16K cartridges. It's suited both
@ -230,6 +243,18 @@ would need to be split in more parts and the parts to be loaded manually.
To write the generated file to a cassette, a utility (<tt/w2cas.com/) to run
on an Atari is provided in the <tt/util/ directory of <tt/atari/ target dir.
<sect2><tt/atari-xex.cfg/<p>
This config file shows how to write a binary using the ATARI (xex) file format
support on LD65, this simplifies the memory areas and allows to add new memory
areas easily without writing new headers and trailers.
Note that the default C library includes the system-check chunk, so in this
linker configuration we suppress the importing of the header and trailer for
this chunk by defining the standard import symbols to a 0 value. For the
initialization address of the system-check chunk, the INITAD is set directly in
the configuration.
<sect1><tt/atarixl/ config files<p>
<sect2>default config file (<tt/atarixl.cfg/)<p>
@ -253,12 +278,40 @@ The files generated by this config file include the
<ref name="&dquot;system check&dquot;" id="syschkxl"> load chunk. It can
optionally be left out, see <ref name="Getting rid of the &dquot;system check&dquot; load chunk" id="nosyschk">.
<sect2><tt/atarixl-xex.cfg/<p>
Similar to the <tt/atari-xex.cfg/ above, this config file shows how to write a
binary using the ATARI (xex) file format support on LD65.
In addition to the suppressing of the system-check headers and trailers, this
also suppresses the shadow-ram-preparation headers and trailers, but does this
by defining an "UNUSED" memory area that is not written to the output file.
<sect>Platform specific header files<p>
Programs containing Atari specific code may use the <tt/atari.h/
header file.
This also includes access to operating system locations (e.g. hardware shadow registers) by a structure called
"<tt/OS/".
The names are the usual ones you can find in system reference manuals. Example:
<tscreen><verb>
...
OS.savmsc = ScreenMemory;
OS.color4 = 14; // white frame
if (OS.stick0 != 15 || OS.ch != 255) // key or stick input?
...
</verb></tscreen>
Please note that memory location 762/$2FA is called "<tt/char_/" while the orignal name "<tt/char/" conflicts with the C keyword.
If you like to use the OS names and locations for the original Atari 800 operating system, please "<tt/#define OSA/" before including the
<tt/atari.h/ header file.
If you like to target the floating point register model of revision 2 machines, put a "<tt/#define OS_REV2/" before including <tt/atari.h/.
Access to the Basic programming language zero page variables is established by the structure "<tt/BASIC/".
<sect1>Atari specific functions<p>
@ -323,7 +376,7 @@ cc65 supports constructing these display lists by offering defines
for the instructions. In conjunction with the "void"-variable extension
of cc65, display lists can be created quite comfortable:
<verb>
<tscreen><verb>
...
unsigned char ScreenMemory[100];
@ -339,12 +392,13 @@ void DisplayList =
DL_CHR20x8x2,
DL_BLK4,
DL_CHR20x8x2,
DL_JVB
DL_JVB,
&amp;DisplayList
};
...
POKEW(560,(unsigned int)&amp;DisplayList); // SDLSTL
OS.sdlst = &amp;DisplayList;
...
</verb>
</verb></tscreen>
Please inspect the <tt/_antic.h/ header file to detemine the supported
instruction names. Modifiers on instructions can be nested without need
@ -391,23 +445,23 @@ A final note: Since cc65 has currently some difficulties with string merging
under different mappings, defining remapped strings works only flawlessly
with static array initialization:
<verb>
<tscreen><verb>
#include &lt;atari_screen_charmap.h&gt;
char pcScreenMappingString[] = "Hello Atari!";
#include &lt;atari_atascii_charmap.h&gt;
char pcAtasciiMappingString[] = "Hello Atari!";
</verb>
</verb></tscreen>
delivers correct results, while
<verb>
<tscreen><verb>
#include &lt;atari_screen_charmap.h&gt;
char* pcScreenMappingString = "Hello Atari!";
#include &lt;atari_atascii_charmap.h&gt;
char* pcAtasciiMappingString = "Hello Atari!";
</verb>
</verb></tscreen>
does not.
@ -417,10 +471,10 @@ For direct keyboard scanning in conjunction with e.g. the OS location "CH" (764/
all keyboard codes are available as defined values on C and assembler side.
Example:
<verb>
<tscreen><verb>
...
while (!kbhit());
switch (PEEK(764))
switch (OS.ch)
{
case KEY_RETURN:
...
@ -430,7 +484,7 @@ Example:
...
}
...
</verb>
</verb></tscreen>
You can find the C defines in the file "<tt/atari.h/" or "<tt/atari.inc/" for the assembler variant.
@ -1082,7 +1136,7 @@ If you are using a customized linker config file you might get some errors
regarding the MAINHDR segment. Like this:
<tscreen><verb>
ld65: Error: Missing memory area assignment for segment `MAINHDR'
ld65: Error: Missing memory area assignment for segment 'MAINHDR'
</verb></tscreen>
The old "HEADER" memory description contained six bytes: &dollar;FFFF

View File

@ -109,14 +109,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -184,14 +184,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -279,14 +279,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -397,14 +397,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -259,14 +259,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -481,14 +481,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

File diff suppressed because it is too large Load Diff

View File

@ -244,7 +244,7 @@ The default drivers, <tt/mouse_stddrv (mouse_static_stddrv)/, point to <tt/cbm51
<sect1>Realtime clock<p>
The realtime clock functions use the CIA1 TOD clock. As that clock only stores
The realtime clock functions use the CIA2 TOD clock. As that clock only stores
the time but not the date, the date set by <tt/clock_settime()/ is simply stored
inside the C library for retrieval in the same program via <tt/clock_gettime()/.
@ -322,14 +322,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -304,14 +304,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -102,14 +102,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -44,7 +44,7 @@ Short options:
-o name Name the output file
-r Enable register variables
-t sys Set the target system
-u sym Force an import of symbol `sym'
-u sym Force an import of symbol 'sym'
-v Verbose mode
-vm Verbose map file
-C name Use linker config file
@ -90,7 +90,7 @@ Long options:
--debug Debug mode
--debug-info Add debug info
--feature name Set an emulation feature
--force-import sym Force an import of symbol `sym'
--force-import sym Force an import of symbol 'sym'
--help Help (this text)
--include-dir dir Set a compiler include directory path
--ld-args options Pass options to the linker
@ -236,14 +236,14 @@ package, it tries to be smart about several things.
<itemize>
<item> If you don't give a target system on the command line, cl65
defaults to the C64.
<item> If you don't give a target system on the command line, cl65
defaults to the C64.
<item> When linking, cl65 will supply the name of the library file for
the target system to the linker; so, you don't have to do that.
<item> If the final step is the linker, and the name of the output file was
not explicitly given, cl65 will use the name of the first input file
<item> If the final step is the linker, and the name of the output file was
not explicitly given, cl65 will use the name of the first input file
without the extension, provided that the name of that file has an
extension. So, you don't need to give the executable name in most
cases; just give the name of your "main" file as the first input file.
@ -284,24 +284,24 @@ assembler file (irq.s) will need the following separate steps to compile
into an executable named morse:
<tscreen><verb>
cc65 -g -Oi -t c64 morse.c
ca65 -g morse.s
ca65 -g irq.s
ld65 -o morse -t c64 c64.o morse.o irq.o c64.lib
cc65 -g -Oi -t c64 morse.c
ca65 -g morse.s
ca65 -g irq.s
ld65 -o morse -t c64 c64.o morse.o irq.o c64.lib
</verb></tscreen>
When using cl65, this is simplified to
<tscreen><verb>
cl65 -g -Oi morse.c irq.s
cl65 -g -Oi morse.c irq.s
</verb></tscreen>
As a general rule, you may use cl65 instead of cc65 at most times,
especially in makefiles to build object files directly from C files. Use
<tscreen><verb>
.c.o:
cl65 -g -Oi $<
.c.o:
cl65 -g -Oi $<
</verb></tscreen>
to do this.
@ -323,14 +323,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>

View File

@ -285,7 +285,7 @@ segment. Use the assembler to generate an object file from the assembler
output.
<tscreen><verb>
co65 --code-label _c64_hi c64-hi.tgi
co65 --code-label _c64_hi c64-hi.tgi
ca65 c64-hi.s
</verb></tscreen>
@ -293,7 +293,7 @@ Next, change your C code to declare a variable that is actually the address
of the driver:
<tscreen><verb>
extern void c64_hi[];
extern void c64_hi[];
</verb></tscreen>
Instead of loading and unloading the driver, change the code to install and
@ -329,14 +329,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -127,17 +127,17 @@ and predecrement operators if you don't need the resulting value. That means,
use
<tscreen><verb>
...
++i;
...
...
++i;
...
</verb></tscreen>
instead of
<tscreen><verb>
...
i++;
...
...
i++;
...
</verb></tscreen>
@ -148,24 +148,24 @@ The compiler produces optimized code, if the value of a pointer is a constant.
So, to access direct memory locations, use
<tscreen><verb>
#define VDC_STATUS 0xD601
*(char*)VDC_STATUS = 0x01;
#define VDC_STATUS 0xD601
*(char*)VDC_STATUS = 0x01;
</verb></tscreen>
That will be translated to
<tscreen><verb>
lda #$01
sta $D601
lda #$01
sta $D601
</verb></tscreen>
The constant value detection works also for struct pointers and arrays, if the
subscript is a constant. So
<tscreen><verb>
#define VDC ((unsigned char*)0xD600)
#define STATUS 0x01
VDC[STATUS] = 0x01;
#define VDC ((unsigned char*)0xD600)
#define STATUS 0x01
VDC[STATUS] = 0x01;
</verb></tscreen>
will also work.
@ -182,14 +182,14 @@ Initialization of local variables when declaring them gives shorter and faster
code. So, use
<tscreen><verb>
int i = 1;
int i = 1;
</verb></tscreen>
instead of
<tscreen><verb>
int i;
i = 1;
int i;
i = 1;
</verb></tscreen>
But beware: To maximize your savings, don't mix uninitialized and initialized
@ -201,18 +201,18 @@ variables, you force the compiler to allocate space for the uninitialized
variables each time, it parses an initialized one. So do this:
<tscreen><verb>
int i, j;
int a = 3;
int b = 0;
int i, j;
int a = 3;
int b = 0;
</verb></tscreen>
instead of
<tscreen><verb>
int i;
int a = 3;
int j;
int b = 0;
int i;
int a = 3;
int j;
int b = 0;
</verb></tscreen>
The latter will work, but will create larger and slower code.
@ -228,17 +228,17 @@ common cases.
Don't use
<tscreen><verb>
char* a;
char b, c;
char b = *(a + c);
char* a;
char b, c;
char b = *(a + c);
</verb></tscreen>
Use
<tscreen><verb>
char* a;
char b, c;
char b = a[c];
char* a;
char b, c;
char b = a[c];
</verb></tscreen>
instead.

View File

@ -168,14 +168,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -109,7 +109,7 @@ Load your program, then enter the monitor and use the "<tt/ll/" command to
load your label file like this:
<tscreen><verb>
ll "hello.lbl"
ll "hello.lbl"
</verb></tscreen>
You will get lots of warnings and even a few errors. You may ignore safely all
@ -120,7 +120,7 @@ After loading the labels, they are used by VICE in the disassembler listing,
and you may use them whereever you need to specify an address. Try
<tscreen><verb>
d ._main
d ._main
</verb></tscreen>
as an example (note that VICE needs a leading dot before all labels, and that
@ -134,14 +134,14 @@ Load your program, then enter the monitor and use the "<tt/sl/" command to
load your label file like this:
<tscreen><verb>
sl hello.sym
sl hello.sym
</verb></tscreen>
After loading the labels, they are used by Oricutron in the disassembler listing,
and you may use them whereever you need to specify an address. Try
<tscreen><verb>
d ._main
d ._main
</verb></tscreen>
as an example (note that VICE needs a leading dot before all labels, and that

View File

@ -3386,7 +3386,7 @@ used in presence of a prototype.
<descrip>
<tag/Function/Load and initialize an extended memory driver.
<tag/Header/<tt/<ref id="em.h" name="em.h">/
<tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
<tag/Declaration/<tt/unsigned char __fastcall__ em_load_driver (const char* name);/
<tag/Description/Load an extended memory driver into memory and initialize
it. The function returns an error code that tells if all this has been
successful.

View File

@ -138,14 +138,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -68,19 +68,19 @@ programs.
The software needed:
<itemize>
<item><em/cc65/ Excellent package containing a C crosscompiler, a crossassembler and a linker, you
can get it from: <url url="https://cc65.github.io/">.
can get it from: <url url="https://cc65.github.io/">.
<item><em/VICE/ This is a portable C64, C128 and few other Commodore computers emulator, you
can obtain it from: <url url="http://vice-emu.sourceforge.net/">.
The VICE package contains the <em/c1541/ program that is able
to convert/unconvert GEOS files to disk images.
can obtain it from: <url url="http://vice-emu.sourceforge.net/">.
The VICE package contains the <em/c1541/ program that is able
to convert/unconvert GEOS files to disk images.
<item><em/The Star Commander/ This tool is only for DOS. You will need it for transferring
object files from a PC to a 1541. There's also one important ability of this
tool - it automatically un-converts .cvt files into GEOS native format on
disk image files. Check out: <url url="http://sta.c64.org/sc.html">.
object files from a PC to a 1541. There's also one important ability of this
tool - it automatically un-converts .cvt files into GEOS native format on
disk image files. Check out: <url url="http://sta.c64.org/sc.html">.
<item><em/opencbm/ A package that allows for communication directly with a 1541 and
other Commodore IEC bus drives. It can be a replacement for Star Commander if
you only want to transfer files to a disk and unconvert using GEOS program for
this purpose. Check out: <url url="https://spiro.trikaliotis.net/opencbm">.
other Commodore IEC bus drives. It can be a replacement for Star Commander if
you only want to transfer files to a disk and unconvert using GEOS program for
this purpose. Check out: <url url="https://spiro.trikaliotis.net/opencbm">.
</itemize>
<p>
VICE and cc65 are portable - they run on variety of platforms - DOS, Win32 and UNIX. GEOSLib only
@ -188,6 +188,14 @@ are covered by new names, but I tried to keep them in the naming convention.
<p>
This section covers the drawing package of GEOS along with text output routines.
<sect2>SetNewMode
<p>
<tt/void SetNewMode (void)/
<p>
This function is intended for use by GEOS 128 only, and will exhibit undefined behavior on the
C64. It will toggle between the 40 column screen mode and the 80 column screen mode. Many C128 GEOS
programs implement a "Switch 40/80" submenu option under the <tt/geos/ menu.
<sect2>SetPattern
<p>
<tt/void SetPattern (char pattern)/
@ -379,7 +387,7 @@ and the number of rows to skip from the top if it.
<sect3>BitOtherClip
<p>
<tt/void BitOtherClip (void *proc1, void *proc2, char skipLeft, char skip Right, unsigned skipTop,
struct iconpic *myPic)/
struct iconpic *myPic)/
<p>
Similar to the previous one with some extension. <tt/proc1/ is called before reading a byte (it
returns in .A the next value), and <tt/proc2/ is called every time the parser reads a byte which is
@ -1382,9 +1390,9 @@ has the following fields:
<itemize>
<item><tt/char number/ - total number of icons declared here
<item><tt/struct pixel mousepos/ - after finishing <tt/DoIcons/ the mouse pointer will be placed in
this point allowing you to have a hint for the user what the default action is
this point allowing you to have a hint for the user what the default action is
<item><tt/struct icondef tab&lsqb;&rsqb/ - this table of size equal to <tt/icontab.number/ contains
descriptions for all icons
descriptions for all icons
</itemize>
<sect1>File and Disk
@ -1444,9 +1452,9 @@ void example = &lcub;
Which will be compiled to following string of bytes:
<tscreen><verb>
_example:
.byte 3
.word 3
.byte 0
.byte 3
.word 3
.byte 0
</verb></tscreen>
As you see this way it is possible to define data of any type in any order. You must remember to
cast each member to proper type.
@ -1466,21 +1474,21 @@ just in the content.
Here is how a single descriptor looks like:
<tscreen><verb>
void myMenu = &lcub;
(char)top, (char)bottom, // this is the size of the menubox
(unsigned)left, (unsigned)right, // counting all items in the current descriptor
(char)number_of_items | type_of_menu, // number of following items ORed with
// type of this menu, it can be either
// HORIZONTAL or VERTICAL if you will have also bit 6 set then menu won't be closed
// after moving mouse pointer outside the menubox. You can have at most 31 items.
(char)top, (char)bottom, // this is the size of the menubox
(unsigned)left, (unsigned)right, // counting all items in the current descriptor
(char)number_of_items | type_of_menu, // number of following items ORed with
// type of this menu, it can be either
// HORIZONTAL or VERTICAL if you will have also bit 6 set then menu won't be closed
// after moving mouse pointer outside the menubox. You can have at most 31 items.
</verb></tscreen>
This is followed by <tt/number_of_items/ of following item description.
<tscreen><verb>
...
"menuitemname", (char)item_type, (unsigned)pointer,
"nextitemname", (char)item_type, (unsigned)pointer,
...
"lastitemname", (char)item_type, (unsigned)pointer &rcub;;
// Note that there isn't ending <tt/NULL/ or something like that.
...
"menuitemname", (char)item_type, (unsigned)pointer,
"nextitemname", (char)item_type, (unsigned)pointer,
...
"lastitemname", (char)item_type, (unsigned)pointer &rcub;;
// Note that there isn't ending <tt/NULL/ or something like that.
</verb></tscreen>
<tt/pointer/ is a pointer to something, what it points for depends from <tt/item_type/. This one
can have following values:
@ -1513,16 +1521,16 @@ The first element can be specified in two ways - by using the default size and p
your own. The first case results in
<tscreen><verb>
const dlgBoxStr example = &lcub;
DB_DEFPOS (pattern_of_shadow),
... // commands
DB_END &rcub;;
DB_DEFPOS (pattern_of_shadow),
... // commands
DB_END &rcub;;
</verb></tscreen>
And the own size and position would be:
<tscreen><verb>
const dlgBoxStr example = &lcub;
DB_SETPOS (pattern, top, bottom, left, right)
... // commands
DB_END &rcub;;
DB_SETPOS (pattern, top, bottom, left, right)
... // commands
DB_END &rcub;;
</verb></tscreen>
<sect3>Commands
@ -1531,9 +1539,9 @@ The next element of the <tt/DoDlgBox/ command string are the commands themselves
default icons and the number of the selected icon will be returned from window processor. The icons are
<tt/OK, CANCEL, YES, NO, OPEN/, and <tt/DISK/. You can use predefined macros for using them, e.g.:
<tscreen><verb>
...
DB_ICON(OK, DBI_X_0, DBI_Y_0),
...
...
DB_ICON(OK, DBI_X_0, DBI_Y_0),
...
</verb></tscreen>
Note that the position is counted from top left corner of window, not entire screen and that the 'x'
position is counted in cards (8-pixel) and not in pixels. This is also true for all following commands.
@ -1547,13 +1555,13 @@ where the address of the text is stored. This is useful for information windows
is variable. Consider following:
<tscreen><verb>
char text = "foo";
...
r15=(unsigned)text; // in code just before call to DoDlgBox
...
DB_VARSTR (TXT_LN_X, TXT_LN_1_Y, &amp;r15),
...
...
r15=(unsigned)text; // in code just before call to DoDlgBox
...
DB_VARSTR (TXT_LN_X, TXT_LN_1_Y, &amp;r15),
...
</verb></tscreen>
will cause the word ``foo'' to appear in the window, but you may store the pointer to any text in
will cause the word ''foo'' to appear in the window, but you may store the pointer to any text in
<tt/r15/ (in this case) before the call to DoDlgBox.
<p>
<tt/DB_GETSTR(x, y, ptr, length)/ - will add a input-from-keyboard feature. <tt/ptr/ works as in the
@ -1588,10 +1596,10 @@ command has to be <tt/GSTR_END/. There is a custom type defined for the command
Here is an example for clearing the screen:
<tscreen><verb>
const graphicStr example = &lcub;
MOVEPENTO(0,0),
NEWPATTERN(0),
RECTANGLETO(319,199)
GSTR_END &rcub;;
MOVEPENTO(0,0),
NEWPATTERN(0),
RECTANGLETO(319,199)
GSTR_END &rcub;;
</verb></tscreen>
<sect2>InitRam table
@ -1615,17 +1623,17 @@ It is possible to intercept events and hook into the GEOS Kernal using vectors.
void_func oldVector;
void NewVectorHandler(void) &lcub;
// do something and at the end call the old vector routine
oldVector();
// do something and at the end call the old vector routine
oldVector();
&rcub;
void hook_into_system(void) &lcub;
oldVector = mouseVector;
mouseVector = NewVectorHandler;
oldVector = mouseVector;
mouseVector = NewVectorHandler;
&rcub;
void remove_hook(void) &lcub;
mouseVector = oldVector;
mouseVector = oldVector;
&rcub;
</verb></tscreen>
<p>
@ -1647,10 +1655,10 @@ That little example above intercepts <tt/mouseVector/. The <tt/NewVectorHandler/
called every time the mouse button changes status. Other important vectors you should know about
are:
<itemize>
<item><tt/appMain/ - this is called from within the <tt/MainLoop/ system loop
<item><tt/keyVector/ - called whenever a keypress occurs
<item><tt/intTopVector/ - called at the start of the IRQ routine
<item><tt/intBotVector/ - called at the end of the IRQ routine
<item><tt/appMain/ - this is called from within the <tt/MainLoop/ system loop
<item><tt/keyVector/ - called whenever a keypress occurs
<item><tt/intTopVector/ - called at the start of the IRQ routine
<item><tt/intBotVector/ - called at the end of the IRQ routine
</itemize>
</article>

View File

@ -381,11 +381,11 @@ HEADER APPLICATION "MyFirstApp" "Class Name" "V1.0"
; file named MyFirstApp with the Class-string "Class Name V1.0"
{
; Not all fields are required, default and current values will be used.
author "Maciej Witkowiak" ; always in quotes!
info "Information text" ; always in quotes!
; date yy mm dd hh ss ; always 5 fields!
; dostype seq ; can be: PRG, SEQ, USR (only all UPPER- or lower-case)
; structure seq ; can be: SEQ, VLIR (only UPPER- or lower-case)
mode c64only ; can be: any, 40only, 80only, c64only
author "Maciej Witkowiak" ; always in quotes!
info "Information text" ; always in quotes!
; date yy mm dd hh ss ; always 5 fields!
; dostype seq ; can be: PRG, SEQ, USR (only all UPPER- or lower-case)
; structure seq ; can be: SEQ, VLIR (only UPPER- or lower-case)
mode c64only ; can be: any, 40only, 80only, c64only
}</verb></tscreen>
</article>

View File

@ -24,21 +24,21 @@ It complements the features that are built into the ca65 macroassembler:
<itemize>
<item> Accept any number of segments to form an executable module.
<item> Accept any number of segments to form an executable module.
<item> Resolve arbitrary expressions stored in the object files.
<item> Resolve arbitrary expressions stored in the object files.
<item> In case of errors, use the meta information stored in the object files
to produce helpful error messages. In case of undefined symbols,
expression range errors, or symbol type mismatches, ld65 is able to
tell you the exact location in the original assembler source, where
the symbol was referenced.
<item> In case of errors, use the meta information stored in the object files
to produce helpful error messages. In case of undefined symbols,
expression range errors, or symbol type mismatches, ld65 is able to
tell you the exact location in the original assembler source, where
the symbol was referenced.
<item> Flexible output. The output of ld65 is highly configurable by a config
file. Some more-common platforms are supported by default configurations
that may be activated by naming the target system. The output
generation was designed with different output formats in mind, so
adding other formats shouldn't be a great problem.
<item> Flexible output. The output of ld65 is highly configurable by a config
file. Some more-common platforms are supported by default configurations
that may be activated by naming the target system. The output
generation was designed with different output formats in mind, so
adding other formats shouldn't be a great problem.
</itemize>
@ -66,7 +66,7 @@ Short options:
-m name Create a map file
-o name Name the default output file
-t sys Set the target system
-u sym Force an import of symbol `sym'
-u sym Force an import of symbol 'sym'
-v Verbose mode
-vm Verbose map file
@ -76,7 +76,7 @@ Long options:
--dbgfile name Generate debug information
--define sym=val Define a symbol
--end-group End a library group
--force-import sym Force an import of symbol `sym'
--force-import sym Force an import of symbol 'sym'
--help Help (this text)
--lib file Link this library
--lib-path path Specify a library search path
@ -487,7 +487,7 @@ There are of course more attributes for a memory section than just start and
size. Start and size are mandatory attributes, that means, each memory area
defined <em/must/ have these attributes given (the linker will check that). I
will cover other attributes later. As you may have noticed, I've used a
comment in the example above. Comments start with a hash mark (`#'), the
comment in the example above. Comments start with a hash mark ('#'), the
remainder of the line is ignored if this character is found.
@ -572,7 +572,7 @@ default behaviour is OK for our purposes, I did not use the attribute in the
example above. Let's have a look at it now.
The "file" attribute (the keyword may also be written as "FILE" if you like
that better) takes a string enclosed in double quotes (`&dquot;') that specifies the
that better) takes a string enclosed in double quotes ('&dquot;') that specifies the
file, where the data is written. You may specify the same file several times,
in that case the data for all memory areas having this file name is written
into this file, in the order of the memory areas defined in the <tt/MEMORY/
@ -894,7 +894,7 @@ look like this:
}
</verb></tscreen>
The only other available output format is the o65 format specified by Andre
There are two other available formats, one is the o65 format specified by Andre
Fachat (see the <url url="http://www.6502.org/users/andre/o65/fileformat.html"
name="6502 binary relocation format specification">). It is defined like this:
@ -904,7 +904,20 @@ name="6502 binary relocation format specification">). It is defined like this:
}
</verb></tscreen>
The necessary o65 attributes are defined in a special section labeled
The other format available is the Atari (xex) segmented file format, this is
the standard format used by Atari DOS 2.0 and upward file managers in the Atari
8-bit computers, and it is defined like this:
<tscreen><verb>
FILES {
%O: format = atari;
}
</verb></tscreen>
In the Atari segmented file format, the linker will write each <tt/MEMORY/ area
as a new segment, including a header with the start and end address.
The necessary o65 or Atari attributes are defined in a special section labeled
<ref id="FORMAT" name="FORMAT">.
@ -925,6 +938,30 @@ has several attributes that may be defined here.
}
</verb></tscreen>
The Atari file format has two attributes:
<descrip>
<tag><tt>RUNAD = symbol</tt></tag>
Specify a symbol as the run address of the binary, the loader will call this
address after all the file is loaded in memory. If the attribute is omitted,
no run address is included in the file.
<tag><tt>INITAD = memory_area : symbol</tt></tag>
Specify a symbol as the initialization address for the given memory area.
The binary loader will call this address just after the memory area is loaded
into memory, before continuing loading the rest of the file.
</descrip>
<tscreen><verb>
FORMATS {
atari: runad = _start;
}
</verb></tscreen>
<sect1>The FEATURES section<label id="FEATURES"><p>
@ -1126,14 +1163,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>

View File

@ -228,14 +228,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -337,14 +337,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -179,17 +179,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -200,15 +200,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -217,14 +217,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -242,14 +242,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -260,14 +260,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -27,19 +27,19 @@ binary needs to be compiled with <tt/--target sim6502/ or <tt/--target sim65c02/
The simulator is called as follows:
<tscreen><verb>
Usage: sim65 [options] file [arguments]
Short options:
-h Help (this text)
-c Print amount of executed CPU cycles
-v Increase verbosity
-V Print the simulator version number
-x <num> Exit simulator after <num> cycles
Usage: sim65 [options] file [arguments]
Short options:
-h Help (this text)
-c Print amount of executed CPU cycles
-v Increase verbosity
-V Print the simulator version number
-x <num> Exit simulator after <num> cycles
Long options:
--help Help (this text)
--cycles Print amount of executed CPU cycles
--verbose Increase verbosity
--version Print the simulator version number
Long options:
--help Help (this text)
--cycles Print amount of executed CPU cycles
--verbose Increase verbosity
--version Print the simulator version number
</verb></tscreen>
@ -89,7 +89,7 @@ Example output for the command
sim65 --verbose --verbose samples/gunzip65
</verb></tscreen>
<tscreen><verb>
Loaded `samples/gunzip65' at $0200-$151F
Loaded 'samples/gunzip65' at $0200-$151F
PVWrite ($0001, $13C9, $000F)
GZIP file name:PVWrite ($0001, $151F, $0001)
@ -120,14 +120,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -470,7 +470,7 @@ SMC instructions.
Example:
<tscreen><verb>
SMC_OperateOnValue ASL, LoadMask ; shift mask to left
SMC_OperateOnValue ASL, LoadMask ; shift mask to left
...
SMC LoadMask, { LDA #$20 }
</verb></tscreen>
@ -555,14 +555,14 @@ allowing reuse of some instructions.
5: SMC StoreAccuFirstSection, { sta SMC_AbsAdr, Y }
6: ...
7: RestoreCodeBranchBaseAdr:
8: SMC FirstIncHighByte, { SMC_OperateOnHighByte inc, StoreAccuFirstSection } ; code will be overwritten to 'beq RestoreCode' (*)
8: SMC FirstIncHighByte, { SMC_OperateOnHighByte inc, StoreAccuFirstSection } ; code will be overwritten to 'beq RestoreCode' (*)
9: ...
10: SMC_TransferOpcode FirstIncHighByte, OPC_BEQ , x ; change code marked above with (*)
11: SMC_TransferValue FirstIncHighByte, #(restoreCode - RestoreCodeBranchBaseAdr-2), x ; set relative address to 'RestoreCode'
10: SMC_TransferOpcode FirstIncHighByte, OPC_BEQ , x ; change code marked above with (*)
11: SMC_TransferValue FirstIncHighByte, #(restoreCode - RestoreCodeBranchBaseAdr-2), x ; set relative address to 'RestoreCode'
12: ...
13: restoreCode:
14: SMC_TransferOpcode FirstIncHighByte, OPC_INC_abs , x ; restore original code...
15: SMC_TransferValue FirstIncHighByte, #(<(StoreToFirstSection+2)), x ; (second byte of inc contained low-byte of address)
14: SMC_TransferOpcode FirstIncHighByte, OPC_INC_abs , x ; restore original code...
15: SMC_TransferValue FirstIncHighByte, #(<(StoreToFirstSection+2)), x ; (second byte of inc contained low-byte of address)
16: ...
</verb></tscreen>

View File

@ -403,14 +403,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>

View File

@ -148,14 +148,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -16,9 +16,9 @@ An overview over the Telestrat (Telemon 2.4 & Telemon 3.x : http://orix.oric.org
<sect>Overview<p>
This file contains an overview of the Telestrat runtime system as it comes with the
cc65 C compiler. It describes the memory layout, Telestrat-specific header files,
available drivers, and any pitfalls specific to that platform.
This file contains an overview of the Telestrat runtime system as it comes
with the cc65 C compiler. It describes the memory layout, Telestrat-specific
header files, available drivers, and any pitfalls specific to that platform.
Please note that Telestrat-specific functions are just mentioned here, they are
described in detail in the separate <url url="funcref.html" name="function
@ -26,17 +26,61 @@ reference">. Even functions marked as "platform dependent" may be available on
more than one platform. Please see the function reference for more
information.
Oric Telestrat is the last Oric computer (Released in 1986, mainly in France).
This computer is an Atmos with extra hardware: RS232, cardridge(banking system),
joysticks (2 ports) or mouse (on joystick port), FDC.
Video chip, CPU, keyboard management, tape hardware are the same than Atmos.
Telestrat can start in Atmos mode with Atmos Cardridge (which is only the atmos
Basic 1.1 ROM).
Telestrat can start in Sedoric (Atmos OS) and Atmos mode with Stratoric Cardridge.
This Cardridge has 3 banks of 16KB of rom with:
<itemize>
<item>a Sedoric ROM.
<item>a Basic 1.1 ROM (Atmos).
<item>a Basic 1.0 ROM (Oric-1).
</itemize>
The main Telestrat's configuration is the Telemon/Hyperbasic Cardridge inserted
with Stratsed in floppy drive.
Anyway, there is no way to load a tape file in Telemon/Hyperbasic mode without
alternative program.
There is also no software to write a Stratsed dsk file on PC.
This Telestrat target build an Orix binary file. But, in the future, it will be possible
to build a Stratsed disk. Orix uses the same systems calls than Telemon mode.
That is why if you need to do software for telestrat target, you have the choice to:
<itemize>
<item>use cc65 Atmos target and start Telestrat in Atmos mode: A tape file is required.
<item>use cc65 Atmos target and start Telestrat in Stratoric mode: A dsk file or tape file is required.
<item>use cc65 Telestrat target and start Telestrat in Orix mode (see <url
name="here" url="http://orix.oric.org/download/">).
<item>use cc65 Telestrat target, remove Orix header from binary, code a dsk tool for Stratsed,
add Stratsed header on your binary,insert your binary on floppy disk (this solution will be possible is the future).
</itemize>
Telestrat (from cardridge) can handle 8 banks (from $C000 to $FFFF): Bank 0 is the overlay ram. Others banks can be ROM or RAM.
<sect>Binary format<p>
The standard binary output format generated the linker for the Telestrat
target is a machine language program with a 20 bytes header described <url
name="here" url="http://orix.oric.org/doku.php?id=orix:header">
name="here" url="http://orix.oric.org/orix-header/">
This header is used for Telemon 3.0.
Anyway, for Telemon 2.4, there is no file management, there is no TAPE routine in Telemon, there is no way to load a binary easily.
Anyway, for Telemon 2.4, there is no file management, there is no TAPE routine
in Telemon, there is no way to load a binary easily.
Stratsed (the Telestrat operating system) handles files management. Stratsed is loaded to memory from floppy disk.
Stratsed (the Telestrat operating system) handles files management. Stratsed
is loaded to memory from floppy disk. Stratsed vector are declared in asminc/telestrat.inc.
But, reverse engineering is required to find how theses vectors works. Please, note that
Stratsed is located in overlay memory (bank 0)
There is no tool to insert a binary in a Stratsed floppy disk.
@ -44,7 +88,9 @@ The only way to load a binary (for Telemon 2.4) is to:
<itemize>
<item>remove the 20 bytes header
<item>download <url name="osdk" url="http://osdk.defence-force.org/index?page=download">
<item>use Floppybuilder in OSDK to insert the binary with the tool (please read FloppyBuilder manual to insert your binary, and to start microdisc boot sector when Telestrat starts)
<item>use Floppybuilder in OSDK to insert the binary with the tool (please read
FloppyBuilder manual to learn how to insert your binary and how to start Microdisc boot sector
when Telestrat starts)
</itemize>
Please note also, that the binary converted into TAP file, will not produce
@ -58,7 +104,7 @@ If you know the Stratsed disk format, please contact the author of this doc.
In the standard setup, cc65-generated programs use the memory from
&dollar;0801 to &dollar;9800; so, nearly 37K of memory (including the stack) is
available. ROM calls are possible without further precautions.
available. ROM calls are possible with BRK feature.
Special locations:
@ -107,6 +153,14 @@ structures; accessing the struct fields will access the chip registers.
Access to the VIA (Versatile Interface Adapter) chip is available via the
<tt/VIA/ variable. The structure behind this variable is explained in <tt/_6522.h/.
<tag><tt/VIA2/</tag>
Access to the VIA2 (Versatile Interface Adapter) chip is available via the
<tt/VIA2/ variable. The structure behind this variable is explained in <tt/_6522.h/.
<tag><tt/ACIA/</tag>
Access to the 6551 ACIA chip is available via the
<tt/ACIA/ variable. The structure behind this variable is explained in <tt/_6551.h/.
</descrip><p>
@ -114,14 +168,15 @@ structures; accessing the struct fields will access the chip registers.
<sect1>TGI<p>
TGI drivers is available on Oric Telestrat with some functions :
TGI drivers is available on Oric Telestrat with some functions:
<itemize>
<item>tgi_done
<item>tgi_install
<item>tgi_init
<item>tgi_clear
<item>tgi_done
<item>tgi_init
<item>tgi_install
<item>tgi_line
<item>tgi_outtext
<item>tgi_setpixel
</itemize>
@ -129,19 +184,26 @@ TGI drivers is available on Oric Telestrat with some functions :
<sect1>Extended memory drivers<p>
No extended memory drivers are currently available for the Telestrat.
This feature could be done because telestrat can manage RAM inserted in his
port cardridge.
<sect1>Joystick drivers<p>
telemon 2.4 & 3.0 manages joysticks but it had been handled yet.
Telemon 2.4 & 3.0 manages joysticks but it had been handled yet. This means that
joysticks driver could be written easily.
Telemon 2.4 returns in keyboard buffer the direction of the joysticks. This means that
if you get input from keyboard by conio cgetc function, you will get direction from joysticks.
<sect1>Mouse drivers<p>
Telestrat manages also mouse, but it had been no handled yet in this version.
Telestrat mouse is really difficult to find.
<sect1>RS232 device drivers<p>
Telestrat has a RS232 port, but it's not usable in cc65.
Telestrat has a RS232 port, but it's not usable in cc65. It is possible to use
RS232 port with Telemon calls (see XSOUT primitive for example)
<sect>Limitations<label id="limitations"><p>
@ -150,9 +212,7 @@ Telestrat has a RS232 port, but it's not usable in cc65.
Telemon 3.0 handles fopen, fread, fclose primitives. It means that this
function will crash the Telestrat because Telemon 2.4 does not have these
primitives. By the way, Telemon 3.0 uses an extension "ch376 card" which
handles sdcard and FAT 32 usb key. In the next version of Telemon, FT DOS,
Sedoric, Stratsed will be handled in these 3 primitives (fopen, fread,
fclose).
handles sdcard and FAT 32 usb key. In the next version of Telemon, FT DOS, Sedoric, Stratsed will be handled in these 3 primitives (fopen, fread, fclose).
<itemize>
<item>fclose
@ -176,14 +236,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -86,8 +86,8 @@ clean:
</verb></tscreen>
<bf/Important:/ When using the sample Makefile above via copy & paste it is
necessary to replace the eight spaces at the beginning of command lines (lines
26, 29 and 32) with a tab character (ASCII code 9).
important to make sure that command lines (lines 26, 29 and 32) start
with a tab character (ASCII code 9).
<sect1>Invoking the sample Makefile<p>
@ -119,7 +119,7 @@ The recommended way to use GNU Make on Windows is to install it as part of a
Cygwin environment. For more information see the Cygwin home page:
<url url="http://www.cygwin.com/">
If however installing Cygwin shouldn't be an option for one or the other reason
then the sample Makefile may be invoked from the Windows Command Prompt (cmd.exe)
by downloading the following programs:
@ -132,17 +132,17 @@ by downloading the following programs:
<sect>Target-specific Variable Values<p>
The very limited resources of the cc65 target machines now and then require
manual optimization of the build process by compiling individual source files
with different compiler options. GNU Make offers
<url url="http://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html" name="Target-specific Variable Values">
perfectly suited for doing so. For example placing the code of the two modules
perfectly suited for doing so. For example placing the code of the two modules
<tt/foo/ and <tt/bar/ in the segment <tt/FOOBAR/ can be achieved with this
target-specific variable definition:
<tscreen><verb>
foo.o bar.o: CFLAGS += --code-name FOOBAR
</verb></tscreen>
</article>

View File

@ -264,14 +264,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
<item> The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
<item> Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
<item> This notice may not be removed or altered from any source
distribution.
</enum>
</article>

View File

@ -55,6 +55,7 @@ typedef unsigned size_t;
#define CPU_65CE02 5
#define CPU_HUC6280 6
#define CPU_2A0x 7
#define CPU_45GS02 8
unsigned char getcpu (void);
/* Detect the CPU the program is running on */

View File

@ -5,9 +5,20 @@
/* Internal include file, do not use directly */
/* */
/* */
/* "ANTIC, Alphanumeric Television Interface Controller, is responsible for */
/* the generation of playfield graphics which is delivered as a datastream */
/* to the related CTIA/GTIA chip. The CTIA/GTIA provides the coloring of the */
/* playfield graphics, and is responsible for adding overlaid sprite */
/* (referred to as "Player/Missile graphics" by Atari). Atari advertised it */
/* as a true microprocessor, in that it has an instruction set to run */
/* programs (called display lists) to process data. ANTIC has no capacity */
/* for writing back computed values to memory, it merely reads data from */
/* memory and processes it for output to the screen, therefore it is not */
/* Turing complete." - Wikipedia article on "ANTIC" (with edits) */
/* */
/* (C) 2000 Freddy Offenga <taf_offenga@yahoo.com> */
/* 24-Jan-2011: Christian Krueger: Added defines for Antic instruction set */
/* 2019-01-16: Bill Kendrick <nbs@sonic.net>: More defines for registers */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -33,66 +44,211 @@
#ifndef __ANTIC_H
#define __ANTIC_H
/* Define a structure with the antic register offsets */
/*****************************************************************************/
/* Define a structure with the ANTIC coprocessor's register offsets */
/*****************************************************************************/
struct __antic {
unsigned char dmactl; /* direct memory access control */
unsigned char chactl; /* character mode control */
unsigned char dmactl; /* (W) direct memory access control */
unsigned char chactl; /* (W) character mode control */
unsigned char dlistl; /* display list pointer low-byte */
unsigned char dlisth; /* display list pointer high-byte */
unsigned char hscrol; /* horizontal scroll enable */
unsigned char vscrol; /* vertical scroll enable */
unsigned char hscrol; /* (W) horizontal scroll enable */
unsigned char vscrol; /* (W) vertical scroll enable */
unsigned char unuse0; /* unused */
unsigned char pmbase; /* msb of p/m base address */
unsigned char pmbase; /* (W) msb of p/m base address (for when DMACTL has player and/or missile DMA enabled) */
unsigned char unuse1; /* unused */
unsigned char chbase; /* character base address */
unsigned char wsync; /* wait for horizontal synchronization */
unsigned char vcount; /* vertical line counter */
unsigned char penh; /* light pen horizontal position */
unsigned char penv; /* light pen vertical position */
unsigned char nmien; /* non-maskable interrupt enable */
unsigned char nmires; /* nmi reset/status */
unsigned char chbase; /* (W) msb of character set base address */
unsigned char wsync; /* (W) wait for horizontal synchronization */
unsigned char vcount; /* (R) vertical line counter */
unsigned char penh; /* (R) light pen horizontal position */
unsigned char penv; /* (R) light pen vertical position */
unsigned char nmien; /* (W) non-maskable interrupt enable */
union {
/* (W) ("NMIRES") nmi reset -- clears the interrupt request register;
** resets all of the NMI status together
*/
unsigned char nmires;
/* (R) ("NMIST") nmi status -- holds cause for the NMI interrupt */
unsigned char nmist;
};
};
/* antic instruction set */
/*****************************************************************************/
/* DMACTL register options */
/*****************************************************************************/
/* absolute instructions (non mode lines) */
/* Initialized to 0x22: DMA fetch, normal playfield, no PMG DMA, double-line PMGs */
/* Playfield modes: */
#define DMACTL_PLAYFIELD_NONE 0x00
#define DMACTL_PLAYFIELD_NARROW 0x01 /* e.g., 32 bytes per scanline with thick borders */
#define DMACTL_PLAYFIELD_NORMAL 0x02 /* e.g., 40 bytes per scanline with normal borders */
#define DMACTL_PLAYFIELD_WIDE 0x03 /* e.g., 48 bytes per scanline with no borders (overscan) */
/* Other options: */
/* If not set, GTIA's GRAFP0 thru GRAFP3, and/or GRAFM registers are used for
** player & missile shapes, respectively. (Modify the registers during the horizontal blank
** (Display List Interrupt), a la "racing the beam" on an Atari VCS/2600, )
** if set, ANTIC's PMBASE will be used to fetch shapes from memory via DMA.
*/
#define DMACTL_DMA_MISSILES 0x04
#define DMACTL_DMA_PLAYERS 0x08
/* Unless set, PMGs (as fetched via DMA) will be double-scanline resolution */
#define DMACTL_PMG_SINGLELINE 0x10
/* Unless set, ANTIC operation is disabled, since it cannot fetch
** Display List instructions
*/
#define DMACTL_DMA_FETCH 0x20
/*****************************************************************************/
/* CHACTL register options */
/*****************************************************************************/
/* Initialized to 2 (CHACTL_CHAR_NORMAL | CHACTL_INV_PRESENT) */
/* Inverted (upside-down) characters */
#define CHACTL_CHAR_NORMAL 0x00
#define CHACTL_CHAR_INVERTED 0x04
/* Inverse (reverse-video) characters */
#define CHACTL_INV_TRANS 0x00 /* chars with high-bit shown */
#define CHACTL_INV_OPAQUE 0x01 /* chars with high-bit appear as space */
#define CHACTL_INV_PRESENT 0x02 /* chars with high-bit are reverse-video */
/*****************************************************************************/
/* Values for NMIEN (enabling interrupts) & NMIST (cause for the interrupt) */
/*****************************************************************************/
/* Display List Interrupts
** Called on a modeline when "DL_DLI" bit is set the ANTIC instruction,
** and jumps through VDSLST vector.
*/
#define NMIEN_DLI 0x80
/* Vertical Blank Interrupt
** Called during every vertical blank; see SYSVBV, VVBLKI, CRITIC, and VVBLKD,
** as well as the SETVBV routine.
*/
#define NMIEN_VBI 0x40
/* [Reset] key pressed */
#define NMIEN_RESET 0x20
/*****************************************************************************/
/* ANTIC instruction set */
/*****************************************************************************/
/* Absolute instructions (non mode lines) */
#define DL_JMP ((unsigned char) 1)
#define DL_JVB ((unsigned char) 65)
#define DL_BLK1 ((unsigned char) 0)
#define DL_BLK2 ((unsigned char) 16)
#define DL_BLK3 ((unsigned char) 32)
#define DL_BLK1 ((unsigned char) 0) /* 1 blank scanline */
#define DL_BLK2 ((unsigned char) 16) /* 2 blank scanlines */
#define DL_BLK3 ((unsigned char) 32) /* ...etc. */
#define DL_BLK4 ((unsigned char) 48)
#define DL_BLK5 ((unsigned char) 64)
#define DL_BLK6 ((unsigned char) 80)
#define DL_BLK7 ((unsigned char) 96)
#define DL_BLK8 ((unsigned char) 112)
/* absolute instructions (mode lines) */
#define DL_CHR40x8x1 ((unsigned char) 2) /* monochrome, 40 character & 8 scanlines per mode line (GR. 0) */
#define DL_CHR40x10x1 ((unsigned char) 3) /* monochrome, 40 character & 10 scanlines per mode line */
#define DL_CHR40x8x4 ((unsigned char) 4) /* colour, 40 character & 8 scanlines per mode line (GR. 12) */
#define DL_CHR40x16x4 ((unsigned char) 5) /* colour, 40 character & 16 scanlines per mode line (GR. 13) */
#define DL_CHR20x8x2 ((unsigned char) 6) /* colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1) */
#define DL_CHR20x16x2 ((unsigned char) 7) /* colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2) */
#define DL_MAP40x8x4 ((unsigned char) 8) /* colour, 40 pixel & 8 scanlines per mode line (GR. 3) */
#define DL_MAP80x4x2 ((unsigned char) 9) /* 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4) */
#define DL_MAP80x4x4 ((unsigned char) 10) /* colour, 80 pixel & 4 scanlines per mode line (GR.5) */
#define DL_MAP160x2x2 ((unsigned char) 11) /* 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6) */
#define DL_MAP160x1x2 ((unsigned char) 12) /* 'duochrome', 160 pixel & 1 scanline per mode line (GR.14) */
#define DL_MAP160x2x4 ((unsigned char) 13) /* 4 colours, 160 pixel & 2 scanlines per mode line (GR.7) */
#define DL_MAP160x1x4 ((unsigned char) 14) /* 4 colours, 160 pixel & 1 scanline per mode line (GR.15) */
#define DL_MAP320x1x1 ((unsigned char) 15) /* monochrome, 320 pixel & 1 scanline per mode line (GR.8) */
/* Absolute instructions (mode lines) */
/* modifiers on mode lines */
#define DL_HSCROL(x) ((unsigned char)((x) | 16))
#define DL_VSCROL(x) ((unsigned char)((x) | 32))
#define DL_LMS(x) ((unsigned char)((x) | 64))
/* Note: Actual width varies (e.g., 40 vs 32 vs 48) depending on
** normal vs narrow vs wide (overscan) playfield setting; see DMACTL
*/
/* Character modes (text, tile graphics, etc.) */
/* monochrome, 40 character & 8 scanlines per mode line (aka Atari BASIC GRAPHICS 0 via OS's CIO routines) */
#define DL_CHR40x8x1 ((unsigned char) 2)
/* monochrome, 40 character & 10 scanlines per mode line (like GR. 0, with descenders) */
#define DL_CHR40x10x1 ((unsigned char) 3)
/* colour, 40 character & 8 scanlines per mode line (GR. 12) */
#define DL_CHR40x8x4 ((unsigned char) 4)
/* colour, 40 character & 16 scanlines per mode line (GR. 13) */
#define DL_CHR40x16x4 ((unsigned char) 5)
/* colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1) */
#define DL_CHR20x8x2 ((unsigned char) 6)
/* colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2) */
#define DL_CHR20x16x2 ((unsigned char) 7)
/* Bitmap modes */
/* colour, 40 pixel & 8 scanlines per mode line (GR. 3) */
#define DL_MAP40x8x4 ((unsigned char) 8)
/* 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4) */
#define DL_MAP80x4x2 ((unsigned char) 9)
/* colour, 80 pixel & 4 scanlines per mode line (GR.5) */
#define DL_MAP80x4x4 ((unsigned char) 10)
/* 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6) */
#define DL_MAP160x2x2 ((unsigned char) 11)
/* 'duochrome', 160 pixel & 1 scanline per mode line (GR.14) */
#define DL_MAP160x1x2 ((unsigned char) 12)
/* 4 colours, 160 pixel & 2 scanlines per mode line (GR.7) */
#define DL_MAP160x2x4 ((unsigned char) 13)
/* 4 colours, 160 pixel & 1 scanline per mode line (GR.15) */
#define DL_MAP160x1x4 ((unsigned char) 14)
/* monochrome, 320 pixel & 1 scanline per mode line (GR.8) */
#define DL_MAP320x1x1 ((unsigned char) 15)
/* Equivalents, for people familiar with Atari 8-bit OS */
#define DL_GRAPHICS0 DL_CHR40x8x1
#define DL_GRAPHICS1 DL_CHR20x8x2
#define DL_GRAPHICS2 DL_CHR20x16x2
#define DL_GRAPHICS3 DL_MAP40x8x4
#define DL_GRAPHICS4 DL_MAP80x4x2
#define DL_GRAPHICS5 DL_MAP80x4x4
#define DL_GRAPHICS6 DL_MAP160x2x2
#define DL_GRAPHICS7 DL_MAP160x2x4
#define DL_GRAPHICS8 DL_MAP320x1x1
#define DL_GRAPHICS9 DL_MAP320x1x1 /* N.B.: GRAPHICS 9, 10, and 11 also involve GTIA's PRIOR register */
#define DL_GRAPHICS10 DL_MAP320x1x1
#define DL_GRAPHICS11 DL_MAP320x1x1
#define DL_GRAPHICS12 DL_CHR40x8x4 /* N.B.: Atari 400/800 OS didn't have GRAPHICS 12 or 13 */
#define DL_GRAPHICS13 DL_CHR40x16x4
#define DL_GRAPHICS14 DL_MAP160x1x2
#define DL_GRAPHICS15 DL_MAP160x1x4
/* Atari 400/800 OS didn't have GRAPHICS 14 or 15, so they were known by "6+" and "7+" */
#define DL_GRAPHICS6PLUS DL_GRAPHICS14
#define DL_GRAPHICS7PLUS DL_GRAPHICS15
/* Neither Atari 400/800 nor XL OS supported 10-scanline (descenders) text mode via CIO */
#define DL_GRAPHICS0_DESCENDERS DL_CHR40x10x1
/* Modifiers to mode lines */
#define DL_HSCROL(x) ((unsigned char)((x) | 16)) /* enable smooth horizontal scrolling on this line; see HSCROL */
#define DL_VSCROL(x) ((unsigned char)((x) | 32)) /* enable smooth vertical scrolling on this line; see VSCROL */
#define DL_LMS(x) ((unsigned char)((x) | 64)) /* Load Memory Scan (next two bytes must be the LSB/MSB of the data to load) */
/* General modifier */
#define DL_DLI(x) ((unsigned char)((x) | 128)) /* enable Display List Interrupt on this mode line */
/* general modifier */
#define DL_DLI(x) ((unsigned char)((x) | 128))
/* End of _antic.h */
#endif /* #ifndef __ANTIC_H */

660
include/_atarios.h Normal file
View File

@ -0,0 +1,660 @@
/*****************************************************************************/
/* */
/* _atarios.h */
/* */
/* Internal include file, do not use directly */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
/* arising from the use of this software. */
/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
/* freely, subject to the following restrictions: */
/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
/* appreciated but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice may not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
#ifndef __ATARIOS_H
#define __ATARIOS_H
/* IOCB Command Codes */
#define IOCB_OPEN 0x03 /* open */
#define IOCB_GETREC 0x05 /* get record */
#define IOCB_GETCHR 0x07 /* get character(s) */
#define IOCB_PUTREC 0x09 /* put record */
#define IOCB_PUTCHR 0x0B /* put character(s) */
#define IOCB_CLOSE 0x0C /* close */
#define IOCB_STATIS 0x0D /* status */
#define IOCB_SPECIL 0x0E /* special */
#define IOCB_DRAWLN 0x11 /* draw line */
#define IOCB_FILLIN 0x12 /* draw line with right fill */
#define IOCB_RENAME 0x20 /* rename disk file */
#define IOCB_DELETE 0x21 /* delete disk file */
#define IOCB_LOCKFL 0x23 /* lock file (set to read-only) */
#define IOCB_UNLOCK 0x24 /* unlock file */
#define IOCB_POINT 0x25 /* point sector */
#define IOCB_NOTE 0x26 /* note sector */
#define IOCB_GETFL 0x27 /* get file length */
#define IOCB_CHDIR_MYDOS 0x29 /* change directory (MyDOS) */
#define IOCB_MKDIR 0x2A /* make directory (MyDOS/SpartaDOS) */
#define IOCB_RMDIR 0x2B /* remove directory (SpartaDOS) */
#define IOCB_CHDIR_SPDOS 0x2C /* change directory (SpartaDOS) */
#define IOCB_GETCWD 0x30 /* get current directory (MyDOS/SpartaDOS) */
#define IOCB_FORMAT 0xFE /* format */
/* Device control block */
struct __dcb {
unsigned char ddevic; /* device id */
unsigned char dunit; /* unit number */
unsigned char dcomnd; /* command */
unsigned char dstats; /* command type / status return */
void *dbuf; /* pointer to buffer */
unsigned char dtimlo; /* device timeout in seconds */
unsigned char dunuse; /* - unused - */
unsigned int dbyt; /* # of bytes to transfer */
union {
struct {
unsigned char daux1; /* 1st command auxiliary byte */
unsigned char daux2; /* 2nd command auxiliary byte */
};
unsigned int daux; /* auxiliary as word */
};
};
typedef struct __dcb dcb_t;
/* I/O control block */
struct __iocb {
unsigned char handler; /* handler index number (0xff free) */
unsigned char drive; /* device number (drive) */
unsigned char command; /* command */
unsigned char status; /* status of last operation */
void* buffer; /* pointer to buffer */
void* put_byte; /* pointer to device's PUT BYTE routine */
unsigned int buflen; /* length of buffer */
unsigned char aux1; /* 1st auxiliary byte */
unsigned char aux2; /* 2nd auxiliary byte */
unsigned char aux3; /* 3rd auxiliary byte */
unsigned char aux4; /* 4th auxiliary byte */
unsigned char aux5; /* 5th auxiliary byte */
unsigned char spare; /* spare byte */
};
typedef struct __iocb iocb_t;
/* DOS 2.x zeropage variables */
struct __dos2x {
unsigned char* zbufp; /* points to user filename */
unsigned char* zdrva; /* points to serveral buffers (mostly VTOC) */
unsigned char* zsba; /* points to sector buffer */
unsigned char errno; /* number of occured error */
};
typedef struct __dos2x dos2x_t;
/* A single device handler formed by it's routines */
struct __devhdl {
void *open; /* address of OPEN routine -1 */
void *close; /* address of CLOSE routine -1 */
void *get; /* address of GET BYTE routine -1 */
void *put; /* address of PUT BYTE routine -1 */
void *status; /* address of GET STATUS routine -1 */
void *special; /* address od SPECIAL routine -1 */
void (*init)(void); /* init routine (JMP INIT) */
void *reserved; /* unused */
};
typedef struct __devhdl devhdl_t;
/* List of device handlers, as managed in HATABS */
struct __hatabs {
unsigned char id; /* ATASCII code of handler e.g. 'C','D','E','K','P','S','R' */
devhdl_t* devhdl; /* Pointer to routines of device */
};
typedef struct __hatabs hatabs_t;
/* Floating point register */
struct __fpreg {
#ifdef OS_REV2
unsigned char fr;
unsigned char frm[5]; /* 5-byte register mantissa */
#else
unsigned char fr[6]; /* 6 bytes for single register */
#endif
};
typedef struct __fpreg fpreg_t;
enum { /* enum for access of floating point registers */
FPIDX_R0 = 0, /* (to use as index) */
FPIDX_RE = 1,
FPIDX_R1 = 2,
FPIDX_R2 = 3
};
/* Define a structure with atari os register offsets */
struct __os {
// --- Zero-Page ---
#ifdef OSA
unsigned char* linzbs; // = $00/$01 LINBUG RAM (WILL BE REPLACED BY MONITOR RAM)
#else
unsigned char linflg; // = $00 LNBUG FLAG (0 = NOT LNBUG)
unsigned char ngflag; // = $01 MEMORY STATUS (0 = FAILURE)
#endif
unsigned char* casini; // = $02/$03 CASSETTE INIT LOCATION
unsigned char* ramlo; // = $04/$05 RAM POINTER FOR MEMORY TEST
#ifdef OSA
unsigned char tramsz; // = $06 FLAG FOR LEFT CARTRIDGE
unsigned char tstdat; // = $07 FLAG FOR RIGHT CARTRIDGE
#else
unsigned char trnsmz; // = $06 TEMPORARY REGISTER FOR RAM SIZE
unsigned char tstdat; // = $07 UNUSED (NOT TOUCHED DURING RESET/COLD START)
#endif
// Cleared upon Coldstart only
unsigned char warmst; // = $08 WARM START FLAG
unsigned char bootq; // = $09 SUCCESSFUL BOOT FLAG
void (*dosvec)(void); // = $0A/$0B DISK SOFTWARE START VECTOR
void (*dosini)(void); // = $0C/$0D DISK SOFTWARE INIT ADDRESS
unsigned char* appmhi; // = $0E/$0F APPLICATIONS MEMORY HI LIMIT
// Cleared upon Coldstart or Warmstart
unsigned char pokmsk; // = $10 SYSTEM MASK FOR POKEY IRQ ENABLE
unsigned char brkkey; // = $11 BREAK KEY FLAG
unsigned char rtclok[3]; // = $12-$14 REAL TIME CLOCK (IN 16 MSEC UNITS)
unsigned char* bufadr; // = $15/$16 INDIRECT BUFFER ADDRESS REGISTER
unsigned char iccomt; // = $17 COMMAND FOR VECTOR
unsigned char* dskfms; // = $18/$19 DISK FILE MANAGER POINTER
unsigned char* dskutl; // = $1A/$1B DISK UTILITIES POINTER
#ifdef OSA
unsigned char ptimot; // = $1C PRINTER TIME OUT REGISTER
unsigned char pbpnt; // = $1D PRINT BUFFER POINTER
unsigned char pbufsz; // = $1E PRINT BUFFER SIZE
unsigned char ptemp; // = $1F TEMPORARY REGISTER
#else
unsigned char abufpt[4]; // = $1C-$1F ACMI BUFFER POINTER AREA
#endif
iocb_t ziocb; // = $20-$2F ZERO PAGE I/O CONTROL BLOCK
unsigned char status; // = $30 INTERNAL STATUS STORAGE
unsigned char chksum; // = $31 CHECKSUM (SINGLE BYTE SUM WITH CARRY)
unsigned char* bufr; // = $32/$33 POINTER TO DATA BUFFER
unsigned char* bfen; // = $34/$35 NEXT BYTE PAST END OF THE DATA BUFFER LO
#ifdef OSA
unsigned char cretry; // = $36 NUMBER OF COMMAND FRAME RETRIES
unsigned char dretry; // = $37 NUMBER OF DEVICE RETRIES
#else
unsigned int ltemp; // = $36/$37 LOADER TEMPORARY
#endif
unsigned char bufrfl; // = $38 DATA BUFFER FULL FLAG
unsigned char recvdn; // = $39 RECEIVE DONE FLAG
unsigned char xmtdon; // = $3A TRANSMISSION DONE FLAG
unsigned char chksnt; // = $3B CHECKSUM SENT FLAG
unsigned char nocksm; // = $3C NO CHECKSUM FOLLOWS DATA FLAG
unsigned char bptr; // = $3D CASSETTE BUFFER POINTER
unsigned char ftype; // = $3E CASSETTE IRG TYPE
unsigned char feof; // = $3F CASSETTE EOF FLAG (0 // = QUIET)
unsigned char freq; // = $40 CASSETTE BEEP COUNTER
unsigned char soundr; // = $41 NOISY I/0 FLAG. (ZERO IS QUIET)
unsigned char critic; // = $42 DEFINES CRITICAL SECTION (CRITICAL IF NON-Z)
dos2x_t fmszpg; // = $43-$49 DISK FILE MANAGER SYSTEM ZERO PAGE
#ifdef OSA
unsigned char ckey; // = $4A FLAG SET WHEN GAME START PRESSED
unsigned char cassbt; // = $4B CASSETTE BOOT FLAG
#else
void* zchain; // = $4A/$4B HANDLER LINKAGE CHAIN POINTER
#endif
unsigned char dstat; // = $4C DISPLAY STATUS
unsigned char atract; // = $4D ATRACT FLAG
unsigned char drkmsk; // = $4E DARK ATRACT MASK
unsigned char colrsh; // = $4F ATRACT COLOR SHIFTER (EOR'ED WITH PLAYFIELD
unsigned char tmpchr; // = $50 TEMPORARY CHARACTER
unsigned char hold1; // = $51 TEMPORARY
unsigned char lmargn; // = $52 LEFT MARGIN (NORMALLY 2, CC65 C STARTUP CODE SETS IT TO 0)
unsigned char rmargn; // = $53 RIGHT MARGIN (NORMALLY 39 IF NO XEP80 IS USED)
unsigned char rowcrs; // = $54 1CURSOR ROW
unsigned int colcrs; // = $55/$56 CURSOR COLUMN
unsigned char dindex; // = $57 DISPLAY MODE
unsigned char* savmsc; // = $58/$59 SAVED MEMORY SCAN COUNTER
unsigned char oldrow; // = $5A PRIOR ROW
unsigned int oldcol; // = $5B/$5C PRIOR COLUMN
unsigned char oldchr; // = $5D DATA UNDER CURSOR
unsigned char* oldadr; // = $5E/$5F SAVED CURSOR MEMORY ADDRESS
#ifdef OSA
unsigned char newrow; // = $60 POINT DRAW GOES TO
unsigned int newcol; // = $61/$62 COLUMN DRAW GOES TO
#else
unsigned char* fkdef; // = $60/$61 FUNCTION KEY DEFINITION TABLE
unsigned char palnts; // = $62 PAL/NTSC INDICATOR (0 // = NTSC)
#endif
unsigned char logcol; // = $63 POINTS AT COLUMN IN LOGICAL LINE
unsigned char* adress; // = $64/$65 TEMPORARY ADDRESS
unsigned int mlttmp; // = $66/$67 TEMPORARY / FIRST BYTE IS USED IN OPEN AS TEMP
unsigned int savadr; // = $68/$69 SAVED ADDRESS
unsigned char ramtop; // = $6A RAM SIZE DEFINED BY POWER ON LOGIC
unsigned char bufcnt; // = $6B BUFFER COUNT
unsigned char* bufstr; // = $6C/$6D EDITOR GETCH POINTER
unsigned char bitmsk; // = $6E BIT MASK
unsigned char shfamt; // = $6F SHIFT AMOUNT FOR PIXEL JUSTIFUCATION
unsigned int rowac; // = $70/$71 DRAW WORKING ROW
unsigned int colac; // = $72/$73 DRAW WORKING COLUMN
unsigned char* endpt; // = $74/$75 END POINT
unsigned char deltar; // = $76 ROW DIFFERENCE
unsigned int deltac; // = $77/$78 COLUMN DIFFERENCE
#ifdef OSA
unsigned char rowinc; // = $79 ROWINC
unsigned char colinc; // = $7A COLINC
#else
unsigned char* keydef; // = $79/$7A 2-BYTE KEY DEFINITION TABLE ADDRESS
#endif
unsigned char swpflg; // = $7B NON-0 1F TXT AND REGULAR RAM IS SWAPPED
unsigned char holdch; // = $7C CH IS MOVED HERE IN KGETCH BEFORE CNTL & SH
unsigned char insdat; // = $7D 1-BYTE TEMPORARY
unsigned int countr; // = $7E/$7F 2-BYTE DRAW ITERATION COUNT
unsigned char _free_1[0xD4-0x7F-1]; // USER SPACE
// Floating Point Package Page Zero Address Equates
fpreg_t fpreg[4]; // = $D4-$EB 4 REGSITERS, ACCCESS LIKE "fpreg[FPIDX_R0].fr"
unsigned char frx; // = $EC 1-BYTE TEMPORARY
unsigned char eexp; // = $ED VALUE OF EXP
#ifdef OS_REV2
unsigned char frsign; // = $EE ##REV2## 1-BYTE FLOATING POINT SIGN
unsigned char plycnt; // = $EF ##REV2## 1-BYTE POLYNOMIAL DEGREE
unsigned char sgnflg; // = $F0 ##REV2## 1-BYTE SIGN FLAG
unsigned char xfmflg; // = $F1 ##REV2## 1-BYTE TRANSFORM FLAG
#else
unsigned char nsign; // = $EE SIGN OF #
unsigned char esign; // = $EF SIGN OF EXPONENT
unsigned char fchrflg; // = $F0 1ST CHAR FLAG
unsigned char digrt; // = $F1 # OF DIGITS RIGHT OF DECIMAL
#endif
unsigned char cix; // = $F2 CURRENT INPUT INDEX
unsigned char* inbuff; // = $F3/$F4 POINTS TO USER'S LINE INPUT BUFFER
unsigned int ztemp1; // = $F5/$F6 2-BYTE TEMPORARY
unsigned int ztemp4; // = $F7/$F8 2-BYTE TEMPORARY
unsigned int ztemp3; // = $F9/$FA 2-BYTE TEMPORARY
union {
unsigned char degflg; // = $FB ##OLD## SAME AS RADFLG
unsigned char radflg; // = $FB ##OLD## 0=RADIANS, 6=DEGREES
};
fpreg_t* flptr; // = $FC/$FD 2-BYTE FLOATING POINT NUMBER POINTER
fpreg_t* fptr2; // = $FE/$FF 2-BYTE FLOATING POINT NUMBER POINTER
// --- Page 1 ---
unsigned char stack[0x100]; // STACK
// --- Page 2 ---
void (*vdslst)(void); // = $0200/$0201 DISPLAY LIST NMI VECTOR
void (*vprced)(void); // = $0202/$0203 PROCEED LINE IRQ VECTOR
void (*vinter)(void); // = $0204/$0205 INTERRUPT LINE IRQ VECTOR
void (*vbreak)(void); // = $0206/$0207 SOFTWARE BREAK (00) INSTRUCTION IRQ VECTOR
void (*vkeybd)(void); // = $0208/$0209 POKEY KEYBOARD IRQ VECTOR
void (*vserin)(void); // = $020A/$020B POKEY SERIAL INPUT READY IRQ
void (*vseror)(void); // = $020C/$020D POKEY SERIAL OUTPUT READY IRQ
void (*vseroc)(void); // = $020E/$020F POKEY SERIAL OUTPUT COMPLETE IRQ
void (*vtimr1)(void); // = $0210/$0201 POKEY TIMER 1 IRQ
void (*vtimr2)(void); // = $0212/$0203 POKEY TIMER 2 IRQ
void (*vtimr4)(void); // = $0214/$0205 POKEY TIMER 4 IRQ
void (*vimirq)(void); // = $0216/$0207 IMMEDIATE IRQ VECTOR
unsigned int cdtmv1; // = $0218/$0210 COUNT DOWN TIMER 1
unsigned int cdtmv2; // = $021A/$021B COUNT DOWN TIMER 2
unsigned int cdtmv3; // = $021C/$021D COUNT DOWN TIMER 3
unsigned int cdtmv4; // = $021E/$021F COUNT DOWN TIMER 4
unsigned int cdtmv5; // = $0220/$0221 COUNT DOWN TIMER 5
void (*vvblki)(void); // = $0222/$0223 IMMEDIATE VERTICAL BLANK NMI VECTOR
void (*vvblkd)(void); // = $0224/$0224 DEFERRED VERTICAL BLANK NMI VECTOR
void (*cdtma1)(void); // = $0226/$0227 COUNT DOWN TIMER 1 JSR ADDRESS
void (*cdtma2)(void); // = $0228/$0229 COUNT DOWN TIMER 2 JSR ADDRESS
unsigned char cdtmf3; // = $022A COUNT DOWN TIMER 3 FLAG
unsigned char srtimr; // = $022B SOFTWARE REPEAT TIMER
unsigned char cdtmf4; // = $022C COUNT DOWN TIMER 4 FLAG
unsigned char intemp; // = $022D IAN'S TEMP
unsigned char cdtmf5; // = $022E COUNT DOWN TIMER FLAG 5
unsigned char sdmctl; // = $022F SAVE DMACTL REGISTER
union {
struct {
unsigned char sdlstl; // = $0230 SAVE DISPLAY LIST LOW BYTE
unsigned char sdlsth; // = $0231 SAVE DISPLAY LIST HI BYTE
};
void* sdlst; // = $0230/$0231 (same as above as pointer)
};
unsigned char sskctl; // = $0232 SKCTL REGISTER RAM
#ifdef OSA
unsigned char _spare_1; // = $0233 No OS use.
#else
unsigned char lcount; // = $0233 ##1200xl## 1-byte relocating loader record
#endif
unsigned char lpenh; // = $0234 LIGHT PEN HORIZONTAL VALUE
unsigned char lpenv; // = $0235 LIGHT PEN VERTICAL VALUE
void (*brkky)(void); // = $0236/$0237 BREAK KEY VECTOR
#ifdef OSA
unsigned char spare2[2]; // = $0238/$0239 No OS use.
#else
void (*vpirq)(void); // = $0238/$0239 ##rev2## 2-byte parallel device IRQ vector
#endif
unsigned char cdevic; // = $023A COMMAND FRAME BUFFER - DEVICE
unsigned char ccomnd; // = $023B COMMAND
union {
struct {
unsigned char caux1; // = $023C COMMAND AUX BYTE 1
unsigned char caux2; // = $023D COMMAND AUX BYTE 2
};
unsigned int caux; // = $023C/$023D (same as above as word)
};
unsigned char temp; // = $023E TEMPORARY RAM CELL
unsigned char errflg; // = $023F ERROR FLAG - ANY DEVICE ERROR EXCEPT TIME OUT
unsigned char dflags; // = $0240 DISK FLAGS FROM SECTOR ONE
unsigned char dbsect; // = $0241 NUMBER OF DISK BOOT SECTORS
unsigned char* bootad; // = $0242/$0243 ADDRESS WHERE DISK BOOT LOADER WILL BE PUT
unsigned char coldst; // = $0244 COLDSTART FLAG (1=IN MIDDLE OF COLDSTART>
#ifdef OSA
unsigned char spare3; // = $0245 No OS use.
#else
unsigned char reclen; // = $0245 ##1200xl## 1-byte relocating loader record length
#endif
unsigned char dsktim; // = $0246 DISK TIME OUT REGISTER
#ifdef OSA
unsigned char linbuf[40]; // = $0247-$026E ##old## CHAR LINE BUFFER
#else
unsigned char pdvmsk; // = $0247 ##rev2## 1-byte parallel device selection mask
unsigned char shpdvs; // = $0248 ##rev2## 1-byte PDVS (parallel device select)
unsigned char pdimsk; // = $0249 ##rev2## 1-byte parallel device IRQ selection
unsigned int reladr; // = $024A/$024B ##rev2## 2-byte relocating loader relative adr.
unsigned char pptmpa; // = $024C ##rev2## 1-byte parallel device handler temporary
unsigned char pptmpx; // = $024D ##rev2## 1-byte parallel device handler temporary
unsigned char _reserved_1[29]; // = $024E-$026A RESERVED
unsigned char chsalt; // = $026B ##1200xl## 1-byte character set alternate
unsigned char vsflag; // = $026C ##1200xl## 1-byte fine vertical scroll count
unsigned char keydis; // = $026D ##1200xl## 1-byte keyboard disable
unsigned char fine; // = $026E ##1200xl## 1-byte fine scrolling mode
#endif
unsigned char gprior; // = $026F GLOBAL PRIORITY CELL
unsigned char paddl0; // = $0270 1-BYTE POTENTIOMETER 0
unsigned char paddl1; // = $0271 1-BYTE POTENTIOMETER 1
unsigned char paddl2; // = $0272 1-BYTE POTENTIOMETER 2
unsigned char paddl3; // = $0273 1-BYTE POTENTIOMETER 3
unsigned char paddl4; // = $0274 1-BYTE POTENTIOMETER 4
unsigned char paddl5; // = $0275 1-BYTE POTENTIOMETER 5
unsigned char paddl6; // = $0276 1-BYTE POTENTIOMETER 6
unsigned char paddl7; // = $0277 1-BYTE POTENTIOMETER 7
unsigned char stick0; // = $0278 1-byte joystick 0
unsigned char stick1; // = $0279 1-byte joystick 1
unsigned char stick2; // = $027A 1-byte joystick 2
unsigned char stick3; // = $027B 1-byte joystick 3
unsigned char ptrig0; // = $027C 1-BYTE PADDLE TRIGGER 0
unsigned char ptrig1; // = $027D 1-BYTE PADDLE TRIGGER 1
unsigned char ptrig2; // = $027E 1-BYTE PADDLE TRIGGER 2
unsigned char ptrig3; // = $027F 1-BYTE PADDLE TRIGGER 3
unsigned char ptrig4; // = $0280 1-BYTE PADDLE TRIGGER 4
unsigned char ptrig5; // = $0281 1-BYTE PADDLE TRIGGER 5
unsigned char ptrig6; // = $0281 1-BYTE PADDLE TRIGGER 6
unsigned char ptrig7; // = $0283 1-BYTE PADDLE TRIGGER 7
unsigned char strig0; // = $0284 1-BYTE JOYSTICK TRIGGER 0
unsigned char strig1; // = $0285 1-BYTE JOYSTICK TRIGGER 1
unsigned char strig2; // = $0286 1-BYTE JOYSTICK TRIGGER 2
unsigned char strig3; // = $0287 1-BYTE JOYSTICK TRIGGER 3
#ifdef OSA
unsigned char cstat; // = $0288 ##old## cassette status register
#else
unsigned char hibyte; // = $0288 ##1200xl## 1-byte relocating loader high byte
#endif
unsigned char wmode; // = $0289 1-byte cassette WRITE mode
unsigned char blim; // = $028A 1-byte cassette buffer limit
#ifdef OSA
unsigned char _reserved_2[5]; // = $028B-$028F RESERVED
#else
unsigned char imask; // = $028B ##rev2## (not used)
void (*jveck)(void); // = $028C/$028D 2-byte jump vector
unsigned newadr; // = $028E/028F ##1200xl## 2-byte relocating address
#endif
unsigned char txtrow; // = $0290 TEXT ROWCRS
unsigned txtcol; // = $0291/$0292 TEXT COLCRS
unsigned char tindex; // = $0293 TEXT INDEX
unsigned char* txtmsc; // = $0294/$0295 FOOLS CONVRT INTO NEW MSC
unsigned char txtold[6]; // = $0296-$029B OLDROW & OLDCOL FOR TEXT (AND THEN SOME)
#ifdef OSA
unsigned char tmpx1; // = $029C ##old## 1--byte temporary register
#else
unsigned char cretry; // = $029C ##1200xl## 1-byte number of command frame retries
#endif
unsigned char hold3; // = $029D 1-byte temporary
unsigned char subtmp; // = $029E 1-byte temporary
unsigned char hold2; // = $029F 1-byte (not used)
unsigned char dmask; // = $02A0 1-byte display (pixel location) mask
unsigned char tmplbt; // = $02A1 1-byte (not used)
unsigned char escflg; // = $02A2 ESCAPE FLAG
unsigned char tabmap[15]; // = $02A3-$02B1 15-byte (120 bit) tab stop bit map
unsigned char logmap[4]; // = $02B2-$02B5 LOGICAL LINE START BIT MAP
unsigned char invflg; // = $02B6 INVERSE VIDEO FLAG (TOGGLED BY ATARI KEY)
unsigned char filflg; // = $02B7 RIGHT FILL FLAG FOR DRAW
unsigned char tmprow; // = $02B8 1-byte temporary row
unsigned tmpcol; // = $02B9/$02BA 2-byte temporary column
unsigned char scrflg; // = $02BB SET IF SCROLL OCCURS
unsigned char hold4; // = $02BC TEMP CELL USED IN DRAW ONLY
#ifdef OSA
unsigned char hold5; // = $02BD ##old## DITTO
#else
unsigned char dretry; // = $02BD ##1200xl## 1-byte number of device retries
#endif
unsigned char shflok; // = $02BE 1-byte shift/control lock flags
unsigned char botscr; // = $02BF BOTTOM OF SCREEN 24 NORM 4 SPLIT
unsigned char pcolr0; // = $02C0 1-byte player-missile 0 color/luminance
unsigned char pcolr1; // = $02C1 1-byte player-missile 1 color/luminance
unsigned char pcolr2; // = $02C2 1-byte player-missile 2 color/luminance
unsigned char pcolr3; // = $02C3 1-byte player-missile 3 color/luminance
unsigned char color0; // = $02C4 1-byte playfield 0 color/luminance
unsigned char color1; // = $02C5 1-byte playfield 1 color/luminance
unsigned char color2; // = $02C6 1-byte playfield 2 color/luminance
unsigned char color3; // = $02C7 1-byte playfield 3 color/luminance
unsigned char color4; // = $02C8 1-byte background color/luminance
#ifdef OSA
unsigned char _spare_2[23]; // = $02C9-$02DF No OS use.
#else
union {
unsigned char parmbl[6]; // = $02C9 ##rev2## 6-byte relocating loader parameter
struct {
void (*runadr)(void); // = $02C9 ##1200xl## 2-byte run address
unsigned int hiused; // = $02CB ##1200xl## 2-byte highest non-zero page address
unsigned int zhiuse; // = $02CD ##1200xl## 2-byte highest zero page address
};
};
union {
unsigned char oldpar[6]; // = $02CF ##rev2## 6-byte relocating loader parameter
struct {
void (*gbytea)(void); // = $02CF ##1200xl## 2-byte GET-BYTE routine address
unsigned int loadad; // = $02D1 ##1200xl## 2-byte non-zero page load address
unsigned int zloada; // = $02D3 ##1200xl## 2-byte zero page load address
};
};
unsigned int dsctln; // = $02D5 ##1200xl## 2-byte disk sector length
unsigned int acmisr; // = $02D7 ##1200xl## 2-byte ACMI interrupt service routine
unsigned char krpdel; // = $02D9 ##1200xl## 1-byte auto-repeat delay
unsigned char keyrep; // = $02DA ##1200xl## 1-byte auto-repeat rate
unsigned char noclik; // = $02DB ##1200xl## 1-byte key click disable
unsigned char helpfg; // = $02DC ##1200xl## 1-byte HELP key flag (0 = no HELP)
unsigned char dmasav; // = $02DD ##1200xl## 1-byte SDMCTL save/restore
unsigned char pbpnt; // = $02DE ##1200xl## 1-byte printer buffer pointer
unsigned char pbufsz; // = $02DF ##1200xl## 1-byte printer buffer size
#endif
union {
unsigned char glbabs[4]; // = $02E0-$02E3 byte global variables for non-DOS users
struct {
void (*runad)(void); // = $02E0 ##map## 2-byte binary file run address
void (*initad)(void); // = $02E2 ##map## 2-byte binary file initialization address
};
};
unsigned char ramsiz; // = $02E4 RAM SIZE (HI BYTE ONLY)
void* memtop; // = $02E5 TOP OF AVAILABLE USER MEMORY
void* memlo; // = $02E7 BOTTOM OF AVAILABLE USER MEMORY
#ifdef OSA
unsigned char _spare_3; // = $02E9 No OS use.
#else
unsigned char hndlod; // = $02E9 ##1200xl## 1-byte user load flag
#endif
unsigned char dvstat[4]; // = $02EA-$02ED STATUS BUFFER
union {
unsigned int cbaud; // = $02EE/$02EF 2-byte cassette baud rate
struct {
unsigned char cbaudl; // = $02EE 1-byte low cassette baud rate
unsigned char cbaudh; // = $02EF 1-byte high cassette baud rate
};
};
unsigned char crsinh; // = $02F0 CURSOR INHIBIT (00 = CURSOR ON)
unsigned char keydel; // = $02F1 KEY DELAY
unsigned char ch1; // = $02F2 1-byte prior keyboard character
unsigned char chact; // = $02F3 CHACTL REGISTER RAM
unsigned char chbas; // = $02F4 CHBAS REGISTER RAM
#ifdef OSA
unsigned char _spare_4[5]; // = $02F5-$02F9 No OS use.
#else
unsigned char newrow; // = $02F5 ##1200xl## 1-byte draw destination row
unsigned int newcol; // = $02F6/$02F7 ##1200xl## 2-byte draw destination column
unsigned char rowinc; // = $02F8 ##1200xl## 1-byte draw row increment
unsigned char colinc; // = $02F9 ##1200xl## 1-byte draw column increment
#endif
unsigned char char_; // = $02FA 1-byte internal character (naming changed due to do keyword conflict)
unsigned char atachr; // = $02FB ATASCII CHARACTER
unsigned char ch; // = $02FC GLOBAL VARIABLE FOR KEYBOARD
unsigned char fildat; // = $02FD RIGHT FILL DATA <DRAW>
unsigned char dspflg; // = $02FE DISPLAY FLAG DISPLAY CNTLS IF NON-ZERO
unsigned char ssflag; // = $02FF START/STOP FLAG FOR PAGING (CNTL 1). CLEARE
// --- Page 3 ---
dcb_t dcb; // = $0300-$030B DEVICE CONTROL BLOCK
unsigned int timer1; // = $030C/$030D INITIAL TIMER VALUE
#ifdef OSA
unsigned char addcor; // = $030E ##old## ADDITION CORRECTION
#else
unsigned char jmpers; // = $030E ##1200xl## 1-byte jumper options
#endif
unsigned char casflg; // = $030F CASSETTE MODE WHEN SET
unsigned int timer2; // = $0310/$0311 2-byte final baud rate timer value
unsigned char temp1; // = $0312 TEMPORARY STORAGE REGISTER
#ifdef OSA
unsigned char _spare_5; // = $0313 unused
unsigned char temp2; // = $0314 ##old## TEMPORARY STORAGE REGISTER
#else
unsigned char temp2; // = $0313 ##1200xl## 1-byte temporary
unsigned char ptimot; // = $0314 ##1200xl## 1-byte printer timeout
#endif
unsigned char temp3; // = $0315 TEMPORARY STORAGE REGISTER
unsigned char savio; // = $0316 SAVE SERIAL IN DATA PORT
unsigned char timflg; // = $0317 TIME OUT FLAG FOR BAUD RATE CORRECTION
unsigned char stackp; // = $0318 SIO STACK POINTER SAVE CELL
unsigned char tstat; // = $0319 TEMPORARY STATUS HOLDER
#ifdef OSA
hatabs_t hatabs[12]; // = $031A-$033D handler address table
unsigned int zeropad; // = $033E/$033F zero padding
#else
hatabs_t hatabs[11]; // = $031A-$033A handler address table
unsigned int zeropad; // = $033B/$033C zero padding
unsigned char pupbt1; // = $033D ##1200xl## 1-byte power-up validation byte 1
unsigned char pupbt2; // = $033E ##1200xl## 1-byte power-up validation byte 2
unsigned char pupbt3; // = $033F ##1200xl## 1-byte power-up validation byte 3
#endif
iocb_t iocb[8]; // = $0340-$03BF 8 I/O Control Blocks
unsigned char prnbuf[40]; // = $03C0-$3E7 PRINTER BUFFER
#ifdef OSA
unsigned char _spare_6[151]; // = $03E8-$047F unused
#else
unsigned char superf; // = $03E8 ##1200xl## 1-byte editor super function flag
unsigned char ckey; // = $03E9 ##1200xl## 1-byte cassette boot request flag
unsigned char cassbt; // = $03EA ##1200xl## 1-byte cassette boot flag
unsigned char cartck; // = $03EB ##1200xl## 1-byte cartridge equivalence check
unsigned char derrf; // = $03EC ##rev2## 1-byte screen OPEN error flag
unsigned char acmvar[11]; // = $03ED-$03F7 ##1200xl## reserved for ACMI, not cleared upon reset
unsigned char basicf; // = $03F8 ##rev2## 1-byte BASIC switch flag
unsigned char mintlk; // = $03F9 ##1200xl## 1-byte ACMI module interlock
unsigned char gintlk; // = $03FA ##1200xl## 1-byte cartridge interlock
void* chlink; // = $03FB/$03FC ##1200xl## 2-byte loaded handler chain link
unsigned char casbuf[131]; // = $03FD-$047F CASSETTE BUFFER
#endif
// --- Page 4 ---
unsigned char usarea[128]; // = $0480 128 bytes reserved for application
// --- Page 5 ---
unsigned char _spare_7[126]; // = $0500-$057D reserved for FP package / unused
unsigned char lbpr1; // = $057E LBUFF PREFIX 1
unsigned char lbpr2; // = $057F LBUFF PREFIX 2
unsigned char lbuff[128]; // = $0580-$05FF 128-byte line buffer
};
/* Define a structure with the zero page atari basic register offsets */
struct __basic {
void* lowmem; // = $80/$81 POINTER TO BASIC'S LOW MEMORY
void* vntp; // = $82/$83 BEGINNING ADDRESS OF THE VARIABLE NAME TABLE
void* vntd; // = $84/$85 POINTER TO THE ENDING ADDRESS OF THE VARIABLE NAME TABLE PLUS ONE
void* vvtp; // = $86/$87 ADDRESS FOR THE VARIABLE VALUE TABLE
void* stmtab; // = $88/$89 ADDRESS OF THE STATEMENT TABLE
void* stmcur; // = $8A/$8B CURRENT BASIC STATEMENT POINTER
void* starp; // = $8C/$8D ADDRESS FOR THE STRING AND ARRAY TABLE
void* runstk; // = $8E/$8F ADDRESS OF THE RUNTIME STACK
void* memtop; // = $90/$91 POINTER TO THE TOP OF BASIC MEMORY
unsigned char _internal_1[0xBA-0x91-1]; // INTERNAL DATA
unsigned int stopln; // = $BA/$BB LINE WHERE A PROGRAM WAS STOPPED
unsigned char _internal_2[0xC3-0xBB-1]; // INTERNAL DATA
unsigned char errsav; // = $C3 NUMBER OF THE ERROR CODE
unsigned char _internal_3[0xC9-0xC3-1]; // INTERNAL DATA
unsigned char ptabw; // = $C9 NUMBER OF COLUMNS BETWEEN TAB STOPS
unsigned char loadflg; // = $CA LIST PROTECTION
unsigned char _internal_4[0xD4-0xCA-1]; // INTERNAL DATA
unsigned int binint; // = $D4/$D5 USR-CALL RETURN VALUE
};
#endif

View File

@ -4,9 +4,16 @@
/* */
/* Internal include file, do not use directly */
/* */
/* "GTIA, Graphic Television Interface Adaptor, is a custom chip used in the */
/* Atari 8-bit family of computers and in the Atari 5200 console. In these */
/* systems, GTIA chip works together with ANTIC to produce video display. */
/* ANTIC generates the playfield graphics (text and bitmap) while GTIA */
/* provides the color for the playfield and adds overlay objects known as */
/* player/missile graphics (sprites)" - Wikipedia article on "GTIA" */
/* */
/* */
/* (C) 2000 Freddy Offenga <taf_offenga@yahoo.com> */
/* 2019-01-16: Bill Kendrick <nbs@sonic.net>: More defines for registers */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -32,26 +39,32 @@
#ifndef __GTIA_H
#define __GTIA_H
/* Define a structure with the gtia register offsets */
/*****************************************************************************/
/* Define a structure with the GTIA register offsets for write (W) */
/*****************************************************************************/
struct __gtia_write {
unsigned char hposp0; /* 0x00: horizontal position player 0 */
unsigned char hposp1; /* 0x01: horizontal position player 1 */
unsigned char hposp2; /* 0x02: horizontal position player 2 */
unsigned char hposp3; /* 0x03: horizontal position player 3 */
unsigned char hposm0; /* 0x04: horizontal position missile 0 */
unsigned char hposm1; /* 0x05: horizontal position missile 1 */
unsigned char hposm2; /* 0x06: horizontal position missile 2 */
unsigned char hposm3; /* 0x07: horizontal position missile 3 */
unsigned char hposp0; /* 0x00: horizontal position of player 0 */
unsigned char hposp1; /* 0x01: horizontal position of player 1 */
unsigned char hposp2; /* 0x02: horizontal position of player 2 */
unsigned char hposp3; /* 0x03: horizontal position of player 3 */
unsigned char hposm0; /* 0x04: horizontal position of missile 0 */
unsigned char hposm1; /* 0x05: horizontal position of missile 1 */
unsigned char hposm2; /* 0x06: horizontal position of missile 2 */
unsigned char hposm3; /* 0x07: horizontal position of missile 3 */
unsigned char sizep0; /* 0x08: size of player 0 */
unsigned char sizep1; /* 0x09: size of player 1 */
unsigned char sizep2; /* 0x0A: size of player 2 */
unsigned char sizep3; /* 0x0B: size of player 3 */
unsigned char sizem; /* 0x0C: size of missiles */
unsigned char grafp0; /* 0x0D: graphics shape player 0 */
unsigned char grafp0; /* 0x0D: graphics shape player 0 (used when ANTIC is not instructed to use DMA; see DMACTL) */
unsigned char grafp1; /* 0x0E: graphics shape player 1 */
unsigned char grafp2; /* 0x0F: graphics shape player 2 */
unsigned char grafp3; /* 0x10: graphics shape player 3 */
unsigned char grafm; /* 0x11: graphics shape missiles */
unsigned char colpm0; /* 0x12: color player and missile 0 */
unsigned char colpm1; /* 0x13: color player and missile 1 */
unsigned char colpm2; /* 0x14: color player and missile 2 */
@ -61,14 +74,177 @@ struct __gtia_write {
unsigned char colpf2; /* 0x18: color playfield 2 */
unsigned char colpf3; /* 0x19: color playfield 3 */
unsigned char colbk; /* 0x1A: color background */
unsigned char prior; /* 0x1B: priority selection */
unsigned char vdelay; /* 0x1C: vertical delay */
unsigned char vdelay;
/* 0x1C: vertical delay -- one-line resolution movement of
** vertical position of an object when two line resolution display is enabled
*/
unsigned char gractl; /* 0x1D: stick/paddle latch, p/m control */
unsigned char hitclr; /* 0x1E: clear p/m collision */
unsigned char consol; /* 0x1F: builtin speaker */
};
/* Define a structure with the gtia register offsets */
/*****************************************************************************/
/* (W) Values for SIZEP0-SIZEP3 and SIZEM registers: */
/*****************************************************************************/
#define PMG_SIZE_NORMAL 0x0 /* one color clock per pixel */
#define PMG_SIZE_DOUBLE 0x1 /* two color clocks per pixel */
#define PMG_SIZE_QUAD 0x2 /* four color clocks per pixel */
/* COLPM0-COLPM3, COLPF0-COLPF3, COLBK color registers */
/*****************************************************************************/
/* Color definitions */
/*****************************************************************************/
/* Make a GTIA color value */
#define _gtia_mkcolor(hue,lum) (((hue) << 4) | ((lum) << 1))
/* Luminance values go from 0 (black) to 7 (white) */
/* Hue values */
/* (These can vary depending on TV standard (NTSC vs PAL),
** tint potentiometer settings, TV tint settings, emulator palette, etc.)
*/
#define HUE_GREY 0
#define HUE_GOLD 1
#define HUE_GOLDORANGE 2
#define HUE_REDORANGE 3
#define HUE_ORANGE 4
#define HUE_MAGENTA 5
#define HUE_PURPLE 6
#define HUE_BLUE 7
#define HUE_BLUE2 8
#define HUE_CYAN 9
#define HUE_BLUEGREEN 10
#define HUE_BLUEGREEN2 11
#define HUE_GREEN 12
#define HUE_YELLOWGREEN 13
#define HUE_YELLOW 14
#define HUE_YELLOWRED 15
/* Color defines, similar to c64 colors (untested) */
/* Note that the conio color implementation is monochrome
** (bgcolor and textcolor are only placeholders)
*/
/* Use the defines with the setcolor() or _atari_xxxcolor() functions */
#define COLOR_BLACK _gtia_mkcolor(HUE_GREY,0)
#define COLOR_WHITE _gtia_mkcolor(HUE_GREY,7)
#define COLOR_RED _gtia_mkcolor(HUE_REDORANGE,1)
#define COLOR_CYAN _gtia_mkcolor(HUE_CYAN,3)
#define COLOR_VIOLET _gtia_mkcolor(HUE_PURPLE,4)
#define COLOR_GREEN _gtia_mkcolor(HUE_GREEN,2)
#define COLOR_BLUE _gtia_mkcolor(HUE_BLUE,2)
#define COLOR_YELLOW _gtia_mkcolor(HUE_YELLOW,7)
#define COLOR_ORANGE _gtia_mkcolor(HUE_ORANGE,5)
#define COLOR_BROWN _gtia_mkcolor(HUE_YELLOW,2)
#define COLOR_LIGHTRED _gtia_mkcolor(HUE_REDORANGE,6)
#define COLOR_GRAY1 _gtia_mkcolor(HUE_GREY,2)
#define COLOR_GRAY2 _gtia_mkcolor(HUE_GREY,3)
#define COLOR_LIGHTGREEN _gtia_mkcolor(HUE_GREEN,6)
#define COLOR_LIGHTBLUE _gtia_mkcolor(HUE_BLUE,6)
#define COLOR_GRAY3 _gtia_mkcolor(HUE_GREY,5)
/* TGI color defines */
#define TGI_COLOR_BLACK COLOR_BLACK
#define TGI_COLOR_WHITE COLOR_WHITE
#define TGI_COLOR_RED COLOR_RED
#define TGI_COLOR_CYAN COLOR_CYAN
#define TGI_COLOR_VIOLET COLOR_VIOLET
#define TGI_COLOR_GREEN COLOR_GREEN
#define TGI_COLOR_BLUE COLOR_BLUE
#define TGI_COLOR_YELLOW COLOR_YELLOW
#define TGI_COLOR_ORANGE COLOR_ORANGE
#define TGI_COLOR_BROWN COLOR_BROWN
#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
#define TGI_COLOR_GRAY1 COLOR_GRAY1
#define TGI_COLOR_GRAY2 COLOR_GRAY2
#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
#define TGI_COLOR_GRAY3 COLOR_GRAY3
/*****************************************************************************/
/* (W) PRIOR register values */
/*****************************************************************************/
#define PRIOR_P03_PF03 0x01 /* Players 0-3, then Playfields 0-3, then background */
#define PRIOR_P01_PF03_P23 0x02 /* Players 0-1, then Playfields 0-3, then Players 2-3, then background */
#define PRIOR_PF03_P03 0x04 /* Playfields 0-3, then Players 0-3, then background */
#define PRIOR_PF01_P03_PF23 0x08 /* Playfields 0-1, then Players 0-3, then Playfields 2-3, then background */
#define PRIOR_5TH_PLAYER 0x10 /* Four missiles combine to be a 5th player (uses COLPF3) */
/* Causes overlap of players 0 & 1 and of players 2 & 3 to result in a third color,
** the logical OR of the two players' colors, and other overlaps (e.g., players 0 and 2)
** to result in black (0x00).
*/
#define PRIOR_OVERLAP_3RD_COLOR 0x20
/*****************************************************************************/
/* (W) GTIA special graphics mode options for GPRIOR */
/*****************************************************************************/
/* Pixels are 2 color clocks wide, and one scanline tall
** (so 80x192 in normal playfield width).
** May be used with both bitmap and character modelines.
*/
/* 16 shade shades of the background (COLBK) hue;
** Note: brightnesses other than 0 (darkest) in COLBK cause additional effects
*/
#define PRIOR_GFX_MODE_9 0x40
/* 9 color palette mode;
** COLPM0 (acts as background) thru COLPM3, followed by COLPF0 thru COLPF3, and COLBK
*/
#define PRIOR_GFX_MODE_10 0x80
/* 16 hues of the background (COLBK) brightness;
** Note: hues other than 0 (greys) in COLBK caus additional effects
*/
#define PRIOR_GFX_MODE_11 0xC0
/*****************************************************************************/
/* (W) VDELAY register values */
/*****************************************************************************/
#define VDELAY_MISSILE0 0x01
#define VDELAY_MISSILE1 0x02
#define VDELAY_MISSILE2 0x04
#define VDELAY_MISSILE3 0x08
#define VDELAY_PLAYER0 0x10
#define VDELAY_PLAYER1 0x20
#define VDELAY_PLAYER2 0x40
#define VDELAY_PLAYER3 0x80
/*****************************************************************************/
/* (W) GRACTL register values */
/*****************************************************************************/
#define GRACTL_MISSLES 0x01 /* enable missiles */
#define GRACTL_PLAYERS 0x02 /* enable players */
/* "Latch" triggers; once pressed, will give a continuous
** pressed input until this bit is cleared
*/
#define GRACTL_LATCH_TRIGGER_INPUTS 0x04
/*****************************************************************************/
/* Define a structure with the GTIA register offsets for read (R) */
/*****************************************************************************/
struct __gtia_read {
unsigned char m0pf; /* 0x00: missile 0 to playfield collision */
unsigned char m1pf; /* 0x01: missile 1 to playfield collision */
@ -86,15 +262,41 @@ struct __gtia_read {
unsigned char p1pl; /* 0x0D: player 1 to player collision */
unsigned char p2pl; /* 0x0E: player 2 to player collision */
unsigned char p3pl; /* 0x0F: player 3 to player collision */
unsigned char trig0; /* 0x10: joystick trigger 0 */
unsigned char trig0; /* 0x10: joystick trigger 0 (0=pressed, 1=released) */
unsigned char trig1; /* 0x11: joystick trigger 1 */
unsigned char trig2; /* 0x12: joystick trigger 2 */
unsigned char trig3; /* 0x13: joystick trigger 3 */
unsigned char pal; /* 0x14: pal/ntsc flag */
unsigned char unused[10];
unsigned char consol; /* 0x1F: console buttons */
};
/*****************************************************************************/
/* (R) PAL register possible values */
/*****************************************************************************/
/* Note: This only tells you whether the GTIA is PAL or NTSC; some NTSC
** systems are modded with PAL ANTIC chips; testing VCOUNT limits can be
** done to check for that. Seems like it's not possible to test for SECAM
*/
#define TV_STD_PAL 0x1
#define TV_STD_NTSC 0xE
/*****************************************************************************/
/* Macros for reading console keys (Start/Select/Option) via CONSOL register */
/*****************************************************************************/
#define CONSOL_START(x) !((unsigned char)((x) & 1)) /* true if Start pressed */
#define CONSOL_SELECT(x) !((unsigned char)((x) & 2)) /* true if Select pressed */
#define CONSOL_OPTION(x) !((unsigned char)((x) & 4)) /* true if Option pressed */
/* End of _gtia.h */
#endif /* #ifndef __GTIA_H */

View File

@ -4,6 +4,10 @@
/* */
/* Internal include file, do not use directly */
/* */
/* The Peripheral Interface Adapter (PIA) chip (a 6520 or 6820) provides */
/* parallel I/O interfacing; it was used in Atari 400/800 and Commodore PET */
/* family of computers, for joystick and some interrupts. */
/* Sources; various + Wikpedia article on "Peripheral Interface Adapter". */
/* */
/* */
/* (C) 2000 Freddy Offenga <taf_offenga@yahoo.com> */
@ -34,7 +38,7 @@
#define __PIA_H
/* Define a structure with the pia register offsets */
/* Define a structure with the PIA register offsets */
struct __pia {
unsigned char porta; /* port A data r/w */
unsigned char portb; /* port B data r/w */
@ -42,10 +46,7 @@ struct __pia {
unsigned char pbctl; /* port B control */
};
/* (Some specific register values for Atari defined in atari.h) */
/* End of _pia.h */
#endif

View File

@ -4,9 +4,17 @@
/* */
/* Internal include file, do not use directly */
/* */
/* POKEY, Pot Keyboard Integrated Circuit, is a digital I/O chip designed */
/* for the Atari 8-bit family of home computers; it combines functions for */
/* sampling (ADC) potentiometers (such as game paddles) and scan matrices of */
/* switches (such as a computer keyboard) as well as sound generation. */
/* It produces four voices of distinctive square wave sound, either as clear */
/* tones or modified with a number of distortion settings. - Wikipedia */
/* "POKEY" article. */
/* */
/* */
/* (C) 2000 Freddy Offenga <taf_offenga@yahoo.com> */
/* 2019-01-16: Bill Kendrick <nbs@sonic.net>: More defines for registers */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -35,7 +43,10 @@
/* Define a structure with the pokey register offsets */
/*****************************************************************************/
/* Define a structure with the POKEY register offsets for write (W) */
/*****************************************************************************/
struct __pokey_write {
unsigned char audf1; /* audio channel #1 frequency */
unsigned char audc1; /* audio channel #1 control */
@ -47,13 +58,122 @@ struct __pokey_write {
unsigned char audc4; /* audio channel #4 control */
unsigned char audctl; /* audio control */
unsigned char stimer; /* start pokey timers */
unsigned char skrest; /* reset serial port status reg. */
unsigned char potgo; /* start paddle scan sequence */
unsigned char skrest;
/* reset serial port status reg.;
** Reset BITs 5 - 7 of the serial port status register (SKCTL) to "1"
*/
unsigned char potgo; /* start paddle scan sequence (see "ALLPOT") */
unsigned char unuse1; /* unused */
unsigned char serout; /* serial port data output */
unsigned char irqen; /* interrupt request enable */
unsigned char skctl; /* serial port control */
};
/*****************************************************************************/
/* (W) AUDC1-4 register values */
/*****************************************************************************/
/* Meaningful values for the distortion bits.
** The first process is to divide the clock value by the frequency,
** then mask the output using the polys in the order below;
** finally, the result is divided by two.
*/
#define AUDC_POLYS_5_17 0x00
#define AUDC_POLYS_5 0x20 /* Same as 0x60 */
#define AUDC_POLYS_5_4 0x40
#define AUDC_POLYS_17 0x80
#define AUDC_POLYS_NONE 0xA0 /* Same as 0xE0 */
#define AUDC_POLYS_4 0xC0
/* When set, the volume value in AUDC1-4 bits 0-3 is sent directly to the speaker;
** it is not modulated with the frequency specified in the AUDF1-4 registers.
** (See "De Re Atari" Chapter 7: Sound)
*/
#define AUDC_VOLUME_ONLY 0x10
/*****************************************************************************/
/* (W) AUDCTL register values */
/*****************************************************************************/
#define AUDCTL_CLOCKBASE_15HZ 0x01 /* Switch main clock base from 64 KHz to 15 KHz */
#define AUDCTL_HIGHPASS_CHAN2 0x02 /* Insert high pass filter into channel two, clocked by channel four */
#define AUDCTL_HIGHPASS_CHAN1 0x04 /* Insert high pass filter into channel one, clocked by channel two */
#define AUDCTL_JOIN_CHAN34 0x08 /* Join channels four and three (16 bit) */
#define AUDCTL_JOIN_CHAN12 0x10 /* Join channels two and one (16 bit) */
#define AUDCTL_CLOCK_CHAN3_179MHZ 0x20 /* Clock channel three with 1.79 MHz */
#define AUDCTL_CLOCK_CHAN1_179MHZ 0x40 /* Clock channel one with 1.79 MHz */
#define AUDCTL_9BIT_POLY 0x80 /* Makes the 17 bit poly counter into nine bit poly (see also: RANDOM) */
/*****************************************************************************/
/* (W) IRQEN register values */
/*****************************************************************************/
#define IRQEN_TIMER_1 0x01 /* The POKEY timer one interrupt is enabled */
#define IRQEN_TIMER_2 0x02 /* The POKEY timer two interrupt is enabled */
#define IRQEN_TIMER_4 0x04 /* The POKEY timer four interrupt is enabled */
#define IRQEN_SERIAL_TRANS_FINISHED 0x08 /* The serial out transmission finished interrupt is enabled */
#define IRQEN_SERIAL_OUT_DATA_REQUIRED 0x10 /* The serial output data required interrupt is enabled */
#define IRQEN_SERIAL_IN_DATA_READY 0x20 /* The serial input data ready interrupt is enabled. */
#define IRQEN_OTHER_KEY 0x40 /* The "other key" interrupt is enabled */
#define IRQEN_BREAK_KEY 0x80 /* The BREAK key is enabled */
/*****************************************************************************/
/* (W) SKCTL register values */
/*****************************************************************************/
#define SKCTL_KEYBOARD_DEBOUNCE 0x01 /* Enable keyboard debounce circuits */
#define SKCTL_KEYBOARD_SCANNING 0x02 /* Enable keyboard scanning circuit */
/* Fast pot scan
** The pot scan counter completes its sequence in two TV line times instead of
** one frame time (228 scan lines). Not as accurate as the normal pot scan
*/
#define SKCTL_FAST_POT_SCAN 0x04
/* POKEY two-tone mode
** Serial output is transmitted as a two-tone signal rather than a logic true/false.
*/
#define SKCTL_TWO_TONE_MODE 0x08
/* Force break (serial output to zero) */
#define SKCTL_FORCE_BREAK 0x80
/* Bits 4, 5, and 6 of SKCTL set Serial Mode Control: */
/* Trans. & Receive rates set by external clock; Also internal clock phase reset to zero. */
#define SKCTL_SER_MODE_TX_EXT_RX_EXT 0x00
/* Trans. rate set by external clock; Receive asynch. (ch. 4) (CH3 and CH4). */
#define SKCTL_SER_MODE_TX_EXT_RX_ASYNC 0x10
/* Trans. & Receive rates set by Chan. 4; Chan. 4 output on Bi-Direct. clock line. */
#define SKCTL_SER_MODE_TX_CH4_RX_CH4_BIDIR 0x20
/* N.B.: Bit combination 0,1,1 not useful */
/* Trans. rate set by Chan. 4; Receive rate set by external clock. */
#define SKCTL_SER_MODE_TX_CH4_RX_EXT 0x40
/* N.B.: Bit combination 1,0,1 not useful */
/* Trans. rate set by Chan. 2; Receive rate set by Chan. 4; Chan. 4 out on Bi-Direct. clock line. */
#define SKCTL_SER_MODE_TX_CH2_RX_CH4_BIDIR 0x60
/* Trans. rate set by Chan. 2; Receive asynch. (chan 3 & 4); Bi-Direct. clock not used (tri-state condition). */
#define SKCTL_SER_MODE_TX_CH4_RX_ASYNC 0x70
/*****************************************************************************/
/* Define a structure with the POKEY register offsets for read (R) */
/*****************************************************************************/
struct __pokey_read {
unsigned char pot0; /* paddle 0 value */
unsigned char pot1; /* paddle 1 value */
@ -63,7 +183,7 @@ struct __pokey_read {
unsigned char pot5; /* paddle 5 value */
unsigned char pot6; /* paddle 6 value */
unsigned char pot7; /* paddle 7 value */
unsigned char allpot; /* eight paddle port status */
unsigned char allpot; /* eight paddle port status (see "POTGO") */
unsigned char kbcode; /* keyboard code */
unsigned char random; /* random number generator */
unsigned char unuse2; /* unused */
@ -74,6 +194,27 @@ struct __pokey_read {
};
/*****************************************************************************/
/* (R) SKSTAT register values */
/*****************************************************************************/
#define SKSTAT_SERIN_SHIFTREG_BUSY 0x02 /* Serial input shift register busy */
#define SKSTAT_LASTKEY_PRESSED 0x04 /* the last key is still pressed */
#define SKSTAT_SHIFTKEY_PRESSED 0x08 /* the [Shift] key is pressed */
#define SKSTAT_DATA_READ_INGORING_SHIFTREG 0x10 /* Data can be read directly from the serial input port, ignoring the shift register. */
#define SKSTAT_KEYBOARD_OVERRUN 0x20 /* Keyboard over-run; Reset BITs 7, 6 and 5 (latches) to 1, using SKREST */
#define SKSTAT_INPUT_OVERRUN 0x40 /* Serial data input over-run. Reset latches as above. */
#define SKSTAT_INPUT_FRAMEERROR 0x80 /* Serial data input frame error caused by missing or extra bits. Reset latches as above. */
/* KBCODE, internal keyboard codes for Atari 8-bit computers,
** are #defined as "KEY_..." in "atari.h".
** Note some keys are not read via KBCODE:
** - Reset
** - Start, Select, and Option; see CONSOL in "gtia.h"
** - Break
*/
/* End of _pokey.h */
#endif /* #ifndef __POKEY_H */

View File

@ -11,60 +11,60 @@
/* TIA write / read registers */
struct __tia {
union {
unsigned char vsync;
unsigned char cxm0p;
unsigned char vsync;
unsigned char cxm0p;
};
union {
unsigned char vblank;
unsigned char cxm1p;
unsigned char vblank;
unsigned char cxm1p;
};
union {
unsigned char wsync;
unsigned char cxp0fb;
unsigned char wsync;
unsigned char cxp0fb;
};
union {
unsigned char rsync;
unsigned char cxp1fb;
unsigned char rsync;
unsigned char cxp1fb;
};
union {
unsigned char nusiz0;
unsigned char cxm0fb;
unsigned char nusiz0;
unsigned char cxm0fb;
};
union {
unsigned char nusiz1;
unsigned char cxm1fb;
unsigned char nusiz1;
unsigned char cxm1fb;
};
union {
unsigned char colup0;
unsigned char cxblpf;
unsigned char colup0;
unsigned char cxblpf;
};
union {
unsigned char colup1;
unsigned char cxppmm;
unsigned char colup1;
unsigned char cxppmm;
};
union {
unsigned char colupf;
unsigned char inpt0;
unsigned char colupf;
unsigned char inpt0;
};
union {
unsigned char colubk;
unsigned char inpt1;
unsigned char colubk;
unsigned char inpt1;
};
union {
unsigned char ctrlpf;
unsigned char inpt2;
unsigned char ctrlpf;
unsigned char inpt2;
};
union {
unsigned char refp0;
unsigned char inpt3;
unsigned char refp0;
unsigned char inpt3;
};
union {
unsigned char refp1;
unsigned char inpt4;
unsigned char refp1;
unsigned char inpt4;
};
union {
unsigned char pf0;
unsigned char inpt5;
unsigned char pf0;
unsigned char inpt5;
};
unsigned char pf1;
unsigned char pf2;

View File

@ -6,9 +6,10 @@
/* */
/* */
/* */
/* (C) 2000-2018 Mark Keates <markk@dendrite.co.uk> */
/* (C) 2000-2019 Mark Keates <markk@dendrite.co.uk> */
/* Freddy Offenga <taf_offenga@yahoo.com> */
/* Christian Groessler <chris@groessler.org> */
/* Bill Kendrick <nbs@sonic.net> */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -36,15 +37,16 @@
#define _ATARI_H
/* Check for errors */
#if !defined(__ATARI__)
# error This module may only be used when compiling for the Atari!
#endif
/*****************************************************************************/
/* Character codes */
/*****************************************************************************/
/* Character codes */
#define CH_DELCHR 0xFE /* delete char under the cursor */
#define CH_ENTER 0x9B
#define CH_ESC 0x1B
@ -86,70 +88,11 @@
#define CH_HLINE 0x12
#define CH_VLINE 0x7C
/* color defines */
/* make GTIA color value */
#define _gtia_mkcolor(hue,lum) (((hue) << 4) | ((lum) << 1))
/*****************************************************************************/
/* Masks for joy_read */
/*****************************************************************************/
/* luminance values go from 0 (black) to 7 (white) */
/* hue values */
#define HUE_GREY 0
#define HUE_GOLD 1
#define HUE_GOLDORANGE 2
#define HUE_REDORANGE 3
#define HUE_ORANGE 4
#define HUE_MAGENTA 5
#define HUE_PURPLE 6
#define HUE_BLUE 7
#define HUE_BLUE2 8
#define HUE_CYAN 9
#define HUE_BLUEGREEN 10
#define HUE_BLUEGREEN2 11
#define HUE_GREEN 12
#define HUE_YELLOWGREEN 13
#define HUE_YELLOW 14
#define HUE_YELLOWRED 15
/* Color defines, similar to c64 colors (untested) */
/* Note that the conio color implementation is monochrome (bgcolor and textcolor are only placeholders) */
/* Use the defines with the setcolor() or _atari_xxxcolor() functions */
#define COLOR_BLACK _gtia_mkcolor(HUE_GREY,0)
#define COLOR_WHITE _gtia_mkcolor(HUE_GREY,7)
#define COLOR_RED _gtia_mkcolor(HUE_REDORANGE,1)
#define COLOR_CYAN _gtia_mkcolor(HUE_CYAN,3)
#define COLOR_VIOLET _gtia_mkcolor(HUE_PURPLE,4)
#define COLOR_GREEN _gtia_mkcolor(HUE_GREEN,2)
#define COLOR_BLUE _gtia_mkcolor(HUE_BLUE,2)
#define COLOR_YELLOW _gtia_mkcolor(HUE_YELLOW,7)
#define COLOR_ORANGE _gtia_mkcolor(HUE_ORANGE,5)
#define COLOR_BROWN _gtia_mkcolor(HUE_YELLOW,2)
#define COLOR_LIGHTRED _gtia_mkcolor(HUE_REDORANGE,6)
#define COLOR_GRAY1 _gtia_mkcolor(HUE_GREY,2)
#define COLOR_GRAY2 _gtia_mkcolor(HUE_GREY,3)
#define COLOR_LIGHTGREEN _gtia_mkcolor(HUE_GREEN,6)
#define COLOR_LIGHTBLUE _gtia_mkcolor(HUE_BLUE,6)
#define COLOR_GRAY3 _gtia_mkcolor(HUE_GREY,5)
/* TGI color defines */
#define TGI_COLOR_BLACK COLOR_BLACK
#define TGI_COLOR_WHITE COLOR_WHITE
#define TGI_COLOR_RED COLOR_RED
#define TGI_COLOR_CYAN COLOR_CYAN
#define TGI_COLOR_VIOLET COLOR_VIOLET
#define TGI_COLOR_GREEN COLOR_GREEN
#define TGI_COLOR_BLUE COLOR_BLUE
#define TGI_COLOR_YELLOW COLOR_YELLOW
#define TGI_COLOR_ORANGE COLOR_ORANGE
#define TGI_COLOR_BROWN COLOR_BROWN
#define TGI_COLOR_LIGHTRED COLOR_LIGHTRED
#define TGI_COLOR_GRAY1 COLOR_GRAY1
#define TGI_COLOR_GRAY2 COLOR_GRAY2
#define TGI_COLOR_LIGHTGREEN COLOR_LIGHTGREEN
#define TGI_COLOR_LIGHTBLUE COLOR_LIGHTBLUE
#define TGI_COLOR_GRAY3 COLOR_GRAY3
/* Masks for joy_read */
#define JOY_UP_MASK 0x01
#define JOY_DOWN_MASK 0x02
#define JOY_LEFT_MASK 0x04
@ -159,7 +102,11 @@
#define JOY_FIRE_MASK JOY_BTN_1_MASK
#define JOY_FIRE(v) ((v) & JOY_FIRE_MASK)
/* Keyboard values returned by kbcode / CH */
/*****************************************************************************/
/* Keyboard values returned by kbcode / CH */
/*****************************************************************************/
#define KEY_NONE ((unsigned char) 0xFF)
#define KEY_0 ((unsigned char) 0x32)
@ -220,15 +167,26 @@
#define KEY_INVERSE ((unsigned char) 0x27)
#define KEY_HELP ((unsigned char) 0x11)
/* Function keys only exist on the 1200XL model. */
#define KEY_F1 ((unsigned char) 0x03)
#define KEY_F2 ((unsigned char) 0x04)
#define KEY_F3 ((unsigned char) 0x13)
#define KEY_F4 ((unsigned char) 0x14)
/* N.B. Cannot read Ctrl key alone */
#define KEY_CTRL ((unsigned char) 0x80)
/* N.B. Cannot read Shift key alone via KBCODE;
** instead, check "Shfit key press" bit of SKSTAT register.
** Also, no way to tell left Shift from right Shift.
*/
#define KEY_SHIFT ((unsigned char) 0x40)
/* Composed keys */
/* Composed keys
** (Other combinations are possible, including Shift+Ctrl+key,
** though not all such combinations are available.)
*/
#define KEY_EXCLAMATIONMARK (KEY_1 | KEY_SHIFT)
#define KEY_QUOTE (KEY_2 | KEY_SHIFT)
@ -256,18 +214,29 @@
#define KEY_LEFT (KEY_PLUS | KEY_CTRL)
#define KEY_RIGHT (KEY_ASTERISK | KEY_CTRL)
/* color register functions */
/*****************************************************************************/
/* Color register functions */
/*****************************************************************************/
extern void __fastcall__ _setcolor (unsigned char color_reg, unsigned char hue, unsigned char luminace);
extern void __fastcall__ _setcolor_low (unsigned char color_reg, unsigned char color_value);
extern unsigned char __fastcall__ _getcolor (unsigned char color_reg);
/* other screen functions */
/*****************************************************************************/
/* Other screen functions */
/*****************************************************************************/
extern int __fastcall__ _graphics (unsigned char mode); /* mode value same as in BASIC */
extern void __fastcall__ _scroll (signed char numlines);
/* numlines > 0 scrolls up */
/* numlines < 0 scrolls down */
/* misc. functions */
/*****************************************************************************/
/* Misc. functions */
/*****************************************************************************/
extern unsigned char get_ostype(void); /* get ROM version */
extern unsigned char get_tv(void); /* get TV system */
extern void _save_vecs(void); /* save system vectors */
@ -275,7 +244,11 @@ extern void _rest_vecs(void); /* restore system vectors */
extern char *_getdefdev(void); /* get default floppy device */
extern unsigned char _is_cmdline_dos(void); /* does DOS support command lines */
/* global variables */
/*****************************************************************************/
/* Global variables */
/*****************************************************************************/
extern unsigned char _dos_type; /* the DOS flavour */
#ifndef __ATARIXL__
extern void atr130_emd[];
@ -329,7 +302,11 @@ extern void atrx15_tgi[];
extern void atrx15p2_tgi[];
#endif
/* get_ostype return value defines (for explanation, see ostype.s) */
/*****************************************************************************/
/* get_ostype return value defines (for explanation, see ostype.s) */
/*****************************************************************************/
/* masks */
#define AT_OS_TYPE_MAIN 7
#define AT_OS_TYPE_MINOR (7 << 3)
@ -352,11 +329,19 @@ extern void atrx15p2_tgi[];
#define AT_OS_XLXE_3 3
#define AT_OS_XLXE_4 4
/* get_tv return values */
/*****************************************************************************/
/* get_tv return values */
/*****************************************************************************/
#define AT_NTSC 0
#define AT_PAL 1
/* valid _dos_type values */
/*****************************************************************************/
/* valid _dos_type values */
/*****************************************************************************/
#define SPARTADOS 0
#define REALDOS 1
#define BWDOS 2
@ -366,7 +351,15 @@ extern void atrx15p2_tgi[];
#define MYDOS 6
#define NODOS 255
/* Define hardware */
/*****************************************************************************/
/* Define hardware and where they're mapped in memory */
/*****************************************************************************/
#include <_atarios.h>
#define OS (*(struct __os*)0x0000)
#define BASIC (*(struct __basic*)0x0080)
#include <_gtia.h>
#define GTIA_READ (*(struct __gtia_read*)0xD000)
#define GTIA_WRITE (*(struct __gtia_write*)0xD000)
@ -383,65 +376,119 @@ extern void atrx15p2_tgi[];
#include <_antic.h>
#define ANTIC (*(struct __antic*)0xD400)
/* device control block */
struct __dcb {
unsigned char device; /* device id */
unsigned char unit; /* unit number */
unsigned char command; /* command */
unsigned char status; /* command type / status return */
void *buffer; /* pointer to buffer */
unsigned char timeout; /* device timeout in seconds */
unsigned char unused;
unsigned int xfersize; /* # of bytes to transfer */
unsigned char aux1; /* 1st command auxiliary byte */
unsigned char aux2; /* 2nd command auxiliary byte */
};
#define DCB (*(struct __dcb *)0x300)
/* I/O control block */
struct __iocb {
unsigned char handler; /* handler index number (0xff free) */
unsigned char drive; /* device number (drive) */
unsigned char command; /* command */
unsigned char status; /* status of last operation */
void *buffer; /* pointer to buffer */
void *put_byte; /* pointer to device's PUT BYTE routine */
unsigned int buflen; /* length of buffer */
unsigned char aux1; /* 1st auxiliary byte */
unsigned char aux2; /* 2nd auxiliary byte */
unsigned char aux3; /* 3rd auxiliary byte */
unsigned char aux4; /* 4th auxiliary byte */
unsigned char aux5; /* 5th auxiliary byte */
unsigned char spare; /* spare byte */
};
#define ZIOCB (*(struct __iocb *)0x20) /* zero page IOCB */
#define IOCB (*(struct __iocb *)0x340) /* system IOCB buffers */
/*****************************************************************************/
/* PIA PORTA and PORTB register bits */
/*****************************************************************************/
/* IOCB Command Codes */
#define IOCB_OPEN 0x03 /* open */
#define IOCB_GETREC 0x05 /* get record */
#define IOCB_GETCHR 0x07 /* get character(s) */
#define IOCB_PUTREC 0x09 /* put record */
#define IOCB_PUTCHR 0x0B /* put character(s) */
#define IOCB_CLOSE 0x0C /* close */
#define IOCB_STATIS 0x0D /* status */
#define IOCB_SPECIL 0x0E /* special */
#define IOCB_DRAWLN 0x11 /* draw line */
#define IOCB_FILLIN 0x12 /* draw line with right fill */
#define IOCB_RENAME 0x20 /* rename disk file */
#define IOCB_DELETE 0x21 /* delete disk file */
#define IOCB_LOCKFL 0x23 /* lock file (set to read-only) */
#define IOCB_UNLOCK 0x24 /* unlock file */
#define IOCB_POINT 0x25 /* point sector */
#define IOCB_NOTE 0x26 /* note sector */
#define IOCB_GETFL 0x27 /* get file length */
#define IOCB_CHDIR_MYDOS 0x29 /* change directory (MyDOS) */
#define IOCB_MKDIR 0x2A /* make directory (MyDOS/SpartaDOS) */
#define IOCB_RMDIR 0x2B /* remove directory (SpartaDOS) */
#define IOCB_CHDIR_SPDOS 0x2C /* change directory (SpartaDOS) */
#define IOCB_GETCWD 0x30 /* get current directory (MyDOS/SpartaDOS) */
#define IOCB_FORMAT 0xFE /* format */
/* See also: "JOY_xxx_MASK" in "atari.h" */
/* Paddle 0-3 triggers (per PORTA bits) */
#define PORTA_PTRIG3 0x80
#define PORTA_PTRIG2 0x40
#define PORTA_PTRIG1 0x08
#define PORTA_PTRIG0 0x04
/* On the Atari 400/800, PORTB is the same as PORTA, but for controller ports 3 & 4. */
/* Paddle 4-7 triggers (per PORTB bits); only 400/800 had four controller ports */
#define PORTB_PTRIG7 0x80
#define PORTB_PTRIG6 0x40
#define PORTB_PTRIG5 0x08
#define PORTB_PTRIG4 0x04
/* On the XL series of computers, PORTB has been changed to a memory and
** LED control (1200XL model only) register (read/write):
*/
/* If set, the built-in OS is enabled, and occupies the address range $C000-$FFFF
** (except that the area $D000-$D7FF will only access the hardware registers.)
** If clear, RAM is enabled in this area (again, save for the hole.)
*/
#define PORTB_OSROM 0x01
/* If set, RAM is enabled for the address range $A000-$BFFF.
** If clear, the built-in BASIC ROM is enabled at this address.
** And if there is a cartridge installed in the computer, it makes no difference.
*/
#define PORTB_BASICROM 0x02
/* If set, the corresponding LED is turned off. If clear, the LED will be on.
** (1200XL only)
*/
#define PORTB_LED1 0x04
#define PORTB_LED2 0x08
/* On the XE series of computers, PORTB is a bank-selected memory control register (read/write): */
/* These bits determine which memory bank is visible to the CPU and/or ANTIC chip
** when their Bank Switch bit is set. There are four possible banks of 16KB each.
*/
#define PORTB_BANKSELECT1 0x00
#define PORTB_BANKSELECT2 0x04
#define PORTB_BANKSELECT3 0x08
#define PORTB_BANKSELECT4 0x0C
/* If set, the CPU and/or ANTIC chip will access bank-switched memory mapped to the
** address range $4000-$7FFF.
** If clear, the CPU and/or ANTIC will see normal memory in this region.
*/
#define PORTB_BANKSWITCH_CPU 0x10
#define PORTB_BANKSWITCH_ANTIC 0x20
/* If set, RAM is enabled for the address range $5000-$57FF.
** If clear, the self-test ROM (physically located at $D000-$D7FF, under the hardware registers)
** is remapped to this memory area.
*/
#define PORTB_SELFTEST 0x80
/*****************************************************************************/
/* PACTL and PBCTL register bits */
/*****************************************************************************/
/* (W) Peripheral PA1/PB1 interrupt (IRQ) ("peripheral proceed line available") enable.
** One equals enable. Set by the OS but available to the user; reset on powerup.
** (PxCTL_IRQ_STATUS (R) bit will get set upon interrupt occurance)
*/
#define PxCTL_IRQ_ENABLE 0x01 /* bit 0 */
/* Note: Bit 1 is always set to */
/* (W) Controls PORTA/PORTB addressing
** 1 = PORTA/PORTB register; read/write to controller port
** 0 = direction control register; write to direction controls
** (allows setting data flow; write 0s & 1s to PORTA/PORTB bits
** to set which port's pins are read (input), or write (output),
** respectively)
*/
#define PxCTL_ADDRESSING 0x04 /* bit 2 */
/* (W) Peripheral motor control line; Turn the cassette on or off
** (PACTL-specific register bit)
** 0 = on
** 1 = off
*/
#define PACTL_MOTOR_CONTROL 0x08 /* bit 3 */
/* Peripheral command identification (serial bus command line)
** (PBCTL-specific register bit)
*/
#define PBCTL_PERIPH_CMD_IDENT 0x08 /* bit 3 */
/* Note: Bits 4 & 5 are always set to 1 */
/* Note: Bit 6 is always set to 0 */
/* (R) Peripheral interrupt (IRQ) status bit.
** Set by Peripherals (PORTA / PORTB). Reset by reading from PORTA / PORTB.
** PACTL's is interrupt status of PROCEED
** PBCTL's is interrupt status of SIO
*/
#define PxCTL_IRQ_STATUS 0x80
/* End of atari.h */

View File

@ -46,47 +46,6 @@
/* the addresses of the static drivers */
extern void atr5200std_joy[]; /* referred to by joy_static_stddrv[] */
/* make GTIA color value */
#define _gtia_mkcolor(hue,lum) (((hue) << 4) | ((lum) << 1))
/* luminance values go from 0 (black) to 7 (white) */
/* hue values */
#define HUE_GREY 0
#define HUE_GOLD 1
#define HUE_GOLDORANGE 2
#define HUE_REDORANGE 3
#define HUE_ORANGE 4
#define HUE_MAGENTA 5
#define HUE_PURPLE 6
#define HUE_BLUE 7
#define HUE_BLUE2 8
#define HUE_CYAN 9
#define HUE_BLUEGREEN 10
#define HUE_BLUEGREEN2 11
#define HUE_GREEN 12
#define HUE_YELLOWGREEN 13
#define HUE_YELLOW 14
#define HUE_YELLOWRED 15
/* Color defines, similar to c64 colors (untested) */
#define COLOR_BLACK _gtia_mkcolor(HUE_GREY,0)
#define COLOR_WHITE _gtia_mkcolor(HUE_GREY,7)
#define COLOR_RED _gtia_mkcolor(HUE_REDORANGE,1)
#define COLOR_CYAN _gtia_mkcolor(HUE_CYAN,3)
#define COLOR_VIOLET _gtia_mkcolor(HUE_PURPLE,4)
#define COLOR_GREEN _gtia_mkcolor(HUE_GREEN,2)
#define COLOR_BLUE _gtia_mkcolor(HUE_BLUE,2)
#define COLOR_YELLOW _gtia_mkcolor(HUE_YELLOW,7)
#define COLOR_ORANGE _gtia_mkcolor(HUE_ORANGE,5)
#define COLOR_BROWN _gtia_mkcolor(HUE_YELLOW,2)
#define COLOR_LIGHTRED _gtia_mkcolor(HUE_REDORANGE,6)
#define COLOR_GRAY1 _gtia_mkcolor(HUE_GREY,2)
#define COLOR_GRAY2 _gtia_mkcolor(HUE_GREY,3)
#define COLOR_LIGHTGREEN _gtia_mkcolor(HUE_GREEN,6)
#define COLOR_LIGHTBLUE _gtia_mkcolor(HUE_BLUE,6)
#define COLOR_GRAY3 _gtia_mkcolor(HUE_GREY,5)
/* Masks for joy_read */
#define JOY_UP_MASK 0x01
#define JOY_DOWN_MASK 0x02

View File

@ -137,6 +137,7 @@
/* The addresses of the static drivers */
extern void c64_65816_emd[];
extern void c64_c256k_emd[];
extern void c64_dqbb_emd[];
extern void c64_georam_emd[];

View File

@ -0,0 +1,297 @@
/*****************************************************************************/
/* */
/* cbm_petscii_charmap.h */
/* */
/* CBM system standard string mapping (ISO-8859-1 -> PetSCII) */
/* */
/* */
/* 2019-03-10, Greg King */
/* */
/* This software is provided "as-is", without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
/* arising from the use of this software. */
/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
/* freely, subject to the following restrictions: */
/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
/* appreciated, but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice must not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
/* No include guard here! Multiple use in one file might be intentional. */
#pragma warn (remap-zero, push, off)
#pragma charmap (0x00, 0x00)
#pragma charmap (0x01, 0x01)
#pragma charmap (0x02, 0x02)
#pragma charmap (0x03, 0x03)
#pragma charmap (0x04, 0x04)
#pragma charmap (0x05, 0x05)
#pragma charmap (0x06, 0x06)
#pragma charmap (0x07, 0x07)
#pragma charmap (0x08, 0x14)
#pragma charmap (0x09, 0x09)
#pragma charmap (0x0A, 0x0D)
#pragma charmap (0x0B, 0x11)
#pragma charmap (0x0C, 0x93)
#pragma charmap (0x0D, 0x0A)
#pragma charmap (0x0E, 0x0E)
#pragma charmap (0x0F, 0x0F)
#pragma charmap (0x10, 0x10)
#pragma charmap (0x11, 0x0B)
#pragma charmap (0x12, 0x12)
#pragma charmap (0x13, 0x13)
#pragma charmap (0x14, 0x08)
#pragma charmap (0x15, 0x15)
#pragma charmap (0x16, 0x16)
#pragma charmap (0x17, 0x17)
#pragma charmap (0x18, 0x18)
#pragma charmap (0x19, 0x19)
#pragma charmap (0x1A, 0x1A)
#pragma charmap (0x1B, 0x1B)
#pragma charmap (0x1C, 0x1C)
#pragma charmap (0x1D, 0x1D)
#pragma charmap (0x1E, 0x1E)
#pragma charmap (0x1F, 0x1F)
#pragma charmap (0x20, 0x20)
#pragma charmap (0x21, 0x21)
#pragma charmap (0x22, 0x22)
#pragma charmap (0x23, 0x23)
#pragma charmap (0x24, 0x24)
#pragma charmap (0x25, 0x25)
#pragma charmap (0x26, 0x26)
#pragma charmap (0x27, 0x27)
#pragma charmap (0x28, 0x28)
#pragma charmap (0x29, 0x29)
#pragma charmap (0x2A, 0x2A)
#pragma charmap (0x2B, 0x2B)
#pragma charmap (0x2C, 0x2C)
#pragma charmap (0x2D, 0x2D)
#pragma charmap (0x2E, 0x2E)
#pragma charmap (0x2F, 0x2F)
#pragma charmap (0x30, 0x30)
#pragma charmap (0x31, 0x31)
#pragma charmap (0x32, 0x32)
#pragma charmap (0x33, 0x33)
#pragma charmap (0x34, 0x34)
#pragma charmap (0x35, 0x35)
#pragma charmap (0x36, 0x36)
#pragma charmap (0x37, 0x37)
#pragma charmap (0x38, 0x38)
#pragma charmap (0x39, 0x39)
#pragma charmap (0x3A, 0x3A)
#pragma charmap (0x3B, 0x3B)
#pragma charmap (0x3C, 0x3C)
#pragma charmap (0x3D, 0x3D)
#pragma charmap (0x3E, 0x3E)
#pragma charmap (0x3F, 0x3F)
#pragma charmap (0x40, 0x40)
#pragma charmap (0x41, 0xC1)
#pragma charmap (0x42, 0xC2)
#pragma charmap (0x43, 0xC3)
#pragma charmap (0x44, 0xC4)
#pragma charmap (0x45, 0xC5)
#pragma charmap (0x46, 0xC6)
#pragma charmap (0x47, 0xC7)
#pragma charmap (0x48, 0xC8)
#pragma charmap (0x49, 0xC9)
#pragma charmap (0x4A, 0xCA)
#pragma charmap (0x4B, 0xCB)
#pragma charmap (0x4C, 0xCC)
#pragma charmap (0x4D, 0xCD)
#pragma charmap (0x4E, 0xCE)
#pragma charmap (0x4F, 0xCF)
#pragma charmap (0x50, 0xD0)
#pragma charmap (0x51, 0xD1)
#pragma charmap (0x52, 0xD2)
#pragma charmap (0x53, 0xD3)
#pragma charmap (0x54, 0xD4)
#pragma charmap (0x55, 0xD5)
#pragma charmap (0x56, 0xD6)
#pragma charmap (0x57, 0xD7)
#pragma charmap (0x58, 0xD8)
#pragma charmap (0x59, 0xD9)
#pragma charmap (0x5A, 0xDA)
#pragma charmap (0x5B, 0x5B)
#pragma charmap (0x5C, 0xBF)
#pragma charmap (0x5D, 0x5D)
#pragma charmap (0x5E, 0x5E)
#pragma charmap (0x5F, 0xA4)
#pragma charmap (0x60, 0xAD)
#pragma charmap (0x61, 0x41)
#pragma charmap (0x62, 0x42)
#pragma charmap (0x63, 0x43)
#pragma charmap (0x64, 0x44)
#pragma charmap (0x65, 0x45)
#pragma charmap (0x66, 0x46)
#pragma charmap (0x67, 0x47)
#pragma charmap (0x68, 0x48)
#pragma charmap (0x69, 0x49)
#pragma charmap (0x6A, 0x4A)
#pragma charmap (0x6B, 0x4B)
#pragma charmap (0x6C, 0x4C)
#pragma charmap (0x6D, 0x4D)
#pragma charmap (0x6E, 0x4E)
#pragma charmap (0x6F, 0x4F)
#pragma charmap (0x70, 0x50)
#pragma charmap (0x71, 0x51)
#pragma charmap (0x72, 0x52)
#pragma charmap (0x73, 0x53)
#pragma charmap (0x74, 0x54)
#pragma charmap (0x75, 0x55)
#pragma charmap (0x76, 0x56)
#pragma charmap (0x77, 0x57)
#pragma charmap (0x78, 0x58)
#pragma charmap (0x79, 0x59)
#pragma charmap (0x7A, 0x5A)
#pragma charmap (0x7B, 0xB3)
#pragma charmap (0x7C, 0xDD)
#pragma charmap (0x7D, 0xAB)
#pragma charmap (0x7E, 0xB1)
#pragma charmap (0x7F, 0xDF)
#pragma charmap (0x80, 0x80)
#pragma charmap (0x81, 0x81)
#pragma charmap (0x82, 0x82)
#pragma charmap (0x83, 0x83)
#pragma charmap (0x84, 0x84)
#pragma charmap (0x85, 0x85)
#pragma charmap (0x86, 0x86)
#pragma charmap (0x87, 0x87)
#pragma charmap (0x88, 0x88)
#pragma charmap (0x89, 0x89)
#pragma charmap (0x8A, 0x8A)
#pragma charmap (0x8B, 0x8B)
#pragma charmap (0x8C, 0x8C)
#pragma charmap (0x8D, 0x8D)
#pragma charmap (0x8E, 0x8E)
#pragma charmap (0x8F, 0x8F)
#pragma charmap (0x90, 0x90)
#pragma charmap (0x91, 0x91)
#pragma charmap (0x92, 0x92)
#pragma charmap (0x93, 0x0C)
#pragma charmap (0x94, 0x94)
#pragma charmap (0x95, 0x95)
#pragma charmap (0x96, 0x96)
#pragma charmap (0x97, 0x97)
#pragma charmap (0x98, 0x98)
#pragma charmap (0x99, 0x99)
#pragma charmap (0x9A, 0x9A)
#pragma charmap (0x9B, 0x9B)
#pragma charmap (0x9C, 0x9C)
#pragma charmap (0x9D, 0x9D)
#pragma charmap (0x9E, 0x9E)
#pragma charmap (0x9F, 0x9F)
#pragma charmap (0xA0, 0xA0)
#pragma charmap (0xA1, 0xA1)
#pragma charmap (0xA2, 0xA2)
#pragma charmap (0xA3, 0xA3)
#pragma charmap (0xA4, 0xA4)
#pragma charmap (0xA5, 0xA5)
#pragma charmap (0xA6, 0xA6)
#pragma charmap (0xA7, 0xA7)
#pragma charmap (0xA8, 0xA8)
#pragma charmap (0xA9, 0xA9)
#pragma charmap (0xAA, 0xAA)
#pragma charmap (0xAB, 0xAB)
#pragma charmap (0xAC, 0xAC)
#pragma charmap (0xAD, 0xAD)
#pragma charmap (0xAE, 0xAE)
#pragma charmap (0xAF, 0xAF)
#pragma charmap (0xB0, 0xB0)
#pragma charmap (0xB1, 0xB1)
#pragma charmap (0xB2, 0xB2)
#pragma charmap (0xB3, 0xB3)
#pragma charmap (0xB4, 0xB4)
#pragma charmap (0xB5, 0xB5)
#pragma charmap (0xB6, 0xB6)
#pragma charmap (0xB7, 0xB7)
#pragma charmap (0xB8, 0xB8)
#pragma charmap (0xB9, 0xB9)
#pragma charmap (0xBA, 0xBA)
#pragma charmap (0xBB, 0xBB)
#pragma charmap (0xBC, 0xBC)
#pragma charmap (0xBD, 0xBD)
#pragma charmap (0xBE, 0xBE)
#pragma charmap (0xBF, 0xBF)
#pragma charmap (0xC0, 0x60)
#pragma charmap (0xC1, 0x61)
#pragma charmap (0xC2, 0x62)
#pragma charmap (0xC3, 0x63)
#pragma charmap (0xC4, 0x64)
#pragma charmap (0xC5, 0x65)
#pragma charmap (0xC6, 0x66)
#pragma charmap (0xC7, 0x67)
#pragma charmap (0xC8, 0x68)
#pragma charmap (0xC9, 0x69)
#pragma charmap (0xCA, 0x6A)
#pragma charmap (0xCB, 0x6B)
#pragma charmap (0xCC, 0x6C)
#pragma charmap (0xCD, 0x6D)
#pragma charmap (0xCE, 0x6E)
#pragma charmap (0xCF, 0x6F)
#pragma charmap (0xD0, 0x70)
#pragma charmap (0xD1, 0x71)
#pragma charmap (0xD2, 0x72)
#pragma charmap (0xD3, 0x73)
#pragma charmap (0xD4, 0x74)
#pragma charmap (0xD5, 0x75)
#pragma charmap (0xD6, 0x76)
#pragma charmap (0xD7, 0x77)
#pragma charmap (0xD8, 0x78)
#pragma charmap (0xD9, 0x79)
#pragma charmap (0xDA, 0x7A)
#pragma charmap (0xDB, 0x7B)
#pragma charmap (0xDC, 0x7C)
#pragma charmap (0xDD, 0x7D)
#pragma charmap (0xDE, 0x7E)
#pragma charmap (0xDF, 0x7F)
#pragma charmap (0xE0, 0xE0)
#pragma charmap (0xE1, 0xE1)
#pragma charmap (0xE2, 0xE2)
#pragma charmap (0xE3, 0xE3)
#pragma charmap (0xE4, 0xE4)
#pragma charmap (0xE5, 0xE5)
#pragma charmap (0xE6, 0xE6)
#pragma charmap (0xE7, 0xE7)
#pragma charmap (0xE8, 0xE8)
#pragma charmap (0xE9, 0xE9)
#pragma charmap (0xEA, 0xEA)
#pragma charmap (0xEB, 0xEB)
#pragma charmap (0xEC, 0xEC)
#pragma charmap (0xED, 0xED)
#pragma charmap (0xEE, 0xEE)
#pragma charmap (0xEF, 0xEF)
#pragma charmap (0xF0, 0xF0)
#pragma charmap (0xF1, 0xF1)
#pragma charmap (0xF2, 0xF2)
#pragma charmap (0xF3, 0xF3)
#pragma charmap (0xF4, 0xF4)
#pragma charmap (0xF5, 0xF5)
#pragma charmap (0xF6, 0xF6)
#pragma charmap (0xF7, 0xF7)
#pragma charmap (0xF8, 0xF8)
#pragma charmap (0xF9, 0xF9)
#pragma charmap (0xFA, 0xFA)
#pragma charmap (0xFB, 0xFB)
#pragma charmap (0xFC, 0xFC)
#pragma charmap (0xFD, 0xFD)
#pragma charmap (0xFE, 0xFE)
#pragma charmap (0xFF, 0xFF)
#pragma warn (remap-zero, pop)

View File

@ -0,0 +1,311 @@
/*****************************************************************************/
/* */
/* cbm_screen_charmap.h */
/* */
/* (c) Copyright 2019, Gerhard W. Gruber (sparhawk@gmx.at) */
/* */
/* When using CBM mode, this include converts character literals */
/* from ASCII to screen-code mapping, so you can write directly */
/* to the screen memory. */
/* */
/* If this include is used, no additional macroes are needed. */
/* */
/*****************************************************************************/
/* No include guard here! Multiple use in one file may be intentional. */
#pragma warn (remap-zero, push, off)
// Char $00 -> c + 128
#pragma charmap (0x00, 0x80)
// Char $01 ... $1A -> c + 128 + 64 (control alphabet)
#pragma charmap (0x01, 0xC1)
#pragma charmap (0x02, 0xC2)
#pragma charmap (0x03, 0xC3)
#pragma charmap (0x04, 0xC4)
#pragma charmap (0x05, 0xC5)
#pragma charmap (0x06, 0xC6)
#pragma charmap (0x07, 0xC7)
#pragma charmap (0x08, 0xC8)
#pragma charmap (0x09, 0xC9)
#pragma charmap (0x0A, 0xCA)
#pragma charmap (0x0B, 0xCB)
#pragma charmap (0x0C, 0xCC)
#pragma charmap (0x0D, 0xCD)
#pragma charmap (0x0E, 0xCE)
#pragma charmap (0x0F, 0xCF)
#pragma charmap (0x10, 0xD0)
#pragma charmap (0x11, 0xD1)
#pragma charmap (0x12, 0xD2)
#pragma charmap (0x13, 0xD3)
#pragma charmap (0x14, 0xD4)
#pragma charmap (0x15, 0xD5)
#pragma charmap (0x16, 0xD6)
#pragma charmap (0x17, 0xD7)
#pragma charmap (0x18, 0xD8)
#pragma charmap (0x19, 0xD9)
#pragma charmap (0x1A, 0xDA)
// Char $1B ... $1F -> c + 128
#pragma charmap (0x1B, 0x9B)
#pragma charmap (0x1C, 0x9C)
#pragma charmap (0x1D, 0x9D)
#pragma charmap (0x1E, 0x9E)
#pragma charmap (0x1F, 0x9F)
// Char $20 ... $3F -> c
#pragma charmap (0x20, 0x20)
#pragma charmap (0x21, 0x21)
#pragma charmap (0x22, 0x22)
#pragma charmap (0x23, 0x23)
#pragma charmap (0x24, 0x24)
#pragma charmap (0x25, 0x25)
#pragma charmap (0x26, 0x26)
#pragma charmap (0x27, 0x27)
#pragma charmap (0x28, 0x28)
#pragma charmap (0x29, 0x29)
#pragma charmap (0x2A, 0x2A)
#pragma charmap (0x2B, 0x2B)
#pragma charmap (0x2C, 0x2C)
#pragma charmap (0x2D, 0x2D)
#pragma charmap (0x2E, 0x2E)
#pragma charmap (0x2F, 0x2F)
#pragma charmap (0x30, 0x30)
#pragma charmap (0x31, 0x31)
#pragma charmap (0x32, 0x32)
#pragma charmap (0x33, 0x33)
#pragma charmap (0x34, 0x34)
#pragma charmap (0x35, 0x35)
#pragma charmap (0x36, 0x36)
#pragma charmap (0x37, 0x37)
#pragma charmap (0x38, 0x38)
#pragma charmap (0x39, 0x39)
#pragma charmap (0x3A, 0x3A)
#pragma charmap (0x3B, 0x3B)
#pragma charmap (0x3C, 0x3C)
#pragma charmap (0x3D, 0x3D)
#pragma charmap (0x3E, 0x3E)
#pragma charmap (0x3F, 0x3F)
// Char $40 -> c - 64
#pragma charmap (0x40, 0x00)
// Char $41 ... $5A -> c (upper-case alphabet)
#pragma charmap (0x41, 0x41)
#pragma charmap (0x42, 0x42)
#pragma charmap (0x43, 0x43)
#pragma charmap (0x44, 0x44)
#pragma charmap (0x45, 0x45)
#pragma charmap (0x46, 0x46)
#pragma charmap (0x47, 0x47)
#pragma charmap (0x48, 0x48)
#pragma charmap (0x49, 0x49)
#pragma charmap (0x4A, 0x4A)
#pragma charmap (0x4B, 0x4B)
#pragma charmap (0x4C, 0x4C)
#pragma charmap (0x4D, 0x4D)
#pragma charmap (0x4E, 0x4E)
#pragma charmap (0x4F, 0x4F)
#pragma charmap (0x50, 0x50)
#pragma charmap (0x51, 0x51)
#pragma charmap (0x52, 0x52)
#pragma charmap (0x53, 0x53)
#pragma charmap (0x54, 0x54)
#pragma charmap (0x55, 0x55)
#pragma charmap (0x56, 0x56)
#pragma charmap (0x57, 0x57)
#pragma charmap (0x58, 0x58)
#pragma charmap (0x59, 0x59)
#pragma charmap (0x5A, 0x5A)
// Char $5B ... $5F -> c - 64
#pragma charmap (0x5B, 0x1B)
#pragma charmap (0x5C, 0x1C)
#pragma charmap (0x5D, 0x1D)
#pragma charmap (0x5E, 0x1E)
#pragma charmap (0x5F, 0x1F)
// Char $60 -> c - 32
#pragma charmap (0x60, 0x40)
// Char $61 ... $7A -> c - 32 - 64 (lower-case alphabet)
#pragma charmap (0x61, 0x01)
#pragma charmap (0x62, 0x02)
#pragma charmap (0x63, 0x03)
#pragma charmap (0x64, 0x04)
#pragma charmap (0x65, 0x05)
#pragma charmap (0x66, 0x06)
#pragma charmap (0x67, 0x07)
#pragma charmap (0x68, 0x08)
#pragma charmap (0x69, 0x09)
#pragma charmap (0x6A, 0x0A)
#pragma charmap (0x6B, 0x0B)
#pragma charmap (0x6C, 0x0C)
#pragma charmap (0x6D, 0x0D)
#pragma charmap (0x6E, 0x0E)
#pragma charmap (0x6F, 0x0F)
#pragma charmap (0x70, 0x10)
#pragma charmap (0x71, 0x11)
#pragma charmap (0x72, 0x12)
#pragma charmap (0x73, 0x13)
#pragma charmap (0x74, 0x14)
#pragma charmap (0x75, 0x15)
#pragma charmap (0x76, 0x16)
#pragma charmap (0x77, 0x17)
#pragma charmap (0x78, 0x18)
#pragma charmap (0x79, 0x19)
#pragma charmap (0x7A, 0x1A)
// Char $7B ... $7F -> c - 32
#pragma charmap (0x7B, 0x5B)
#pragma charmap (0x7C, 0x5C)
#pragma charmap (0x7D, 0x5D)
#pragma charmap (0x7E, 0x5E)
#pragma charmap (0x7F, 0x5F)
// Char $80 -> c + 64
#pragma charmap (0x80, 0xC0)
// Char $81 ... $9A -> c (control alphabet)
#pragma charmap (0x81, 0x81)
#pragma charmap (0x82, 0x82)
#pragma charmap (0x83, 0x83)
#pragma charmap (0x84, 0x84)
#pragma charmap (0x85, 0x85)
#pragma charmap (0x86, 0x86)
#pragma charmap (0x87, 0x87)
#pragma charmap (0x88, 0x88)
#pragma charmap (0x89, 0x89)
#pragma charmap (0x8A, 0x8A)
#pragma charmap (0x8B, 0x8B)
#pragma charmap (0x8C, 0x8C)
#pragma charmap (0x8D, 0x8D)
#pragma charmap (0x8E, 0x8E)
#pragma charmap (0x8F, 0x8F)
#pragma charmap (0x90, 0x90)
#pragma charmap (0x91, 0x91)
#pragma charmap (0x92, 0x92)
#pragma charmap (0x93, 0x93)
#pragma charmap (0x94, 0x94)
#pragma charmap (0x95, 0x95)
#pragma charmap (0x96, 0x96)
#pragma charmap (0x97, 0x97)
#pragma charmap (0x98, 0x98)
#pragma charmap (0x99, 0x99)
#pragma charmap (0x9A, 0x9A)
// Char $9B ... $9F -> c + 64
#pragma charmap (0x9B, 0xDB)
#pragma charmap (0x9C, 0xDC)
#pragma charmap (0x9D, 0xDD)
#pragma charmap (0x9E, 0xDE)
#pragma charmap (0x9F, 0xDF)
// Char $A0 ... $BF -> c - 64
#pragma charmap (0xA0, 0x60)
#pragma charmap (0xA1, 0x61)
#pragma charmap (0xA2, 0x62)
#pragma charmap (0xA3, 0x63)
#pragma charmap (0xA4, 0x64)
#pragma charmap (0xA5, 0x65)
#pragma charmap (0xA6, 0x66)
#pragma charmap (0xA7, 0x67)
#pragma charmap (0xA8, 0x68)
#pragma charmap (0xA9, 0x69)
#pragma charmap (0xAA, 0x6A)
#pragma charmap (0xAB, 0x6B)
#pragma charmap (0xAC, 0x6C)
#pragma charmap (0xAD, 0x6D)
#pragma charmap (0xAE, 0x6E)
#pragma charmap (0xAF, 0x6F)
#pragma charmap (0xB0, 0x70)
#pragma charmap (0xB1, 0x71)
#pragma charmap (0xB2, 0x72)
#pragma charmap (0xB3, 0x73)
#pragma charmap (0xB4, 0x74)
#pragma charmap (0xB5, 0x75)
#pragma charmap (0xB6, 0x76)
#pragma charmap (0xB7, 0x77)
#pragma charmap (0xB8, 0x78)
#pragma charmap (0xB9, 0x79)
#pragma charmap (0xBA, 0x7A)
#pragma charmap (0xBB, 0x7B)
#pragma charmap (0xBC, 0x7C)
#pragma charmap (0xBD, 0x7D)
#pragma charmap (0xBE, 0x7E)
#pragma charmap (0xBF, 0x7F)
// Char $C0 ... $DF -> c - 128
#pragma charmap (0xC0, 0x40)
// Char $C1 ... $DA -> c - 128 - 64 (lower-case alphabet)
#pragma charmap (0xC1, 0x01)
#pragma charmap (0xC2, 0x02)
#pragma charmap (0xC3, 0x03)
#pragma charmap (0xC4, 0x04)
#pragma charmap (0xC5, 0x05)
#pragma charmap (0xC6, 0x06)
#pragma charmap (0xC7, 0x07)
#pragma charmap (0xC8, 0x08)
#pragma charmap (0xC9, 0x09)
#pragma charmap (0xCA, 0x0A)
#pragma charmap (0xCB, 0x0B)
#pragma charmap (0xCC, 0x0C)
#pragma charmap (0xCD, 0x0D)
#pragma charmap (0xCE, 0x0E)
#pragma charmap (0xCF, 0x0F)
#pragma charmap (0xD0, 0x10)
#pragma charmap (0xD1, 0x11)
#pragma charmap (0xD2, 0x12)
#pragma charmap (0xD3, 0x13)
#pragma charmap (0xD4, 0x14)
#pragma charmap (0xD5, 0x15)
#pragma charmap (0xD6, 0x16)
#pragma charmap (0xD7, 0x17)
#pragma charmap (0xD8, 0x18)
#pragma charmap (0xD9, 0x19)
#pragma charmap (0xDA, 0x1A)
// Char $DB ... $DF -> c - 128
#pragma charmap (0xDB, 0x5B)
#pragma charmap (0xDC, 0x5C)
#pragma charmap (0xDD, 0x5D)
#pragma charmap (0xDE, 0x5E)
#pragma charmap (0xDF, 0x5F)
// Char $E0 ... $FF -> c - 128
#pragma charmap (0xE0, 0x60)
#pragma charmap (0xE1, 0x61)
#pragma charmap (0xE2, 0x62)
#pragma charmap (0xE3, 0x63)
#pragma charmap (0xE4, 0x64)
#pragma charmap (0xE5, 0x65)
#pragma charmap (0xE6, 0x66)
#pragma charmap (0xE7, 0x67)
#pragma charmap (0xE8, 0x68)
#pragma charmap (0xE9, 0x69)
#pragma charmap (0xEA, 0x6A)
#pragma charmap (0xEB, 0x6B)
#pragma charmap (0xEC, 0x6C)
#pragma charmap (0xED, 0x6D)
#pragma charmap (0xEE, 0x6E)
#pragma charmap (0xEF, 0x6F)
#pragma charmap (0xF0, 0x70)
#pragma charmap (0xF1, 0x71)
#pragma charmap (0xF2, 0x72)
#pragma charmap (0xF3, 0x73)
#pragma charmap (0xF4, 0x74)
#pragma charmap (0xF5, 0x75)
#pragma charmap (0xF6, 0x76)
#pragma charmap (0xF7, 0x77)
#pragma charmap (0xF8, 0x78)
#pragma charmap (0xF9, 0x79)
#pragma charmap (0xFA, 0x7A)
#pragma charmap (0xFB, 0x7B)
#pragma charmap (0xFC, 0x7C)
#pragma charmap (0xFD, 0x7D)
#pragma charmap (0xFE, 0x7E)
#pragma charmap (0xFF, 0x7F)
#pragma warn (remap-zero, pop)

View File

@ -45,6 +45,10 @@ void __fastcall__ BitOtherClip(void *proc1, void *proc2, char skipl,
void __fastcall__ GraphicsString(char *myGfxString);
#ifdef __GEOS_CBM__
void SetNewMode(void);
#endif
/* VIC colour constants */
#define BLACK 0
#define WHITE 1

View File

@ -93,7 +93,7 @@ INSTALL = install
define INSTALL_recipe
$(if $(PREFIX),,$(error variable `PREFIX' must be set))
$(if $(PREFIX),,$(error variable "PREFIX" must be set))
$(INSTALL) -d $(DESTDIR)$(datadir)/$(dir)
$(INSTALL) -m0644 ../$(dir)/*.* $(DESTDIR)$(datadir)/$(dir)

View File

@ -44,15 +44,15 @@
.addr $0000
; Jump table
.addr INSTALL
.addr UNINSTALL
.addr OPEN
.addr CLOSE
.addr GET
.addr PUT
.addr STATUS
.addr IOCTL
.addr IRQ
.addr SER_INSTALL
.addr SER_UNINSTALL
.addr SER_OPEN
.addr SER_CLOSE
.addr SER_GET
.addr SER_PUT
.addr SER_STATUS
.addr SER_IOCTL
.addr SER_IRQ
;----------------------------------------------------------------------------
; I/O definitions
@ -141,23 +141,23 @@ IdTableLen = * - IdValTable
.code
;----------------------------------------------------------------------------
; INSTALL: Is called after the driver is loaded into memory. If possible,
; SER_INSTALL: Is called after the driver is loaded into memory. If possible,
; check if the hardware is present. Must return an SER_ERR_xx code in a/x.
;
; Since we don't have to manage the IRQ vector on the Apple II, this is
; actually the same as:
;
; UNINSTALL: Is called before the driver is removed from memory.
; SER_UNINSTALL: Is called before the driver is removed from memory.
; No return code required (the driver is removed from memory on return).
;
; and:
;
; CLOSE: Close the port and disable interrupts. Called without parameters.
; SER_CLOSE: Close the port and disable interrupts. Called without parameters.
; Must return an SER_ERR_xx code in a/x.
INSTALL:
UNINSTALL:
CLOSE:
SER_INSTALL:
SER_UNINSTALL:
SER_CLOSE:
ldx Index ; Check for open port
beq :+
@ -172,16 +172,16 @@ CLOSE:
rts
;----------------------------------------------------------------------------
; OPEN: A pointer to a ser_params structure is passed in ptr1.
; SER_OPEN: A pointer to a ser_params structure is passed in ptr1.
; Must return an SER_ERR_xx code in a/x.
OPEN:
SER_OPEN:
ldx #<$C000
stx ptr2
lda #>$C000
ora Slot
sta ptr2+1
; Check Pascal 1.1 Firmware Protocol ID bytes
: ldy IdOfsTable,x
lda IdValTable,x
@ -190,7 +190,7 @@ OPEN:
inx
cpx #IdTableLen
bcc :-
; Convert slot to I/O register index
lda Slot
asl
@ -273,11 +273,11 @@ InvBaud:lda #<SER_ERR_BAUD_UNAVAIL
rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
; SER_GET: Will fetch a character from the receive buffer and store it into the
; variable pointed to by ptr1. If no data is available, SER_ERR_NO_DATA is
; returned.
GET:
SER_GET:
ldx Index
ldy SendFreeCnt ; Send data if necessary
iny ; Y == $FF?
@ -315,10 +315,10 @@ GET:
rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; SER_PUT: Output character in A.
; Must return an SER_ERR_xx code in a/x.
PUT:
SER_PUT:
ldx Index
; Try to send
@ -348,10 +348,10 @@ PUT:
rts
;----------------------------------------------------------------------------
; STATUS: Return the status in the variable pointed to by ptr1.
; SER_STATUS: Return the status in the variable pointed to by ptr1.
; Must return an SER_ERR_xx code in a/x.
STATUS:
SER_STATUS:
ldx Index
lda ACIA_STATUS,x
ldx #$00
@ -360,11 +360,11 @@ STATUS:
rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; SER_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an SER_ERR_xx code in a/x.
IOCTL:
SER_IOCTL:
; Check data msb and code to be 0
ora ptr1+1
bne :+
@ -384,12 +384,12 @@ IOCTL:
rts
;----------------------------------------------------------------------------
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; SER_IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; registers are already saved, no parameters are passed, but the carry flag
; is clear on entry. The routine must return with carry set if the interrupt
; was handled, otherwise with carry clear.
IRQ:
SER_IRQ:
ldx Index ; Check for open port
beq Done
lda ACIA_STATUS,x ; Check ACIA status for receive interrupt
@ -431,7 +431,7 @@ Again: lda SendFreeCnt
lda ACIA_STATUS,x
and #$10
bne Send
bit tmp1 ; Keep trying if must try hard
bit tmp1 ; Keep trying if must try hard
bmi Again
Quit: rts

View File

@ -1,5 +1,5 @@
;
; Mark Keates, Christian Groessler
; Mark Keates, Christian Groessler, Piotr Fusik
;
; void cputcxy (unsigned char x, unsigned char y, char c);
; void cputc (char c);
@ -30,16 +30,13 @@ L4: cmp #$0A ; LF
cmp #ATEOL ; Atari-EOL?
beq newline
tay
rol a
rol a
rol a
rol a
and #3
tax
tya
and #$9f
ora ataint,x
asl a ; shift out the inverse bit
adc #$c0 ; grab the inverse bit; convert ATASCII to screen code
bpl codeok ; screen code ok?
eor #$40 ; needs correction
codeok: lsr a ; undo the shift
bcc cputdirect
eor #$80 ; restore the inverse bit
cputdirect: ; accepts screen code
jsr putchar
@ -89,6 +86,3 @@ putchar:
ldy COLCRS
sta (ptr4),y
jmp setcursor
.rodata
ataint: .byte 64,0,32,96

View File

@ -134,6 +134,7 @@ YPosWrk: .res 2
irq_enabled: .res 1 ; flag indicating that the high frequency polling interrupt is enabled
old_porta_vbi: .res 1 ; previous PORTA value of the VBI interrupt (IRQ)
how_long: .res 1 ; counter for how many VBI interrupts the mouse hasn't been moved
in_irq: .res 1 ; flag indicating high-frequency polling interrupt is active
.if .defined (AMIGA_MOUSE) .or .defined (ST_MOUSE)
dumx: .res 1
@ -145,11 +146,11 @@ oldval: .res 1
.endif
.ifndef __ATARIXL__
OldT1: .res 2
OldT2: .res 2
.else
.data
set_VTIMR1_handler:
set_VTIMR2_handler:
.byte $4C, 0, 0
.endif
@ -226,29 +227,29 @@ INSTALL:
; Setup pointer to wrapper install/deinstall function.
lda libref
sta set_VTIMR1_handler+1
sta set_VTIMR2_handler+1
lda libref+1
sta set_VTIMR1_handler+2
sta set_VTIMR2_handler+2
; Install my handler.
sec
lda #<T1Han
ldx #>T1Han
jsr set_VTIMR1_handler
lda #<T2Han
ldx #>T2Han
jsr set_VTIMR2_handler
.else
lda VTIMR1
sta OldT1
lda VTIMR1+1
sta OldT1+1
lda VTIMR2
sta OldT2
lda VTIMR2+1
sta OldT2+1
php
sei
lda #<T1Han
sta VTIMR1
lda #>T1Han
sta VTIMR1+1
lda #<T2Han
sta VTIMR2
lda #>T2Han
sta VTIMR2+1
plp
.endif
@ -257,20 +258,12 @@ INSTALL:
sta AUDCTL
lda #0
sta AUDC1
sta AUDC2
lda #15
sta AUDF1
sta AUDF2
sta STIMER
.if 0 ; the IRQ will now be dynamically enabled when the mouse is moved
lda POKMSK
ora #%00000001 ; timer 1 enable
sta POKMSK
sta IRQEN
sta irq_enabled
.endif
lda PORTA
and #$0f
sta old_porta_vbi
@ -290,23 +283,23 @@ UNINSTALL:
; uninstall timer irq routine
lda POKMSK
and #%11111110 ; timer 1 disable
and #%11111101 ; timer 2 disable
sta IRQEN
sta POKMSK
.ifdef __ATARIXL__
clc
jsr set_VTIMR1_handler
jsr set_VTIMR2_handler
.else
php
sei
lda OldT1
sta VTIMR1
lda OldT1+1
sta VTIMR1+1
lda OldT2
sta VTIMR2
lda OldT2+1
sta VTIMR2+1
plp
.endif
@ -503,7 +496,7 @@ IRQ: lda PORTA ; mouse port contents
; Turn mouse polling IRQ back on
lda POKMSK
ora #%00000001 ; timer 1 enable
ora #%00000010 ; timer 2 enable
sta POKMSK
sta IRQEN
sta irq_enabled
@ -533,7 +526,7 @@ IRQ: lda PORTA ; mouse port contents
sta irq_enabled
lda POKMSK
and #%11111110 ; timer 1 disable
and #%11111101 ; timer 2 disable
sta IRQEN
sta POKMSK
@ -620,13 +613,18 @@ IRQ: lda PORTA ; mouse port contents
;----------------------------------------------------------------------------
; T1Han: Local IRQ routine to poll mouse
; T2Han: Local IRQ routine to poll mouse
;
T1Han: lda CRITIC ; if CRITIC flag is set, disable the
T2Han: lda CRITIC ; if CRITIC flag is set, disable the
bne disable_me ; high frequency polling IRQ, in order
; not to interfere with SIO I/O (e.g.
; floppy access)
; floppy access or serial I/O)
lda in_irq ; handler entered again?
bne skip ; yes, ignore this interrupt
inc in_irq
cli ; enable IRQs so that we don't block them for too long
tya
pha
@ -803,6 +801,8 @@ mmexit: sty oldval
tax
pla
tay
dec in_irq
skip:
.ifdef __ATARIXL__
rts
.else
@ -819,7 +819,7 @@ mmexit: sty oldval
disable_me:
lda POKMSK
and #%11111110 ; timer 1 disable
and #%11111101 ; timer 2 disable
sta IRQEN
sta POKMSK
lda #0

View File

@ -5,8 +5,8 @@
.export mouse_libref
.ifdef __ATARIXL__
.import set_VTIMR1_handler
mouse_libref := set_VTIMR1_handler
.import set_VTIMR2_handler
mouse_libref := set_VTIMR2_handler
.else
.import _exit
mouse_libref := _exit

View File

@ -0,0 +1,81 @@
;
; Atari XL shadow RAM timer IRQ #2 handler
;
; Christian Groessler, chris@groessler.org, 2019
;
;DEBUG = 1
.ifdef __ATARIXL__
SHRAM_HANDLERS = 1
.include "atari.inc"
.include "romswitch.inc"
.export set_VTIMR2_handler
.segment "LOWBSS"
VTIMR2_handler: .res 3
.segment "BSS"
old_VTIMR2_handler:
.res 2
.segment "LOWCODE"
; timer interrupt handler:
; disable ROM, call user handler, enable ROM again
my_VTIMR2_handler:
disable_rom_quick
jsr VTIMR2_handler
enable_rom_quick
pla
rti
.segment "CODE"
; install or remove VTIMR2 handler
; input: CF - 0/1 for remove/install handler
; AX - pointer to handler (if CF=1)
; registers destroyed
set_VTIMR2_handler:
bcc @remove
; install vector
stx VTIMR2_handler+2
sta VTIMR2_handler+1 ; save passed vector in low memory
lda #$4C ; "JMP" opcode
sta VTIMR2_handler
lda VTIMR2
sta old_VTIMR2_handler
lda VTIMR2+1
sta old_VTIMR2_handler+1
lda #<my_VTIMR2_handler
php
sei
sta VTIMR2
lda #>my_VTIMR2_handler
sta VTIMR2+1
plp
rts
@remove: php
sei
lda old_VTIMR2_handler
sta VTIMR2
lda old_VTIMR2_handler+1
sta VTIMR2+1
plp
rts
.endif ; .ifdef __ATARIXL__

View File

@ -16,8 +16,7 @@
;DEBUG = 1
.export __SYSTEM_CHECK__: absolute = 1
.import __SYSCHK_LOAD__
.export __SYSTEM_CHECK__, __SYSCHK_END__
.import __STARTADDRESS__
; the following imports are only needed for the 'atari' target version
@ -25,10 +24,12 @@
.import __STACKSIZE__
.import __RESERVED_MEMORY__
; import our header and trailers
.forceimport __SYSCHKHDR__, __SYSCHKTRL__
.include "zeropage.inc"
.include "atari.inc"
.macro print_string text
.local start, cont
jmp cont
@ -229,25 +230,10 @@ delay1: ldx #0
.endproc
end:
__SYSTEM_CHECK__=syschk
__SYSCHK_END__:
.ifndef __ATARIXL__
tmp: ; outside of the load chunk, some kind of poor man's .bss
.endif
; ------------------------------------------------------------------------
; Chunk header
.segment "SYSCHKHDR"
.word __SYSCHK_LOAD__
.word end - 1
; ------------------------------------------------------------------------
; Chunk "trailer" - sets INITAD
.segment "SYSCHKTRL"
.word INITAD
.word INITAD+1
.word syschk

View File

@ -0,0 +1,16 @@
;
; Atari startup system check headers
;
; Christian Groessler, chris@groessler.org, 2013
;
.export __SYSCHKHDR__: absolute = 1
.import __SYSCHK_LOAD__, __SYSCHK_END__
; ------------------------------------------------------------------------
; Chunk header
.segment "SYSCHKHDR"
.word __SYSCHK_LOAD__
.word __SYSCHK_END__ - 1

View File

@ -0,0 +1,17 @@
;
; Atari startup system check headers
;
; Christian Groessler, chris@groessler.org, 2013
;
.export __SYSCHKTRL__: absolute = 1
.import __SYSTEM_CHECK__
.include "atari.inc"
; ------------------------------------------------------------------------
; Chunk "trailer" - sets INITAD
.segment "SYSCHKTRL"
.word INITAD
.word INITAD+1
.word __SYSTEM_CHECK__

View File

@ -22,13 +22,11 @@ static char C_dev[] = "C:";
static struct __iocb *findfreeiocb(void)
{
struct __iocb *iocb = &IOCB; /* first IOCB (#0) */
int i;
for (i = 0; i < 8; i++) {
if (iocb->handler == 0xff)
return iocb;
iocb++;
if (OS.iocb[i].handler == 0xff)
return &OS.iocb[i];
}
return NULL;
}
@ -52,7 +50,7 @@ int main(int argc, char **argv)
fprintf(stderr, "couldn't find a free iocb\n");
return 1;
}
iocb_num = (iocb - &IOCB) * 16;
iocb_num = (iocb - OS.iocb) * 16;
if (verbose)
printf("using iocb index $%02X ($%04X)\n", iocb_num, iocb);

View File

@ -1110,11 +1110,8 @@ skipm: ; Loop while --dy > 0
; locals
string := tmp1
cols := tmp3
pixels := tmp4
font := regsave
.rodata
ataint: .byte 64,0,32,96
.bss
rows: .res 1
@ -1222,32 +1219,31 @@ scvert: ldx x1
.endif
; Draw one character
; Convert to ANTIC code
draw: tay
rol a
rol a
rol a
rol a
and #3
tax
tya
and #$9f
ora ataint,x
; Save and clear inverse video bit
sta inv
and #$7F
draw:
; Extract the inverse mask
ldx #0
asl a
bcc noinv
dex
noinv: stx inv
; Calculate font data address
ldx CHBAS
cmp #$20*2
bpl lowhalf
; Semigraphic or lowercase
inx
inx
lowhalf:
asl a
bcc lowquarter
; Letter
inx
lowquarter:
asl a
sta font
lda #0
sta font + 1
stx font+1
.repeat 3
asl font
rol a
.endrepeat
adc CHBAS
sta font + 1
; Save old coords
bit text_dir
bpl hor
@ -1273,15 +1269,12 @@ cont: ldy #7
; Put one row of the glyph
putrow: sty rows
lda (font),y
bit inv
bpl noinv
eor #$FF
noinv: sta pixels
lda #7
sta cols
eor inv
sec
rol a
sta pixels
; Put one column of the row
putcol: asl pixels
bcc next_col
putcol: bcc next_col
lda x1
pha
lda x1 + 1
@ -1317,8 +1310,8 @@ vertinc:
sub mag_x
sta y2
L2:
dec cols
bpl putcol
asl pixels
bne putcol
next_row:
; Go to next row
bit text_dir

View File

@ -44,15 +44,15 @@
.addr $0000
; Jump table
.addr INSTALL
.addr UNINSTALL
.addr OPEN
.addr CLOSE
.addr GET
.addr PUT
.addr SER_INSTALL
.addr SER_UNINSTALL
.addr SER_OPEN
.addr SER_CLOSE
.addr SER_GET
.addr SER_PUT
.addr SER_STATUS
.addr IOCTL
.addr IRQ
.addr SER_IOCTL
.addr SER_IRQ
;----------------------------------------------------------------------------
; Global variables
@ -116,23 +116,23 @@ ParityTable:
.code
;----------------------------------------------------------------------------
; INSTALL: Is called after the driver is loaded into memory. If possible,
; SER_INSTALL: Is called after the driver is loaded into memory. If possible,
; check if the hardware is present. Must return an SER_ERR_xx code in a/x.
;
; Since we don't have to manage the IRQ vector on the Telestrat/Atmos, this is
; actually the same as:
;
; UNINSTALL: Is called before the driver is removed from memory.
; SER_UNINSTALL: Is called before the driver is removed from memory.
; No return code required (the driver is removed from memory on return).
;
; and:
;
; CLOSE: Close the port and disable interrupts. Called without parameters.
; SER_CLOSE: Close the port and disable interrupts. Called without parameters.
; Must return an SER_ERR_xx code in a/x.
INSTALL:
UNINSTALL:
CLOSE:
SER_INSTALL:
SER_UNINSTALL:
SER_CLOSE:
ldx Index ; Check for open port
beq :+
@ -147,10 +147,10 @@ CLOSE:
rts
;----------------------------------------------------------------------------
; OPEN: A pointer to a ser_params structure is passed in ptr1.
; SER_OPEN: A pointer to a ser_params structure is passed in ptr1.
; Must return an SER_ERR_xx code in a/x.
OPEN:
SER_OPEN:
; Check if the handshake setting is valid
ldy #SER_PARAMS::HANDSHAKE ; Handshake
lda (ptr1),y
@ -220,11 +220,11 @@ InvBaud:lda #<SER_ERR_BAUD_UNAVAIL
rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
; SER_GET: Will fetch a character from the receive buffer and store it into the
; variable pointed to by ptr1. If no data is available, SER_ERR_NO_DATA is
; returned.
GET:
SER_GET:
ldy SendFreeCnt ; Send data if necessary
iny ; Y == $FF?
beq :+
@ -261,10 +261,10 @@ GET:
rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; SER_PUT: Output character in A.
; Must return an SER_ERR_xx code in a/x.
PUT:
SER_PUT:
; Try to send
ldy SendFreeCnt
iny ; Y = $FF?
@ -303,22 +303,22 @@ SER_STATUS:
rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; SER_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an SER_ERR_xx code in a/x.
IOCTL:
SER_IOCTL:
lda #<SER_ERR_INV_IOCTL
ldx #>SER_ERR_INV_IOCTL
rts
;----------------------------------------------------------------------------
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; SER_IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; registers are already saved, no parameters are passed, but the carry flag
; is clear on entry. The routine must return with carry set if the interrupt
; was handled, otherwise with carry clear.
IRQ:
SER_IRQ:
ldx Index ; Check for open port
beq Done
lda ACIA::STATUS,x ; Check ACIA status for receive interrupt

View File

@ -10,6 +10,7 @@
.import cursor
.include "cbm_kernal.inc"
.include "c128.inc"
;--------------------------------------------------------------------------
@ -17,8 +18,8 @@
_cgetc: lda KEY_COUNT ; Get number of characters
bne L2 ; Jump if there are already chars waiting
; Switch on the cursor if needed. We MUST always switch the cursor on,
; before switching it off, because switching it off will restore the
; Switch on the cursor if needed. We MUST always switch the cursor on,
; before switching it off, because switching it off will restore the
; character attribute remembered when it was switched on. So just switching
; it off will restore the wrong character attribute.

View File

@ -6,9 +6,6 @@
.export _clrscr
.include "c128.inc"
.include "cbm_kernal.inc"
_clrscr = CLRSCR

View File

@ -9,8 +9,8 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import gotoxy
.import PLOT
.include "cbm_kernal.inc"
.include "c128.inc"
newline = NEWLINE
@ -85,4 +85,3 @@ plot: ldy CURS_X
; position in Y
putchar = $CC2F

View File

@ -25,6 +25,7 @@
.constructor initmainargs, 24
.import __argc, __argv
.include "cbm_kernal.inc"
.include "c128.inc"

View File

@ -45,15 +45,15 @@
; Jump table
.word INSTALL
.word UNINSTALL
.word OPEN
.word CLOSE
.word GET
.word PUT
.word STATUS
.word IOCTL
.word IRQ
.word SER_INSTALL
.word SER_UNINSTALL
.word SER_OPEN
.word SER_CLOSE
.word SER_GET
.word SER_PUT
.word SER_STATUS
.word SER_IOCTL
.word SER_IRQ
;----------------------------------------------------------------------------
; I/O definitions
@ -155,11 +155,11 @@ Vector := *+1
.reloc
;----------------------------------------------------------------------------
; INSTALL routine. Is called after the driver is loaded into memory. If
; SER_INSTALL routine. Is called after the driver is loaded into memory. If
; possible, check if the hardware is present.
; Must return an SER_ERR_xx code in a/x.
INSTALL:
SER_INSTALL:
; Deactivate DTR and disable 6551 interrupts
@ -192,10 +192,10 @@ SetNMI: sta NMIVec
rts
;----------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
; SER_UNINSTALL routine. Is called before the driver is removed from memory.
; Must return an SER_ERR_xx code in a/x.
UNINSTALL:
SER_UNINSTALL:
; Stop interrupts, drop DTR
@ -212,7 +212,7 @@ UNINSTALL:
; PARAMS routine. A pointer to a ser_params structure is passed in ptr1.
; Must return an SER_ERR_xx code in a/x.
OPEN:
SER_OPEN:
; Check if the handshake setting is valid
@ -283,11 +283,11 @@ InvBaud:
rts
;----------------------------------------------------------------------------
; CLOSE: Close the port, disable interrupts and flush the buffer. Called
; SER_CLOSE: Close the port, disable interrupts and flush the buffer. Called
; without parameters. Must return an error code in a/x.
;
CLOSE:
SER_CLOSE:
; Stop interrupts, drop DTR
@ -305,12 +305,13 @@ CLOSE:
rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
; SER_GET: Will fetch a character from the receive buffer and store it into the
; variable pointer to by ptr1. If no data is available, SER_ERR_NO_DATA is
; return.
;
GET: ldx SendFreeCnt ; Send data if necessary
SER_GET:
ldx SendFreeCnt ; Send data if necessary
inx ; X == $FF?
beq @L1
lda #$00
@ -349,11 +350,11 @@ GET: ldx SendFreeCnt ; Send data if necessary
rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; SER_PUT: Output character in A.
; Must return an error code in a/x.
;
PUT:
SER_PUT:
; Try to send
@ -383,23 +384,25 @@ PUT:
rts
;----------------------------------------------------------------------------
; STATUS: Return the status in the variable pointed to by ptr1.
; SER_STATUS: Return the status in the variable pointed to by ptr1.
; Must return an error code in a/x.
;
STATUS: lda ACIA_STATUS
SER_STATUS:
lda ACIA_STATUS
ldx #0
sta (ptr1,x)
txa ; SER_ERR_OK
rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; SER_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an error code in a/x.
;
IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
SER_IOCTL:
lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
ldx #>SER_ERR_INV_IOCTL
rts
@ -407,7 +410,7 @@ IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
; IRQ: Not used on the C128
;
IRQ = $0000
SER_IRQ = $0000
;----------------------------------------------------------------------------
;
@ -500,5 +503,3 @@ InitBuffers:
stx RecvFreeCnt
stx SendFreeCnt
rts

View File

@ -7,6 +7,7 @@
.export _cgetc
.import cursor
.include "cbm_kernal.inc"
.include "plus4.inc"

View File

@ -6,10 +6,6 @@
.export _clrscr
.include "plus4.inc"
.include "cbm_kernal.inc"
_clrscr = CLRSCR

View File

@ -7,6 +7,7 @@
.export _cgetc
.import cursor
.include "cbm_kernal.inc"
.include "c64.inc"
_cgetc: lda KEY_COUNT ; Get number of characters

View File

@ -6,9 +6,6 @@
.export _clrscr
.include "c64.inc"
.include "cbm_kernal.inc"
_clrscr = CLRSCR

View File

@ -24,6 +24,7 @@
.include "zeropage.inc"
.include "ser-kernel.inc"
.include "ser-error.inc"
.include "cbm_kernal.inc"
.include "c64.inc"
.macpack module
@ -45,15 +46,15 @@
; Jump table
.word INSTALL
.word UNINSTALL
.word OPEN
.word CLOSE
.word GET
.word PUT
.word STATUS
.word IOCTL
.word IRQ
.word SER_INSTALL
.word SER_UNINSTALL
.word SER_OPEN
.word SER_CLOSE
.word SER_GET
.word SER_PUT
.word SER_STATUS
.word SER_IOCTL
.word SER_IRQ
;----------------------------------------------------------------------------
; I/O definitions
@ -136,11 +137,11 @@ ParityTable:
.code
;----------------------------------------------------------------------------
; INSTALL routine. Is called after the driver is loaded into memory. If
; SER_INSTALL routine. Is called after the driver is loaded into memory. If
; possible, check if the hardware is present.
; Must return an SER_ERR_xx code in a/x.
INSTALL:
SER_INSTALL:
; Deactivate DTR and disable 6551 interrupts
@ -165,10 +166,10 @@ SetNMI: sta NMIVec
rts
;----------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.
; SER_UNINSTALL routine. Is called before the driver is removed from memory.
; Must return an SER_ERR_xx code in a/x.
UNINSTALL:
SER_UNINSTALL:
; Stop interrupts, drop DTR
@ -185,7 +186,7 @@ UNINSTALL:
; PARAMS routine. A pointer to a ser_params structure is passed in ptr1.
; Must return an SER_ERR_xx code in a/x.
OPEN:
SER_OPEN:
; Check if the handshake setting is valid
@ -256,11 +257,11 @@ InvBaud:
rts
;----------------------------------------------------------------------------
; CLOSE: Close the port, disable interrupts and flush the buffer. Called
; SER_CLOSE: Close the port, disable interrupts and flush the buffer. Called
; without parameters. Must return an error code in a/x.
;
CLOSE:
SER_CLOSE:
; Stop interrupts, drop DTR
@ -278,12 +279,13 @@ CLOSE:
rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
; SER_GET: Will fetch a character from the receive buffer and store it into the
; variable pointer to by ptr1. If no data is available, SER_ERR_NO_DATA is
; return.
;
GET: ldx SendFreeCnt ; Send data if necessary
SER_GET:
ldx SendFreeCnt ; Send data if necessary
inx ; X == $FF?
beq @L1
lda #$00
@ -322,11 +324,11 @@ GET: ldx SendFreeCnt ; Send data if necessary
rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; SER_PUT: Output character in A.
; Must return an error code in a/x.
;
PUT:
SER_PUT:
; Try to send
@ -356,31 +358,33 @@ PUT:
rts
;----------------------------------------------------------------------------
; STATUS: Return the status in the variable pointed to by ptr1.
; SER_STATUS: Return the status in the variable pointed to by ptr1.
; Must return an error code in a/x.
;
STATUS: lda ACIA_STATUS
SER_STATUS:
lda ACIA_STATUS
ldx #0
sta (ptr1,x)
txa ; SER_ERR_OK
rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; SER_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an error code in a/x.
;
IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
SER_IOCTL:
lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
ldx #>SER_ERR_INV_IOCTL
rts
rts
;----------------------------------------------------------------------------
; IRQ: Not used on the C64
; SER_IRQ: Not used on the C64
;
IRQ = $0000
SER_IRQ = $0000
;----------------------------------------------------------------------------
;
@ -476,4 +480,3 @@ InitBuffers:
stx RecvFreeCnt
stx SendFreeCnt
rts

View File

@ -11,6 +11,7 @@
.import cursor
.importzp tmp1
.include "cbm_kernal.inc"
.include "c64.inc"
.include "soft80.inc"

View File

@ -12,6 +12,7 @@
.import cursor
.importzp tmp1
.include "cbm_kernal.inc"
.include "c64.inc"
.include "soft80.inc"

View File

@ -46,15 +46,15 @@
; Jump table
.word INSTALL
.word UNINSTALL
.word OPEN
.word CLOSE
.word GET
.word PUT
.word STATUS
.word IOCTL
.word IRQ
.word SER_INSTALL
.word SER_UNINSTALL
.word SER_OPEN
.word SER_CLOSE
.word SER_GET
.word SER_PUT
.word SER_STATUS
.word SER_IOCTL
.word SER_IRQ
;----------------------------------------------------------------------------
;
@ -122,24 +122,24 @@ ParityTable:
.code
;----------------------------------------------------------------------------
; INSTALL routine. Is called after the driver is loaded into memory. If
; SER_INSTALL routine. Is called after the driver is loaded into memory. If
; possible, check if the hardware is present.
; Must return an SER_ERR_xx code in a/x.
;
; Since we don't have to manage the IRQ vector on the Plus/4, this is actually
; the same as:
;
; UNINSTALL routine. Is called before the driver is removed from memory.
; SER_UNINSTALL routine. Is called before the driver is removed from memory.
; Must return an SER_ERR_xx code in a/x.
; and:
;
; CLOSE: Close the port, disable interrupts and flush the buffer. Called
; SER_CLOSE: Close the port, disable interrupts and flush the buffer. Called
; without parameters. Must return an error code in a/x.
;
INSTALL:
UNINSTALL:
CLOSE:
SER_INSTALL:
SER_UNINSTALL:
SER_CLOSE:
; Deactivate DTR and disable 6551 interrupts
@ -156,7 +156,7 @@ CLOSE:
; PARAMS routine. A pointer to a ser_params structure is passed in ptr1.
; Must return an SER_ERR_xx code in a/x.
OPEN:
SER_OPEN:
; Check if the handshake setting is valid
@ -236,12 +236,13 @@ InvBaud:
rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
; SER_GET: Will fetch a character from the receive buffer and store it into the
; variable pointer to by ptr1. If no data is available, SER_ERR_NO_DATA is
; return.
;
GET: ldx SendFreeCnt ; Send data if necessary
SER_GET:
ldx SendFreeCnt ; Send data if necessary
inx ; X == $FF?
beq @L1
lda #$00
@ -280,11 +281,11 @@ GET: ldx SendFreeCnt ; Send data if necessary
rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; SER_PUT: Output character in A.
; Must return an error code in a/x.
;
PUT:
SER_PUT:
; Try to send
@ -314,11 +315,12 @@ PUT:
rts
;----------------------------------------------------------------------------
; STATUS: Return the status in the variable pointed to by ptr1.
; SER_STATUS: Return the status in the variable pointed to by ptr1.
; Must return an error code in a/x.
;
STATUS: lda #$0F
SER_STATUS:
lda #$0F
sta IndReg
ldy #ACIA::STATUS
lda (acia),y
@ -330,23 +332,25 @@ STATUS: lda #$0F
rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; SER_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an error code in a/x.
;
IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
SER_IOCTL:
lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
ldx #>SER_ERR_INV_IOCTL
rts
;----------------------------------------------------------------------------
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; SER_IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; registers are already save, no parameters are passed, but the carry flag
; is clear on entry. The routine must return with carry set if the interrupt
; was handled, otherwise with carry clear.
;
IRQ: lda #$0F
SER_IRQ:
lda #$0F
sta IndReg ; Switch to the system bank
ldy #ACIA::STATUS
lda (acia),y ; Check ACIA status for receive interrupt
@ -435,4 +439,3 @@ write: pha
lda ExecReg
sta IndReg
rts

View File

@ -46,15 +46,15 @@
; Jump table
.word INSTALL
.word UNINSTALL
.word OPEN
.word CLOSE
.word GET
.word PUT
.word STATUS
.word IOCTL
.word IRQ
.word SER_INSTALL
.word SER_UNINSTALL
.word SER_OPEN
.word SER_CLOSE
.word SER_GET
.word SER_PUT
.word SER_STATUS
.word SER_IOCTL
.word SER_IRQ
;----------------------------------------------------------------------------
;
@ -122,25 +122,25 @@ ParityTable:
.code
;----------------------------------------------------------------------------
; INSTALL routine. Is called after the driver is loaded into memory. If
; SER_INSTALL routine. Is called after the driver is loaded into memory. If
; possible, check if the hardware is present.
; Must return an SER_ERR_xx code in a/x.
;
; Since we don't have to manage the IRQ vector on the Plus/4, this is actually
; the same as:
;
; UNINSTALL routine. Is called before the driver is removed from memory.
; SER_UNINSTALL routine. Is called before the driver is removed from memory.
; Must return an SER_ERR_xx code in a/x.
;
; and:
;
; CLOSE: Close the port, disable interrupts and flush the buffer. Called
; SER_CLOSE: Close the port, disable interrupts and flush the buffer. Called
; without parameters. Must return an error code in a/x.
;
INSTALL:
UNINSTALL:
CLOSE:
SER_INSTALL:
SER_UNINSTALL:
SER_CLOSE:
; Deactivate DTR and disable 6551 interrupts
@ -157,7 +157,7 @@ CLOSE:
; PARAMS routine. A pointer to a ser_params structure is passed in ptr1.
; Must return an SER_ERR_xx code in a/x.
OPEN:
SER_OPEN:
; Check if the handshake setting is valid
@ -237,12 +237,13 @@ InvBaud:
rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
; SER_GET: Will fetch a character from the receive buffer and store it into the
; variable pointer to by ptr1. If no data is available, SER_ERR_NO_DATA is
; return.
;
GET: ldx SendFreeCnt ; Send data if necessary
SER_GET:
ldx SendFreeCnt ; Send data if necessary
inx ; X == $FF?
beq @L1
lda #$00
@ -281,11 +282,11 @@ GET: ldx SendFreeCnt ; Send data if necessary
rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; SER_PUT: Output character in A.
; Must return an error code in a/x.
;
PUT:
SER_PUT:
; Try to send
@ -315,11 +316,12 @@ PUT:
rts
;----------------------------------------------------------------------------
; STATUS: Return the status in the variable pointed to by ptr1.
; SER_STATUS: Return the status in the variable pointed to by ptr1.
; Must return an error code in a/x.
;
STATUS: lda #$0F
SER_STATUS:
lda #$0F
sta IndReg
ldy #ACIA::STATUS
lda (acia),y
@ -331,23 +333,25 @@ STATUS: lda #$0F
rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; SER_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an error code in a/x.
;
IOCTL: lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
SER_IOCTL:
lda #<SER_ERR_INV_IOCTL ; We don't support ioclts for now
ldx #>SER_ERR_INV_IOCTL
rts
;----------------------------------------------------------------------------
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; SER_IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; registers are already save, no parameters are passed, but the carry flag
; is clear on entry. The routine must return with carry set if the interrupt
; was handled, otherwise with carry clear.
;
IRQ: lda #$0F
SER_IRQ:
lda #$0F
sta IndReg ; Switch to the system bank
ldy #ACIA::STATUS
lda (acia),y ; Check ACIA status for receive interrupt
@ -436,4 +440,3 @@ write: pha
lda ExecReg
sta IndReg
rts

View File

@ -3,7 +3,7 @@
;
; unsigned char getcpu (void);
;
.include "zeropage.inc"
.export _getcpu
; ---------------------------------------------------------------------------
@ -17,6 +17,7 @@
; - carry set and 5 in A for a 65CE02
; - carry set and 6 in A for a HuC6280
; - carry clear and 7 in A for a 2a03/2a07
; - carry set and 8 in A for a 45GS02
;
; This function uses a $1A opcode which is a INA on the 816 and ignored
; (interpreted as a NOP) on a NMOS 6502. There are several CMOS versions
@ -26,52 +27,95 @@
.p816 ; Enable 65816 instructions
_getcpu:
lda #0
inc a ; .byte $1A ; nop on nmos, inc on every cmos
cmp #1
bcc @L8
bcc @IsNMOS
; This is at least a 65C02, check for a 65CE02/4510
.byte $42,$EA ; neg on 65CE02/4510, nop #$EA on 65C02, wdm $EA on 65816
cmp #1
beq @L6
beq @HasINCA
; This is at least a 65CE02, check for 4510
lda #5 ; CPU_65CE02 constant
ldx #0 ; to make sure MAP doesn't do anything, the upper nybl of X and Z must be clear
.byte $5C ; map on 4510, aug on 65CE02 (acts like 4 byte nop)
lda #3 ; CPU_4510 constant
nop
bne @L9
cmp #5
beq @LoadXAndReturn
; It is either a 4510 (C65) or a 45GS02 (MEGA65)
; 45GS02 supports 32-bit ZP indirect, so use that to check CPU type
; without requiring a functioning MEGA65 hypervisor.
; We setup a read of $200xx, then store a different value in $xx
; and then re-read $200xx to see if it is unchanged.
; Setup 32-bit pointer to $00020000+tmp1
lda #<$020000+tmp1
sta regsave
lda #>$020000+tmp1
sta regsave+1
sta regsave+3 ; also write to upper byte of pointer to save an extra LDA #$00
lda #^$020000+tmp1
sta regsave+2
; Prefixing LDA ($nn),Z with a NOP uses 32-bit ZP pointer on 45GS02,
; but normal 16-bit ZP pointer on 4510
; (We assume Z=$00, which will be the normal case)
nop ; prefix to tell next instruction to be 32-bit ZP
.byte $b2,regsave ; LDA (regsave),Z
eor #$ff ; change the value
sta tmp1 ; store in $xx
; now try again to load it: If the same, then 45GS02, as $200xx is unchanged
nop ; prefix to tell next instruction to be 32-bit ZP
.byte $b2,regsave ; LDA (regsave),Z
cmp tmp1 ; does the loaded value match what is in $xx?
bne @Is45GS02 ; $200xx and $xx have different values, so must be a MEGA65 45GS02
@Is4510:
lda #3 ; CPU_4510 constant
ldx #0 ; load high byte of word
rts
@Is45GS02:
lda #8 ; CPU_45GS02 constant
ldx #0 ; load high byte of word
rts
; 6502 type of cpu, check for a 2a03/2a07
@L8:
@IsNMOS:
sed ; set decimal mode, no decimal mode on the 2a03/2a07
lda #9
clc
adc #1 ; $01+$09 = $10 on 6502, $01+$09 = $0A on 2a03/2a07
cld
cmp #$0a
beq @L5
beq @Is2a03
lda #0 ; CPU_6502 constant
beq @L9
@L5:
beq @LoadXAndReturn
@Is2a03:
lda #7 ; CPU_2A0x constant
bne @L9
bne @LoadXAndReturn
; 65C02 cpu type, check for HuC6280
@L4: ldx #6 ; CPU_HUC6280 constant
@CheckHuC6280:
ldx #6 ; CPU_HUC6280 constant
.byte $22,$EA ; sax nop on HuC6280 (A=$06, X=$01), nop #$EA on 65C02 (A=$01, X=$06)
bne @L9
bne @LoadXAndReturn
; Check for 65816/65802
@L6: xba ; .byte $EB, put $01 in B accu (nop on 65C02/65SC02)
@HasINCA:
xba ; .byte $EB, put $01 in B accu (nop on 65C02/65SC02)
dec a ; .byte $3A, A=$00
xba ; .byte $EB, A=$01 if 65816/65802 and A=$00 if 65C02/65SC02
inc a ; .byte $1A, A=$02 if 65816/65802 and A=$01 if 65C02/65SC02
cmp #2
beq @L9
beq @LoadXAndReturn
; check for 65SC02
@ -82,9 +126,8 @@ _getcpu:
ldx $F7
sty $F7
cpx #$00
bne @L4
bne @CheckHuC6280
lda #4 ; CPU_65SC02 constant
@L9: ldx #0 ; Load high byte of word
@LoadXAndReturn:
ldx #0
rts

View File

@ -0,0 +1,18 @@
;
; Scott Hutter
;
; 18.12.18
; void SetNewMode(void);
.export _SetNewMode
.include "jumptab.inc"
.include "geossym.inc"
_SetNewMode:
lda graphMode
eor #$80
sta graphMode
jmp SetNewMode

View File

@ -1062,7 +1062,7 @@ SndSetValues:
ldx #4-1
set0: ldy SndOffsets,x
lda SndChannel+2,y
_IFNE ; flag == 0 => don`t set
_IFNE ; flag == 0 => don't set
bit #$80
_IFNE ;

View File

@ -25,15 +25,15 @@
.addr $0000
; Jump table
.addr INSTALL
.addr UNINSTALL
.addr OPEN
.addr CLOSE
.addr GET
.addr PUT
.addr STATUS
.addr IOCTL
.addr IRQ
.addr SER_INSTALL
.addr SER_UNINSTALL
.addr SER_OPEN
.addr SER_CLOSE
.addr SER_GET
.addr SER_PUT
.addr SER_STATUS
.addr SER_IOCTL
.addr SER_IRQ
;----------------------------------------------------------------------------
; Global variables
@ -54,25 +54,25 @@ TxDone: .res 1
.code
;----------------------------------------------------------------------------
; INSTALL: Is called after the driver is loaded into memory.
; SER_INSTALL: Is called after the driver is loaded into memory.
;
; Must return an SER_ERR_xx code in a/x.
INSTALL:
SER_INSTALL:
; Set up IRQ vector ?
;----------------------------------------------------------------------------
; UNINSTALL: Is called before the driver is removed from memory.
; SER_UNINSTALL: Is called before the driver is removed from memory.
; No return code required (the driver is removed from memory on return).
;
UNINSTALL:
SER_UNINSTALL:
;----------------------------------------------------------------------------
; CLOSE: Close the port and disable interrupts. Called without parameters.
; SER_CLOSE: Close the port and disable interrupts. Called without parameters.
; Must return an SER_ERR_xx code in a/x.
CLOSE:
SER_CLOSE:
; Disable interrupts
; Done, return an error code
lda #<SER_ERR_OK
@ -80,7 +80,7 @@ CLOSE:
rts
;----------------------------------------------------------------------------
; OPEN: A pointer to a ser_params structure is passed in ptr1.
; SER_OPEN: A pointer to a ser_params structure is passed in ptr1.
;
; The Lynx has only two correct serial data formats:
; 8 bits, parity mark, 1 stop bit
@ -101,7 +101,7 @@ CLOSE:
;
; Must return an SER_ERR_xx code in a/x.
OPEN:
SER_OPEN:
stz RxPtrIn
stz RxPtrOut
stz TxPtrIn
@ -247,11 +247,11 @@ invparameter:
rts
;----------------------------------------------------------------------------
; GET: Will fetch a character from the receive buffer and store it into the
; SER_GET: Will fetch a character from the receive buffer and store it into the
; variable pointed to by ptr1. If no data is available, SER_ERR_NO_DATA is
; returned.
GET:
SER_GET:
lda RxPtrIn
cmp RxPtrOut
bne GetByte
@ -260,7 +260,7 @@ GET:
rts
GetByte:
ldy RxPtrOut
lda RxBuffer,y
lda RxBuffer,y
inc RxPtrOut
ldx #$00
sta (ptr1,x)
@ -268,10 +268,10 @@ GetByte:
rts
;----------------------------------------------------------------------------
; PUT: Output character in A.
; SER_PUT: Output character in A.
; Must return an SER_ERR_xx code in a/x.
PUT:
SER_PUT:
tax
lda TxPtrIn
ina
@ -301,10 +301,10 @@ PutByte:
rts
;----------------------------------------------------------------------------
; STATUS: Return the status in the variable pointed to by ptr1.
; SER_STATUS: Return the status in the variable pointed to by ptr1.
; Must return an SER_ERR_xx code in a/x.
STATUS:
SER_STATUS:
ldy SerialStat
ldx #$00
sta (ptr1,x)
@ -312,17 +312,17 @@ STATUS:
rts
;----------------------------------------------------------------------------
; IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; SER_IOCTL: Driver defined entry point. The wrapper will pass a pointer to ioctl
; specific data in ptr1, and the ioctl code in A.
; Must return an SER_ERR_xx code in a/x.
IOCTL:
SER_IOCTL:
lda #<SER_ERR_INV_IOCTL
ldx #>SER_ERR_INV_IOCTL
rts
;----------------------------------------------------------------------------
; IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; SER_IRQ: Called from the builtin runtime IRQ handler as a subroutine. All
; registers are already saved, no parameters are passed, but the carry flag
; is clear on entry. The routine must return with carry set if the interrupt
; was handled, otherwise with carry clear.
@ -330,7 +330,7 @@ IOCTL:
; Both the Tx and Rx interrupts are level sensitive instead of edge sensitive.
; Due to this bug you have to disable the interrupt before clearing it.
IRQ:
SER_IRQ:
lda INTSET ; Poll all pending interrupts
and #SERIAL_INTERRUPT
bne @L0
@ -411,4 +411,3 @@ IRQ:
@IRQexit:
clc
rts

View File

@ -7,6 +7,7 @@
.export _cgetc
.import cursor
.include "cbm_kernal.inc"
.include "plus4.inc"
; --------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More