diff --git a/asminc/atari.inc b/asminc/atari.inc index 98c721296..7c46b3252 100644 --- a/asminc/atari.inc +++ b/asminc/atari.inc @@ -831,6 +831,104 @@ PDVS = $D1FF ;##rev2## parallel device select POKEY = $D200 ;POKEY area .include "atari_pokey.inc" +; POKEY KBCODE Values + +KEY_NONE = $FF + +KEY_0 = $32 +KEY_1 = $1F +KEY_2 = $1E +KEY_3 = $1A +KEY_4 = $18 +KEY_5 = $1D +KEY_6 = $1B +KEY_7 = $33 +KEY_8 = $35 +KEY_9 = $30 + +KEY_A = $3F +KEY_B = $15 +KEY_C = $12 +KEY_D = $3A +KEY_E = $2A +KEY_F = $38 +KEY_G = $3D +KEY_H = $39 +KEY_I = $0D +KEY_J = $01 +KEY_K = $05 +KEY_L = $00 +KEY_M = $25 +KEY_N = $23 +KEY_O = $08 +KEY_P = $0A +KEY_Q = $2F +KEY_R = $28 +KEY_S = $3E +KEY_T = $2D +KEY_U = $0B +KEY_V = $10 +KEY_W = $2E +KEY_X = $16 +KEY_Y = $2B +KEY_Z = $17 + +KEY_COMMA = $20 +KEY_PERIOD = $22 +KEY_SLASH = $26 +KEY_SEMICOLON = $02 +KEY_PLUS = $06 +KEY_ASTERISK = $07 +KEY_DASH = $0E +KEY_EQUALS = $0F +KEY_LESSTHAN = $36 +KEY_GREATERTHAN = $37 + +KEY_ESC = $1C +KEY_TAB = $2C +KEY_SPACE = $21 +KEY_RETURN = $0C +KEY_DELETE = $34 +KEY_CAPS = $3C +KEY_INVERSE = $27 +KEY_HELP = $11 + +KEY_F1 = $03 +KEY_F2 = $04 +KEY_F3 = $13 +KEY_F4 = $14 + +KEY_SHIFT = $40 +KEY_CTRL = $80 + +; Composed keys + +KEY_EXCLAMATIONMARK = KEY_1 | KEY_SHIFT +KEY_QUOTE = KEY_2 | KEY_SHIFT +KEY_HASH = KEY_3 | KEY_SHIFT +KEY_DOLLAR = KEY_4 | KEY_SHIFT +KEY_PERCENT = KEY_5 | KEY_SHIFT +KEY_AMPERSAND = KEY_6 | KEY_SHIFT +KEY_APOSTROPHE = KEY_7 | KEY_SHIFT +KEY_AT = KEY_8 | KEY_SHIFT +KEY_OPENINGPARAN = KEY_9 | KEY_SHIFT +KEY_CLOSINGPARAN = KEY_0 | KEY_SHIFT +KEY_UNDERLINE = KEY_DASH | KEY_SHIFT +KEY_BAR = KEY_EQUALS | KEY_SHIFT +KEY_COLON = KEY_SEMICOLON | KEY_SHIFT +KEY_BACKSLASH = KEY_PLUS | KEY_SHIFT +KEY_CIRCUMFLEX = KEY_ASTERISK | KEY_SHIFT +KEY_OPENINGBRACKET = KEY_COMMA | KEY_SHIFT +KEY_CLOSINGBRACKET = KEY_PERIOD | KEY_SHIFT +KEY_QUESTIONMARK = KEY_SLASH | KEY_SHIFT +KEY_CLEAR = KEY_LESSTHAN | KEY_SHIFT +KEY_INSERT = KEY_GREATERTHAN | KEY_SHIFT + +KEY_UP = KEY_UNDERLINE | KEY_CTRL +KEY_DOWN = KEY_EQUALS | KEY_CTRL +KEY_LEFT = KEY_PLUS | KEY_CTRL +KEY_RIGHT = KEY_ASTERISK | KEY_CTRL + ;------------------------------------------------------------------------- ; ANTIC Address Equates ;------------------------------------------------------------------------- diff --git a/asminc/atari_pokey.inc b/asminc/atari_pokey.inc index 99d192fbd..4174865d5 100644 --- a/asminc/atari_pokey.inc +++ b/asminc/atari_pokey.inc @@ -41,4 +41,3 @@ POTGO = POKEY + $0B ;start potentiometer scan sequence SEROUT = POKEY + $0D ;serial port output IRQEN = POKEY + $0E ;IRQ interrupt enable SKCTL = POKEY + $0F ;serial port and keyboard control - diff --git a/asminc/c128.inc b/asminc/c128.inc index 7a98d770c..2852631f3 100644 --- a/asminc/c128.inc +++ b/asminc/c128.inc @@ -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 diff --git a/asminc/c64.inc b/asminc/c64.inc index c12f8e64b..1d10f673d 100644 --- a/asminc/c64.inc +++ b/asminc/c64.inc @@ -37,14 +37,6 @@ KBDREPEAT := $28a KBDREPEATRATE := $28b KBDREPEATDELAY := $28c -; --------------------------------------------------------------------------- -; Kernal routines - -; Direct entries -CLRSCR := $E544 -KBDREAD := $E5B4 -NMIEXIT := $FEBC - ; --------------------------------------------------------------------------- ; Vector and other locations diff --git a/asminc/cbm_kernal.inc b/asminc/cbm_kernal.inc index 4e2e927e4..29a6e5ddf 100644 --- a/asminc/cbm_kernal.inc +++ b/asminc/cbm_kernal.inc @@ -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 diff --git a/asminc/plus4.inc b/asminc/plus4.inc index 5ea4dcf88..774722e93 100644 --- a/asminc/plus4.inc +++ b/asminc/plus4.inc @@ -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 - - diff --git a/asminc/ser-kernel.inc b/asminc/ser-kernel.inc index 3ddb7f300..546587515 100644 --- a/asminc/ser-kernel.inc +++ b/asminc/ser-kernel.inc @@ -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 - diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc index 9d7949920..c4dc509a3 100644 --- a/asminc/telestrat.inc +++ b/asminc/telestrat.inc @@ -73,7 +73,9 @@ XLPRBI := $48 ; Printer flag (b7) HRSX40 := $49 HRSX6 := $4A + ADHRS := $4B ; hires screen address (word) + HRS1 := $4D HRS2 := $4F HRS3 := $51 @@ -229,8 +231,10 @@ 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 @@ -299,6 +303,7 @@ 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 @@ -314,10 +319,12 @@ 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 @@ -335,15 +342,16 @@ 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 @@ -371,6 +379,7 @@ FLGRST := $2EE CSRND := $2EF VNMI := $2F4 ADIODB_VECTOR := $2f7 ; 3 bytes length + IRQVECTOR := $2FA VAPLIC := $2FD @@ -459,6 +468,59 @@ XPBUF1 := $FFA4 XPMAP := $FFA7 XRWTS := $FFAA +; --------------------------------------------------------------------------- +; Stratsed vectors +; Stratsed is the main OS for Telestrat +XMERGE := $FF0E +XFST := $FF11 +XSPUT := $FF14 +XSTAKE := $FF17 +XTAKE := $FF20 +XOPENS := $FF1A ; XOPEN from Stratsed +XCLOSES := $FF1D ; XCLOSE from Stratsed +XPUT := $FF23 +XREWIN := $FF29 +XJUMP := $FF2C +XLGBUF := $FF2F +XERVEC := $FF32 +XESAVE := $FF35 +XCOPY := $FF38 +XDNAME := $FF3B +XSTATU := $FF3E +XUPDAT := $FF41 +XFORMA := $FF44 +XDELBK := $FF4A +XDELN := $FF4D +XPROT := $FF50 +XUNPRO := $FF53 +XDIRN := $FF56 +XBKP := $FF59 +XINITI := $FF5C +XERREU := $FF5F +XLOAD := $FF62 +XDEFSA := $FF65 +XDEFLO := $FF68 +XSAVE := $FF6B +XNOMDE := $FF6E +XCREAY := $FF71 +XDETSE := $FF74 +XLIBSE := $FF77 +XTRVCA := $FF7A +XTRVNM := $FF7D +XTRVNX := $FF80 +XBUCA := $FF86 +XVBUF1 := $FF89 +XSVSEC := $FF8C +XSAY := $FF8F +XSBUF1 := $FF92 +XSBUF2 := $FF95 +XSBUF3 := $FF98 +XSCAT := $FF9B +XPRSEC := $FFA1 +XPBUF1 := $FFA4 +XPMAP := $FFA7 +XRWTS := $FFAA + ; --------------------------------------------------------------------------- ; MACRO diff --git a/asminc/vic20.inc b/asminc/vic20.inc index 6ac7ef35c..b82874f56 100644 --- a/asminc/vic20.inc +++ b/asminc/vic20.inc @@ -41,13 +41,6 @@ KBDREPEATDELAY := $28c XSIZE = 22 YSIZE = 23 -; --------------------------------------------------------------------------- -; Kernal routines - -; Direct entries -CLRSCR := $E55F -KBDREAD := $E5CF - ; --------------------------------------------------------------------------- ; Vector and other locations @@ -59,9 +52,25 @@ NMIVec := $0318 ; I/O: 6560 VIC VIC := $9000 -VIC_LINES := $9003 ; Screen lines, bit 7 is bit 0 from VIC_HLINE -VIC_HLINE := $9004 ; Rasterline, bits 1-8 -VIC_COLOR := $900F ; Border and background color +VIC_CR0 := VIC+$0 +VIC_CR1 := VIC+$1 +VIC_CR2 := VIC+$2 +VIC_CR3 := VIC+$3 +VIC_LINES := VIC+$3 ; Screen lines, bit 7 is bit 0 from VIC_HLINE +VIC_CR4 := VIC+$4 +VIC_HLINE := VIC+$4 ; Rasterline, bits 1-8 +VIC_CR5 := VIC+$5 +VIC_CR6 := VIC+$6 +VIC_CR7 := VIC+$7 +VIC_CR8 := VIC+$8 +VIC_CR9 := VIC+$9 +VIC_CRA := VIC+$A +VIC_CRB := VIC+$B +VIC_CRC := VIC+$C +VIC_CRD := VIC+$D +VIC_CRE := VIC+$E +VIC_CRF := VIC+$F +VIC_COLOR := VIC+$F ; Border and background color ; --------------------------------------------------------------------------- ; I/O: 6522 VIA1 diff --git a/cfg/geos-apple.cfg b/cfg/geos-apple.cfg index 2c9f6c589..98dcfb5aa 100644 --- a/cfg/geos-apple.cfg +++ b/cfg/geos-apple.cfg @@ -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__; diff --git a/cfg/geos-cbm.cfg b/cfg/geos-cbm.cfg index d2e896fa5..4bf33fdf5 100644 --- a/cfg/geos-cbm.cfg +++ b/cfg/geos-cbm.cfg @@ -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__; diff --git a/cfg/plus4.cfg b/cfg/plus4.cfg index 802f1076e..b7199e008 100644 --- a/cfg/plus4.cfg +++ b/cfg/plus4.cfg @@ -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; diff --git a/doc/Makefile b/doc/Makefile index 33b5c2686..bb8f551ad 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -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) diff --git a/doc/apple2.sgml b/doc/apple2.sgml index aa3089957..ac5059902 100644 --- a/doc/apple2.sgml +++ b/doc/apple2.sgml @@ -469,25 +469,47 @@ BASIC.SYSTEM) there are some limitations for DOS 3.3: Direct console I/O

- - -

