diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..75d9b00d3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,16 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- +**Compiler and OS** +It is important to know what version of the compiler/assembler you used (call it with --version to get this info). Sometimes we also need to know what OS you are using. + +**Describe the bug** +Please tell us what you did, what happened, and what you expected to happen instead. + +**To Reproduce** +If it isnt obvious how to reproduce the problem, please give use some detailed instructions on how to reproduce it. Ideally provide a testcase (program) that we can put into the testbench later. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..09cadc0ba --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,14 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: feature request +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..5215c557d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +## Summary + +Provide description of the bug (if an issue exists, link to it) and the fix. + +## Checklist + +- [ ] The fix meets the codestyle requirements +- [ ] New unit tests have been added to prevent future regressions +- [ ] The documentation has been updated if necessary diff --git a/.github/checks/sorted.sh b/.github/checks/sorted.sh index b5451a21f..43dfa9a69 100755 --- a/.github/checks/sorted.sh +++ b/.github/checks/sorted.sh @@ -33,7 +33,8 @@ function checkarray_quoted_name } -for N in `grep -rl "BEGIN SORTED.SH" "$CHECK_DIR"`; do - checkarray_quoted_name $N +FILES=$(find "$CHECK_DIR" -name \*.\[ch\] -print) +for N in $FILES; do + grep -q "BEGIN SORTED.SH" "$N" && checkarray_quoted_name "$N" done exit 0 diff --git a/.github/checks/sorted_codeopt.sh b/.github/checks/sorted_codeopt.sh index cfca028dd..550779fd6 100755 --- a/.github/checks/sorted_codeopt.sh +++ b/.github/checks/sorted_codeopt.sh @@ -63,7 +63,8 @@ function checkarray } -find "$CHECK_DIR" -name \*.\[ch\] -print | while read N; do - grep -q "BEGIN DECL SORTED_CODEOPT.SH" "$N" && checkarray $N +FILES=$(find "$CHECK_DIR" -name \*.\[ch\] -print) +for N in $FILES; do + grep -q "BEGIN DECL SORTED_CODEOPT.SH" "$N" && checkarray "$N" done -exit 0 +exit 0 diff --git a/.github/checks/sorted_opcodes.sh b/.github/checks/sorted_opcodes.sh index 34156bde6..e72a970d1 100755 --- a/.github/checks/sorted_opcodes.sh +++ b/.github/checks/sorted_opcodes.sh @@ -34,7 +34,8 @@ function checkarray_quoted_name rm -rf .a.tmp } -for N in `grep -rl "BEGIN SORTED_OPCODES.SH" "$CHECK_DIR"`; do - checkarray_quoted_name $N +FILES=$(find "$CHECK_DIR" -name \*.\[ch\] -print) +for N in $FILES; do + grep -q "BEGIN SORTED_OPCODES.SH" "$N" && checkarray_quoted_name "$N" done exit 0 diff --git a/Code_of_Conduct.md b/Code_of_Conduct.md new file mode 100644 index 000000000..6be56d8e3 --- /dev/null +++ b/Code_of_Conduct.md @@ -0,0 +1,122 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +groepaz@gmx.net. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/Makefile b/Makefile index 1f7af1087..222fea5ac 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,9 @@ zip: install: ifndef PREFIX - $(error Error: PREFIX must be set for install to work) +ifndef DESTDIR + $(error Error: PREFIX or DESTDIR must be set for install to work) +endif endif @$(MAKE) -C src --no-print-directory $@ @$(MAKE) -C libsrc --no-print-directory $@ @@ -73,7 +75,9 @@ util: checkprefix: ifndef PREFIX - $(warning Warning: PREFIX is empty - make install will not work) +ifndef DESTDIR + $(warning Warning: PREFIX and DESTDIR are empty - make install will not work) +endif endif # check the code style diff --git a/asminc/apple2.mac b/asminc/apple2.mac index b9860c092..c0c957102 100644 --- a/asminc/apple2.mac +++ b/asminc/apple2.mac @@ -36,6 +36,12 @@ ; Just output the character _scrcode arg1 + ; Check for an identifier + .elseif .match (.left (1, {arg1}), identifier) + + ; Just output the identifier + _scrcode arg1 + ; Anything else is an error .else diff --git a/asminc/atari.mac b/asminc/atari.mac index 3916254d0..952af8732 100644 --- a/asminc/atari.mac +++ b/asminc/atari.mac @@ -46,6 +46,12 @@ ; Just output the character _scrcode arg1 + ; Check for an identifier + .elseif .match (.left (1, {arg1}), identifier) + + ; Just output the identifier + _scrcode arg1 + ; Anything else is an error .else diff --git a/asminc/cbm.mac b/asminc/cbm.mac index 6d7ac7e8d..5c542b228 100644 --- a/asminc/cbm.mac +++ b/asminc/cbm.mac @@ -40,6 +40,12 @@ ; Just output the character _scrcode arg1 + ; Check for an identifier + .elseif .match (.left (1, {arg1}), identifier) + + ; Just output the identifier + _scrcode arg1 + ; Anything else is an error .else .error "scrcode: invalid argument type" diff --git a/asminc/cbm510.inc b/asminc/cbm510.inc index e1a86c487..627ba4991 100644 --- a/asminc/cbm510.inc +++ b/asminc/cbm510.inc @@ -15,6 +15,8 @@ IndReg := $01 ; Controls indirect indexed load-store bank TXTPTR := $85 ; Far pointer into BASIC source code FNAM := $90 ; Far pointer to LOAD/SAVE file-name +FNAM_SEG := $92 +STATUS := $9C ; Kernal I/O completion status FNAM_LEN := $9D ; Holds length of file-name ; --------------------------------------------------------------------------- diff --git a/asminc/cbm610.inc b/asminc/cbm610.inc index b1b03eb1d..b031b2e9f 100644 --- a/asminc/cbm610.inc +++ b/asminc/cbm610.inc @@ -15,6 +15,8 @@ IndReg := $01 ; Controls indirect indexed load-store bank TXTPTR := $85 ; Far pointer into BASIC source code FNAM := $90 ; Far pointer to LOAD/SAVE file-name +FNAM_SEG := $92 +STATUS := $9C ; Kernal I/O completion status FNAM_LEN := $9D ; Holds length of file-name ; --------------------------------------------------------------------------- diff --git a/asminc/cpu.mac b/asminc/cpu.mac index 15b16bad5..092519173 100644 --- a/asminc/cpu.mac +++ b/asminc/cpu.mac @@ -1,38 +1,4 @@ -; CPU bitmask constants (make sure this matches src/common/cpu.h) - -CPU_ISET_NONE = $0001 -CPU_ISET_6502 = $0002 -CPU_ISET_6502X = $0004 -CPU_ISET_6502DTV = $0008 -CPU_ISET_65SC02 = $0010 -CPU_ISET_65C02 = $0020 ; Rockwell extensions -CPU_ISET_65816 = $0040 -CPU_ISET_SWEET16 = $0080 -CPU_ISET_HUC6280 = $0100 -CPU_ISET_M740 = $0200 -CPU_ISET_4510 = $0400 -CPU_ISET_45GS02 = $0800 -CPU_ISET_W65C02 = $1000 ; WDC extensions -CPU_ISET_65CE02 = $2000 ; CSG extensions - -; CPU capabilities -; make sure to only combine the instruction sets that are 100% compatible -CPU_NONE = CPU_ISET_NONE -CPU_6502 = CPU_ISET_6502 -CPU_6502X = CPU_ISET_6502X | CPU_ISET_6502 -CPU_6502DTV = CPU_ISET_6502DTV | CPU_ISET_6502 -CPU_65SC02 = CPU_ISET_65SC02 | CPU_ISET_6502 -CPU_65C02 = CPU_ISET_65C02 | CPU_ISET_6502 | CPU_ISET_65SC02 -CPU_W65C02 = CPU_ISET_W65C02 | CPU_ISET_6502 | CPU_ISET_65SC02 | CPU_ISET_65C02 - -; FIXME: CPU_ISET_65SC02 does not apply to the following, because the zp-indirect -; addressing was replaced with zp-indirect,z-indexed in 652SCE02 - -CPU_HUC6280 = CPU_ISET_HUC6280 | CPU_ISET_6502 | CPU_ISET_65C02 -CPU_4510 = CPU_ISET_4510 | CPU_ISET_6502 | CPU_ISET_65C02 | CPU_ISET_65CE02 -CPU_45GS02 = CPU_ISET_45GS02 | CPU_ISET_6502 | CPU_ISET_65C02 | CPU_ISET_65CE02 | CPU_ISET_4510 -CPU_M740 = CPU_ISET_M740 | CPU_ISET_6502 -CPU_65CE02 = CPU_ISET_65CE02 | CPU_ISET_6502 | CPU_ISET_65C02 - -CPU_65816 = CPU_ISET_65816 | CPU_ISET_6502 | CPU_ISET_65SC02 -CPU_SWEET16 = CPU_ISET_SWEET16 +; This file is no longer needed as the symbols that were defined here are now +; internal symbols generated by the assembler. It is kept to avoid breaking +; old sources. +.warning "'.macpack cpu' is no longer required" diff --git a/asminc/opcodes.inc b/asminc/opcodes.inc index b610360e1..a5406e5ab 100644 --- a/asminc/opcodes.inc +++ b/asminc/opcodes.inc @@ -38,8 +38,6 @@ ; iax = ($0000,X) ; rel = $0000 (PC-relative) (supressed here) -.macpack cpu - OPC_BRK = $00 OPC_ORA_izx = $01 OPC_ORA_zp = $05 diff --git a/asminc/pet.inc b/asminc/pet.inc index ee96d378c..c51010210 100644 --- a/asminc/pet.inc +++ b/asminc/pet.inc @@ -10,6 +10,7 @@ VARTAB := $2A ; Pointer to start of BASIC variables MEMSIZE := $34 ; Size of memory installed TXTPTR := $77 ; Pointer into BASIC source code TIME := $8D ; 60HZ clock +STATUS := $96 ; IEC status byte KEY_COUNT := $9E ; Number of keys in input buffer RVS := $9F ; Reverse flag CURS_FLAG := $A7 ; 1 = cursor off diff --git a/cfg/atari7800.cfg b/cfg/atari7800.cfg index 1eed534f3..5a3351e75 100644 --- a/cfg/atari7800.cfg +++ b/cfg/atari7800.cfg @@ -39,7 +39,7 @@ MEMORY { SEGMENTS { ZEROPAGE: load = ZP, type = zp; - EXTZP: load = ZP, type = zp; + EXTZP: load = ZP, type = zp, optional = yes; EXEHDR: load = HEADER, type = ro, optional = yes; STARTUP: load = ROMS, type = ro, define = yes; ONCE: load = ROMS, type = ro, define = yes; diff --git a/cfg/creativision.cfg b/cfg/creativision.cfg index f3b7ac0f4..d34278de6 100644 --- a/cfg/creativision.cfg +++ b/cfg/creativision.cfg @@ -23,7 +23,7 @@ FEATURES { CONDES: type = constructor, label = __CONSTRUCTOR_TABLE__, count = __CONSTRUCTOR_COUNT__, - segment = INIT; + segment = ONCE; CONDES: type = destructor, label = __DESTRUCTOR_TABLE__, count = __DESTRUCTOR_COUNT__, diff --git a/cfg/geos-cbm.cfg b/cfg/geos-cbm.cfg index 4bf33fdf5..945735683 100644 --- a/cfg/geos-cbm.cfg +++ b/cfg/geos-cbm.cfg @@ -2,12 +2,32 @@ 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 = __HIMEM__ - __OVERLAYSIZE__; - __STACKSIZE__: type = weak, value = $0400; # 1k stack - __STACKADDR__: type = weak, value = __OVERLAYADDR__ - __STACKSIZE__; + __BACKBUFSIZE__: type = weak, value = $2000; + __HIMEM__: type = weak, value = $8000 - __BACKBUFSIZE__; + __OVERLAYSIZE__: type = weak, value = $0000; + __OVERLAYADDR__: type = weak, value = __HIMEM__ - __OVERLAYSIZE__; + __STACKSIZE__: type = weak, value = $0400; # 1k stack + __STACKADDR__: type = weak, value = __OVERLAYADDR__ - __STACKSIZE__; + __VLIR0_BLOCKS__: type = export, value = ((__VLIR0_LAST__ - __VLIR0_START__ - __BSS_SIZE__) + 253) / 254; + __VLIR1_BLOCKS__: type = export, value = ((__VLIR1_LAST__ - __VLIR1_START__) + 253) / 254; + __VLIR2_BLOCKS__: type = export, value = ((__VLIR2_LAST__ - __VLIR2_START__) + 253) / 254; + __VLIR3_BLOCKS__: type = export, value = ((__VLIR3_LAST__ - __VLIR3_START__) + 253) / 254; + __VLIR4_BLOCKS__: type = export, value = ((__VLIR4_LAST__ - __VLIR4_START__) + 253) / 254; + __VLIR5_BLOCKS__: type = export, value = ((__VLIR5_LAST__ - __VLIR5_START__) + 253) / 254; + __VLIR6_BLOCKS__: type = export, value = ((__VLIR6_LAST__ - __VLIR6_START__) + 253) / 254; + __VLIR7_BLOCKS__: type = export, value = ((__VLIR7_LAST__ - __VLIR7_START__) + 253) / 254; + __VLIR8_BLOCKS__: type = export, value = ((__VLIR8_LAST__ - __VLIR8_START__) + 253) / 254; + __VLIR9_BLOCKS__: type = export, value = ((__VLIR9_LAST__ - __VLIR9_START__) + 253) / 254; + __VLIR10_BLOCKS__: type = export, value = ((__VLIR10_LAST__ - __VLIR10_START__) + 253) / 254; + __VLIR11_BLOCKS__: type = export, value = ((__VLIR11_LAST__ - __VLIR11_START__) + 253) / 254; + __VLIR12_BLOCKS__: type = export, value = ((__VLIR12_LAST__ - __VLIR12_START__) + 253) / 254; + __VLIR13_BLOCKS__: type = export, value = ((__VLIR13_LAST__ - __VLIR13_START__) + 253) / 254; + __VLIR14_BLOCKS__: type = export, value = ((__VLIR14_LAST__ - __VLIR14_START__) + 253) / 254; + __VLIR15_BLOCKS__: type = export, value = ((__VLIR15_LAST__ - __VLIR15_START__) + 253) / 254; + __VLIR16_BLOCKS__: type = export, value = ((__VLIR16_LAST__ - __VLIR16_START__) + 253) / 254; + __VLIR17_BLOCKS__: type = export, value = ((__VLIR17_LAST__ - __VLIR17_START__) + 253) / 254; + __VLIR18_BLOCKS__: type = export, value = ((__VLIR18_LAST__ - __VLIR18_START__) + 253) / 254; + __VLIR19_BLOCKS__: type = export, value = ((__VLIR19_LAST__ - __VLIR19_START__) + 253) / 254; } MEMORY { CVT: file = %O, start = $0, size = $40000; diff --git a/doc/apple2.sgml b/doc/apple2.sgml index ec9598d04..286acc252 100644 --- a/doc/apple2.sgml +++ b/doc/apple2.sgml @@ -354,6 +354,8 @@ usage. allow_lowercase beep dir_entry_count +file_set_auxtype +file_set_type get_tv get_ostype gmtime_dt diff --git a/doc/apple2enh.sgml b/doc/apple2enh.sgml index 1e94d3b60..c2076923a 100644 --- a/doc/apple2enh.sgml +++ b/doc/apple2enh.sgml @@ -333,6 +333,8 @@ usage. _datetime beep dir_entry_count +file_set_auxtype +file_set_type get_tv get_ostype gmtime_dt diff --git a/doc/ca65.sgml b/doc/ca65.sgml index b7e8539af..5e53fb002 100644 --- a/doc/ca65.sgml +++ b/doc/ca65.sgml @@ -94,23 +94,29 @@ Short options: -W n Set warning level n -d Debug mode -g Add debug info to object file + -x Expand macros in the listing + repeat -x for full expansion -h Help (this text) -i Ignore case of symbols -l name Create a listing file if assembly was ok -mm model Set the memory model -o name Name the output file -s Enable smart mode + -S Generate segment offsets in listing -t sys Set the target system -v Increase verbosity Long options: --auto-import Mark unresolved symbols as import --bin-include-dir dir Set a search path for binary includes + --color [on|auto|off] Color diagnostics (default: auto) --cpu type Set cpu type --create-dep name Create a make dependency file --create-full-dep name Create a full make dependency file --debug Debug mode --debug-info Add debug info to object file + --expand-macros Expand macros in listing + Repeat to get full expansion --feature name Set an emulation feature --help Help (this text) --ignore-case Ignore case of symbols @@ -119,8 +125,10 @@ Long options: --listing name Create a listing file if assembly was ok --list-bytes n Maximum number of bytes per listing line --memory-model model Set the memory model + --no-utf8 Disable use of UTF-8 in diagnostics --pagelength n Set the page length for the listing - --relax-checks Disables some error checks + --relax-checks Relax some checks (see docs) + --segment-list Generate segment offsets in listing --smart Enable smart mode --target sys Set the target system --verbose Increase verbosity @@ -146,6 +154,14 @@ Here is a description of all the command line options: name="search paths">. +