+The Apple ][ has no color text mode. Therefore the functions +Random number generator

- +The random number seed is generated from the time the program waits for user input. +Therefore it is necessary to wait for at least one user keypress either via Standard +I/O or via Direct console I/O before initializing the pseudo random number generator. -

+Realtime clock

+ +There are several types of realtime clocks. It's not desirable to have specific code +for all of them. As ProDOS 8 supports file timestamps, realtime clock owners usually +use ProDOS 8 drivers for their realtime clock. Those drivers read the realtime clock +and write the result to the date/time location in RAM ($BF90 to $BF93). +ProDOS 8 reads the date/time from that RAM location. If there's no realtime clock the +RAM location keeps containing zeros. ProDOS 8 uses those zeros as timestamps and the +files show up in a directory as Direct console I/O

- - -

+The enhanced Apple //e has no color text mode. Therefore the functions +Random number generator

- +The random number seed is generated from the time the program waits for user input. +Therefore it is necessary to wait for at least one user keypress either via Standard +I/O or via Direct console I/O before initializing the pseudo random number generator. -

+Realtime clock

+ +There are several types of realtime clocks. It's not desirable to have specific code +for all of them. As ProDOS 8 supports file timestamps, realtime clock owners usually +use ProDOS 8 drivers for their realtime clock. Those drivers read the realtime clock +and write the result to the date/time location in RAM ($BF90 to $BF93). +ProDOS 8 reads the date/time from that RAM location. If there's no realtime clock the +RAM location keeps containing zeros. ProDOS 8 uses those zeros as timestamps and the +files show up in a directory as -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 -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. @@ -65,9 +65,9 @@ Modules names in the library are stored without the path, so, using ar65 v v r mysubs.lib ofiles/sub1.o ofiles/sub2.o -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 -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 -Using the `x' command, you may extract modules from the library. The +Using the -The `V' command prints the version number of the assembler. If you send +The , it is +, it is recommended to use the @@ -411,6 +411,29 @@ char* pcAtasciiMappingString = "Hello Atari!"; does not. +Keyboard codes

+ +For direct keyboard scanning in conjunction with e.g. the OS location "CH" (764/$2FC), +all keyboard codes are available as defined values on C and assembler side. + +Example: + +... + while (!kbhit()); + switch (PEEK(764)) + { + case KEY_RETURN: + ... + case KEY_SPACE: + ... + case KEY_1: + ... + } +... + + +You can find the C defines in the file "Loadable drivers

@@ -611,7 +634,18 @@ interface module. Limitations

- limitations

Compile with @@ -1008,16 +1042,16 @@ FEATURES { New contents for NEXEHDR and CHKHDR are needed (split2.s): - .import __STARTUP_LOAD__, __BSS_LOAD__, __DATA_SIZE__ - .import __DATA_LOAD__, __RODATA_LOAD__ + .import __STARTUP_LOAD__, __BSS_LOAD__, __DATA_SIZE__ + .import __DATA_LOAD__, __RODATA_LOAD__ - .segment "NEXEHDR" - .word __RODATA_LOAD__ - .word __DATA_LOAD__ + __DATA_SIZE__ - 1 + .segment "NEXEHDR" + .word __RODATA_LOAD__ + .word __DATA_LOAD__ + __DATA_SIZE__ - 1 - .segment "CHKHDR" - .word __STARTUP_LOAD__ - .word __BSS_LOAD__ - 1 + .segment "CHKHDR" + .word __STARTUP_LOAD__ + .word __BSS_LOAD__ - 1 Compile with @@ -1048,7 +1082,7 @@ If you are using a customized linker config file you might get some errors regarding the MAINHDR segment. Like this: -ld65: Error: Missing memory area assignment for segment `MAINHDR' +ld65: Error: Missing memory area assignment for segment 'MAINHDR' The old "HEADER" memory description contained six bytes: $FFFF @@ -1096,14 +1130,14 @@ including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - 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. - Altered source versions must be plainly marked as such, and must not - be misrepresented as being the original software. - This notice may not be removed or altered from any source - distribution. + 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. + Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + This notice may not be removed or altered from any source + distribution. diff --git a/doc/c128.sgml b/doc/c128.sgml index dd9af2d6b..82c280ef0 100644 --- a/doc/c128.sgml +++ b/doc/c128.sgml @@ -339,6 +339,13 @@ The default drivers, Limitations

+Realtime clock

+ +The realtime clock functions use the CIA1 TOD clock. As that clock only stores +the time but not the date, the date set by Other hints

diff --git a/doc/c64.sgml b/doc/c64.sgml index 328a77ab6..37ac0c146 100644 --- a/doc/c64.sgml +++ b/doc/c64.sgml @@ -418,6 +418,13 @@ The default drivers, Limitations

+Realtime clock

+ +The realtime clock functions use the CIA1 TOD clock. As that clock only stores +the time but not the date, the date set by Other hints

diff --git a/doc/ca65.sgml b/doc/ca65.sgml index 52e9634ae..e0566fda4 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -2730,7 +2730,7 @@ Here's a list of all control commands and a description, what they do: at_in_identifiers - Accept the at character (`@') as a valid character in identifiers. The + Accept the at character ('@') as a valid character in identifiers. The at character is not allowed to start an identifier, even with this feature enabled. @@ -2765,13 +2765,13 @@ Here's a list of all control commands and a description, what they do: dollar_in_identifiers - Accept the dollar sign (`$') as a valid character in identifiers. The + Accept the dollar sign ('$') as a valid character in identifiers. The dollar character is not allowed to start an identifier, even with this feature enabled. dollar_is_pc - The dollar sign may be used as an alias for the star (`*'), which + The dollar sign may be used as an alias for the star ('*'), which gives the value of the current PC in expressions. Note: Assignment to the pseudo variable is not allowed. @@ -2789,7 +2789,7 @@ Here's a list of all control commands and a description, what they do: leading_dot_in_identifiers - Accept the dot (`.') as the first character of an identifier. This may be + Accept the dot ('.') as the first character of an identifier. This may be used for example to create macro names that start with a dot emulating control directives of other assemblers. Note however, that none of the reserved keywords built into the assembler, that starts with a dot, may be @@ -2825,12 +2825,30 @@ Here's a list of all control commands and a description, what they do: pc_assignment - Allow assignments to the PC symbol (`*' or `$' if command (which is usually not needed, so just removing the lines with the assignments may also be an option when porting code written for older assemblers). + string_escapes + + Allow C-style backslash escapes within string constants to embed + special characters. The following escapes are accepted: + + +\\ backslash ($5C) +\' single quote ($27) +\" double quote ($22) +\t tab ($09) +\r carriage return ($0D) +\n newline ($0A) +\xNN ($NN) + + + Note that \n maps to ASCII $0A, not a platform specific + line ending character. + ubiquitous_idents Allow the use of instructions names as names for macros and symbols. This @@ -3799,7 +3817,7 @@ Here's a list of all control commands and a description, what they do: page and direct (short) addressing is possible for data in this segment. Beware: Only labels in a segment with the zeropage attribute are marked - as reachable by short addressing. The `*' (PC counter) operator will + as reachable by short addressing. The '*' (PC counter) operator will work as in other segments and will create absolute variable values. Please note that a segment cannot have two different address sizes. A diff --git a/doc/cbm510.sgml b/doc/cbm510.sgml index 5c7c0f767..600a1fe90 100644 --- a/doc/cbm510.sgml +++ b/doc/cbm510.sgml @@ -242,6 +242,13 @@ The default drivers, Limitations

+Realtime clock

+ +The realtime clock functions use the CIA1 TOD clock. As that clock only stores +the time but not the date, the date set by Kernal and hardware access

Since the program runs in bank 0, and the kernal and all I/O chips are located diff --git a/doc/cbm610.sgml b/doc/cbm610.sgml index c1faefd51..68b1060ad 100644 --- a/doc/cbm610.sgml +++ b/doc/cbm610.sgml @@ -224,6 +224,13 @@ No mouse drivers are currently available for the Commodore 610. Limitations

+Realtime clock

+ +The realtime clock functions use the CIA1 TOD clock. As that clock only stores +the time but not the date, the date set by Kernal and hardware access

Since the program runs in bank 1, and the kernal and all I/O chips are located diff --git a/doc/cl65.sgml b/doc/cl65.sgml index ef7309eec..c6761ed9e 100644 --- a/doc/cl65.sgml +++ b/doc/cl65.sgml @@ -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 diff --git a/doc/funcref.sgml b/doc/funcref.sgml index ade7a855f..bfd687b6f 100644 --- a/doc/funcref.sgml +++ b/doc/funcref.sgml @@ -2587,7 +2587,7 @@ changing values. (See the description of / is not +If the / is not a multiple of , - +, @@ -2637,7 +2637,7 @@ retrieved value may not be valid. See also the platform-specific information. -/ / - -Hardware access

- -The following pseudo variables declared in the - -

- - Loadable drivers

@@ -159,6 +149,3 @@ freely, subject to the following restrictions: - - - diff --git a/doc/geos.sgml b/doc/geos.sgml index 8e50a2605..eb8d74939 100644 --- a/doc/geos.sgml +++ b/doc/geos.sgml @@ -48,7 +48,7 @@ changed between -For Functions from the headers above are either standard C library functions or cc65-specific, in either case they are not GEOS specific and so they are not described here. @@ -188,6 +188,14 @@ are covered by new names, but I tried to keep them in the naming convention.

This section covers the drawing package of GEOS along with text output routines. +SetNewMode +

+ +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 SetPattern

-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 -Loaded `samples/gunzip65' at $0200-$151F +Loaded 'samples/gunzip65' at $0200-$151F PVWrite ($0001, $13C9, $000F) GZIP file name:PVWrite ($0001, $151F, $0001) diff --git a/doc/telestrat.sgml b/doc/telestrat.sgml index 97229db00..1c0b3d954 100644 --- a/doc/telestrat.sgml +++ b/doc/telestrat.sgml @@ -192,6 +192,7 @@ port cardridge. Joystick drivers

+ Telemon 2.4 & 3.0 manages joysticks but it had been handled yet. This means that @@ -200,26 +201,24 @@ 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. - - Mouse drivers

+ Telestrat manages also mouse, but it had been no handled yet in this version. Telestrat mouse is really difficult to find. - RS232 device drivers

+ 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) - Limitations

diff --git a/include/6502.h b/include/6502.h index 642a608a8..4a27b706e 100644 --- a/include/6502.h +++ b/include/6502.h @@ -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 */ diff --git a/include/_antic.h b/include/_antic.h index 23a72609c..717f7f820 100644 --- a/include/_antic.h +++ b/include/_antic.h @@ -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 */ /* 24-Jan-2011: Christian Krueger: Added defines for Antic instruction set */ +/* 2019-01-16: Bill Kendrick : 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) */ -#define DL_JMP (unsigned char) 1 -#define DL_JVB (unsigned char) 65 +/* Initialized to 0x22: DMA fetch, normal playfield, no PMG DMA, double-line PMGs */ -#define DL_BLK1 (unsigned char) 0 -#define DL_BLK2 (unsigned char) 16 -#define DL_BLK3 (unsigned char) 32 -#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 +/* 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) */ -/* 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) */ +/* Other options: */ -#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) */ +/* 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 -/* 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) +/* 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) /* 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) */ + +/* 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 */ diff --git a/include/_gtia.h b/include/_gtia.h index 0542efa2f..ae3e69445 100644 --- a/include/_gtia.h +++ b/include/_gtia.h @@ -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 */ +/* 2019-01-16: Bill Kendrick : 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 */ - diff --git a/include/_pia.h b/include/_pia.h index 867c8f8a5..8c9fa01f1 100644 --- a/include/_pia.h +++ b/include/_pia.h @@ -4,9 +4,14 @@ /* */ /* 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 */ +/* 2019-01-17: Bill Kendrick : Defines for registers */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -34,7 +39,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 */ @@ -43,9 +48,119 @@ struct __pia { }; +/*****************************************************************************/ +/* PORTA and PORTB register bits */ +/*****************************************************************************/ + +/* 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 _pia.h */ #endif - - - diff --git a/include/_pokey.h b/include/_pokey.h index df10eac3f..88d6949aa 100644 --- a/include/_pokey.h +++ b/include/_pokey.h @@ -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 */ +/* 2019-01-16: Bill Kendrick : 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 */ @@ -73,6 +193,28 @@ struct __pokey_read { unsigned char skstat; /* serial port status */ }; + +/*****************************************************************************/ +/* (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 */ - diff --git a/include/atari.h b/include/atari.h index ca6bd424c..e06967ff9 100644 --- a/include/atari.h +++ b/include/atari.h @@ -6,9 +6,10 @@ /* */ /* */ /* */ -/* (C) 2000-2018 Mark Keates */ +/* (C) 2000-2019 Mark Keates */ /* Freddy Offenga */ /* Christian Groessler */ +/* Bill Kendrick */ /* */ /* */ /* This software is provided 'as-is', without any expressed or implied */ @@ -44,7 +45,10 @@ -/* Character codes */ +/*****************************************************************************/ +/* Character codes */ +/*****************************************************************************/ + #define CH_DELCHR 0xFE /* delete char under the cursor */ #define CH_ENTER 0x9B #define CH_ESC 0x1B @@ -86,70 +90,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,18 +104,141 @@ #define JOY_FIRE_MASK JOY_BTN_1_MASK #define JOY_FIRE(v) ((v) & JOY_FIRE_MASK) -/* color register functions */ + +/*****************************************************************************/ +/* Keyboard values returned by kbcode / CH */ +/*****************************************************************************/ + +#define KEY_NONE ((unsigned char) 0xFF) + +#define KEY_0 ((unsigned char) 0x32) +#define KEY_1 ((unsigned char) 0x1F) +#define KEY_2 ((unsigned char) 0x1E) +#define KEY_3 ((unsigned char) 0x1A) +#define KEY_4 ((unsigned char) 0x18) +#define KEY_5 ((unsigned char) 0x1D) +#define KEY_6 ((unsigned char) 0x1B) +#define KEY_7 ((unsigned char) 0x33) +#define KEY_8 ((unsigned char) 0x35) +#define KEY_9 ((unsigned char) 0x30) + +#define KEY_A ((unsigned char) 0x3F) +#define KEY_B ((unsigned char) 0x15) +#define KEY_C ((unsigned char) 0x12) +#define KEY_D ((unsigned char) 0x3A) +#define KEY_E ((unsigned char) 0x2A) +#define KEY_F ((unsigned char) 0x38) +#define KEY_G ((unsigned char) 0x3D) +#define KEY_H ((unsigned char) 0x39) +#define KEY_I ((unsigned char) 0x0D) +#define KEY_J ((unsigned char) 0x01) +#define KEY_K ((unsigned char) 0x05) +#define KEY_L ((unsigned char) 0x00) +#define KEY_M ((unsigned char) 0x25) +#define KEY_N ((unsigned char) 0x23) +#define KEY_O ((unsigned char) 0x08) +#define KEY_P ((unsigned char) 0x0A) +#define KEY_Q ((unsigned char) 0x2F) +#define KEY_R ((unsigned char) 0x28) +#define KEY_S ((unsigned char) 0x3E) +#define KEY_T ((unsigned char) 0x2D) +#define KEY_U ((unsigned char) 0x0B) +#define KEY_V ((unsigned char) 0x10) +#define KEY_W ((unsigned char) 0x2E) +#define KEY_X ((unsigned char) 0x16) +#define KEY_Y ((unsigned char) 0x2B) +#define KEY_Z ((unsigned char) 0x17) + +#define KEY_COMMA ((unsigned char) 0x20) +#define KEY_PERIOD ((unsigned char) 0x22) +#define KEY_SLASH ((unsigned char) 0x26) +#define KEY_SEMICOLON ((unsigned char) 0x02) +#define KEY_PLUS ((unsigned char) 0x06) +#define KEY_ASTERISK ((unsigned char) 0x07) +#define KEY_DASH ((unsigned char) 0x0E) +#define KEY_EQUALS ((unsigned char) 0x0F) +#define KEY_LESSTHAN ((unsigned char) 0x36) +#define KEY_GREATERTHAN ((unsigned char) 0x37) + +#define KEY_ESC ((unsigned char) 0x1C) +#define KEY_TAB ((unsigned char) 0x2C) +#define KEY_SPACE ((unsigned char) 0x21) +#define KEY_RETURN ((unsigned char) 0x0C) +#define KEY_DELETE ((unsigned char) 0x34) +#define KEY_CAPS ((unsigned char) 0x3C) +#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 +** (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) +#define KEY_HASH (KEY_3 | KEY_SHIFT) +#define KEY_DOLLAR (KEY_4 | KEY_SHIFT) +#define KEY_PERCENT (KEY_5 | KEY_SHIFT) +#define KEY_AMPERSAND (KEY_6 | KEY_SHIFT) +#define KEY_APOSTROPHE (KEY_7 | KEY_SHIFT) +#define KEY_AT (KEY_8 | KEY_SHIFT) +#define KEY_OPENINGPARAN (KEY_9 | KEY_SHIFT) +#define KEY_CLOSINGPARAN (KEY_0 | KEY_SHIFT) +#define KEY_UNDERLINE (KEY_DASH | KEY_SHIFT) +#define KEY_BAR (KEY_EQUALS | KEY_SHIFT) +#define KEY_COLON (KEY_SEMICOLON | KEY_SHIFT) +#define KEY_BACKSLASH (KEY_PLUS | KEY_SHIFT) +#define KEY_CIRCUMFLEX (KEY_ASTERISK | KEY_SHIFT) +#define KEY_OPENINGBRACKET (KEY_COMMA | KEY_SHIFT) +#define KEY_CLOSINGBRACKET (KEY_PERIOD | KEY_SHIFT) +#define KEY_QUESTIONMARK (KEY_SLASH | KEY_SHIFT) +#define KEY_CLEAR (KEY_LESSTHAN | KEY_SHIFT) +#define KEY_INSERT (KEY_GREATERTHAN | KEY_SHIFT) + +#define KEY_UP (KEY_UNDERLINE | KEY_CTRL) +#define KEY_DOWN (KEY_EQUALS | KEY_CTRL) +#define KEY_LEFT (KEY_PLUS | KEY_CTRL) +#define KEY_RIGHT (KEY_ASTERISK | KEY_CTRL) + + +/*****************************************************************************/ +/* 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 */ @@ -178,7 +246,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[]; @@ -232,7 +304,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) @@ -255,11 +331,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 @@ -269,7 +353,11 @@ extern void atrx15p2_tgi[]; #define MYDOS 6 #define NODOS 255 -/* Define hardware */ + +/*****************************************************************************/ +/* Define hardware and where they're mapped in memory */ +/*****************************************************************************/ + #include <_gtia.h> #define GTIA_READ (*(struct __gtia_read*)0xD000) #define GTIA_WRITE (*(struct __gtia_write*)0xD000) @@ -286,7 +374,68 @@ extern void atrx15p2_tgi[]; #include <_antic.h> #define ANTIC (*(struct __antic*)0xD400) -/* device control block */ + +/*****************************************************************************/ +/* Shadow registers for hardware registers */ +/*****************************************************************************/ + +/* GTIA */ +#define STRIG0 (*(unsigned char*)0x284) /* TRIG0 */ +#define STRIG1 (*(unsigned char*)0x285) /* TRIG1 */ +#define STRIG2 (*(unsigned char*)0x286) /* TRIG2 */ +#define STRIG3 (*(unsigned char*)0x287) /* TRIG3 */ +#define PCOLR0 (*(unsigned char*)0x2C0) /* COLPM0 */ +#define PCOLR1 (*(unsigned char*)0x2C1) /* COLPM1 */ +#define PCOLR2 (*(unsigned char*)0x2C2) /* COLPM2 */ +#define PCOLR3 (*(unsigned char*)0x2C3) /* COLPM3 */ +#define COLOR0 (*(unsigned char*)0x2C4) /* COLPF0 */ +#define COLOR1 (*(unsigned char*)0x2C5) /* COLPF1 */ +#define COLOR2 (*(unsigned char*)0x2C6) /* COLPF2 */ +#define COLOR3 (*(unsigned char*)0x2C7) /* COLPF3 */ +#define COLOR4 (*(unsigned char*)0x2C8) /* COLPBK */ +#define GPRIOR (*(unsigned char*)0x264) /* PRIOR */ + +/* ANTIC */ +#define SDMCTL (*(unsigned char*)0x22F) /* DMACTL */ +#define CHACT (*(unsigned char*)0x2F3) /* CHACTL */ +#define SDLSTL (*(unsigned char*)0x230) /* DLISTL */ +#define SDLSTH (*(unsigned char*)0x231) /* DLISTH */ +#define SDLST (*(unsigned int*)0x230) /* DLISTL/H together */ +#define CHBAS (*(unsigned char*)0x2F4) /* CHBASE */ +#define LPENH (*(unsigned char*)0x233) /* PENH */ +#define LPENV (*(unsigned char*)0x234) /* PENV */ + +/* POKEY */ +#define PADDL0 (*(unsigned char*)0x270) /* POT0 */ +#define PADDL1 (*(unsigned char*)0x271) /* POT1 */ +#define PADDL2 (*(unsigned char*)0x272) /* POT2 */ +#define PADDL3 (*(unsigned char*)0x273) /* POT3 */ +#define PADDL4 (*(unsigned char*)0x274) /* POT4 */ +#define PADDL5 (*(unsigned char*)0x275) /* POT5 */ +#define PADDL6 (*(unsigned char*)0x276) /* POT6 */ +#define PADDL7 (*(unsigned char*)0x277) /* POT7 */ +#define CH (*(unsigned char*)0x2FC) /* KBCODE */ +#define POKMSK (*(unsigned char*)0x10) /* IRQEN */ + +/* PIA */ +#define STICK0 (*(unsigned char*)0x278) /* PORTA for controller port 1 */ +#define STICK1 (*(unsigned char*)0x279) /* PORTA for controller port 2 */ +#define STICK2 (*(unsigned char*)0x27A) /* PORTB for controller port 3 */ +#define STICK3 (*(unsigned char*)0x27B) /* PORTB for controller port 4 */ +#define PTRIG0 (*(unsigned char*)0x27C) /* PORTA for controller port 1, paddle 1 */ +#define PTRIG1 (*(unsigned char*)0x27D) /* PORTA for controller port 1, paddle 2 */ +#define PTRIG2 (*(unsigned char*)0x27E) /* PORTA for controller port 1, paddle 3 */ +#define PTRIG3 (*(unsigned char*)0x27F) /* PORTA for controller port 1, paddle 4 */ +#define PTRIG4 (*(unsigned char*)0x280) /* PORTA for controller port 2, paddle 5 */ +#define PTRIG5 (*(unsigned char*)0x281) /* PORTA for controller port 2, paddle 6 */ +#define PTRIG6 (*(unsigned char*)0x282) /* PORTA for controller port 2, paddle 7 */ +#define PTRIG7 (*(unsigned char*)0x283) /* PORTA for controller port 2, paddle 8 */ + + +/*****************************************************************************/ +/* Device control block */ +/*****************************************************************************/ + struct __dcb { unsigned char device; /* device id */ unsigned char unit; /* unit number */ @@ -301,7 +450,11 @@ struct __dcb { }; #define DCB (*(struct __dcb *)0x300) -/* I/O control block */ + +/*****************************************************************************/ +/* I/O control block */ +/*****************************************************************************/ + struct __iocb { unsigned char handler; /* handler index number (0xff free) */ unsigned char drive; /* device number (drive) */ @@ -346,6 +499,5 @@ struct __iocb { #define IOCB_FORMAT 0xFE /* format */ - /* End of atari.h */ #endif diff --git a/include/atari5200.h b/include/atari5200.h index 12c2bb349..67c11c1df 100644 --- a/include/atari5200.h +++ b/include/atari5200.h @@ -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 diff --git a/include/c64.h b/include/c64.h index eb10600d6..b1cd2e2c4 100644 --- a/include/c64.h +++ b/include/c64.h @@ -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[]; diff --git a/include/geos/ggraph.h b/include/geos/ggraph.h index 35e02c198..ec9fb0fa1 100644 --- a/include/geos/ggraph.h +++ b/include/geos/ggraph.h @@ -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 diff --git a/libsrc/Makefile b/libsrc/Makefile index 0d0cd320b..0ebec46b1 100644 --- a/libsrc/Makefile +++ b/libsrc/Makefile @@ -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) diff --git a/libsrc/apple2/ser/a2.ssc.s b/libsrc/apple2/ser/a2.ssc.s index d5c567165..a32110ef2 100644 --- a/libsrc/apple2/ser/a2.ssc.s +++ b/libsrc/apple2/ser/a2.ssc.s @@ -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 # 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 diff --git a/libsrc/atmos/ser/atmos-acia.s b/libsrc/atmos/ser/atmos-acia.s index 79fbc1bbe..f84b66a0a 100644 --- a/libsrc/atmos/ser/atmos-acia.s +++ b/libsrc/atmos/ser/atmos-acia.s @@ -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_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 diff --git a/libsrc/c128/cgetc.s b/libsrc/c128/cgetc.s index bc9d8da7f..7cf7fcc3e 100644 --- a/libsrc/c128/cgetc.s +++ b/libsrc/c128/cgetc.s @@ -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. diff --git a/libsrc/c128/clrscr.s b/libsrc/c128/clrscr.s index 2213be0cd..a3c519cb1 100644 --- a/libsrc/c128/clrscr.s +++ b/libsrc/c128/clrscr.s @@ -6,9 +6,6 @@ .export _clrscr - .include "c128.inc" + .include "cbm_kernal.inc" _clrscr = CLRSCR - - - diff --git a/libsrc/c128/cputc.s b/libsrc/c128/cputc.s index 9d269a47e..667260843 100644 --- a/libsrc/c128/cputc.s +++ b/libsrc/c128/cputc.s @@ -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 - diff --git a/libsrc/c128/mainargs.s b/libsrc/c128/mainargs.s index f53ceafa0..dcf590024 100644 --- a/libsrc/c128/mainargs.s +++ b/libsrc/c128/mainargs.s @@ -25,6 +25,7 @@ .constructor initmainargs, 24 .import __argc, __argv + .include "cbm_kernal.inc" .include "c128.inc" diff --git a/libsrc/c128/ser/c128-swlink.s b/libsrc/c128/ser/c128-swlink.s index 98411d4f8..3337e2668 100644 --- a/libsrc/c128/ser/c128-swlink.s +++ b/libsrc/c128/ser/c128-swlink.s @@ -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 rts @@ -407,7 +410,7 @@ IOCTL: lda #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 - diff --git a/libsrc/c64/soft80_cgetc.s b/libsrc/c64/soft80_cgetc.s index ae0e23857..05e9e5b47 100644 --- a/libsrc/c64/soft80_cgetc.s +++ b/libsrc/c64/soft80_cgetc.s @@ -11,6 +11,7 @@ .import cursor .importzp tmp1 + .include "cbm_kernal.inc" .include "c64.inc" .include "soft80.inc" diff --git a/libsrc/c64/soft80mono_cgetc.s b/libsrc/c64/soft80mono_cgetc.s index d99dc7775..8d8dc940d 100644 --- a/libsrc/c64/soft80mono_cgetc.s +++ b/libsrc/c64/soft80mono_cgetc.s @@ -12,6 +12,7 @@ .import cursor .importzp tmp1 + .include "cbm_kernal.inc" .include "c64.inc" .include "soft80.inc" diff --git a/libsrc/cbm510/ser/cbm510-std.s b/libsrc/cbm510/ser/cbm510-std.s index 7629892e0..64f613cd5 100644 --- a/libsrc/cbm510/ser/cbm510-std.s +++ b/libsrc/cbm510/ser/cbm510-std.s @@ -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 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 - diff --git a/libsrc/cbm610/ser/cbm610-std.s b/libsrc/cbm610/ser/cbm610-std.s index 1b2d38aa5..7cdb285bd 100644 --- a/libsrc/cbm610/ser/cbm610-std.s +++ b/libsrc/cbm610/ser/cbm610-std.s @@ -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 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 - diff --git a/libsrc/common/divt.s b/libsrc/common/divt.s index f1291c86f..914eb569d 100644 --- a/libsrc/common/divt.s +++ b/libsrc/common/divt.s @@ -18,12 +18,15 @@ .importzp sreg, ptr1, tmp1 _div: jsr tosdivax ; Division-operator does most of the work - lda sreg ; Unsigned remainder is in sreg - ldx sreg+1 - ldy ptr1 ; transfer quotient to sreg - sty sreg - ldy ptr1+1 - sty sreg+1 + + ldy sreg ; low byte remainder from sreg + sta sreg ; store low byte quotient to sreg + + lda sreg+1 ; high byte remainder from sreg + stx sreg+1 ; store high byte quotient to sreg + + tax ; high byte remainder to x + tya ; low byte remainder to a ; Adjust the sign of the remainder. ; It must be the same as the sign of the dividend. @@ -33,4 +36,3 @@ _div: jsr tosdivax ; Division-operator does most of the work jmp negax ; Result is negative, adjust the sign Pos: rts - diff --git a/libsrc/common/getcpu.s b/libsrc/common/getcpu.s index 169c56bbd..51ccd5a4a 100644 --- a/libsrc/common/getcpu.s +++ b/libsrc/common/getcpu.s @@ -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 - diff --git a/libsrc/geos-cbm/graph/setnewmode.s b/libsrc/geos-cbm/graph/setnewmode.s new file mode 100644 index 000000000..1d63cf78e --- /dev/null +++ b/libsrc/geos-cbm/graph/setnewmode.s @@ -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 + diff --git a/libsrc/lynx/lynx-snd.s b/libsrc/lynx/lynx-snd.s index 9d0b8b7af..82b05276f 100644 --- a/libsrc/lynx/lynx-snd.s +++ b/libsrc/lynx/lynx-snd.s @@ -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 ; diff --git a/libsrc/lynx/ser/lynx-comlynx.s b/libsrc/lynx/ser/lynx-comlynx.s index 1fd24ad94..ded862eaa 100644 --- a/libsrc/lynx/ser/lynx-comlynx.s +++ b/libsrc/lynx/ser/lynx-comlynx.s @@ -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_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 - diff --git a/libsrc/plus4/cgetc.s b/libsrc/plus4/cgetc.s index fcbc66064..62863c06e 100644 --- a/libsrc/plus4/cgetc.s +++ b/libsrc/plus4/cgetc.s @@ -7,6 +7,7 @@ .export _cgetc .import cursor + .include "cbm_kernal.inc" .include "plus4.inc" ; -------------------------------------------------------------------------- diff --git a/libsrc/plus4/clrscr.s b/libsrc/plus4/clrscr.s index 720a5e6e4..a67016255 100644 --- a/libsrc/plus4/clrscr.s +++ b/libsrc/plus4/clrscr.s @@ -6,6 +6,7 @@ .export _clrscr + .include "cbm_kernal.inc" .include "plus4.inc" .segment "LOWCODE" ; Must go into low memory @@ -16,9 +17,3 @@ sta ENABLE_RAM ; Switch back to RAM rts ; Return to caller .endproc - - - - - - diff --git a/libsrc/plus4/ser/plus4-stdser.s b/libsrc/plus4/ser/plus4-stdser.s index 6cacff327..bb44a4cf9 100644 --- a/libsrc/plus4/ser/plus4-stdser.s +++ b/libsrc/plus4/ser/plus4-stdser.s @@ -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 @@ -130,25 +130,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 @@ -165,7 +165,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 @@ -244,12 +244,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 @@ -288,11 +289,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 @@ -322,34 +323,37 @@ 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 rts ; Run into IRQ instead ;---------------------------------------------------------------------------- -; 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 ACIA_STATUS ; Check ACIA status for receive interrupt +SER_IRQ: + lda ACIA_STATUS ; Check ACIA status for receive interrupt and #$08 beq @L9 ; Jump if no ACIA interrupt (carry still clear) lda ACIA_DATA ; Get byte from ACIA @@ -405,5 +409,3 @@ IRQ: lda ACIA_STATUS ; Check ACIA status for receive interrupt jmp @L0 .endproc - - diff --git a/libsrc/vic20/cgetc.s b/libsrc/vic20/cgetc.s index d5af9a9f6..1a5c8d5a2 100644 --- a/libsrc/vic20/cgetc.s +++ b/libsrc/vic20/cgetc.s @@ -7,6 +7,7 @@ .export _cgetc .import cursor + .include "cbm_kernal.inc" .include "vic20.inc" _cgetc: lda KEY_COUNT ; Get number of characters diff --git a/libsrc/vic20/clrscr.s b/libsrc/vic20/clrscr.s index 8d4994eac..a3c519cb1 100644 --- a/libsrc/vic20/clrscr.s +++ b/libsrc/vic20/clrscr.s @@ -6,9 +6,6 @@ .export _clrscr - .include "vic20.inc" + .include "cbm_kernal.inc" _clrscr = CLRSCR - - - diff --git a/samples/Makefile b/samples/Makefile index 601d19d76..74094aeae 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -296,7 +296,7 @@ INSTALL = install samplesdir = $(PREFIX)/share/cc65/samples install: - $(if $(PREFIX),,$(error variable `PREFIX' must be set)) + $(if $(PREFIX),,$(error variable "PREFIX" must be set)) $(INSTALL) -d $(DESTDIR)$(samplesdir) $(INSTALL) -d $(DESTDIR)$(samplesdir)/geos $(INSTALL) -d $(DESTDIR)$(samplesdir)/tutorial diff --git a/src/Makefile b/src/Makefile index c1f11ff58..c93a8645f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -107,7 +107,7 @@ $(RM) /usr/local/bin/$(prog) endef # UNAVAIL_recipe install: - $(if $(PREFIX),,$(error variable `PREFIX' must be set)) + $(if $(PREFIX),,$(error variable "PREFIX" must be set)) $(INSTALL) -d $(DESTDIR)$(bindir) $(INSTALL) ../bin/* $(DESTDIR)$(bindir) diff --git a/src/ar65.vcxproj b/src/ar65.vcxproj index 003a5fa69..a57bec813 100644 --- a/src/ar65.vcxproj +++ b/src/ar65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {5E8C19C6-B167-440C-8BEF-3CBF109CDB49} Win32Proj ar65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/ar65/exports.c b/src/ar65/exports.c index b3bb4cebe..b1e133e72 100644 --- a/src/ar65/exports.c +++ b/src/ar65/exports.c @@ -113,8 +113,8 @@ void ExpInsert (const char* Name, const ObjData* Module) while (1) { if (strcmp (L->Name, Name) == 0) { /* Duplicate entry */ - Warning ("External symbol `%s' in module `%s', library `%s', " - "is duplicated in module `%s'", + Warning ("External symbol '%s' in module '%s', library '%s', " + "is duplicated in module '%s'", Name, L->Module->Name, LibName, Module->Name); } if (L->Next == 0) { diff --git a/src/ar65/library.c b/src/ar65/library.c index c72e6e3cf..4d18168d8 100644 --- a/src/ar65/library.c +++ b/src/ar65/library.c @@ -95,11 +95,11 @@ static void ReadHeader (void) /* Read the header fields, checking magic and version */ Header.Magic = Read32 (Lib); if (Header.Magic != LIB_MAGIC) { - Error ("`%s' is not a valid library file", LibName); + Error ("'%s' is not a valid library file", LibName); } Header.Version = Read16 (Lib); if (Header.Version != LIB_VERSION) { - Error ("Wrong data version in `%s'", LibName); + Error ("Wrong data version in '%s'", LibName); } Header.Flags = Read16 (Lib); Header.IndexOffs = Read32 (Lib); @@ -229,11 +229,11 @@ void LibOpen (const char* Name, int MustExist, int NeedTemp) /* File does not exist */ if (MustExist) { - Error ("Library `%s' does not exist", Name); + Error ("Library '%s' does not exist", Name); } else { /* Announce the library's creation if ar65 is verbose. */ Print (stdout, 1, - "%s: Library `%s' will be created.\n", ProgName, Name); + "%s: Library '%s' will be created.\n", ProgName, Name); } } else { @@ -317,7 +317,7 @@ static void LibCheckExports (ObjData* O) unsigned I; /* Let the user know what we do */ - Print (stdout, 2, "Module `%s' (%u exports):\n", O->Name, CollCount (&O->Exports)); + Print (stdout, 2, "Module '%s' (%u exports):\n", O->Name, CollCount (&O->Exports)); /* Insert the exports into the global table */ for (I = 0; I < CollCount (&O->Exports); ++I) { @@ -381,7 +381,7 @@ void LibClose (void) /* Reopen the library and truncate it */ Lib = fopen (LibName, "wb"); if (Lib == 0) { - Error ("Cannot open library `%s' for writing: %s", + Error ("Cannot open library '%s' for writing: %s", LibName, strerror (errno)); } @@ -389,14 +389,14 @@ void LibClose (void) fseek (NewLib, 0, SEEK_SET); while ((Count = fread (Buf, 1, sizeof (Buf), NewLib)) != 0) { if (fwrite (Buf, 1, Count, Lib) != Count) { - Error ("Cannot write to `%s': %s", LibName, strerror (errno)); + Error ("Cannot write to '%s': %s", LibName, strerror (errno)); } } } /* Close both files */ if (Lib && fclose (Lib) != 0) { - Error ("Problem closing `%s': %s", LibName, strerror (errno)); + Error ("Problem closing '%s': %s", LibName, strerror (errno)); } if (NewLib && fclose (NewLib) != 0) { Error ("Problem closing temporary library file: %s", strerror (errno)); diff --git a/src/ar65/objdata.c b/src/ar65/objdata.c index 5a8f0c5fb..252ebe6ab 100644 --- a/src/ar65/objdata.c +++ b/src/ar65/objdata.c @@ -165,5 +165,5 @@ void DelObjData (const char* Module) } /* Not found! */ - Warning ("Module `%s' not found in library `%s'", Module, LibName); + Warning ("Module '%s' not found in library '%s'", Module, LibName); } diff --git a/src/ar65/objfile.c b/src/ar65/objfile.c index 0434f7e59..ac7dccb0d 100644 --- a/src/ar65/objfile.c +++ b/src/ar65/objfile.c @@ -68,7 +68,7 @@ static const char* GetModule (const char* Name) /* Must not end with a path separator */ if (*Module == 0) { - Error ("Cannot make module name from `%s'", Name); + Error ("Cannot make module name from '%s'", Name); } /* Done */ @@ -82,11 +82,11 @@ static void ObjReadHeader (FILE* Obj, ObjHeader* H, const char* Name) { H->Magic = Read32 (Obj); if (H->Magic != OBJ_MAGIC) { - Error ("`%s' is not an object file", Name); + Error ("'%s' is not an object file", Name); } H->Version = Read16 (Obj); if (H->Version != OBJ_VERSION) { - Error ("Object file `%s' has wrong version", Name); + Error ("Object file '%s' has wrong version", Name); } H->Flags = Read16 (Obj); H->OptionOffs = Read32 (Obj); @@ -236,7 +236,7 @@ void ObjAdd (const char* Name) /* Open the object file */ FILE* Obj = fopen (Name, "rb"); if (Obj == 0) { - Error ("Could not open `%s': %s", Name, strerror (errno)); + Error ("Could not open '%s': %s", Name, strerror (errno)); } /* Get the modification time of the object file. There's a race condition @@ -248,7 +248,7 @@ void ObjAdd (const char* Name) ** here. */ if (FileStat (Name, &StatBuf) != 0) { - Error ("Cannot stat object file `%s': %s", Name, strerror (errno)); + Error ("Cannot stat object file '%s': %s", Name, strerror (errno)); } /* Read and check the header */ @@ -267,7 +267,7 @@ void ObjAdd (const char* Name) ** and the external one. */ if (difftime ((time_t)O->MTime, StatBuf.st_mtime) > 0.0) { - Warning ("Replacing module `%s' by older version in library `%s'", + Warning ("Replacing module '%s' by older version in library '%s'", O->Name, LibName); } @@ -313,13 +313,13 @@ void ObjExtract (const char* Name) /* Bail out if the module does not exist */ if (O == 0) { - Error ("Module `%s' not found in library `%s'", Module, LibName); + Error ("Module '%s' not found in library '%s'", Module, LibName); } /* Open the output file */ Obj = fopen (Name, "w+b"); if (Obj == 0) { - Error ("Cannot open target file `%s': %s", Name, strerror (errno)); + Error ("Cannot open target file '%s': %s", Name, strerror (errno)); } /* Copy the complete object file data from the library to the new object @@ -329,11 +329,11 @@ void ObjExtract (const char* Name) /* Close the file */ if (fclose (Obj) != 0) { - Error ("Problem closing object file `%s': %s", Name, strerror (errno)); + Error ("Problem closing object file '%s': %s", Name, strerror (errno)); } /* Set access and modification time */ if (SetFileTimes (Name, O->MTime) != 0) { - Error ("Cannot set mod time on `%s': %s", Name, strerror (errno)); + Error ("Cannot set mod time on '%s': %s", Name, strerror (errno)); } } diff --git a/src/ca65.vcxproj b/src/ca65.vcxproj index fb7cf2e26..df246a59f 100644 --- a/src/ca65.vcxproj +++ b/src/ca65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {D28CB737-E6CA-49C4-8CE9-FF05F86DD4EC} Win32Proj ca65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/ca65/dbginfo.c b/src/ca65/dbginfo.c index 135739fb5..c9dd7ab6d 100644 --- a/src/ca65/dbginfo.c +++ b/src/ca65/dbginfo.c @@ -468,7 +468,7 @@ void DbgInfoCheck (void) /* Search for the symbol name */ S->Sym = SymFindAny (S->Scope, GetStrBuf (S->AsmName)); if (S->Sym == 0) { - PError (&S->Pos, "Assembler symbol `%s' not found", + PError (&S->Pos, "Assembler symbol '%s' not found", GetString (S->AsmName)); } else { /* Set the backlink */ diff --git a/src/ca65/ea65.c b/src/ca65/ea65.c index 2f7c2bfa9..275d90b56 100644 --- a/src/ca65/ea65.c +++ b/src/ca65/ea65.c @@ -133,7 +133,7 @@ void GetEA (EffAddr* A) A->AddrModeSet = AM65_STACK_REL_IND_Y; Consume (IndirectLeave, IndirectExpect); ConsumeComma (); - Consume (TOK_Y, "`Y' expected"); + Consume (TOK_Y, "'Y' expected"); } else { Error ("Syntax error"); } @@ -152,7 +152,7 @@ void GetEA (EffAddr* A) A->AddrModeSet = AM65_DIR_IND; break; default: - Consume (TOK_Y, "`Y' expected"); + Consume (TOK_Y, "'Y' expected"); A->AddrModeSet = AM65_DIR_IND_Y; break; } @@ -173,7 +173,7 @@ void GetEA (EffAddr* A) if (CurTok.Tok == TOK_COMMA) { /* [dir],y */ NextTok (); - Consume (TOK_Y, "`Y' expected"); + Consume (TOK_Y, "'Y' expected"); A->AddrModeSet = AM65_DIR_IND_LONG_Y; } else { /* [dir] */ diff --git a/src/ca65/enum.c b/src/ca65/enum.c index f0561b692..339b3230f 100644 --- a/src/ca65/enum.c +++ b/src/ca65/enum.c @@ -146,7 +146,7 @@ void DoEnum (void) } /* End of enum definition */ - Consume (TOK_ENDENUM, "`.ENDENUM' expected"); + Consume (TOK_ENDENUM, "'.ENDENUM' expected"); /* Free the base expression */ FreeExpr (BaseExpr); diff --git a/src/ca65/expr.c b/src/ca65/expr.c index ff4232c00..982bb05c6 100644 --- a/src/ca65/expr.c +++ b/src/ca65/expr.c @@ -699,7 +699,7 @@ static ExprNode* FuncAddrSize (void) /* Cheap local symbol */ Sym = SymFindLocal (SymLast, &CurTok.SVal, SYM_FIND_EXISTING); if (Sym == 0) { - Error ("Unknown symbol or scope: `%m%p'", &CurTok.SVal); + Error ("Unknown symbol or scope: '%m%p'", &CurTok.SVal); } else { AddrSize = Sym->AddrSize; } @@ -739,13 +739,13 @@ static ExprNode* FuncAddrSize (void) if (Sym) { AddrSize = Sym->AddrSize; } else { - Error ("Unknown symbol or scope: `%m%p%m%p'", &ScopeName, &Name); + Error ("Unknown symbol or scope: '%m%p%m%p'", &ScopeName, &Name); } } if (AddrSize == 0) { - Warning (1, "Unknown address size: `%m%p%m%p'", &ScopeName, &Name); + Warning (1, "Unknown address size: '%m%p%m%p'", &ScopeName, &Name); } /* Free the string buffers */ @@ -780,7 +780,7 @@ static ExprNode* FuncSizeOf (void) /* Cheap local symbol */ Sym = SymFindLocal (SymLast, &CurTok.SVal, SYM_FIND_EXISTING); if (Sym == 0) { - Error ("Unknown symbol or scope: `%m%p'", &CurTok.SVal); + Error ("Unknown symbol or scope: '%m%p'", &CurTok.SVal); } else { SizeSym = GetSizeOfSymbol (Sym); } @@ -832,7 +832,7 @@ static ExprNode* FuncSizeOf (void) if (Sym) { SizeSym = GetSizeOfSymbol (Sym); } else { - Error ("Unknown symbol or scope: `%m%p%m%p'", + Error ("Unknown symbol or scope: '%m%p%m%p'", &ScopeName, &Name); } } @@ -840,7 +840,7 @@ static ExprNode* FuncSizeOf (void) /* Check if we have a size */ if (SizeSym == 0 || !SymIsConst (SizeSym, &Size)) { - Error ("Size of `%m%p%m%p' is unknown", &ScopeName, &Name); + Error ("Size of '%m%p%m%p' is unknown", &ScopeName, &Name); Size = 0; } diff --git a/src/ca65/feature.c b/src/ca65/feature.c index 0fb766b6f..b11345338 100644 --- a/src/ca65/feature.c +++ b/src/ca65/feature.c @@ -65,6 +65,7 @@ static const char* const FeatureKeys[FEAT_COUNT] = { "underline_in_numbers", "addrsize", "bracket_as_indirect", + "string_escapes", }; @@ -123,6 +124,7 @@ feature_t SetFeature (const StrBuf* Key) case FEAT_UNDERLINE_IN_NUMBERS: UnderlineInNumbers= 1; break; case FEAT_ADDRSIZE: AddrSize = 1; break; case FEAT_BRACKET_AS_INDIRECT: BracketAsIndirect = 1; break; + case FEAT_STRING_ESCAPES: StringEscapes = 1; break; default: /* Keep gcc silent */ break; } diff --git a/src/ca65/feature.h b/src/ca65/feature.h index 050c197f0..876f3c4a8 100644 --- a/src/ca65/feature.h +++ b/src/ca65/feature.h @@ -67,6 +67,7 @@ typedef enum { FEAT_UNDERLINE_IN_NUMBERS, FEAT_ADDRSIZE, FEAT_BRACKET_AS_INDIRECT, + FEAT_STRING_ESCAPES, /* Special value: Number of features available */ FEAT_COUNT diff --git a/src/ca65/filetab.c b/src/ca65/filetab.c index ce4b15c03..4ca32631e 100644 --- a/src/ca65/filetab.c +++ b/src/ca65/filetab.c @@ -211,7 +211,7 @@ unsigned GetFileIndex (const StrBuf* Name) /* If we don't have this index, print a diagnostic and use the main file */ if (F == 0) { - Error ("File name `%m%p' not found in file table", Name); + Error ("File name '%m%p' not found in file table", Name); return 0; } else { return F->Index; @@ -316,7 +316,7 @@ static void CreateDepFile (const char* Name, FileType Types) /* Open the file */ FILE* F = fopen (Name, "w"); if (F == 0) { - Fatal ("Cannot open dependency file `%s': %s", Name, strerror (errno)); + Fatal ("Cannot open dependency file '%s': %s", Name, strerror (errno)); } /* Print the output file followed by a tab char */ diff --git a/src/ca65/global.c b/src/ca65/global.c index 31e599f00..a216fc406 100644 --- a/src/ca65/global.c +++ b/src/ca65/global.c @@ -66,6 +66,7 @@ unsigned char DbgSyms = 0; /* Add debug symbols */ unsigned char LineCont = 0; /* Allow line continuation */ unsigned char LargeAlignment = 0; /* Don't warn about large alignments */ unsigned char RelaxChecks = 0; /* Relax a few assembler checks */ +unsigned char StringEscapes = 0; /* Allow C-style escapes in strings */ /* Emulation features */ unsigned char DollarIsPC = 0; /* Allow the $ symbol as current PC */ @@ -84,4 +85,3 @@ unsigned char ForceRange = 0; /* Force values into expected range */ unsigned char UnderlineInNumbers = 0; /* Allow underlines in numbers */ unsigned char AddrSize = 0; /* Allow .ADDRSIZE function */ unsigned char BracketAsIndirect = 0; /* Use '[]' not '()' for indirection */ - diff --git a/src/ca65/global.h b/src/ca65/global.h index 397d9221b..77d90beca 100644 --- a/src/ca65/global.h +++ b/src/ca65/global.h @@ -68,6 +68,7 @@ extern unsigned char DbgSyms; /* Add debug symbols */ extern unsigned char LineCont; /* Allow line continuation */ extern unsigned char LargeAlignment; /* Don't warn about large alignments */ extern unsigned char RelaxChecks; /* Relax a few assembler checks */ +extern unsigned char StringEscapes; /* Allow C-style escapes in strings */ /* Emulation features */ extern unsigned char DollarIsPC; /* Allow the $ symbol as current PC */ diff --git a/src/ca65/listing.c b/src/ca65/listing.c index b3f3d9282..9f2396612 100644 --- a/src/ca65/listing.c +++ b/src/ca65/listing.c @@ -304,7 +304,7 @@ void CreateListing (void) /* Open the real listing file */ F = fopen (SB_GetConstBuf (&ListingName), "w"); if (F == 0) { - Fatal ("Cannot open listing file `%s': %s", + Fatal ("Cannot open listing file '%s': %s", SB_GetConstBuf (&ListingName), strerror (errno)); } diff --git a/src/ca65/macro.c b/src/ca65/macro.c index 1f6812ce0..988493976 100644 --- a/src/ca65/macro.c +++ b/src/ca65/macro.c @@ -375,7 +375,7 @@ static void MacSkipDef (unsigned Style) if (CurTok.Tok != TOK_EOF) { SkipUntilSep (); } else { - Error ("`.ENDMACRO' expected"); + Error ("'.ENDMACRO' expected"); } } else { /* Skip until end of line */ @@ -409,7 +409,7 @@ void MacDef (unsigned Style) /* Did we already define that macro? */ if (HT_Find (&MacroTab, &CurTok.SVal) != 0) { /* Macro is already defined */ - Error ("A macro named `%m%p' is already defined", &CurTok.SVal); + Error ("A macro named '%m%p' is already defined", &CurTok.SVal); /* Skip tokens until we reach the final .endmacro */ MacSkipDef (Style); return; @@ -451,7 +451,7 @@ void MacDef (unsigned Style) IdDesc* List = M->Params; while (1) { if (SB_Compare (&List->Id, &CurTok.SVal) == 0) { - Error ("Duplicate symbol `%m%p'", &CurTok.SVal); + Error ("Duplicate symbol '%m%p'", &CurTok.SVal); } if (List->Next == 0) { break; @@ -500,7 +500,7 @@ void MacDef (unsigned Style) } /* May not have end of file in a macro definition */ if (CurTok.Tok == TOK_EOF) { - Error ("`.ENDMACRO' expected"); + Error ("'.ENDMACRO' expected"); goto Done; } } else { @@ -930,7 +930,7 @@ static void StartExpDefine (MacExp* E) if (CurTok.Tok == TOK_COMMA) { NextTok (); } else { - Error ("`,' expected"); + Error ("',' expected"); } } } diff --git a/src/ca65/main.c b/src/ca65/main.c index fbca2beac..33e0a74b5 100644 --- a/src/ca65/main.c +++ b/src/ca65/main.c @@ -168,7 +168,7 @@ static void NewSymbol (const char* SymName, long Val) /* Check if have already a symbol with this name */ if (SymIsDef (Sym)) { - AbEnd ("`%s' is already defined", SymName); + AbEnd ("'%s' is already defined", SymName); } /* Generate an expression for the symbol */ @@ -201,7 +201,7 @@ static void SetSys (const char* Sys) break; case TGT_MODULE: - AbEnd ("Cannot use `module' as a target for the assembler"); + AbEnd ("Cannot use 'module' as a target for the assembler"); break; case TGT_ATARI2600: @@ -331,7 +331,7 @@ static void SetSys (const char* Sys) break; default: - AbEnd ("Invalid target name: `%s'", Sys); + AbEnd ("Invalid target name: '%s'", Sys); } @@ -346,7 +346,7 @@ static void FileNameOption (const char* Opt, const char* Arg, StrBuf* Name) { /* Cannot have the option twice */ if (SB_NotEmpty (Name)) { - AbEnd ("Cannot use option `%s' twice", Opt); + AbEnd ("Cannot use option '%s' twice", Opt); } /* Remember the file name for later */ SB_CopyStr (Name, Arg); @@ -427,7 +427,7 @@ static void OptCPU (const char* Opt attribute ((unused)), const char* Arg) { cpu_t CPU = FindCPU (Arg); if (CPU == CPU_UNKNOWN) { - AbEnd ("Invalid CPU: `%s'", Arg); + AbEnd ("Invalid CPU: '%s'", Arg); } else { SetCPU (CPU); } @@ -478,7 +478,7 @@ static void OptFeature (const char* Opt attribute ((unused)), const char* Arg) /* Set the feature, check for errors */ if (SetFeature (SB_InitFromString (&Feature, Arg)) == FEAT_UNKNOWN) { - AbEnd ("Illegal emulation feature: `%s'", Arg); + AbEnd ("Illegal emulation feature: '%s'", Arg); } } @@ -533,7 +533,7 @@ static void OptListBytes (const char* Opt, const char* Arg) /* Check the bounds */ if (Num != 0 && (Num < MIN_LIST_BYTES || Num > MAX_LIST_BYTES)) { - AbEnd ("Argument for option `%s' is out of range", Opt); + AbEnd ("Argument for option '%s' is out of range", Opt); } /* Use the value */ @@ -549,7 +549,7 @@ static void OptListing (const char* Opt, const char* Arg) ** the filename is empty or begins with the option char. */ if (Arg == 0 || *Arg == '\0' || *Arg == '-') { - Fatal ("The meaning of `%s' has changed. It does now " + Fatal ("The meaning of '%s' has changed. It does now " "expect a file name as argument.", Opt); } @@ -566,7 +566,7 @@ static void OptMemoryModel (const char* Opt, const char* Arg) /* Check the current memory model */ if (MemoryModel != MMODEL_UNKNOWN) { - AbEnd ("Cannot use option `%s' twice", Opt); + AbEnd ("Cannot use option '%s' twice", Opt); } /* Translate the memory model name and check it */ @@ -762,7 +762,7 @@ static void OneLine (void) */ if (CurTok.Tok != TOK_COLON) { if (HadWS || !NoColonLabels) { - Error ("`:' expected"); + Error ("':' expected"); /* Try some smart error recovery */ if (CurTok.Tok == TOK_NAMESPACE) { NextTok (); @@ -807,7 +807,7 @@ static void OneLine (void) } else if (PCAssignment && (CurTok.Tok == TOK_STAR || CurTok.Tok == TOK_PC)) { NextTok (); if (CurTok.Tok != TOK_EQ) { - Error ("`=' expected"); + Error ("'=' expected"); SkipUntilSep (); } else { /* Skip the equal sign */ @@ -1040,7 +1040,7 @@ int main (int argc, char* argv []) } else { /* Filename. Check if we already had one */ if (InFile) { - fprintf (stderr, "%s: Don't know what to do with `%s'\n", + fprintf (stderr, "%s: Don't know what to do with '%s'\n", ProgName, Arg); exit (EXIT_FAILURE); } else { diff --git a/src/ca65/nexttok.c b/src/ca65/nexttok.c index 1521ed0c2..54733740e 100644 --- a/src/ca65/nexttok.c +++ b/src/ca65/nexttok.c @@ -179,7 +179,7 @@ static void FuncConcat (void) ** by the string token just created. */ if (CurTok.Tok != TOK_RPAREN) { - Error ("`)' expected"); + Error ("')' expected"); } else { CurTok.Tok = TOK_STRCON; SB_Copy (&CurTok.SVal, &Buf); @@ -253,7 +253,7 @@ static void FuncIdent (void) SB_Copy (&Buf, &CurTok.SVal); NextTok (); if (CurTok.Tok != TOK_RPAREN) { - Error ("`)' expected"); + Error ("')' expected"); } else { CurTok.Tok = Id; SB_Copy (&CurTok.SVal, &Buf); @@ -600,7 +600,7 @@ static void FuncSPrintF (void) ** by the string token just created. */ if (CurTok.Tok != TOK_RPAREN) { - Error ("`)' expected"); + Error ("')' expected"); } else { CurTok.Tok = TOK_STRCON; SB_Copy (&CurTok.SVal, &R); @@ -660,7 +660,7 @@ static void FuncString (void) ** by the string token just created. */ if (CurTok.Tok != TOK_RPAREN) { - Error ("`)' expected"); + Error ("')' expected"); } else { CurTok.Tok = TOK_STRCON; SB_Copy (&CurTok.SVal, &Buf); @@ -754,7 +754,7 @@ void ConsumeSep (void) void ConsumeLParen (void) /* Consume a left paren */ { - Consume (TOK_LPAREN, "`(' expected"); + Consume (TOK_LPAREN, "'(' expected"); } @@ -762,7 +762,7 @@ void ConsumeLParen (void) void ConsumeRParen (void) /* Consume a right paren */ { - Consume (TOK_RPAREN, "`)' expected"); + Consume (TOK_RPAREN, "')' expected"); } @@ -770,7 +770,7 @@ void ConsumeRParen (void) void ConsumeComma (void) /* Consume a comma */ { - Consume (TOK_COMMA, "`,' expected"); + Consume (TOK_COMMA, "',' expected"); } diff --git a/src/ca65/objfile.c b/src/ca65/objfile.c index dfa0d146e..b475d15df 100644 --- a/src/ca65/objfile.c +++ b/src/ca65/objfile.c @@ -113,7 +113,7 @@ static void ObjWriteError (void) remove (OutFile); /* Now abort with a fatal error */ - Fatal ("Cannot write to output file `%s': %s", OutFile, strerror (Error)); + Fatal ("Cannot write to output file '%s': %s", OutFile, strerror (Error)); } @@ -170,7 +170,7 @@ void ObjOpen (void) /* Create the output file */ F = fopen (OutFile, "w+b"); if (F == 0) { - Fatal ("Cannot open output file `%s': %s", OutFile, strerror (errno)); + Fatal ("Cannot open output file '%s': %s", OutFile, strerror (errno)); } /* Write a dummy header */ diff --git a/src/ca65/pseudo.c b/src/ca65/pseudo.c index a1115606b..a0eb28699 100644 --- a/src/ca65/pseudo.c +++ b/src/ca65/pseudo.c @@ -167,13 +167,13 @@ static void SetBoolOption (unsigned char* Flag) switch (GetSubKey (Keys, sizeof (Keys) / sizeof (Keys [0]))) { case 0: *Flag = 0; NextTok (); break; case 1: *Flag = 1; NextTok (); break; - default: ErrorSkip ("`on' or `off' expected"); break; + default: ErrorSkip ("'on' or 'off' expected"); break; } } else if (TokIsSep (CurTok.Tok)) { /* Without anything assume switch on */ *Flag = 1; } else { - ErrorSkip ("`on' or `off' expected"); + ErrorSkip ("'on' or 'off' expected"); } } @@ -1017,7 +1017,7 @@ static void DoFeature (void) /* Set the feature and check for errors */ if (SetFeature (&CurTok.SVal) == FEAT_UNKNOWN) { /* Not found */ - ErrorSkip ("Invalid feature: `%m%p'", &CurTok.SVal); + ErrorSkip ("Invalid feature: '%m%p'", &CurTok.SVal); return; } else { /* Skip the keyword */ @@ -1242,7 +1242,7 @@ static void DoIncBin (void) char* PathName = SearchFile (BinSearchPath, SB_GetConstBuf (&Name)); if (PathName == 0 || (F = fopen (PathName, "rb")) == 0) { /* Not found or cannot open, print an error and bail out */ - ErrorSkip ("Cannot open include file `%m%p': %s", &Name, strerror (errno)); + ErrorSkip ("Cannot open include file '%m%p': %s", &Name, strerror (errno)); xfree (PathName); goto ExitPoint; } @@ -1268,7 +1268,7 @@ static void DoIncBin (void) */ SB_Terminate (&Name); if (FileStat (SB_GetConstBuf (&Name), &StatBuf) != 0) { - Fatal ("Cannot stat input file `%m%p': %s", &Name, strerror (errno)); + Fatal ("Cannot stat input file '%m%p': %s", &Name, strerror (errno)); } /* Add the file to the input file table */ @@ -1305,7 +1305,7 @@ static void DoIncBin (void) size_t BytesRead = fread (Buf, 1, BytesToRead, F); if (BytesToRead != BytesRead) { /* Some sort of error */ - ErrorSkip ("Cannot read from include file `%m%p': %s", + ErrorSkip ("Cannot read from include file '%m%p': %s", &Name, strerror (errno)); break; } @@ -1896,7 +1896,7 @@ static void DoUnDef (void) static void DoUnexpected (void) /* Got an unexpected keyword */ { - Error ("Unexpected `%m%p'", &Keyword); + Error ("Unexpected '%m%p'", &Keyword); SkipUntilSep (); } diff --git a/src/ca65/scanner.c b/src/ca65/scanner.c index 7c291666c..f80fe2bca 100644 --- a/src/ca65/scanner.c +++ b/src/ca65/scanner.c @@ -501,7 +501,7 @@ int NewInputFile (const char* Name) /* Main file */ F = fopen (Name, "r"); if (F == 0) { - Fatal ("Cannot open input file `%s': %s", Name, strerror (errno)); + Fatal ("Cannot open input file '%s': %s", Name, strerror (errno)); } } else { /* We are on include level. Search for the file in the include @@ -510,7 +510,7 @@ int NewInputFile (const char* Name) PathName = SearchFile (IncSearchPath, Name); if (PathName == 0 || (F = fopen (PathName, "r")) == 0) { /* Not found or cannot open, print an error and bail out */ - Error ("Cannot open include file `%s': %s", Name, strerror (errno)); + Error ("Cannot open include file '%s': %s", Name, strerror (errno)); goto ExitPoint; } @@ -527,7 +527,7 @@ int NewInputFile (const char* Name) ** here. */ if (FileStat (Name, &Buf) != 0) { - Fatal ("Cannot stat input file `%s': %s", Name, strerror (errno)); + Fatal ("Cannot stat input file '%s': %s", Name, strerror (errno)); } /* Add the file to the input file table and remember the index */ @@ -794,6 +794,43 @@ static void ReadStringConst (int StringTerm) break; } + if (C == '\\' && StringEscapes) { + NextChar (); + + switch (C) { + case EOF: + Error ("Unterminated escape sequence in string constant"); + break; + case '\\': + case '\'': + case '"': + break; + case 't': + C = '\x09'; + break; + case 'r': + C = '\x0D'; + break; + case 'n': + C = '\x0A'; + break; + case 'x': + NextChar (); + if (IsXDigit (C)) { + char high_nibble = DigitVal (C) << 4; + NextChar (); + if (IsXDigit (C)) { + C = high_nibble | DigitVal (C); + break; + } + } + /* otherwise, fall through */ + default: + Error ("Unsupported escape sequence in string constant"); + break; + } + } + /* Append the char to the string */ SB_AppendChar (&CurTok.SVal, C); @@ -1054,7 +1091,7 @@ Again: /* Not found */ if (!LeadingDotInIdents) { /* Invalid pseudo instruction */ - Error ("`%m%p' is not a recognized control command", &CurTok.SVal); + Error ("'%m%p' is not a recognized control command", &CurTok.SVal); goto Again; } diff --git a/src/ca65/segment.c b/src/ca65/segment.c index 35a41ffe1..aa9a48512 100644 --- a/src/ca65/segment.c +++ b/src/ca65/segment.c @@ -134,7 +134,7 @@ static Segment* NewSegment (const char* Name, unsigned char AddrSize) /* Check the segment name for invalid names */ if (!ValidSegName (Name)) { - Error ("Illegal segment name: `%s'", Name); + Error ("Illegal segment name: '%s'", Name); } /* Create a new segment and return it */ diff --git a/src/ca65/struct.c b/src/ca65/struct.c index 195f29ba4..5ea7a18ec 100644 --- a/src/ca65/struct.c +++ b/src/ca65/struct.c @@ -261,9 +261,9 @@ static long DoStructInternal (long Offs, unsigned Type) /* End of struct/union definition */ if (Type == STRUCT) { - Consume (TOK_ENDSTRUCT, "`.ENDSTRUCT' expected"); + Consume (TOK_ENDSTRUCT, "'.ENDSTRUCT' expected"); } else { - Consume (TOK_ENDUNION, "`.ENDUNION' expected"); + Consume (TOK_ENDUNION, "'.ENDUNION' expected"); } /* Return the size of the struct */ diff --git a/src/ca65/studyexpr.c b/src/ca65/studyexpr.c index 366b50ff1..90d2d6e18 100644 --- a/src/ca65/studyexpr.c +++ b/src/ca65/studyexpr.c @@ -524,7 +524,7 @@ static void StudySymbol (ExprNode* Expr, ExprDesc* D) if (SymHasUserMark (Sym)) { LIError (&Sym->DefLines, - "Circular reference in definition of symbol `%m%p'", + "Circular reference in definition of symbol '%m%p'", GetSymName (Sym)); ED_SetError (D); } else { diff --git a/src/ca65/symbol.c b/src/ca65/symbol.c index 0b02aab45..3b06fd1a2 100644 --- a/src/ca65/symbol.c +++ b/src/ca65/symbol.c @@ -95,7 +95,7 @@ SymTable* ParseScopedIdent (StrBuf* Name, StrBuf* FullName) if (Scope == 0) { /* Scope not found */ SB_Terminate (FullName); - Error ("No such scope: `%m%p'", FullName); + Error ("No such scope: '%m%p'", FullName); return 0; } @@ -139,7 +139,7 @@ SymTable* ParseScopedIdent (StrBuf* Name, StrBuf* FullName) Scope = SymFindScope (Scope, Name, SYM_FIND_EXISTING); if (Scope == 0) { /* Scope not found */ - Error ("No such scope: `%m%p'", FullName); + Error ("No such scope: '%m%p'", FullName); return 0; } diff --git a/src/ca65/symentry.c b/src/ca65/symentry.c index 06c537cf6..cf789da5e 100644 --- a/src/ca65/symentry.c +++ b/src/ca65/symentry.c @@ -213,24 +213,24 @@ void SymDef (SymEntry* S, ExprNode* Expr, unsigned char AddrSize, unsigned Flags { if (S->Flags & SF_IMPORT) { /* Defined symbol is marked as imported external symbol */ - Error ("Symbol `%m%p' is already an import", GetSymName (S)); + Error ("Symbol '%m%p' is already an import", GetSymName (S)); return; } if ((Flags & SF_VAR) != 0 && (S->Flags & (SF_EXPORT | SF_GLOBAL))) { /* Variable symbols cannot be exports or globals */ - Error ("Var symbol `%m%p' cannot be an export or global symbol", GetSymName (S)); + Error ("Var symbol '%m%p' cannot be an export or global symbol", GetSymName (S)); return; } if (S->Flags & SF_DEFINED) { /* Multiple definition. In case of a variable, this is legal. */ if ((S->Flags & SF_VAR) == 0) { - Error ("Symbol `%m%p' is already defined", GetSymName (S)); + Error ("Symbol '%m%p' is already defined", GetSymName (S)); S->Flags |= SF_MULTDEF; return; } else { /* Redefinition must also be a variable symbol */ if ((Flags & SF_VAR) == 0) { - Error ("Symbol `%m%p' is already different kind", GetSymName (S)); + Error ("Symbol '%m%p' is already different kind", GetSymName (S)); return; } /* Delete the current symbol expression, since it will get @@ -285,7 +285,7 @@ void SymDef (SymEntry* S, ExprNode* Expr, unsigned char AddrSize, unsigned Flags S->ExportSize = S->AddrSize; } else if (S->AddrSize > S->ExportSize) { /* We're exporting a symbol smaller than it actually is */ - Warning (1, "Symbol `%m%p' is %s but exported %s", + Warning (1, "Symbol '%m%p' is %s but exported %s", GetSymName (S), AddrSizeToStr (S->AddrSize), AddrSizeToStr (S->ExportSize)); } @@ -315,13 +315,13 @@ void SymImport (SymEntry* S, unsigned char AddrSize, unsigned Flags) /* Mark the given symbol as an imported symbol */ { if (S->Flags & SF_DEFINED) { - Error ("Symbol `%m%p' is already defined", GetSymName (S)); + Error ("Symbol '%m%p' is already defined", GetSymName (S)); S->Flags |= SF_MULTDEF; return; } if (S->Flags & SF_EXPORT) { /* The symbol is already marked as exported symbol */ - Error ("Cannot import exported symbol `%m%p'", GetSymName (S)); + Error ("Cannot import exported symbol '%m%p'", GetSymName (S)); return; } @@ -337,16 +337,16 @@ void SymImport (SymEntry* S, unsigned char AddrSize, unsigned Flags) */ if (S->Flags & SF_IMPORT) { if ((Flags & SF_FORCED) != (S->Flags & SF_FORCED)) { - Error ("Redeclaration mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Redeclaration mismatch for symbol '%m%p'", GetSymName (S)); } if (AddrSize != S->AddrSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } } if (S->Flags & SF_GLOBAL) { S->Flags &= ~SF_GLOBAL; if (AddrSize != S->AddrSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } } @@ -369,12 +369,12 @@ void SymExport (SymEntry* S, unsigned char AddrSize, unsigned Flags) /* Check if it's ok to export the symbol */ if (S->Flags & SF_IMPORT) { /* The symbol is already marked as imported external symbol */ - Error ("Symbol `%m%p' is already an import", GetSymName (S)); + Error ("Symbol '%m%p' is already an import", GetSymName (S)); return; } if (S->Flags & SF_VAR) { /* Variable symbols cannot be exported */ - Error ("Var symbol `%m%p' cannot be exported", GetSymName (S)); + Error ("Var symbol '%m%p' cannot be exported", GetSymName (S)); return; } @@ -383,7 +383,7 @@ void SymExport (SymEntry* S, unsigned char AddrSize, unsigned Flags) */ if (S->Flags & SF_GLOBAL) { if (AddrSize != S->ExportSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } S->Flags &= ~SF_GLOBAL; @@ -398,7 +398,7 @@ void SymExport (SymEntry* S, unsigned char AddrSize, unsigned Flags) */ if ((S->Flags & (SF_EXPORT|SF_DEFINED)) == SF_EXPORT) { if (S->ExportSize != AddrSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } } S->ExportSize = AddrSize; @@ -412,7 +412,7 @@ void SymExport (SymEntry* S, unsigned char AddrSize, unsigned Flags) S->ExportSize = S->AddrSize; } else if (S->AddrSize > S->ExportSize) { /* We're exporting a symbol smaller than it actually is */ - Warning (1, "Symbol `%m%p' is %s but exported %s", + Warning (1, "Symbol '%m%p' is %s but exported %s", GetSymName (S), AddrSizeToStr (S->AddrSize), AddrSizeToStr (S->ExportSize)); } @@ -434,7 +434,7 @@ void SymGlobal (SymEntry* S, unsigned char AddrSize, unsigned Flags) { if (S->Flags & SF_VAR) { /* Variable symbols cannot be exported or imported */ - Error ("Var symbol `%m%p' cannot be made global", GetSymName (S)); + Error ("Var symbol '%m%p' cannot be made global", GetSymName (S)); return; } @@ -447,7 +447,7 @@ void SymGlobal (SymEntry* S, unsigned char AddrSize, unsigned Flags) AddrSize = GetCurrentSegAddrSize (); } if (AddrSize != S->AddrSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } return; } @@ -459,12 +459,12 @@ void SymGlobal (SymEntry* S, unsigned char AddrSize, unsigned Flags) if ((S->Flags & SF_DEFINED) == 0) { /* Symbol is undefined */ if (AddrSize != S->ExportSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } } else if (AddrSize != ADDR_SIZE_DEFAULT) { /* Symbol is defined and address size given */ if (AddrSize != S->ExportSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } } return; @@ -476,7 +476,7 @@ void SymGlobal (SymEntry* S, unsigned char AddrSize, unsigned Flags) */ if (S->Flags & SF_GLOBAL) { if (AddrSize != S->ExportSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } return; } @@ -494,7 +494,7 @@ void SymGlobal (SymEntry* S, unsigned char AddrSize, unsigned Flags) S->ExportSize = S->AddrSize; } else if (S->AddrSize > S->ExportSize) { /* We're exporting a symbol smaller than it actually is */ - Warning (1, "Symbol `%m%p' is %s but exported %s", + Warning (1, "Symbol '%m%p' is %s but exported %s", GetSymName (S), AddrSizeToStr (S->AddrSize), AddrSizeToStr (S->ExportSize)); } @@ -537,12 +537,12 @@ void SymConDes (SymEntry* S, unsigned char AddrSize, unsigned Type, unsigned Pri /* Check for errors */ if (S->Flags & SF_IMPORT) { /* The symbol is already marked as imported external symbol */ - Error ("Symbol `%m%p' is already an import", GetSymName (S)); + Error ("Symbol '%m%p' is already an import", GetSymName (S)); return; } if (S->Flags & SF_VAR) { /* Variable symbols cannot be exported or imported */ - Error ("Var symbol `%m%p' cannot be exported", GetSymName (S)); + Error ("Var symbol '%m%p' cannot be exported", GetSymName (S)); return; } @@ -552,7 +552,7 @@ void SymConDes (SymEntry* S, unsigned char AddrSize, unsigned Type, unsigned Pri */ if (S->Flags & (SF_EXPORT | SF_GLOBAL)) { if (S->ExportSize != AddrSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } S->Flags &= ~SF_GLOBAL; } @@ -566,7 +566,7 @@ void SymConDes (SymEntry* S, unsigned char AddrSize, unsigned Type, unsigned Pri /* Use the real size of the symbol */ S->ExportSize = S->AddrSize; } else if (S->AddrSize != S->ExportSize) { - Error ("Address size mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Address size mismatch for symbol '%m%p'", GetSymName (S)); } } @@ -575,7 +575,7 @@ void SymConDes (SymEntry* S, unsigned char AddrSize, unsigned Type, unsigned Pri */ if (S->ConDesPrio[Type] != CD_PRIO_NONE) { if (S->ConDesPrio[Type] != Prio) { - Error ("Redeclaration mismatch for symbol `%m%p'", GetSymName (S)); + Error ("Redeclaration mismatch for symbol '%m%p'", GetSymName (S)); } } S->ConDesPrio[Type] = Prio; diff --git a/src/ca65/symtab.c b/src/ca65/symtab.c index 35d5a8066..afe7b3ad6 100644 --- a/src/ca65/symtab.c +++ b/src/ca65/symtab.c @@ -178,7 +178,7 @@ static SymTable* NewSymTable (SymTable* Parent, const StrBuf* Name) } } else { /* Duplicate scope name */ - Internal ("Duplicate scope name: `%m%p'", Name); + Internal ("Duplicate scope name: '%m%p'", Name); } } } @@ -216,7 +216,7 @@ void SymEnterLevel (const StrBuf* ScopeName, unsigned char Type, /* Check if the scope has been defined before */ if (CurrentScope->Flags & ST_DEFINED) { - Error ("Duplicate scope `%m%p'", ScopeName); + Error ("Duplicate scope '%m%p'", ScopeName); } } else { @@ -502,7 +502,7 @@ static void SymCheckUndefined (SymEntry* S) if (Sym->Flags & SF_IMPORT) { /* The symbol is already marked as import */ LIError (&S->RefLines, - "Symbol `%s' is already an import", + "Symbol '%s' is already an import", GetString (Sym->Name)); } if ((Sym->Flags & SF_EXPORT) == 0) { @@ -516,7 +516,7 @@ static void SymCheckUndefined (SymEntry* S) if (Sym->AddrSize > Sym->ExportSize) { /* We're exporting a symbol smaller than it actually is */ LIWarning (&Sym->DefLines, 1, - "Symbol `%m%p' is %s but exported %s", + "Symbol '%m%p' is %s but exported %s", GetSymName (Sym), AddrSizeToStr (Sym->AddrSize), AddrSizeToStr (Sym->ExportSize)); @@ -541,7 +541,7 @@ static void SymCheckUndefined (SymEntry* S) if (S->Flags & SF_EXPORT) { /* We will not auto-import an export */ LIError (&S->RefLines, - "Exported symbol `%m%p' was never defined", + "Exported symbol '%m%p' was never defined", GetSymName (S)); } else { if (AutoImport) { @@ -554,7 +554,7 @@ static void SymCheckUndefined (SymEntry* S) } else { /* Error */ LIError (&S->RefLines, - "Symbol `%m%p' is undefined", + "Symbol '%m%p' is undefined", GetSymName (S)); } } @@ -616,7 +616,7 @@ void SymCheck (void) ReleaseFullLineInfo (&S->RefLines); } else if ((S->Flags & SF_DEFINED) != 0 && (S->Flags & SF_REFERENCED) == 0) { LIWarning (&S->DefLines, 2, - "Symbol `%m%p' is defined but never used", + "Symbol '%m%p' is defined but never used", GetSymName (S)); } @@ -625,7 +625,7 @@ void SymCheck (void) if ((S->Flags & (SF_REFERENCED | SF_FORCED)) == SF_NONE) { /* Imported symbol is not referenced */ LIWarning (&S->DefLines, 2, - "Symbol `%m%p' is imported but never used", + "Symbol '%m%p' is imported but never used", GetSymName (S)); } else { /* Give the import an id, count imports */ @@ -653,7 +653,7 @@ void SymCheck (void) } else if (S->AddrSize > S->ExportSize) { /* We're exporting a symbol smaller than it actually is */ LIWarning (&S->DefLines, 1, - "Symbol `%m%p' is %s but exported %s", + "Symbol '%m%p' is %s but exported %s", GetSymName (S), AddrSizeToStr (S->AddrSize), AddrSizeToStr (S->ExportSize)); @@ -673,7 +673,7 @@ void SymCheck (void) const FilePos* P = S->GuessedUse[S->AddrSize - 1]; if (P) { PWarning (P, 0, - "Didn't use %s addressing for `%m%p'", + "Didn't use %s addressing for '%m%p'", AddrSizeToStr (S->AddrSize), GetSymName (S)); } diff --git a/src/cc65.vcxproj b/src/cc65.vcxproj index 12573e862..a56ecf880 100644 --- a/src/cc65.vcxproj +++ b/src/cc65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {B17EDBD5-DC04-4970-9CBD-56A98B6A3FCA} Win32Proj cc65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/cc65/asmstmt.c b/src/cc65/asmstmt.c index 1fc4e3167..ae4308522 100644 --- a/src/cc65/asmstmt.c +++ b/src/cc65/asmstmt.c @@ -102,7 +102,7 @@ static SymEntry* AsmGetSym (unsigned Arg, unsigned Type) /* Did we find a symbol with this name? */ if (Sym == 0) { - Error ("Undefined symbol `%s' for argument %u", CurTok.Ident, Arg); + Error ("Undefined symbol '%s' for argument %u", CurTok.Ident, Arg); AsmErrorSkip (); return 0; } diff --git a/src/cc65/codeinfo.c b/src/cc65/codeinfo.c index e9d98f5b8..972d48f6a 100644 --- a/src/cc65/codeinfo.c +++ b/src/cc65/codeinfo.c @@ -461,7 +461,7 @@ void GetFuncInfo (const char* Name, unsigned short* Use, unsigned short* Chg) ** use and change all registers. */ if (Debug) { - fprintf (stderr, "No info about internal function `%s'\n", Name); + fprintf (stderr, "No info about internal function '%s'\n", Name); } *Use = REG_ALL; *Chg = REG_ALL; diff --git a/src/cc65/codeopt.c b/src/cc65/codeopt.c index 3116539dc..575398c11 100644 --- a/src/cc65/codeopt.c +++ b/src/cc65/codeopt.c @@ -981,7 +981,7 @@ static OptFunc* GetOptFunc (const char* Name) OptFunc* F = FindOptFunc (Name); if (F == 0) { /* Not found */ - AbEnd ("Optimization step `%s' not found", Name); + AbEnd ("Optimization step '%s' not found", Name); } return F; } @@ -1168,10 +1168,10 @@ static void WriteDebugOutput (CodeSeg* S, const char* Step) /* Output a header line */ if (Step == 0) { /* Initial output */ - WriteOutput ("Initial code for function `%s':\n", + WriteOutput ("Initial code for function '%s':\n", S->Func? S->Func->Name : ""); } else { - WriteOutput ("Code after applying `%s':\n", Step); + WriteOutput ("Code after applying '%s':\n", Step); } /* Output the code segment */ @@ -1512,7 +1512,7 @@ void RunOpt (CodeSeg* S) /* Print the name of the function we are working on */ if (S->Func) { - Print (stdout, 1, "Running optimizer for function `%s'\n", S->Func->Name); + Print (stdout, 1, "Running optimizer for function '%s'\n", S->Func->Name); } else { Print (stdout, 1, "Running optimizer for global code segment\n"); } diff --git a/src/cc65/codeseg.c b/src/cc65/codeseg.c index a808a26f7..ba759988b 100644 --- a/src/cc65/codeseg.c +++ b/src/cc65/codeseg.c @@ -317,12 +317,12 @@ static CodeEntry* ParseInsn (CodeSeg* S, LineInfo* LI, const char* L) /* Expect zp x indirect */ L = SkipSpace (L+1); if (toupper (*L) != 'X') { - Error ("ASM code error: `X' expected"); + Error ("ASM code error: 'X' expected"); return 0; } L = SkipSpace (L+1); if (*L != ')') { - Error ("ASM code error: `)' expected"); + Error ("ASM code error: ')' expected"); return 0; } L = SkipSpace (L+1); @@ -337,7 +337,7 @@ static CodeEntry* ParseInsn (CodeSeg* S, LineInfo* LI, const char* L) if (*L == ',') { L = SkipSpace (L+1); if (toupper (*L) != 'Y') { - Error ("ASM code error: `Y' expected"); + Error ("ASM code error: 'Y' expected"); return 0; } L = SkipSpace (L+1); @@ -378,7 +378,7 @@ static CodeEntry* ParseInsn (CodeSeg* S, LineInfo* LI, const char* L) /* Check for subroutine call to local label */ if ((OPC->Info & OF_CALL) && IsLocalLabelName (Arg)) { Error ("ASM code error: " - "Cannot use local label `%s' in subroutine call", + "Cannot use local label '%s' in subroutine call", Arg); } AM = AM65_ABS; @@ -532,7 +532,7 @@ void CS_AddVLine (CodeSeg* S, LineInfo* LI, const char* Format, va_list ap) case '.': /* Control instruction */ ReadToken (L, " \t", Token, sizeof (Token)); - Error ("ASM code error: Pseudo instruction `%s' not supported", Token); + Error ("ASM code error: Pseudo instruction '%s' not supported", Token); break; default: @@ -780,7 +780,7 @@ CodeLabel* CS_AddLabel (CodeSeg* S, const char* Name) if (L) { /* We found it - be sure it does not already have an owner */ if (L->Owner) { - Error ("ASM label `%s' is already defined", Name); + Error ("ASM label '%s' is already defined", Name); return L; } } else { @@ -790,7 +790,7 @@ CodeLabel* CS_AddLabel (CodeSeg* S, const char* Name) /* Safety. This call is quite costly, but safety is better */ if (CollIndex (&S->Labels, L) >= 0) { - Error ("ASM label `%s' is already defined", Name); + Error ("ASM label '%s' is already defined", Name); return L; } @@ -906,7 +906,7 @@ void CS_MergeLabels (CodeSeg* S) /* Print some debugging output */ if (Debug) { - printf ("Removing unused global label `%s'", X->Name); + printf ("Removing unused global label '%s'", X->Name); } /* And free the label */ diff --git a/src/cc65/compile.c b/src/cc65/compile.c index d79ef350b..9cc7f9641 100644 --- a/src/cc65/compile.c +++ b/src/cc65/compile.c @@ -192,7 +192,7 @@ static void Parse (void) /* This is a definition */ if (SymIsDef (Entry)) { - Error ("Global variable `%s' has already been defined", + Error ("Global variable '%s' has already been defined", Entry->Name); } Entry->Flags |= SC_DEF; @@ -204,11 +204,11 @@ static void Parse (void) if (!IsTypeVoid (Decl.Type)) { if (!IsTypeArray (Decl.Type)) { /* Size is unknown and not an array */ - Error ("Variable `%s' has unknown size", Decl.Ident); + Error ("Variable '%s' has unknown size", Decl.Ident); } } else if (IS_Get (&Standard) != STD_CC65) { /* We cannot declare variables of type void */ - Error ("Illegal type for variable `%s'", Decl.Ident); + Error ("Illegal type for variable '%s'", Decl.Ident); } } @@ -234,12 +234,12 @@ static void Parse (void) if (IsTypeVoid (Decl.Type)) { /* We cannot declare variables of type void */ - Error ("Illegal type for variable `%s'", Decl.Ident); + Error ("Illegal type for variable '%s'", Decl.Ident); Entry->Flags &= ~(SC_STORAGE | SC_DEF); } else if (Size == 0) { /* Size is unknown. Is it an array? */ if (!IsTypeArray (Decl.Type)) { - Error ("Variable `%s' has unknown size", Decl.Ident); + Error ("Variable '%s' has unknown size", Decl.Ident); } Entry->Flags &= ~(SC_STORAGE | SC_DEF); } else { @@ -256,7 +256,7 @@ static void Parse (void) const char* bssName = GetSegName (SEG_BSS); if (Entry->V.BssName && strcmp (Entry->V.BssName, bssName) != 0) { - Error ("Global variable `%s' already was defined in the `%s' segment.", + Error ("Global variable '%s' already was defined in the '%s' segment.", Entry->Name, Entry->V.BssName); } Entry->V.BssName = xstrdup (bssName); @@ -286,7 +286,7 @@ static void Parse (void) /* Function body. Check for duplicate function definitions */ if (SymIsDef (Entry)) { - Error ("Body for function `%s' has already been defined", + Error ("Body for function '%s' has already been defined", Entry->Name); } diff --git a/src/cc65/declare.c b/src/cc65/declare.c index 19100781c..e3b5edfec 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -102,7 +102,7 @@ static unsigned ParseInitInternal (Type* T, int AllowFlexibleMembers); static void DuplicateQualifier (const char* Name) /* Print an error message */ { - Warning ("Duplicate qualifier: `%s'", Name); + Warning ("Duplicate qualifier: '%s'", Name); } @@ -551,7 +551,7 @@ static SymEntry* StructOrUnionForwardDecl (const char* Name, unsigned Type) Entry = AddStructSym (Name, Type, 0, 0); } else if ((Entry->Flags & SC_TYPEMASK) != Type) { /* Already defined, but no struct */ - Error ("Symbol `%s' is already different kind", Name); + Error ("Symbol '%s' is already different kind", Name); } return Entry; } @@ -1070,7 +1070,7 @@ static void ParseTypeSpec (DeclSpec* D, long Default, TypeCode Qualifiers) Entry = FindTagSym (CurTok.Ident); if (Entry) { if (SymIsLocal (Entry) && (Entry->Flags & SC_ENUM) == 0) { - Error ("Symbol `%s' is already different kind", Entry->Name); + Error ("Symbol '%s' is already different kind", Entry->Name); } } else { /* Insert entry into table ### */ @@ -1211,10 +1211,10 @@ static void ParseOldStyleParamList (FuncDesc* F) Sym->Flags &= ~SC_DEFTYPE; } else { /* Type has already been changed */ - Error ("Redefinition for parameter `%s'", Sym->Name); + Error ("Redefinition for parameter '%s'", Sym->Name); } } else { - Error ("Unknown identifier: `%s'", Decl.Ident); + Error ("Unknown identifier: '%s'", Decl.Ident); } } @@ -1291,7 +1291,7 @@ static void ParseAnsiParamList (FuncDesc* F) /* If the parameter is a struct or union, emit a warning */ if (IsClassStruct (Decl.Type)) { if (IS_Get (&WarnStructParam)) { - Warning ("Passing struct by value for parameter `%s'", Decl.Ident); + Warning ("Passing struct by value for parameter '%s'", Decl.Ident); } } @@ -1512,7 +1512,7 @@ static void Declarator (const DeclSpec* Spec, Declaration* D, declmode_t Mode) ConstAbsIntExpr (hie1, &Expr); if (Expr.IVal <= 0) { if (D->Ident[0] != '\0') { - Error ("Size of array `%s' is invalid", D->Ident); + Error ("Size of array '%s' is invalid", D->Ident); } else { Error ("Size of array is invalid"); } @@ -1534,16 +1534,16 @@ static void Declarator (const DeclSpec* Spec, Declaration* D, declmode_t Mode) /* If we have remaining qualifiers, flag them as invalid */ if (Qualifiers & T_QUAL_NEAR) { - Error ("Invalid `__near__' qualifier"); + Error ("Invalid '__near__' qualifier"); } if (Qualifiers & T_QUAL_FAR) { - Error ("Invalid `__far__' qualifier"); + Error ("Invalid '__far__' qualifier"); } if (Qualifiers & T_QUAL_FASTCALL) { - Error ("Invalid `__fastcall__' qualifier"); + Error ("Invalid '__fastcall__' qualifier"); } if (Qualifiers & T_QUAL_CDECL) { - Error ("Invalid `__cdecl__' qualifier"); + Error ("Invalid '__cdecl__' qualifier"); } } @@ -1637,7 +1637,7 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, declmode_t Mode) ** have the C89 standard enabled explicitly. */ if (IS_Get (&Standard) >= STD_C99) { - Warning ("Implicit `int' return type is an obsolete feature"); + Warning ("Implicit 'int' return type is an obsolete feature"); } GetFuncDesc (D->Type)->Flags |= FD_OLDSTYLE_INTRET; } @@ -1653,7 +1653,7 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, declmode_t Mode) ** for variables with implicit int type. */ if ((Spec->Flags & DS_DEF_TYPE) != 0 && IS_Get (&Standard) >= STD_C99) { - Warning ("Implicit `int' is an obsolete feature"); + Warning ("Implicit 'int' is an obsolete feature"); } } @@ -1662,7 +1662,7 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, declmode_t Mode) unsigned Size = SizeOf (D->Type); if (Size >= 0x10000) { if (D->Ident[0] != '\0') { - Error ("Size of `%s' is invalid (0x%06X)", D->Ident, Size); + Error ("Size of '%s' is invalid (0x%06X)", D->Ident, Size); } else { Error ("Invalid size in declaration (0x%06X)", Size); } @@ -1735,7 +1735,7 @@ static unsigned OpeningCurlyBraces (unsigned BracesNeeded) NextToken (); } if (BraceCount < BracesNeeded) { - Error ("`{' expected"); + Error ("'{' expected"); } return BraceCount; } @@ -1755,7 +1755,7 @@ static void ClosingCurlyBraces (unsigned BracesExpected) NextToken (); NextToken (); } else { - Error ("`}' expected"); + Error ("'}' expected"); return; } --BracesExpected; diff --git a/src/cc65/declattr.c b/src/cc65/declattr.c index bdaea20d6..37048e69b 100644 --- a/src/cc65/declattr.c +++ b/src/cc65/declattr.c @@ -225,7 +225,7 @@ void ParseAttribute (Declaration* D) } else { /* Attribute not known, maybe typo */ - Error ("Illegal attribute: `%s'", AttrName); + Error ("Illegal attribute: '%s'", AttrName); /* Skip until end of attribute */ ErrorSkip (); diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 55c6391d2..320ac2321 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -791,9 +791,9 @@ static void Primary (ExprDesc* E) ** list and returning int. */ if (IS_Get (&Standard) >= STD_C99) { - Error ("Call to undefined function `%s'", Ident); + Error ("Call to undefined function '%s'", Ident); } else { - Warning ("Call to undefined function `%s'", Ident); + Warning ("Call to undefined function '%s'", Ident); } Sym = AddGlobalSym (Ident, GetImplicitFuncType(), SC_EXTERN | SC_REF | SC_FUNC); E->Type = Sym->Type; @@ -804,7 +804,7 @@ static void Primary (ExprDesc* E) Sym = AddLocalSym (Ident, type_int, SC_AUTO | SC_REF, 0); E->Flags = E_LOC_STACK | E_RTYPE_LVAL; E->Type = type_int; - Error ("Undefined symbol: `%s'", Ident); + Error ("Undefined symbol: '%s'", Ident); } } @@ -1174,7 +1174,7 @@ static void StructRef (ExprDesc* Expr) NextToken (); Field = FindStructField (Expr->Type, Ident); if (Field == 0) { - Error ("Struct/union has no field named `%s'", Ident); + Error ("Struct/union has no field named '%s'", Ident); /* Make the expression an integer at address zero */ ED_MakeConstAbs (Expr, 0, type_int); return; @@ -2485,7 +2485,7 @@ static void parseadd (ExprDesc* Expr) typeadjust (Expr, &Expr2, 1); } else { /* OOPS */ - Error ("Invalid operands for binary operator `+'"); + Error ("Invalid operands for binary operator '+'"); } } else { @@ -2567,7 +2567,7 @@ static void parseadd (ExprDesc* Expr) } } else { /* OOPS */ - Error ("Invalid operands for binary operator `+'"); + Error ("Invalid operands for binary operator '+'"); flags = CF_INT; } @@ -2611,7 +2611,7 @@ static void parseadd (ExprDesc* Expr) flags = typeadjust (Expr, &Expr2, 1); } else { /* OOPS */ - Error ("Invalid operands for binary operator `+'"); + Error ("Invalid operands for binary operator '+'"); flags = CF_INT; } @@ -2653,7 +2653,7 @@ static void parseadd (ExprDesc* Expr) flags = typeadjust (Expr, &Expr2, 0) & ~CF_CONST; } else { /* OOPS */ - Error ("Invalid operands for binary operator `+'"); + Error ("Invalid operands for binary operator '+'"); flags = CF_INT; } @@ -2689,7 +2689,7 @@ static void parsesub (ExprDesc* Expr) /* lhs cannot be function or pointer to function */ if (IsTypeFunc (Expr->Type) || IsTypeFuncPtr (Expr->Type)) { - Error ("Invalid left operand for binary operator `-'"); + Error ("Invalid left operand for binary operator '-'"); /* Make it pointer to char to avoid further errors */ Expr->Type = type_uchar; } @@ -2712,7 +2712,7 @@ static void parsesub (ExprDesc* Expr) /* rhs cannot be function or pointer to function */ if (IsTypeFunc (Expr2.Type) || IsTypeFuncPtr (Expr2.Type)) { - Error ("Invalid right operand for binary operator `-'"); + Error ("Invalid right operand for binary operator '-'"); /* Make it pointer to char to avoid further errors */ Expr2.Type = type_uchar; } @@ -2750,7 +2750,7 @@ static void parsesub (ExprDesc* Expr) Expr->IVal -= Expr2.IVal; } else { /* OOPS */ - Error ("Invalid operands for binary operator `-'"); + Error ("Invalid operands for binary operator '-'"); } /* Result is constant, condition codes not set */ @@ -2783,7 +2783,7 @@ static void parsesub (ExprDesc* Expr) flags = typeadjust (Expr, &Expr2, 1); } else { /* OOPS */ - Error ("Invalid operands for binary operator `-'"); + Error ("Invalid operands for binary operator '-'"); flags = CF_INT; } @@ -2837,7 +2837,7 @@ static void parsesub (ExprDesc* Expr) flags = typeadjust (Expr, &Expr2, 0); } else { /* OOPS */ - Error ("Invalid operands for binary operator `-'"); + Error ("Invalid operands for binary operator '-'"); flags = CF_INT; } @@ -3304,7 +3304,7 @@ static void opeq (const GenDesc* Gen, ExprDesc* Expr, const char* Op) /* The rhs must be an integer (or a float, but we don't support that yet */ if (!IsClassInt (Expr2.Type)) { - Error ("Invalid right operand for binary operator `%s'", Op); + Error ("Invalid right operand for binary operator '%s'", Op); /* Continue. Wrong code will be generated, but the compiler won't ** break, so this is the best error recovery. */ @@ -3421,7 +3421,7 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *Expr, const char* Op) */ hie1 (&Expr2); if (!IsClassInt (Expr2.Type)) { - Error ("Invalid right operand for binary operator `%s'", Op); + Error ("Invalid right operand for binary operator '%s'", Op); /* Continue. Wrong code will be generated, but the compiler won't ** break, so this is the best error recovery. */ diff --git a/src/cc65/function.c b/src/cc65/function.c index 97d6916ff..3256d7541 100644 --- a/src/cc65/function.c +++ b/src/cc65/function.c @@ -422,14 +422,14 @@ void NewFunc (SymEntry* Func) /* Main cannot be a fastcall function */ if (IsQualFastcall (Func->Type)) { - Error ("`main' cannot be declared as __fastcall__"); + Error ("'main' cannot be declared as __fastcall__"); } /* If cc65 extensions aren't enabled, don't allow a main function that ** doesn't return an int. */ if (IS_Get (&Standard) != STD_CC65 && CurrentFunc->ReturnType[0].C != T_INT) { - Error ("`main' must always return an int"); + Error ("'main' must always return an int"); } /* Add a forced import of a symbol that is contained in the startup diff --git a/src/cc65/hexval.c b/src/cc65/hexval.c index 37e43da14..ce4e33acf 100644 --- a/src/cc65/hexval.c +++ b/src/cc65/hexval.c @@ -54,7 +54,7 @@ unsigned HexVal (int C) */ { if (!IsXDigit (C)) { - Error ("Invalid hexadecimal digit: `%c'", C); + Error ("Invalid hexadecimal digit: '%c'", C); } if (IsDigit (C)) { return C - '0'; diff --git a/src/cc65/input.c b/src/cc65/input.c index 005e0c668..22a66e1f7 100644 --- a/src/cc65/input.c +++ b/src/cc65/input.c @@ -174,7 +174,7 @@ static AFile* NewAFile (IFile* IF, FILE* F) struct stat Buf; if (FileStat (IF->Name, &Buf) != 0) { /* Error */ - Fatal ("Cannot stat `%s': %s", IF->Name, strerror (errno)); + Fatal ("Cannot stat '%s': %s", IF->Name, strerror (errno)); } IF->Size = (unsigned long) Buf.st_size; IF->MTime = (unsigned long) Buf.st_mtime; @@ -251,7 +251,7 @@ void OpenMainFile (const char* Name) FILE* F = fopen (Name, "r"); if (F == 0) { /* Cannot open */ - Fatal ("Cannot open input file `%s': %s", Name, strerror (errno)); + Fatal ("Cannot open input file '%s': %s", Name, strerror (errno)); } /* Allocate a new AFile structure for the file */ @@ -284,7 +284,7 @@ void OpenIncludeFile (const char* Name, InputType IT) /* Search for the file */ N = SearchFile ((IT == IT_SYSINC)? SysIncSearchPath : UsrIncSearchPath, Name); if (N == 0) { - PPError ("Include file `%s' not found", Name); + PPError ("Include file '%s' not found", Name); return; } @@ -303,12 +303,12 @@ void OpenIncludeFile (const char* Name, InputType IT) F = fopen (IF->Name, "r"); if (F == 0) { /* Error opening the file */ - PPError ("Cannot open include file `%s': %s", IF->Name, strerror (errno)); + PPError ("Cannot open include file '%s': %s", IF->Name, strerror (errno)); return; } /* Debugging output */ - Print (stdout, 1, "Opened include file `%s'\n", IF->Name); + Print (stdout, 1, "Opened include file '%s'\n", IF->Name); /* Allocate a new AFile structure */ (void) NewAFile (IF, F); @@ -619,7 +619,7 @@ static void CreateDepFile (const char* Name, InputType Types) /* Open the file */ FILE* F = fopen (Name, "w"); if (F == 0) { - Fatal ("Cannot open dependency file `%s': %s", Name, strerror (errno)); + Fatal ("Cannot open dependency file '%s': %s", Name, strerror (errno)); } /* If a dependency target was given, use it, otherwise use the output diff --git a/src/cc65/locals.c b/src/cc65/locals.c index 36afb6223..d0aab7f9c 100644 --- a/src/cc65/locals.c +++ b/src/cc65/locals.c @@ -143,7 +143,7 @@ static void ParseRegisterDecl (Declaration* Decl, int Reg) ** we cannot allow that here. */ if (ParseInit (Sym->Type) != Size) { - Error ("Cannot initialize flexible array members of storage class `register'"); + Error ("Cannot initialize flexible array members of storage class 'register'"); } /* Generate code to copy this data into the variable space */ @@ -171,7 +171,7 @@ static void ParseRegisterDecl (Declaration* Decl, int Reg) /* Cannot allocate a variable of zero size */ if (Size == 0) { - Error ("Variable `%s' has unknown size", Decl->Ident); + Error ("Variable '%s' has unknown size", Decl->Ident); } } @@ -356,7 +356,7 @@ static void ParseAutoDecl (Declaration* Decl) /* Cannot allocate a variable of zero size */ if (Size == 0) { - Error ("Variable `%s' has unknown size", Decl->Ident); + Error ("Variable '%s' has unknown size", Decl->Ident); } } @@ -410,7 +410,7 @@ static void ParseStaticDecl (Declaration* Decl) /* Cannot allocate a variable of zero size */ if (Size == 0) { - Error ("Variable `%s' has unknown size", Decl->Ident); + Error ("Variable '%s' has unknown size", Decl->Ident); } } diff --git a/src/cc65/macrotab.c b/src/cc65/macrotab.c index daf5cd7b8..09f0db50a 100644 --- a/src/cc65/macrotab.c +++ b/src/cc65/macrotab.c @@ -245,7 +245,7 @@ void AddMacroArg (Macro* M, const char* Arg) for (I = 0; I < CollCount (&M->FormalArgs); ++I) { if (strcmp (CollAtUnchecked (&M->FormalArgs, I), Arg) == 0) { /* Found */ - Error ("Duplicate macro parameter: `%s'", Arg); + Error ("Duplicate macro parameter: '%s'", Arg); break; } } diff --git a/src/cc65/main.c b/src/cc65/main.c index 7783587aa..871e21ebc 100644 --- a/src/cc65/main.c +++ b/src/cc65/main.c @@ -160,7 +160,7 @@ static void SetSys (const char* Sys) break; case TGT_MODULE: - AbEnd ("Cannot use `module' as a target for the compiler"); + AbEnd ("Cannot use 'module' as a target for the compiler"); break; case TGT_ATARI2600: @@ -256,7 +256,7 @@ static void SetSys (const char* Sys) case TGT_TELESTRAT: DefineNumericMacro ("__TELESTRAT__", 1); break; - + case TGT_NES: DefineNumericMacro ("__NES__", 1); break; @@ -300,7 +300,11 @@ static void FileNameOption (const char* Opt, const char* Arg, StrBuf* Name) { /* Cannot have the option twice */ if (SB_NotEmpty (Name)) { - AbEnd ("Cannot use option `%s' twice", Opt); + AbEnd ("Cannot use option '%s' twice", Opt); + } + /* A typo in OptTab[] might allow a NULL Arg */ + if (Arg == 0) { + Internal ("Typo in OptTab[]; option '%s' should require an argument", Opt); } /* Remember the file name for later */ SB_CopyStr (Name, Arg); @@ -358,7 +362,7 @@ static void CheckSegName (const char* Seg) { /* Print an error and abort if the name is not ok */ if (!ValidSegName (Seg)) { - AbEnd ("Segment name `%s' is invalid", Seg); + AbEnd ("Segment name '%s' is invalid", Seg); } } @@ -455,7 +459,7 @@ static void OptCPU (const char* Opt, const char* Arg) CPU = FindCPU (Arg); if (CPU != CPU_6502 && CPU != CPU_6502X && CPU != CPU_65SC02 && CPU != CPU_65C02 && CPU != CPU_65816 && CPU != CPU_HUC6280) { - AbEnd ("Invalid argument for %s: `%s'", Opt, Arg); + AbEnd ("Invalid argument for %s: '%s'", Opt, Arg); } } @@ -500,7 +504,7 @@ static void OptDebugOpt (const char* Opt attribute ((unused)), const char* Arg) /* Open the file */ FILE* F = fopen (Arg, "r"); if (F == 0) { - AbEnd ("Cannot open `%s': %s", Arg, strerror (errno)); + AbEnd ("Cannot open '%s': %s", Arg, strerror (errno)); } /* Read line by line, ignore empty lines and switch optimization @@ -558,7 +562,7 @@ static void OptDebugOpt (const char* Opt attribute ((unused)), const char* Arg) -static void OptDebugOptOutput (const char* Opt attribute ((unused)), +static void OptDebugOptOutput (const char* Opt attribute ((unused)), const char* Arg attribute ((unused))) /* Output optimization steps */ { @@ -671,7 +675,7 @@ static void OptMemoryModel (const char* Opt, const char* Arg) /* Check the current memory model */ if (MemoryModel != MMODEL_UNKNOWN) { - AbEnd ("Cannot use option `%s' twice", Opt); + AbEnd ("Cannot use option '%s' twice", Opt); } /* Translate the memory model name and check it */ @@ -735,7 +739,7 @@ static void OptStandard (const char* Opt, const char* Arg) /* Find the standard from the given name */ standard_t Std = FindStandard (Arg); if (Std == STD_UNKNOWN) { - AbEnd ("Invalid argument for %s: `%s'", Opt, Arg); + AbEnd ("Invalid argument for %s: '%s'", Opt, Arg); } else if (IS_Get (&Standard) != STD_UNKNOWN) { AbEnd ("Option %s given more than once", Opt); } else { @@ -1065,7 +1069,7 @@ int main (int argc, char* argv[]) /* Write the output to the file */ WriteAsmOutput (); - Print (stdout, 1, "Wrote output to `%s'\n", OutputFilename); + Print (stdout, 1, "Wrote output to '%s'\n", OutputFilename); /* Close the file, check for errors */ CloseOutputFile (); diff --git a/src/cc65/output.c b/src/cc65/output.c index e0b06ef99..6ce5334ca 100644 --- a/src/cc65/output.c +++ b/src/cc65/output.c @@ -102,9 +102,9 @@ void OpenOutputFile () /* Open the file */ OutputFile = fopen (OutputFilename, "w"); if (OutputFile == 0) { - Fatal ("Cannot open output file `%s': %s", OutputFilename, strerror (errno)); + Fatal ("Cannot open output file '%s': %s", OutputFilename, strerror (errno)); } - Print (stdout, 1, "Opened output file `%s'\n", OutputFilename); + Print (stdout, 1, "Opened output file '%s'\n", OutputFilename); } @@ -120,9 +120,9 @@ void OpenDebugOutputFile (const char* Name) /* Open the file */ OutputFile = fopen (Name, "w"); if (OutputFile == 0) { - Fatal ("Cannot open debug output file `%s': %s", Name, strerror (errno)); + Fatal ("Cannot open debug output file '%s': %s", Name, strerror (errno)); } - Print (stdout, 1, "Opened debug output file `%s'\n", Name); + Print (stdout, 1, "Opened debug output file '%s'\n", Name); } @@ -138,7 +138,7 @@ void CloseOutputFile () remove (OutputFilename); Fatal ("Cannot write to output file (disk full?)"); } - Print (stdout, 1, "Closed output file `%s'\n", OutputFilename); + Print (stdout, 1, "Closed output file '%s'\n", OutputFilename); OutputFile = 0; } diff --git a/src/cc65/pragma.c b/src/cc65/pragma.c index 64ea4a1aa..1a24a08d9 100644 --- a/src/cc65/pragma.c +++ b/src/cc65/pragma.c @@ -356,7 +356,7 @@ static int BoolKeyword (StrBuf* Ident) } /* Error */ - Error ("Pragma argument must be one of `on', `off', `true' or `false'"); + Error ("Pragma argument must be one of 'on', 'off', 'true' or 'false'"); return 0; } @@ -453,7 +453,7 @@ static void SegNamePragma (StrBuf* B, segment_t Seg) } else { /* Segment name is invalid */ - Error ("Illegal segment name: `%s'", Name); + Error ("Illegal segment name: '%s'", Name); } @@ -788,7 +788,7 @@ static void ParsePragma (void) ** for unknown pragmas, but warn about them if enabled (the default). */ if (IS_Get (&WarnUnknownPragma)) { - Warning ("Unknown pragma `%s'", SB_GetConstBuf (&Ident)); + Warning ("Unknown pragma '%s'", SB_GetConstBuf (&Ident)); } goto ExitPoint; } diff --git a/src/cc65/preproc.c b/src/cc65/preproc.c index 99ce6acc1..1c4837d94 100644 --- a/src/cc65/preproc.c +++ b/src/cc65/preproc.c @@ -304,7 +304,7 @@ static void OldStyleComment (void) } } else { if (CurC == '/' && NextC == '*') { - PPWarning ("`/*' found inside a comment"); + PPWarning ("'/*' found inside a comment"); } NextChar (); } @@ -491,7 +491,7 @@ static void ReadMacroArgs (MacroExp* E) NewStyleComment (); } else if (CurC == '\0') { /* End of input inside macro argument list */ - PPError ("Unterminated argument list invoking macro `%s'", E->M->Name); + PPError ("Unterminated argument list invoking macro '%s'", E->M->Name); ClearLine (); break; @@ -611,7 +611,7 @@ static void MacroArgSubst (MacroExp* E) NextChar (); SkipWhitespace (0); if (!IsSym (Ident) || (ArgIdx = FindMacroArg (E->M, Ident)) < 0) { - PPError ("`#' is not followed by a macro parameter"); + PPError ("'#' is not followed by a macro parameter"); } else { /* Make a valid string from Replacement */ Arg = ME_GetActual (E, ArgIdx); @@ -782,7 +782,7 @@ static void DefineMacro (void) /* Ellipsis */ NextChar (); if (CurC != '.' || NextC != '.') { - PPError ("`...' expected"); + PPError ("'...' expected"); ClearLine (); return; } @@ -803,7 +803,7 @@ static void DefineMacro (void) /* __VA_ARGS__ is only allowed in C89 mode */ if (!C89 && strcmp (Ident, "__VA_ARGS__") == 0) { - PPWarning ("`__VA_ARGS__' can only appear in the expansion " + PPWarning ("'__VA_ARGS__' can only appear in the expansion " "of a C99 variadic macro"); } @@ -823,7 +823,7 @@ static void DefineMacro (void) /* Check for a right paren and eat it if we find one */ if (CurC != ')') { - PPError ("`)' expected"); + PPError ("')' expected"); ClearLine (); return; } @@ -900,7 +900,7 @@ static unsigned Pass1 (StrBuf* Source, StrBuf* Target) if (HaveParen) { SkipWhitespace (0); if (CurC != ')') { - PPError ("`)' expected"); + PPError ("')' expected"); } else { NextChar (); } @@ -1138,7 +1138,7 @@ static void DoInclude (void) break; default: - PPError ("`\"' or `<' expected"); + PPError ("'\"' or '<' expected"); goto Done; } NextChar (); @@ -1295,7 +1295,7 @@ void Preprocess (void) PPError ("Duplicate #else"); } } else { - PPError ("Unexpected `#else'"); + PPError ("Unexpected '#else'"); } break; @@ -1314,7 +1314,7 @@ void Preprocess (void) /* Remove the clause that needs a terminator */ Skip = (IfStack[IfIndex--] & IFCOND_SKIP) != 0; } else { - PPError ("Unexpected `#endif'"); + PPError ("Unexpected '#endif'"); } break; @@ -1387,7 +1387,7 @@ void Preprocess (void) } if (NextLine () == 0) { if (IfIndex >= 0) { - PPError ("`#endif' expected"); + PPError ("'#endif' expected"); } return; } diff --git a/src/cc65/scanner.c b/src/cc65/scanner.c index 8605f55a5..695085e94 100644 --- a/src/cc65/scanner.c +++ b/src/cc65/scanner.c @@ -377,7 +377,7 @@ static void CharConst (void) /* Check for closing quote */ if (CurC != '\'') { - Error ("`\'' expected"); + Error ("'\'' expected"); } else { /* Skip the quote */ NextChar (); @@ -1044,7 +1044,7 @@ int Consume (token_t Token, const char* ErrorMsg) int ConsumeColon (void) /* Check for a colon and skip it. */ { - return Consume (TOK_COLON, "`:' expected"); + return Consume (TOK_COLON, "':' expected"); } @@ -1057,7 +1057,7 @@ int ConsumeSemi (void) NextToken (); return 1; } else { - Error ("`;' expected"); + Error ("';' expected"); if (CurTok.Tok == TOK_COLON || CurTok.Tok == TOK_COMMA) { NextToken (); } @@ -1075,7 +1075,7 @@ int ConsumeComma (void) NextToken (); return 1; } else { - Error ("`,' expected"); + Error ("',' expected"); if (CurTok.Tok == TOK_SEMI) { NextToken (); } @@ -1088,7 +1088,7 @@ int ConsumeComma (void) int ConsumeLParen (void) /* Check for a left parenthesis and skip it */ { - return Consume (TOK_LPAREN, "`(' expected"); + return Consume (TOK_LPAREN, "'(' expected"); } @@ -1096,7 +1096,7 @@ int ConsumeLParen (void) int ConsumeRParen (void) /* Check for a right parenthesis and skip it */ { - return Consume (TOK_RPAREN, "`)' expected"); + return Consume (TOK_RPAREN, "')' expected"); } @@ -1104,7 +1104,7 @@ int ConsumeRParen (void) int ConsumeLBrack (void) /* Check for a left bracket and skip it */ { - return Consume (TOK_LBRACK, "`[' expected"); + return Consume (TOK_LBRACK, "'[' expected"); } @@ -1112,7 +1112,7 @@ int ConsumeLBrack (void) int ConsumeRBrack (void) /* Check for a right bracket and skip it */ { - return Consume (TOK_RBRACK, "`]' expected"); + return Consume (TOK_RBRACK, "']' expected"); } @@ -1120,7 +1120,7 @@ int ConsumeRBrack (void) int ConsumeLCurly (void) /* Check for a left curly brace and skip it */ { - return Consume (TOK_LCURLY, "`{' expected"); + return Consume (TOK_LCURLY, "'{' expected"); } @@ -1128,5 +1128,5 @@ int ConsumeLCurly (void) int ConsumeRCurly (void) /* Check for a right curly brace and skip it */ { - return Consume (TOK_RCURLY, "`}' expected"); + return Consume (TOK_RCURLY, "'}' expected"); } diff --git a/src/cc65/scanstrbuf.c b/src/cc65/scanstrbuf.c index 91abc8cb3..bbee569d2 100644 --- a/src/cc65/scanstrbuf.c +++ b/src/cc65/scanstrbuf.c @@ -271,7 +271,7 @@ int SB_GetNumber (StrBuf* B, long* Val) SB_Skip (B); *Val = SignExtendChar (TgtTranslateChar (ParseChar (B))); if (SB_Peek (B) != '\'') { - Error ("`\'' expected"); + Error ("'\'' expected"); return 0; } else { /* Skip the quote */ diff --git a/src/cc65/stmt.c b/src/cc65/stmt.c index 14169671b..657bc9963 100644 --- a/src/cc65/stmt.c +++ b/src/cc65/stmt.c @@ -115,7 +115,7 @@ static void CheckSemi (int* PendingToken) { int HaveToken = (CurTok.Tok == TOK_SEMI); if (!HaveToken) { - Error ("`;' expected"); + Error ("';' expected"); /* Try to be smart about errors */ if (CurTok.Tok == TOK_COLON || CurTok.Tok == TOK_COMMA) { HaveToken = 1; @@ -231,7 +231,7 @@ static void DoStatement (void) g_defcodelabel (ContinueLabel); /* Parse the end condition */ - Consume (TOK_WHILE, "`while' expected"); + Consume (TOK_WHILE, "'while' expected"); TestInParens (LoopLabel, 1); ConsumeSemi (); @@ -332,7 +332,7 @@ static void ReturnStatement (void) } } else if (!F_HasVoidReturn (CurrentFunc) && !F_HasOldStyleIntRet (CurrentFunc)) { - Error ("Function `%s' must return a value", F_GetFuncName (CurrentFunc)); + Error ("Function '%s' must return a value", F_GetFuncName (CurrentFunc)); } /* Mark the function as having a return statement */ @@ -361,7 +361,7 @@ static void BreakStatement (void) /* Check if we are inside a loop */ if (L == 0) { /* Error: No current loop */ - Error ("`break' statement not within loop or switch"); + Error ("'break' statement not within loop or switch"); return; } @@ -396,7 +396,7 @@ static void ContinueStatement (void) /* Did we find it? */ if (L == 0) { - Error ("`continue' statement not within a loop"); + Error ("'continue' statement not within a loop"); return; } @@ -591,7 +591,7 @@ int Statement (int* PendingToken) case TOK_LCURLY: NextToken (); GotBreak = CompoundStatement (); - CheckTok (TOK_RCURLY, "`{' expected", PendingToken); + CheckTok (TOK_RCURLY, "'{' expected", PendingToken); return GotBreak; case TOK_IF: diff --git a/src/cc65/swstmt.c b/src/cc65/swstmt.c index 512f4257d..4a3730283 100644 --- a/src/cc65/swstmt.c +++ b/src/cc65/swstmt.c @@ -303,7 +303,7 @@ void DefaultLabel (void) } else { /* case keyword outside a switch statement */ - Error ("`default' label not within a switch statement"); + Error ("'default' label not within a switch statement"); } diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 9eb0346e8..56196ea5a 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -168,11 +168,11 @@ static void CheckSymTable (SymTable* Tab) !SymHasAttr (Entry, atUnused)) { if (Flags & SC_PARAM) { if (IS_Get (&WarnUnusedParam)) { - Warning ("Parameter `%s' is never used", Entry->Name); + Warning ("Parameter '%s' is never used", Entry->Name); } } else { if (IS_Get (&WarnUnusedVar)) { - Warning ("`%s' is defined but never used", Entry->Name); + Warning ("'%s' is defined but never used", Entry->Name); } } } @@ -182,11 +182,11 @@ static void CheckSymTable (SymTable* Tab) if (Flags & SC_LABEL) { if (!SymIsDef (Entry)) { /* Undefined label */ - Error ("Undefined label: `%s'", Entry->Name); + Error ("Undefined label: '%s'", Entry->Name); } else if (!SymIsRef (Entry)) { /* Defined but not used */ if (IS_Get (&WarnUnusedLabel)) { - Warning ("`%s' is defined but never used", Entry->Name); + Warning ("'%s' is defined but never used", Entry->Name); } } } @@ -566,10 +566,10 @@ SymEntry* AddStructSym (const char* Name, unsigned Type, unsigned Size, SymTable /* We do have an entry. This may be a forward, so check it. */ if ((Entry->Flags & SC_TYPEMASK) != Type) { /* Existing symbol is not a struct */ - Error ("Symbol `%s' is already different kind", Name); + Error ("Symbol '%s' is already different kind", Name); } else if (Size > 0 && Entry->V.S.Size > 0) { /* Both structs are definitions. */ - Error ("Multiple definition for `%s'", Name); + Error ("Multiple definition for '%s'", Name); } else { /* Define the struct size if it is given */ if (Size > 0) { @@ -605,7 +605,7 @@ SymEntry* AddBitField (const char* Name, unsigned Offs, unsigned BitOffs, unsign if (Entry) { /* We have a symbol with this name already */ - Error ("Multiple definition for `%s'", Name); + Error ("Multiple definition for '%s'", Name); } else { @@ -639,9 +639,9 @@ SymEntry* AddConstSym (const char* Name, const Type* T, unsigned Flags, long Val SymEntry* Entry = FindSymInTable (Tab, Name, HashStr (Name)); if (Entry) { if ((Entry->Flags & SC_CONST) != SC_CONST) { - Error ("Symbol `%s' is already different kind", Name); + Error ("Symbol '%s' is already different kind", Name); } else { - Error ("Multiple definition for `%s'", Name); + Error ("Multiple definition for '%s'", Name); } return Entry; } @@ -706,7 +706,7 @@ SymEntry* AddLabelSym (const char* Name, unsigned Flags) if (SymIsDef (Entry) && (Flags & SC_DEF) != 0) { /* Trying to define the label more than once */ - Error ("Label `%s' is defined more than once", Name); + Error ("Label '%s' is defined more than once", Name); } NewDOR = AddDefOrRef (Entry, Flags); @@ -809,7 +809,7 @@ SymEntry* AddLocalSym (const char* Name, const Type* T, unsigned Flags, int Offs if (Entry) { /* We have a symbol with this name already */ - Error ("Multiple definition for `%s'", Name); + Error ("Multiple definition for '%s'", Name); } else { @@ -865,12 +865,12 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags) ** then avoid a compiler crash. See GitHub issue #728. */ if (Entry->Flags & SC_ENUM) { - Fatal ("Can't redeclare enum constant `%s' as global variable", Name); + Fatal ("Can't redeclare enum constant '%s' as global variable", Name); } /* We have a symbol with this name already */ if (Entry->Flags & SC_TYPE) { - Error ("Multiple definition for `%s'", Name); + Error ("Multiple definition for '%s'", Name); return Entry; } @@ -890,7 +890,7 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags) if ((Size != UNSPECIFIED && ESize != UNSPECIFIED && Size != ESize) || TypeCmp (T + 1, EType + 1) < TC_EQUAL) { /* Types not identical: Conflicting types */ - Error ("Conflicting types for `%s'", Name); + Error ("Conflicting types for '%s'", Name); return Entry; } else { /* Check if we have a size in the existing definition */ @@ -903,7 +903,7 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags) } else { /* New type must be identical */ if (TypeCmp (EType, T) < TC_EQUAL) { - Error ("Conflicting types for `%s'", Name); + Error ("Conflicting types for '%s'", Name); return Entry; } @@ -930,7 +930,7 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags) ** warn about the conflict. (It will compile a public declaration.) */ if ((Flags & SC_EXTERN) == 0 && (Entry->Flags & SC_EXTERN) != 0) { - Warning ("static declaration follows non-static declaration of `%s'.", Name); + Warning ("static declaration follows non-static declaration of '%s'.", Name); } /* An extern declaration must not change the current linkage. */ @@ -942,7 +942,7 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags) ** warn about the conflict. (It will compile a public declaration.) */ if ((Flags & SC_EXTERN) != 0 && (Entry->Flags & SC_EXTERN) == 0) { - Warning ("public declaration follows static declaration of `%s'.", Name); + Warning ("public declaration follows static declaration of '%s'.", Name); } /* Add the new flags */ @@ -1017,7 +1017,7 @@ void MakeZPSym (const char* Name) if (Entry) { Entry->Flags |= SC_ZEROPAGE; } else { - Error ("Undefined symbol: `%s'", Name); + Error ("Undefined symbol: '%s'", Name); } } diff --git a/src/cc65/typeconv.c b/src/cc65/typeconv.c index 47ab993c1..21ad33f12 100644 --- a/src/cc65/typeconv.c +++ b/src/cc65/typeconv.c @@ -76,7 +76,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType) /* Don't allow casts from void to something else. */ if (IsTypeVoid (OldType)) { - Error ("Cannot convert from `void' to something else"); + Error ("Cannot convert from 'void' to something else"); goto ExitPoint; } diff --git a/src/chrcvt65.vcxproj b/src/chrcvt65.vcxproj index d120399d1..351f6077e 100644 --- a/src/chrcvt65.vcxproj +++ b/src/chrcvt65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {1C7A3FEF-DD0B-4B10-BC33-C3BE29BF67CC} Win32Proj chrcvt65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/chrcvt65/main.c b/src/chrcvt65/main.c index 7e7183e0a..b2a21a114 100644 --- a/src/chrcvt65/main.c +++ b/src/chrcvt65/main.c @@ -325,7 +325,7 @@ static void ConvertFile (const char* Input, const char* Output) /* Try to open the file for reading */ FILE* F = fopen (Input, "rb"); if (F == 0) { - Error ("Cannot open input file `%s': %s", Input, strerror (errno)); + Error ("Cannot open input file '%s': %s", Input, strerror (errno)); } /* Seek to the end and determine the size */ @@ -337,9 +337,9 @@ static void ConvertFile (const char* Input, const char* Output) /* Check if the size is reasonable */ if (Size > 32*1024) { - Error ("Input file `%s' is too large (max = 32k)", Input); + Error ("Input file '%s' is too large (max = 32k)", Input); } else if (Size < 0x100) { - Error ("Input file `%s' is too small to be a vector font file", Input); + Error ("Input file '%s' is too small to be a vector font file", Input); } /* Allocate memory for the file */ @@ -347,7 +347,7 @@ static void ConvertFile (const char* Input, const char* Output) /* Read the file contents into the buffer */ if (fread (Buf, 1, (size_t) Size, F) != (size_t) Size) { - Error ("Error reading from input file `%s'", Input); + Error ("Error reading from input file '%s'", Input); } /* Close the file */ @@ -355,14 +355,14 @@ static void ConvertFile (const char* Input, const char* Output) /* Verify the header */ if (memcmp (Buf, ChrHeader, sizeof (ChrHeader)) != 0) { - Error ("Invalid format for `%s': invalid header", Input); + Error ("Invalid format for '%s': invalid header", Input); } MsgEnd = memchr (Buf + sizeof (ChrHeader), 0x1A, 0x80); if (MsgEnd == 0) { - Error ("Invalid format for `%s': description not found", Input); + Error ("Invalid format for '%s': description not found", Input); } if (MsgEnd[1] != 0x80 || MsgEnd[2] != 0x00) { - Error ("Invalid format for `%s': wrong header size", Input); + Error ("Invalid format for '%s': wrong header size", Input); } /* We expect the file to hold chars from 0x20 (space) to 0x7E (tilde) */ @@ -372,9 +372,9 @@ static void ConvertFile (const char* Input, const char* Output) if (FirstChar > 0x20 || LastChar < 0x7E) { Print (stderr, 1, "FirstChar = $%04X, CharCount = %u\n", FirstChar, CharCount); - Error ("File `%s' doesn't contain the chars we need", Input); + Error ("File '%s' doesn't contain the chars we need", Input); } else if (LastChar >= 0x100) { - Error ("File `%s' contains too many character definitions", Input); + Error ("File '%s' contains too many character definitions", Input); } /* Print the copyright from the header */ @@ -405,7 +405,7 @@ static void ConvertFile (const char* Input, const char* Output) /* Check if the offset is valid */ if (Remaining <= 0) { - Error ("Invalid data offset in input file `%s'", Input); + Error ("Invalid data offset in input file '%s'", Input); } /* Convert the vector data and place it into the buffer */ @@ -422,7 +422,7 @@ static void ConvertFile (const char* Input, const char* Output) /* The baseline must be zero, otherwise we cannot convert */ if (Buf[0x89] != 0) { - Error ("Baseline of font in `%s' is not zero", Input); + Error ("Baseline of font in '%s' is not zero", Input); } /* If the output file is NULL, use the name of the input file with ".tch" @@ -435,33 +435,33 @@ static void ConvertFile (const char* Input, const char* Output) /* Open the output file */ F = fopen (Output, "wb"); if (F == 0) { - Error ("Cannot open output file `%s': %s", Output, strerror (errno)); + Error ("Cannot open output file '%s': %s", Output, strerror (errno)); } /* Write the header to the output file */ if (fwrite (TchHeader, 1, sizeof (TchHeader), F) != sizeof (TchHeader)) { - Error ("Error writing to `%s' (disk full?)", Output); + Error ("Error writing to '%s' (disk full?)", Output); } /* Write the width table to the output file */ if (fwrite (WidthBuf, 1, 0x5F, F) != 0x5F) { - Error ("Error writing to `%s' (disk full?)", Output); + Error ("Error writing to '%s' (disk full?)", Output); } /* Write the offsets to the output file */ if (fwrite (SB_GetConstBuf (&Offsets), 1, 0x5F * 2, F) != 0x5F * 2) { - Error ("Error writing to `%s' (disk full?)", Output); + Error ("Error writing to '%s' (disk full?)", Output); } /* Write the data to the output file */ Offs = SB_GetLen (&VectorData); if (fwrite (SB_GetConstBuf (&VectorData), 1, Offs, F) != Offs) { - Error ("Error writing to `%s' (disk full?)", Output); + Error ("Error writing to '%s' (disk full?)", Output); } /* Close the output file */ if (fclose (F) != 0) { - Error ("Error closing to `%s': %s", Output, strerror (errno)); + Error ("Error closing to '%s': %s", Output, strerror (errno)); } /* Done */ diff --git a/src/cl65.vcxproj b/src/cl65.vcxproj index b6ceb161a..dab77e196 100644 --- a/src/cl65.vcxproj +++ b/src/cl65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {F657912F-050A-488B-B203-50ED5715CDD7} Win32Proj cl65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/cl65/main.c b/src/cl65/main.c index e61bd02a5..4a65e8729 100644 --- a/src/cl65/main.c +++ b/src/cl65/main.c @@ -339,7 +339,7 @@ static void CmdAddFile (CmdDesc* Cmd, const char* File) for (I = 0; I < Cmd->FileCount; ++I) { if (strcmp (Cmd->Files[I], File) == 0) { /* Duplicate file */ - Warning ("Duplicate file in argument list: `%s'", File); + Warning ("Duplicate file in argument list: '%s'", File); /* No need to search further */ break; } @@ -447,7 +447,7 @@ static void ExecProgram (CmdDesc* Cmd) /* Check the result code */ if (Status < 0) { /* Error executing the program */ - Error ("Cannot execute `%s': %s", Cmd->Name, strerror (errno)); + Error ("Cannot execute '%s': %s", Cmd->Name, strerror (errno)); } else if (Status != 0) { /* Called program had an error */ exit (Status); @@ -573,7 +573,7 @@ static void AssembleIntermediate (const char* SourceFile) /* Remove the input file */ if (remove (AsmName) < 0) { - Warning ("Cannot remove temporary file `%s': %s", + Warning ("Cannot remove temporary file '%s': %s", AsmName, strerror (errno)); } @@ -757,7 +757,7 @@ static void Usage (void) " -o name\t\t\tName the output file\n" " -r\t\t\t\tEnable register variables\n" " -t sys\t\t\tSet the target system\n" - " -u sym\t\t\tForce an import of symbol `sym'\n" + " -u sym\t\t\tForce an import of symbol 'sym'\n" " -v\t\t\t\tVerbose mode\n" " -vm\t\t\t\tVerbose map file\n" " -C name\t\t\tUse linker config file\n" @@ -803,7 +803,7 @@ static void Usage (void) " --debug\t\t\tDebug mode\n" " --debug-info\t\t\tAdd debug info\n" " --feature name\t\tSet an emulation feature\n" - " --force-import sym\t\tForce an import of symbol `sym'\n" + " --force-import sym\t\tForce an import of symbol 'sym'\n" " --help\t\t\tHelp (this text)\n" " --include-dir dir\t\tSet a compiler include directory path\n" " --ld-args options\t\tPass options to the linker\n" @@ -1296,9 +1296,9 @@ static void OptTarget (const char* Opt attribute ((unused)), const char* Arg) { Target = FindTarget (Arg); if (Target == TGT_UNKNOWN) { - Error ("No such target system: `%s'", Arg); + Error ("No such target system: '%s'", Arg); } else if (Target == TGT_MODULE) { - Error ("Cannot use `module' as target, use --module instead"); + Error ("Cannot use 'module' as target, use --module instead"); } } @@ -1631,7 +1631,7 @@ int main (int argc, char* argv []) break; default: - Error ("Don't know what to do with `%s'", Arg); + Error ("Don't know what to do with '%s'", Arg); } diff --git a/src/cl65/spawn-unix.inc b/src/cl65/spawn-unix.inc index 283285c76..36eb7aab4 100644 --- a/src/cl65/spawn-unix.inc +++ b/src/cl65/spawn-unix.inc @@ -82,7 +82,7 @@ int spawnvp (int Mode attribute ((unused)), const char* File, char* const argv [ /* The son - exec the program */ if (execvp (File, argv) < 0) { - Error ("Cannot exec `%s': %s", File, strerror (errno)); + Error ("Cannot exec '%s': %s", File, strerror (errno)); } } else { @@ -94,7 +94,7 @@ int spawnvp (int Mode attribute ((unused)), const char* File, char* const argv [ /* Examine the child status */ if (!WIFEXITED (Status)) { - Error ("Subprocess `%s' aborted by signal %d", File, WTERMSIG (Status)); + Error ("Subprocess '%s' aborted by signal %d", File, WTERMSIG (Status)); } } diff --git a/src/co65.vcxproj b/src/co65.vcxproj index 89eed36e1..9b4f18786 100644 --- a/src/co65.vcxproj +++ b/src/co65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {F5DB5D1A-05BC-48FE-B346-4E96DD522AA2} Win32Proj co65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/co65/convert.c b/src/co65/convert.c index af036ebf7..ec6d68401 100644 --- a/src/co65/convert.c +++ b/src/co65/convert.c @@ -394,7 +394,7 @@ void Convert (const O65Data* D) switch (O->Type) { case O65_OPT_FILENAME: - Print (stdout, 1, "O65 filename option: `%s'\n", + Print (stdout, 1, "O65 filename option: '%s'\n", GetO65OptionText (O)); break; @@ -402,7 +402,7 @@ void Convert (const O65Data* D) if (O->Len == 2) { Warning ("Operating system option without data found"); } else { - Print (stdout, 1, "O65 operating system option: `%s'\n", + Print (stdout, 1, "O65 operating system option: '%s'\n", GetO65OSName (O->Data[0])); switch (O->Data[0]) { case O65_OS_CC65_MODULE: @@ -418,7 +418,7 @@ void Convert (const O65Data* D) break; case O65_OPT_ASM: - Print (stdout, 1, "O65 assembler option: `%s'\n", + Print (stdout, 1, "O65 assembler option: '%s'\n", GetO65OptionText (O)); break; @@ -427,11 +427,11 @@ void Convert (const O65Data* D) xfree (Author); } Author = xstrdup (GetO65OptionText (O)); - Print (stdout, 1, "O65 author option: `%s'\n", Author); + Print (stdout, 1, "O65 author option: '%s'\n", Author); break; case O65_OPT_TIMESTAMP: - Print (stdout, 1, "O65 timestamp option: `%s'\n", + Print (stdout, 1, "O65 timestamp option: '%s'\n", GetO65OptionText (O)); break; @@ -450,11 +450,11 @@ void Convert (const O65Data* D) /* Open the output file */ F = fopen (OutputName, "w"); if (F == 0) { - Error ("Cannot open `%s': %s", OutputName, strerror (errno)); + Error ("Cannot open '%s': %s", OutputName, strerror (errno)); } /* Create a header */ - fprintf (F, ";\n; File generated by co65 v %s using model `%s'\n;\n", + fprintf (F, ";\n; File generated by co65 v %s using model '%s'\n;\n", GetVersionAsString (), GetModelName (Model)); /* Select the CPU */ diff --git a/src/co65/main.c b/src/co65/main.c index 43d263516..33ecdbf6f 100644 --- a/src/co65/main.c +++ b/src/co65/main.c @@ -112,7 +112,7 @@ static void CheckLabelName (const char* Label) } if (*L) { - Error ("Label name `%s' is invalid", Label); + Error ("Label name '%s' is invalid", Label); } } @@ -123,7 +123,7 @@ static void CheckSegName (const char* Seg) { /* Print an error and abort if the name is not ok */ if (!ValidSegName (Seg)) { - Error ("Segment name `%s' is invalid", Seg); + Error ("Segment name '%s' is invalid", Seg); } } @@ -244,7 +244,7 @@ static void OptO65Model (const char* Opt attribute ((unused)), const char* Arg) /* Search for the model name */ Model = FindModel (Arg); if (Model == O65_MODEL_INVALID) { - Error ("Unknown o65 model `%s'", Arg); + Error ("Unknown o65 model '%s'", Arg); } } @@ -387,7 +387,7 @@ int main (int argc, char* argv []) } else { /* Filename. Check if we already had one */ if (InputName) { - Error ("Don't know what to do with `%s'", Arg); + Error ("Don't know what to do with '%s'", Arg); } else { InputName = Arg; } diff --git a/src/co65/o65.c b/src/co65/o65.c index 3496995a8..81c07bb8c 100644 --- a/src/co65/o65.c +++ b/src/co65/o65.c @@ -361,7 +361,7 @@ O65Data* ReadO65File (const char* Name) /* Open the o65 input file */ FILE* F = fopen (Name, "rb"); if (F == 0) { - Error ("Cannot open `%s': %s", Name, strerror (errno)); + Error ("Cannot open '%s': %s", Name, strerror (errno)); } /* Read the file data */ diff --git a/src/common.vcxproj b/src/common.vcxproj index 644d6da85..eb0dffd66 100644 --- a/src/common.vcxproj +++ b/src/common.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -110,18 +110,19 @@ {71DC1F68-BFC4-478C-8655-C8E9C9654D2B} Win32Proj common + 10.0.16299.0 StaticLibrary true - v140 + v141 false true StaticLibrary - v140 + v141 diff --git a/src/common/check.c b/src/common/check.c index c6c5d2d95..0d0e6ef4b 100644 --- a/src/common/check.c +++ b/src/common/check.c @@ -75,5 +75,5 @@ static void DefaultCheckFailed (const char* Msg, const char* Cond, const char* File, unsigned Line) { /* Output a diagnostic and abort */ - AbEnd ("%s%s, file `%s', line %u", Msg, Cond, File, Line); + AbEnd ("%s%s, file '%s', line %u", Msg, Cond, File, Line); } diff --git a/src/common/cmdline.c b/src/common/cmdline.c index 0f6622934..4de79a419 100644 --- a/src/common/cmdline.c +++ b/src/common/cmdline.c @@ -239,7 +239,7 @@ void NeedArg (const char* Opt) void InvArg (const char* Opt, const char* Arg) /* Print an error about an invalid option argument and exit. */ { - AbEnd ("Invalid argument for %s: `%s'", Opt, Arg); + AbEnd ("Invalid argument for %s: '%s'", Opt, Arg); } @@ -247,7 +247,7 @@ void InvArg (const char* Opt, const char* Arg) void InvDef (const char* Def) /* Print an error about an invalid definition and die */ { - AbEnd ("Invalid definition: `%s'", Def); + AbEnd ("Invalid definition: '%s'", Def); } diff --git a/src/da65.vcxproj b/src/da65.vcxproj index 06af7505d..7a8b0de68 100644 --- a/src/da65.vcxproj +++ b/src/da65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {0BCFB793-2B25-40E2-B265-75848824AC4C} Win32Proj da65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/da65/asminc.c b/src/da65/asminc.c index 06a397d52..59ba0aab4 100644 --- a/src/da65/asminc.c +++ b/src/da65/asminc.c @@ -148,7 +148,7 @@ void AsmInc (const char* Filename, char CommentStart, int IgnoreUnknown) ++L; } else { if (!IgnoreUnknown) { - Error ("%s(%u): Missing `='", Filename, Line); + Error ("%s(%u): Missing '='", Filename, Line); } continue; } diff --git a/src/da65/code.c b/src/da65/code.c index 9aff732b3..3fb6a21d3 100644 --- a/src/da65/code.c +++ b/src/da65/code.c @@ -78,12 +78,12 @@ void LoadCode (void) /* Open the file */ F = fopen (InFile, "rb"); if (F == 0) { - Error ("Cannot open `%s': %s", InFile, strerror (errno)); + Error ("Cannot open '%s': %s", InFile, strerror (errno)); } /* Seek to the end to get the size of the file */ if (fseek (F, 0, SEEK_END) != 0) { - Error ("Cannot seek on file `%s': %s", InFile, strerror (errno)); + Error ("Cannot seek on file '%s': %s", InFile, strerror (errno)); } Size = ftell (F); @@ -101,7 +101,7 @@ void LoadCode (void) ** the file. */ if (fseek (F, InputOffs, SEEK_SET) != 0) { - Error ("Cannot seek on file `%s': %s", InFile, strerror (errno)); + Error ("Cannot seek on file '%s': %s", InFile, strerror (errno)); } Size -= InputOffs; @@ -130,10 +130,10 @@ void LoadCode (void) /* Check if the size is larger than what we can read */ if (Size == 0) { - Error ("Nothing to read from input file `%s'", InFile); + Error ("Nothing to read from input file '%s'", InFile); } if (Size > MaxCount) { - Warning ("File `%s' is too large, ignoring %ld bytes", + Warning ("File '%s' is too large, ignoring %ld bytes", InFile, Size - MaxCount); } else if (MaxCount > Size) { MaxCount = (unsigned) Size; @@ -142,7 +142,7 @@ void LoadCode (void) /* Read from the file and remember the number of bytes read */ Count = fread (CodeBuf + StartAddr, 1, MaxCount, F); if (ferror (F) || Count != MaxCount) { - Error ("Error reading from `%s': %s", InFile, strerror (errno)); + Error ("Error reading from '%s': %s", InFile, strerror (errno)); } /* Close the file */ diff --git a/src/da65/labels.c b/src/da65/labels.c index 6aa7f38cf..97e195ebf 100644 --- a/src/da65/labels.c +++ b/src/da65/labels.c @@ -92,7 +92,9 @@ static void AddLabel (unsigned Addr, attr_t Attr, const char* Name) ** have a name (you guessed that, didn't you?). */ if (ExistingAttr == Attr && - ((Name == 0 && SymTab[Addr] == 0) || strcmp (SymTab[Addr], Name) == 0)) { + ((Name == 0 && SymTab[Addr] == 0) || + (Name != 0 && SymTab[Addr] != 0 && + strcmp (SymTab[Addr], Name) == 0))) { return; } Error ("Duplicate label for address $%04X: %s/%s", Addr, SymTab[Addr], Name); diff --git a/src/da65/main.c b/src/da65/main.c index b0a784dd8..1fc07f006 100644 --- a/src/da65/main.c +++ b/src/da65/main.c @@ -617,7 +617,7 @@ int main (int argc, char* argv []) } else { /* Filename. Check if we already had one */ if (InFile) { - fprintf (stderr, "%s: Don't know what to do with `%s'\n", + fprintf (stderr, "%s: Don't know what to do with '%s'\n", ProgName, Arg); exit (EXIT_FAILURE); } else { diff --git a/src/da65/output.c b/src/da65/output.c index 4daacb1ee..5b0b6b79c 100644 --- a/src/da65/output.c +++ b/src/da65/output.c @@ -96,7 +96,7 @@ void OpenOutput (const char* Name) if (Name != 0) { F = fopen (Name, "w"); if (F == 0) { - Error ("Cannot open `%s': %s", Name, strerror (errno)); + Error ("Cannot open '%s': %s", Name, strerror (errno)); } } else { F = stdout; diff --git a/src/da65/scanner.c b/src/da65/scanner.c index 2bb80a8ef..85853d6c4 100644 --- a/src/da65/scanner.c +++ b/src/da65/scanner.c @@ -7,7 +7,7 @@ /* */ /* */ /* (C) 2000-2005 Ullrich von Bassewitz */ -/* Römerstrasse 52 */ +/* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ /* */ @@ -466,7 +466,7 @@ Again: /* C++ style comment */ NextChar (); if (C != '/') { - InfoError ("Invalid token `/'"); + InfoError ("Invalid token '/'"); } do { NextChar (); @@ -482,7 +482,7 @@ Again: break; default: - InfoError ("Invalid character `%c'", C); + InfoError ("Invalid character '%c'", C); } } @@ -503,7 +503,7 @@ void InfoConsume (unsigned T, const char* Msg) void InfoConsumeLCurly (void) /* Consume a left curly brace */ { - InfoConsume (INFOTOK_LCURLY, "`{' expected"); + InfoConsume (INFOTOK_LCURLY, "'{' expected"); } @@ -511,7 +511,7 @@ void InfoConsumeLCurly (void) void InfoConsumeRCurly (void) /* Consume a right curly brace */ { - InfoConsume (INFOTOK_RCURLY, "`}' expected"); + InfoConsume (INFOTOK_RCURLY, "'}' expected"); } @@ -519,7 +519,7 @@ void InfoConsumeRCurly (void) void InfoConsumeSemi (void) /* Consume a semicolon */ { - InfoConsume (INFOTOK_SEMI, "`;' expected"); + InfoConsume (INFOTOK_SEMI, "';' expected"); } @@ -527,7 +527,7 @@ void InfoConsumeSemi (void) void InfoConsumeColon (void) /* Consume a colon */ { - InfoConsume (INFOTOK_COLON, "`:' expected"); + InfoConsume (INFOTOK_COLON, "':' expected"); } @@ -683,7 +683,7 @@ void InfoOpenInput (void) /* Open the file */ InputFile = fopen (InfoFile, "r"); if (InputFile == 0) { - Error ("Cannot open `%s': %s", InfoFile, strerror (errno)); + Error ("Cannot open '%s': %s", InfoFile, strerror (errno)); } /* Initialize variables */ diff --git a/src/dbginfo/dbginfo.c b/src/dbginfo/dbginfo.c index e0d8894f9..42001ed07 100644 --- a/src/dbginfo/dbginfo.c +++ b/src/dbginfo/dbginfo.c @@ -2687,7 +2687,7 @@ static void NextToken (InputData* D) break; default: - ParseError (D, CC65_ERROR, "Invalid input character `%c'", D->C); + ParseError (D, CC65_ERROR, "Invalid input character '%c'", D->C); } } diff --git a/src/grc65.vcxproj b/src/grc65.vcxproj index afac0cce1..841ec635a 100644 --- a/src/grc65.vcxproj +++ b/src/grc65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {E0FD0AB3-3BEE-496F-8108-A8E0F8933F39} Win32Proj grc65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/grc65/main.c b/src/grc65/main.c index a53801a39..f6554eada 100644 --- a/src/grc65/main.c +++ b/src/grc65/main.c @@ -151,12 +151,12 @@ static void OptTarget (const char* Opt attribute ((unused)), const char* Arg) break; case TGT_UNKNOWN: - AbEnd ("Unknown target system `%s'", Arg); + AbEnd ("Unknown target system '%s'", Arg); break; default: /* Target is known but unsupported */ - AbEnd ("Unsupported target system `%s'", Arg); + AbEnd ("Unsupported target system '%s'", Arg); break; } } diff --git a/src/ld65.vcxproj b/src/ld65.vcxproj index cc5598aad..f98da6119 100644 --- a/src/ld65.vcxproj +++ b/src/ld65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {26C749A0-814C-47A2-9D36-AE92AE932FE4} Win32Proj ld65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/ld65/asserts.c b/src/ld65/asserts.c index 276b13595..626ed94a6 100644 --- a/src/ld65/asserts.c +++ b/src/ld65/asserts.c @@ -129,7 +129,7 @@ void CheckAssertions (void) /* If the expression is not constant, we're not able to handle it */ if (!IsConstExpr (A->Expr)) { - Warning ("Cannot evaluate assertion in module `%s', line %u", + Warning ("Cannot evaluate assertion in module '%s', line %u", Module, Line); } else if (GetExprVal (A->Expr) == 0) { @@ -149,7 +149,7 @@ void CheckAssertions (void) break; default: - Internal ("Invalid assertion action (%u) in module `%s', " + Internal ("Invalid assertion action (%u) in module '%s', " "line %u (file corrupt?)", A->Action, Module, Line); break; diff --git a/src/ld65/bin.c b/src/ld65/bin.c index a77d49679..688622415 100644 --- a/src/ld65/bin.c +++ b/src/ld65/bin.c @@ -154,7 +154,7 @@ static void BinWriteMem (BinDesc* D, MemoryArea* M) SegDesc* S = CollAtUnchecked (&M->SegList, I); /* Keep the user happy */ - Print (stdout, 1, " Writing `%s'\n", GetString (S->Name)); + Print (stdout, 1, " Writing '%s'\n", GetString (S->Name)); /* Writes do only occur in the load area and not for BSS segments */ DoWrite = (S->Flags & SF_BSS) == 0 && /* No BSS segment */ @@ -286,23 +286,23 @@ void BinWriteTarget (BinDesc* D, struct File* F) /* Open the file */ D->F = fopen (D->Filename, "wb"); if (D->F == 0) { - Error ("Cannot open `%s': %s", D->Filename, strerror (errno)); + Error ("Cannot open '%s': %s", D->Filename, strerror (errno)); } /* Keep the user happy */ - Print (stdout, 1, "Opened `%s'...\n", D->Filename); + Print (stdout, 1, "Opened '%s'...\n", D->Filename); /* Dump all memory areas */ for (I = 0; I < CollCount (&F->MemoryAreas); ++I) { /* Get this entry */ MemoryArea* M = CollAtUnchecked (&F->MemoryAreas, I); - Print (stdout, 1, " Dumping `%s'\n", GetString (M->Name)); + Print (stdout, 1, " Dumping '%s'\n", GetString (M->Name)); BinWriteMem (D, M); } /* Close the file */ if (fclose (D->F) != 0) { - Error ("Cannot write to `%s': %s", D->Filename, strerror (errno)); + Error ("Cannot write to '%s': %s", D->Filename, strerror (errno)); } /* Reset the file and filename */ diff --git a/src/ld65/config.c b/src/ld65/config.c index 1d3e810f6..099617ba0 100644 --- a/src/ld65/config.c +++ b/src/ld65/config.c @@ -226,7 +226,7 @@ static MemoryArea* CfgGetMemory (unsigned Name) { MemoryArea* M = CfgFindMemory (Name); if (M == 0) { - CfgError (&CfgErrorPos, "Invalid memory area `%s'", GetString (Name)); + CfgError (&CfgErrorPos, "Invalid memory area '%s'", GetString (Name)); } return M; } @@ -320,7 +320,7 @@ static MemoryArea* CreateMemoryArea (const FilePos* Pos, unsigned Name) MemoryArea* M = CfgFindMemory (Name); if (M) { CfgError (&CfgErrorPos, - "Memory area `%s' defined twice", + "Memory area '%s' defined twice", GetString (Name)); } @@ -343,7 +343,7 @@ static SegDesc* NewSegDesc (unsigned Name) /* Check for duplicate names */ SegDesc* S = CfgFindSegDesc (Name); if (S) { - CfgError (&CfgErrorPos, "Segment `%s' defined twice", GetString (Name)); + CfgError (&CfgErrorPos, "Segment '%s' defined twice", GetString (Name)); } /* Allocate memory */ @@ -566,7 +566,7 @@ static void ParseFiles (void) F = FindFile (GetStrBufId (&CfgSVal)); if (F == 0) { CfgError (&CfgErrorPos, - "File `%s' not found in MEMORY section", + "File '%s' not found in MEMORY section", SB_GetConstBuf (&CfgSVal)); } @@ -798,7 +798,7 @@ static void ParseSegments (void) */ if ((S->Flags & SF_BSS) != 0 && (S->Load != S->Run)) { CfgWarning (&CfgErrorPos, - "Segment with type `bss' has both LOAD and RUN " + "Segment with type 'bss' has both LOAD and RUN " "memory areas assigned"); } @@ -806,7 +806,7 @@ static void ParseSegments (void) if ((S->Flags & SF_RO) == 0) { if (S->Run->Flags & MF_RO) { CfgError (&CfgErrorPos, - "Cannot put r/w segment `%s' in r/o memory area `%s'", + "Cannot put r/w segment '%s' in r/o memory area '%s'", GetString (S->Name), GetString (S->Run->Name)); } } @@ -1511,7 +1511,7 @@ static void ParseConfig (void) CfgNextTok (); /* Expected a curly brace */ - CfgConsume (CFGTOK_LCURLY, "`{' expected"); + CfgConsume (CFGTOK_LCURLY, "'{' expected"); /* Read the block */ switch (BlockTok) { @@ -1546,7 +1546,7 @@ static void ParseConfig (void) } /* Skip closing brace */ - CfgConsume (CFGTOK_RCURLY, "`}' expected"); + CfgConsume (CFGTOK_RCURLY, "'}' expected"); } while (CfgTok != CFGTOK_EOF); } @@ -1603,7 +1603,7 @@ static void ProcessSegments (void) */ if ((S->Flags & SF_BSS) != 0 && S->Seg != 0 && !IsBSSType (S->Seg)) { CfgWarning (GetSourcePos (S->LI), - "Segment `%s' with type `bss' contains initialized data", + "Segment '%s' with type 'bss' contains initialized data", GetString (S->Name)); } @@ -1632,7 +1632,7 @@ static void ProcessSegments (void) /* Print a warning if the segment is not optional */ if ((S->Flags & SF_OPTIONAL) == 0) { CfgWarning (&CfgErrorPos, - "Segment `%s' does not exist", + "Segment '%s' does not exist", GetString (S->Name)); } @@ -1665,7 +1665,7 @@ static void ProcessSymbols (void) if (O65GetImport (O65FmtDesc, Sym->Name) != 0) { CfgError ( GetSourcePos (Sym->LI), - "Exported o65 symbol `%s' cannot also be an o65 import", + "Exported o65 symbol '%s' cannot also be an o65 import", GetString (Sym->Name) ); } @@ -1677,7 +1677,7 @@ static void ProcessSymbols (void) if (O65GetExport (O65FmtDesc, Sym->Name) != 0) { CfgError ( GetSourcePos (Sym->LI), - "Duplicate exported o65 symbol: `%s'", + "Duplicate exported o65 symbol: '%s'", GetString (Sym->Name) ); } @@ -1691,7 +1691,7 @@ static void ProcessSymbols (void) if (O65GetExport (O65FmtDesc, Sym->Name) != 0) { CfgError ( GetSourcePos (Sym->LI), - "Imported o65 symbol `%s' cannot also be an o65 export", + "Imported o65 symbol '%s' cannot also be an o65 export", GetString (Sym->Name) ); } @@ -1703,7 +1703,7 @@ static void ProcessSymbols (void) if (O65GetImport (O65FmtDesc, Sym->Name) != 0) { CfgError ( GetSourcePos (Sym->LI), - "Duplicate imported o65 symbol: `%s'", + "Duplicate imported o65 symbol: '%s'", GetString (Sym->Name) ); } @@ -1813,7 +1813,7 @@ unsigned CfgProcess (void) */ if (!IsConstExpr (M->StartExpr)) { CfgError (GetSourcePos (M->LI), - "Start address of memory area `%s' is not constant", + "Start address of memory area '%s' is not constant", GetString (M->Name)); } Addr = M->Start = GetExprVal (M->StartExpr); @@ -1838,7 +1838,7 @@ unsigned CfgProcess (void) /* Resolve the size expression */ if (!IsConstExpr (M->SizeExpr)) { CfgError (GetSourcePos (M->LI), - "Size of memory area `%s' is not constant", + "Size of memory area '%s' is not constant", GetString (M->Name)); } M->Size = GetExprVal (M->SizeExpr); @@ -1859,15 +1859,15 @@ unsigned CfgProcess (void) ++Overwrites; } else { CfgError (GetSourcePos (M->LI), - "Segment `%s' of type `overwrite' requires either" - " `Start' or `Offset' attribute to be specified", + "Segment '%s' of type 'overwrite' requires either" + " 'Start' or 'Offset' attribute to be specified", GetString (S->Name)); } } else { if (Overwrites > 0) { CfgError (GetSourcePos (M->LI), - "Segment `%s' is preceded by at least one segment" - " of type `overwrite'", + "Segment '%s' is preceded by at least one segment" + " of type 'overwrite'", GetString (S->Name)); } } @@ -1893,7 +1893,7 @@ unsigned CfgProcess (void) ** in the linker. */ CfgWarning (GetSourcePos (S->LI), - "Segment `%s' isn't aligned properly; the" + "Segment '%s' isn't aligned properly; the" " resulting executable might not be functional.", GetString (S->Name)); } @@ -1908,7 +1908,7 @@ unsigned CfgProcess (void) */ if (M->FillLevel == 0 && NewAddr > Addr) { CfgWarning (GetSourcePos (S->LI), - "The first segment in memory area `%s' " + "The first segment in memory area '%s' " "needs fill bytes for alignment.", GetString (M->Name)); } @@ -1929,7 +1929,7 @@ unsigned CfgProcess (void) if (S->Flags & SF_OVERWRITE) { if (NewAddr < M->Start) { CfgError (GetSourcePos (S->LI), - "Segment `%s' begins before memory area `%s'", + "Segment '%s' begins before memory area '%s'", GetString (S->Name), GetString (M->Name)); } else { Addr = NewAddr; @@ -1940,12 +1940,12 @@ unsigned CfgProcess (void) ++Overflows; if (S->Flags & SF_OFFSET) { CfgWarning (GetSourcePos (S->LI), - "Segment `%s' offset is too small in `%s' by %lu byte%c", + "Segment '%s' offset is too small in '%s' by %lu byte%c", GetString (S->Name), GetString (M->Name), Addr - NewAddr, (Addr - NewAddr == 1) ? ' ' : 's'); } else { CfgWarning (GetSourcePos (S->LI), - "Segment `%s' start address is too low in `%s' by %lu byte%c", + "Segment '%s' start address is too low in '%s' by %lu byte%c", GetString (S->Name), GetString (M->Name), Addr - NewAddr, (Addr - NewAddr == 1) ? ' ' : 's'); } @@ -1992,7 +1992,7 @@ unsigned CfgProcess (void) ++Overflows; M->Flags |= MF_OVERFLOW; CfgWarning (GetSourcePos (M->LI), - "Segment `%s' overflows memory area `%s' by %lu byte%c", + "Segment '%s' overflows memory area '%s' by %lu byte%c", GetString (S->Name), GetString (M->Name), M->FillLevel - M->Size, (M->FillLevel - M->Size == 1) ? ' ' : 's'); } @@ -2117,7 +2117,7 @@ void CfgWriteTarget (void) MemoryArea* M = CollAtUnchecked (&F->MemoryAreas, J); /* Debugging */ - Print (stdout, 2, "Skipping `%s'...\n", GetString (M->Name)); + Print (stdout, 2, "Skipping '%s'...\n", GetString (M->Name)); /* Walk throught the segments */ for (K = 0; K < CollCount (&M->SegList); ++K) { diff --git a/src/ld65/dbgfile.c b/src/ld65/dbgfile.c index 386706f66..204aff9d8 100644 --- a/src/ld65/dbgfile.c +++ b/src/ld65/dbgfile.c @@ -107,7 +107,7 @@ void CreateDbgFile (void) /* Open the debug info file */ FILE* F = fopen (DbgFileName, "w"); if (F == 0) { - Error ("Cannot create debug file `%s': %s", DbgFileName, strerror (errno)); + Error ("Cannot create debug file '%s': %s", DbgFileName, strerror (errno)); } /* Output version information */ @@ -166,6 +166,6 @@ void CreateDbgFile (void) /* Close the file */ if (fclose (F) != 0) { - Error ("Error closing debug file `%s': %s", DbgFileName, strerror (errno)); + Error ("Error closing debug file '%s': %s", DbgFileName, strerror (errno)); } } diff --git a/src/ld65/exports.c b/src/ld65/exports.c index e7ef3d413..0f9ac1c10 100644 --- a/src/ld65/exports.c +++ b/src/ld65/exports.c @@ -166,13 +166,13 @@ Import* ReadImport (FILE* F, ObjData* Obj) */ if (ObjHasFiles (I->Obj)) { const LineInfo* LI = GetImportPos (I); - Error ("Invalid import size in for `%s', imported from %s(%u): 0x%02X", + Error ("Invalid import size in for '%s', imported from %s(%u): 0x%02X", GetString (I->Name), GetSourceName (LI), GetSourceLine (LI), I->AddrSize); } else { - Error ("Invalid import size in for `%s', imported from %s: 0x%02X", + Error ("Invalid import size in for '%s', imported from %s: 0x%02X", GetString (I->Name), GetObjFileName (I->Obj), I->AddrSize); @@ -199,7 +199,7 @@ Import* GenImport (unsigned Name, unsigned char AddrSize) /* We have no object file information and no line info for a new ** import */ - Error ("Invalid import size 0x%02X for symbol `%s'", + Error ("Invalid import size 0x%02X for symbol '%s'", I->AddrSize, GetString (I->Name)); } @@ -483,7 +483,7 @@ void InsertExport (Export* E) } } else { /* Duplicate entry, ignore it */ - Warning ("Duplicate external identifier: `%s'", + Warning ("Duplicate external identifier: '%s'", GetString (L->Name)); } return; @@ -662,7 +662,7 @@ long GetExportVal (const Export* E) { if (E->Expr == 0) { /* OOPS */ - Internal ("`%s' is an undefined external", GetString (E->Name)); + Internal ("'%s' is an undefined external", GetString (E->Name)); } return GetExprVal (E->Expr); } @@ -720,9 +720,9 @@ static void CheckSymType (const Export* E) } /* Output the diagnostic */ - Warning ("Address size mismatch for `%s': " - "Exported from %s as `%s', " - "import in %s as `%s'", + Warning ("Address size mismatch for '%s': " + "Exported from %s as '%s', " + "import in %s as '%s'", GetString (E->Name), SB_GetConstBuf (&ExportLoc), ExpAddrSize, @@ -770,7 +770,7 @@ static void PrintUnresolved (ExpCheckFunc F, void* Data) /* Unresolved external */ Import* Imp = E->ImpList; fprintf (stderr, - "Unresolved external `%s' referenced in:\n", + "Unresolved external '%s' referenced in:\n", GetString (E->Name)); while (Imp) { unsigned J; @@ -1053,7 +1053,7 @@ void CircularRefError (const Export* E) /* Print an error about a circular reference using to define the given export */ { const LineInfo* LI = GetExportPos (E); - Error ("Circular reference for symbol `%s', %s(%u)", + Error ("Circular reference for symbol '%s', %s(%u)", GetString (E->Name), GetSourceName (LI), GetSourceLine (LI)); diff --git a/src/ld65/expr.c b/src/ld65/expr.c index efdff899e..2a08b5a98 100644 --- a/src/ld65/expr.c +++ b/src/ld65/expr.c @@ -407,12 +407,12 @@ long GetExprVal (ExprNode* Expr) Error ("Argument for .BANK is not segment relative or too complex"); } if (D.Seg->MemArea == 0) { - Error ("Segment `%s' is referenced by .BANK but " + Error ("Segment '%s' is referenced by .BANK but " "not assigned to a memory area", GetString (D.Seg->Name)); } if (D.Seg->MemArea->BankExpr == 0) { - Error ("Memory area `%s' is referenced by .BANK but " + Error ("Memory area '%s' is referenced by .BANK but " "has no BANK attribute", GetString (D.Seg->MemArea->Name)); } diff --git a/src/ld65/extsyms.c b/src/ld65/extsyms.c index b250125a7..cca10f3ad 100644 --- a/src/ld65/extsyms.c +++ b/src/ld65/extsyms.c @@ -89,7 +89,7 @@ ExtSym* NewExtSym (ExtSymTab* Tab, unsigned Name) ExtSym* E = GetExtSym (Tab, Name); if (E != 0) { /* We do already have a symbol with this name */ - Error ("Duplicate external symbol `%s'", GetString (Name)); + Error ("Duplicate external symbol '%s'", GetString (Name)); } /* Allocate memory for the structure */ diff --git a/src/ld65/library.c b/src/ld65/library.c index 0dadcfa67..dd964cff2 100644 --- a/src/ld65/library.c +++ b/src/ld65/library.c @@ -112,7 +112,7 @@ static void CloseLibrary (Library* L) { /* Close the library file */ if (fclose (L->F) != 0) { - Error ("Error closing `%s': %s", GetString (L->Name), strerror (errno)); + Error ("Error closing '%s': %s", GetString (L->Name), strerror (errno)); } L->F = 0; } @@ -144,7 +144,7 @@ static void LibSeek (Library* L, unsigned long Offs) /* Do a seek in the library checking for errors */ { if (fseek (L->F, Offs, SEEK_SET) != 0) { - Error ("Seek error in `%s' (%lu): %s", + Error ("Seek error in '%s' (%lu): %s", GetString (L->Name), Offs, strerror (errno)); } } @@ -158,7 +158,7 @@ static void LibReadHeader (Library* L) L->Header.Magic = LIB_MAGIC; L->Header.Version = Read16 (L->F); if (L->Header.Version != LIB_VERSION) { - Error ("Wrong data version in `%s'", GetString (L->Name)); + Error ("Wrong data version in '%s'", GetString (L->Name)); } L->Header.Flags = Read16 (L->F); L->Header.IndexOffs = Read32 (L->F); @@ -171,12 +171,12 @@ static void LibReadObjHeader (Library* L, ObjData* O) { O->Header.Magic = Read32 (L->F); if (O->Header.Magic != OBJ_MAGIC) { - Error ("Object file `%s' in library `%s' is invalid", + Error ("Object file '%s' in library '%s' is invalid", GetObjFileName (O), GetString (L->Name)); } O->Header.Version = Read16 (L->F); if (O->Header.Version != OBJ_VERSION) { - Error ("Object file `%s' in library `%s' has wrong version", + Error ("Object file '%s' in library '%s' has wrong version", GetObjFileName (O), GetString (L->Name)); } O->Header.Flags = Read16 (L->F); diff --git a/src/ld65/lineinfo.c b/src/ld65/lineinfo.c index 25eca4fcd..d2c1de0f7 100644 --- a/src/ld65/lineinfo.c +++ b/src/ld65/lineinfo.c @@ -162,7 +162,7 @@ void ReadLineInfoList (FILE* F, ObjData* O, Collection* LineInfos) ** therefore be part of the line infos read from the object file. */ if (LineInfoIndex >= CollCount (&O->LineInfos)) { - Internal ("Invalid line info index %u in module `%s' - max is %u", + Internal ("Invalid line info index %u in module '%s' - max is %u", LineInfoIndex, GetObjFileName (O), CollCount (&O->LineInfos)); diff --git a/src/ld65/main.c b/src/ld65/main.c index 74511a48a..e0dcf9727 100644 --- a/src/ld65/main.c +++ b/src/ld65/main.c @@ -123,7 +123,7 @@ static void Usage (void) " -m name\t\tCreate a map file\n" " -o name\t\tName the default output file\n" " -t sys\t\tSet the target system\n" - " -u sym\t\tForce an import of symbol `sym'\n" + " -u sym\t\tForce an import of symbol 'sym'\n" " -v\t\t\tVerbose mode\n" " -vm\t\t\tVerbose map file\n" "\n" @@ -133,7 +133,7 @@ static void Usage (void) " --dbgfile name\tGenerate debug information\n" " --define sym=val\tDefine a symbol\n" " --end-group\t\tEnd a library group\n" - " --force-import sym\tForce an import of symbol `sym'\n" + " --force-import sym\tForce an import of symbol 'sym'\n" " --help\t\tHelp (this text)\n" " --lib file\t\tLink this library\n" " --lib-path path\tSpecify a library search path\n" @@ -214,13 +214,13 @@ static void LinkFile (const char* Name, FILETYPE Type) /* We must have a valid name now */ if (PathName == 0) { - Error ("Input file `%s' not found", Name); + Error ("Input file '%s' not found", Name); } /* Try to open the file */ F = fopen (PathName, "rb"); if (F == 0) { - Error ("Cannot open `%s': %s", PathName, strerror (errno)); + Error ("Cannot open '%s': %s", PathName, strerror (errno)); } /* Read the magic word */ @@ -246,7 +246,7 @@ static void LinkFile (const char* Name, FILETYPE Type) default: fclose (F); - Error ("File `%s' has unknown type", PathName); + Error ("File '%s' has unknown type", PathName); } @@ -322,7 +322,7 @@ static void OptConfig (const char* Opt attribute ((unused)), const char* Arg) PathName = SearchFile (CfgDefaultPath, Arg); } if (PathName == 0) { - Error ("Cannot find config file `%s'", Arg); + Error ("Cannot find config file '%s'", Arg); } /* Read the config */ @@ -376,7 +376,7 @@ static void OptForceImport (const char* Opt attribute ((unused)), const char* Ar /* Get the address size and check it */ unsigned char AddrSize = AddrSizeFromStr (ColPos+1); if (AddrSize == ADDR_SIZE_INVALID) { - Error ("Invalid address size `%s'", ColPos+1); + Error ("Invalid address size '%s'", ColPos+1); } /* Create a copy of the argument */ @@ -509,7 +509,7 @@ static void OptTarget (const char* Opt attribute ((unused)), const char* Arg) /* Map the target name to a target id */ Target = FindTarget (Arg); if (Target == TGT_UNKNOWN) { - Error ("Invalid target name: `%s'", Arg); + Error ("Invalid target name: '%s'", Arg); } /* Set the target binary format */ @@ -526,7 +526,7 @@ static void OptTarget (const char* Opt attribute ((unused)), const char* Arg) PathName = SearchFile (CfgDefaultPath, SB_GetBuf (&FileName)); } if (PathName == 0) { - Error ("Cannot find config file `%s'", SB_GetBuf (&FileName)); + Error ("Cannot find config file '%s'", SB_GetBuf (&FileName)); } /* Free file name memory */ diff --git a/src/ld65/mapfile.c b/src/ld65/mapfile.c index 0cf9b651b..7fec986ff 100644 --- a/src/ld65/mapfile.c +++ b/src/ld65/mapfile.c @@ -67,7 +67,7 @@ void CreateMapFile (int ShortMap) /* Open the map file */ FILE* F = fopen (MapFileName, "w"); if (F == 0) { - Error ("Cannot create map file `%s': %s", MapFileName, strerror (errno)); + Error ("Cannot create map file '%s': %s", MapFileName, strerror (errno)); } /* Write a modules list */ @@ -132,7 +132,7 @@ void CreateMapFile (int ShortMap) /* Close the file */ if (fclose (F) != 0) { - Error ("Error closing map file `%s': %s", MapFileName, strerror (errno)); + Error ("Error closing map file '%s': %s", MapFileName, strerror (errno)); } } @@ -144,7 +144,7 @@ void CreateLabelFile (void) /* Open the label file */ FILE* F = fopen (LabelFileName, "w"); if (F == 0) { - Error ("Cannot create label file `%s': %s", LabelFileName, strerror (errno)); + Error ("Cannot create label file '%s': %s", LabelFileName, strerror (errno)); } /* Print the labels for the export symbols */ @@ -155,6 +155,6 @@ void CreateLabelFile (void) /* Close the file */ if (fclose (F) != 0) { - Error ("Error closing label file `%s': %s", LabelFileName, strerror (errno)); + Error ("Error closing label file '%s': %s", LabelFileName, strerror (errno)); } } diff --git a/src/ld65/o65.c b/src/ld65/o65.c index aceb5158a..e36f40d36 100644 --- a/src/ld65/o65.c +++ b/src/ld65/o65.c @@ -784,7 +784,7 @@ static void O65WriteSeg (O65Desc* D, SegDesc** Seg, unsigned Count, int DoWrite) S = Seg [I]; /* Keep the user happy */ - Print (stdout, 1, " Writing `%s'\n", GetString (S->Name)); + Print (stdout, 1, " Writing '%s'\n", GetString (S->Name)); /* Write this segment */ if (DoWrite) { @@ -805,7 +805,7 @@ static void O65WriteSeg (O65Desc* D, SegDesc** Seg, unsigned Count, int DoWrite) /* Check the size of the segment for overflow */ if ((D->Header.Mode & MF_SIZE_MASK) == MF_SIZE_16BIT && D->SegSize > 0xFFFF) { - Error ("Segment overflow in file `%s'", D->Filename); + Error ("Segment overflow in file '%s'", D->Filename); } } @@ -940,7 +940,7 @@ static void O65WriteExports (O65Desc* D) */ Export* E = FindExport (NameIdx); if (E == 0 || IsUnresolvedExport (E)) { - Internal ("Unresolved export `%s' found in O65WriteExports", Name); + Internal ("Unresolved export '%s' found in O65WriteExports", Name); } /* Get the expression for the symbol */ @@ -958,7 +958,7 @@ static void O65WriteExports (O65Desc* D) /* Bail out if we cannot handle the expression */ if (ED.TooComplex) { - Error ("Expression for symbol `%s' is too complex", Name); + Error ("Expression for symbol '%s' is too complex", Name); } /* Determine the segment id for the expression */ @@ -977,7 +977,7 @@ static void O65WriteExports (O65Desc* D) /* For some reason, we didn't find this segment in the list of ** segments written to the o65 file. */ - Error ("Segment for symbol `%s' is undefined", Name); + Error ("Segment for symbol '%s' is undefined", Name); } SegmentID = O65SegType (Seg); @@ -1207,7 +1207,7 @@ void O65SetExport (O65Desc* D, unsigned Ident) */ Export* E = FindExport (Ident); if (E == 0 || IsUnresolvedExport (E)) { - Error ("Unresolved export: `%s'", GetString (Ident)); + Error ("Unresolved export: '%s'", GetString (Ident)); } /* Insert the entry into the table */ @@ -1370,11 +1370,11 @@ void O65WriteTarget (O65Desc* D, File* F) /* Open the file */ D->F = fopen (D->Filename, "wb"); if (D->F == 0) { - Error ("Cannot open `%s': %s", D->Filename, strerror (errno)); + Error ("Cannot open '%s': %s", D->Filename, strerror (errno)); } /* Keep the user happy */ - Print (stdout, 1, "Opened `%s'...\n", D->Filename); + Print (stdout, 1, "Opened '%s'...\n", D->Filename); /* Define some more options: A timestamp, the linker version and the ** filename @@ -1428,7 +1428,7 @@ void O65WriteTarget (O65Desc* D, File* F) /* Close the file */ if (fclose (D->F) != 0) { - Error ("Cannot write to `%s': %s", D->Filename, strerror (errno)); + Error ("Cannot write to '%s': %s", D->Filename, strerror (errno)); } /* Reset the file and filename */ diff --git a/src/ld65/objdata.c b/src/ld65/objdata.c index 7e83f9107..88a7bded4 100644 --- a/src/ld65/objdata.c +++ b/src/ld65/objdata.c @@ -184,7 +184,7 @@ unsigned MakeGlobalStringId (const ObjData* O, unsigned Index) /* Convert a local string id into a global one and return it. */ { if (Index >= O->StringCount) { - Error ("Invalid string index (%u) in module `%s'", + Error ("Invalid string index (%u) in module '%s'", Index, GetObjFileName (O)); } return O->Strings[Index]; @@ -214,7 +214,7 @@ struct Section* GetObjSection (const ObjData* O, unsigned Id) /* Get a section from an object file checking for a valid index */ { if (Id >= CollCount (&O->Sections)) { - Error ("Invalid section index (%u) in module `%s'", + Error ("Invalid section index (%u) in module '%s'", Id, GetObjFileName (O)); } return CollAtUnchecked (&O->Sections, Id); @@ -226,7 +226,7 @@ struct Import* GetObjImport (const ObjData* O, unsigned Id) /* Get an import from an object file checking for a valid index */ { if (Id >= CollCount (&O->Imports)) { - Error ("Invalid import index (%u) in module `%s'", + Error ("Invalid import index (%u) in module '%s'", Id, GetObjFileName (O)); } return CollAtUnchecked (&O->Imports, Id); @@ -238,7 +238,7 @@ struct Export* GetObjExport (const ObjData* O, unsigned Id) /* Get an export from an object file checking for a valid index */ { if (Id >= CollCount (&O->Exports)) { - Error ("Invalid export index (%u) in module `%s'", + Error ("Invalid export index (%u) in module '%s'", Id, GetObjFileName (O)); } return CollAtUnchecked (&O->Exports, Id); @@ -250,7 +250,7 @@ struct DbgSym* GetObjDbgSym (const ObjData* O, unsigned Id) /* Get a debug symbol from an object file checking for a valid index */ { if (Id >= CollCount (&O->DbgSyms)) { - Error ("Invalid debug symbol index (%u) in module `%s'", + Error ("Invalid debug symbol index (%u) in module '%s'", Id, GetObjFileName (O)); } return CollAtUnchecked (&O->DbgSyms, Id); @@ -262,7 +262,7 @@ struct Scope* GetObjScope (const ObjData* O, unsigned Id) /* Get a scope from an object file checking for a valid index */ { if (Id >= CollCount (&O->Scopes)) { - Error ("Invalid scope index (%u) in module `%s'", + Error ("Invalid scope index (%u) in module '%s'", Id, GetObjFileName (O)); } return CollAtUnchecked (&O->Scopes, Id); diff --git a/src/ld65/objfile.c b/src/ld65/objfile.c index 870ca5221..a44e3239a 100644 --- a/src/ld65/objfile.c +++ b/src/ld65/objfile.c @@ -67,7 +67,7 @@ static unsigned GetModule (const char* Name) /* Make a module name from the file name */ const char* Module = FindName (Name); if (*Module == 0) { - Error ("Cannot make module name from `%s'", Name); + Error ("Cannot make module name from '%s'", Name); } return GetStringId (Module); } @@ -79,7 +79,7 @@ static void ObjReadHeader (FILE* Obj, ObjHeader* H, const char* Name) { H->Version = Read16 (Obj); if (H->Version != OBJ_VERSION) { - Error ("Object file `%s' has wrong version, expected %08X, got %08X", + Error ("Object file '%s' has wrong version, expected %08X, got %08X", Name, OBJ_VERSION, H->Version); } H->Flags = Read16 (Obj); diff --git a/src/ld65/scanner.c b/src/ld65/scanner.c index 3c2346aac..31f1c7a41 100644 --- a/src/ld65/scanner.c +++ b/src/ld65/scanner.c @@ -196,7 +196,7 @@ static void StrVal (void) default: CfgWarning (&CfgErrorPos, - "Unkown escape sequence `%%%c'", C); + "Unkown escape sequence '%%%c'", C); SB_AppendChar (&CfgSVal, '%'); SB_AppendChar (&CfgSVal, C); NextChar (); @@ -389,7 +389,7 @@ Again: break; default: - CfgError (&CfgErrorPos, "Invalid character `%c'", C); + CfgError (&CfgErrorPos, "Invalid character '%c'", C); } } @@ -410,7 +410,7 @@ void CfgConsume (cfgtok_t T, const char* Msg) void CfgConsumeSemi (void) /* Consume a semicolon */ { - CfgConsume (CFGTOK_SEMI, "`;' expected"); + CfgConsume (CFGTOK_SEMI, "';' expected"); } @@ -418,7 +418,7 @@ void CfgConsumeSemi (void) void CfgConsumeColon (void) /* Consume a colon */ { - CfgConsume (CFGTOK_COLON, "`:' expected"); + CfgConsume (CFGTOK_COLON, "':' expected"); } @@ -556,7 +556,7 @@ void CfgOpenInput (void) /* Open the file */ InputFile = fopen (CfgName, "r"); if (InputFile == 0) { - Error ("Cannot open `%s': %s", CfgName, strerror (errno)); + Error ("Cannot open '%s': %s", CfgName, strerror (errno)); } /* Initialize variables */ diff --git a/src/ld65/scopes.c b/src/ld65/scopes.c index edf0d0da2..cf40fac01 100644 --- a/src/ld65/scopes.c +++ b/src/ld65/scopes.c @@ -147,7 +147,7 @@ void PrintDbgScopes (FILE* F) case SCOPE_ENUM: fputs (",type=enum", F); break; default: - Error ("Module `%s': Unknown scope type %u", + Error ("Module '%s': Unknown scope type %u", GetObjFileName (O), S->Type); } diff --git a/src/ld65/segments.c b/src/ld65/segments.c index 9c3972ac5..56a4719ad 100644 --- a/src/ld65/segments.c +++ b/src/ld65/segments.c @@ -144,7 +144,7 @@ Segment* GetSegment (unsigned Name, unsigned char AddrSize, const char* ObjName) if (ObjName == 0) { ObjName = "[linker generated]"; } - Error ("Module `%s': Type mismatch for segment `%s'", ObjName, + Error ("Module '%s': Type mismatch for segment '%s'", ObjName, GetString (Name)); } } @@ -210,7 +210,7 @@ Section* ReadSection (FILE* F, ObjData* O) /* Print some data */ Print (stdout, 2, - "Module `%s': Found segment `%s', size = %u, alignment = %lu, type = %u\n", + "Module '%s': Found segment '%s', size = %u, alignment = %lu, type = %u\n", GetObjFileName (O), GetString (Name), Size, Alignment, Type); /* Get the segment for this section */ @@ -226,13 +226,13 @@ Section* ReadSection (FILE* F, ObjData* O) if (Sec->Alignment > 1) { Alignment = LeastCommonMultiple (S->Alignment, Sec->Alignment); if (Alignment > MAX_ALIGNMENT) { - Error ("Combined alignment for segment `%s' is %lu which exceeds " - "%lu. Last module requiring alignment was `%s'.", + Error ("Combined alignment for segment '%s' is %lu which exceeds " + "%lu. Last module requiring alignment was '%s'.", GetString (Name), Alignment, MAX_ALIGNMENT, GetObjFileName (O)); } else if (Alignment >= LARGE_ALIGNMENT) { - Warning ("Combined alignment for segment `%s' is suspiciously " - "large (%lu). Last module requiring alignment was `%s'.", + Warning ("Combined alignment for segment '%s' is suspiciously " + "large (%lu). Last module requiring alignment was '%s'.", GetString (Name), Alignment, GetObjFileName (O)); } S->Alignment = Alignment; @@ -270,7 +270,7 @@ Section* ReadSection (FILE* F, ObjData* O) break; default: - Error ("Unknown fragment type in module `%s', segment `%s': %02X", + Error ("Unknown fragment type in module '%s', segment '%s': %02X", GetObjFileName (O), GetString (S->Name), Type); /* NOTREACHED */ return 0; @@ -502,19 +502,19 @@ void SegWrite (const char* TgtName, FILE* Tgt, Segment* S, SegWriteFunc F, void* break; case SEG_EXPR_RANGE_ERROR: - Error ("Range error in module `%s', line %u", + Error ("Range error in module '%s', line %u", GetFragmentSourceName (Frag), GetFragmentSourceLine (Frag)); break; case SEG_EXPR_TOO_COMPLEX: - Error ("Expression too complex in module `%s', line %u", + Error ("Expression too complex in module '%s', line %u", GetFragmentSourceName (Frag), GetFragmentSourceLine (Frag)); break; case SEG_EXPR_INVALID: - Error ("Invalid expression in module `%s', line %u", + Error ("Invalid expression in module '%s', line %u", GetFragmentSourceName (Frag), GetFragmentSourceLine (Frag)); break; @@ -657,7 +657,7 @@ void CheckSegments (void) /* Check it */ if (S->Size > 0 && S->Dumped == 0) { - Error ("Missing memory area assignment for segment `%s'", + Error ("Missing memory area assignment for segment '%s'", GetString (S->Name)); } } diff --git a/src/od65.vcxproj b/src/od65.vcxproj index 2ace26001..03ea41fce 100644 --- a/src/od65.vcxproj +++ b/src/od65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {FF8576C2-1253-44FE-A51B-D9AE35F3CEAD} Win32Proj od65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/od65/main.c b/src/od65/main.c index 2d23f4202..ce71608ed 100644 --- a/src/od65/main.c +++ b/src/od65/main.c @@ -222,7 +222,7 @@ static void DumpFile (const char* Name) /* Try to open the file */ FILE* F = fopen (Name, "rb"); if (F == 0) { - Error ("Cannot open `%s': %s", Name, strerror (errno)); + Error ("Cannot open '%s': %s", Name, strerror (errno)); } /* Read the magic word */ diff --git a/src/sim65.vcxproj b/src/sim65.vcxproj index 9ba0980ba..9dc61e53f 100644 --- a/src/sim65.vcxproj +++ b/src/sim65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {002A366E-2863-46A8-BDDE-DDF534AAEC73} Win32Proj sim65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/sim65/main.c b/src/sim65/main.c index f7f73165a..a1bbc5561 100644 --- a/src/sim65/main.c +++ b/src/sim65/main.c @@ -141,13 +141,13 @@ static void ReadProgramFile (void) /* Open the file */ FILE* F = fopen (ProgramFile, "rb"); if (F == 0) { - Error ("Cannot open `%s': %s", ProgramFile, strerror (errno)); + Error ("Cannot open '%s': %s", ProgramFile, strerror (errno)); } /* Get the CPU type from the file header */ if ((Val = fgetc(F)) != EOF) { if (Val != CPU_6502 && Val != CPU_65C02) { - Error ("`%s': Invalid CPU type", ProgramFile); + Error ("'%s': Invalid CPU type", ProgramFile); } CPU = Val; } @@ -155,20 +155,20 @@ static void ReadProgramFile (void) /* Read the file body into memory */ while ((Val = fgetc(F)) != EOF) { if (Addr == 0xFF00) { - Error ("`%s': To large to fit into $0200-$FFF0", ProgramFile); + Error ("'%s': To large to fit into $0200-$FFF0", ProgramFile); } MemWriteByte (Addr++, (unsigned char) Val); } /* Check for errors */ if (ferror (F)) { - Error ("Error reading from `%s': %s", ProgramFile, strerror (errno)); + Error ("Error reading from '%s': %s", ProgramFile, strerror (errno)); } /* Close the file */ fclose (F); - Print (stderr, 1, "Loaded `%s' at $0200-$%04X\n", ProgramFile, Addr - 1); + Print (stderr, 1, "Loaded '%s' at $0200-$%04X\n", ProgramFile, Addr - 1); } diff --git a/src/sp65.vcxproj b/src/sp65.vcxproj index 6e7d992d4..3b770ec57 100644 --- a/src/sp65.vcxproj +++ b/src/sp65.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,16 +14,17 @@ {4388D1AF-C7EA-4AD4-8E80-CA1FB7BF76BF} Win32Proj sp65 + 10.0.16299.0 true - v140 + v141 false true - v140 + v141 diff --git a/src/sp65/asm.c b/src/sp65/asm.c index 8f520cb9e..74c9bc023 100644 --- a/src/sp65/asm.c +++ b/src/sp65/asm.c @@ -89,7 +89,7 @@ static unsigned GetBytesPerLine (const Collection* A) const char* V = GetAttrVal (A, "bytesperline"); if ((V && sscanf (V, "%u%c", &BytesPerLine, &C) != 1) || (BytesPerLine < 1 || BytesPerLine > 64)) { - Error ("Invalid value for attribute `bytesperline'"); + Error ("Invalid value for attribute 'bytesperline'"); } return BytesPerLine; } @@ -106,7 +106,7 @@ static unsigned GetBase (const Collection* A) const char* V = GetAttrVal (A, "base"); if ((V && sscanf (V, "%u%c", &Base, &C) != 1) || (Base != 2 && Base != 10 && Base != 16)) { - Error ("Invalid value for attribute `base'"); + Error ("Invalid value for attribute 'base'"); } return Base; } @@ -119,7 +119,7 @@ static const char* GetIdentifier (const Collection* A) /* Check for a ident attribute */ const char* Ident = GetAttrVal (A, "ident"); if (Ident && !ValidIdentifier (Ident)) { - Error ("Invalid value for attribute `ident'"); + Error ("Invalid value for attribute 'ident'"); } return Ident; } @@ -152,7 +152,7 @@ void WriteAsmFile (const StrBuf* Data, const Collection* A, const Bitmap* B) /* Open the output file */ F = fopen (Name, "w"); if (F == 0) { - Error ("Cannot open output file `%s': %s", Name, strerror (errno)); + Error ("Cannot open output file '%s': %s", Name, strerror (errno)); } /* Write a readable header */ @@ -235,6 +235,6 @@ void WriteAsmFile (const StrBuf* Data, const Collection* A, const Bitmap* B) /* Close the file */ if (fclose (F) != 0) { - Error ("Error closing output file `%s': %s", Name, strerror (errno)); + Error ("Error closing output file '%s': %s", Name, strerror (errno)); } } diff --git a/src/sp65/attr.c b/src/sp65/attr.c index e57b86973..1b7883c47 100644 --- a/src/sp65/attr.c +++ b/src/sp65/attr.c @@ -160,7 +160,7 @@ const Attr* NeedAttr (const Collection* C, const char* Name, const char* Op) /* Search for the attribute and return it */ unsigned Index; if (!FindAttr (C, Name, &Index)) { - Error ("Found no attribute named `%s' for operation %s", Name, Op); + Error ("Found no attribute named '%s' for operation %s", Name, Op); } return CollConstAt (C, Index); } @@ -201,7 +201,7 @@ void AddAttr (Collection* C, const char* Name, const char* Value) */ unsigned Index; if (FindAttr (C, Name, &Index)) { - Error ("Duplicate command line attribute `%s'", Name); + Error ("Duplicate command line attribute '%s'", Name); } /* Insert the attribute */ @@ -221,7 +221,7 @@ void SplitAddAttr (Collection* C, const char* Combined, const char* Name) if (Pos == 0) { /* Combined is actually a value */ if (Name == 0) { - Error ("Command line attribute `%s' doesn't contain a name", Combined); + Error ("Command line attribute '%s' doesn't contain a name", Combined); } AddAttr (C, Name, Combined); } else { diff --git a/src/sp65/bin.c b/src/sp65/bin.c index fdf7ddee0..a3f856340 100644 --- a/src/sp65/bin.c +++ b/src/sp65/bin.c @@ -65,7 +65,7 @@ void WriteBinFile (const StrBuf* Data, const Collection* A, /* Open the output file */ FILE* F = fopen (Name, "wb"); if (F == 0) { - Error ("Cannot open output file `%s': %s", Name, strerror (errno)); + Error ("Cannot open output file '%s': %s", Name, strerror (errno)); } /* Write to the file. We will use fwrite here instead of the fileio @@ -75,11 +75,11 @@ void WriteBinFile (const StrBuf* Data, const Collection* A, */ Size = SB_GetLen (Data); if (fwrite (SB_GetConstBuf (Data), 1, Size, F) != Size) { - Error ("Error writing to output file `%s': %s", Name, strerror (errno)); + Error ("Error writing to output file '%s': %s", Name, strerror (errno)); } /* Close the file */ if (fclose (F) != 0) { - Error ("Error closing output file `%s': %s", Name, strerror (errno)); + Error ("Error closing output file '%s': %s", Name, strerror (errno)); } } diff --git a/src/sp65/c.c b/src/sp65/c.c index d4d6ee00b..57950ca6d 100644 --- a/src/sp65/c.c +++ b/src/sp65/c.c @@ -89,7 +89,7 @@ static unsigned GetBytesPerLine (const Collection* A) const char* V = GetAttrVal (A, "bytesperline"); if ((V && sscanf (V, "%u%c", &BytesPerLine, &C) != 1) || (BytesPerLine < 1 || BytesPerLine > 64)) { - Error ("Invalid value for attribute `bytesperline'"); + Error ("Invalid value for attribute 'bytesperline'"); } return BytesPerLine; } @@ -105,7 +105,7 @@ static unsigned GetBase (const Collection* A) /* Check for a base attribute */ const char* V = GetAttrVal (A, "base"); if ((V && sscanf (V, "%u%c", &Base, &C) != 1) || (Base != 10 && Base != 16)) { - Error ("Invalid value for attribute `base'"); + Error ("Invalid value for attribute 'base'"); } return Base; } @@ -118,7 +118,7 @@ static const char* GetIdentifier (const Collection* A) /* Check for a ident attribute */ const char* Ident = GetAttrVal (A, "ident"); if (Ident && !ValidIdentifier (Ident)) { - Error ("Invalid value for attribute `ident'"); + Error ("Invalid value for attribute 'ident'"); } return Ident; } @@ -151,7 +151,7 @@ void WriteCFile (const StrBuf* Data, const Collection* A, const Bitmap* B) /* Open the output file */ F = fopen (Name, "w"); if (F == 0) { - Error ("Cannot open output file `%s': %s", Name, strerror (errno)); + Error ("Cannot open output file '%s': %s", Name, strerror (errno)); } /* Write a readable header */ @@ -220,6 +220,6 @@ void WriteCFile (const StrBuf* Data, const Collection* A, const Bitmap* B) /* Close the file */ if (fclose (F) != 0) { - Error ("Error closing output file `%s': %s", Name, strerror (errno)); + Error ("Error closing output file '%s': %s", Name, strerror (errno)); } } diff --git a/src/sp65/convert.c b/src/sp65/convert.c index 45b40f1ef..a9047ffb0 100644 --- a/src/sp65/convert.c +++ b/src/sp65/convert.c @@ -106,7 +106,7 @@ StrBuf* ConvertTo (const Bitmap* B, const Collection* A) sizeof (ConverterMap[0]), Compare); if (E == 0) { - Error ("No such target format: `%s'", Format); + Error ("No such target format: '%s'", Format); } /* Do the conversion */ diff --git a/src/sp65/input.c b/src/sp65/input.c index 381adf6b9..f1df247ae 100644 --- a/src/sp65/input.c +++ b/src/sp65/input.c @@ -103,7 +103,7 @@ Bitmap* ReadInputFile (const Collection* A) sizeof (FormatTable[0]), CompareFileId); if (F == 0) { - Error ("Unknown input format `%s'", Format); + Error ("Unknown input format '%s'", Format); } } else { /* No format given, use file name extension */ @@ -112,7 +112,7 @@ Bitmap* ReadInputFile (const Collection* A) sizeof (FormatTable) / sizeof (FormatTable[0])); /* Found? */ if (F == 0) { - Error ("Cannot determine file format of input file `%s'", Name); + Error ("Cannot determine file format of input file '%s'", Name); } } diff --git a/src/sp65/lynxsprite.c b/src/sp65/lynxsprite.c index e4afc7773..4d7669faf 100644 --- a/src/sp65/lynxsprite.c +++ b/src/sp65/lynxsprite.c @@ -80,7 +80,7 @@ static enum Mode GetMode (const Collection* A) } else if (strcmp (Mode, "shaped") == 0) { return smShaped; } else { - Error ("Invalid value for attribute `mode'"); + Error ("Invalid value for attribute 'mode'"); } } diff --git a/src/sp65/main.c b/src/sp65/main.c index 5c9724a8a..1dda696d6 100644 --- a/src/sp65/main.c +++ b/src/sp65/main.c @@ -392,7 +392,7 @@ int main (int argc, char* argv []) } } else { /* We don't accept anything else */ - AbEnd ("Don't know what to do with `%s'", Arg); + AbEnd ("Don't know what to do with '%s'", Arg); } /* Next argument */ diff --git a/src/sp65/output.c b/src/sp65/output.c index 3ffa38dcc..c12d1f612 100644 --- a/src/sp65/output.c +++ b/src/sp65/output.c @@ -124,7 +124,7 @@ void WriteOutputFile (const StrBuf* Data, const Collection* A, const Bitmap* B) sizeof (FormatTable[0]), CompareFileId); if (F == 0) { - Error ("Unknown output format `%s'", Format); + Error ("Unknown output format '%s'", Format); } } else { /* No format given, use file name extension */ @@ -133,7 +133,7 @@ void WriteOutputFile (const StrBuf* Data, const Collection* A, const Bitmap* B) sizeof (FormatTable) / sizeof (FormatTable[0])); /* Found? */ if (F == 0) { - Error ("Cannot determine file format of output file `%s'", Name); + Error ("Cannot determine file format of output file '%s'", Name); } } diff --git a/src/sp65/pcx.c b/src/sp65/pcx.c index 273ad8cf0..d721671b3 100644 --- a/src/sp65/pcx.c +++ b/src/sp65/pcx.c @@ -146,10 +146,10 @@ static PCXHeader* ReadPCXHeader (FILE* F, const char* Name) /* Check the header data */ if (P->Id != PCX_MAGIC_ID || P->FileVersion == 1 || P->FileVersion > 5) { - Error ("`%s' is not a PCX file", Name); + Error ("'%s' is not a PCX file", Name); } if (P->Compressed > 1) { - Error ("Unsupported compression (%d) in PCX file `%s'", + Error ("Unsupported compression (%d) in PCX file '%s'", P->Compressed, Name); } /* We support: @@ -160,15 +160,15 @@ static PCXHeader* ReadPCXHeader (FILE* F, const char* Name) if (!((P->BPP == 1 && P->Planes == 1) || (P->BPP == 8 && (P->Planes == 1 || P->Planes == 3 || P->Planes == 4)))) { /* We could support others, but currently we don't */ - Error ("Unsupported PCX format: %u planes, %u bpp in PCX file `%s'", + Error ("Unsupported PCX format: %u planes, %u bpp in PCX file '%s'", P->Planes, P->BPP, Name); } if (P->PalInfo != 1 && P->PalInfo != 2) { - Error ("Unsupported palette info (%u) in PCX file `%s'", + Error ("Unsupported palette info (%u) in PCX file '%s'", P->PalInfo, Name); } if (!ValidBitmapSize (P->Width, P->Height)) { - Error ("PCX file `%s' has an unsupported size (w=%u, h=%d)", + Error ("PCX file '%s' has an unsupported size (w=%u, h=%d)", Name, P->Width, P->Height); } @@ -261,7 +261,7 @@ Bitmap* ReadPCXFile (const Collection* A) /* Open the file */ FILE* F = fopen (Name, "rb"); if (F == 0) { - Error ("Cannot open PCX file `%s': %s", Name, strerror (errno)); + Error ("Cannot open PCX file '%s': %s", Name, strerror (errno)); } /* Read the PCX header */ @@ -357,7 +357,7 @@ Bitmap* ReadPCXFile (const Collection* A) /* Check for palette marker */ if (Read8 (F) != 0x0C) { - Error ("Invalid palette marker in PCX file `%s'", Name); + Error ("Invalid palette marker in PCX file '%s'", Name); } } else if (EndPos == CurPos) { @@ -367,12 +367,12 @@ Bitmap* ReadPCXFile (const Collection* A) /* Check the maximum index for safety */ if (MaxIdx > 15) { - Error ("PCX file `%s' contains more than 16 indexed colors " + Error ("PCX file '%s' contains more than 16 indexed colors " "but no extra palette", Name); } } else { - Error ("Error in PCX file `%s': %lu bytes at end of pixel data", + Error ("Error in PCX file '%s': %lu bytes at end of pixel data", Name, EndPos - CurPos); } diff --git a/src/sp65/vic2sprite.c b/src/sp65/vic2sprite.c index 3e99ec7b2..94a9ad499 100644 --- a/src/sp65/vic2sprite.c +++ b/src/sp65/vic2sprite.c @@ -81,7 +81,7 @@ static enum Mode GetMode (const Collection* A) } else if (strcmp (Mode, "multicolor") == 0) { return smMultiColor; } else { - Error ("Invalid value for attribute `mode'"); + Error ("Invalid value for attribute 'mode'"); } } diff --git a/test/misc/goto.ref b/test/misc/goto.ref index ad69cdfe2..85dc20a61 100644 --- a/test/misc/goto.ref +++ b/test/misc/goto.ref @@ -1,7 +1,7 @@ goto.c(8): Warning: Goto at line 8 to label start jumps into a block with initialization of an object that has automatic storage duration -goto.c(97): Warning: `a' is defined but never used -goto.c(117): Warning: `a' is defined but never used -goto.c(137): Warning: `a' is defined but never used +goto.c(97): Warning: 'a' is defined but never used +goto.c(117): Warning: 'a' is defined but never used +goto.c(137): Warning: 'a' is defined but never used goto.c(159): Warning: Goto at line 23 to label l8 jumps into a block with initialization of an object that has automatic storage duration goto.c(159): Warning: Goto at line 44 to label l8 jumps into a block with initialization of an object that has automatic storage duration goto.c(159): Warning: Goto at line 65 to label l8 jumps into a block with initialization of an object that has automatic storage duration diff --git a/test/ref/cc65090124.c b/test/ref/cc65090124.c index 3f8279b27..3a75b28fa 100644 --- a/test/ref/cc65090124.c +++ b/test/ref/cc65090124.c @@ -32,7 +32,7 @@ int main(void) fs=(func((fd/a),(func(2,0x0082c90f)))); } -i get "Error: `)' expected" on that line. (this is with the snapshot, freshly +i get "Error: ')' expected" on that line. (this is with the snapshot, freshly compiled 5 minutes ago) */ diff --git a/test/ref/cc65091022.c b/test/ref/cc65091022.c index 25d197c11..ea19afe43 100644 --- a/test/ref/cc65091022.c +++ b/test/ref/cc65091022.c @@ -8,7 +8,7 @@ #include /* -...gives "test.c(2): Error: Variable `foo' has unknown size" using -Cl. +...gives "test.c(2): Error: Variable 'foo' has unknown size" using -Cl. Is it really unknown? cc65 V2.13.0, SVN version: 4384 diff --git a/test/ref/cc65101102.c b/test/ref/cc65101102.c index 4faa7c12b..1f87f65b5 100644 --- a/test/ref/cc65101102.c +++ b/test/ref/cc65101102.c @@ -11,12 +11,12 @@ Compiler is build from cc65-snapshot-2.13.9.20101031 sources. Expected results and also what I get from this without any optimisations are: 48663 and 49218 -When I turn on ``-O``: 58096 and 58096. After swapping the two variable -declaration lines in `calculate_checksum()` the results are correct -with ``-O``. +When I turn on ''-O'': 58096 and 58096. After swapping the two variable +declaration lines in 'calculate_checksum()' the results are correct +with ''-O''. -But with ``--O --static-locals`` the results are incorrect again (31757 -and 15408). ``--static-locals`` alone works though. +But with ''--O --static-locals'' the results are incorrect again (31757 +and 15408). ''--static-locals'' alone works though. */ #include diff --git a/test/ref/cc65110210.c b/test/ref/cc65110210.c index 2c7853556..ca5b39203 100644 --- a/test/ref/cc65110210.c +++ b/test/ref/cc65110210.c @@ -8,15 +8,15 @@ with SVN version: 4973M $ cl65 -v -o test.prg tests/cc65110210.c -Opened include file `/usr/local/lib/cc65/include/stdio.h' -Opened include file `/usr/local/lib/cc65/include/stddef.h' -Opened include file `/usr/local/lib/cc65/include/stdarg.h' -Opened include file `/usr/local/lib/cc65/include/limits.h' +Opened include file '/usr/local/lib/cc65/include/stdio.h' +Opened include file '/usr/local/lib/cc65/include/stddef.h' +Opened include file '/usr/local/lib/cc65/include/stdarg.h' +Opened include file '/usr/local/lib/cc65/include/limits.h' 0 errors, 0 warnings -Opened output file `tests/cc65110210.s' -Wrote output to `tests/cc65110210.s' -Closed output file `tests/cc65110210.s' -cl65: Subprocess `ld65' aborted by signal 11 +Opened output file 'tests/cc65110210.s' +Wrote output to 'tests/cc65110210.s' +Closed output file 'tests/cc65110210.s' +cl65: Subprocess 'ld65' aborted by signal 11 */ diff --git a/test/ref/paranoia.c b/test/ref/paranoia.c index e9a47dd71..e4833bd16 100644 --- a/test/ref/paranoia.c +++ b/test/ref/paranoia.c @@ -1626,7 +1626,7 @@ part7(){ overflow: sigsave = 0; Z = V9; - printf("Can `Z = -Y' overflow?\n"); + printf("Can 'Z = -Y' overflow?\n"); printf("Trying it on Y = %.17e .\n", Y); V9 = - Y; V0 = V9; @@ -2087,7 +2087,7 @@ Instructions() { static char *instr[] = { "Lest this program stop prematurely, i.e. before displaying\n", - " `END OF TEST',\n", + " 'END OF TEST',\n", "try to persuade the computer NOT to terminate execution when an", "error like Over/Underflow or Division by Zero occurs, but rather", "to persevere with a surrogate value after, perhaps, displaying some", @@ -2170,8 +2170,8 @@ History() " FAILUREs, like 2+2 == 5 .", "Failures may confound subsequent diagnoses.\n", "The diagnostic capabilities of this program go beyond an earlier", - "program called `MACHAR', which can be found at the end of the", - "book `Software Manual for the Elementary Functions' (1980) by", + "program called 'MACHAR', which can be found at the end of the", + "book 'Software Manual for the Elementary Functions' (1980) by", "W. J. Cody and W. Waite. Although both programs try to discover", "the Radix, Precision and range (over/underflow thresholds)", "of the arithmetic, this program tries to cope with a wider variety", diff --git a/test/val/compare1.c b/test/val/compare1.c index 0127e3b1b..e9d2f7d4a 100644 --- a/test/val/compare1.c +++ b/test/val/compare1.c @@ -52,7 +52,7 @@ compare_char_to_lits1 (void) failures++; } -/* achar0 should be `5' */ +/* achar0 should be '5' */ void compare_char_to_lits2 (void) { @@ -106,7 +106,7 @@ compare_int_to_lits1 (void) failures++; } -/* aint0 should be `5' */ +/* aint0 should be '5' */ void compare_int_to_lits2 (void) { @@ -123,7 +123,7 @@ compare_int_to_lits2 (void) failures++; } -/* aint0 should be `0x1234' */ +/* aint0 should be '0x1234' */ void compare_int_to_lits3 (void) { diff --git a/testcode/lib/div-test.c b/testcode/lib/div-test.c index 2d5c2541e..401f13ff8 100644 --- a/testcode/lib/div-test.c +++ b/testcode/lib/div-test.c @@ -2,37 +2,44 @@ ** ** This program tests the division and modulo operators ** and the div() library function. -** -** 2002-10-24, Greg King */ +#include +#include #include #include -#include -static bool test(int dividend, int divisor) { - div_t result; +static bool test (int dividend, int divisor) +{ + div_t result; - result = div(dividend, divisor); - printf("%+d/%+d= %+d, %+d%%%+d= %+d, div()= %+d, %+d\n", - dividend, divisor, dividend / divisor, - dividend, divisor, dividend % divisor, - result.quot, result.rem); - return result.quot * divisor + result.rem != dividend; - } + result = div (dividend, divisor); + printf ("%+d/%+d= %+d, %+d%%%+d= %+d, div()= %+d, %+d\n", + dividend, divisor, dividend / divisor, + dividend, divisor, dividend % divisor, + result.quot, result.rem); -int main(void) { - bool t; + return result.quot * divisor + result.rem != dividend; +} - printf("\nTest of division and modulus operations:\n\n"); - t = test(+40, +3) || - test(+40, -3) || - test(-40, +3) || - test(-40, -3); - if (t) - printf("\nThe div() function made a wrong result!\n"); +int main (void) +{ + bool t; - printf("\nTap a key, to exit. "); - getchar(); - return (int)t; - } + printf ("\nTest of division and modulus operations:\n\n"); + + t = test (+40, +3) || + test (+40, -3) || + test (-40, +3) || + test (-40, -3); + if (t) { + printf ("\nThe div() function made a wrong result!\n"); + } + + if (doesclrscrafterexit ()) { + printf ("\nTap the Return key to quit. "); + getchar (); + } + + return (int)t; +}