Compare commits

..

5540 commits

Author SHA1 Message Date
wrapper
51dffb6f34 nes.lib compat 2026-04-21 19:53:53 +07:00
wrapper
916e9ee86d release prep 2026-04-17 10:42:58 +07:00
wrapper
17602e86b6 update encryption names 2026-04-17 09:40:46 +07:00
wrapper
7b33aa2662 lib build script 2026-04-10 18:37:50 +07:00
wrapper
6007ae8cdd add encryption 2026-04-10 17:12:11 +07:00
wrapper
3f714aa1d0 VTxx encryption support 2026-04-10 16:37:46 +07:00
Bob Andrews
a545b4fc3e
Merge pull request #2951 from avolkov76/anv-bug-2942
Prevent inadvertent removals of `ldaxysp` runtime calls in `OptStackOps()`
2026-04-07 13:36:12 +02:00
Alex Volkov
69c17a502b Additional synthetic, extreme register load reuse tests future-proofing issues #2942 and #2947. 2026-04-01 18:27:28 -04:00
Alex Volkov
de78048319 Generalize the shared, non-removable reg load tests in RemoveRegLoads() to "instruction affects the other register" 2026-03-29 17:05:20 -04:00
Alex Volkov
321e47f0f3 Rhs X removals in coptstop.c should no longer be dangerous. 2026-03-26 18:32:04 -04:00
Alex Volkov
6027487c30 Expand bug2461 tests to other operators and Lhs/Rhs conditions 2026-03-26 18:22:39 -04:00
Alex Volkov
00a1f1d447 Clearly delineate load instruction "must remove" conditions from "may remove" with a new LI_MUST_REMOVE flag. A demand to remove a non-removable load is fatal. 2026-03-25 19:14:14 -04:00
Alex Volkov
c9b885b144 Prevent the removal of a ldaxysp runtime call as a "load instruction" for only the A or the X side, when the other is non-removable. Fixes issue #2942 / #2461. 2026-03-25 19:08:18 -04:00
Alex Volkov
40a20ab973 Expand bug1374 tests to a few other conditions 2026-03-25 19:03:00 -04:00
Alex Volkov
ac69017ca5 Remove redundant LoadEntry clears; DelEntry() already handles clearing them, and the redundant clears are a red herring in the code. 2026-03-25 19:01:37 -04:00
Alex Volkov
62451557f9 Revert the fix for #2461 in search of a more general solution 2026-03-25 19:00:57 -04:00
Bob Andrews
80ff9d3f4d
Merge pull request #2949 from avolkov76/anv-bug-2947
[cc65] Prevent Lhs loads shared with the Rhs from being removed in `OptStackOps()`
2026-03-25 23:01:50 +01:00
Alex Volkov
d711b6d6fa Prevent Lhs load insns shared with the Rhs from being inadvertently removed by Rhs optimizers. Fixes issue #2947. 2026-03-22 19:42:57 -04:00
Alex Volkov
af285ba9e5 Remove red herring flag set. It is far too late to set LI_DONT_REMOVE in a subopt. 2026-03-22 18:49:12 -04:00
Alex Volkov
7988d9aefb Regression tests for #2947 expanded to other operators and conditions 2026-03-22 18:44:16 -04:00
Alex Volkov
9732bc2cb7 Correct some printed messages and remove one print in bug2395 test (c&p errors) 2026-03-22 18:42:01 -04:00
Bob Andrews
b6d9fb6016
Merge pull request #2948 from avolkov76/tests-out-race
Prevent stdout/stderr redirect races in the val testbench
2026-03-22 20:36:59 +01:00
Alex Volkov
9c5916866b Prevent stdout/stderr redirect races in the testbench 2026-03-22 14:24:02 -04:00
Bob Andrews
916933f884
Merge pull request #2941 from avolkov76/anv-coptstop-refactor
[cc65] Refactor OptStackOps() subopt precondition evaluation framework, phase 1
2026-03-21 14:50:25 +01:00
Alex Volkov
d036c4aaae Minimal test for issue #2947 2026-03-20 19:51:55 -04:00
Alex Volkov
f464b50495 Minimal test for issue #2946 2026-03-20 19:51:37 -04:00
Alex Volkov
2fd9411f7f Expand bug2395 tests to other operators and conditions 2026-03-20 19:51:04 -04:00
Alex Volkov
d427887764
Merge branch 'cc65:master' into anv-coptstop-refactor 2026-03-19 08:15:09 -04:00
Bob Andrews
4232e7acc6
Merge pull request #2945 from polluks/patch-15
Update comment for MEGA65 joystick driver
2026-03-18 21:31:55 +01:00
Stefan
0fe0337e9c
Update comment for MEGA65 joystick driver 2026-03-18 19:30:40 +01:00
Alex Volkov
57cc683d91 Whitespace fix (left after var removal) 2026-03-11 19:33:36 -04:00
Alex Volkov
ca98b218e8 Remove the unused (for now) predicate functions in coptstop.c to keep the compiler happy. 2026-03-11 19:17:50 -04:00
Alex Volkov
73f4149554 Refactor: remove the now unused flag variable in OptStackOps() 2026-03-11 19:09:34 -04:00
Alex Volkov
99ccd7e1a3 Refactor: Replace OptStackOps() complex (and buggy) flag-based subopt precondition evaluation system with plain language predicate functions. Any custom preconditions can now be expressed without much trouble.
Also, begin establishing parity between precondition logic and actual subopt branching logic.
2026-03-11 17:44:33 -04:00
Alex Volkov
82d672e904 Refactor: rearrange Opt_a_tosbitwise() code to follow the common if-else if-else pattern form used by other subopts. 2026-03-10 20:47:39 -04:00
Alex Volkov
bf5d8c44e4 BUGFIX: Fix the "same X value" and "same A value" evaluations issue in OptStackOps(), where the values compared come from the wrong instruction when a runtime call has an asm label. 2026-03-10 20:08:35 -04:00
Alex Volkov
505698c450 Refactor: remove StackOpData side effects from IsRegVar() and PreCondOk()/RegAPreCondOk(); setting StackOpData.ZPLo/ZPHi is explicit. 2026-03-10 19:23:40 -04:00
Alex Volkov
1b778edee8 Annotations ahead of refactoring: bugs., looming bugs, and work notes. 2026-03-10 17:46:40 -04:00
Bob Andrews
a29ce64fb5
Merge pull request #2940 from avolkov76/anv-coptstop-head
Compare operator test suite ahead of cc65/coptstop.c refactoring (refer #2935)
2026-03-10 01:49:31 +01:00
Alex Volkov
76d71aec92 Compare operator test suite: forward and reverse compares; edge and corner cases; literals, autos, statics, simple expressions; signed and unsigned; some special cases. 2026-03-09 20:04:59 -04:00
Bob Andrews
d45fac3afe
Merge pull request #2938 from kugelfuhr/kugelfuhr/fix-2811
Fix an invalid transformation by the optimizer
2026-03-05 19:51:51 +01:00
Kugel Fuhr
3d26a7e1fe Correct test name and test comment. 2026-03-05 18:44:33 +01:00
Kugel Fuhr
380c3f810e Fix an invalid transformation by the optimizer. Introduced by #2811. 2026-03-05 18:40:52 +01:00
Bob Andrews
6184e7286b
Merge pull request #2936 from CubeXGames/patch-1
Fix typo in ca65 documentation
2026-03-01 14:06:41 +01:00
CubeX
e41484a3a8
Fix typo in ca65 documentation 2026-02-28 20:20:59 -07:00
Bob Andrews
c7e851caa3
Merge pull request #2932 from willisblackburn/bug_2930
Move AssignIds to before we print the info line…
2026-02-28 00:14:48 +01:00
Willis Blackburn
5f437e09a0 Move AssignIds to before we print the info line in order to ensure that we write the correct file count. 2026-02-12 17:54:58 -05:00
Bob Andrews
0fca83500b
Merge pull request #2927 from kugelfuhr/kugelfuhr/fix-2926
Fix cc65 not detecting invalid integer and float literal suffixes
2026-02-11 19:54:44 +01:00
Bob Andrews
53dacfd18e
Merge pull request #2919 from polluks/c16
Combine C16 and Plus/4 source
2026-02-11 19:47:04 +01:00
Bob Andrews
f166ca8ad9
Merge pull request #2918 from polluks/patch-15
Removed unused import
2026-02-07 16:35:51 +01:00
Bob Andrews
fbcae3e640
Merge pull request #2921 from willisblackburn/master
Add terminating NUL after __func__ string literal #2920
2026-02-07 16:34:01 +01:00
Kugel Fuhr
2f62b263f3 Added a test. 2026-02-06 16:36:44 +01:00
Kugel Fuhr
61799b07bf Fix unchecked integer or floating point suffixes. 2026-02-06 15:55:30 +01:00
Willis Blackburn
789416798f Add terminating NUL after __func__ string literal #2920 2026-01-24 12:32:31 -05:00
Stefan
0125d82902
Replace kbhit implementation with new include 2026-01-22 14:37:52 +01:00
Stefan
53b5f79051
Combine C16 and Plus/4 source 2026-01-22 13:49:56 +01:00
Stefan
2f6eb8ddd0
Removed unused import 2026-01-22 12:27:57 +01:00
Bob Andrews
034f73a9e1
Merge pull request #2862 from dansanderson/master
c65 target: conio accesses all color RAM in 80x25 text mode
2026-01-09 23:45:05 +01:00
Bob Andrews
1e1e8a686e
Merge pull request #2911 from picocomputer/tz2
Time zone support for target RP6502
2026-01-04 18:18:54 +01:00
Christian Groessler
4680d68e52
Merge pull request #2913 from polluks/master
Fixed funny typo
2025-12-24 16:25:29 +01:00
Stefan
7ee374a432
Fixed funny typo 2025-12-15 00:28:21 +01:00
rumbledethumps
dde04808aa the bytes, they need saving 2025-12-07 11:42:02 -08:00
rumbledethumps
8ff7b0087c doh 2025-12-06 12:56:20 -08:00
rumbledethumps
48b936b767 nah it's 4 2025-12-06 12:13:36 -08:00
rumbledethumps
af19d96174
Merge branch 'cc65:master' into tz2 2025-12-06 11:42:09 -08:00
rumbledethumps
6ac362af87 indeed! 2025-12-06 11:41:52 -08:00
rumbledethumps
328f7e6a43 yes! 2025-12-06 11:38:27 -08:00
rumbledethumps
18f084eafb restore test 2025-12-05 16:30:14 -08:00
rumbledethumps
dbdca13444 optimize and restore null test 2025-12-05 15:38:46 -08:00
Bob Andrews
c720c3c485
Merge pull request #2910 from Fabrizio-Caruso/patch-1
Fix typo in Watara entry in README
2025-12-03 22:24:14 +01:00
Fabrizio Caruso
10297ba637
Fix typo in Watara entry in README 2025-12-03 21:54:32 +01:00
Bob Andrews
36f00f9886
Merge pull request #2907 from colinleroy/decomp-more-info
Mention where decompressors stats come from
2025-12-03 21:32:22 +01:00
rumbledethumps
71f2ffbffc remove time zone hack 2025-12-03 00:45:25 -08:00
rumbledethumps
dce4ed65d9 remove test for non-standard behavior 2025-12-02 22:08:53 -08:00
rumbledethumps
a6a91349bc make time zone work 2025-12-02 21:37:14 -08:00
Colin Leroy-Mira
e01a608863 Mention where decompressors stats come from 2025-12-01 13:30:26 +01:00
Dan Sanderson
5296d394e4 Use php/sei/plp to preserve original state of the interrupt flag 2025-11-28 11:09:21 -08:00
Dan Sanderson
c14f2b7252 cpeekcolor: don't stash and restore I flag or CRAM2K 2025-11-20 18:03:38 -08:00
Dan Sanderson
d2f91a8116 Assume conio owns Interrupt flag and CRAM2K, don't stash and restore 2025-11-20 17:49:40 -08:00
Dan Sanderson
6fb5934b87 Improve CRAM2K flip to preserve previous value 2025-11-18 20:22:47 -08:00
Bob Andrews
dbcfa91089
Merge pull request #2863 from kugelfuhr/kugelfuhr/fix-2859
Fix broken boolean not operator in ca65
2025-11-18 16:39:08 +01:00
Kugel Fuhr
1924e4cc63 Added a test for #2859. 2025-11-18 14:38:10 +01:00
Kugel Fuhr
c4cd575331 Fix parsing boolean not (.not/!). 2025-11-18 14:35:29 +01:00
Dan Sanderson
cfb55a89d4 Update coding style for asm 2025-11-18 00:47:49 -08:00
Dan Sanderson
18e9c6f6a0 c65 target: conio accesses all color RAM in 80x25 text mode 2025-11-18 00:36:10 -08:00
Bob Andrews
640206696f
Merge pull request #2855 from picocomputer/master
Update RP6502 in README
2025-11-14 23:49:48 +01:00
Bob Andrews
3d7e3884e4
Merge pull request #2856 from kugelfuhr/kugelfuhr/fix-2854
Corrected a typo in the description of .set
2025-11-09 19:10:26 +01:00
Kugel Fuhr
aa73c03f6a Corrected a typo in the description of .set. Fixes #2854. 2025-11-09 17:25:57 +01:00
rumbledethumps
1d219395f2 Update RP6502 in README 2025-11-07 13:11:47 -08:00
Bob Andrews
f54780cfbc
Merge pull request #2844 from picocomputer/master
Support for RP6502 Version 0.14
2025-11-03 13:39:25 +01:00
Bob Andrews
083f89a9ca
Merge pull request #2847 from colinleroy/zx02-faster-decompressor
Add a 9% faster ZX02 decompressor
2025-11-03 13:34:29 +01:00
Colin Leroy-Mira
9390e5c2ce Apple2: factorize MLI pathname setting (up to -22 bytes) 2025-11-02 21:24:59 +01:00
Colin Leroy-Mira
850accee3a Apple2: -8 bytes on rename 2025-11-02 21:24:59 +01:00
Colin Leroy-Mira
280f296952 Apple2: mutualize mli filename push (-0 to -18 bytes) 2025-11-02 21:24:59 +01:00
Colin Leroy-Mira
3b8531a422 Apple2: -5 bytes on open() 2025-11-02 21:24:59 +01:00
Colin Leroy-Mira
707e317bb8 Apple2: spare 10 bytes on I/O 2025-11-02 21:24:59 +01:00
Colin Leroy-Mira
25c1223f02 Apple2: spare 2 bytes on read 2025-11-02 21:24:59 +01:00
Oliver
759884ddd4 Allow to backspace with 'Delete' (and some optimization) 2025-11-02 20:52:50 +01:00
Bob Andrews
778bc5bc22
Merge pull request #2843 from colinleroy/warn-about-fill-bytes
Emit warnings for wasted bytes when aligning
2025-11-02 18:14:27 +01:00
Bob Andrews
a88d7abd3f
Merge pull request #2851 from kugelfuhr/kugelfuhr/fix-2850
Fix "constant expression expected" when using .CPU_ISET_xxx with no target system set
2025-11-01 16:36:39 +01:00
Kugel Fuhr
b4dc41c653 CPU constants must always be defined, not only if a target system was given. 2025-11-01 15:37:57 +01:00
Colin Leroy-Mira
d6dd0fa865 Document decompressors 2025-10-26 18:58:15 +01:00
Colin Leroy-Mira
f3e43cc5c5 Add a 9% faster ZX02 decompressor 2025-10-26 18:53:26 +01:00
Colin Leroy-Mira
2220c6ec8d Add --warn-align-waste option to ca65, ld65, cl65 2025-10-26 16:06:08 +01:00
rumbledethumps
4cb40a4155 f_getcwd 2025-10-22 18:51:01 -07:00
rumbledethumps
47c7160476 getcwd 2025-10-21 20:58:50 -07:00
rumbledethumps
899ee2dac2 remove fresult 2025-10-21 09:42:04 -07:00
rumbledethumps
f06acc993a code_page 2025-10-20 23:06:32 -07:00
rumbledethumps
9b54be41da code page 2025-10-20 22:53:42 -07:00
Colin Leroy-Mira
28442e60b8 Emit warnings for wasted bytes when aligning 2025-10-19 15:00:13 +02:00
rumbledethumps
69149c65ec remove blank line 2025-10-16 18:14:44 -07:00
rumbledethumps
be4eb9dc23
Merge branch 'cc65:master' into master 2025-10-16 16:21:09 -07:00
rumbledethumps
4b561acea5 all dir commands 2025-10-16 16:20:23 -07:00
rumbledethumps
815135f716 chdir and friends 2025-10-15 23:41:44 -07:00
rumbledethumps
f744f0b8a0 dir seeking 2025-10-15 14:12:12 -07:00
rumbledethumps
e6c138dc03 directory ops 2025-10-14 23:11:23 -07:00
Bob Andrews
84bcd53c45
Merge pull request #2840 from polluks/patch-14
Fixed typos
2025-10-13 20:52:17 +02:00
Stefan
82dbc828af
Fixed typos 2025-10-10 15:01:33 +02:00
Bob Andrews
c2556bb5e2
Merge pull request #1358 from dmsc/issue-479
Fixes Issue 479 (ca65: can't reference .proc members before declaration)
2025-10-05 15:39:56 +02:00
rumbledethumps
a6763af95c fix xreg.s 2025-10-04 16:29:30 -07:00
Bob Andrews
362e20b4d0
Merge pull request #2839 from danielg4/master
Fix uncatalogued name clash with libsrc/runtime/leave.s
2025-09-30 16:40:18 +02:00
Daniel Gimpelevich
6be0731247 Fix uncatalogued name clash with libsrc/runtime/leave.s
Even though these labels are not exported, they can show up in linker
maps and thus break o65 modules.
2025-09-29 18:22:53 -07:00
rumbledethumps
23b8bafbf6 no need to expose errno_opt 2025-09-27 23:27:02 -07:00
rumbledethumps
e182d5d324
Merge branch 'cc65:master' into master 2025-09-26 17:20:17 -07:00
rumbledethumps
fdcb890bfd remove oserror from rp6502 2025-09-26 17:19:50 -07:00
Bob Andrews
93c1b659ee
Merge pull request #2824 from GrosChien/master
ca65 Fixing segfault when using `--expend-macros` without `--listing`
2025-09-22 21:18:39 +02:00
Bob Andrews
8ec38c38d5
Merge pull request #2827 from polluks/master
Fixed minor typo
2025-09-22 21:17:10 +02:00
Bob Andrews
ca7335023f
Merge pull request #2834 from polluks/patch-12
Fixed overflow
2025-09-22 21:06:41 +02:00
Bob Andrews
4383841f24
Merge pull request #2833 from polluks/patch-10
Fixed typo
2025-09-22 21:03:56 +02:00
Bob Andrews
fae2d5511f
Merge branch 'master' into patch-10 2025-09-22 21:03:18 +02:00
Bob Andrews
732c0c09f8
Merge pull request #2832 from polluks/patch-9
Fixed typos
2025-09-22 21:01:29 +02:00
Bob Andrews
9aab9e93aa
Merge pull request #2829 from kugelfuhr/kugelfuhr/fix-2826
Fix hardcoded upper limit of ld65 input files
2025-09-22 21:00:43 +02:00
Stefan
9601b11a9c
inplicit length 2025-09-18 11:10:41 +02:00
Stefan
5e89953bf9
Fixed overflow 2025-09-17 15:03:55 +02:00
rumbledethumps
b5ff68a952
Merge branch 'cc65:master' into master 2025-09-15 20:57:21 -07:00
Stefan
089f8f1425
Fixed typo 2025-09-14 22:36:31 +02:00
Stefan
1ef3f88f0a
Fixed typos 2025-09-14 22:30:24 +02:00
Kugel Fuhr
0dc484f5a7 Fix hardcoded upper limit of input files. 2025-09-08 20:51:27 +02:00
Stefan
613e752051
Fixed minor typo 2025-09-05 09:58:36 +02:00
Gros chien
ee096d27df Fix segfault when using -x without -l 2025-08-26 23:45:39 +02:00
Colin Leroy-Mira
357f64e4e3 Address Oliver's comments 2025-08-26 15:11:15 +02:00
Colin Leroy-Mira
86bcf32580 Apple2: Add file_set_type() and file_set_auxtype()
MLI wrapper to be able to update existing ProDOS
files' type and auxtype.
2025-08-26 15:11:15 +02:00
Joshua Bell
ce20b6aa48 Explain the expected failures in 311 2025-08-22 09:57:45 -07:00
Joshua Bell
873361ba83 Show used values in listing 2025-08-22 09:49:04 -07:00
Joshua Bell
f18de5bc73 Remove accidentally included file 2025-08-22 09:37:23 -07:00
Joshua Bell
939276669f Tests for scopes and issue #479 / PR #1358 2025-08-21 10:07:54 -07:00
Daniel Serpell
2454ab831c When creating a new scope for a forwarded symbol, do not open it.
This fixes las example in the PR.
2025-08-17 20:24:08 -04:00
Daniel Serpell
acc26c0e7b When the scope is not found on ancestors, create on current scope.
This solves comment https://github.com/cc65/cc65/pull/1358#issuecomment-3193961949
2025-08-16 22:28:32 -04:00
Daniel Serpell
2323f46a54 Only search a symbol in parent scopes if not already scoped.
This fixes the case at: https://github.com/cc65/cc65/pull/1358#issuecomment-747194906
2025-08-16 17:29:12 -04:00
Daniel Serpell
76e31e5b75 Document usage of scope before definitions.
Note that before the last commit, the example did not assemble.
2025-08-16 11:17:43 -04:00
Daniel Serpell
5b70654289 Allows referencing a scope not yet created.
Use the "::" syntax at the start of the symbol to force creating
a scope if it does not exists yet.

Fixes issue #479.
2025-08-16 11:17:35 -04:00
mrdudz
6efe447d14 add some strategic git ignores, should satisfy #2818 2025-07-27 17:29:59 +02:00
Bob Andrews
5197c56c7c
Merge pull request #2794 from mrdudz/fixgrc
Fixgrc
2025-07-27 00:23:02 +02:00
Bob Andrews
d06e0d9a16
Merge pull request #2812 from colinleroy/Opt-ldptr1
Optimize ldax?sp/sta/stx to ldptr1?sp
2025-07-27 00:22:21 +02:00
Bob Andrews
17c8e2154b
Merge pull request #2811 from colinleroy/OptTosLoadPop
Optimize jsr ldax0sp/incsp2
2025-07-27 00:21:50 +02:00
Colin Leroy-Mira
1f6cca2140 Coding style 2025-07-27 00:02:48 +02:00
Colin Leroy-Mira
a0b705fd41 Remove code after inserting new one 2025-07-27 00:02:48 +02:00
Colin Leroy-Mira
0647cb1112 Merge jsr pushax/j?? popax into nothing or RTS 2025-07-27 00:02:48 +02:00
Colin Leroy-Mira
4c2cc24e77 Optimize jsr ldax0sp/incsp2 2025-07-27 00:02:18 +02:00
Colin Leroy-Mira
aa936b6d12 Fix copyright 2025-07-26 23:59:02 +02:00
mrdudz
cb39da2fba Use spaces instead of tabs in the output files 2025-07-26 23:52:14 +02:00
Bob Andrews
4c6c8b2430
Merge pull request #2819 from kugelfuhr/kugelfuhr/improved-flowanalysis
Improved flowanalysis for cc65
2025-07-26 23:37:49 +02:00
Kugel Fuhr
228671b7c4 Added another test. 2025-07-26 10:17:32 +02:00
Kugel Fuhr
8f4a4040d6 Complete unreachable checking for switch statements. 2025-07-26 09:03:27 +02:00
Kugel Fuhr
70c1bd5e3c Improved flow analysis in general and especially for "for" loops. Added more
tests.
2025-07-26 09:03:04 +02:00
Kugel Fuhr
8ac25376a0 Fix the "double semicolon" problem where a double semicolon after a statement
that makes the following code unreachable led to an "unreachable code" warning.
2025-07-26 09:02:54 +02:00
mrdudz
3d052ea4a3 remove some braces 2025-07-26 00:21:00 +02:00
Bob Andrews
b0e10e1f9a
Merge pull request #2814 from jedeoric/master
telestrat target : lseek now returns position as it should
2025-07-26 00:18:38 +02:00
Bob Andrews
0a4af6df92
Merge pull request #2808 from kugelfuhr/kugelfuhr/flowanalysis
Simple flow analysis to find unreachable code
2025-07-26 00:10:21 +02:00
Bob Andrews
5809eaf037
Update libsrc/telestrat/lseek.s
Co-authored-by: kugelfuhr <98353208+kugelfuhr@users.noreply.github.com>
2025-07-26 00:01:07 +02:00
Bob Andrews
4e0806c6be
Merge pull request #2813 from colinleroy/fix-pr-2778
Fix bug in PR #2778
2025-07-24 13:21:56 +02:00
jedeoric
87ce45ba01
telestrat target : lseek now returns position as it should 2025-07-23 22:49:15 +02:00
mrdudz
2c906474eb calculate the disk blocks in the linker config 2025-07-20 19:18:24 +02:00
Colin Leroy-Mira
6d96a952fd
Stricter check for incax[1-8]
Thanks to @kugelfuhr

Co-authored-by: kugelfuhr <98353208+kugelfuhr@users.noreply.github.com>
2025-07-20 18:48:58 +02:00
Colin Leroy-Mira
fa1b6ed4f7 Address issues 2025-07-20 16:39:24 +02:00
Colin Leroy-Mira
095ee0b27c Merge branch 'master' into fix-pr-2778 2025-07-20 16:28:49 +02:00
Colin Leroy-Mira
8a793796d7 Coding style 2025-07-20 16:14:35 +02:00
Colin Leroy-Mira
8ba1cef550 Merge branch 'master' into Opt-ldptr1 2025-07-20 16:08:01 +02:00
Colin Leroy-Mira
2b2c082efb Fix bug in PR #2778
Don't replace incaxy like incax[1-8].
2025-07-20 14:36:30 +02:00
Colin Leroy-Mira
17b8645360 Optimize ldax?sp/sta/stx to ldptr1?sp 2025-07-20 12:24:24 +02:00
rumbledethumps
02cb5d23f7 add xreg_ria_gamepad 2025-07-19 23:13:53 -07:00
mrdudz
e554d0ccfb mark sequential GEOS files without RECORD table as such. 2025-07-20 02:01:37 +02:00
mrdudz
3ff1a9e463 another try. still not quite right apparently 2025-07-19 23:00:28 +02:00
Bob Andrews
32313a8c56
Merge pull request #2805 from kugelfuhr/kugelfuhr/remove-grc-artifacts
Remove .s files generated from .grc files
2025-07-19 20:11:13 +02:00
Bob Andrews
053f0a1b05
Merge pull request #2809 from JimmyDansbo/w65c02_capabilities
Added correct capabilities to W65C02 and 65CE02 CPUs
2025-07-19 20:08:06 +02:00
Bob Andrews
8bbe0f6972
Merge pull request #2810 from jedeoric/master
telestrat target : manage main return code
2025-07-19 20:06:35 +02:00
jedeoric
329ec64a4b
telestrat target : manage main return code 2025-07-18 00:23:44 +02:00
Kugel Fuhr
61f3e43fb6 Rewrote an outdated comment. 2025-07-17 20:52:33 +02:00
Jimmy Dansbo
3cd1672ae5 Added correct capabilities to W65C02 and 65CD02 cpus 2025-07-17 19:17:03 +02:00
Kugel Fuhr
6d45a94127 Do not output a warning about a missing "return" in a function if the function
exit is unreachable.
2025-07-17 17:07:34 +02:00
Kugel Fuhr
ed54e9b168 Added several flow control tests. 2025-07-17 16:00:59 +02:00
Kugel Fuhr
f13284d3f8 Move the warning about unreachable code out of the Test() function and into
the callers. This has the effect that the location for the warning is much
more precise than before.
2025-07-17 15:43:15 +02:00
Kugel Fuhr
93b94d314a Implement a simple flow analysis. Tracks control flow of all statements with
the exception of "switch". Outputs warnings for unreachable code. Tracks also
"return" but doesn't currently make use of this information.
2025-07-17 15:39:45 +02:00
Kugel Fuhr
1c167b1ff1 Use cl65 to generate the object file from the grc file to avoid having an
intermediate .s file lying around that "make check" complains about.
2025-07-16 21:24:25 +02:00
Kugel Fuhr
e82656d8ca Remove .s files generated from .grc files. 2025-07-16 12:31:18 +02:00
Bob Andrews
3f3dc3d145
Merge pull request #2803 from kugelfuhr/kugelfuhr/fix-1162
Add a description for --memory-model to the docs
2025-07-16 00:56:36 +02:00
Bob Andrews
89704a6e37
Merge pull request #2802 from kugelfuhr/kugelfuhr/modernize-ld65-diags
Modernize ld65 diagnostics
2025-07-16 00:55:12 +02:00
Bob Andrews
25e6b42ef3
Merge pull request #2799 from kugelfuhr/kugelfuhr/fix-atari7800-cfg
Atari 7800: Make the EXTZP segment optional
2025-07-15 23:27:06 +02:00
Bob Andrews
61072ce3c7
Merge pull request #2797 from kugelfuhr/kugelfuhr/fix-2796
For the cpudetect tests, check the binary results for all instructions
2025-07-15 21:21:31 +02:00
Bob Andrews
14a6c66997
Merge pull request #2795 from kugelfuhr/kugelfuhr/fix-sortcheck
Fix an error in the sort check scripts.
2025-07-15 21:18:22 +02:00
Bob Andrews
a4c97c7ebc
Merge pull request #2804 from mrdudz/geossample
add a geos resource file to the "ascii" sample
2025-07-15 20:48:01 +02:00
mrdudz
3ea8cae0ee add a geos resource file to the "ascii" sample, removes the linker warnings (and makes the program actually work in GEOS) 2025-07-15 17:56:45 +02:00
Christian Groessler
4cbdb55fbc
Merge pull request #2798 from kugelfuhr/kugelfuhr/fix-2787
Move constructors into the ONCE segment for the creativision target
2025-07-14 20:32:37 +02:00
Kugel Fuhr
9ac02f3282 Move constructors into the ONCE segment to fix linker warnings. 2025-07-14 19:52:07 +02:00
Kugel Fuhr
f86f602b9e Add a description for --memory-model to the docs. 2025-07-14 16:45:42 +02:00
Kugel Fuhr
4120f35276 Added tests for warnings or errors that now have notifications. 2025-07-14 12:59:52 +02:00
Kugel Fuhr
170ddc6e33 Add a --warnings-as-errors option to cc65 for compatibility reasons. 2025-07-14 11:35:53 +02:00
Kugel Fuhr
d54844c76b Make the EXTZP segment optional for Atari 7800. 2025-07-14 07:03:53 +02:00
Kugel Fuhr
3dfde7baef For the cpudetect tests, check the binary results for all instructions, not
just for a few selected ones.
2025-07-13 21:43:34 +02:00
Kugel Fuhr
c7096ab6d7 Fix an error that was introduced by me in a4a24280f2:
Using a pipe causes a subshell to be generated so the "exit" statements will
just leave the subshell. As a consequence, the sortedxxx.sh scripts produced
output but no error exit code. Which in turn caused an error in #2778 to slip
through undetected.
2025-07-13 17:56:31 +02:00
Kugel Fuhr
2e4c18770b Add a --warnings-as-errors to cl65. 2025-07-13 16:34:36 +02:00
Kugel Fuhr
c2f17b6f6b When initialized data is found in a segment, print the first module where this
data comes from to ease debugging.
2025-07-13 16:34:29 +02:00
Kugel Fuhr
2e3edf9b1b Some reformatting and improved diagnostics. 2025-07-13 16:34:20 +02:00
Kugel Fuhr
3e81cd6ae0 Renames CfgError -> PError, CfgWarning -> PWarning. 2025-07-13 16:33:59 +02:00
Kugel Fuhr
7d963d4490 Change the output format for .assert. Use --no-utf8 for the tests. 2025-07-13 16:33:15 +02:00
Kugel Fuhr
074a3f513e Add the --color and --no-utf8 options to cl65 which will pass it to the tools
that understand it.
2025-07-13 16:33:03 +02:00
Kugel Fuhr
79967ff01b Support colors in diagnostic output. 2025-07-13 16:32:56 +02:00
Kugel Fuhr
96f8ce4cee Move the functions to output config file errors from scanner.c to error.c. 2025-07-13 16:32:47 +02:00
Kugel Fuhr
6f45af3c9e Use console properties. Add the --no-utf8 and --color options. 2025-07-13 16:32:37 +02:00
Kugel Fuhr
da0e3907ec Move the code to parse color strings into the CP_Parse() function and use it. 2025-07-13 16:32:23 +02:00
mrdudz
b99bdf1e89 if "geos-template.d64" exists, copy the samples to that instead of a blank image 2025-07-12 21:15:12 +02:00
mrdudz
7117936828 calculate number of disk blocks from size of VLIR record(s) 2025-07-12 20:58:18 +02:00
Bob Andrews
faecedb514
Merge pull request #2793 from mrdudz/fixdbg
fix debugger
2025-07-12 17:00:45 +02:00
mrdudz
c0e8835ba0 brief docs 2025-07-11 22:32:14 +02:00
mrdudz
0d30d8b4ae add (very simple) example for dbg.h 2025-07-11 21:56:34 +02:00
mrdudz
e973483cc8 DbgIsBreak() must use __cdecl__ 2025-07-11 21:55:58 +02:00
Bob Andrews
18805b8df9
Merge pull request #2792 from mrdudz/sometests
test for #2208
2025-07-11 19:10:38 +02:00
Bob Andrews
68cccd31fa
Merge pull request #2791 from mrdudz/fix2789
Fix2789
2025-07-11 19:00:01 +02:00
Bob Andrews
8245eb31a0
Merge pull request #2790 from mrdudz/docsfix
add missing command line details, sort options
2025-07-11 18:47:10 +02:00
mrdudz
c13f7dbdad fix range check 2025-07-11 18:44:58 +02:00
mrdudz
907d8b26c5 simple regression test for .charmap 2025-07-11 18:38:24 +02:00
mrdudz
aba0b6b439 add missing command line details, sort options 2025-07-11 17:52:03 +02:00
Bob Andrews
5fc300b987
Merge pull request #2280 from pm100/seglist
Add segment ID to assembler listing for reloc code
2025-07-10 22:49:21 +02:00
Bob Andrews
3e3a65f82e
Update ca65.sgml 2025-07-10 22:35:18 +02:00
Bob Andrews
f7ebd4dfea
Merge branch 'master' into seglist 2025-07-10 22:21:57 +02:00
Bob Andrews
bb736972f0
Merge pull request #2279 from pm100/macexpand
Expand macros in listing
2025-07-10 22:17:13 +02:00
Bob Andrews
ffa72f56f1
codestyle 2025-07-10 21:19:55 +02:00
Bob Andrews
97e4c6b42f
some cosmetics 2025-07-10 21:18:12 +02:00
Bob Andrews
61362779a5
Merge branch 'master' into macexpand 2025-07-10 21:05:20 +02:00
Bob Andrews
d8b4013f3c
Merge branch 'master' into seglist 2025-07-10 20:48:28 +02:00
Bob Andrews
ce6e322046
Merge pull request #2785 from kugelfuhr/kugelfuhr/modernize-ca65-diags
Modernize ca65 diagnostics
2025-07-10 18:47:34 +02:00
Kugel Fuhr
2926a95e71 Use correct type for function used in atexit(). 2025-07-10 17:14:50 +02:00
Kugel Fuhr
72e3956aeb Add missing definitions for Windows. 2025-07-10 17:14:50 +02:00
Kugel Fuhr
26968ffdf2 Fixed a typo :-( 2025-07-10 17:14:50 +02:00
Kugel Fuhr
bb255838a6 Fix include files for Windows (hopefully). 2025-07-10 17:14:50 +02:00
Kugel Fuhr
0c14830da0 Remove tabs. 2025-07-10 17:14:50 +02:00
Kugel Fuhr
abb0adf546 Update visual studio project files with added sources. 2025-07-10 17:14:50 +02:00
Kugel Fuhr
97ef430053 Restore description for --debug which was lost. 2025-07-10 17:14:50 +02:00
Kugel Fuhr
7e97e99bae Do also color quoted text. 2025-07-10 17:14:50 +02:00
Kugel Fuhr
8c654193f7 For the assembler tests, switch off UTF-8 output so we have always the
identical diagnostics indepdendent of the console properties.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
8d7c87f753 Fix problem with UTF-8 output when switching the code page under windows fails. 2025-07-10 17:14:50 +02:00
Kugel Fuhr
c466faf484 Use UTF-8 for diagnostic output if it is available. Added a command line
switch --no-utf8 to disable the use of UTF-8 characters.
2025-07-10 17:14:50 +02:00
Kugel Fuhr
b1eb1bf6ab Colorize diagnostics. 2025-07-10 17:14:50 +02:00
Kugel Fuhr
ffcff0fa61 Much improved error messages for ca65. For most errors it will now say what
was expected and what was found instead. Also improved error recovery in a few
places.
2025-07-10 17:14:47 +02:00
Bob Andrews
4afbd1104d
Merge pull request #2777 from kugelfuhr/kugelfuhr/ca65-errors
Improve error handling for ca65
2025-07-10 17:05:32 +02:00
Bob Andrews
4a53a891e8
Merge pull request #2778 from colinleroy/optimise-ldaxi
Optimise ldaxi
2025-07-10 17:03:28 +02:00
Bob Andrews
9971d9fac0
Merge pull request #2776 from colinleroy/optimize-incdecsp-further
Further optimize inc/decsp
2025-07-10 17:02:32 +02:00
Bob Andrews
7d7cfde818
Merge pull request #2786 from mrdudz/fixmakefiles
Fixmakefiles
2025-07-10 00:01:12 +02:00
Bob Andrews
9ff71e431b
Merge branch 'master' into fixmakefiles 2025-07-09 23:41:26 +02:00
Bob Andrews
ac6b1326e9
Merge pull request #2784 from kugelfuhr/kugelfuhr/fix-cleanup
Add missing files to "clean" target
2025-07-09 23:41:01 +02:00
mrdudz
472525eecd redirect errors into file so we can see it if needed 2025-07-09 23:10:43 +02:00
mrdudz
6aad5f6c18 fix error log output 2025-07-09 18:35:05 +02:00
mrdudz
18bb697891 fix stderr redirection 2025-07-09 14:20:42 +02:00
Kugel Fuhr
d82a1f9fa0 Apply changes by @mrduz. Fixes an error in the makefile and adjusts the
mostlyclean target accordingly.
2025-07-09 13:35:27 +02:00
Bob Andrews
50220800aa
Merge pull request #2771 from colinleroy/much-smaller-strndup
Make strndup smaller, safer, faster
2025-07-09 00:55:04 +02:00
Kugel Fuhr
735edaa8f7 Add missing files to "clean" target. 2025-07-08 07:38:59 +02:00
Bob Andrews
593bf159fa
Merge pull request #2774 from mrdudz/somedocs
Somedocs
2025-07-07 23:27:14 +02:00
Bob Andrews
7c6efded1c
Merge pull request #2782 from kugelfuhr/kugelfuhr/use-static-inline
Use "static inline" instead of macros in the source
2025-07-07 23:25:11 +02:00
Bob Andrews
8a976d555b
Merge pull request #2783 from kugelfuhr/kugelfuhr/macro-locals
Add info about cheap local names in macro local symbols.
2025-07-07 16:52:04 +02:00
Kugel Fuhr
b64c811a3f Add info about cheap local names in macro local symbols. 2025-07-07 12:05:46 +02:00
Kugel Fuhr
9be9003e9a Removed the inline.h module and removed the use of macros instead of "static
inline".
2025-07-07 11:23:12 +02:00
Kugel Fuhr
8dc815f53f Fixed typos in comments. 2025-07-06 21:07:34 +02:00
Colin Leroy-Mira
20a9db757d Optimize multiple incax* and incax*/ldaxi
- Group multiple calls to incax* and decax* into a single one
- Replace incaxN/jsr ldaxi with ldy #N+1/jsr ldaxidx

Fixes #2055
2025-07-06 20:37:01 +02:00
Kugel Fuhr
b7e592699d Fix a copy&paste error (mrduz). 2025-07-06 20:20:32 +02:00
Bob Andrews
f1b9cf0e32
Merge pull request #2780 from mrdudz/cpumac
remove .macpack cpu, fixes #2779
2025-07-06 20:14:44 +02:00
Kugel Fuhr
57283733e7 Remove unwanted duplicate reference output for the tests. 2025-07-06 20:06:48 +02:00
mrdudz
48924cc9d5 remove .macpack cpu, fixes #2779 2025-07-06 19:14:48 +02:00
Colin Leroy-Mira
facf7b2a0c Add basic test for incsp optimisation 2025-07-06 18:35:21 +02:00
Kugel Fuhr
929fc94466 Added the necessary control files and reference output for the tests. 2025-07-06 16:58:58 +02:00
Colin Leroy-Mira
87e5775efb
Merge branch 'master' into much-smaller-strndup 2025-07-06 13:36:58 +02:00
Colin Leroy-Mira
fe86149203 Further optimize inc/decsp
The optimizer can now merge incsp+decsp together, and merge
jsr incsp/decsp + jmp incsp/decsp together. Drop the code
altogether if both instructions cancel each other out.

Fixes #2748
2025-07-06 13:30:33 +02:00
Kugel Fuhr
4a8498cb0a When skipping a macro definintion because of an error, apply the same handling
regarding .endmacro as when the macro is parsed regularily: A .endmacro ends
the macro only if is the first token on a line.
2025-07-06 12:45:16 +02:00
Kugel Fuhr
7b79fd1ec1 Added more tests. 2025-07-06 10:42:15 +02:00
Kugel Fuhr
23086bccff Much improved diagnostics for macros. 2025-07-06 10:41:12 +02:00
Kugel Fuhr
7cd137afb4 Improved diagnostics. 2025-07-06 10:40:25 +02:00
Kugel Fuhr
45a326750c Added a function to output notifications. 2025-07-06 10:39:29 +02:00
Kugel Fuhr
bcd29de443 Much improved error messages for ca65. For most errors it will now say what
was expected and what was found instead. Also improved error recovery in a few
places.
2025-07-06 08:40:05 +02:00
mrdudz
cf89172cf7 attempt to explain the ISET* dilemma 2025-07-05 23:27:06 +02:00
mrdudz
1cc7d01c99 added missing predefined constants 2025-07-05 21:53:10 +02:00
Bob Andrews
d20077de2b
Merge pull request #2773 from SlithyMatt/master
#2772 - Fixed default CPU for CX16
2025-07-05 16:14:46 +02:00
SlithyMatt
8c9e45ee85 #2772 - Fixed default CPU for CX16 2025-07-05 09:57:05 -04:00
Colin Leroy-Mira
fb7afcfee9 Add strndup ENOMEM test 2025-07-05 12:31:26 +02:00
Colin Leroy-Mira
6604c5ce92 Make strndup smaller, safer, faster
First implementation was doing:
- strdup (without checking result!)
- strlen
- terminate
- realloc

New one does:
- malloc to shortest +1
- strncpy
- terminate
2025-07-05 12:11:40 +02:00
mrdudz
70b54bdbe3 some missing target defines 2025-07-04 23:59:57 +02:00
Bob Andrews
7ed1f0c7ea
Merge pull request #2766 from mrdudz/CommunityStandards
CoC draft
2025-07-04 17:05:52 +02:00
Bob Andrews
315d6c4ae3
Merge pull request #2768 from mrdudz/fix2764
disable the basic interrupt before main(), fixes #2764
2025-07-04 17:04:12 +02:00
Bob Andrews
b24560c083
Merge pull request #2759 from mrdudz/test1972
Fixed #1970 (Missing definition for ST on cbm610 with getdevice) (was #1972)
2025-07-04 17:03:47 +02:00
Bob Andrews
fd973cd544
Merge pull request #2769 from colinleroy/add-strndup
Add strndup
2025-07-04 17:01:28 +02:00
Bob Andrews
14eae07a8c
Merge pull request #2770 from kugelfuhr/kugelfuhr/fix-1557
Add comments about cputs() relying on cputc() not to clobber ptr1
2025-07-04 16:57:04 +02:00
Kugel Fuhr
500b86f1e2 Improve error recovery. 2025-07-04 14:56:20 +02:00
Kugel Fuhr
2e6f04034b Improved an error message. 2025-07-04 14:51:56 +02:00
Kugel Fuhr
947eecb65c Add comments to the cputs() and cputc() sources about the former relying on
the latter not to clobber ptr1.
2025-07-04 11:20:35 +02:00
Colin Leroy-Mira
90e1ac374b Add strndup
char* __fastcall__ strndup (const char* S, size_t maxlen);
2025-07-03 23:46:28 +02:00
Colin Leroy-Mira
fcbc253bf9 Add strlen and strnlen unit tests 2025-07-03 23:43:04 +02:00
Bob Andrews
3ae514921c
Merge branch 'master' into seglist 2025-07-03 23:16:51 +02:00
Bob Andrews
96cc66868c
Merge branch 'master' into macexpand 2025-07-03 23:16:28 +02:00
mrdudz
a19e00d304 disable the basic interrupt before main(), fixes #2764 2025-07-03 21:49:31 +02:00
Bob Andrews
29f7ab3809
Merge pull request #2760 from kugelfuhr/kugelfuhr/fix-2753
Add ".CAPABILITY" to ca65, remove ".MACPACK cpu"
2025-07-03 18:43:05 +02:00
Bob Andrews
dbb6ff5482
Merge pull request #2761 from kugelfuhr/kugelfuhr/fix-2231
Allow comments within _Pragma()
2025-07-03 18:36:43 +02:00
Bob Andrews
4edf1ad363
Merge pull request #2767 from kugelfuhr/kugelfuhr/fix-836
Remove invalid characters from labels in the VICE label file
2025-07-03 18:32:37 +02:00
Bob Andrews
9194d9e309
Update bug_report.md 2025-07-03 11:09:03 +02:00
Bob Andrews
ca329c975b
Update feature_request.md
cut down (a lot)
2025-07-03 09:46:43 +02:00
Bob Andrews
2c4b3a485e
Update bug_report.md
cut down
2025-07-03 09:44:57 +02:00
Bob Andrews
9240ad37ab
Update PULL_REQUEST_TEMPLATE.md
cut it down a lot
2025-07-03 09:39:29 +02:00
Kugel Fuhr
dd27ec8696 When creating a VICE label file, replace characters in labels that VICE
doesn't understand with '_'. Fixes #836.
2025-07-03 08:54:10 +02:00
mrdudz
087edc336b don't try to use multiple templates for the time being 2025-07-02 23:47:53 +02:00
cc65 Owner
7b26325632
Create bug_fix_template.md 2025-07-02 23:29:49 +02:00
cc65 Owner
b4d034bef7
Initial issue templates
These are basically the standard templates GH generated - they might help to automatically tag at least bugs vs features
2025-07-02 23:10:29 +02:00
mrdudz
5db0283571 CoC draft 2025-07-02 22:12:03 +02:00
Bob Andrews
807f02f3a3
Merge pull request #2765 from polluks/master
Fixed minor typos
2025-07-02 16:22:09 +02:00
Stefan
ce35a816a6
Fixed minor typo 2025-07-02 15:59:38 +02:00
Stefan
75d6efeabf
Fixed minor typo 2025-07-02 15:54:00 +02:00
Stefan
73fa13a23e
Fixed minor typo 2025-07-02 15:51:43 +02:00
Stefan
a820538c2a
Fixed minor typo 2025-07-02 15:50:29 +02:00
Bob Andrews
92fa7cb23f
Merge pull request #2762 from kugelfuhr/kugelfuhr/fix-1778
Change notification message used when pointing to the macro an error comes from
2025-07-02 00:35:24 +02:00
Bob Andrews
9151c9b5ff
Merge pull request #2763 from kugelfuhr/kugelfuhr/fix-534
Make the scrcode macros handle identifiers
2025-07-01 21:38:05 +02:00
Kugel Fuhr
070276a1a3 Add a better description for CPU_HAS_ZPIND and CPU_HAS_STZ. 2025-07-01 20:19:19 +02:00
Kugel Fuhr
12bc6ff99e Make the scrcode macros handle identifiers. 2025-07-01 20:14:34 +02:00
Kugel Fuhr
b65ee13e8c Fix the tests. 2025-07-01 17:46:39 +02:00
Kugel Fuhr
ec67b49d7d Change notification message used when pointing to the macro an error comes from. 2025-07-01 17:37:39 +02:00
Kugel Fuhr
64d35b6a86 Allow comments within _Pragma(). Fixes #2231. 2025-07-01 17:24:24 +02:00
Kugel Fuhr
60ec9045fc Use CPUIsets from cpu.c instead of recreating the CPU_xxx constants. 2025-07-01 13:02:15 +02:00
Kugel Fuhr
37414199c7 Hopefully fix windows build files. 2025-07-01 09:33:38 +02:00
Kugel Fuhr
c162f6a286 Warning fix. 2025-07-01 09:21:18 +02:00
Kugel Fuhr
8d3112e24f Small code simplification. 2025-07-01 08:47:16 +02:00
Kugel Fuhr
29c8846f7d Add an additional hook (currently unused) for target specific capabilities. 2025-07-01 08:44:13 +02:00
Kugel Fuhr
59e7158512 Make the CPU_xxx constants from cpu.mac internal to the assembler and replace
cpu.mac by a file that just emits a warning when used.
2025-07-01 08:29:42 +02:00
Kugel Fuhr
c72126e68f Changed most of the library sources to use .CAP instead of .CPU. 2025-07-01 08:04:00 +02:00
Kugel Fuhr
f333b300f1 Added the CPU_HAS_BITIMM capability. 2025-07-01 07:16:33 +02:00
Kugel Fuhr
d4e57278c6 Add a new .cap pseudo function to the assembler that allows to check for
certain capabilities of the CPU or target system.
2025-06-30 21:37:43 +02:00
Kugel Fuhr
a4a24280f2 Do only check .c and .h files. 2025-06-30 20:50:30 +02:00
mrdudz
81da8b2107 fix getdevice 2025-06-30 20:34:59 +02:00
mrdudz
aa41d51825 add enumdevdir to cbm2 samples 2025-06-30 19:11:13 +02:00
mrdudz
d91f4f0b82 adjust c65/mega65 functions 2025-06-30 19:10:52 +02:00
mrdudz
26cf19642c initial patch from #1972 2025-06-30 18:39:33 +02:00
Bob Andrews
4899b6dc0c
Merge pull request #2758 from mrdudz/fixdestdir
also test DESTDIR
2025-06-30 16:27:23 +02:00
mrdudz
483ef7844b also test DESTDIR 2025-06-30 16:03:36 +02:00
rumbledethumps
aa042f57d8
Merge branch 'cc65:master' into master 2025-06-29 20:16:27 -07:00
rumbledethumps
77e325507e settable codepage() on RP6502 2025-06-29 20:16:07 -07:00
Bob Andrews
8e62d3d440
Merge pull request #2755 from mrdudz/quietagain
Some more Makefile woes
2025-06-30 00:15:19 +02:00
mrdudz
13878070e5 don't check prefix on "zip" 2025-06-29 23:24:04 +02:00
mrdudz
705081af34 Merge branch 'master' into quietagain 2025-06-29 23:01:47 +02:00
Bob Andrews
a7a76b0e50
Merge pull request #2751 from mrdudz/cmoscleanup
Clean up supported CPUs/Instruction sets
2025-06-29 22:59:27 +02:00
mrdudz
cb4cd114bf handle -s correctly when using these makefiles directly 2025-06-29 22:48:03 +02:00
mrdudz
831eedfb58 add some reasonable warnings/errors when PREFIX is empty 2025-06-29 22:46:42 +02:00
mrdudz
3f3039192f adjust comments 2025-06-29 21:06:17 +02:00
mrdudz
ce99bfb195 forgot some case values /o\ 2025-06-29 21:05:51 +02:00
mrdudz
e85339dada add sweet16 to the opcodes test as well 2025-06-29 19:51:22 +02:00
mrdudz
a1a87f74a9 add pseudos to docs 2025-06-29 19:45:29 +02:00
mrdudz
91c9e32e4b add sweet16 to the cpudetect test 2025-06-29 19:14:28 +02:00
mrdudz
af89b22252 add missing pseudos for sweet16 2025-06-29 19:13:56 +02:00
mrdudz
4d73544d6c cleanup/fix test for 65816 2025-06-29 18:29:22 +02:00
mrdudz
501dc00c9f fix JSL/JML 2025-06-29 18:28:49 +02:00
mrdudz
51dc9119a9 fix test 2025-06-29 17:21:40 +02:00
mrdudz
dd0d908d57 65816 does not have Rockwell extensions 2025-06-29 17:21:22 +02:00
mrdudz
b878f05721 add 65816 opcodes 2025-06-29 17:06:32 +02:00
mrdudz
6c6fcea71d docs braindump 2025-06-29 02:22:18 +02:00
mrdudz
cf8af80dce add missing pseudo(s) for HUC6280, fix cpudetect for 6280 2025-06-29 01:57:28 +02:00
mrdudz
629252c562 its CSG extensions, not GTE 2025-06-29 01:51:10 +02:00
mrdudz
f45471156b update test 2025-06-28 18:41:29 +02:00
mrdudz
ced83d0f47 update tests 2025-06-28 18:18:39 +02:00
mrdudz
0168835456 handle extra address mode(s) for 65CE02 in the scanner 2025-06-28 18:17:37 +02:00
mrdudz
bf1dbc54fc fix instruction bitfields. 65CE02 derivates can not use 65SC02, because of the zp-ind-z clash 2025-06-28 18:17:13 +02:00
mrdudz
8e4936d68d add related pseudos 2025-06-28 18:15:57 +02:00
mrdudz
e74bdab313 add compound instructions 2025-06-28 02:27:24 +02:00
mrdudz
c359cd9251 update test 2025-06-28 02:27:04 +02:00
mrdudz
c16b8dcf43 add new files 2025-06-28 02:08:01 +02:00
mrdudz
b08f306fde fix test 2025-06-28 02:05:08 +02:00
mrdudz
f6becd1b27 compiler should know about W65C02/65CE02 as well 2025-06-28 01:51:13 +02:00
mrdudz
b05e418e0b rp6502 actually uses W65C02 2025-06-28 01:45:26 +02:00
mrdudz
d472ac8fc0 fix table 2025-06-28 01:44:40 +02:00
mrdudz
0b49d66f05 sort table 2025-06-28 01:06:37 +02:00
mrdudz
f09aaeb085 update docs a bit, create a seperate CPU page 2025-06-28 00:58:44 +02:00
mrdudz
b38422ef9f 65CE02 has phz and asw 2025-06-28 00:58:19 +02:00
mrdudz
e3140349b0 add 65CE02 and W65C02 to disassembler 2025-06-28 00:54:13 +02:00
mrdudz
e93356e3bb add 65CE02 table 2025-06-28 00:38:16 +02:00
mrdudz
76aa7cbc40 add names and bit(field)s for WDC65C02 and 65CE02 2025-06-27 19:40:41 +02:00
Bob Andrews
91bf4352a9
Merge pull request #2749 from mrdudz/unbreakmaster
hide the SP symbol from the 4510 and 45GS02
2025-06-27 17:45:42 +02:00
mrdudz
0a5211dcaa ...and the reference for the test 2025-06-27 17:39:04 +02:00
mrdudz
0d28f6ff8c fix test 2025-06-27 17:32:20 +02:00
mrdudz
74a2262157 hotfix 2025-06-27 17:26:11 +02:00
Bob Andrews
d909a2c285
Merge pull request #2746 from mrdudz/bequiet
Fix -s vs QUIET in the makefiles
2025-06-27 16:43:13 +02:00
Bob Andrews
270552af48
Merge pull request #2734 from mrdudz/mega65c
C65 and Mega65 initial C support
2025-06-27 16:41:28 +02:00
Bob Andrews
9c4934239e
Merge pull request #2743 from kugelfuhr/kugelfuhr/include-guard
Do not read a file twice if it has an include guard
2025-06-27 16:16:51 +02:00
mrdudz
ecdc59de47 more QUIET=1 2025-06-27 00:10:07 +02:00
mrdudz
0d98ab42f0 pass QUIET in the workflows 2025-06-27 00:00:48 +02:00
mrdudz
1f1e1f1490 output target before name(s) 2025-06-26 23:53:36 +02:00
mrdudz
0c22e310ef ...and patch the Makefile in src the same way 2025-06-26 23:44:56 +02:00
mrdudz
703b166b29 handle -s and QUIET accordingly in libsrc too. those who never used make -s before might start doing it now :) 2025-06-26 23:18:35 +02:00
mrdudz
261180577c add subdirs to "platforms" 2025-06-26 22:44:26 +02:00
mrdudz
000789de95 adjust makefiles in util to common behaviour 2025-06-26 22:36:12 +02:00
mrdudz
fed7276a63 make makefiles in samples behave the same as the others 2025-06-26 22:16:08 +02:00
Colin Leroy-Mira
a028ac4140 Apple2: Fix permanently disabled IRQ
Regression introduced in 990d65e:
Pushing status, initializing IRQ handler (which enables IRQ)
then pulling status re-disables IRQ.
2025-06-26 21:52:15 +02:00
mrdudz
cc6813428c fix the fix 2025-06-26 21:00:20 +02:00
mrdudz
46770bbb63 another for cmd.exe 2025-06-26 20:53:10 +02:00
mrdudz
70f9723a89 dumb down for cmd.exe 2025-06-26 20:42:15 +02:00
mrdudz
afe395e970 fix -s vs QUIET in testtarget 2025-06-26 20:15:28 +02:00
mrdudz
7a85575158 fix handling of QUIET in the "test" directory 2025-06-26 19:48:16 +02:00
mrdudz
73869a6f38 make propagating QUIET=1 down actually work, also set --no-print-directory depending on QUIET 2025-06-26 19:45:52 +02:00
mrdudz
75aa45d41e when -s was used, implicitly use QUIET=1. also explicitly propagate QUIET to submakefile(s) 2025-06-26 18:42:01 +02:00
mrdudz
4f5fc898d7 someone accidently checked this in, i guess 2025-06-26 18:40:32 +02:00
Bob Andrews
bc9ebfb077
Update ppubuf.s - fix ppu ringbuffer size as suggested in #1703 2025-06-26 16:05:12 +02:00
Bob Andrews
c5fccb2c7e
Merge pull request #2742 from kugelfuhr/kugelfuhr/sp-backwards-compat
Allow "sp" as an alias for "c_sp" to avoid breaking old code
2025-06-26 15:43:54 +02:00
Kugel Fuhr
d5e7c94eb2 Introduce an optimization for (header) files containing include guards: If
such an include guard exists, the file is not read and parsed multiple times
(as before) but duplicate inclusion is detected before opening the file and
the additional overhead is avoided.
2025-06-26 10:10:11 +02:00
Kugel Fuhr
e2a39d076d Renamed the assembler test. 2025-06-26 09:00:03 +02:00
Kugel Fuhr
399f5aaab7 Check that there are no library modules that use the old "sp" symbol instead
of "c_sp".
2025-06-26 08:23:51 +02:00
Kugel Fuhr
5db2aed129 Allow "sp" as an alias for "c_sp" for backwards compatibility. Using it will
work but generates a linker warning. Added a test to check for this warning.
2025-06-26 07:40:04 +02:00
mrdudz
2de056167a fix warnings 2025-06-26 02:16:05 +02:00
mrdudz
b1a123b601 fix c65 lib, remove includes from cbm generic lib 2025-06-26 02:10:15 +02:00
mrdudz
01ba0b562d Merge branch 'master' into mega65c 2025-06-26 01:52:10 +02:00
Bob Andrews
3a6766d0a0
Merge pull request #2737 from mrdudz/asmversion
fix version in sysuname for all targets
2025-06-26 01:47:47 +02:00
mrdudz
8bf6bb606c make sure "make platforms" actually checks all targets 2025-06-26 01:34:32 +02:00
mrdudz
0290b276ae fix sysuname for all targets, somehow this was forgotten 2025-06-26 01:21:28 +02:00
Bob Andrews
801508aecf
Merge pull request #2735 from kugelfuhr/kugelfuhr/fix-2025
Add an optimization that removes compare instructions preceeding RTS or function calls
2025-06-26 00:29:29 +02:00
mrdudz
1b815d4148 add joydemo to c65/mega65 samples, it works when driver is statically linked 2025-06-25 23:52:59 +02:00
mrdudz
ad4d86bbf2 add a standard joystick driver, adapted from the c64 one 2025-06-25 23:44:07 +02:00
mrdudz
38bdb2326b added a simple joystick api example, since we didn't have one. 2025-06-25 23:14:08 +02:00
mrdudz
f8b1691eff prepare vic3 header 2025-06-25 21:48:25 +02:00
mrdudz
a7e509cd43 better handling of the cursor, use kernal function to read key, not the UART directly 2025-06-25 21:39:03 +02:00
mrdudz
ef1b101538 fix cursor() 2025-06-25 20:38:58 +02:00
Kugel Fuhr
fa81f14cbf Add an explicit "exit 0" to the shell scripts. This worked more or less by
coincidence before since shell scripts return the exit code of the last
command run if there is no explicit exit statement.
2025-06-25 20:34:41 +02:00
Kugel Fuhr
55d9b2dbd0 Rewrite the optimization step from c0a1b1b887 to
remove compares not only before RTS but also befoire function calls that don't
use the flags but destroy all of them. The latter is currently the case for
all functions called. This way the optimization covers a lot more cases than
just checking for RTS.
2025-06-25 20:07:36 +02:00
mrdudz
2206b8d199 fix getscreensize 2025-06-25 18:52:36 +02:00
Kugel Fuhr
1feeee9ce0 Do only check .c and .h files. 2025-06-25 09:37:58 +02:00
mrdudz
1e209b1f15 forgot, need sleep 2025-06-25 05:14:26 +02:00
mrdudz
4db5ac6c14 SCREEN_PTR does only contain the offset apparently (unlike on other cbm systems), so we need extra handling 2025-06-25 05:13:09 +02:00
mrdudz
955c6627c0 forgot settime... 2025-06-25 02:47:33 +02:00
mrdudz
db49432561 some more simple fixes, make targettest(s) work 2025-06-25 02:38:40 +02:00
mrdudz
79b2d25840 name the SIDs 1 and 2 just like the CIAs 2025-06-25 02:32:46 +02:00
mrdudz
23336420b1 a bunch of simple conio fixes, makes a few more samples work 2025-06-25 00:23:58 +02:00
mrdudz
fa6d72cae5 move zp range to a somewhat safer place 2025-06-25 00:14:19 +02:00
mrdudz
4d1fbe3f90 fix refs (remove 652SC02) 2025-06-24 21:59:35 +02:00
mrdudz
f787e0857a remove non existing kernal export 2025-06-24 21:52:48 +02:00
mrdudz
faa287f578 enable building library and samples 2025-06-24 21:40:59 +02:00
mrdudz
d6cc893940 fix instruction set bits set by the compiler. in particular do not set the 65SC02 bit for 4510/45GS02, else we get clashes with sta(zp) 2025-06-24 21:39:39 +02:00
mrdudz
d374ea2cde include target header to allow lib to build 2025-06-24 21:30:53 +02:00
mrdudz
450c8f7c55 startup code and minimalist kernal support for c65 and mega65 2025-06-24 21:23:04 +02:00
mrdudz
bfb16888d1 simple linker config for c65 and mega65 2025-06-24 21:20:31 +02:00
mrdudz
a37a88d5bf std cbm tgi colors 2025-06-24 21:19:38 +02:00
Kugel Fuhr
7a6c60ade4 Do also sort variables to satisfy sorted_codeopt.sh. 2025-06-24 20:21:43 +02:00
mrdudz
681b49a111 initial target header files for c65 and mega65 2025-06-24 19:55:28 +02:00
mrdudz
7be14a951c initial asm includes for c65 and mega65 2025-06-24 19:33:49 +02:00
Kugel Fuhr
c0a1b1b887 Add an optimization step that removes compare instructions preceeding an RTS.
Since nothing is passed back in the flags, these instructions have no effect.
Fixes #2025.
2025-06-24 18:02:24 +02:00
mrdudz
358167556c Merge remote-tracking branch 'upstream' into tryrenaming 2025-06-24 17:51:48 +02:00
Bob Andrews
54a2410b5a
Merge pull request #2674 from GorillaSapiens/c_sp
rename "sp" to "c_sp", avoid conflict with 4510 opcodes
2025-06-24 17:44:13 +02:00
Bob Andrews
cd96ce96a1
Merge pull request #2733 from Russell-S-Harper/update-docn-with-cscanf
Updated documentation with cscanf
2025-06-24 17:27:08 +02:00
Russell-S-Harper
450898513c Updated doc'n with cscanf 2025-06-23 22:07:09 -04:00
Gorilla Sapiens
b2e5d3cd25 insipid formatting whack-a-mole 2025-06-23 17:51:44 +00:00
mrdudz
5fc15a7a60 test #2674 2025-06-23 17:09:06 +02:00
Bob Andrews
4863a3e29b
Merge pull request #2705 from Russell-S-Harper/add-conio-cgets
Implement conio cgets
2025-06-23 16:10:51 +02:00
Bob Andrews
ad9e5cebbb
Delete l.txt 2025-06-23 15:50:57 +02:00
Bob Andrews
a0c6c64826
Merge pull request #2723 from kugelfuhr/kugelfuhr/fix-2717
Allow multiple passes for da65 to resolve labels
2025-06-23 15:14:01 +02:00
mrdudz
30bee8e268 test for #2208 2025-06-23 14:54:05 +02:00
Kugel Fuhr
4c81eacefe Added -d/--debug and -m/--multi-pass switches to the disassembler. The latter
will make the disassembler run multiple preparation passes to find all
addresses where labels must be placed. Without -m some label addresses are
found in the final pass, where the disassembler cannot make use of them.
2025-06-23 14:50:40 +02:00
Bob Andrews
c520455b2b
Merge pull request #2729 from kugelfuhr/kugelfuhr/fix-2208
When studying a symbol expression use its address size if its smaller than that of the symbol
2025-06-23 14:22:22 +02:00
Bob Andrews
c20461d213
Merge pull request #2722 from kugelfuhr/kugelfuhr/da65-cleanup
Small cleanup for da65
2025-06-23 14:18:18 +02:00
Bob Andrews
c832af8a71
Merge pull request #2710 from kugelfuhr/kugelfuhr/fix-2694
Fix wrong file offset handling for a memory area with only run segments written to a file
2025-06-23 14:17:55 +02:00
Kugel Fuhr
96bb1e4336 Fix coding style. 2025-06-23 14:02:56 +02:00
Kugel Fuhr
49713f73e0 Output relative branch targets as "*-30" instead of "* + (-30)". 2025-06-23 14:01:29 +02:00
Bob Andrews
540a6a7658
Merge pull request #2728 from kugelfuhr/kugelfuhr/da65-improvements
Cleanup for the da65 code base
2025-06-23 13:47:23 +02:00
Bob Andrews
2e7ee0f105
Merge pull request #2711 from mrdudz/plus4tgi
TGI Documentation and Comments fix
2025-06-23 13:40:41 +02:00
Bob Andrews
46be7778cd
Merge pull request #2730 from mrdudz/mega65target
Mega65 target
2025-06-23 13:34:47 +02:00
mrdudz
034fc93c75 enable 4510/45GS02 in the compiler - however, the resulting asm files cant be assembled because of sp vs c_sp clash 2025-06-23 13:23:23 +02:00
Gorilla Sapiens
0489098517 restore comment alignment 2025-06-22 21:34:41 +00:00
mrdudz
44672e6281 prepared lib makefile. skip building the library while compiler support is not there 2025-06-22 21:43:21 +02:00
mrdudz
f6a3f66f0b asm configs 2025-06-22 21:42:36 +02:00
mrdudz
715d9c00a2 initial (identical) minimal "library" for assembly support for c65 and mega65. taken from #1792 2025-06-22 21:09:40 +02:00
mrdudz
6d7f37c4f2 update list of targets in the docs 2025-06-22 21:08:13 +02:00
mrdudz
8615c244d9 add initial target for mega65, also added c65 where missing. reworked from #1792 2025-06-22 21:07:38 +02:00
Gorilla Sapiens
a7af49a763 Merge branch 'master' into c_sp 2025-06-22 19:02:24 +00:00
Kugel Fuhr
e949fbdbbf Unify CPU list in the docs. 2025-06-22 20:36:30 +02:00
Kugel Fuhr
7d231d60a6 Minor corrections after looking at the diff. 2025-06-22 20:36:26 +02:00
Kugel Fuhr
b9a703749c Replace all tables by hash tables. This allows to remove the ugly special
casing of "long addresses" and prepares the code base for use with the full
address range of the 65816.
Use fixed size data types for addresses and target data words of known size.
Many other minor improvements.
2025-06-22 20:36:26 +02:00
Bob Andrews
7573272836
Merge pull request #2724 from mrdudz/mega65asm
part of #1792 - 48GS02 assembler support
2025-06-22 17:36:36 +02:00
Kugel Fuhr
7854a53434 When studying expressions and recalculating the address size for a symbol
expression, use the symbol address size only if it is smaller than the one
that was calculated.
2025-06-22 16:12:07 +02:00
mrdudz
1d7bc938f2 add roundtrip disasm tests for all cpus 2025-06-22 01:18:41 +02:00
mrdudz
233c784c03 fix aslq in the disassembler 2025-06-22 01:16:03 +02:00
mrdudz
2ae30b5b50 cleanup 2025-06-22 01:15:40 +02:00
mrdudz
c3b75f0ac1 comment 2025-06-22 01:15:10 +02:00
mrdudz
4a11fa791a more codestyle 2025-06-21 22:33:43 +02:00
mrdudz
6b554362a5 codestyle/comment 2025-06-21 22:23:19 +02:00
mrdudz
4820b716c7 use sect2 for cpu subsections 2025-06-21 22:12:53 +02:00
mrdudz
12e40f4aff fix some codestyle 2025-06-21 22:05:30 +02:00
mrdudz
698045c7c2 updated the docs 2025-06-21 21:55:21 +02:00
mrdudz
c35405f14b add new sourcefile(s) 2025-06-21 20:52:03 +02:00
mrdudz
5e414edb50 are we more pedantic than local make? 2025-06-21 20:47:57 +02:00
mrdudz
2244a5ab0a include header :) 2025-06-21 20:44:37 +02:00
mrdudz
3321910848 implement 45GS02 compound instrictions in the disassembler 2025-06-21 20:37:31 +02:00
mrdudz
37144ed014 fix akkumulator addressing for some compound instructions 2025-06-21 20:35:25 +02:00
Russell-S-Harper
7f40affb59 Adding documentation and some minor reformatting to ensure consistency 2025-06-21 08:48:41 -04:00
Russell-S-Harper
8bfaaa60ba Revising to align with stdio fgets 2025-06-21 06:01:13 -04:00
mrdudz
76c8f0d860 fix test, add 45GS02 instructions 2025-06-21 01:39:33 +02:00
mrdudz
9344d87b05 part of #1792 - 48GS02 assembler support 2025-06-21 00:56:34 +02:00
Russell-S-Harper
00bb9d5376 Edits to more closely match standard cgets 2025-06-20 18:48:51 -04:00
Bob Andrews
d333627081
Merge pull request #2707 from mrdudz/m740
m740 Support
2025-06-20 19:39:32 +02:00
Bob Andrews
64c936317d
Merge pull request #2720 from GorillaSapiens/issue_2714
fixes #2714
2025-06-20 18:00:50 +02:00
Bob Andrews
fa4d704ee8
Update main.c - codestyle 2025-06-20 17:53:52 +02:00
Gorilla Sapiens
de844d48c4 fixes #2714 2025-06-19 22:36:16 +00:00
Bob Andrews
b630dac728
Merge pull request #2718 from kugelfuhr/kugelfuhr/fix-505
Fix the behavior of variable symbols in regard to cheap locals
2025-06-19 23:44:38 +02:00
Bob Andrews
3989ce1185
Merge pull request #2715 from kugelfuhr/kugelfuhr/fix-2527
Added a few simple optimizations
2025-06-19 23:39:04 +02:00
mrdudz
4f26d6d8b7 typo 2025-06-19 22:49:12 +02:00
mrdudz
c75d1dd7df update docs with some more info about the various cpu modes 2025-06-19 22:42:36 +02:00
mrdudz
02e79d35d7 no need to fix the assembler, but making da65 produce the same mnemonics ans ca65 uses seems like a good idea :) 2025-06-19 21:44:14 +02:00
Colin Leroy-Mira
ec0595ad28 Remove useless code
LOSCR is a valid and safe softswitch on any Apple II.
Thanks Oliver S!
2025-06-19 14:07:43 -04:00
mrdudz
8d763abe92 Add notes on TGI_COLOR_BLACK and TGI_COLOR_WHITE 2025-06-19 19:58:36 +02:00
Bob Andrews
1f23fc6ba8
Merge pull request #2716 from kugelfuhr/kugelfuhr/fix-2649
Fix an internal error in da65 when there are certain labels in a skipped section
2025-06-19 19:33:17 +02:00
Kugel Fuhr
758bdaa4ad Fixed a typo in the test source. 2025-06-19 17:59:30 +02:00
Kugel Fuhr
54f63a0cdc Fix the behavior of variable symbols in regard to cheap locals. Previously
every assignment to a variable symbol opened the same scope for cheap locals.
So when redefining a variable symbol, an old cheap local scope was reopened
which was unexpected and confusing. The change fixes this so that only the
first definition of a variable symbol opens a new scope for cheap locals, but
redefinitions of the same symbol do not.
2025-06-19 09:11:30 +02:00
mrdudz
d34b36c6e5 add test that checks all opcodes per current cpu flags 2025-06-19 01:33:31 +02:00
mrdudz
2be28d2d64 add some comments 2025-06-19 01:32:43 +02:00
Kugel Fuhr
8d407c7b17 Fix #2649. When generating labels for "skip" sections, GetGranularity() is
called which wouldn't handle this type.
2025-06-18 21:54:19 +02:00
mrdudz
130c5e67b3 typo 2025-06-18 18:30:29 +02:00
Bob Andrews
5e47d0432f
Merge pull request #2675 from GorillaSapiens/sane_makefile_output
added information to Makefile output
2025-06-18 17:50:12 +02:00
Kugel Fuhr
2ceaa3fabb Added a few simple optimizations that resolve most of #2527. 2025-06-18 10:34:13 +02:00
Gorilla Sapiens
8cb0578447 changes suggested by mrdudz 2025-06-18 06:38:38 +00:00
Gorilla Sapiens
06a77abc68 Merge branch 'master' into sane_makefile_output 2025-06-18 06:26:58 +00:00
Gorilla Sapiens
5a4b11e7ff Merge branch 'master' into c_sp 2025-06-18 06:14:39 +00:00
mrdudz
00de49a46d codestyle 2025-06-18 02:43:40 +02:00
mrdudz
05506ede2a comments 2025-06-18 02:41:22 +02:00
mrdudz
157ddf2c5b codestyle 2025-06-18 02:41:15 +02:00
mrdudz
499fcbdb5f we dont use the table in the custom jsr 2025-06-18 02:38:34 +02:00
mrdudz
80b4ea304b fix table for added address modes 2025-06-18 02:24:59 +02:00
mrdudz
9eecd794b1 less hacky way to get the addr mode 2025-06-18 02:03:52 +02:00
mrdudz
ad38683176 Merge branch 'master' into m740 2025-06-18 01:17:52 +02:00
mrdudz
ff1e5b3351 minimize diff 2025-06-18 01:14:31 +02:00
mrdudz
dd78eb91c3 don't make script choke with more than 9 tables 2025-06-18 01:12:43 +02:00
Bob Andrews
02d22e712c
Merge pull request #2713 from mrdudz/somechecks
don't make script choke with more than 9 tables
2025-06-18 00:45:07 +02:00
mrdudz
4daba00d47 don't make script choke with more than 9 tables 2025-06-18 00:28:53 +02:00
Bob Andrews
3d2734172f
Delete cfg/m740.cfg 2025-06-17 23:53:40 +02:00
Bob Andrews
d1ecc02e31
Merge branch 'master' into m740 2025-06-17 23:52:55 +02:00
Bob Andrews
f91500e3d3
Merge pull request #2712 from mrdudz/pseudo20x
fix/add missing .ifp02x and .p02x pseudo ops, update test
2025-06-17 23:48:31 +02:00
mrdudz
5a3aa1fd51 fix/add missing .ifp02x and .p02x pseudo ops, update test 2025-06-17 23:34:23 +02:00
mrdudz
5e4f811ddf remove commented out code 2025-06-17 22:52:42 +02:00
mrdudz
f45d25cfaf merge master 2025-06-17 22:51:25 +02:00
mrdudz
9edc396ce7 fix TGI docs a bit 2025-06-17 22:27:47 +02:00
mrdudz
55742003d6 add some more comments 2025-06-17 21:40:04 +02:00
Bob Andrews
3486cd7830
Merge pull request #967 from rhalkyard/feature/plus4-tgi-driver
TGI driver and IRQ-handler fix for plus4
2025-06-17 20:49:09 +02:00
Bob Andrews
0b0bead634
Update tgidemo.c - fix misunderstanding about TGI colors 2025-06-17 20:29:41 +02:00
Bob Andrews
bae58ae419
Update cbm264.h - fix misunderstanding about TGI colors 2025-06-17 20:29:01 +02:00
Bob Andrews
f04c25a233
Merge pull request #2709 from GorillaSapiens/gps4bugs
added reporting of fatal/error/warning/note location generation with …
2025-06-17 19:51:02 +02:00
Bob Andrews
f16eced6fc
Merge pull request #2698 from kugelfuhr/kugelfuhr/fix-1640
Implement -dD, -dM and -dN command line switches to output macro definitions
2025-06-17 19:44:19 +02:00
Gorilla Sapiens
c90c61f08f rename functions 2025-06-16 23:30:46 +00:00
mrdudz
7ea6575ca8 update cpu list on da65 page too 2025-06-16 23:35:51 +02:00
mrdudz
476abbddd1 update/fix doc nodes 2025-06-16 23:26:47 +02:00
mrdudz
ed86cb84f9 slightly updated docs 2025-06-16 23:10:49 +02:00
mrdudz
2e27ee1702 added .IFM740 and .PM470, and while at it also .IFP02X and .P02X. Updated regression test to use these 2025-06-16 22:55:58 +02:00
Russell-S-Harper
17a8c92ba1 Implement conio cgets 2025-06-16 16:45:46 -04:00
mrdudz
0b74ae8c2d add m740 to macpack cpu, add .ifpm740, add regression test for those 2025-06-16 21:59:38 +02:00
mrdudz
20e7c54fa3 more m740 fixes, makes the regression test work 2025-06-16 20:32:54 +02:00
mrdudz
2184ba80c7 make <bit> part of the instruction, like in the huc6280 2025-06-16 17:39:23 +02:00
Kugel Fuhr
e4b610994c Fix #2694. Also reformatting of long comments and refactoring of a small piece
of code.
2025-06-16 16:01:56 +02:00
Kugel Fuhr
adc9ddc280 Change the available options to -dM and -dP. The former prints user macros,
the latter predefined macros. Can be combined by using -dMP or -dPM.
2025-06-16 11:30:25 +02:00
Gorilla Sapiens
c0a0ba1483 added reporting of fatal/error/warning/note location generation with "-d" 2025-06-16 02:46:10 +00:00
mrdudz
ef33c4b71d fix script to deal with more than 9 tables 2025-06-16 01:35:23 +02:00
mrdudz
7b12962eec fix m740, survives disasm/asm roundtrip now, still needs some work though 2025-06-16 01:17:36 +02:00
Oliver
24b7d1fec7 Make use of dynamic box drawing 2025-06-15 14:14:38 -04:00
Colin Leroy-Mira
990d65e4e4 Apple2: Setup IRQ/RST vectors in LC if needed
Programs running under DOS3.3 need to setup correct
reset and IRQ vectors in the language card.
2025-06-15 14:12:01 -04:00
mrdudz
5be4c4697c original patch 2025-06-15 18:25:01 +02:00
Bob Andrews
2470851bfd
Merge pull request #2703 from mrdudz/testbug2110
add test for #2110
2025-06-14 23:03:00 +02:00
Bob Andrews
d0b8e606cd
Merge pull request #2702 from mrdudz/testbug2172
added repro cases from #2172 as tests
2025-06-14 22:44:12 +02:00
mrdudz
7620e551ee add test 2025-06-14 22:40:29 +02:00
mrdudz
1ac8a51c58 added repro cases from #2172 as tests 2025-06-14 21:39:00 +02:00
Bob Andrews
b29b50d363
Merge pull request #2701 from colinleroy/fix-tmp-files-again-again
Make sure pid and counter don't interfere
2025-06-14 18:48:39 +02:00
Colin Leroy-Mira
e3f9a5f052 Make sure pid and counter don't interfere 2025-06-14 13:02:28 +02:00
Gorilla Sapiens
2f55eeb612 sp -> c_sp for agat/crt0.s 2025-06-14 01:11:39 +00:00
GorillaSapiens
ae54171b8a
Merge branch 'master' into c_sp 2025-06-13 17:43:06 -07:00
Bob Andrews
51b3add3c0
Merge pull request #2684 from mrdudz/checksorted
simple script(s) to check if bsearch tables are sorted correctly
2025-06-14 02:28:50 +02:00
Bob Andrews
647a79bb2f
Merge branch 'master' into checksorted 2025-06-14 02:16:34 +02:00
Bob Andrews
89651fd8bd
Merge pull request #2699 from colinleroy/fix-temp-files-again
Fix temporary filenames again.
2025-06-13 20:44:28 +02:00
Colin Leroy-Mira
215f51a230 Fix temporary filenames again.
Outputting temp files in the output directory means we have
to distinguish source files in different source directories
that happen to have the same name.
2025-06-13 20:26:00 +02:00
Bob Andrews
b9eeec0c51
Merge pull request #2677 from sintech/agat-support
Agat support
2025-06-13 17:59:40 +02:00
Konstantin
8202b520b2 add Agat to samples 2025-06-13 12:51:41 +03:00
Konstantin
c28bafa581 add chline, cvline functions 2025-06-13 12:50:39 +03:00
Bob Andrews
af2ab29a91
Merge branch 'master' into c_sp 2025-06-12 23:38:48 +02:00
Bob Andrews
f191272feb
Merge branch 'master' into checksorted 2025-06-12 23:33:12 +02:00
Bob Andrews
fc6ed60029
Merge branch 'master' into macexpand 2025-06-12 22:18:06 +02:00
Kugel Fuhr
b7a5ec86c5 Remove trailing spaces. 2025-06-12 22:09:53 +02:00
Kugel Fuhr
40aced6d6d Command line switches -dD and -Dm were swapped in the usage information. 2025-06-12 22:02:35 +02:00
Kugel Fuhr
a6b94ebba2 Implement -dD, -dM and -dN command line switches to output macro definitions. 2025-06-12 21:50:20 +02:00
Bob Andrews
0a1df881b3
Merge pull request #2697 from mrdudz/testdbginfo
add dbginfo and dbgsh to src/Makefile, add building dbginfo and dbgsh example to CI.
2025-06-12 21:44:37 +02:00
mrdudz
505160f169 a bit cleaner, also build dbgsh 2025-06-12 21:31:05 +02:00
mrdudz
b2616eac0d use -C correctly :) 2025-06-12 20:58:36 +02:00
mrdudz
86cf60d0e6 add dbginfo to src/Makefile, add building dbginfo example to CI. Fixes #2681, supersedes #2682 2025-06-12 20:53:55 +02:00
Bob Andrews
a8b9c05584
Merge pull request #2696 from colinleroy/optimize-ntohs-on-c02
Use new CPU macro to optimize ntohs on 65c02
2025-06-12 19:51:11 +02:00
Colin Leroy-Mira
149b2b69ef Use new CPU macro to optimize ntohs on 65c02 2025-06-12 19:33:54 +02:00
Bob Andrews
57fa64bac6
Merge pull request #2686 from colinleroy/fix-temp-name
Fix temporary file name creation.
2025-06-12 18:39:54 +02:00
Colin Leroy-Mira
ffd667c2c9 Fix temporary file name creation.
Use the original name as template for readability in
the map file, and use the process PID instead of platform-dependant
or deprecated random filename functions to make unique temporary
filenames. Also, create these temporary files in the output
directory.
2025-06-12 18:00:10 +02:00
Bob Andrews
59441b3139
Merge pull request #2695 from kugelfuhr/kugelfuhr/fix-2363
Add macros to check for CPU type and supported instruction set.
2025-06-12 17:56:08 +02:00
Bob Andrews
49eaf54c89
Merge pull request #2690 from GorillaSapiens/issue_2608
fixes #2608
2025-06-12 15:54:44 +02:00
Kugel Fuhr
ace81bd36a Add macros to check for CPU type and supported instruction set. 2025-06-12 14:42:38 +02:00
Gorilla Sapiens
880322a5ae renamed test as requested. 2025-06-12 06:06:52 +00:00
Gorilla Sapiens
844596fd03 Merge branch 'master' into issue_2608 2025-06-12 05:59:27 +00:00
Bob Andrews
c3defc1b1c
Update tgidemo.c - i really like BLACK but that was a bit much :) 2025-06-12 01:00:17 +02:00
Bob Andrews
2f16defd6f
Update tgidemo.c - apple2 fix 2025-06-12 00:45:17 +02:00
Bob Andrews
1c71d4c609
Update tgidemo.c
TGI color defines should be indices into the default palette
2025-06-12 00:35:29 +02:00
Bob Andrews
cd769b3a9f
Update cbm264.h - TGI_COLOR defines should be indices into the default palette 2025-06-12 00:32:09 +02:00
Bob Andrews
3b79c92f39
Update pragma.c just retrigger the checks 2025-06-11 21:06:58 +02:00
mrdudz
ccdc5b9fea massaged repro case from #2608 into a test 2025-06-11 20:50:04 +02:00
Gorilla Sapiens
51da666210 fixes #2608 2025-06-11 02:21:39 +00:00
mrdudz
d1def100dd use sort -c 2025-06-09 22:28:19 +02:00
mrdudz
aaa1058d32 use explicit markers (comments) for the bsearch table checking, simplifies the scripts and makes them more robust too :) 2025-06-09 21:48:20 +02:00
Konstantin
9afe980124 Add dash for naming consistency 2025-06-09 21:17:47 +03:00
Konstantin
1e80269c6b Add comment about why AppleSingle header is needed 2025-06-09 21:14:01 +03:00
mrdudz
717e32ba6a add "sorted" target 2025-06-09 18:45:52 +02:00
mrdudz
58ff844d04 add to GHA 2025-06-09 18:42:52 +02:00
mrdudz
d368f3d0ea simple script(s) to check if bsearch tables are sorted correctly 2025-06-09 18:26:41 +02:00
Bob Andrews
869ba5c493
Merge pull request #2683 from mrdudz/fixsorted
fix bsearch tables
2025-06-09 18:23:05 +02:00
mrdudz
ba80de5efc fix bsearch tables that must be sorted, add comment to all tables that must be sorted 2025-06-09 17:58:58 +02:00
Konstantin
fb421d7a81 Remove dangling spaces 2025-06-08 23:44:51 +03:00
Konstantin
4d5a290135 add docs and readme.md 2025-06-08 23:30:34 +03:00
Konstantin
41a82f7165 fix codestyle 2025-06-08 23:20:21 +03:00
Konstantin
34daf33d93 Remove dangling spaces 2025-06-07 14:10:50 +03:00
Konstantin
cbf1b1d5a7 Updated translation table 2025-06-07 14:00:10 +03:00
Konstantin
1a109c0b34 Fix codestyle 2025-06-07 12:36:49 +03:00
Bob Andrews
c3b87779b7
Update Makefile - link all Plus4 samples with plus4-hires.cfg - using the LDFLAGS mechanism for this does not work 2025-06-05 02:23:29 +02:00
Bob Andrews
79ecb2071c
Update Makefile - use ld65, not cl65, for linking 2025-06-05 02:09:11 +02:00
Konstantin
5ff18c1ebc Updates 2025-06-04 23:11:13 +03:00
Konstantin
de524a6561 Initial Agat support 2025-06-04 22:51:17 +03:00
Gorilla Sapiens
a0772cfa10 one more comment 2025-06-04 06:43:29 +00:00
Gorilla Sapiens
b6f42f9ab2 changed "spc" to "c_sp" 2025-06-04 06:37:59 +00:00
Gorilla Sapiens
dd2f19260c added information to Makefile output 2025-06-04 03:03:18 +00:00
Gorilla Sapiens
3d118dc6e5 rename "sp" to "spc", avoid conflict with 4510 opcodes 2025-06-04 02:06:40 +00:00
Bob Andrews
58171691d0
Merge pull request #2673 from GorillaSapiens/issue_2666
fixes #2666, double charmap of char literals
2025-06-03 23:53:48 +02:00
Gorilla Sapiens
9318c781ae fixes #2666, double charmap of char literals 2025-06-03 20:54:55 +00:00
Bob Andrews
a1fe6b8465
kill spaces 2025-06-01 23:22:44 +02:00
Bob Andrews
d7c84d1434
kill spaces 2025-06-01 23:20:51 +02:00
Bob Andrews
81ca41b736
kill dangling spaces 2025-06-01 23:19:51 +02:00
Bob Andrews
aa4a791cc3
Merge branch 'master' into feature/plus4-tgi-driver 2025-06-01 23:12:27 +02:00
Colin Leroy-Mira
0122307399 Apple2: Dynamic IIe check on a2_lo_tgi 2025-06-01 12:53:36 +02:00
Colin Leroy-Mira
a9ab23ad51 Make waitvsync available on apple2 2025-06-01 12:53:36 +02:00
Colin Leroy-Mira
d3ef3e1b62 Apple2: Don't depend on apple2enh definition for characters
Up, Down and Del, as well as Open-Apple, exist on
non-enhanced Apple //e.
2025-05-31 19:43:53 +02:00
Bob Andrews
4971fe312a
Merge pull request #2660 from GorillaSapiens/issue_2446
Issue 2446
2025-05-31 19:02:06 +02:00
Bob Andrews
df99b9a107
fix codestyle 2025-05-31 19:00:11 +02:00
Colin Leroy-Mira
c75c305c59 Apple2: Fix inconsistency (use bit like everywhere else) 2025-05-31 15:43:23 +02:00
Colin Leroy-Mira
d03529067a Apple2: don't define _allow_lowercase and uppercasemask on APPLE2ENH 2025-05-31 15:42:02 +02:00
Colin Leroy-Mira
89daccaa43 Apple2: automatically enable lowercase starting from //e 2025-05-31 15:42:02 +02:00
Colin Leroy-Mira
f8c51ffd3d Spare a few bytes 2025-05-31 12:04:47 +02:00
Gorilla Sapiens
779c393e65 fixes *.s -> *.o -> exe path 2025-05-29 15:05:03 +00:00
Gorilla Sapiens
842ec4b481 tmpfiles for the *.grc -> *.s -> *.o -> exe path 2025-05-29 14:26:25 +00:00
Colin Leroy-Mira
e444f4c40e Apple2: Safely check for 80-columns card
Check the Pascal ID bytes for an 80-columns card
to avoid blindly jumping into a $C300 that could be
totally unrelated.
2025-05-27 23:38:56 +02:00
Colin Leroy-Mira
816666615b Apple2: Make 80-columns support dynamic on apple2 target
Add a machinetype identifier to help us quickly identify
Apple //e (bit 7) and //e enhanced (bit 6).

Use it in conio functions for 80-columns code instead of
relying entirely on the __APPLE2ENH__ target.

Move videomode() to the apple2 target, and have it return
an error if 80-columns hardware is not available - this
is a lie for now, it is considered available on //e enhanced,
which may not be true, and not available on //e, which
may also be not true. An ulterior patch will make that
check correctly.

Adapt the box/line drawing characters so that one can use
MouseText on the apple2 target if it is available, by
defining DYN_DRAW_BOX. No change by default: MouseText is
considered available on apple2enh and not available on
apple2.
2025-05-27 19:03:20 +02:00
Gorilla Sapiens
9ae0eaafcc fixed inaccurate comment 2025-05-27 14:13:52 +00:00
Gorilla Sapiens
a1139aa6b8 removed dangling space 2025-05-27 06:31:54 +00:00
Gorilla Sapiens
ca8b072608 fixed another pedantic github build problem 2025-05-27 06:30:12 +00:00
Gorilla Sapiens
9a2f754e8d fixes problems found by github autobuild 2025-05-27 06:18:24 +00:00
Gorilla Sapiens
11d3338282 bugfixes 2025-05-27 06:00:24 +00:00
Gorilla Sapiens
e451134e23 fixes issue #2446 2025-05-27 05:03:17 +00:00
Colin Leroy-Mira
cd92e4f0af Apple2: Set mousecard IRQ rate when possible 2025-05-26 14:58:13 +02:00
rumbledethumps
407a31eeaa
Merge branch 'cc65:master' into master 2025-05-24 21:39:17 -07:00
rumbledethumps
b6d261ba2b change to ria_tzset 2025-05-24 21:27:05 -07:00
Bob Andrews
3b089b715a
Merge pull request #2485 from SvenMichaelKlose/add_plus4_getin_wrapper
Add Plus/4 wrapper for KERNAL's GETIN.
2025-05-25 03:58:00 +02:00
Bob Andrews
0d9ae7cb70
Update kgetin.s
use symbol from cbm_kernal.inc
2025-05-25 03:44:36 +02:00
Bob Andrews
cb0c9bf526
Merge pull request #1810 from mrdudz/coniopeek
conio peek for Atari, Atmos, NES, OSIC1P
2025-05-25 03:26:30 +02:00
mrdudz
bd63c6aa4b move char block printing into function 2025-05-25 03:23:54 +02:00
mrdudz
c996157f0e update conio test to reflect the state of cpeek implementation(s) 2025-05-25 02:53:34 +02:00
mrdudz
e9a15af29b cleanup/fix pce cpeekc/cpeekcolor/cpeekrevers/cpeeks, replaces #532 2025-05-25 02:52:03 +02:00
mrdudz
5c72deb0b9 prepare osic1p cpeekc/cpeekcolor/cpeekrevers, replaces #532 2025-05-25 01:38:32 +02:00
mrdudz
8d42c4a8c5 fix cpeekc/cpeekcolor/cpeekrevers/cpeeks for atmos, replaces what is in #532 2025-05-24 20:03:44 +02:00
mrdudz
228316ff58 NES complete now (tested and conio test updated), replaces what is in #532 2025-05-24 19:19:49 +02:00
mrdudz
6628c4ff43 fix cpeekc/cpeekcolor/cpeekrevers for atari 800 2025-05-24 18:34:44 +02:00
mrdudz
0d5e365ee3 Merge branch 'master' into coniopeek 2025-05-24 17:52:58 +02:00
Bob Andrews
7621fb91f0
Merge pull request #2642 from GorillaSapiens/ca65_charset_translations
C style character translation in ca65
2025-05-24 17:23:19 +02:00
Bob Andrews
8f4451a468
Merge pull request #2658 from kugelfuhr/kugelfuhr/fix-2655
Fix -W -unreachable-code not working in all cases
2025-05-24 17:17:36 +02:00
Bob Andrews
40d6b45d30
Merge pull request #2652 from pfusik/opt-crc32
zlib: Make crc32 8 bytes shorter and 3 cycles/byte faster
2025-05-24 17:13:56 +02:00
Bob Andrews
2edb5b96c5
Merge pull request #2654 from kugelfuhr/kugelfuhr/fix-2599
Fix missing warning for non void functions without a return statement
2025-05-24 16:59:00 +02:00
Bob Andrews
e211849633
Merge pull request #2657 from kugelfuhr/kugelfuhr/cleanup
Remove the unused function ClearDiagnosticStrBufs()
2025-05-24 16:56:56 +02:00
Bob Andrews
333ac4b383
Merge pull request #2651 from colinleroy/add-decompressors
Add ZX02 and LZSA (1,2) decompressors
2025-05-24 16:54:05 +02:00
rumbledethumps
795cc55e45 tzset() 2025-05-23 19:26:27 -07:00
rumbledethumps
096095840f fix RIA.errno macro conflict 2025-05-23 19:25:46 -07:00
rumbledethumps
5854818754
Merge branch 'cc65:master' into master 2025-05-23 18:53:28 -07:00
Kugel Fuhr
7be7ce4e9b Remove tabs. 2025-05-21 11:21:40 +02:00
Kugel Fuhr
b5b7ea422e Make sure, the command line setting for the "Unreachable code" warning is
checked in all cases before outputting such a warning. Fixes #2655.
2025-05-21 11:04:21 +02:00
Kugel Fuhr
c7c7377f7a Remove the unused function ClearDiagnosticStrBufs(). 2025-05-21 10:20:59 +02:00
Kugel Fuhr
81e1312416 Remove the unused function ClearDiagnosticStrBufs(). 2025-05-20 13:50:33 +02:00
Christian Groessler
2dbc7d1696
Merge pull request #2653 from frotzer/fixeof
Fix Atari buffer overrun on keyboard EOF
2025-05-20 07:41:00 +02:00
Kugel Fuhr
500887ec23 Fix #2599. The compiler handled all functions returning an int but without a
"return" statement by silently adding "return 0" instead of emitting a
warning. This is the desired behavior for the "main" function in C99 and
above, but the compiler applied it to all functions.
2025-05-17 17:18:05 +02:00
John Murkerson
9cdba1b6d8 Fix Atari buffer overrun on keyboard EOF 2025-05-15 20:45:40 -04:00
Piotr Fusik
13ddd6392c zlib: Make crc32 8 bytes shorter and 3 cycles/byte faster 2025-05-14 15:15:32 +02:00
Colin Leroy-Mira
cfbfaa559c Add ZX02 and LZSA (1,2) decompressors 2025-05-13 21:26:47 +02:00
Bob Andrews
84094ae2b3
Merge pull request #2648 from McZonk/GranularityTypo
Fixed a typo in Granularity
2025-05-13 13:54:04 +02:00
Max
8fbb4c39c4 Fixed a typo in Granularity 2025-05-13 09:14:03 +02:00
Bob Andrews
80cef73f8c
Merge pull request #2644 from JimmyDansbo/cx16_videomodes
Add additional video modes that were added in ROM Pre Release 43 on CX16
2025-05-08 19:09:38 +02:00
Jimmy Dansbo
d4a37f7777 Changed tabs to spaces 2025-05-06 09:16:12 +02:00
Jimmy Dansbo
c5a3dbdf38 Add additional video modes that were added in ROM Pre Release 43 2025-05-06 09:09:07 +02:00
Gorilla Sapiens
1b85ab6985 C style character translation in ca65 2025-05-06 03:02:18 +00:00
Bob Andrews
75d43ef88e
Merge pull request #2636 from GorillaSapiens/issue_2607
issue #2607, enable '\e' character escape for --standard cc65
2025-05-06 01:47:23 +02:00
Gorilla Sapiens
f48fb03540 issue #2607, enable '\e' character escape for --standard cc65 2025-05-05 17:53:42 +00:00
Bob Andrews
4fb87d27dc
Merge pull request #2610 from GorillaSapiens/c_6.4.4.4_test1
conform to 6.4.4.4 for hex and octal escapes
2025-05-05 17:14:01 +02:00
Bob Andrews
0742b68ea1
Merge pull request #2639 from GorillaSapiens/issue_2637
fixes issue #2637
2025-05-05 17:01:22 +02:00
Gorilla Sapiens
f13f2cb619 fixes issue #2637 2025-05-03 02:41:08 +00:00
Bob Andrews
b1713e4c96
Merge pull request #2627 from colinleroy/add-lz4-C-ref
Add decompress_lz4 C implementation as comment
2025-05-02 20:23:09 +02:00
Bob Andrews
ae76f28712
Merge pull request #2635 from GorillaSapiens/issue_2633
issue #2633 print unambiguous success message
2025-05-02 16:29:54 +02:00
Gorilla Sapiens
060522a740 issue #2633 print unambiguous success message 2025-05-02 05:43:14 +00:00
Gorilla Sapiens
6a17aedd81 conform to 6.4.4.4 for hex and octal escapes
fixes problem noted in #2610
2025-05-02 05:03:55 +00:00
Colin Leroy-Mira
2085646e57 Apple2: implement get_tv()
get_tv() will return TV_NTSC or TV_PAL for any Apple II model
with a way of checking vblank. For Apple ][ and ][+ it will
return TV_OTHER and let the user figure it out in another way.
2025-04-28 11:58:53 +02:00
rumbledethumps
34bb14bc6e improve validation errors 2025-04-27 23:52:23 -07:00
Bob Andrews
96e8e89776
Merge pull request #2630 from McZonk/docfix-unnamedlabels
Fix documentation about unnamed labels using an `@`.
2025-04-19 15:51:18 +02:00
Max
8cf802cee3 Fix documentation about unnamed labels using an @. 2025-04-15 16:57:13 +02:00
Christian Groessler
5cb1bc60fc Add 'define=yes' for INIT segment to atari-asm.cfg and atari-asm-xex.cfg linker configs.
libsrc/atari/exehdr.s: Add (empty) INIT segment to cover assembler programs which link with
exehdr.s.
2025-04-09 22:51:11 +02:00
Colin Leroy-Mira
caa66aea95 Add decompress_lz4 C implementation as comment
For reference.
2025-04-07 21:01:05 +02:00
Bob Andrews
432f2841e5
Merge pull request #2626 from kugelfuhr/kugelfuhr/fix-2611
Fix a typo in g_typeadjust()
2025-04-07 19:11:21 +02:00
Kugel Fuhr
f1ed5b7057 Fixed a typo in g_typeadjust(). Will fix #2611. 2025-04-07 09:20:51 +02:00
Bob Andrews
2b30b90cfe
Merge pull request #2625 from polluks/posix_memalign
Added doc and some refs #2613
2025-04-06 19:25:10 +02:00
Stefan A. Haubenthal
834388a9e1 Added doc and some refs #2613 2025-04-06 18:49:11 +02:00
Bob Andrews
065b0d7f90
Merge pull request #2621 from polluks/master
Fixed many comments
2025-03-25 16:01:44 +01:00
Stefan
5ceb4f0d68
Revert atr5200std.s 2025-03-24 21:27:55 +01:00
Stefan A. Haubenthal
774e275965 Fixed many comments 2025-03-24 20:52:55 +01:00
Christian Groessler
9f5a195dc2 samples/geos/Makefile: use C1541 variable for c1541 program 2025-03-22 00:17:03 +01:00
Oliver Schmidt
1efe1227d6 Added apple2enh to the targets supporting waitvsync(). 2025-03-14 16:43:39 +01:00
Colin Leroy-Mira
fb63a839bf Optimize LZ4 decompressor
Use a walking out pointer instead of &out[written]. This
simplifies the code by 27 bytes and spares 15% cycles.
Tested with both the unit test and code uncompressing
10kB of data.

Renamed the labels for legibility.
2025-03-14 16:33:13 +01:00
Oliver Schmidt
ee540678e6 Improved consistency of notation for return value promotion. 2025-03-13 22:22:28 +01:00
Oliver Schmidt
3edb959298 Finally made CONIO and STDIO fully interoperable in 80 column mode.
In order to avoid undefined behaviour of programs not aware of 80 column mode, the 80 column firmware deliberately doesn't use CH but OURCH. So in order to be fully interoperable, CONIO needs to do the same. This changes introduces that behavior. So far so good.
But the 80 column firmware can also be active in 40 column mode. This scenario is not detectable with reasonable effort. Therefore the behaviour of CONIO in this scenario is _not_ improved. However, this scenario is supposed to be very uncommon - and a recent update to videomode() makes sure to not activate it anymore ourselves.
Notes:
* If a program wants to be 100% sure to not run in 40 column mode with 80 column firmware active it can call videomode(VIDEOMODE_40COL) to explicitly deactivate a potentially active 80 column firmware. However, this always implicitly clears the screen.
* In 40 column mode (contrast to 80 column mode) the 80 column firmware updates CH to reflect OURCH. So as long as CONIO only reads CH, but doesn't update it, everything works as expected. Interestingly this makes a rather useful scenario of STDIO/CONIO interoperation work: Using STDIO for screen output and CONIO for keyboard input. When cgetc() is called after cursor(1), it has to write to the screen as there's no hardware cursor on the Apple II. Those writes work as expected even in 40 column mode with active 80 column firmware as CH is only read but not written.
2025-03-13 22:22:28 +01:00
Oliver Schmidt
7c2671be2a Disable interrupts during aux memory access.
Interrupt handlers rather likely access text screen holes. Especially MSLOT is obligatory for every interrupt handler that requires access to an extension ROM ($C800-$CFFE) in order to be able to re-enable the extension ROM that was enabled when the interrupt occured. Those text screen holes only hold valid values in main memory so interrupts must be disabled while the aux memory text screen is mapped.
2025-03-13 22:22:28 +01:00
Oliver Schmidt
fd4c1e193d Completely disable/enable 80 column firmware.
The //e 80 column firmware allows to switch between 80 and 40 clumns without clearing the screen. So far, I made that feature available via videomode(). However thinking about it once more, I don't see a C program making use of it. A C program rather benefits from the consistent behavior of videomode() always clearing the screen.
Apart from that, the (default) 40 column display and the 40 column display with 80 column firmware active, behave differently (CH vs. OURCH) which causes subtile issues. Those issues can be avoid altogether by simply always deactivating the 80 column firmware when switching from 80 column display to 40 column display.
Of course, those issues are also relevant, if the 40 column display with 80 column firmware is already active when the C program starts. However, I have reasons to believe that running the Apple II in that mode was/is very unpopular.
2025-03-13 22:22:28 +01:00
Colin Leroy-Mira
c8eb6e2dd5 Apple II: Document BLTU alternative 2025-03-09 16:19:42 +01:00
Colin Leroy-Mira
020fe4028a Fix RANGE ERROR STOPPED AT 8214
On a 48k Apple II, the BLTU2 call throws an error,
even when there is nothing to copy in the LC segment.

Add an alternative LC copy, based on memcpy, to an
extra file that the user can link in as with iobuf-0800.

This memcpy-based version allows our programs to run on
Integer ROM apple2. It costs 21 bytes in binary size,
plus memcpy (60 bytes in binary size + RAM use) if it
wasn't already linked in.
2025-03-06 15:55:10 +01:00
Christian Groessler
02470a2343 atari5200: fix conio screen initialization
Screen memory clearing was wrong, now uses _clrscr function.
2025-03-04 23:41:30 +01:00
Christian Groessler
16224cdd36 atari5200: fix _clrscr to use correct screen size
Could be different than default when linking with atari5200-conioscreen-20x12.o.
2025-03-04 23:07:13 +01:00
Christian Groessler
b0220e5456 fix problem in _get_tv for GEOS CBM
Found by mkslack, see #2046
2025-03-02 09:26:31 +01:00
Christian Groessler
e5cebeda76
Merge pull request #2606 from groessler/something_to_pull
Atari: fix fallout of change of INIT segment to 'bss' type
2025-02-25 21:55:48 +01:00
Christian Groessler
04ada63935 Atari: let crt0.s always provide an (empty) INIT segment 2025-02-23 01:06:08 +01:00
Christian Groessler
0082473630 Atari: fix fallout of change of INIT segment to 'bss' type
The size of the load chunk was calculated incorrectly in exehdr.s
since the INIT segment is no longer being part of the file anymore.

While at it, change atari-cassette.cfg so that order of BSS and INIT
is the same as in the other configs. See 692f96409d why it was
in different order.
2025-02-23 00:35:23 +01:00
Christian Groessler
b75f872fee
Merge pull request #2602 from polluks/master
Fixed cassette boot file header #2600
2025-02-02 16:52:42 +01:00
Stefan
46b2f95ac8
comment 2025-01-31 20:56:59 +01:00
Stefan
fb12363a6a
Fixed cassette boot file header #2600 2025-01-31 20:26:35 +01:00
Bob Andrews
d5cf8ef7ea
Merge pull request #2587 from colinleroy/rewind-asm-and-fseek-paravirt
Rewrite rewind() in assembly,add lseek() to paravirt
2025-01-27 17:18:12 +01:00
Oliver Schmidt
99b113de64 Make memory between the end of the text screen and the start of the loaded program available to the linker. 2025-01-19 18:17:11 +01:00
mrdudz
734a76c158 added missing directories to "install" target 2025-01-12 19:03:39 +01:00
mrdudz
67da1e7123 add makefile for simulator samples 2025-01-12 18:57:31 +01:00
Sidney Cadot
9fd090ae8b
Merge pull request #2593 from sidneycadot/sim65-add-peripheral-support-and-docs-and-samples
sim65: add C/assembly support, docs, and samples for the new peripheral functionality.
2025-01-11 08:50:28 +01:00
Sidney Cadot
b05bb4a44f
Merge pull request #2595 from sidneycadot/fix-2594
Fixed typo in color symbol definition.
2025-01-07 23:51:52 +01:00
Sidney Cadot
e245ae655d Fixed typo in color symbol definition.
Fixes #2594.
2025-01-07 23:36:17 +01:00
Sidney Cadot
aacd64b2bc Shorteded is_65c02 routine. 2025-01-05 22:29:51 +01:00
Bob Andrews
4e3f1ed025
Merge pull request #2559 from polluks/violet
Fixed colour #2540
2025-01-05 21:59:03 +01:00
Bob Andrews
86ed0722e4
Merge pull request #2592 from kugelfuhr/kugelfuhr/fix-2566
Fix a field alignment bug
2025-01-05 19:25:51 +01:00
Kugel Fuhr
1556c8ac7c Move the test from "todo" to "val" since it shouldn't fail any longer. 2025-01-05 17:04:31 +01:00
Kugel Fuhr
447b6e5573 More explicit solution. The first one was a bit hackish. 2025-01-05 16:45:59 +01:00
Kugel Fuhr
3a52c143fb Fix #2566. 2025-01-05 16:45:59 +01:00
Sidney Cadot
50c669d38e
Merge pull request #2570 from sidneycadot/struct-assignment-bug2566
Added test to demonstrate issue #2566.
2025-01-05 16:33:27 +01:00
sidney
aca6b33af7 Fixed printf format types, and don't act like a test. 2025-01-05 16:16:13 +01:00
sidney
988260c699 sim65: add C/assembly support, docs, and samples for the new peripheral functionality.
This PR is the second of two PRs that replaces earlier PRs #2589 and #2590. Due to a git branching mishap it was decided to re-partition the new functionality in two sequential PRs that offer self-contained, new functionality to sim65.

The functionality in this second and last PR provides the following things in relation to the new "peripheral" support:

* C support: there is now an include/sim65.h that can be included from C. It provides access to the memory-mapped peripheral addresses.

* Asm support: there is now an asminc/sim65.inc that can be included from assembly. It provides symbolic labels for the memory-mapped peripheral addresses.

Note: the two items above are implemented by adding a "_peripherals" symbol to cfg/sim6502.cfg and cfg/sim65c02.cfg, with the fixed base address of the peripherals memory aperture (0xffc0).

* Updated the sim65 documentation to describe the peripherals in some detail, with examples that show to use the new features from within C.

* Some examples in the new samples/sim5/ directory. These are currently not integrated in the build system (in other words, there's no Makefile there), because I don't know how to do that. I will happily implement that after #2582 is taken care of.

If that is not acceptable, the next best thing will be for somebody else (who understands how the Makefiles are set up) to take care of this.

If that's not going to happen, and we don't want examples that are not properly integrated with the build system, there's always the option of removing these samples from the PR.
2025-01-05 15:58:05 +01:00
Sidney Cadot
edf0ce216e
Merge pull request #2591 from sidneycadot/add-tracing-and-cpumode-switching-peripheral
sim65: add tracing, and a sim65 control peripheral for sim65 runtime control
2025-01-05 15:17:17 +01:00
sidney
5be0b10b62 sim65: add tracing, and a sim65 control peripheral for sim65 runtime control.
This PR is the first of two PRs that replaces earlier PRs #2589 and #2590.
Due to a git branching mishap it was decided to re-partition the new
functionality in two sequential PRs that offer self-contained, new
functionality to sim65.

The functionality in this first PR extends the sim65 simulator in the following ways:

(1) It provides tracing functionality, i.e., the possibility of printing one line of simulator state information per instruction executed.
(2) It provides a memory mapped "sim65 control" peripheral that allows control of (a) the tracing functionality, and (b) the cpu mode.
(3) It provides command-line options to sim65 to enable the tracing, and to override the CPU mode as specified in the program file header.

More detailed information and some discussion can be found in the discussions with the (now retracted) PRs #2589 and #2590.

This PR provides the technical infrastructure inside the sim65 simulator program itself. Once this PR is accepted, a follow-up PR will be posted that adds C and assembly-language support for the new tracing and peripheral features so they can be easily accessed from the CC65 compiler and the CA65 assembler; some examples; and the documentation for these features. The lack of the latter, in this pull request, will be addressed then.
2025-01-03 21:39:20 +01:00
Sidney Cadot
25ed7ac6e4
Merge pull request #2588 from polluks/master
Fixed typos
2025-01-01 23:07:52 +01:00
Stefan
bf8b834317
Fixed typo 2025-01-01 18:31:57 +01:00
Stefan
0d8cbbc38b
Fixed typos 2025-01-01 18:30:23 +01:00
Stefan
3047439174
Fixed typo 2025-01-01 18:26:11 +01:00
Colin Leroy-Mira
21345bd6da Fix headers 2025-01-01 14:32:07 +01:00
Colin Leroy-Mira
adfb42bfa6 Rewrite rewind in assembly 2025-01-01 14:32:07 +01:00
Colin Leroy-Mira
5531320b51 Fix test_fread return value on error 2025-01-01 14:32:07 +01:00
Colin Leroy-Mira
50cccc2c3a Add lseek to sim6502 paravirt 2025-01-01 14:32:03 +01:00
Sidney Cadot
dbbfcd1467
Merge branch 'cc65:master' into struct-assignment-bug2566 2025-01-01 10:56:57 +01:00
Sidney Cadot
823f2045cf
Merge pull request #2586 from sidneycadot/fix-snapshot-build-issue_2
Fixing snapshot build issue.
2025-01-01 09:14:31 +01:00
sidney
66594d44a5 Forget to include sys/time.h which is needed for MingGW32 builds. 2025-01-01 08:58:51 +01:00
Sidney Cadot
0f203361bb
Merge pull request #2585 from sidneycadot/fix-snapshot-build-issue
Fix snapshot build failure. Hopefully this quick fix will solve the snapshot build failure for now.
2025-01-01 08:42:54 +01:00
sidney
ef18d2cdd9 Added code path for for MinGW32 builds that happen during snapshot builds, but not during PR builds. 2025-01-01 08:28:17 +01:00
Sidney Cadot
380a946faa
Merge branch 'cc65:master' into struct-assignment-bug2566 2024-12-31 23:02:08 +01:00
Sidney Cadot
b95e8b2ae0
Merge pull request #2577 from sidneycadot/feature-add-timer
sim65: add memory-mapped cycle/instruction/wallclock timer.
2024-12-31 23:00:22 +01:00
sidney
a8581d042f Improved description. 2024-12-31 18:32:11 +01:00
sidney
b2851be340 Fixed several typos. 2024-12-31 18:20:11 +01:00
sidney
915416dc66 Added example. 2024-12-31 18:11:35 +01:00
sidney
d8df73c36d Improved counter peripheral documentation, and moved its documentation to the end
of the page just before the copyright notice.
2024-12-31 17:54:58 +01:00
sidney
f95a60d5ad Updating sim65 docs. 2024-12-31 13:48:45 +01:00
sidney
e37a2b1559 Updated documentation with counter documentation. 2024-12-31 13:35:16 +01:00
Sidney Cadot
cd1e9f6729
Merge branch 'cc65:master' into struct-assignment-bug2566 2024-12-31 12:41:29 +01:00
Sidney Cadot
acb8eae032
Merge branch 'master' into feature-add-timer 2024-12-31 12:37:55 +01:00
Sidney Cadot
ef385c78cc
Merge pull request #2580 from sidneycadot/fix-sim65-cosmetics
Fixed style issues in sim65 code.
2024-12-31 12:32:19 +01:00
sidney
511f4478de Fixed style issues. 2024-12-29 22:26:38 +01:00
sidney
7576f59e6a Visual Studio compiler demands an explicit cast from uint64_t to uint8_t. 2024-12-28 06:57:37 +01:00
sidney
29063021a8 Cosmetic improvements. 2024-12-28 06:49:23 +01:00
sidney
e785b88d42 Cleaning up the GetWallclockTime function. 2024-12-27 09:21:04 +01:00
sidney
58b8c14738 Split off the compiler-depended wallclock time function in a separate function. 2024-12-27 08:57:58 +01:00
sidney
c735a83a98 Enable timespec_get in MINGW64 code path to see if that works (7). 2024-12-27 02:19:36 +01:00
sidney
6ccde66c86 Enable timespec_get in MINGW64 code path to see if that works (6). 2024-12-27 02:06:15 +01:00
sidney
083c968885 Enable timespec_get in MINGW64 code path to see if that works (5). 2024-12-27 01:53:16 +01:00
sidney
a94b389965 Enable timespec_get in MINGW64 code path to see if that works (4). 2024-12-27 01:39:18 +01:00
sidney
2743644b02 Enable timespec_get in MINGW64 code path to see if that works (3). 2024-12-27 01:24:44 +01:00
sidney
74f12b4498 Enable timespec_get in MINGW64 code path to see if that works (2). 2024-12-27 01:12:04 +01:00
sidney
65d20eaab4 Enable timespec_get in MINGW64 code path to see if that works. 2024-12-27 00:55:13 +01:00
sidney
328006e500 Split out cases for MINGW32 and MINGW64 2024-12-27 00:42:29 +01:00
sidney
f3e8f36f00 Corrected typo. 2024-12-27 00:28:19 +01:00
sidney
db0b8c2d2c Check if we have it working now on the MinGW32 and 64 compilers. 2024-12-27 00:21:50 +01:00
sidney
ae3106af4a Windows version now uses timespec_get() as a substitute for clock_gettime(). 2024-12-27 00:04:06 +01:00
sidney
1f9e731fc9 Try if gettimeofday() will work in Windows. 2024-12-26 23:48:34 +01:00
sidney
8c40568566 Made wallclock time fail on Windows (due to lack of clock_gettime), succeed everywhere else. 2024-12-26 23:32:00 +01:00
sidney
a906402308 Re-enabling the clock_gettime() code path. 2024-12-26 23:15:41 +01:00
sidney
55019fb517 Merge branch 'feature-add-timer' of github.com:sidneycadot/cc65 into feature-add-timer 2024-12-26 22:57:24 +01:00
sidney
61bedbdd55 Added explicit cast to uint8_t, to make the Cisual Studio compiler happy. 2024-12-26 22:55:52 +01:00
sidney
9978600d28 Fixed erroneous ClInclude to ClCompile (thanks Matteo Pompili!) 2024-12-26 22:55:32 +01:00
Sidney Cadot
1096023e00
Update src/sim65.vcxproj
Co-authored-by: Matteo Pompili <6500688+matpompili@users.noreply.github.com>
2024-12-26 22:48:42 +01:00
Sidney Cadot
583c103f86
Merge branch 'cc65:master' into struct-assignment-bug2566 2024-12-26 15:08:08 +01:00
Sidney Cadot
af8a04dba0
Merge branch 'cc65:master' into feature-add-timer 2024-12-26 15:07:52 +01:00
Sidney Cadot
d1bf3ba8c7
Merge pull request #2576 from sidneycadot/fix-instruction-timing
sim65: Fix instruction timings for 6502 and 65C02.
2024-12-26 15:06:27 +01:00
Sidney Cadot
ca76db1ee4 peripherals.c now at the back of the dependency list. 2024-12-24 11:59:52 +01:00
Sidney Cadot
073606b858 Trying re-ordering of dependencies to get the Windows version to compile. 2024-12-24 11:30:34 +01:00
Sidney Cadot
d512954fe9 Added peripherals.c and peripherals.h to sim65.vcxproj 2024-12-24 11:23:05 +01:00
Sidney Cadot
e149d1dcf6 Disable the use of clock_gettime(), to see if this fixes the CC65 CI builds. 2024-12-24 11:14:30 +01:00
Sidney Cadot
7980b81ddb sim65: Fix instruction timings for 6502 and 65C02.
This PR fixes all discrepancies of sim65 instruction timings, for both the 6502 and the 65C02 processors.

The timings as implemented in this PR have been verified against actual hardware (Atari 800 XL for 6502; and WDC 65C02 for 65C02).

These timings can also be verified against the 65x02 test suite. However, in this case, a single discrepancy arises; the 65x02 testsuite suggests that the 65C02 opcode 0x5c should take 4 clocks. However, tests on a hardware 65C02 have conclusively shown that this instruction takes 8 clock cycles. The 8 clock cycles duration for the 65C02 0xfc opcode is also confirmed by other sources, e.g. Section 9 of http://www.6502.org/tutorials/65c02opcodes.html.

This test makes sim65 correct both in terms of functionality (all opcodes now do what they do on hardware) and in terms of timing (all instructions take as long as they would on real hardware).

The one discrepancy that remains, is that on a real 6502/65C02, some instructions issue R or W cycles on the bus while the instruction processing is being done. Those spurious bus cycles are not replicated in sim65. Sim65 is thus an instruction-level simulator, rather than a bus-cycle level simulator. In other words, while the clock cycle counts for each instruction are now correct, not all clock cycles are individually simulated.
2024-12-24 09:24:02 +01:00
Sidney Cadot
3b73cf9b34
Merge branch 'cc65:master' into struct-assignment-bug2566 2024-12-24 08:34:11 +01:00
Sidney Cadot
c3916455a7
Merge branch 'cc65:master' into feature-add-timer 2024-12-24 08:33:47 +01:00
Sidney Cadot
07b168e062
Merge pull request #2573 from sidneycadot/fix-6502x-illegals
sim65: properly implement 5 'illegal' 6502X opcodes.
2024-12-24 08:29:16 +01:00
Sidney Cadot
92f9f4b427
Merge pull request #2572 from sidneycadot/fix-missing-65c02-instructions
sim65: implemented missing 65C02 instructions
2024-12-24 08:28:21 +01:00
Sidney Cadot
fbf3bde97c sim65: properly implement 5 'illegal' 6502X opcodes.
This PR fixes the implementation of 5 illegal opcodes
in the 6502, which the 6502X supports:

* $93   SHA (zp),y
* $9B   TAS abs,y
* $9C   SHY abs,x
* $9E   SHX abs,x
* $9F   SHA abs,y

The common denominator of the previous implementation was that it didn't correctly handle the case when the Y or X indexing induced a page crossing. In those cases, the effective address calculation of the instructions becomes truly messed up (with the high byte of the address equal to the value being written).

The correctness of the implementations in this PR was verified using the 65x02 test suite, and corresponds to a (detailed) reading of the "No More Secrets" document.

Stylistically, there is room for improvement in these implementations, specifically in factoring out common behavior into macros. However, for now the "explicit" coding style will suffice. It is clear enough, and we want to reach a situation soon where the sim65
code is able to pass the full '65x02' testsuite. Once we get to that point, we can refactor this code with a lot more confidence, since we will have the benefit of a working exhaustive test to make sure we don't break stuff.
2024-12-22 19:48:41 +01:00
Sidney Cadot
d064ca424f sim65: implemented missing 65C02 instructions
This PR implements support for 32 65C02-specific instructions
to sim65: BBRx, BBSx, RMBx, SMBx, with x = 0..7.

These instructions are implemented using two macros:

* The "ZP_BITOP" macro implements the RMBx and SMBx isntructions.
* The "ZP_BIT_BRANCH" macro implements the BBRx abd BBSx instructions.

The implementation of these instructions has been verified usingthe 65x02 test suite.
2024-12-22 19:15:20 +01:00
Sidney Cadot
5291f51e73
Merge branch 'cc65:master' into feature-add-timer 2024-12-22 18:16:15 +01:00
Sidney Cadot
075514c60c
Merge pull request #2569 from sidneycadot/fix-cpu-register-types
sim65: tighten 6502 register types
2024-12-22 18:00:16 +01:00
Sidney Cadot
3c5d5aac63
Merge pull request #2568 from sidneycadot/fix-ane-behavior
sim65: changes constant of the unstable "ANE" instruction.
2024-12-22 17:59:57 +01:00
Sidney Cadot
4802b5b27b
Merge pull request #2565 from sidneycadot/fix-fgets
Temporary fix for fgets() not using target-specific newline.
2024-12-22 17:59:35 +01:00
Sidney Cadot
3c4d9660ed
Merge pull request #2567 from sidneycadot/fix-jsr
sim65: fix memory access order of the JSR instruction.
2024-12-22 17:59:19 +01:00
Sidney Cadot
178ab08fe2 Test to demonstrate issue #2566. 2024-12-20 21:47:01 +01:00
Sidney Cadot
8cb941985d sim65: tighten 6502 register types
After a lot of preparatory work, we are now in position to finally tighten
the types of the 6502 registers defined in the CPURegs struct of sim65.

All registers were previously defined as bare 'unsigned', leading to subtle
bugs where the bits beyond the 8 or 16 "true" bits in the register could
become non-zero. Tightening the types of the registers to uint8_t and
uint16_t as appropriate gets rid of these subtle bugs once and for all,
assisted by the semantics of C when assigning an unsigned value to an
unsigned type with less bits: the high-order bits are simply discarded,
which is precisely what we'd want to happen.

This change cleans up a lot of spurious failures of sim65 against the
65x02 test-set. For the 6502 and 65C02, we're now *functionally*
compliant. For timing (i.e., clock cycle counts for each instruction),
some work remains.
2024-12-19 23:13:20 +01:00
Sidney Cadot
b14f883e73 sim65: changes constant of the unstable "ANE" instruction to comply with 65x02 test suite.
ANE (0x8b) is an unstable illegal opcode that depends on a "constant" value that isn't
really constant. It varies between machines, with temperature, and so on. Original sim65
behavior was to use the constant value 0xEF. To get the behavior in line with the 65x02
testsuite, we now use the value 0xEE instead, which is also a reasonable choice that can
be observed in practice.
2024-12-19 22:58:42 +01:00
Sidney Cadot
bad2f54f75 Fix memory access order of the JSR instruction.
The obvious way to implement JSR for the 6502 is to (a) read the target address,
and then (b) push the return address minus one. Or do (b) first, then (a).

However, there is a non-obvious case where this conflicts with the actual order
of operations that the 6502 does, which is:

(a) Load the LSB of the target address.
(b) Push the MSB of the return address, minus one.
(c) Push the LSB of the return address, minus one.
(d) Load the MSB of the target address.

This can make a difference in a pretty esoteric case, if the JSR target is located,
wholly or in part, inside the stack page (!). This won't happen in normal code
but it can happen in specifically constructed examples.

To deal with this, we load the LSB and MSB of the target address separately, with
the pushing of the return address sandwiched in between, to mimic the order of the
bus operations on a real 6502.
2024-12-19 22:35:15 +01:00
Bob Andrews
c52d7b27e6
Merge pull request #2564 from sidneycadot/fix-cpuregs-linkage
sim65: simulated CPU registers can be accessed from outside 6502.c.
2024-12-19 21:09:37 +01:00
Bob Andrews
028dc60386
Merge pull request #2563 from sidneycadot/fix-adc-sbc
sim65: fixed ADC/SBC for the 65C02.
2024-12-19 21:09:05 +01:00
Sidney Cadot
eb8ea0f2c4 Replaced incidental tab by spaces. 2024-12-19 20:57:34 +01:00
sidney
743a3dc735 Changed nameing convention of fields (now CamelCase), and improved comments. 2024-12-19 07:44:01 +01:00
sidney
3cd7548b59 Cosmetic fixes. 2024-12-19 03:50:44 +01:00
sidney
5239d3a11b Polishing the peripherals (and counter) interface. 2024-12-19 03:48:15 +01:00
sidney
8a7cd9c632 Fixed format string. 2024-12-19 03:04:55 +01:00
Sidney Cadot
8ee93f7e5f Fixed indentation inside comment. 2024-12-18 09:04:20 +01:00
Sidney Cadot
a3cc9b4757 Fixed mistake in the latching code. 2024-12-18 08:55:30 +01:00
Sidney Cadot
ceac9f87ba Temporary fix for fgets() not using target-specific newline.
This patch provides a temporary fix for the issue where the fgets()
function did not use the target-specific newline character to
decide if it has reached the end of the line. It defaulted to the
value $0a, which is the newline character on only some targets.
The Atari, for example, has newline character $9b instead.

This patch is ugly, because the ca65 assembler that is used for
fgets doesn't currently accept C-type character escape sequences
as values. Ideally we'd be able to write:

		cmp #'\n'

And this would end up being translated to a compare-immediate
to the target-specific newline character.

Since that is impossible, this patch substitutes the equivalent,
but ugly, code:

		.byte $c9, "\n"

This works because $c9 is the opcode for cmp #imm, and the "\n"
string /is/ translated to the platform-specific newline character,
at least when the 'string_escapes' feature is enabled.
2024-12-18 07:44:52 +01:00
Sidney Cadot
6f9406bbe3 This adds timer functionality to sim65.
It provides access to a handful of 64-bit counters that count different things:
- clock cycles
- instructions
- number of IRQ processed
- number of NMIs processed
- nanoseconds since 1-1-1970.

This in not ready yet to be pushed as a merge request into the upstream CC65
repository. What's lacking:

- documentation
- tests

And to be discussed:

- do we agree on this implementation direction and interface in principe?
- can I include inttypes.h for printing a 64-bit unsigned value?
- will clock_gettime() work on a Windows build?
2024-12-17 23:24:35 +01:00
Sidney Cadot
86ccf25e81 CPU registers can be accessed from outside 6502.c.
The linkage of the 'Regs' variable in 6502.c was changed from static
to extern. This makes the Regs type visible (and even alterable) from
the outside.

This change helps tools to inspect the CPU state. In particular, it
was implemented to facilitate a tool that verifies opcode
functionality using the '65x02' testsuite. But the change is also
potentially useful for e.g. an online debugger that wants to inspect
the CPU state while the 6502 is neing simulated.
2024-12-16 17:12:07 +01:00
Sidney Cadot
fb6745573e Fixed whitespace. 2024-12-16 16:55:26 +01:00
Sidney Cadot
dfc88d5796
Merge branch 'cc65:master' into fix-adc-sbc 2024-12-16 16:46:26 +01:00
Sidney Cadot
eda8774e08 Fixed ADC/SBC for the 65C02.
The current (before-this-patch) version of sim65.c does not correctly implement
the ADC and SBC instructions in 65C02 mode. This PR fixes that.

The 6502 and 65C02 behave identically in binary mode; in decimal behavior
however they diverge, both in the handling of inputs that are not BCD values,
and in the handling of processor flags.

This fix restructures the original "ADC" and "SBC" macros in versions that
are specific for the 6502 and the 65C02, and updates the opcode tables to
ensure that they point to the correct implementations.

Considering the ADC instruction for a moment, the original "ADC" macro was
changed to two macros ADC_6502 and ADC_65C02. These check the D (decimal
mode) bit, and defer their implementation to any of three macros ADC_BINARY_MODE,
ADC_DECIMAL_MODE_6502, and ADC_DECIMAL_MODE_65C02. This is a bit verbose but it
makes it very clear what's going on.

(For the SBC changes, the analogous changes were made.)

The correctness of the changes made is ensured as follows:

First, an in-depth study was made how ADC and SBC work, both in the original
6502 and the later 65C02 processor. The actual behavior of both processors
was captured on hardware (an Atari 800 XL with a 6502 and a Neo6502 equipped
with a WDC 65C02 processor), and was analyzed. The results were cross-referenced
with internet sources, leading to a C implementation that reproduces the exact
result of the hardware processors. See:

https://github.com/sidneycadot/6502-test/blob/main/functional_test/adc_sbc/c_and_python_implementations/6502_adc_sbc.c

Next, these C implementations of ADC and SBC were fitted into sim65's macro-
based implementation scheme, replacing the existing 6502-only implementation.

Finally, the new sim65 implementation was tested against the 65x02 testsuite,
showing that (1) the 6502 implementation was still correct; and (2) that
the 65C02 implementation is now also correct.

As an added bonus, this new implementation of ADC/SBC no longer relies on a
dirty implementation detail in sim65: the previous implementation relied on
the fact that currently, the A register in the simulator is implemented as
an "unsigned", with more bits than the actual A register (8 bits). In the
future we want to change the register width to 8 bits, and this updated
ADC/SBC is a necessary precursor to that change.
2024-12-16 16:36:23 +01:00
Bob Andrews
a53524b9de
Merge pull request #2558 from polluks/cpp
Clean-up preprocessor syntax
2024-12-15 23:02:35 +01:00
Bob Andrews
bfbf5cd250
Merge pull request #2560 from binary-sequence-forks/master
Improve description of namespace access in ca65
2024-12-15 23:01:15 +01:00
Bob Andrews
33f2de7178
Merge pull request #2561 from binary-sequence-forks/fix-typo-ca65-doc
Fix typo in ca65 doc
2024-12-15 23:00:18 +01:00
Bob Andrews
11699a4124
Merge pull request #2557 from sidneycadot/fix-sim65-rol-ror-ops
sim65 : improve implementation of ROL and ROR operations
2024-12-15 22:59:39 +01:00
Bob Andrews
f9e4a2a4d3
Merge pull request #2555 from sidneycadot/fix-sim65-memory-types
sim65: changing memory access types to uint8_t and uint16_t.
2024-12-15 22:59:07 +01:00
Sergio Lindo Mansilla
17e7e669c9 Fix typo in ca65 doc 2024-12-15 15:29:38 +01:00
Sergio Lindo Mansilla
3933f329c2 Improve description of namespace access in ca65
This avoid confusion with referencing global scope with the namespace
token.
2024-12-15 15:08:32 +01:00
Stefan
0e640877c2
Fixed colour #2540 2024-12-11 14:30:56 +01:00
Colin Leroy-Mira
852b622c43 Apple2: Don't forcefully re-enable IRQ
Avoid enabling IRQ after disabling them in driver code, remember
previous state instead (in case user had them disabled already).
2024-12-09 19:01:00 +01:00
Stefan
0f6b427170
Update strftime.c 2024-12-09 18:37:02 +01:00
Stefan
d993f3a766
Update cc65.sgml 2024-12-09 18:36:05 +01:00
Stefan
cf470dd0df
Update sieve.c 2024-12-09 18:26:00 +01:00
Stefan
5f2c5b58ab
Update overlaydemo.c 2024-12-09 18:25:34 +01:00
Stefan
5d2730f4b4
Update multidemo.c 2024-12-09 00:44:44 +01:00
Stefan
8b008052cb
Update mandelbrot.c 2024-12-09 00:43:35 +01:00
Stefan
26e6717102
Update mandelbrot.c 2024-12-09 00:43:05 +01:00
Stefan
316ee4ad5b
Update overlay-demo.c 2024-12-09 00:42:28 +01:00
Stefan
be6819ca1f
Update plasma.c 2024-12-09 00:41:03 +01:00
Stefan
3612d90c8e
Update fire.c 2024-12-09 00:40:41 +01:00
Sidney Cadot
05b3825683 sim65 : improve implementation of ROL and ROR operations
Issue #2539 brings to light a number of issues in the sim65 simulator.

Several issues can be traced back to undesirable side effects of the
use of bare 'unsigned' types for the CPU registers in the 'CPURegs'
type defined in src/sim65/6502.h.

The intention is to tighten the types of the registers defined there
to uint8_t and uint16_t, in accordance with the actual number of bits
that those registers have in the 6502. However, it turns out that a
handful of opcode implementations depend on the fact that the register
types currently have more bits than the actual 6502 registers themselves
for correct operation. This mostly involves operations that involve
the carry bit (ROL, ROR, ADC, SBC).

In preparation of fixing the CPURegs field types, we will first make
sure that those opcode implementations are changed in such a way that
they still work if the underlying register types are tightened to their
actual bit width.

This PR concerns this specific change for the ROL and ROR operations.

The correct functioning of ROL and ROR after this patch has been verified
by testing against the 65x02 test suite.
2024-12-03 23:33:57 +01:00
Sidney Cadot
fbd8961be1 sim65: changing memory access types to uint8_t and uint16_t.
In sim65, simulator memory access to a 64 KB array is implemented via functions
defined in src/sim65/memory.h and src/sim65/memory.c.

In the old version, the types for both content bytes (8 bits), content words
(16 bits), regular addresses (16 bits), and zero-page addresses (8 bits) were
all given as bare 'unsigned'.

This lead to several cases of address overrun (e.g., when an instruction wraps
around from address 0xffff to 0x0000) when running the simulator against a
stress test (specifically, the 65x02 test suite). To protect from this, and to
more properly express the bit width of the types involved which is a good idea
anyway, we start using the fixed-width types provided by 'stdint.h'.

In the process, we also change the MemReadByte macro to a full function call.
This may impact performance (by a small amount), but it improves memory safety,
as cases where the address is accidentally expressed as a value exceeding 0xffff
are handled by wrap-around (as it is in the actual hardware), rather than causing
access outside of the Mem[] array where the 64 KB of simulated RAM resides.

The reason for this patch is twofold.

(1) It is a partial patch for issue #2539.

Several issues brought to the surface by running the 65x02 testsuite are
eliminated by these changes. In the discussion about this issue, it was
concluded that it is a Good Idea to use the stdint-types, both for the
simulated CPU registers and for the memory. This patch addresses the
memory-part of that change.

(2) It is a precursor patch for issue #2355.

For that issue, we will implement a memory-mapped timer register. This will
make handling of memory access in the simulator a bit more complex.

Having proper functions with the proper types in place will help to make the
timer register patch easier.
2024-12-03 21:21:49 +01:00
Bob Andrews
162bc6b305
Merge pull request #2553 from sidneycadot/fix-remove-zregister
Sim65: removed ZR register from CPURegs type.
2024-12-03 02:15:50 +01:00
Sidney Cadot
84c4ea062d Sim65: removed ZR register from CPURegs type. 2024-12-03 01:17:44 +01:00
Bob Andrews
a55d328e78
Merge pull request #2549 from clydeshaffer/debuginfo_doc_port
Port Debug Info page from Wiki to Docs
2024-12-02 00:30:24 +01:00
Bob Andrews
c0a4942b5d
Merge pull request #2550 from sidneycadot/fix-bit-imm
Fixed behavior of the 65C02 "BIT #imm" instruction in sim65.
2024-12-02 00:28:07 +01:00
Bob Andrews
918c39cbeb
Merge pull request #2548 from sidneycadot/fix-branch-timings
Fixed clock-cycle timing of branch (Bxx) instructions.
2024-12-02 00:25:54 +01:00
Bob Andrews
3895caae90
Style fix 2024-12-02 00:25:24 +01:00
Bob Andrews
79e26c1bc5
Merge pull request #2547 from sidneycadot/fix-jmp-ind
Fixed the behavior of JMP (ind) in sim65 when it runs with the 6502X CPU type.
2024-12-02 00:21:31 +01:00
Bob Andrews
1ce8225091
Merge pull request #2551 from sidneycadot/fix-interrupts-dflag
Fixed wrong clearing of D-flag on interrupts for sim65 with 6502X CPU.
2024-12-02 00:19:55 +01:00
Sidney Cadot
e26c17fd50 Fixed wrong clearing of D-flag on interrupts for sim65 with 6502X CPU type.
The 65C02 clears the D flag on interrupts while the 6502 does not.

The old code cleared the D flag also for the 6502X CPU type, which
was incorrect.
2024-12-01 09:59:10 +01:00
Sidney Cadot
1d9d056da5 Fixed behavior of the 65C02 "BIT #imm" instruction.
The BIT #imm instruction behaves differently from the BIT instruction with other
addressing modes, in that it does /not/ set the N and V flags according to the
value of its operand. It only sets the Z flag, in accordance to the value of
(A & operand).

This is corroborated in two ways:

- The 65x02 test suite;
- Documentation about BIT #imm such as http://www.6502.org/tutorials/65c02opcodes.html

This patch implements the correct behavior for BIT with immediate addressing.
The patched version passes the 65x02 test suite for 65C02 opcode 0x89.
2024-11-30 23:46:19 +01:00
Clyde Shaffer
3fdb1a516c small formatting fixes, and a section rename to get it to build 2024-11-30 16:56:25 -05:00
Clyde Shaffer
12f6340878 Add section to ld65 doc about debug info 2024-11-30 16:09:50 -05:00
Sidney Cadot
709d71ef70 Fixed clock-cycle timing of branch (Bxx) instructions.
Branch instructions, when taken, take three or four cycles,
depending on whether a page is crossed by the branch.

The proper check to determine whether the extra cycle must be added
is the target address of the branch vs the address immediately
following the branch.

In the former version of the BRANCH instruction handler, the target
address was incorrectly checked vs the address of the branch instruction
itself.

The corrected behavior was verified against a real 6502 (Atari) and
the 65x02 testsuite.
2024-11-30 19:56:31 +01:00
Sidney Cadot
2abd66ea0c Fixed the behavior of the JMP (ind) instruction in sim65 when it runs with the "6502X" CPU type.
The JMP (ind) bug is present in the 6502 which is emulated by both the "6502" and "6502X"
emulation targets of sim65; specifically, the OPC_6502_6C handler. In the old code, the
bug-exhibiting code was not executed when the target was set to 6502X, which is incorrect.
the patch removes the (CPU == CPU_6502) check, which made no sense.

The JMP (ind) bug was actually fixed in the 65c02. Indeed, the OPC_65C02_6C opcode handler
has code that implements the 'right' behavior.
2024-11-30 12:36:35 +01:00
Bob Andrews
05a653d3f9
Merge pull request #2538 from clydeshaffer/dbg_banknum
[LD65] Add bank number to `seg` entries in dbgfile
2024-11-26 02:27:29 +01:00
Colin Leroy-Mira
21030c22a0 Apple2: Rewrite rewinddir() in assembly 2024-11-17 11:03:58 +01:00
Colin Leroy-Mira
f663ee428d Apple2: Rewrite readdir() and closedir() to assembly 2024-11-17 11:03:58 +01:00
Clyde Shaffer
90e4360958 Parse and report segment bank number in dbginfo module and test shell 2024-11-16 17:13:04 -05:00
Colin Leroy-Mira
700c01fa8b Rename dir_file_count to dir_entry_count 2024-11-15 19:25:40 +01:00
Colin Leroy-Mira
40d9f3eed5 Apple2: Provide a way to get directory file count
The information is available in the directory key block.
Providing it to the user as soon as opendir() is done
can save them costly code.
2024-11-15 19:25:40 +01:00
Clyde Shaffer
fa80e171a2 [LD65] Add bank number to dbgfile 2024-11-12 01:57:27 -05:00
Bob Andrews
36132a437b
Merge pull request #2478 from alexthissen/lynx-include
Lynx cc65 and ca65 include file improvements for Mikey and Suzy
2024-11-09 20:10:51 +01:00
Alex Thissen
a945bedefc Replaced all C++ style comments from Lynx include files 2024-11-09 19:46:11 +01:00
Bob Andrews
e07cdd0a80
Merge pull request #2533 from colinleroy/apple2-rewrite-opendir-asm
Apple2: Rewrite opendir in assembly
2024-11-09 19:35:48 +01:00
Colin Leroy-Mira
819a314508 Apple2: Rewrite opendir in assembly
58 bytes size gain
2024-11-09 18:17:30 +01:00
Alex Thissen
4036912463 Fix to trailing whitespace 2024-11-09 12:06:37 +01:00
Alex Thissen
3dad6c76fa Changed to C style comments 2024-11-09 12:01:22 +01:00
Alex Thissen
0c018919fe Removed union and structures for Suzy math 2024-11-09 11:45:41 +01:00
Alex Thissen
1f1a004a05 Minor tweaks to Suzy struct types.
Named math union
2024-11-09 11:45:41 +01:00
Alex Thissen
489989f4c8 Changed 0x hex values to % binary values 2024-11-09 11:45:41 +01:00
Alex Thissen
336c4287c5 Missed some dangles spaces 2024-11-09 11:45:41 +01:00
Alex Thissen
abcb073a5a Bit definitions for Suzy 2024-11-09 11:45:41 +01:00
Alex Thissen
7150fdf4b9 Enumerations and math structures for Suzy 2024-11-09 11:45:41 +01:00
Alex Thissen
3553975b02 Math improvements to Suzy include file 2024-11-09 11:45:41 +01:00
Alex Thissen
eb6003aaf7 Mikey enumeration values for cc65 include files and new bit definitions for ca65 2024-11-09 11:45:41 +01:00
Bob Andrews
394d3b1964
Merge pull request #2528 from lcvgit/cc65-checkversion-fix
checkversion.c fix missing shifts
2024-11-07 20:52:38 +01:00
lcvgit
c41eb007e4
Update checkversion.c
Add missing shifts.
2024-10-21 10:09:00 -05:00
lcvgit
02840d503c
Fix checkversion.c
Add missing shifts for checking version from __CC65__.
2024-10-21 10:00:48 -05:00
Bob Andrews
4dfbccfafd
Merge pull request #2522 from kugelfuhr/kugelfuhr/code-optimizations
Improve generated code for AND/EOR/ORA
2024-10-05 15:03:46 +02:00
Bob Andrews
270aa4417b
Merge pull request #2524 from kugelfuhr/kugelfuhr/fix-2523
Fix some issues with preprocessor expressions
2024-10-05 14:14:29 +02:00
Bob Andrews
8cd45417f9
Merge pull request #2525 from SvOlli/doc_customizing
updated customizing documentation
2024-10-05 14:13:05 +02:00
Bob Andrews
bb7f0c17b8
Merge pull request #2526 from picocomputer/master
Add to rp6502 target: clock(), xregn(), and RIA stack increase
2024-10-05 14:11:34 +02:00
rumbledethumps
e373aa2d3f
Merge branch 'cc65:master' into master 2024-09-29 18:36:34 -07:00
Sven Oliver Moll
41951a1345 updated customizing documentation
"weak = yes" is now "type = weak"
2024-09-26 19:33:26 +02:00
Kugel Fuhr
9c69aac097 Fix some issues with signedness in preprocessor expressions. Do also disallow
comma expressions since the aren't compliant and collide with macro invocations.
2024-09-17 11:45:46 +02:00
Bob Andrews
16258d812b
Merge pull request #2521 from kugelfuhr/kugelfuhr/fix-2520
Fix wrong evaluation of ternary expressions in the preprocessor
2024-09-15 19:24:22 +02:00
mrdudz
7dc09fdb05 add test related to bug#2515 / pr#2518 2024-09-15 19:22:16 +02:00
Kugel Fuhr
175ec65af1 Fix #2520. 2024-09-14 21:12:19 +02:00
Bob Andrews
fe6afa621b
Merge pull request #2516 from kugelfuhr/kugelfuhr/fix-2514
Make lastline.sh ignore empty files
2024-09-14 01:41:16 +02:00
Bob Andrews
e7c735ed8c
Merge pull request #2513 from kugelfuhr/kugelfuhr/fix-2505
Remove casts from stdint.h
2024-09-14 01:38:46 +02:00
Kugel Fuhr
231ab4169b Added a test. 2024-09-13 19:30:38 +02:00
Kugel Fuhr
f43cfd1ad0 Fix the check for CPU flags being used after an instruction that gets removed.
Previously only the next instruction was checked for usage of the CPU flags
but this fails for certain code.
2024-09-13 19:30:38 +02:00
Kugel Fuhr
6e18e0880a Added/improved the optimizations:
* Added a new pass that optimizes PHA/PLA sequences
* Added a new pass that optimizes AND/EOR/ORA when an operand is known
* Added a run of an existing pass at later stages to remove code that
  otherwise goes unchanged.
* Handle binary operations in OptUnusedLoads in addition to real loads.
2024-09-13 19:30:38 +02:00
Kugel Fuhr
001fa05d48 Move the test to the test/standard directory. 2024-09-13 19:18:31 +02:00
Kugel Fuhr
3f83cf81f3 Revert the change to .gitignore so git status doesn't report a clean status as
before.
2024-09-13 19:02:13 +02:00
Bob Andrews
7260c10062
Merge pull request #2518 from kugelfuhr/kugelfuhr/fix-2515
Fix minor preprocessor problems
2024-09-13 17:53:20 +02:00
Bob Andrews
34d8c3ef0a
Merge pull request #2517 from kugelfuhr/kugelfuhr/time-improvements
Improved/fixed the time() function
2024-09-13 17:47:14 +02:00
Bob Andrews
b5135b3ae0
Merge pull request #2502 from kugelfuhr/kugelfuhr/fix-2461
Fix issue #2461
2024-09-13 15:53:49 +02:00
Kugel Fuhr
efa2020d93 Improved/fixed the time() function:
- When the underlying clock_gettime function returned an error, the value
  returned via *timep was wrong.
- Reduced code size by 7 bytes.
- Don't suck in ldeaxi.
2024-09-12 09:14:57 +02:00
Kugel Fuhr
36a810cdb2 Make lastline.sh ignore empty files. Fixes #2514. 2024-09-12 09:10:37 +02:00
Kugel Fuhr
70ca6d4200 Fixed a standard noncompliance: In C99 and above there must be whitespace
between a name of an object like macro and its replacement list.
2024-09-11 19:21:19 +02:00
Kugel Fuhr
2f6f5f0da1 Fix problem with #line when there is no whitespace between line number and
filename.
y
2024-09-11 19:20:01 +02:00
Kugel Fuhr
6113dc5995 Removed casts from stdint.h. Added a test. Fixes #2505. 2024-09-10 08:12:31 +02:00
Bob Andrews
aff8248341
add comment on function prototypes 2024-09-08 17:08:40 +02:00
Bob Andrews
31a0d5cc40
Merge pull request #2503 from colinleroy/master
Optimize stpcpy's size and speed
2024-09-08 16:17:14 +02:00
Bob Andrews
0be5f8f9e1
Merge pull request #2508 from polluks/waitvsync
[ATMOS] waitvsync
2024-09-08 16:14:51 +02:00
Bob Andrews
3a7f0e2d18
Merge pull request #2509 from polluks/extern
Remove explicit keyword
2024-09-08 16:13:55 +02:00
Bob Andrews
e6ff8d9301
Merge pull request #2510 from polluks/better_waitvsync
Faster waitvsync
2024-09-08 16:09:23 +02:00
Bob Andrews
38038fd0d3
Merge pull request #2512 from kugelfuhr/kugelfuhr/fix-2134
Warn for braces around a pointer initializer
2024-09-08 16:05:58 +02:00
Bob Andrews
1771cb6fbd
Merge pull request #2511 from coronax/fix-gettime-in-time.s
In time(), set the clock id to CLOCK_REALTIME when calling clock_gettime.
2024-09-08 16:04:27 +02:00
Kugel Fuhr
d825a40add The test needs a main() function. 2024-09-08 09:36:40 +02:00
Kugel Fuhr
3c5269dede Warn for braces around a pointer initializer. 2024-09-08 09:11:47 +02:00
coronax
838c8b48b7 Set the clock id to CLOCK_REALTIME when calling clock_gettime.
Previously, time() allocated stack space for the clock id argument, but didn't actually set a value.
2024-09-07 23:27:54 -05:00
Colin Leroy-Mira
55d3a6ea39 Optimize stpcpy's size and speed 2024-09-07 21:24:53 +02:00
Stefan
461554e616
Update waitvsync.s 2024-09-07 19:17:00 +02:00
Stefan
f5e434c6c8
Update waitvsync.s 2024-09-07 19:14:59 +02:00
Stefan
be5a9f92ec
oops 2024-09-07 18:51:20 +02:00
Stefan
b355620939
Optimise waitvsync.s 2024-09-07 18:49:53 +02:00
Stefan
44aa5dca91
Update atari.h 2024-09-07 18:12:37 +02:00
Stefan
c9fa9f0002
Update atari5200.h 2024-09-07 18:08:18 +02:00
Stefan
ab4cdafacb
Update atari7800.h 2024-09-07 18:07:35 +02:00
Stefan
f430341d5d
Update atmos.h 2024-09-07 17:23:17 +02:00
Stefan
033fd9e0dc
Update funcref.sgml 2024-09-07 17:19:21 +02:00
Stefan
38f54875d0
Add files via upload 2024-09-07 17:06:45 +02:00
Bob Andrews
4e2a3bde92
Merge pull request #2499 from kugelfuhr/kugelfuhr/disable-recursive-calls-to-main
Disallow recursive calls to main() in cc65 mode
2024-09-07 14:39:28 +02:00
Bob Andrews
7bd0a1d7f0
Merge pull request #2500 from kugelfuhr/kugelfuhr/better-help-for-W
Improve the usage output for the '-W' option
2024-09-07 14:37:30 +02:00
Kugel Fuhr
d996e20c5f Fix issues #2461. This was always wrong even in cases where it seemed to work.
If it did, it was by coincidence.
2024-09-03 20:21:48 +02:00
Kugel Fuhr
79606c4d20 Overlooked a few target tests that take the address of main(). 2024-09-02 16:55:58 +02:00
Kugel Fuhr
cd4357057f The change from #2495 didn't take into account that recursive calls to main()
are legal in C. With the changes from #2495, such calls will usually crash the
machine. But recursive calls to main() are rare and on the 6502 every byte
saved is precious. So this change limits the effect of #2495 to cc65 mode and
at the same time disallows recursive calls to main() in this mode. If
recursive calls to main() are actually required, the code must be compiled in
c89 or c99 mode.
2024-09-02 10:39:42 +02:00
Kugel Fuhr
e2014611ef Improve the usage output for the '-W' option. 2024-09-02 07:02:41 +02:00
Bob Andrews
5e5dd1d6c4
Merge pull request #2498 from kugelfuhr/kugelfuhr/fix-include-in-macros
Fix .include within .macro/.repeat
2024-09-01 23:26:33 +02:00
Bob Andrews
2680bc8dec
Merge pull request #2495 from kugelfuhr/kugelfuhr/dont-save-stuff-in-main
Generate shorter code for main() in some cases
2024-09-01 22:54:45 +02:00
Kugel Fuhr
cc0db26e20 Added some tests. 2024-09-01 20:22:29 +02:00
Kugel Fuhr
b2aceaea24 Fix behavior of .INCLUDE within a macro or .REPEAT. In the original code
.INCLUDE was executed after expansion of the macro or .REPEAT - which was
wrong and caused all sorts of unexpected behavior. Related issues/PRs
are #231, #1473, #2159 and maybe others.

Note: After this change error messages for nested macro/.include statements
may be wrong. This is an unrelated bug that was always there and got exposed
by this fix. The bug needs to be addressed in a separate PR.
2024-09-01 19:58:07 +02:00
Bob Andrews
7a578be724
Merge pull request #2491 from kugelfuhr/kugelfuhr/fix-2431
Fix issue #2431
2024-09-01 19:35:32 +02:00
Bob Andrews
a712fbb8f9
Merge pull request #2493 from kugelfuhr/kugelfuhr/fix-1663
Fix issue #1663.
2024-09-01 18:07:14 +02:00
Bob Andrews
601deab3a2
Merge pull request #2492 from kugelfuhr/kugelfuhr/alternative-pragma-names
Allow alternative names for pragmas that contain underlines instead of dashes
2024-09-01 17:57:38 +02:00
Bob Andrews
4b38974918
Merge pull request #2496 from kugelfuhr/kugelfuhr/fix-2458
Fix macro preprocessing for #include
2024-09-01 17:54:36 +02:00
Bob Andrews
8c1047529f
Merge pull request #2497 from kugelfuhr/kugelfuhr/fix-2044
Fix issue #2044
2024-09-01 17:48:45 +02:00
Kugel Fuhr
b4aef6eac4 Fix macro preprocessing for #include. Arguments enclosed in "" or <> must not
be preprocessed. See ISO/IEC 9899 1990 (E) section 6.8.2.
2024-09-01 13:16:35 +02:00
Kugel Fuhr
b5cc68d6e2 Do not save any register variables when entering main(). Do not restore the C
stack when leaving main(). Both are unnecessary and just bloat the executable.
2024-09-01 12:41:25 +02:00
Kugel Fuhr
4b68d19993 Fix issue #1663. 2024-09-01 10:42:18 +02:00
Kugel Fuhr
35c3fe5d0a Fix issue #2044. While doing so, cleanup copy&pasted code. 2024-09-01 10:29:59 +02:00
Kugel Fuhr
ef17250c64 Fixed a compiler warning. 2024-09-01 10:26:45 +02:00
Kugel Fuhr
e40058257e Added a test for the available #pragmas. 2024-09-01 10:23:29 +02:00
Kugel Fuhr
4008ec5814 Document the new #pragma names. 2024-09-01 10:23:10 +02:00
Kugel Fuhr
ba263d13a7 Allow alternative #pragma names using underscores. 2024-09-01 10:22:57 +02:00
Kugel Fuhr
58b1c21996 Removed #pragma names that have been obsolete for over a decade. 2024-09-01 10:22:40 +02:00
Colin Leroy-Mira
622793e343 Apple II: Move _exit out of STARTUP segment 2024-08-25 22:14:45 +02:00
Sven Michael Klose
3f618d7de9 Add Plus/4 wrapper for KERNAL's GETIN. 2024-08-18 21:57:06 +02:00
Bob Andrews
b688cfa0c0
Merge pull request #2480 from polluks/patch-9
Added company name and notice
2024-08-11 01:16:38 +02:00
Bob Andrews
b86ac99982
Merge pull request #2479 from polluks/patch-8
Fixed README.md
2024-08-11 01:15:43 +02:00
Stefan
86611f1c9c
Some clarification 2024-08-10 15:29:50 +02:00
Stefan
bf2b522478
Added company name and warning 2024-08-10 15:12:34 +02:00
Stefan
0126b34d20
Fixed README.md
Oric was not a company.
2024-08-10 14:53:29 +02:00
Oliver Schmidt
feb5026823
Added option to disable the force-to-uppercase behavior of the apple2 target. (#2474)
* Added option to disable the force-to-uppercase behavior of the apple2 target.

* Fixed dangling spaces.
2024-08-07 18:27:09 +02:00
Bob Andrews
925a589b90
Merge pull request #2467 from SvenMichaelKlose/updated_readme
Updated readme
2024-07-28 16:08:28 +02:00
Bob Andrews
8b3625847d
Merge pull request #2466 from SvenMichaelKlose/reformatted_doc_contributing
Make document human-readable and split out name clashes section.
2024-07-28 15:56:58 +02:00
Bob Andrews
91f908f55a
Merge pull request #2468 from karrika/fix-joystick
Fixed #2459
2024-07-28 15:49:42 +02:00
Sven Michael Klose
8a1e060b13 Fix function comment example.
Must be on its own line.
2024-07-22 23:51:16 +02:00
karri
2ea216a521 Merge branch 'fix-joystick' of ssh://github/karrika/cc65 into fix-joystick 2024-07-20 13:18:16 +03:00
karri
19899022af Add support for different joysticks 2024-07-20 13:14:22 +03:00
Sven Michael Klose
d5fecbf10b Add project origin and people and table of supported targets.
Vital information that shouldn't require following links.
2024-07-18 11:24:36 +02:00
Sven Michael Klose
d3e0f7b392 Make document human-readable and split out name clashes section.
In hope to reduce the pull request comment ping-pong.
2024-07-18 10:00:16 +02:00
Bob Andrews
03d824e13b
Merge pull request #2464 from SvenMichaelKlose/stpcpy
Add stpcpy().
2024-07-16 01:47:11 +02:00
Sven Michael Klose
aed94d2dae Fix code style.
Have type, function name and argument declaration on a single line.
2024-07-16 01:33:48 +02:00
Bob Andrews
6551d455b1
Merge pull request #2463 from SvenMichaelKlose/test_strtok
Test strtok().
2024-07-15 22:56:10 +02:00
Sven Michael Klose
677cd8ff4e Use standard library's exit() code constants. 2024-07-15 17:54:43 +02:00
Sven Michael Klose
9558ebad62 Add test for stpcpy(). 2024-07-15 17:35:28 +02:00
Sven Michael Klose
816bcabe5a Move strtok() test to correct section. 2024-07-14 23:12:59 +02:00
Sven Michael Klose
c385e52c12 Merge branch 'master' into test_strtok 2024-07-14 13:59:18 +02:00
Bob Andrews
1d1dd425c1
Merge pull request #2448 from Commodore64128/master
Commander X16 640x480 tgi loadable graphics driver
2024-07-12 12:40:43 +02:00
Sven Michael Klose
af3ac42373 Move stpcpy() to non-standard section. 2024-07-07 19:48:44 +02:00
Sven Michael Klose
581b79e0b9 Add stpcpy().
Like strcpy() but returning pointer to ending zero of copied string.
2024-07-07 14:04:49 +02:00
Bob Andrews
2f25b18074
Merge pull request #2462 from SvenMichaelKlose/gcc14_make_test_fix
Keep gcc-14 from aborting with errors due to new defaults.
2024-07-07 13:49:45 +02:00
Sven Michael Klose
cdb2d49e3a Test strtok(). 2024-07-07 01:02:32 +02:00
Sven Michael Klose
871bafa5b3 Keep gcc-14 from aborting with errors due to new defaults.
Adds -Wno-error=implicit-int -Wno-error=int-conversion to CFLAGS.

Tested with gcc-12.4 and gcc-14.1.
2024-07-07 00:48:15 +02:00
Bob Andrews
0541b65aa4
Merge pull request #2434 from colinleroy/strcasestr
Implement strcasestr
2024-06-22 15:00:17 +02:00
xlar54
3d5fd0489e replaced constant 2024-06-19 23:52:25 -05:00
xlar54
3b494ad6f2 alignment fixes 2024-06-19 23:50:54 -05:00
xlar54
6098ac2788 fix for getdefpalette 2024-06-16 16:06:38 -05:00
xlar54
6dbf5f528a argh dangling spaces 2024-06-16 14:51:53 -05:00
xlar54
5caed9a15f fixed setpalette 2024-06-16 14:46:00 -05:00
Bob Andrews
db178e55fe
Merge pull request #2450 from ops/plus4-c16-asm
Add asm config for C16 and Plus/4
2024-06-16 19:06:51 +02:00
Olli Savia
4989ce485c Build hello-asm.s on C16 & Plus/4 2024-06-16 19:15:54 +03:00
Olli Savia
64cfb322cc Added asm configs for C16 & Plus/4 2024-06-16 19:14:24 +03:00
Bob Andrews
35d638cb09
Merge pull request #2447 from ops/helloworld
Add sample assembly program for Commodore machines
2024-06-16 16:05:54 +02:00
Olli Savia
a1ca451e69 Renamed: hello.s -> hello-asm.s 2024-06-16 09:35:44 +03:00
xlar54
550f94b773 make setpalette return error 2024-06-13 23:13:05 -05:00
xlar54
60f9081ea4 some comment alignment 2024-06-13 21:40:51 -05:00
xlar54
0837f9c25f spaces 2024-06-13 21:29:37 -05:00
xlar54
b7f4c17460 dangling spaces 2024-06-13 21:23:50 -05:00
xlar54
d24a8d7e61 fixed newline 2024-06-13 21:09:02 -05:00
xlar54
ff5091202f docs 2024-06-13 21:00:40 -05:00
Olli Savia
5976e3b85d Add sample assembly program for Commodore machines 2024-06-13 16:22:42 +03:00
xlar54
91cdc0d705 removed unneeded code 2024-06-12 16:45:24 -05:00
xlar54
2c4aca43df fixed some text alignment 2024-06-12 16:40:23 -05:00
xlar54
3ea0ded65d initial 2024-06-12 16:23:30 -05:00
mrdudz
2c4d4d3314 add -j2 to make test invocations 2024-05-16 18:57:29 +02:00
mrdudz
86e5acd679 fix race condition as proposed in #2420 2024-05-16 18:57:08 +02:00
Bob Andrews
84153e809e
Merge pull request #2438 from ops/exehdr
Add missing EXEHDR
2024-05-15 14:11:08 +02:00
Bob Andrews
90723d7dd1
Merge pull request #2132 from vrubleg/ulabel
Add support of unnamed labels with @ (.localchar) prefix
2024-05-14 20:10:06 +02:00
Bob Andrews
b1e1c13d4b
Merge pull request #2437 from bbbradsmith/sim65-examples
provide simple examples for using sim65 with C and assembly code
2024-04-25 23:52:08 +02:00
Colin Leroy-Mira
793aa48a49 Add doc 2024-04-19 08:13:41 +02:00
Colin Leroy-Mira
a823d90082 Separated versions 2024-04-19 07:57:47 +02:00
bbbradsmith
8804dc7a58 give cl65 alternative 2024-04-16 16:56:13 -04:00
bbbradsmith
4bc726ebe2 clarify the meaning of the exit code unsigned limitation 2024-04-16 16:41:00 -04:00
bbbradsmith
fa1a426c29 add -t sim6502 to cc65 and ca65 examples 2024-04-16 14:06:45 -04:00
Evgeny Vrublevsky
f789316f86 Add a test for the unnamed labels. 2024-04-07 13:34:49 +03:00
Evgeny Vrublevsky
270f3544b5 Document changes in unnamed labels. 2024-04-07 13:34:48 +03:00
Evgeny Vrublevsky
c500cb9086 Add support of unnamed labels with @ (.localchar) prefix. 2024-04-07 13:34:48 +03:00
Olli Savia
074ec82126 Added missing EXEHDR 2024-04-02 19:25:15 +03:00
bbbradsmith
89b709c7f8 make it clearer that explicit lib is required, note that exit is from stdlib.h, exit codes are unsigned, tweak "see below" for spacing, clarify that assembly can be used with C tests as well 2024-03-28 16:55:55 -04:00
bbbradsmith
79585194e6 provide simple examples for using sim65 with C and assembly code 2024-03-28 16:33:20 -04:00
Colin Leroy-Mira
71d82ab5d9 Use common naming scheme for tolowerdirect 2024-03-22 17:19:26 +01:00
Colin Leroy-Mira
0c681b42ef Factorize to save 20 bytes 2024-03-19 18:07:17 +01:00
paul moore
9b5d11abde fix blank lines 2024-03-18 16:08:13 -07:00
paul moore
1f1f2c5a68 move options, add doc 2024-03-18 16:04:49 -07:00
paul moore
eb2acfc3e4 move options, add doc 2024-03-18 15:58:00 -07:00
Colin Leroy-Mira
b5d259bafb Implement strcasestr as part of strstr 2024-03-18 19:52:04 +01:00
Colin Leroy-Mira
82165c1a77 Implement strcasestr 2024-03-18 19:51:50 +01:00
mrdudz
b993d88339 second half of #2420 - don't use the loop macro. Fixes -j13 for me 2024-03-17 17:19:42 +01:00
Bob Andrews
25967e65b5
Merge pull request #2424 from acqn/Cleanup
[cc65] Cleanups in src/cc65/declare.c
2024-03-10 02:39:14 +01:00
Bob Andrews
a372ead4de
Merge pull request #2334 from carlo-bramini/fix-sim65-1
[SIM65] Support undocumented opcodes for 6502
2024-03-10 00:37:18 +01:00
Bob Andrews
081d18f7d7
Merge pull request #2422 from acqn/SubFix
[cc65] Fixed potential errors with subtraction evaluation of identifiers at different memory locations
2024-03-09 13:02:27 +01:00
Bob Andrews
a293920fb3
Merge pull request #2423 from acqn/BitfieldFix
[cc65] Fixed the error recovery integer type used for bit-fields
2024-03-09 12:05:20 +01:00
Bob Andrews
60c75bdb54
Merge pull request #2414 from SvenMichaelKlose/master
vic-asm.cfg: Fix size of MAIN to end at $1E00.
2024-03-09 12:00:42 +01:00
Sven Michael Klose
1fe12f112e
Merge branch 'cc65:master' into master 2024-03-08 17:41:06 +01:00
Sven Michael Klose
a887b29ffb Revert "Test strtok()."
This reverts commit 3a7bd53956.
2024-03-05 07:04:59 +01:00
acqn
731f349b24 Removed ParamTypeCvt(). 2024-02-29 18:24:22 +08:00
acqn
98767741ce Reorganized stuff in src/cc65/declare.c. 2024-02-29 18:24:22 +08:00
acqn
9b2d27d1e1 Fixed the error recovery integer type used for bit-fields. 2024-02-29 18:23:04 +08:00
acqn
23aa562094 Fixed potential errors with subtraction evaluation of identifiers at different memory locations. 2024-02-24 15:34:38 +08:00
Bob Andrews
5c3ff714ae
Merge pull request #2415 from polluks/patch-13
[grc65] Fixed segv of empty resource file
2024-02-23 16:16:46 +01:00
Colin Leroy-Mira
86317711e0 IIgs SCC: Rework branches to X-indexed variables
and general cleanup/commenting
2024-02-23 01:20:47 +01:00
Colin Leroy-Mira
8b71fafb84 IIgs SCC: Allow choosing 115200bps as the card allows it
Of course, that won't work full speed with the standard
IRQ-based RX. But that will allow users to setup the port
at this speed without duplicating the setup part of the
code. Up to them to add hooks to disable IRQs and read
directly in a tight asm loop.
2024-02-23 01:20:47 +01:00
Colin Leroy-Mira
3fd78208ba Disable IRQ if opening at 115200 bps 2024-02-19 19:31:47 +01:00
Colin Leroy-Mira
7a12399b39 Allow choosing 115200bps as the card allows it
Of course, that won't work full speed with the
standard IRQ-based RX. But that will allow users
to setup the port at this speed without duplicating
the setup part of the code. Up to them to add hooks
to disable IRQs and read directly in a tight asm
loop.
2024-02-19 19:31:47 +01:00
rumbledethumps
4d3153e10e add rp6502 xregn 2024-02-17 16:02:57 -08:00
rumbledethumps
f42e6a26b2 xstack bump to 512 2024-02-17 15:47:51 -08:00
rumbledethumps
b8b263b38c
Merge branch 'cc65:master' into master 2024-02-17 14:54:12 -08:00
Sven Michael Klose
294b034920 Add configuration files for expanded VICs. 2024-02-15 17:32:44 +01:00
Stefan
ab0eb4fe58
oops 2024-02-15 09:03:46 +01:00
Stefan
8d4946b3f4
Fixed segv
touch /tmp/xx
grc65 /tmp/xx
2024-02-15 07:52:42 +01:00
Sven Michael Klose
3a7bd53956 Test strtok(). 2024-02-15 01:05:35 +01:00
Sven Michael Klose
8173c850fd Fix size of MAIN to end at $1E00.
Caused negative size of MAIN in cc65-contrib/quikmans2k8.
2024-02-15 00:00:46 +01:00
Bob Andrews
4bde3afd80
Merge pull request #2410 from alexthissen/serial
Improvements and fixes in serial support for Atari Lynx
2024-02-12 12:50:02 +01:00
Alex Thissen
7d6f3d24d4 Changed sta (ptr1,x) to sta (ptr1)
Reset serial status on ser_close
Fixed error for saving serial state
2024-02-11 23:12:27 +00:00
Alex Thissen
8b172e05bc Applied optimization as per review 42Bastian 2024-02-11 20:59:08 +00:00
Alex Thissen
1deb9e52ae Replaced last literal value for SERCTL 2024-02-11 15:46:23 +00:00
Alex Thissen
acff429eb8 Added redeye check for SER_HS_SW handshake 2024-02-11 15:33:22 +00:00
Alex Thissen
6cf8ee8eb5 Removed baud rates from 150 and lower.
Fixed tab
Replaced uploader references to SERIAL_INTERRUPT
2024-02-10 23:19:05 +00:00
Alex Thissen
65bce9ecde Implemented mark and space checks. 2024-02-10 23:19:04 +00:00
Alex Thissen
014f85f226 Fixed baud rates 2024-02-10 23:19:04 +00:00
Alex Thissen
788ae82d30 Fixes to serial driver implementation 2024-02-10 23:19:02 +00:00
Carlo Bramini
b04d79b1da [SIM65] Support undocumented opcodes for 6502
This PR is mostly a complete rewrite of the emulator for 6502/65c02 opcodes.
It provides an easier to maintain implementation of the instructions, by using few macros rather than having hand-written code for each function.
All undocumented, previously missing opcodes for 6502 are also implemented.
The patch also includes a detailed documentation of those opcodes, for reference to developers.
This PR should fix one of the milestones listed here for the next version of CC65:

https://github.com/cc65/wiki/wiki/Before-the-next-release
2024-02-08 12:13:17 +01:00
rumbledethumps
7b790cf883 add RIA_OP_CLOCK to asm inc 2024-02-04 23:38:44 -08:00
mrdudz
3dfe033000 update actions/upload-artifact@v3->actions/upload-artifact@v4, actions/cache@v3->actions/cache@v4 2024-02-03 17:02:08 +01:00
mrdudz
5acfb02794 update actions/checkout@v3 -> actions/checkout@v4 and microsoft/setup-msbuild@v1.1 -> microsoft/setup-msbuild@v2. lets see what happens :) 2024-02-03 16:20:17 +01:00
mrdudz
934de685bc this is pr #2194 - removed ramfont.o 2024-02-03 01:34:21 +01:00
Bob Andrews
ce14f0f8ad
Merge pull request #2401 from colinleroy/enabled-windows-tests-on-PR
Enable Windows tests on pull requests
2024-02-02 21:59:09 +01:00
Bob Andrews
a06431a8f9
Merge pull request #2402 from colinleroy/a-bit-of-65c02-optimisations
a BIT of 65C02 optimisations
2024-02-02 21:58:04 +01:00
Bob Andrews
eb503cc542
Merge pull request #2390 from colinleroy/implement-shifts-by-7
Implement aslax7/shlax7/asrax7/shrax7
2024-02-02 20:17:48 +01:00
Colin Leroy-Mira
1fab179cb4 a BIT of 65C02 optimisations
Use BIT immediate instead of AND when reloading A is required
afterwards.
Add an fread unit test as the optimisation touches fread.
Sprinkle a few zero page indexed while we're at it.
2024-02-02 19:45:49 +01:00
Colin Leroy-Mira
c4c6967e4a Enable Windows tests on pull requests 2024-02-02 19:45:17 +01:00
Bob Andrews
2a03e5d8c9
Merge pull request #2392 from colinleroy/asm-fputc-fputs
Asm fputc fputs
2024-02-02 19:41:23 +01:00
Bob Andrews
128f261c3a
Merge pull request #2389 from colinleroy/fix-2388
Fix #2388
2024-02-02 18:25:39 +01:00
Bob Andrews
d5c84e7828
Merge pull request #2398 from acqn/OptFix
[cc65] Fixed optimization for char-size bitwise XOR/OR/AND when the rhs operand is complicated
2024-02-02 17:20:31 +01:00
Bob Andrews
54b423a99e
fix test 2024-02-02 13:13:57 +01:00
acqn
96d55e3703 Fixed optimization for char-size bitwise XOR/OR/AND when the rhs operand is complicated. 2024-02-02 19:00:33 +08:00
Bob Andrews
a7ac9b7ef2
Merge pull request #2397 from colinleroy/bug-2395-test
Add test case for issue #2395
2024-02-01 23:09:12 +01:00
Colin Leroy-Mira
1e300bf768 Add test case for issue #2395 2024-02-01 22:06:56 +01:00
Colin Leroy-Mira
ce606bb19e Fix tests... 2024-01-31 08:40:36 +01:00
Colin Leroy-Mira
afd8ee627e Remove useless branching code in fgets 2024-01-30 19:52:48 +01:00
Colin Leroy-Mira
2b97735d5d Factorize file pointer check 2024-01-30 19:40:28 +01:00
Colin Leroy-Mira
1a5a7d67a7 Rewrite fputc in assembly
-36 bytes, -12% cycles
2024-01-30 17:19:13 +01:00
Colin Leroy-Mira
ba36071022 Rewrite fputs in assembly
-28 bytes, -1% cycles
2024-01-30 17:12:52 +01:00
Colin Leroy-Mira
7594af553a Fix #2388
Reopen stdin in binary mode instead of closing/opening
2024-01-30 09:39:44 +01:00
rumbledethumps
9ffa2d05e6 rp6502 validate write_xstack count 2024-01-30 00:17:28 -08:00
rumbledethumps
dd95d20268
Merge branch 'cc65:master' into master 2024-01-29 08:45:56 -08:00
Colin Leroy-Mira
7d7cf2d1e0 Implement aslax7/shlax7/asrax7/shrax7 2024-01-29 07:59:11 +01:00
Bob Andrews
51b946bf25
Merge pull request #2387 from colinleroy/sim65-implement-remove
Implement __sysremove for sim65
2024-01-28 16:53:29 +01:00
Colin Leroy-Mira
0dd7b0c3a5 Implement __sysremove for sim65
This will allow using unlink()/remove() in sim65 programs
Use it to unlink fgets' test output file
2024-01-28 13:58:57 +01:00
Bob Andrews
8682095f9f
Merge pull request #2384 from colinleroy/asm-realloc
Rewrite realloc in asm
2024-01-27 00:28:17 +01:00
Bob Andrews
782dad23da
Merge pull request #2382 from colinleroy/asm-gets
Rewrite gets in asm
2024-01-27 00:26:12 +01:00
Colin Leroy-Mira
aa6f850b8d Rewrite gets in assembler
+19 bytes if used alone, because it pulls in fgets, but as code is
factorized, -128 bytes in programs using both fgets and gets.
2024-01-26 20:29:17 +01:00
Colin Leroy-Mira
a8b870555e Rewrite realloc in asm
-80 bytes, -39% cycles
2024-01-26 20:25:59 +01:00
Bob Andrews
65937684a0
Merge pull request #2380 from colinleroy/asm-fgetc
Rewrite fgetc in asm
2024-01-26 20:12:41 +01:00
Bob Andrews
ba6f9f5d3f
Merge pull request #2381 from colinleroy/asm-fgets
Rewrite fgets in asm
2024-01-26 19:36:57 +01:00
Bob Andrews
4b9bf9bb98
Merge pull request #2386 from polluks/patch-12
Added link for your interest
2024-01-25 14:36:51 +01:00
Stefan
f1d95f1f07
Added link for your interest 2024-01-25 11:27:54 +01:00
Colin Leroy-Mira
476591e8b7 Rewrite fgetc in asm
-82 bytes, -20% cycles
2024-01-25 09:13:39 +01:00
Colin Leroy-Mira
f7388cfb79 add fgets/fgetc test 2024-01-25 09:13:35 +01:00
Bob Andrews
ee3a542539
Merge pull request #2383 from colinleroy/pmemalign-size-opt
Optimize -36 bytes out of posix_memalign
2024-01-24 21:26:50 +01:00
Bob Andrews
a2d722639f
Merge pull request #2385 from polluks/master
Fixed comment
2024-01-24 21:17:19 +01:00
Bob Andrews
9ba270d97b
Merge pull request #2378 from colinleroy/fix-overflow-in-malloc-and-realloc
Fix malloc and realloc overflow
2024-01-24 21:15:31 +01:00
Stefan
34f37c873e
Fixed comment 2024-01-24 16:32:45 +01:00
Bob Andrews
ebf43ddb05
Merge pull request #2379 from colinleroy/add-return-minus-1-helper
add a return -1 helper
2024-01-24 15:53:19 +01:00
Colin Leroy-Mira
f0b5b02966 Swap in LC before destructors, ROM after 2024-01-24 12:28:57 +01:00
Colin Leroy-Mira
b87df9e1c6 Optimize -36 bytes out of posix_memalign
And add a unit test
2024-01-24 10:23:53 +01:00
Colin Leroy-Mira
1f820d0ae8 Rewrite fgets in asm
-104 bytes, -1% cycles
2024-01-24 10:16:26 +01:00
Colin Leroy-Mira
5d49fde788 add a return -1 helper 2024-01-24 09:58:09 +01:00
Colin Leroy-Mira
3e01ac9b04 Fix malloc and realloc overflow
If user requests a size >= 65532, adding the heap admin size
overflows size. Fixes #2358.
2024-01-24 09:54:54 +01:00
Bob Andrews
57e65a6bf6
Merge pull request #2348 from colinleroy/time-functions-pass-2
Convert more time functions to asm
2024-01-23 23:45:10 +01:00
Bob Andrews
13ddd734db
Add note about contacting the devs when starting to work on huge patches 2024-01-23 23:26:26 +01:00
Colin Leroy-Mira
2ba176372e Add beep for apple2 2024-01-23 23:04:50 +01:00
Bob Andrews
6c7106c9d9
Merge pull request #2377 from acqn/Diagnostics
[cc65] Diagnosis improvements
2024-01-23 22:16:35 +01:00
Bob Andrews
ea83b9fa53
Merge pull request #2347 from acqn/SrcFile
[cc65] fixes and enhancements for source file info in diagnosis and debug output
2024-01-23 22:15:31 +01:00
acqn
ba75a2ac26 Added missing checks for forward declarations of the main() function.
More accurate diagnosis on implicit 'int' type specifiers.
2024-01-23 14:33:05 +08:00
Bob Andrews
bea2e86210
Merge pull request #2354 from acqn/Diagnostics
[cc65] Improved diagnosis
2024-01-22 19:09:51 +01:00
Bob Andrews
998dfd6fa7
Merge pull request #2370 from acqn/VisibilityFix
[cc65] Fixed visibility of undeclared functions and objects
2024-01-22 18:31:47 +01:00
Bob Andrews
deaf27d6a8
Merge pull request #2372 from acqn/C99Inline
[cc65] Added primitive support for the ISO C99 inline feature as well as the __inline__ extension
2024-01-22 17:30:09 +01:00
Colin Leroy-Mira
01ee903cdf Fixup gmtime/localtime/mktime tests with all cases 2024-01-22 16:38:39 +01:00
Bob Andrews
7a7e98d799
Merge pull request #2371 from alexthissen/lynx-upload
Lynx upload fixes for IRQ and configuration
2024-01-22 15:50:40 +01:00
Bob Andrews
6a03fda453
Merge pull request #2374 from colinleroy/save-two-bytes
Save two cycles in pushax and popptr1
2024-01-22 15:48:49 +01:00
Colin Leroy-Mira
b23a7ec407 Save two bytes in pushax and popptr1
It's not because Y must equal zero on rts that we should'nt spare one byte
and one cycle.
2024-01-19 21:14:47 +01:00
Alex Thissen
83691f30c1 Missed a tab in config 2024-01-19 10:52:42 +00:00
Alex Thissen
6bab3f921b
Merge branch 'cc65:master' into lynx-upload 2024-01-19 09:49:20 +01:00
Alex Thissen
ad90a3a421 Replaced references to __BLOCKSIZE__ with __BANK0BLOCKSIZE__ 2024-01-18 18:57:57 +00:00
Bob Andrews
a173428fab
Merge pull request #2367 from acqn/PragmaFix
[cc65] Fixed segname pragmas right after a function definition
2024-01-18 18:44:39 +01:00
Alex Thissen
2e56dcc521 Fix for mising import 2024-01-18 18:13:39 +01:00
Alex Thissen
acce24fedc Switched to __BANK0BLOCKSIZE__ instead of __BLOCKSIZE__ to make current lynx config files work 2024-01-18 18:13:02 +01:00
Alex Thissen
93f9cb6e48 Adjusted uploader configuration. Split into two MEMORY areas, so it can be just below video memory. 2024-01-18 18:06:10 +01:00
Alex Thissen
d906748691 Fix uploader implementation to reset IRQ bit for timer 4 (serial) interrupt 2024-01-18 17:37:09 +01:00
Colin Leroy-Mira
166a4b25f7 Apple2: implement sleep using MONWAIT
Also publish detect_iigs(), set_iigs_speed() and get_iigs_speed(). Refactor to only store one ostype variable.
2024-01-18 16:17:10 +01:00
acqn
9471e128b5 Fixed segname pragmas right after a function definition. 2024-01-18 20:59:46 +08:00
Colin Leroy-Mira
10282a9b74 Rewrite asctime() in assembler (-7 bytes) 2024-01-18 09:09:38 +01:00
Colin Leroy-Mira
03d5e5fba0 Rewrite mktime in assembly
-415 bytes,
-39% cycles,
Unit test expanded to cover more cases (there was a bug in 2100 before!)
2024-01-18 09:09:38 +01:00
Colin Leroy-Mira
348a9048b7 Convert _time_t_to_tm to asm
46 bytes size gain, -8% cycles on the unit tests
2024-01-18 09:09:31 +01:00
Bob Andrews
92ee03f9e9
Merge pull request #2362 from colinleroy/fix-2357-bis
Add test case for bug #2357
2024-01-16 21:08:38 +01:00
Colin Leroy-Mira
0c53e7e0da Add test case for bug #2357 2024-01-16 20:55:48 +01:00
Bob Andrews
5e267ccfca
Merge pull request #2361 from colinleroy/fix-2357-bis
Cleaner instruction updating for long opt
2024-01-16 20:26:05 +01:00
Colin Leroy-Mira
db8ac355cb Cleaner updating of instructions 2024-01-16 09:33:33 +01:00
Colin Leroy-Mira
dec65176f0 Fix #2357 - Copy est.size and flags of op when moving it 2024-01-16 08:45:20 +01:00
Bob Andrews
43c2239e94
Merge pull request #2360 from cc65/revert-2359-fix-2357
Revert "Fix #2357 - Copy est.size and flags of op when moving it"
2024-01-15 23:04:35 +01:00
Bob Andrews
2c4ebe812c
Revert "Fix #2357 - Copy est.size and flags of op when moving it" 2024-01-15 23:03:13 +01:00
Bob Andrews
8e25a7b376
Merge pull request #2359 from colinleroy/fix-2357
Fix #2357 - Copy est.size and flags of op when moving it
2024-01-15 23:00:09 +01:00
Colin Leroy-Mira
b388ca0236 Fix #2357 - Copy est.size and flags of op when moving it 2024-01-15 21:51:17 +01:00
acqn
e9bd9330c0 Added warning on some code patterns of faulty attempt to declare anonymous structs/unions.
Removed unnecessary warning on tagless enum/struct/unions that would be invisible out of a function declaration.
2024-01-15 23:56:42 +08:00
acqn
07e349c517 Skipped anonymous tag names in diagnosis on empty structs/unions. 2024-01-15 23:56:39 +08:00
acqn
afdf398a0b Fixed repeated diagnosis when reading EOF in certain cases. 2024-01-15 23:56:11 +08:00
rumbledethumps
cf28d69696
Merge branch 'cc65:master' into master 2024-01-14 17:40:09 -08:00
acqn
de3087a7e9 Removed the extra "unused parameter" warning when the parameter had an duplicated identifier error. 2024-01-14 00:19:11 +08:00
acqn
0b06c34dfc Added primitive support for the ISO C99 inline feature as well as the __inline__ extension.
No inlining is actually done but that part is not required by the standard.
2024-01-14 00:08:41 +08:00
acqn
7e80e55b6d Added a warning on implicit int in typedefs. 2024-01-13 16:40:44 +08:00
acqn
3d0dc58153 Fixed visibility of undeclared functions and objects. 2024-01-13 00:46:14 +08:00
Bob Andrews
8c329dfd1a
Merge pull request #2344 from acqn/Cleanup
[cc65] Cleanup for symbol types and flags
2024-01-12 16:02:08 +01:00
Bob Andrews
0f7d2dd818
Merge pull request #2351 from groessler/something_to_pull
mention John Dunning as original author
2024-01-11 19:46:16 +01:00
Christian Groessler
6ab3c0c75f elaborate more about Uz's contributions 2024-01-11 19:40:41 +01:00
Christian Groessler
44b2e48e3e mention John Dunning as original author 2024-01-11 17:41:17 +01:00
Bob Andrews
28f892bb3c
Merge pull request #2345 from acqn/PtrFix
[cc65] Fixed regression on comparison to null pointer
2024-01-11 16:50:49 +01:00
Bob Andrews
17c2622382
Merge pull request #2346 from acqn/Diagnostics
[cc65] Diagnosis fixes
2024-01-11 16:49:36 +01:00
rumbledethumps
2138f3c902 add clock() to RP6502 2024-01-10 21:24:55 -08:00
acqn
38dac907e8 Cleanup for symbol types and flags. 2024-01-10 04:51:59 +08:00
acqn
2682fc0b79 Fixed regression on comparison to null pointer. 2024-01-10 04:51:20 +08:00
acqn
8e43c4706f Added hierarchy info about source file inclusion in diagnostic output.
Fixed presumed names of source files in disgnosis.
Fixed line number of source files in debug output.
2024-01-10 04:50:42 +08:00
acqn
94dfc08c0e Fixed false "Non constant initializers" error messages on wrong places, which could be resulted from failed array declarations etc. 2024-01-10 04:43:50 +08:00
acqn
2564aaa12c Refix for diagnosis on expected expressions. 2024-01-10 04:48:27 +08:00
Bob Andrews
8aa59e4af3
Merge pull request #2325 from acqn/Cleanup
[cc65] Cleanups
2024-01-08 23:02:40 +01:00
Bob Andrews
773ed23cea
Merge pull request #2326 from acqn/Diagnostics
[cc65] Diagnostics
2024-01-08 22:45:44 +01:00
Bob Andrews
2127778239
Merge pull request #2336 from colinleroy/optimize-strdup
Optimize strdup
2024-01-08 22:13:43 +01:00
Bob Andrews
e1065d0c89
Merge pull request #2342 from colinleroy/rework-mktime
Rework time functions a bit
2024-01-08 22:13:05 +01:00
Bob Andrews
1e3b063b4a
Merge pull request #2320 from pm100/cl65_type
bug 2319 - dont allow -t after input files given
2024-01-08 21:59:21 +01:00
Bob Andrews
a71865f6ec
Merge pull request #2331 from acqn/FuncDeclFix
[cc65] Fixed calling convention parsing in type names and function parameter types
2024-01-08 21:58:01 +01:00
Bob Andrews
fa7dca5fa3
Merge pull request #2338 from colinleroy/fix-2237-keep-time-h-standard
Remove non-standard (and useless) include
2024-01-08 21:52:40 +01:00
Colin Leroy-Mira
df193c0947 Rework time functions a bit
- mktime: Work unsigned as time_t's type implies (shifting Y2K38 bug to 2106)
- mktime: Add unit tests
- gmtime/localtime: factorize
- gmtime/localtime: Add unit tests
- mktime/gmtime/localtime: Size optimisation (-130 bytes wrt master)
- mktime: Speed optimisation (from 23M cycles on the unit test to 2M)
2024-01-08 18:24:13 +01:00
Colin Leroy-Mira
3a439e0e1b Little strdup optimisation
-12 bytes on disk
-20 cycles per strdup
-6 cycles per strlen called from strdup
2024-01-07 14:25:06 +01:00
Colin Leroy-Mira
7ce982cc68 Remove non-standard (and useless) include
Fixes #2337
2024-01-07 10:21:05 +01:00
mrdudz
29801a2fde remove extra format specifier, fixed #2330 2024-01-06 17:53:24 +01:00
Bob Andrews
82f01af6ec
Merge pull request #2333 from polluks/patch-11
Update README.md for new target
2024-01-06 17:41:39 +01:00
Bob Andrews
c379d03dfb
Merge pull request #2332 from polluks/patch-10
Clean-up
2024-01-06 17:40:58 +01:00
Colin Leroy-Mira
169c9c0da0 Add strdup tests 2024-01-05 22:26:06 +01:00
Bob Andrews
1b5371b42d
Merge pull request #2335 from jedeoric/master
Add routine identifier for Telestrat target
2024-01-05 11:07:16 +01:00
jedeoric
bcea5dfa8f
fix comment telestrat 2024-01-05 00:46:15 +01:00
jedeoric
726b70a534
add XMAINARGS and XGETARGV for Telestrat 2024-01-05 00:45:03 +01:00
Stefan
dc9d2f0dbd
Update README.md 2024-01-03 16:46:07 +01:00
Stefan
075ece5faf
Clean-up
void is always fast
2024-01-03 16:35:12 +01:00
Colin Leroy-Mira
75461e1319 Apple2: implement stat(2) and statvfs(3) 2024-01-01 19:12:51 +01:00
acqn
7aab84628d Fixed calling convention parsing in type names and function parameter types. 2024-01-01 16:11:30 +08:00
acqn
acbd87b576 Renamed GetUnqualTypeCode() to GetUnderlyingTypeCode() for consistency with GetUnderlyingType(). 2024-01-01 15:27:57 +08:00
acqn
88246f852d Removed RefineFuncDesc() as an unnecessary wrapper. 2024-01-01 15:04:50 +08:00
acqn
4e820677ee ED_AddrExpr() and ED_IndExpr() need no return values. 2024-01-01 15:03:45 +08:00
acqn
0b7d9d8216 Fixed missing calling convention and address size qualifiers in diagnosis on function types. 2024-01-01 14:48:05 +08:00
acqn
f734f43a35 Removed extra 'const' qualifier in array-to-pointer and function-to-pointer conversions. 2024-01-01 14:48:05 +08:00
acqn
f3199e4308 Fixed type name output with K&R-style functions. 2024-01-01 14:48:03 +08:00
Bob Andrews
4343eebe67
Merge pull request #2314 from acqn/PPFix
[cc65] Separated C preprocessor errors from other errors
2023-12-31 19:16:44 +01:00
Bob Andrews
9e3d1e1027
Merge pull request #2309 from acqn/Diagnostics
[cc65] Added warning on static functions that are used but not defined
2023-12-31 19:15:48 +01:00
paul moore
c262929a62 doc cl65 change 2023-12-31 10:14:53 -08:00
Bob Andrews
0ece9449d7
Merge pull request #2307 from acqn/FuncDeclFix
[cc65] Fixed function declarator parser when a parameter has a function type
2023-12-31 19:11:25 +01:00
Bob Andrews
7297d2c8b6
Merge pull request #2310 from pm100/vs64
second try at fixing win64 build
2023-12-31 18:54:23 +01:00
Bob Andrews
d0903ba225
Merge pull request #2311 from bbbradsmith/ca65-struct-doc-clarify
ca65 struct and union documentation improvement and feature testing.
2023-12-31 18:51:09 +01:00
Bob Andrews
98b9814692
Merge pull request #2318 from alexthissen/lynxincludes
Added SPRCTL0 and SPRCTL1  bit definitions for ca65
2023-12-31 18:46:49 +01:00
paul moore
096bd0b633 bug 2319 2023-12-29 17:02:45 -08:00
Alex Thissen
66e354961c Missed some tabs 2023-12-29 22:48:36 +01:00
Alex Thissen
061d907a11 Fixed tabs instead of spaces 2023-12-29 22:46:15 +01:00
Alex Thissen
e5f9def572 Added SPRCTL0 and SPRCTL1 bit definitions for ca65 2023-12-29 22:37:18 +01:00
acqn
b876a6b213 Fixed cc65 exitcode when there are only preprocessor errors. 2023-12-19 19:30:50 +08:00
acqn
cd7c688dff Separated C preprocessor errors from other errors. 2023-12-18 15:30:53 +08:00
bbbradsmith
9892c8f6c4 using less generic names for the example to avoid confusion, adding cautionary example for what I think is the most error prone case 2023-12-17 05:40:00 -05:00
bbbradsmith
302c4f7409 clarify offsets of anonymous nested scope, missing quotes for names 2023-12-17 05:01:06 -05:00
bbbradsmith
0ff1b20f2a nested struct example needs a .tag 2023-12-16 19:52:57 -05:00
bbbradsmith
f6838be162 missing <tt> 2023-12-16 19:32:52 -05:00
bbbradsmith
6cb8717c24 fix dangling space, mention .union in test comment 2023-12-16 19:25:21 -05:00
bbbradsmith
0d74b84ce4 Test of .struct and .union features. Update documentation with more examples, better clarity, and fixes to incorrect data. 2023-12-16 19:18:25 -05:00
paul moore
103d4b82c5 more msbuild syntax fixes 2023-12-14 14:43:58 -08:00
paul moore
269786a5ae fix msbuild syntax 2023-12-14 14:38:24 -08:00
paul moore
08341aae30 second try at fixing win64 build 2023-12-14 14:25:35 -08:00
Colin Leroy-Mira
1093d169ad Fix BSS obliteration by mliparam during exec().
Using mliparam at this time could lead to corruption at the
start of the new executed program if BSS is real full and
mliparam is over $BB00.
The fix is to open the file from the loader stub instead of doing
it before the C library shutdown.
2023-12-14 16:47:33 +01:00
acqn
a5746227dc Added warning on static functions that are used but not defined. 2023-12-14 21:27:48 +08:00
acqn
1e4d1b4311 Fixed function declarator parser when a parameter has a function type.
Ensured check on parameter lists without types in non-definition declarations.
2023-12-14 02:34:03 +08:00
Bob Andrews
05aae60816
Merge pull request #2305 from acqn/FuncDeclFix
[cc65] Fixed missing diagnosis on function parameter lists with trailing commas
2023-12-13 19:17:59 +01:00
acqn
f8fe1d1560 Fixed missing diagnosis on function parameter lists with trailing commas. 2023-12-13 22:57:32 +08:00
Bob Andrews
bc97bce8c1
Merge pull request #2297 from acqn/WrappedCall
[cc65] Fixed wrapped call when the function was defined before its later declaration gets wrapped with the pragma
2023-12-12 17:11:47 +01:00
Bob Andrews
e90e7f46de
Merge pull request #2298 from acqn/Diagnostics
[cc65] More accurate diagnostic messages on empty declarations without any type specifiers
2023-12-12 17:06:54 +01:00
mrdudz
b1c1502494 MS compiler insists on those typecasts apparently 2023-12-11 00:35:07 +01:00
mrdudz
9985ee7f61 fix %hhn and %hn in the internal xvsnprintf function 2023-12-11 00:18:40 +01:00
mrdudz
6b855d562a use -std=gnu17 for the references, so the test bench will not break with GCC 14. see #2277 2023-12-10 23:18:55 +01:00
mrdudz
0b077f561f exclude test directory from some style checks - it makes no sense to enforce these things in the test bench, we need to be able to test all kinds of spaces and tabs :) 2023-12-10 22:43:47 +01:00
Bob Andrews
cc5e9c38ca
Merge pull request #2296 from acqn/Diagnostics
[cc65] Fixed and improved diagnostics regarding type names and declarations
2023-12-10 22:32:33 +01:00
mrdudz
b31a1c7c0c test for regression that occured after #2262 2023-12-10 22:18:59 +01:00
Bob Andrews
9634cc4d1e
Merge pull request #2295 from colinleroy/fix-2262-too-eager-opt
Fix #2262: Make sure there's no branching after the sequence
2023-12-10 19:16:38 +01:00
acqn
befc9533c6 More accurate diagnostic messages on empty declarations without any type specifiers. 2023-12-10 20:21:50 +08:00
acqn
bbd542fac7 Fixed missing diagnosis on extra identifiers in type names. 2023-12-10 17:01:54 +08:00
Colin Leroy-Mira
07c71541f4 Fix #2262: Make sure there's no branching after the sequence
Also better check that arguments match
2023-12-10 09:45:15 +01:00
acqn
3215d377ea More accurate diagnostic messages on wrong missing declaration specifiers. 2023-12-10 15:46:48 +08:00
acqn
cadf8012f6 Improved error recovery with type cast and sizeof. 2023-12-10 15:43:24 +08:00
acqn
a1a060c291 Declaration specifier flags cleanup. 2023-12-10 15:43:24 +08:00
acqn
79b4690077 Fixed missing diagnostics on empty enum/struct/union declareations without tag names.
Improved error recovery with local declarations and _Static_assert.
2023-12-10 15:43:24 +08:00
Bob Andrews
a16a6298e2
Merge pull request #2287 from acqn/Diagnostics
[cc65] Minor diagnostics improvements
2023-12-09 22:16:47 +01:00
Bob Andrews
92f869cdfb
Merge pull request #2288 from acqn/TypeFix
[cc65] Fixed an iteration bug in type composition
2023-12-09 22:15:24 +01:00
Bob Andrews
a956f6f9ed
Merge pull request #2289 from acqn/FuncDeclFix
[cc65] Fixed the issue that qualifiers of pointees of function parameters were ignored for type compatibility check
2023-12-09 22:14:41 +01:00
Bob Andrews
9e19a2e6a3
Merge pull request #2290 from acqn/TestFix
Updated test/misc/Makefile
2023-12-09 22:12:59 +01:00
Bob Andrews
d805211002
Merge pull request #2291 from colinleroy/fix-256-minus-1
Fix bug introduced in #2260
2023-12-09 22:11:33 +01:00
acqn
b66682a05b Fixed wrapped call when the function to wrap has already got defined before it is wrapped with the pragma. 2023-12-10 00:47:10 +08:00
Colin Leroy-Mira
2a2cc6cad6 Fix bug introduced in #2260
bne should have applied to A, not X, but adding a cmp #$00 before
makes the change less optimized than the existing.
2023-12-09 16:43:23 +01:00
acqn
d8e61552be Removed outdated testcases no longer in the directory from test/misc/Makefile. 2023-12-09 18:04:29 +08:00
acqn
d8a722b638 Improved diagnostics on multiple definition of struct/union types. 2023-12-09 17:34:01 +08:00
acqn
87f8893886 Avoided "Variable 'XXX' is defined but never used" error message resulted from an earlier error. 2023-12-09 17:33:46 +08:00
acqn
98ffc031d1 Fixed an iteration bug in type composition. 2023-12-09 14:35:00 +08:00
acqn
b7e7bb7489 Fixed the issue that qualifiers of pointees of function parameters were ignored for type compatibility check. 2023-12-09 14:34:37 +08:00
Bob Andrews
519a52d92c
Merge pull request #2209 from vrubleg/linecont
ca65: `.LINECONT` as a part of `.FEATURE`
2023-12-08 02:10:45 +01:00
Bob Andrews
66bfc31988
Merge pull request #2262 from colinleroy/optimize-long-assign
Optimize static long assignment a bit
2023-12-08 01:58:01 +01:00
Bob Andrews
09735b26c5
Merge pull request #2274 from acqn/UnionFix
[cc65] Fixed initialization of union when it has an anonymous bit-field as the first member declaration
2023-12-08 01:55:06 +01:00
Bob Andrews
c4575ec2c4
Merge pull request #2275 from acqn/BitfieldFix
[cc65] Fixed constness of bit-fields
2023-12-08 01:54:02 +01:00
Bob Andrews
85a15007ec
Merge pull request #2276 from acqn/Diagnostics
[cc65] Fixed diagnostics
2023-12-08 01:53:08 +01:00
paul moore
ac6d43adc9 fix option name 2023-12-03 15:27:49 -08:00
paul moore
c43557d4ed complete first version 2023-12-03 13:58:04 -08:00
paul moore
b527549dd2 fix spaces at end of line 2023-12-03 13:19:42 -08:00
paul moore
617eb0e065 Added repeat support. Added short vs long expansion 2023-12-03 11:59:05 -08:00
paul moore
116f678180 fixed incorrect offsets , cleaned out redundant code 2023-12-02 11:04:25 -08:00
paul moore
d21616ea71 initial commit 2023-12-02 09:16:49 -08:00
paul moore
ca2cf4bf54 forgot to free retport line, remove old code 2023-12-01 16:34:47 -08:00
paul moore
b7af5ac438 fix gcc warning 2023-12-01 16:17:42 -08:00
paul moore
39744f1bde initial commit 2023-12-01 15:40:33 -08:00
Colin Leroy-Mira
63861766e1 Fix Makefile change 2023-12-01 14:22:30 +01:00
Colin Leroy-Mira
d8a3938f2b Optimize a bit static long assignation 2023-12-01 14:20:00 +01:00
acqn
47e7ed2f56 Fixed wrong "Mixed declarations and code are not supported in cc65" error message when it should be "Expression expected". 2023-11-30 00:36:13 +08:00
acqn
c0a2021d9a Fixed endlessly repeated disgnostics when there are some certain patterns of syntax errors in a struct/union declaration. 2023-11-30 00:35:30 +08:00
acqn
6434176909 Fixed constness of bit-fields. 2023-11-29 12:27:01 +08:00
Bob Andrews
5537b61e6a
Merge pull request #2272 from acqn/Diagnostics
[cc65] Improved diagnostics
2023-11-28 15:06:39 +01:00
Bob Andrews
2af16ee82b
Merge pull request #2271 from acqn/InternalFix
[cc65] Fixed assertion failure when there is an undeclared symbol used in a parameter list
2023-11-28 15:03:09 +01:00
Bob Andrews
97cfb8c67a
Merge pull request #2266 from acqn/StructFix
[cc65] Fixes for structs/unions
2023-11-28 15:00:58 +01:00
Bob Andrews
86b09f56a6
Merge pull request #2260 from colinleroy/optimize-substraction
Optimize integer decrements by 1
2023-11-28 14:40:51 +01:00
Bob Andrews
acf159adbc
Merge pull request #2269 from colinleroy/optimize_gt_255
Optimize unsigned int and long > 255
2023-11-28 14:36:39 +01:00
Bob Andrews
ad0b778008
Merge pull request #2265 from acqn/C99Main
[cc65] Enabled implicit "return 0" in C99 standard main function in default cc65 mode
2023-11-28 14:27:55 +01:00
Bob Andrews
7e6399d439
Merge pull request #2268 from picocomputer/master
add rp6502 target
2023-11-27 17:53:43 +01:00
acqn
546be1d5dd Fixed assertion failure when there is an undefined symbol used in a parameter list. 2023-11-27 20:42:50 +08:00
acqn
b99ebc1256 Fixed diagnostic messages about undeclared identifiers. 2023-11-27 20:39:15 +08:00
acqn
7574e36e95 Improved error recovery with function declarations.
Fixed some rare cases when a single file-scope error could get reapeated endlessly until the maximum total count of errors allowed is reached.
2023-11-27 20:39:15 +08:00
acqn
ac04394254 Fixed and improved diagnostics about declaration errors. 2023-11-27 20:39:15 +08:00
acqn
79214530e0 Maximum total count of errors before the compiler unconditionally bails out is now 200.
If more than 20 errors occur on the same source line, the compiler will immediately bail out.
2023-11-27 20:39:15 +08:00
rumbledethumps
3905e43068 style update 2023-11-26 15:12:20 -08:00
Bob Andrews
ab0ab8e36f
Merge pull request #2267 from acqn/Diagnostics
[cc65] Removed extra "'}' expected" error message
2023-11-26 22:14:30 +01:00
Bob Andrews
e6c8f896b0
Merge pull request #2264 from ryandesign/patch-2
Fix typos; other copyediting
2023-11-26 22:06:06 +01:00
Bob Andrews
f95e3a1e49
Merge pull request #2263 from ryandesign/patch-1
Fix typo
2023-11-26 22:05:03 +01:00
rumbledethumps
502e13173a
Merge branch 'cc65:master' into master 2023-11-25 19:55:56 -08:00
Colin Leroy-Mira
f1b0fbebd5 Remove all indexed accesses to SCC registers
Some IIgs models had issues sending bytes out.
Also make channel tests clearer.
2023-11-24 18:37:43 +01:00
Colin Leroy-Mira
3066b1f9b4 Optimize unsigned int and long > 255 2023-11-17 22:49:03 +01:00
rumbledethumps
564c85235f style update and add rp6502 doc 2023-11-17 11:08:51 -08:00
rumbledethumps
b17c4d3434 add rp6502 target 2023-11-16 18:46:16 -08:00
acqn
3b7af398a9 Fixed initialization of union when it has an anonymous bit-field as the first member declaration. 2023-11-15 21:32:24 +08:00
acqn
f6c3a1b209 Removed the extra "'}' expected" error message following a "Excess elements in struct/union initializer" error message. 2023-11-15 21:17:05 +08:00
acqn
5332eeecc2 Fixed empty declarations in structs/unions. 2023-11-15 18:17:36 +08:00
Ryan Carsten Schmidt
e9e3cd969e
Fix typos; other copyediting 2023-11-14 00:57:07 -06:00
Ryan Carsten Schmidt
913ab3607f
Fix typo 2023-11-14 00:22:36 -06:00
Colin Leroy-Mira
b3eca51264 Add int decrement tests 2023-11-13 10:32:27 +01:00
Colin Leroy-Mira
076137f41b Optimize lda/sta/lda and friends 2023-11-13 10:32:09 +01:00
Colin Leroy-Mira
9242508abf Optimize substraction of 1 2023-11-13 10:31:48 +01:00
acqn
0eb38770bd Fixed const qualifiers on named structs/unions members that should prevent assignments to the whole structs/unions.
Added warning on ignored qualifiers on anonymous structs/unions.
2023-11-13 17:17:46 +08:00
Bob Andrews
d7d1d89698
Merge pull request #2252 from colinleroy/optimize-multiply-by-zero
Optimize multiplication by zero
2023-11-12 18:47:34 +01:00
Bob Andrews
be49751ad2
Merge pull request #2254 from brian6932/upload-64-bit-snapshot
Upload 64-bit Windows snapshot to Sourceforge
2023-11-12 18:44:41 +01:00
Colin Leroy-Mira
d00a23feff Update Apple 2 serial documentation
Reflect the new support of SER_HS_NONE.
2023-11-12 15:16:47 +01:00
Bob Andrews
ab2163f2c8
Merge pull request #2255 from polluks/patch-9
Fixed typo
2023-11-11 13:37:41 +01:00
Colin Leroy-Mira
86d498b7b3 Implement SER_HS_NONE on Apple IIgs serial driver 2023-11-10 21:56:43 +01:00
Stefan
f8d7c0cd4c
Fixed typo 2023-11-08 11:13:31 +01:00
Brian
83f51b1e3c
mention in readme 2023-11-06 21:53:14 -05:00
Brian
23f37c40aa
Upload 64-bit Windows snapshot to Sourceforge 2023-11-06 21:36:58 -05:00
Colin Leroy-Mira
cff611711b Optimize multiplication by zero 2023-11-06 11:04:00 +01:00
Colin Leroy-Mira
fe115fb621 Revert "Apple 2 SSC: Handle SER_HS_NONE with no performance impact"
This reverts commit 0eafb6d1d5.
This was buggy, as we sta Stopped when asserting flow, and this stops
SER_GET.
2023-11-05 11:34:51 +01:00
Colin Leroy-Mira
8a797095c1 Apple 2 SSC: Handle SER_HS_NONE with no performance impact 2023-11-05 11:34:51 +01:00
Colin Leroy-Mira
94239525ca Apple2 SSC: Implement no flow control 2023-11-05 11:34:51 +01:00
Bob Andrews
5b47def166
Merge pull request #2248 from acqn/ReturnTypeCheck
[cc65] Improved function return type check
2023-11-01 15:08:48 +01:00
Bob Andrews
f381d23001
Merge pull request #2236 from acqn/TypeFix
[cc65] Fixed some type-related bugs which don't have any impact yet
2023-10-29 12:37:07 +01:00
Bob Andrews
f7cf14bf58
Merge pull request #2246 from acqn/ArrayFix
[cc65] Fixes for nested unspecified-length/flexible arrays
2023-10-29 12:10:30 +01:00
Bob Andrews
65aad16d83
Merge pull request #2245 from acqn/MinorFix
[cc65] Avoided unnecessary BSS name duplication for tentative global variables
2023-10-28 15:26:31 +02:00
acqn
d424883716 Fixed diagnostics on qualifiers of function return types. 2023-10-28 15:24:13 +08:00
acqn
8e45a4c960 Fixed the bug that a union type containing a struct with a flexible array member was accepted as a struct member or array element type. 2023-10-27 23:46:10 +08:00
acqn
85e63e99a6 Fixed regression: array element of incomplete type. 2023-10-27 21:51:45 +08:00
Bob Andrews
94ef5856d0
Merge pull request #2235 from acqn/Cleanup
[cc65] Cleanups
2023-10-26 20:07:39 +02:00
Bob Andrews
401bcaa5ff
Merge pull request #2237 from acqn/CGType
[cc65] Renamed type facility functions for deciding code generation type flags
2023-10-26 19:50:10 +02:00
Bob Andrews
16f6860f57
Merge pull request #2243 from acqn/StdFuncFix
[cc65] Inlined std functions fixes
2023-10-26 17:39:07 +02:00
Bob Andrews
10f709eeb7
Merge pull request #2234 from acqn/Diagnostics
[cc65] Minor fix for error recovery from duplicated struct members
2023-10-26 17:10:01 +02:00
Bob Andrews
316ae886d7
Merge pull request #2242 from acqn/SwitchFix
[cc65] Fixed type promotion of switch case values
2023-10-26 16:56:01 +02:00
Bob Andrews
a8d00bfaae
Merge pull request #2240 from acqn/BitwiseOpt
[cc65] New TOS optimization steps for 8-bit subtraction and bitwise operations
2023-10-26 16:53:37 +02:00
Bob Andrews
8e6c0c1466
Merge pull request #2238 from acqn/BoolOptFix
[cc65] Bool opt fixes
2023-10-26 13:06:33 +02:00
acqn
df392fc104 Fixed type promotion of switch case values. 2023-10-25 22:38:21 +08:00
acqn
a31b35b2a6 Fixed naming of local variables in CG_TypeOfBySize and CG_TypeOf. 2023-10-22 10:42:17 +08:00
acqn
70549e868e New optimizer steps to restore some possibly lost optimization with boolean due to the previous fix. 2023-10-21 23:56:13 +08:00
acqn
f321bb16e5 Fixed potential bugs with boolean branch optimizers when more than one jeq/jne follows. 2023-10-21 23:56:07 +08:00
acqn
79c52e742f Added new opts OptBoolUnary1/OptBoolUnary2 to remove unnecessary cmp + bcastax/bnegax,
as well as OptBoolUnary3 to "strength-reduce" certain bcastax/bnegax to boolne/booleq.
2023-10-21 23:56:04 +08:00
acqn
e5bbdfa995 Separated boolean optimizers from bitwise unary operator optimizers.
Renamed OptCmp6 to OptBoolCmp.
2023-10-21 23:56:01 +08:00
acqn
c52427fc65 Minor fix for error recovery from duplicated struct members. 2023-10-21 23:52:14 +08:00
Bob Andrews
bb1b5c363e
Merge pull request #2233 from acqn/ArraySubscriptFix
[cc65] Fixed array subscript with a bit-field with patch by kugelfuhr
2023-10-18 12:51:36 +02:00
Bob Andrews
3e60268243
add newline at the end 2023-10-17 20:39:15 +02:00
acqn
178573a128 Fixed inlined strlen when it takes a string literal with extra characters after the first '\0'.
Added testcases.
2023-10-17 17:57:19 +08:00
Bob Andrews
77c6a6a693
Merge pull request #2226 from acqn/PragmaFix
[cc65] Pragma fixes
2023-10-16 16:57:09 +02:00
Oliver Schmidt
3c864fc7d8
Minimal style adjustment 2023-10-15 17:00:15 +02:00
Colin Leroy-Mira
882f6fd103 Fix ACIA check so we don't enable RX/TX with IRQs on 2023-10-15 16:58:59 +02:00
Colin Leroy-Mira
3107f34ec9 Put back 6551 test as a last verification 2023-10-15 16:58:59 +02:00
Colin Leroy-Mira
6e035c864e Apple2 SSC: on IIgs, verify slot mode
If the slot is not in "Your Card" mode, there's no way it is an SSC
2023-10-15 16:58:59 +02:00
Colin Leroy-Mira
96e893795b Better check for 6551 2023-10-15 16:58:59 +02:00
acqn
21b6cbb66e Updated documentation on string literal translation in asm() and _Static_assert(). 2023-10-15 16:43:40 +08:00
acqn
8111946731 Fixed array subscript with a bit-field with patch by kugelfuhr. 2023-10-15 15:53:03 +08:00
mrdudz
6222cd9115 don't use a label in the bgt macro, as that may cause subtle problems. fixes #2222 2023-10-14 23:04:30 +02:00
Bob Andrews
2726192aaf
Merge pull request #2224 from acqn/DeclCleanUp
[cc65] Made functions in src/cc65/declare.c less confusing
2023-10-14 20:09:05 +02:00
mrdudz
bb92144717 changed "inline assembler statement" to "inline assembler expression" as suggested in #2191 2023-10-14 16:21:30 +02:00
Colin Leroy-Mira
e138403727 Move cli in common out path 2023-10-14 14:36:09 +02:00
Colin Leroy-Mira
6e0bbb00ee Fix logic error on parameters checks 2023-10-14 14:36:09 +02:00
Colin Leroy-Mira
c7db08b4e3 Move hardware check to ser_install 2023-10-14 14:36:09 +02:00
Colin Leroy-Mira
e90a8f3123 Address code review comments 2023-10-14 14:36:09 +02:00
Colin Leroy-Mira
39d6080945 Do the IIgs check as documented 2023-10-14 14:36:09 +02:00
Colin Leroy-Mira
e3759a3ead Spare cycles on IRQ path 2023-10-14 14:36:09 +02:00
Colin Leroy-Mira
65ce3a6792 Don't check firmware at $C200, as we don't use it
Just check that we're on a IIgs instead.
2023-10-14 14:36:09 +02:00
Colin Leroy-Mira
9e87e558d2 Fix register r/w timing 2023-10-14 14:36:09 +02:00
Bob Andrews
b300b7ac8b
Merge pull request #1799 from acqn/#1489
[cc65] Post-inc/post-dec won't affect __A__/__AX__/__EAX__ in the same statement
2023-10-14 13:25:14 +02:00
Bob Andrews
ed2f1f6b90
Merge pull request #2223 from acqn/VSLineEndingFix
Reverted EOL settings (LF vs CRLF) for Visual Studio
2023-10-14 13:19:57 +02:00
acqn
7b0d1d9679 Added warning on concatenated string literals in _Pragma operations. 2023-10-13 14:54:54 +08:00
acqn
25832ef5fc Fixed timing of #pragma charmap.
Now it is immediately applied and affects almost all characters and string literals after it.
Exceptions:
- String literals as the message of a static assertion or inline assembler code (only the required one, not any optional formatted arguments) in an asm() expression are not translated with either #pragma charmap or target presets.
- String literals used for preprocessor directives or as the result of stringized macro arguments are never translated.
2023-10-13 16:32:06 +08:00
acqn
c6ead99b00 Fixed string literal concatenation with pragmas in between. 2023-10-13 16:32:05 +08:00
acqn
74922afa7c Made the intension of functions in src/cc65/declare.c less confusing. 2023-10-12 17:31:49 +08:00
acqn
b14efbb578 Fixed EOL settings (LF vs CRLF) for Visual Studio. 2023-10-11 23:57:45 +08:00
acqn
7b6f8249a0 General fixes for prerequisites for optimization on certain std functions.
Added utility functions for extracting expression info.
2023-10-11 22:29:15 +08:00
Bob Andrews
494bf10e80
Merge pull request #2216 from acqn/FuncDefFix
[cc65] Type category in a function definition cannot be inherited from a typedef
2023-10-08 18:58:29 +02:00
Bob Andrews
181a8cd64c
Merge pull request #2212 from BrianPeek/removeabc
Remove unused abc_score_ptr zp entries for lynx lib
2023-10-08 14:51:26 +02:00
Bob Andrews
ee6118f235
Merge pull request #2215 from acqn/VariadicCallCheck
[cc65] Added check for total arguments size for variadic functions
2023-10-08 13:13:08 +02:00
Brian Peek
32a20cf5ca remove abc ptrs 2023-10-06 19:53:18 -07:00
acqn
0028b14071 The type category in a function definition cannot be inherited from a typedef. 2023-10-05 17:48:16 +08:00
Evgeny Vrublevsky
850007cb44 Document line_continuations feature. 2023-10-05 08:28:37 +03:00
Evgeny Vrublevsky
c8df241337 Add line_continuations feature that works as .LINECONT but in a consistent way with other features. 2023-10-05 08:28:37 +03:00
Bob Andrews
12193790e5
Merge pull request #2199 from acqn/FAMFix
[cc65] Forbidden struct itself with flexible array member as struct member or array element
2023-10-05 03:21:31 +02:00
Bob Andrews
327281b869
Merge pull request #2200 from acqn/CompoundInitFix
[cc65] Fixed compound initialization with certain omitted enclosing curly braces
2023-10-05 03:20:33 +02:00
Bob Andrews
bdb13350e3
Merge pull request #2201 from acqn/Diagnostics
[cc65] Improved diagnostics
2023-10-05 03:19:31 +02:00
Bob Andrews
eb5e888499
Merge pull request #2204 from vrubleg/general_fixes
General project fixes and quality of life improvements
2023-10-05 03:17:51 +02:00
acqn
20c3e994c6 Fixed compiling with pragmas in the middle of declarations or statements. 2023-10-04 21:22:04 +08:00
Colin Leroy-Mira
9667a5f991 Re-introduce necessary comments, wit a clearer wording 2023-10-03 18:35:23 +02:00
Colin Leroy-Mira
3c17c13357 Address latest comments 2023-10-03 18:34:22 +02:00
Colin Leroy-Mira
996a2659d5 Address code review comments 2023-10-03 18:34:22 +02:00
Colin Leroy-Mira
e16a5e0dbe Add Apple IIgs serial driver 2023-10-03 18:34:22 +02:00
Colin Leroy-Mira
330b1ab3f9 Remove useless comments 2023-10-03 13:55:10 +02:00
Colin Leroy-Mira
df4902157a Cleanup coding style a bit 2023-10-03 13:55:10 +02:00
Colin Leroy-Mira
4ff917816e Apple2: Always copy cmdline
Otherwise, the last exec() cmdline lingers around for the next exec("file", NULL).
2023-09-29 10:51:53 +02:00
Evgeny Vrublevsky
148942ff1d Don't use hardcoded Visual Studio installation path in msbuild.cmd. 2023-09-23 14:26:09 +03:00
Evgeny Vrublevsky
9b9e955eb1 Add basic .editorconfig. 2023-09-23 14:26:08 +03:00
Evgeny Vrublevsky
d83354a8dd Fix default VS project settings. 2023-09-23 14:26:08 +03:00
Bob Andrews
4944c92f9a
Merge pull request #2202 from polluks/patch-8
Update funcref cx16
2023-09-22 23:10:34 +02:00
Stefan
b81e5d00f2
Update funcref cx16 2023-09-22 16:43:03 +02:00
Colin Leroy-Mira
e3bc143f27 Another two bytes saved 2023-09-22 11:51:29 +02:00
acqn
13e1ed3e7b Fixed compound initialization with omitted enclosing curly braces when an array/struct/union to initialize is nested. 2023-09-22 10:29:52 +08:00
Bob Andrews
dd833125a8
Merge pull request #2198 from acqn/DeclFix
[cc65] Fixed check for conflicting extern vs no-linkage/static declarations in functions
2023-09-21 00:35:35 +02:00
Bob Andrews
c82e877451
Merge pull request #2188 from colinleroy/serial-kernel-fix-driver-lifecycle
Serial kernel: Fix driver lifecycle
2023-09-21 00:34:09 +02:00
Bob Andrews
6bc68b9763
Merge pull request #2195 from polluks/kim
Added KIM-1 refs
2023-09-21 00:19:22 +02:00
Bob Andrews
40b0315be9
Merge pull request #2196 from ToboterXP/add_fx
Added FX registers to cx16.h
2023-09-21 00:18:00 +02:00
acqn
51e304f10f Added check for total arguments size for variadic functions. 2023-09-18 16:44:04 +08:00
acqn
fc603129da A structure with a flexible array member shall not be a member of a structure or an element of an array according to the ISO C Standard. 2023-09-18 15:44:58 +08:00
ToboterXP
0815c8890b Added semicolon 2023-09-17 22:57:42 +02:00
ToboterXP
d251bd46c8 Removed dangling spaces 2023-09-17 22:54:48 +02:00
ToboterXP
3626c94c97 Added FX registers to cx16.h 2023-09-17 22:48:47 +02:00
acqn
39abd233fe Fixed check for conflicting extern vs no-linkage/static declarations in functions. 2023-09-17 23:47:22 +08:00
Stefan
e145145fbb
Added KIM-1 refs
some clean-up
2023-09-16 21:01:37 +02:00
Bob Andrews
5ed3108eea
Merge pull request #2190 from polluks2/patch-12
optimisation scandisplay
2023-09-15 15:49:11 +02:00
polluks2
2e9843b32d
optimisation scandisplay 2023-09-15 10:35:36 +02:00
acqn
878264d948 Minor consistency improvement for AddEnumSym() usage. No impact. 2023-09-13 22:26:41 +08:00
acqn
8e62cbf092 Improved checks on function return types. 2023-09-13 22:26:41 +08:00
Colin Leroy-Mira
3fc074014e Serial kernel: Fix driver lifecycle
- Make sure we don't install a driver on top of another one
- Make sure we don't uninstall a driver twice
- Make sure we uninstall a driver if needed at exit
2023-09-12 20:58:21 +02:00
Colin Leroy-Mira
aa5ee8423a Clearer wording for the firmware check 2023-09-11 08:31:15 +02:00
Colin Leroy-Mira
38f7daf40e Make sure not to load ACIA driver on IIgs' Z8530
The Pascal Firmware Protocol Bytes ID are not enough to differentiate an SSC card from a IIgs serial firmware:
http://www.1000bit.it/support/manuali/apple/technotes/misc/tn.misc.08.html

Loading a2(e).ssc.ser on a IIgs succeeds, then goes to limbo when one tries to use the serial port.

Check first byte on the slot's firmware in addition to the four existing ones, as it's supposed to be $2C (BIT instruction) on an SSC card, and $EF (65C816 SEP instruction) on the IIgs' serial firmware (ROM revisions 0, 1, 3).
2023-09-11 08:31:15 +02:00
Bob Andrews
043590c971
Merge pull request #2182 from colinleroy/add-ntohs
Add ntohs/htons and ntohl/htonl
2023-09-08 18:47:09 +02:00
Bob Andrews
caf8186565
Merge pull request #2166 from colinleroy/rfc-serial-optimisation
Possible serial driver optimisations
2023-09-08 18:42:39 +02:00
Bob Andrews
537aa665cf
Merge pull request #2006 from bbbradsmith/ca65_jmp_abs_wrap_error
jmp (abs) wrap warning promoted to an error, suppressed on 65C02/etc
2023-09-08 18:26:55 +02:00
Colin Leroy-Mira
9e5620f127 Fix coding-style on header 2023-09-07 23:06:51 +02:00
Colin Leroy-Mira
9669710cc3 Fix usage of __OPT_i__ 2023-09-07 21:36:39 +02:00
Colin Leroy-Mira
cbc5603d63 Inline ntohs/htons as a macro if -i is passed 2023-09-07 21:00:30 +02:00
Colin Leroy-Mira
a90aa57510 Address Oliver's comments 2023-09-07 16:48:56 +02:00
Colin Leroy-Mira
734541ee05 Serial: Optimize SER_GET
There is no need to TryToSend before getting the character. We
send bytes during SER_PUT, and if interrupted during sending, we
still try to do it at the beginning of the next SER_PUT.
2023-09-07 07:14:01 +02:00
Colin Leroy-Mira
a89a311abf Serial: Micro-optimisation for apple2enh
On 65C02 we can spare one cycle on sta (abs); we also
not have to care about the 6502 false reads
2023-09-07 07:13:59 +02:00
Colin Leroy-Mira
e8f5ad2471 Serial: Optimize SER_PUT
We don't need to reload SendFreeCnt if we don't jsr TryToSend.
2023-09-07 07:13:57 +02:00
Colin Leroy-Mira
89af42e5cb Serial: Optimize SER_IRQ
Apple2 and Atmos have Index in X, but can still use it for the
best-case path as long as we reload it in the worst-case part
(when we assert flow control).
Also, standardize the free space to trigger flow control to 32
characters left (compare with RecvFreeCnt before decrement)
2023-09-07 07:13:54 +02:00
Colin Leroy-Mira
3f3b6123b9 Serial: Optimize TryToSend
We don't need to reload SendFreeCnt each time we loop to wait
for the ACIA to be ready.
2023-09-07 07:13:48 +02:00
Colin Leroy-Mira
dfe7562f76 Add ntohs, htons, ntohl, htons. 2023-09-07 07:03:34 +02:00
Bob Andrews
c674b7ced4
Merge pull request #2183 from polluks2/patch-10
Update README.md
2023-09-06 19:40:58 +02:00
polluks2
1a6e20ca6e
Update README.md 2023-09-06 14:47:14 +02:00
polluks2
30b80548d4
Update README.md
For the sake of completeness
2023-09-06 12:16:14 +02:00
Bob Andrews
e52e350498
Merge pull request #2180 from polluks2/patch-9
Added missing detail
2023-09-05 19:51:41 +02:00
Bob Andrews
84a01816fd
Merge pull request #2181 from bbbradsmith/init-revert
change INIT back to rw for configurations that needed it
2023-09-05 19:42:57 +02:00
bbbradsmith
d4c4786ff0 undo change of INIT to bss for configurations that were also using rw to reserve space, add a comment documenting the reason 2023-09-05 00:24:18 -04:00
polluks2
e28e32129a
Added missing detail 2023-09-04 20:38:05 +02:00
Bob Andrews
7eaa5c507f
Merge pull request #2177 from polluks2/patch-11
Don't mix apple2 with apple2enh
2023-09-04 20:36:31 +02:00
Bob Andrews
870581a4d4
Merge pull request #2174 from colinleroy/conio-65c02-optimisations
Conio: 65c02 optimisations
2023-09-04 18:00:23 +02:00
Bob Andrews
980727d62d
Merge pull request #2178 from polluks2/patch-9
Fixed typo
2023-09-04 17:58:47 +02:00
polluks2
4ebc3b8b04
Don't mix apple2 and apple2enh 2023-09-03 20:47:48 +02:00
Bob Andrews
16e90187e8
Merge pull request #2163 from bbbradsmith/init-bss
INIT segment definitions should be consistent, and bss is the appropriate semantic type
2023-09-03 00:30:44 +02:00
Colin Leroy-Mira
8a140e6503 Conio: 65c02 optimisations
cputc: -2 cycles per char, -2 cycles per carriage return
cputs: -5 cycles per char, -3 cycles on cputsxy
vcprintf: -6 cycles per char
2023-09-02 12:44:53 +02:00
Bob Andrews
d70c902a02
Merge pull request #2170 from colinleroy/build-libs-with-debug-info
Build libs with debug symbols
2023-09-01 17:58:17 +02:00
Colin Leroy-Mira
a2c115fc3e Build libs with debug symbols 2023-08-26 15:35:28 +02:00
Bob Andrews
05cd805cbc
Merge pull request #2085 from bbbradsmith/numerical_constant_errors-float
Numerical constant errors and improvements (float)
2023-08-25 22:30:07 +02:00
bbbradsmith
97e59b0756 ref link doesn't work within the usage verb 2023-08-19 15:50:22 -04:00
bbbradsmith
28ffe2f59b add jmp page crossing to --relax-checks, document it, fix --relax-checks documentation (segment branch error is not suppressed) 2023-08-19 15:39:51 -04:00
bbbradsmith
f31d8efc1e tabs are forbidden 2023-08-19 15:07:32 -04:00
bbbradsmith
07f08fc547 tests verifying jmp (indirect) page crossing error on 6502, and the lack of error for other CPU types 2023-08-19 14:36:30 -04:00
bbbradsmith
d09e0a7f20 Merge branch 'master' into ca65_jmp_abs_wrap_error 2023-08-19 14:07:52 -04:00
bbbradsmith
2431fb7d85 correct INIT segment semantic is bss, make this consistent across all default cfg 2023-08-19 13:08:46 -04:00
mrdudz
39619b629d fix docs on .version (forgot to update it when __CC65__ was fixed) 2023-08-19 15:39:16 +02:00
Colin Leroy-Mira
148be69f97 Optimize and fix comments (thanks to Oliver Schmidt) 2023-08-19 14:11:36 +02:00
Colin Leroy-Mira
1f68846116 Avoid using mli.s to initcwd 2023-08-19 14:11:36 +02:00
mrdudz
a24196ee41 Merge branch 'master' into coniopeek 2023-07-08 15:23:42 +02:00
Bob Andrews
ce3bcadd24
Merge pull request #2146 from baktragh/master
Update _atari5200os.h
2023-07-02 19:10:39 +02:00
baktragh
7a85473cb0
Update _atari5200os.h
Remove dangling spaces
2023-07-02 15:16:33 +02:00
baktragh
6c127d6a83
Update _atari5200os.h
Update the page 0 symbols, synchronize  the names with the _atarios.h, add locations used by Atari 5200 conio
2023-07-02 14:59:00 +02:00
Bob Andrews
3efa517d96
Merge pull request #2141 from baktragh/master
Update _atari5200os.h with POT shadows
2023-06-27 00:18:23 +02:00
baktragh
aaec2a6270
Update _atari5200os.h - Remove dangling spaces 2023-06-26 16:46:42 +02:00
baktragh
3e166c760d
Update _atari5200os.h with POT shadows
Update the OS struct with POT shadow registers, according to the https://web.archive.org/web/20120830055323/http://www.atarimuseum.com/videogames/consoles/5200/conv_to_5200.html document
2023-06-26 16:38:41 +02:00
Bob Andrews
c2e5937724
Merge pull request #2138 from mooinglemur/20230615-cx16-memsiz
cx16: use KERNAL memsiz for MEMSIZE in asminc/cx16.inc
2023-06-19 18:59:47 +02:00
MooingLemur
59941d9464 cx16: use KERNAL memsiz for MEMSIZE in asminc/cx16.inc 2023-06-15 21:30:26 -04:00
mrdudz
c8aa9cc703 add struct assign check related to #2079 2023-05-29 17:20:09 +02:00
Bob Andrews
31bac03d01
Merge pull request #2124 from jedeoric/telestrat_fix_compute_length_bytes_read_write
Fix computed length for read and write for telestrat target
2023-05-29 16:02:41 +02:00
jede
480600093c fix pla/pha instead of tmp1 2023-05-25 18:09:03 +02:00
jede
1ca9d7e9e7 fix tab 2023-05-23 23:15:23 +02:00
jede
1377ba0d36 fix compute length for read and write for telestrat target 2023-05-23 23:08:56 +02:00
Bob Andrews
652949f183
Merge pull request #2104 from Movax12/remove-feature-requirement-addrsize
ca65: Remove .feature requirement for .addrsize
2023-05-22 00:39:04 +02:00
Bob Andrews
47ee29f239
Merge pull request #2120 from polluks2/patch-10
Fixed typo
2023-05-19 17:25:34 +02:00
polluks2
40ff9281c6
Fixed typo 2023-05-19 16:36:19 +02:00
polluks2
3831feba75
Fixed typo 2023-05-19 16:32:09 +02:00
Bob Andrews
9ff7b88192
Merge pull request #2113 from polluks2/patch-9
Unified NULL #2110
2023-05-19 16:06:46 +02:00
polluks2
accd57460b
Reverted gconst.h 2023-05-19 15:48:31 +02:00
polluks2
8ff008722b
Fixed test
Don't define NULL yourself. QED
2023-05-19 02:49:49 +02:00
polluks2
767875b5a7
Added guard 2023-05-18 00:08:26 +02:00
polluks2
19436f5159
Update gconst.h 2023-05-17 20:24:36 +02:00
Bob Andrews
70bf4d492b
Merge pull request #2105 from bbbradsmith/sim65-64bit-cycle-count
Sim65 64bit cycle count
2023-05-16 15:53:23 +02:00
Bob Andrews
d41f53e252
Merge pull request #2108 from bbbradsmith/windows-workflow-scheduled-cmd
Scheduled windows build/test and cmd.exe subshell
2023-05-16 15:37:18 +02:00
polluks2
dd58c7ff50
Update stddef.h 2023-05-14 17:32:30 +02:00
polluks2
ba6747f5da
Update time.h 2023-05-14 17:29:42 +02:00
polluks2
c55459b287
Update string.h 2023-05-14 17:28:48 +02:00
polluks2
fd74e6b005
Update stdio.h 2023-05-14 17:28:09 +02:00
polluks2
680ddaf37d
Update locale.h 2023-05-14 17:27:04 +02:00
polluks2
6579df4e91
Update stdlib.h 2023-05-14 02:43:35 +02:00
Bob Andrews
55723f4977
Merge pull request #2112 from bbbradsmith/extern-static-conflict-error
Error/warning for extern/static linkage declaration conflict
2023-05-12 11:22:59 +02:00
polluks2
5d9306fed3
Fixed header #2110 2023-05-12 02:32:14 +02:00
bbbradsmith
5a30d746b4 extern/static conflict test: remove warning as errors to match the new expected cases 2023-05-11 20:15:27 -04:00
bbbradsmith
3b7be09a7f extern redeclared as static = error (C spec: undefined)
static redeclared as extern = warning (C spec: ignore extern)
See: #2111
2023-05-11 19:50:58 -04:00
bbbradsmith
eb2b013d62 remove workflow comments this obsoletes 2023-05-08 21:22:18 -04:00
bbbradsmith
76328da682 librsc/Makefile: ../lib directory must be created globally before make lib targets in parallel
prevents conflict of individual targets each trying to create ../lib
enable -j2 in make lib windows action
2023-05-08 20:57:50 -04:00
bbbradsmith
07963abd52 replace manual-only tests with scheduled test and manual dispatch
cache is used to prevent unnecessary rebuild if the previous build was successful
make steps now use SHELL=cmd to provide cmd.exe subshell
2023-05-08 18:21:21 -04:00
bbbradsmith
ce6097ea7e rename windows-test-manual to windows-test-scheduled 2023-05-08 18:12:57 -04:00
Movax12
a058d4a2f3 Fix warning message, remove comment 2023-05-08 16:55:54 -04:00
Bob Andrews
79018fd424
Merge pull request #2107 from IrgendwerA8/patch-2
Fixed comments for Atari OS memory location
2023-05-08 18:34:30 +02:00
Irgendwer
02d38ae17e
Fixed comments for Atari OS memory location 2023-05-08 15:28:22 +02:00
bbbradsmith
f15e9c4159 Linux build rejects %llu in ErrorCode 2023-05-07 17:41:54 -04:00
bbbradsmith
2cb457b85f sim65 use error codes outside the simulated program's range for non-sim errors 2023-05-07 16:51:12 -04:00
bbbradsmith
7f0baff792 document how to return from assembly sim65 test 2023-05-07 16:35:05 -04:00
bbbradsmith
3419cbd348 sim65 64-bit cycle count tests
These take ~10 seconds to run locally
2023-05-07 16:33:47 -04:00
bbbradsmith
aad64063c9 makefiles no longer need comment about sim65 64-bit support 2023-05-07 16:33:07 -04:00
bbbradsmith
0081fe548c sim64 universal 64-bit cycle count support:
MaxCycleCount is accounted by countdown, eliminating the 1-instruction-overhead issue, and removing the need to compare against a growing TotalCycles.
Makes main.c responsible for counting total cycles, instead of 6502.c, so the size of MaxCycleCount etc. is fully determined in one location.
Makes error.c responsible for PrintCycles instead of paravirt.c, so that it can be treated globally instead of
Return value of main() should be SIM65_ERROR because it is unreachable by design.
2023-05-07 16:26:42 -04:00
mvax
56df849101 add warning for .feature addrsize, clean up switch in SetFeature 2023-05-07 14:53:44 -04:00
Bob Andrews
6de85b2e2a
Merge pull request #2093 from bbbradsmith/split2089-workflow-docs-artifact
Workflow docs artifact and snapshot
2023-05-07 19:44:41 +02:00
Brad Smith
8b682b3c5a
Merge branch 'master' into split2089-workflow-docs-artifact 2023-05-07 13:34:37 -04:00
Bob Andrews
c9857d9962
Merge pull request #2069 from jefftranter/bootstrap-fix
Source listing in bootstrap.s is incorrect.
2023-05-07 13:49:12 +02:00
mvax
bee29dedd1 fix feature.s test 2023-05-06 17:11:57 -04:00
mvax
560085cb17 modify and add tests 2023-05-06 16:22:04 -04:00
Bob Andrews
9c70235173
Merge pull request #2096 from Movax12/BugFix-for-ismnemonic-function
Bugfix for the .ISMNEMONIC, .ISMNEM builtin function
2023-05-06 21:42:59 +02:00
Bob Andrews
9c27084fa5
Merge pull request #2084 from bbbradsmith/numerical_constant_errors-int
Numerical constant errors and improvements (integer)
2023-05-06 21:36:59 +02:00
Bob Andrews
066953c435
Merge pull request #2101 from bbbradsmith/split2092-windows-test-manual
workflow for manually dispatched Windows build and test
2023-05-06 21:23:50 +02:00
Bob Andrews
7b40515506
Merge pull request #2099 from bbbradsmith/split2092-sim65-fix
sim65 fix platform-dependent issues
2023-05-06 20:36:59 +02:00
mvax
11cc5b6f06 remove .feature requirment for addrsize function, silently ignore '.feature addrsize' 2023-05-06 14:24:53 -04:00
Bob Andrews
f87c7f3f14
Merge pull request #2098 from bbbradsmith/split2092-grc65-fix
grc65 fix flawed text parsing
2023-05-06 20:07:20 +02:00
bbbradsmith
84f0ab322d sim65: cycles does not increment 1 at a time, so some small overhead is needed in range check 2023-05-06 13:54:28 -04:00
mvax
fe35386b79 add test - add overloading instruction test 2023-05-06 12:56:34 -04:00
bbbradsmith
532681c961 braces were requested
combining the two a = ' ' cases was requested
2023-05-06 12:06:06 -04:00
bbbradsmith
1df7ab0352 opening brace on same line as while
other AbEnd messages don't end in .
2023-05-06 11:55:21 -04:00
Bob Andrews
027ec91944
Merge pull request #2094 from bbbradsmith/workflow-docs-tweak
More specific git commit error suppression in doc upload
2023-05-06 12:04:57 +02:00
Bob Andrews
0d0369983a
Merge pull request #2100 from bbbradsmith/split2092-libtest
libtest target alternative to lib
2023-05-06 11:30:05 +02:00
Bob Andrews
9014165612
Merge pull request #2097 from jefftranter/c1p-video-mode
Add support for 48x12 video mode on Challenger 1P
2023-05-06 11:17:45 +02:00
bbbradsmith
a022f7203d workflow for manually dispatched Windows build and test 2023-05-05 22:05:10 -04:00
bbbradsmith
df749abbfb libtest target alternative to libs
saves me about 20 minutes if I only want to run tests
2023-05-05 21:56:52 -04:00
bbbradsmith
c03d00bc80 sim65 suppress uninitialized variable warning
the EOF check was protecting uninitialized Val2 but the compiler can't figure that out
2023-05-05 21:46:42 -04:00
bbbradsmith
773716c32a sim65 close(-1) crash fix
test/val/constexpr.c relies on close(-1) to return -1 for some reason (comment says "abuse"), but on MSVC close(-1) is treated as a security issue and terminates the program instead of returning -1
simulating this desire for sim65, though constexpr.c may also warrant a review
2023-05-05 21:46:11 -04:00
bbbradsmith
f2e7609046 sim65 cycles 32-bit range fix
long is 64-bit on some platforms, making this inconsistent, added range check to catch overflow.
reduced tests requesting 5 billion cycles to 2^32-1 so they can fun on 32-bit long sim65.
2023-05-05 21:45:57 -04:00
bbbradsmith
8d048699ee grc65 fix flawed text parsing
Was using fseek(F,-1,SEEK_CUR) which is invalid for text files, behaviour unreliable across platforms.
Added check for internal buffer overflow.
2023-05-05 21:32:34 -04:00
mvax
dd0a2bf1bc add test - fix stlye 2023-05-05 19:10:16 -04:00
mvax
7994889213 add test - fix again 2023-05-05 19:07:14 -04:00
mvax
c5cf32ac47 add test - fix 2023-05-05 18:50:44 -04:00
mvax
18570d18b8 add test 2023-05-05 18:43:10 -04:00
Jeff Tranter
17706208e8 Add support for 48x12 video mode on Challenger 1P.
Tested on real C1P hardware.
2023-05-05 18:02:42 -04:00
Bob Andrews
a325c95652
Merge pull request #2090 from bbbradsmith/split2089-make-test-standard
add test/standard to test makefile
2023-05-05 20:42:57 +02:00
Bob Andrews
7a040978d7
Merge pull request #2088 from bbbradsmith/struct-3byte-misc-todo
guard test to ensure 3-byte struct isn't re-enabled without evaluation by accident
2023-05-05 20:39:37 +02:00
Bob Andrews
34d9d55b95
Merge pull request #2091 from bbbradsmith/split2089-test-todo-testwrk
test/todo makefile uses testwrk/val by mistake
2023-05-05 20:36:10 +02:00
mvax
1c58b302d8 Bugfix for the .ISMNEMONIC, .ISMNEM builtin function 2023-05-05 12:31:19 -04:00
bbbradsmith
c662c7a36f use diff-index to prevent commit instead of bash if
preferred because the if suppresses all git commit errors, instead of the one error we need to suppress (commit with no changes)
2023-05-05 12:02:50 -04:00
bbbradsmith
5c20fb2812 test/todo makefile uses testwrk/val by mistake 2023-05-05 11:28:42 -04:00
bbbradsmith
9f3e47e9c9 test/standard was never added to test makefile 2023-05-05 11:04:31 -04:00
bbbradsmith
8f356f5093 artifact upload should not end with .zip as it is appended automatically
fixes ".zip.zip" artifact filenames
2023-05-05 11:00:06 -04:00
bbbradsmith
0cad5bef81 include docs snapshot with pull request build so that PRs can preview it easily 2023-05-05 10:58:18 -04:00
bbbradsmith
e57c991de7 master push workflow can include a docs snapshot 2023-05-05 10:56:43 -04:00
bbbradsmith
cfc8a41a03 guard test to ensure 3-byte struct isn't re-enabled without evaluation by accident 2023-05-04 17:07:34 -04:00
Bob Andrews
a7676bdff5
Merge pull request #2075 from bbbradsmith/struct-duplicate-member-error
Error for struct/union with a duplicate member
2023-05-04 22:43:17 +02:00
mrdudz
69fd3d7998 tweak 2023-05-04 22:21:36 +02:00
mrdudz
71bb11bee1 make the commit message a url, also check if it really doesnt fail when there is nothing to commit 2023-05-04 22:09:22 +02:00
mrdudz
e228e4d65c try something else, again 2023-05-04 21:58:37 +02:00
mrdudz
4ef849cb81 Force background image to snap left, adapted from https://github.com/cc65/doc/pull/1 2023-05-04 21:44:57 +02:00
mrdudz
769b316376 lets see if this will not fail when there are no changes in the docs 2023-05-04 21:27:48 +02:00
mrdudz
7053dac3a9 remove token from cc65/doc, reenable the tests again 2023-05-04 21:13:37 +02:00
mrdudz
610dfbb41c try normal push, also try actions/upload-artifact@v3 2023-05-04 21:07:23 +02:00
mrdudz
ea90c934d7 try gain with classic token 2023-05-04 20:59:18 +02:00
mrdudz
17f58d934f AGAIN 2023-05-04 20:52:50 +02:00
mrdudz
926d09a14d i'm not patient enough 2023-05-04 20:48:52 +02:00
mrdudz
0369838f24 bleh 2023-05-04 20:45:35 +02:00
mrdudz
3536761110 another try 2023-05-04 20:30:28 +02:00
mrdudz
99a0d64b93 lets see if that token stuff works 2023-05-04 20:03:27 +02:00
mrdudz
20f0427fa4 comment out the push again. who knows whats wrong. sigh 2023-05-04 15:20:33 +02:00
mrdudz
681c51b37e yawn 2023-05-04 15:12:46 +02:00
mrdudz
c0dd3b9d9a like this? awesome how everyone does something different :) 2023-05-04 15:10:10 +02:00
mrdudz
7c5595efbc another try 2023-05-04 15:02:32 +02:00
mrdudz
45258d060d lets see if this works 2023-05-04 14:47:02 +02:00
mrdudz
0957c36115 try verbose dry run to see what it does :) 2023-05-04 14:19:27 +02:00
bbbradsmith
69f4cd1847 limits.h was apparently already included somewhere on windows but not linux 2023-05-04 05:48:48 -04:00
bbbradsmith
ca8201a314 Overflow test optimization suggested by kugelfuhr
User CHAR_BIT instead of 8
2023-05-04 05:44:20 -04:00
Bob Andrews
13f317e660
Update Contributing.md 2023-05-04 09:18:33 +02:00
Brad Smith
5ed7153841
Merge branch 'master' into ca65_jmp_abs_wrap_error 2023-05-03 21:12:37 -04:00
bbbradsmith
84eafb7f9c err test for struct with duplicate member 2023-05-03 21:09:03 -04:00
bbbradsmith
b5f255f912 Test case for const-overflow warnings 2023-05-03 19:54:40 -04:00
bbbradsmith
8e75e5b51a Suppress overflow warning when conversion is an explicit cast 2023-05-03 19:42:05 -04:00
bbbradsmith
e3cb8dfb9b Numerical constant scanner requires explicitly 32-bit sized type for cross-platform consistency 2023-05-03 19:27:37 -04:00
Bob Andrews
b743b1a8c2
Merge pull request #2081 from bbbradsmith/suppress-size-error
ca65: Suppress '.size' error for multiply-defined symbols
2023-05-04 00:36:48 +02:00
Bob Andrews
45bdeb62ad
Merge pull request #2070 from bbbradsmith/fix2060
RHS primary integer promotion must happen after loading the primary, not before
2023-05-03 23:57:19 +02:00
bbbradsmith
49bd568113 error test for integer constant too large for internal representation 2023-05-03 17:55:02 -04:00
bbbradsmith
dbdadaa3f3 accidental tabs, printf long expectts explicit %ld 2023-05-03 16:59:48 -04:00
bbbradsmith
2ac9c6f51e Suppress the floating point precision warning if an explicit cast is used 2023-05-03 16:53:51 -04:00
bbbradsmith
e3887d7ead Test to demonstrate availability of floating point constants, document the possibility. 2023-05-03 16:48:02 -04:00
bbbradsmith
7ff74b2c47 Give a better error for unsupported floating point arithmetic, instead of internal "Precondition violated" error. 2023-05-03 16:48:02 -04:00
bbbradsmith
52f0e6a29c Allow floating point constants to be converted to integer (warning if loss of precision) 2023-05-03 16:48:02 -04:00
bbbradsmith
a686d1fa8e Allow unary +/- for floating point constants 2023-05-03 16:48:02 -04:00
bbbradsmith
a109f475ed Fix broken/incomplete floating point parsing
- Fractional digit scale was broken
- Base was partially ignored
- Exponent sign was ignored
- Exponent for hex float is 2 not 10
2023-05-03 16:48:02 -04:00
bbbradsmith
9a502c69dc fix tab, braces for 1-line if, Expr->Ival is signed 2023-05-03 16:46:59 -04:00
Bob Andrews
83ff62d5e2
Merge pull request #2078 from bbbradsmith/line-endings
ca65 support for three line ending types: \r, \r\n, \n
2023-05-03 21:19:03 +02:00
Bob Andrews
f4676e11b4
Merge pull request #2083 from bbbradsmith/struct-passing
Improve struct size error message to include the detected size
2023-05-03 21:00:25 +02:00
Bob Andrews
6386788843
Merge pull request #2082 from cc65/revert-2080-revert-2072-struct-passing
Revert "Revert "Forbid 3-byte struct pass/return by value, document struct value pass/return""
2023-05-03 20:49:37 +02:00
bbbradsmith
440c91fad9 braces for 1-line if 2023-05-03 14:11:30 -04:00
Bob Andrews
ae7a1416fe
Revert "Revert "Forbid 3-byte struct pass/return by value, document struct value pass/return"" 2023-05-03 20:02:12 +02:00
bbbradsmith
1f18ab218e Improve struct size error message to include the detected size 2023-05-03 13:35:51 -04:00
Brad Smith
4e6b94de5c
braces 2023-05-03 12:19:05 -04:00
bbbradsmith
016008b6df ca65: Suppress '.size' error for multiply-defined symbols 2023-05-03 11:57:50 -04:00
Jeff Tranter
387d455cb4 Revised patch.
Uses code in source listing. Tested on a real OSI C1P machine.
2023-05-03 11:16:22 -04:00
Jeff Tranter
fdd4d35887
Merge branch 'cc65:master' into bootstrap-fix 2023-05-03 10:43:44 -04:00
Bob Andrews
59bd5fdd4c
Merge pull request #2071 from bbbradsmith/bug895_warningspam
bug895.c compliant token pasting syntax to remove warnings
2023-05-03 15:02:30 +02:00
Bob Andrews
0bded728ae
Merge pull request #2080 from cc65/revert-2072-struct-passing
Revert "Forbid 3-byte struct pass/return by value, document struct value pass/return"
2023-05-03 14:37:21 +02:00
Bob Andrews
6ffc4004d7
Revert "Forbid 3-byte struct pass/return by value, document struct value pass/return" 2023-05-03 14:24:13 +02:00
Bob Andrews
f3c0f7c6ce
Merge pull request #2074 from bbbradsmith/zp_override_not_suspicious
Explicit z: should suppress "Suspicious address expression" warning
2023-05-03 14:09:23 +02:00
Bob Andrews
7d9a736b7f
Merge pull request #2072 from bbbradsmith/struct-passing
Forbid 3-byte struct pass/return by value, document struct value pass/return
2023-05-03 13:57:09 +02:00
Bob Andrews
dd0e902a08
Merge pull request #2077 from bbbradsmith/doc-setbooloption-must-can
Document directives that use SetBoolOption "can" use +/- rather than "must"
2023-05-03 13:15:35 +02:00
Bob Andrews
88f581c796
Merge pull request #2076 from bbbradsmith/macro-axy-document
Don't use a,x,y in macro parameter example, document why not.
2023-05-03 13:10:57 +02:00
bbbradsmith
456fa9f963 cc65 document: both pass and return of structs are allowed 2023-05-03 05:36:37 -04:00
bbbradsmith
86e3a640d5 Support for three line ending types: \r, \r\n, \n.
#1894
2023-05-03 05:03:11 -04:00
bbbradsmith
2b60adfa11 Document directives that use SetBoolOption "can" use +/- rather than "must"
#1772
2023-05-03 03:26:10 -04:00
bbbradsmith
4d698bf18c Don't use a,x,y in macro parameter example, document why not.
#392
2023-05-03 03:05:14 -04:00
bbbradsmith
56c715af40 Error for struct/union with a duplicate member #2015 2023-05-03 01:14:27 -04:00
bbbradsmith
65f773f5ee Explicit z: should suppress "Suspicious address expression" warning #194 2023-05-03 01:01:21 -04:00
bbbradsmith
409235aee6 Optional warning for implicit constant conversion overflow 2023-05-02 22:27:28 -04:00
bbbradsmith
bf5b37a3b2 Error check for internal overflow of numerical constant
See bug #2026
2023-05-02 21:27:02 -04:00
bbbradsmith
bf22f94a43 struct pass and return by value test 2023-05-02 20:02:58 -04:00
bbbradsmith
af11d4d947 Document that struct-param is default off since: 3129266 2023-05-02 19:21:21 -04:00
bbbradsmith
e7046a02ff Disallow pass/return of 3-byte struct (#2022), document capability added in #1102. 2023-05-02 19:00:34 -04:00
Brad Smith
2c47ea45af
bug895.c compliant token pasting syntax to remove warnings
Gets rid of some unnecessary warning spam in the test log of lines like this:
```
bug895.c:95: Warning: Pasting formed "unsigned_long_14(", an invalid preprocessing token
```
2023-05-02 18:18:10 -04:00
bbbradsmith
1c26b1cf1b RHS primary integer promotion must happen after loading the primary, not before. See: #2060 2023-05-02 14:42:00 -04:00
Bob Andrews
805e98a7aa
Merge pull request #2027 from bbbradsmith/ca65_jmp_abs_wrap_cpu_filter
ca65 jmp (abs) wrap warning only applies to 6502, later CPUs do not have this bug
2023-05-02 12:52:03 +02:00
Bob Andrews
08223360d5
Update instr.c 2023-05-02 12:43:50 +02:00
Jeff Tranter
1fe39514bc Merge branch 'bootstrap-fix' of github.com:jefftranter/cc65 into bootstrap-fix 2023-05-01 10:13:52 -04:00
Jeff Tranter
4d97e30b55 Source listing in bootstrap.s is incorrect.
The OSI C1P alternative boot file format works, but the code in the
source listing does not match the ASCII-coded hex translation (which
is actually used). This is confusing to anyone trying to maintain the
code.

Also, the source code did not assemble when ASM is defined.

Also removed use of branch macros and an unnecessary "<" operator.

With these changes the source file should correctly match what
is used at run time.
2023-05-01 09:49:41 -04:00
Jeff Tranter
613ee94f44 Source listing in bootstrap.s is incorrect.
The OSI C1P alternative boot file format works, but the code in the
source listing does not match the ASCII-coded hex translation (which
is actually used). This is confusing to anyone trying to maintain the
code.

Also, the source code does not assemble when ASM is defined.

With these changes the source file should correctly match what
is used at run time.
2023-04-30 18:40:09 -04:00
Bob Andrews
e5f4ca6b89
Merge pull request #2058 from icepic/patch-1
Update lynxsprite.c
2023-04-19 15:07:16 +02:00
Janne Johansson
1f9594560e
Update lynxsprite.c
Remove compiler warning about (signed) char wrapping around to -1 when set to 255.
2023-04-19 09:15:03 +02:00
Bob Andrews
128b15a71e
Merge pull request #2051 from sodero/topic/disable_hardcoded_paths_on_amiga
Don't use hardcoded paths on Amiga
2023-04-08 17:40:47 +02:00
Ola Söder
2a7533268c Don't use hardcoded paths on Amiga
Hardcoded paths don't make sense on AmigaOS, AROS and MorphOS.
2023-04-07 23:44:30 +02:00
Christian Groessler
19349acdcf fix typo in README.md 2023-04-04 00:57:52 +02:00
Christian Groessler
ed4edd908b fix copy'n'paste typo 2023-04-04 00:40:33 +02:00
Bob Andrews
1f7318f527
Merge pull request #2042 from jefftranter/kim1-api-additions
Add Additional KIM-1 Functions
2023-03-30 20:23:54 +02:00
Jeff Tranter
3a5fbd34da Add KIM-1 functions to write to the 7-segment LED display and get
keypresses from the keypad.
Includes sample program illustrating how to use them.
Tested on real KIM-1 hardware.
2023-03-29 18:40:10 -04:00
Bob Andrews
d69117c0c1
Merge pull request #2037 from jefftranter/kim1-io-fixes
Fixes and improvements to KIM-1 i/o routines.
2023-03-29 22:41:34 +02:00
Bob Andrews
9fb4854f6c
Merge pull request #2040 from mooinglemur/20230328-cx16-r42
cx16: update RAM constants for ROM ver R42
2023-03-29 22:40:24 +02:00
mooinglemur
2dd558eae9 cx16: update RAM constants for ROM ver R42 2023-03-28 21:18:02 -07:00
Jeff Tranter
806ffe5675 Fixes and improvements to KIM-1 i/o routines.
Tested on real KIM-1 hardware.

read.s:
- Remove commented out line.
- Remove unused check for bell character.
- Remove echo of newline (hardware always echoes entered characters).
- This fixes gets() and fgets() so they return when CR is entered.

write.s:
- Fix check for adding return after linefeed (failed to work because OUTCHR changes A)
- Remove unused check for bell character.

kim1.inc:
- Add symbol for monitor entry

crt0.s:
- Jump to KIM-1 monitor by address rather than using BRK (which relies on vector being set in RAM)
2023-03-27 17:56:25 -04:00
Bob Andrews
f74775b841
Merge pull request #2036 from jefftranter/master
Make some documentation fixes for KIM-1 platform.
2023-03-27 17:57:14 +02:00
Jeff Tranter
fcbcbea4ad Make some documentation fixes for KIM-1 platform. 2023-03-27 09:23:40 -04:00
Bob Andrews
8692630369
Merge pull request #2032 from jedeoric/telestrat_lseek
[Telestrat Target]  Add fseek to telestrat target (Orix)
2023-03-19 11:51:24 +01:00
jede
c8c6fc6a40 add xfseek 2023-03-17 23:10:15 +01:00
Bob Andrews
7f1dd09bcb
Merge pull request #2028 from bbbradsmith/linker_test_overwrite
Linker test capability and overwrite segment tests
2023-03-09 18:20:48 +01:00
bbbradsmith
99220f60af test/asm readme val description revision 2023-03-07 18:53:30 -05:00
bbbradsmith
6be7c16013 linkter test with custom config should not use none.lib 2023-03-07 18:48:30 -05:00
bbbradsmith
4732e937ad overwrite segment tests
asm/listing linker CFG support
asm and asm/listing test documentation
2023-03-07 18:44:56 -05:00
bbbradsmith
8b818aac67 remove trailing space on segment "bytes" warning plural 2023-03-07 18:42:20 -05:00
bbbradsmith
016b03e356 ca65 jmp (abs) wrap warning only applies to 6502, later CPUs do not have this bug 2023-03-07 17:00:38 -05:00
Bob Andrews
c226e58a3c
Merge pull request #2007 from groessler/something_to_pull
fix for issue #1973 (printf("%c", '\0') doesn't _write '\0' to fd 0)
2023-03-04 13:30:18 +01:00
Bob Andrews
b9cf6266e7
Merge pull request #2010 from bbbradsmith/ca65_brk_optional_signature
optional BRK signature on all 6502 CPUs, not just 65816
2023-03-04 13:21:28 +01:00
Bob Andrews
c0559dd931
Merge pull request #2009 from bbbradsmith/ca65_feature_disable
ca65: allow .feature to both enable and disable
2023-03-04 13:08:18 +01:00
Bob Andrews
34189b85ab
Merge pull request #2013 from Movax12/fix-endmacro-not-at-start-of-line
Fix endmacro not at start of line
2023-03-03 12:29:30 +01:00
mvax
c092f57b73 Consistent case for .endmacro in comments, remove trailing spaces 2023-03-02 17:31:55 -05:00
mvax
90d5f41b37 Consistent case for .endmacro in comments 2023-03-02 17:26:05 -05:00
mvax
3f2129894b Fix .endmacro not at the start of the line. Rename test files. 2023-03-02 15:12:30 -05:00
Bob Andrews
6fe649ecab
Merge pull request #1994 from Compyx/make-avail-sanity-check
make avail: check for presence of binaries before creating symbolic links
2023-03-02 18:56:04 +01:00
mvax
98d2d9ee4e Fix .endmacro not at the start of the line. Fix style 2023-03-01 21:59:00 -05:00
mvax
0b71d1cfff Fix .endmacro not at the start of the line. Fix last commit 2023-03-01 21:55:14 -05:00
mvax
1c60bc5009 Fix .endmacro not at the start of the line. Fix style, add doc., add tests 2023-03-01 21:47:50 -05:00
mvax
993054c9d3 Fix .endmacro not at the start of the line. .ENDMACRO error with line number of macro definition start 2023-03-01 11:58:42 -05:00
mrdudz
ffa83c32a4 clean-up of driver return codes 2023-02-26 20:03:41 +01:00
mvax
7d894fbe04 Fix .endmacro not at the start of the line. Fix comment 2023-02-25 13:52:13 -05:00
mvax
4b29615f2b Fix .endmacro not at the start of the line. Allow empty macro 2023-02-25 13:49:19 -05:00
mvax
0a05f78d47 Fix .endmacro not at the start of the line. 2023-02-25 13:38:02 -05:00
mvax
429e90dffd Fix .endmacro in a .define in a macro body 2023-02-25 12:42:26 -05:00
mvax
e87325033d Fix .endmacro in a .define in a macro body 2023-02-25 12:39:36 -05:00
bbbradsmith
3d41a5b516 allow immedite style syntax variation for BRK signature byte 2023-02-25 08:23:47 -05:00
bbbradsmith
3f8252311e 65C816 document brk optional signature, and mvn/mvp syntax 2023-02-24 23:00:30 -05:00
bbbradsmith
cd8fa39066 optional BRK signature on all 6502 CPUs, not just 65816 (also COP) 2023-02-24 22:40:29 -05:00
bbbradsmith
c2bc40f213 test for all ca65 .feature options 2023-02-24 20:00:56 -05:00
bbbradsmith
230230819e document the undocumented test/asm/listing behaviours 2023-02-24 19:35:38 -05:00
bbbradsmith
da150aeeac allow .feature to both enable and disable 2023-02-24 18:00:58 -05:00
Bob Andrews
a299ef4210
Merge pull request #1995 from bbbradsmith/overwrite_segment_fix
ld65 fix overwrite segments adding wrong padding or causing internal errors
2023-02-24 21:27:33 +01:00
Bob Andrews
302d6ee4a4
Merge pull request #2001 from bbbradsmith/ca65_long_jsr_jmp_rts
ca65 jsr/jmp/rts will not promote to jsl/jml/rtl by default, new feature long_jsr_jmp_rts to re-enable this ability
2023-02-24 19:34:37 +01:00
Bob Andrews
12fc59351e
Merge branch 'master' into ca65_long_jsr_jmp_rts 2023-02-24 19:25:32 +01:00
Bob Andrews
e105f6049d
Merge pull request #2003 from bbbradsmith/large_align_false_positive_fix
supress spurious "large alignment" warnings
2023-02-24 16:32:41 +01:00
Bob Andrews
d810b12c6d
Merge pull request #1998 from bbbradsmith/ca65_local_scope_error_info
ca65 improve error for unclosed scopes
2023-02-24 16:24:05 +01:00
Bob Andrews
221e6b53ef
Merge pull request #1992 from bbbradsmith/optstackops_toscmpbool_fix
OptStackOps label migration fix
2023-02-24 13:43:07 +01:00
Bob Andrews
d808088c64
Merge pull request #1997 from bbbradsmith/doc_ca65_a8_a16_description
ca65 doc for A8/A18/I8/I16: use "assume" instead of "switch" to avoid implying that a hardware state is changed
2023-02-24 13:04:48 +01:00
Bob Andrews
0c462467e3
Merge pull request #1999 from bbbradsmith/ca65_ld65_warnings_as_errors
--warnings-as-errors for ca65 and ld65
2023-02-24 13:02:49 +01:00
Christian Groessler
fedfc3443d fix for issue #1973 (printf("%c", '\0') doesn't _write '\0' to fd 0) 2023-02-24 02:12:19 +01:00
bbbradsmith
ba038e921f jmp (abs) page wrapping should be an error, not a warning, also only applies to 6502 CPU 2023-02-21 17:06:21 -05:00
Bob Andrews
ac987e2439
Merge pull request #2000 from bbbradsmith/doc_cc65_intern_linker_config
Document expected linker configuration and special segments used by cc65
2023-02-21 22:00:23 +01:00
bbbradsmith
23cc295b08 improve description of large-alignment warning 2023-02-21 07:32:38 -05:00
bbbradsmith
13f1d37403 suppress spurious "large alignment" warning when the combined alignment is not larger than any of the explictly requested ones 2023-02-21 06:48:46 -05:00
bbbradsmith
2cdab999f5 dasm test extend 65816.info to include added code 2023-02-21 05:22:28 -05:00
bbbradsmith
4b29d257d9 fix dasm test65816 which relied on JMP automatic promotion, add test of new long_jsr_jmp_rts and smart 2023-02-21 04:38:42 -05:00
bbbradsmith
ccf3994e3b ca65 jsr/jmp/rts will not promote to jsl/jml/rtl by default, but can still be enabled with new feature long_jsr_jmp_rts 2023-02-21 04:00:34 -05:00
bbbradsmith
99ecd9b69d Document expected linker configuration and special segments used by cc65 2023-02-21 00:53:55 -05:00
bbbradsmith
45d0d60349 --warnings-as-errors for ca65 and ld65 2023-02-20 22:24:26 -05:00
bbbradsmith
f1134cc5f1 ca65 improve error for unclosed scopes
See: #1779
2023-02-20 20:49:04 -05:00
bbbradsmith
864eecf7c3 ca16 doc for A8/A18/I8/I16: use "assume" instead of "switch" to avoid implying that a hardware state is changed. See: #1759 2023-02-20 20:08:58 -05:00
compyx
68ce335f59 Replace shell code with GNU Make conditionals and functions
Use `ifeq` to provide two rules for the `avail` target: one that reports
an error if any of the symlink targets are missing and one that installs
the symlinks for the targets if they're all present.
2023-02-19 19:17:45 +01:00
Bob Andrews
d0f17ba602
Merge pull request #1996 from bbbradsmith/negative_memory_size_error
ld65 error if computed memory size is negative
2023-02-19 18:45:09 +01:00
Bob Andrews
0ff18510c3
Merge pull request #1993 from bbbradsmith/sim65_pvopen_safety
sim65 path length safety for PVOpen
2023-02-19 16:27:46 +01:00
bbbradsmith
3df5b9f41f relocate dasm test start-addr to avoid producing negative memory area size with none.cfg (conflicted with stack position at $8000) 2023-02-19 09:30:07 -05:00
bbbradsmith
5bc8ff98de error if computed memory size is negative 2023-02-19 09:01:17 -05:00
bbbradsmith
4fc19a3d4c ld65 overwrite segment should pad with fill value if the desired seek position is beyond the end of the file so far 2023-02-19 08:37:07 -05:00
bbbradsmith
2ac055383f ld65 fix overwrite segments adding wrong padding or causing internal errors 2023-02-19 08:14:04 -05:00
compyx
5c12659cf4 make avail: check for presence of binaries before creating symbolic
links

To avoid creating broken symlinks, first check if the binaries exists in
bin/ and exit when they don't, with a message to first run `make`.
2023-02-19 14:01:14 +01:00
bbbradsmith
4d30333099 sim65 path length safety for PVOpen 2023-02-19 05:31:46 -05:00
bbbradsmith
4e411e8526 Opt_a_tosicmp likely has a bug which will incorrectly migrate a label on a replaced op in one case. 2023-02-18 00:13:34 -05:00
bbbradsmith
78263cd24b Fix OptStackOps label migration case for toscmpbool, add test case 2023-02-17 23:48:32 -05:00
Bob Andrews
c097401f8b
Merge pull request #1991 from spiro-trikaliotis/fix-msys2-test
Remove .exe from file output
2023-02-17 18:29:39 +01:00
Spiro Trikaliotis
727b3288d6 Remove .exe from file output
Whenever a tool like ld65 wants to output its name into a log file, it
uses the name of command-line parameter 0. However, this parameter also
includes the .exe suffix if it is on Windows.

This patch removes the .exe suffix, so that the output is clean and
consistent across platforms.

This fixes #1990.
2023-02-17 17:22:55 +01:00
Bob Andrews
544a49c060
Merge pull request #1983 from mrdudz/fix1941
fix for #1941
2023-02-05 17:28:22 +01:00
mrdudz
8ac5e2f7b6 fix devicestr call, so related posix function work on cbm targets 2023-01-28 15:08:14 +01:00
mrdudz
1764b7aca9 fix for #1941, taken from 22d435b689 2023-01-28 12:29:05 +01:00
Bob Andrews
6267db6b01
Merge pull request #1980 from TommiRommi/patch-1
fixed spelling mistake
2023-01-28 11:29:50 +01:00
tomas
1d73c8d259
Update typeconv.c 2023-01-27 16:53:36 +00:00
tomas
ed909dba1d
fixed spelling mistake
there was a spelling mistake in one of pointer warnings
2023-01-27 10:52:20 +00:00
Christian Groessler
60f56c43c7 some documentation fixes 2023-01-18 11:55:52 +01:00
Bob Andrews
dbefd12571
Merge pull request #1968 from mseabold/master
Allow line_bynumber to return more than one result
2023-01-18 04:34:58 +01:00
Matt Seabold
3360734487 Update comment to match in source file 2023-01-17 22:17:23 -05:00
Matt Seabold
9ee0c835e5 Update documentation for line_bynumber 2023-01-17 22:15:27 -05:00
Bob Andrews
645fa982af
Merge pull request #1975 from marianodominguez/add_sound_documentation
add documentation for _sound.
2023-01-17 22:41:12 +01:00
Bob Andrews
cc9b91363f
Merge pull request #1971 from polluks2/patch-8
Create disk of GEOS samples
2023-01-17 22:36:53 +01:00
Mariano Dominguez
c6d183c31b add documentation for _sound. 2023-01-16 19:09:01 -08:00
Christian Groessler
67564d83c8 libsrc/atari/sound.s: fix indentation 2023-01-16 18:01:11 +01:00
Christian Groessler
c2e8f75bec
Merge pull request #1962 from marianodominguez/feature_add_sound_command
add sound command
2023-01-16 17:59:34 +01:00
Mariano Dominguez
40656ffb6e more style 2023-01-15 17:05:24 -08:00
Mariano Dominguez
6236e82850 change storage to pager zero
fix bug that kills keyboard.
2023-01-15 17:00:05 -08:00
polluks2
a5a8225a58
Create disk of GEOS samples
You don't need to convert anymore.
2023-01-14 13:49:16 +01:00
Matt Seabold
8ea0dfe453 Allow line_bynumber to return more than one result 2023-01-11 20:18:51 -05:00
Mariano Dominguez
42c39c6bfc remove trailing spacew, use correct user 2023-01-10 11:26:12 -08:00
Mariano Dominguez
27ecb555ea
Rename sound to _sound.
remove extra comments.
2023-01-10 11:16:36 -08:00
Bob Andrews
7979f8a41f
Merge pull request #1965 from polluks2/patch-7
Wrong file "geover.cvt"
2023-01-08 18:54:27 +01:00
polluks2
e4d9dbf0c0
Wrong file "geover.cvt"
See line 106
2023-01-08 17:47:04 +01:00
Mariano Dominguez
bf9fb6dcdb increase delay in sound test 2023-01-06 11:23:33 -08:00
Mariano Dominguez
196962adac remove lasy pesky space 2023-01-06 10:54:16 -08:00
Mariano Dominguez
2a961a870b add target test 2023-01-06 09:56:15 -08:00
Mariano Dominguez
c3e1ae3478 last trailing space 2023-01-05 21:36:44 -08:00
Mariano Dominguez
8c97b54f5d more trailing spaces :( 2023-01-05 21:34:43 -08:00
Mariano Dominguez
658c1ad711 only missing space 2023-01-05 21:33:40 -08:00
Mariano Dominguez
85f657b35e missing space 2023-01-05 21:30:31 -08:00
Mariano Dominguez
4e8b18c035 missing tab 2023-01-05 21:29:33 -08:00
Mariano Dominguez
29a80065cc fix tab indentation 2023-01-05 21:27:54 -08:00
Mariano Dominguez
30df733c31 remove dangling spaces 2023-01-05 21:20:16 -08:00
Mariano Dominguez
fa05294054 add newline for style 2023-01-05 21:16:58 -08:00
Mariano Dominguez
f9024d132a add sound command
this behives the same as BASIC

sound(voice, pitch, distortion, volume)
2023-01-05 21:12:58 -08:00
Bob Andrews
e944a30b6a
Merge pull request #1955 from davepl/master
Add KIM-1 support
2023-01-04 19:10:14 +01:00
Rutger van Bergen
7ea2d8ab18
Address review comment 2023-01-04 19:05:08 +01:00
Bob Andrews
072f4188ac
Merge pull request #1939 from acqn/TypeFix
[cc65] Renamed/added/removed some C type facility and fixed a few comments
2023-01-04 19:01:23 +01:00
Bob Andrews
167e940361
Merge pull request #1958 from karrika/sprite
[sp65] Sprite generation fixed for 1BPP Lynx sprites. Fix for #1957
2023-01-04 18:16:46 +01:00
Bob Andrews
ce3a987d2d
Merge pull request #1956 from karrika/master
[sp65] Add support for 4 pixels per plane. Add feature for current GIMP pcx files.
2023-01-04 17:42:38 +01:00
Bob Andrews
9cda019669
Merge pull request #1960 from karrika/palette
[sp65] New feature to extract the palette from the bitmap. Lynx format implemented. #1959
2023-01-04 17:25:34 +01:00
Bob Andrews
36a56faa14
Merge pull request #1961 from clbr/da816
Teach da65 about table units
2023-01-04 17:21:26 +01:00
karri
e2c6d06b0d Update dosc 2023-01-04 12:14:37 +02:00
Karri Kaksonen
34aa53affb
Merge branch 'cc65:master' into master 2022-12-30 17:48:04 +02:00
Lauri Kasanen
56a414593a Teach da65 about table units 2022-12-30 17:25:47 +02:00
Bob Andrews
cce119a9e7
Merge pull request #1871 from clbr/da816
da65 support for 65816
2022-12-30 15:34:40 +01:00
karri
878a20ab59 Fix dangling space 2022-12-30 15:27:17 +02:00
karri
b6d06288e0 Fix warnings 2022-12-30 15:20:54 +02:00
karri
f85951ab24 Add to build 2022-12-30 15:06:22 +02:00
karri
4117e94ed5 Add palette extraction functions 2022-12-30 14:44:18 +02:00
karri
c2e9e5961d Add fixed Lynx sprite generation 2022-12-30 12:57:50 +02:00
karri
f6b3bdda21 Add fixed Lynx sprite generation 2022-12-30 12:36:49 +02:00
karri
b4aa853e6f Add fixed Lynx sprite generation 2022-12-30 12:21:49 +02:00
karri
aed6591b19 Add new method GetBitmapBPP as we need it for sprite math 2022-12-30 12:16:46 +02:00
karri
ebd1381030 Use same style in comments 2022-12-29 21:55:25 +02:00
karri
9cb0667260 Use same style in comments 2022-12-29 21:53:50 +02:00
karri
5ec5050af2 Remove redundant code 2022-12-29 21:48:28 +02:00
karri
05766d4bfe Add support for 4 pixels per plane 2022-12-29 19:40:00 +02:00
karri
e953c1aa08 Add support for 4 pixels per plane 2022-12-29 19:28:16 +02:00
karri
817d129be8 Add support for 4 pixels per plane 2022-12-29 19:18:00 +02:00
Rutger van Bergen
37954dffe7 Specify supported tests 2022-12-26 20:26:29 +01:00
Rutger van Bergen
a8c6409689
Delete kimHello 2022-12-26 19:54:00 +01:00
Rutger van Bergen
ae23e47eb5
Merge branch 'cc65:master' into master 2022-12-26 13:57:10 +01:00
Oliver Schmidt
de30a57c0c Added minimalistic terminal program.
So far there was no sample code at all making use of the serial drivers.
2022-12-23 16:20:26 +01:00
Oliver Schmidt
1daa445310 Fixed recently introduced addressing mode bug. 2022-12-22 22:09:23 +01:00
Oliver Schmidt
d90c7e9853 Introduced the notion of a standard serial driver.
There's no target with more than one serial driver (and I don't see that change anytime soon) so it's a no-brainer to apply the standard driver concept to serial drivers.
2022-12-22 18:13:24 +01:00
mrdudz
d9ebfa7192 all good things are three 2022-12-11 12:29:11 +01:00
mrdudz
2b941e255a move test. oops 2022-12-11 12:22:41 +01:00
mrdudz
ddab16007a run branch fixer again after replacing BRA by JMP. should fix #1936 2022-12-11 12:08:30 +01:00
Bob Andrews
299f764c5d
Merge pull request #1942 from IrgendwerA8/patch-1
Fixed floating point naming in Contributing.md
2022-12-07 08:21:24 +01:00
Irgendwer
78e6bcf643
Update Contributing.md 2022-12-07 00:20:20 +01:00
Bob Andrews
dae4b2d9b0
add note on optimizer 2022-12-06 14:47:03 +01:00
mrdudz
bad961b36f add missing newline 2022-11-28 06:34:05 +01:00
mrdudz
61ee5fe1d5 test for bug #1933 2022-11-28 06:26:47 +01:00
mrdudz
15eb1c5f5e support the msvc specific I64 specifier in our sprintf 2022-11-28 06:26:14 +01:00
mrdudz
05c2530243 it should have been I64x, not I64u 2022-11-28 06:25:45 +01:00
Bob Andrews
765e7d1efa
Merge pull request #1927 from smuehlst/osi-conio-chardefs
Character defines for osic1p target
2022-11-28 04:15:34 +01:00
Stephan Mühlstrasser
a46de2f6d4 Fix macro order 2022-11-20 15:22:37 +01:00
Stephan Mühlstrasser
484e1dc9fd Character defines for osic1p target
Added character definitions for line graphics and enter character
for osic1p target.
2022-11-20 13:30:57 +01:00
Stephan Mühlstrasser
ec652367d0 Support targets without cursor keys
Not all targets to have cursor keys on their keyboard. Add corresponding
#ifdefs to the conio test program.
2022-11-20 13:28:45 +01:00
Bob Andrews
e4f01a260d
Merge pull request #1844 from mrdudz/underscores
Fix name conflicts in standard headers by adding more Underscores
2022-11-19 22:09:03 +01:00
mrdudz
9a9bf9f2ea update note on identifiers 2022-11-19 19:06:14 +01:00
mrdudz
d6c37a757d Merge branch 'master' into underscores 2022-11-19 17:11:11 +01:00
Bob Andrews
3513342445
Merge pull request #1913 from acqn/Diagnostics
[cc65] Improved diagnostics on div-by-zero/bitwise-shift in unevaluated context and overall
2022-11-18 19:55:51 +01:00
Bob Andrews
a0a9cfdcd3
Merge pull request #1918 from acqn/PPFix
[cc65] Fixed bitwise-shift in preprocessor
2022-11-18 19:09:55 +01:00
Bob Andrews
93b015660d
Merge pull request #1899 from acqn/TypeCmpFix
[cc65] Fixed compatibility checks on "pointer to pointer" vs "pointer to array" etc.
2022-11-18 19:04:35 +01:00
mrdudz
eb8dbcd04d really update all jobs 2022-11-18 19:00:35 +01:00
mrdudz
9d78e10d4b update actions to use node16 instead of node12 2022-11-18 18:39:58 +01:00
mrdudz
b166dc4261 hopefully thats it 2022-11-18 18:19:31 +01:00
mrdudz
4c047bf11e yawn 2022-11-18 18:13:54 +01:00
mrdudz
bbe8c62e9d coffee 2022-11-18 18:13:15 +01:00
mrdudz
a6feeac5ed or msvc I64u ? 2022-11-18 18:10:07 +01:00
mrdudz
ca94cfcbac that perhaps? 2022-11-18 18:03:40 +01:00
mrdudz
4c6fddd300 i want a cookie each time i do this 2022-11-18 17:58:12 +01:00
mrdudz
feb839e7f0 narrisch werd i! 2022-11-18 17:55:22 +01:00
mrdudz
8a9029d393 hnnngg 2022-11-18 17:50:32 +01:00
mrdudz
c6ecee0748 Babydino sagt: nochmal! 2022-11-18 17:45:21 +01:00
mrdudz
5fb20dec91 commit message 2022-11-18 17:41:22 +01:00
mrdudz
5638e0916a spül es noch einmal, Sam 2022-11-18 17:39:35 +01:00
mrdudz
d1b7768064 yeah! 2022-11-18 17:27:51 +01:00
mrdudz
d68598165c and another 2022-11-18 17:24:05 +01:00
mrdudz
d459b5da87 another try 2022-11-18 17:20:44 +01:00
mrdudz
fdcc683997 shoot in the dark, try to fix ming build issue 2022-11-18 17:13:37 +01:00
Bob Andrews
0408d71cc5 fixes so "make clean" will work without failing on cmd.exe 2022-11-18 16:28:25 +01:00
Bob Andrews
1ce044c2b4
Merge pull request #1916 from spiro-trikaliotis/split-asm-listing-test-stdout-stderr
Split stdout and stderr in test/asm/
2022-11-18 16:17:20 +01:00
Bob Andrews
88b926e914
Merge pull request #1917 from acqn/CodeGen
[cc65] Clearer comments on and usage of code generator flags with type conversions in the primary register
2022-11-13 12:51:17 +01:00
acqn
dadca9e033 Fixed bitwise-shift in PP. 2022-11-13 16:32:41 +08:00
acqn
3bcfa735cb clearer comments on and usage of code generator flags with type conversions in the primary register. 2022-11-13 14:57:48 +08:00
Spiro Trikaliotis
d7a804d120 Split stdin and stdout in test/asm/
Some tests pipe the stdout and stderr of the compiler or assembler into
a file and compare the result with a reference. This has the subtle
problem that both stdout and stderr and buffered i/o streams that may or
may not work the same on different OSs or even shells. That means the
order of the lines in the resulting file is not guaranteed.

In practise it is "mostly" not an issue, but "we" still stumbled about
one test where different behaviour can be triggered depending on running
it in cmd.exe or bash (msys): test/asm/listing output of
010-paramcount.bin differs from the reference output when running the
test from cmd.exe.

The solution is most likely to have two reference files and not redirect
into one file.

This patch fixes the issue (cf. #1912) for the directory test/asm/.
2022-11-12 23:12:25 +01:00
acqn
7b436e9823 Added tests for #1895 fix. 2022-11-13 01:01:24 +08:00
acqn
9d693d2c80 Warnings instead of errors for division-by-zero/modulo-with-zero in evaluation. 2022-11-12 22:13:56 +08:00
acqn
cc177208b4 Added tests for diagnostics in unevaluated context. 2022-11-12 21:05:01 +08:00
acqn
73897aface Additional check for out of ranges of bit-fields in bitwise-shifts. 2022-11-12 12:36:22 +08:00
acqn
75be73cc8d Added utility functions to acquire bit width of types. 2022-11-12 12:32:27 +08:00
acqn
d0c9b2de99 Added basic shift count check for <<= and >>= operations. 2022-11-12 12:34:16 +08:00
acqn
2c3ca15d90 Fixed marking unevaluated subexpressions for conditional operator. 2022-11-12 12:32:27 +08:00
acqn
3af77e7333 Improved error recovery in declarations with curly braces. 2022-11-12 12:28:29 +08:00
acqn
eb595b1f5f Improved error recovery with K&R-style function declarations. 2022-11-12 12:28:27 +08:00
acqn
894ba49cb5 Improved error messages about missing type specifiers. 2022-11-12 12:28:24 +08:00
acqn
b0ef3572ea Improved error messages about missing identifiers. 2022-11-12 12:28:22 +08:00
Bob Andrews
6924d44564
Merge pull request #1911 from acqn/TypeFix
[cc65] Organized type-related stuff better
2022-11-11 22:05:45 +01:00
Bob Andrews
ec2688b50e
Merge pull request #1910 from acqn/DeclFix
[cc65] Renamed a few functions and struct used for declaration parser
2022-11-11 21:41:04 +01:00
Bob Andrews
ace39197e5 move test to test/ref 2022-11-11 21:22:20 +01:00
Bob Andrews
9c48c0ab8a
Merge pull request #1900 from acqn/Diagnostics
[cc65] Fixed endlessly repeated error messages when a declaration lacks a required identifier
2022-11-11 21:08:53 +01:00
Bob Andrews
ebb33ee8b4 fix problem with copy command in cmd.exe 2022-11-11 20:54:38 +01:00
acqn
9253f0d6bc Added testcase for #1889. 2022-11-10 02:11:54 +08:00
mrdudz
a09053ce0b make test work again also on linux. why did this not break the github actions? 2022-11-09 01:07:36 +01:00
acqn
e10b5fd79b Renamed a few functions and struct used for declaration parser. 2022-11-08 14:42:52 +08:00
Bob Andrews
800c30604f
Merge pull request #1909 from silverdr/master
Updated ATTR_UNUSED() for clang
2022-11-06 14:06:56 +01:00
Silver Dream !
2dcccae036 Updated ATTR_UNUSED() for clang 2022-11-06 11:27:08 +00:00
mrdudz
5d1ad05cb8 oops 2022-11-05 20:48:53 +01:00
mrdudz
e5777f7ccf add ATTR_UNUSED on the flags variable 2022-11-05 20:38:07 +01:00
mrdudz
1452d8164d add ATTR_UNUSED and ATTR_NORETURN 2022-11-05 20:37:41 +01:00
Bob Andrews
d066fbbcf5
Merge pull request #1908 from mrdudz/maketweaks
cmd.exe related tweaks
2022-11-05 19:55:53 +01:00
mrdudz
bf924395fb fix some bashisms, hopefully makes "check" work again in cmd.exe 2022-11-05 19:41:02 +01:00
Bob Andrews
680aacd4a7
Merge pull request #1907 from acqn/InputLineInfo
[cc65] Renamed some misleading functions relevent with input file info
2022-11-05 18:45:17 +01:00
mrdudz
699ba1fbd6 when running on cmd.exe only print a message, the style tests
require bash
2022-11-05 16:42:01 +01:00
Bob Andrews
53b62184e8
Merge pull request #1905 from acqn/DeclFix
[cc65] Fixed some missing declaration features
2022-11-05 16:03:09 +01:00
Bob Andrews
fe43e13706
Merge pull request #1906 from acqn/Testcase
[cc65] Renamed several tests
2022-11-05 15:35:18 +01:00
acqn
e608f8a94f Renamed several tests. 2022-11-05 18:30:02 +08:00
Bob Andrews
fef8436eb4
Merge pull request #1881 from acqn/ExprDesc
[cc65] Organized ExprDesc functions and fixed several comments
2022-11-04 14:22:22 +01:00
Bob Andrews
7146dbc87d
Merge pull request #1879 from acqn/SymEntryFix
[cc65] SymEntry cleanups
2022-11-04 14:06:47 +01:00
mrdudz
79fd078ae3 add check for line endings containing CR. 2022-11-03 18:27:10 +01:00
mrdudz
cc450706d1 testcase related to bug #1888 2022-11-03 18:03:47 +01:00
mrdudz
44b2e4f331 added examples for tests that compare the compiler output with a reference 2022-11-03 17:40:13 +01:00
acqn
8a7f566387 Fixed support for storage class specifiers after type specifiers. 2022-11-03 21:46:42 +08:00
acqn
991af3755b Added support for _Static_assert in unions. 2022-11-03 21:46:41 +08:00
Lauri Kasanen
9aae1efd03 Add a da65 65186 test 2022-11-03 08:17:51 +02:00
Lauri Kasanen
3ea999f034 Correct mvn, mvp, pei 2022-11-03 08:17:51 +02:00
Lauri Kasanen
b90bf258e2 Implement far override 2022-11-03 08:17:51 +02:00
Lauri Kasanen
db351b4228 Output remaining long labels 2022-11-03 08:17:51 +02:00
Lauri Kasanen
65907b1f10 Output MX states 2022-11-03 08:17:51 +02:00
Lauri Kasanen
4b04f81d37 Fix jsl length 2022-11-03 08:17:51 +02:00
Lauri Kasanen
1294c1c253 Implement changing-size opcodes 2022-11-03 08:17:51 +02:00
Lauri Kasanen
e8ee8435e9 Add addrMode to RANGE 2022-11-03 08:16:45 +02:00
Lauri Kasanen
89fc5e30c4 Remove unused and conflicting value 2022-11-03 08:15:48 +02:00
Lauri Kasanen
ea924ededd Teach attrtab, labels and comments about long addresses 2022-11-03 08:15:48 +02:00
Lauri Kasanen
67384a29b7 Start on 65816 2022-11-03 08:08:38 +02:00
Bob Andrews
0eba33ee74
Merge pull request #1897 from acqn/TernaryFix
[cc65] Fixed errors in the conditional operator "? :" parser
2022-11-02 18:13:45 +01:00
Bob Andrews
37efb40c69
Merge pull request #1898 from acqn/PPFix
[cc65] Fixed '\\' + newline
2022-11-02 18:09:04 +01:00
Bob Andrews
d151a1e38a
Merge pull request #1902 from silverdr/master
Silencing confusing util/zlib 'warning' target
2022-11-02 18:00:53 +01:00
Silver Dream !
c90d078fb7 Silencing confusing util/zlib 'warning' target 2022-11-02 16:43:21 +00:00
Bob Andrews
5fd2b6fe4b
Merge pull request #1896 from acqn/EnumFix
[cc65] Fixed diagnostic messages on enumerator overflow
2022-11-02 17:34:31 +01:00
Bob Andrews
eede412959
Merge pull request #1885 from clbr/da65-range-end
Allow specifying range end as a size
2022-11-02 17:15:38 +01:00
acqn
aa5d44b2b0 Fixed endlessly repeated error messages when a declaration lacks a required identifier. 2022-11-02 23:58:20 +08:00
acqn
9b39c3f949 Fixed garbage enum tag name appeared in diagnostic messages if the enum tag declaration failed. 2022-11-02 23:58:18 +08:00
acqn
d2f74db4d8 Fixed compatibility checks on "pointer to pointer" vs "pointer to array" etc. 2022-11-02 22:44:57 +08:00
acqn
deb5e97732 Fixed diagnostic messages on enumerator overflow.
An enumerator that would be incremented greater than ULONG_MAX now causes an error.
2022-11-02 14:22:21 +08:00
acqn
e9413567d7 Renamed several functions relevent with input file info. 2022-11-02 14:16:15 +08:00
acqn
8fb2576626 Fixed processing '\\' followed with a newline and line number output (-E) with it. 2022-11-02 14:09:15 +08:00
acqn
d84cc2d122 Fixed errors in the conditional operator "? :" parser. 2022-11-02 13:56:55 +08:00
Lauri Kasanen
c95c9c2749 Allow specifying range end as a size 2022-10-27 18:20:37 +03:00
acqn
b81e54c1d2 Organized ExprDesc functions and fixed several comments. 2022-10-24 14:55:39 +08:00
acqn
03ceeb4ad1 Removed warning on implicit "return 0" in C99 standard main function in default cc65 mode. 2022-10-22 12:45:51 +08:00
Bob Andrews
ad7c5a6617
Merge pull request #1878 from clbr/sim65opt
Speed up sim65 by 10%
2022-10-17 17:46:11 +02:00
Lauri Kasanen
b052e64089 Speed up sim65 by 10% 2022-10-17 13:32:38 +03:00
Bob Andrews
34ff99aef0
Merge pull request #1877 from bbbradsmith/integer_constant_warning_rephrase
Rephrasing warnings for suspicious decimal integer constants
2022-10-16 22:15:59 +02:00
Bob Andrews
89031594eb
Merge pull request #1876 from bbbradsmith/constant_overflow_warning
Emit warning for signed integer constant overflow
2022-10-16 22:15:22 +02:00
Bob Andrews
b2238fdcd4
Merge pull request #1868 from acqn/PPFix
[cc65] Fixed and improved C preprocessor
2022-10-16 19:02:23 +02:00
Bob Andrews
3aadf6c66e
Merge pull request #1867 from acqn/Diagnostics
[cc65] Diagnostics improvements
2022-10-16 18:26:26 +02:00
bbbradsmith
66698d4b1a Rephrasing warnings for suspicious decimal integer constants 2022-10-14 16:47:11 -04:00
bbbradsmith
4540205b0d Emit warning for signed integer constant overflow 2022-10-13 23:49:07 -04:00
Bob Andrews
4ed31cec69
Merge pull request #1870 from clbr/postproc-compilefix
Fix compilation after the postproc merge
2022-10-12 21:44:46 +02:00
Bob Andrews
f1612218a3
Merge pull request #1874 from clbr/sprintf-clarify
Clarify sprintf-test's output so it doesn't look like the entire test…
2022-10-12 17:54:30 +02:00
Lauri Kasanen
1e6279aee5 Clarify sprintf-test's output so it doesn't look like the entire test bench summary 2022-10-12 18:38:33 +03:00
Lauri Kasanen
d52ef67d51 Fix compilation after the postproc merge 2022-10-12 10:28:14 +03:00
acqn
e57c409894 Fixed TypeHasAttrData(), GetSignedType() and GetUnsignedType(), none in use yet though. 2022-10-12 13:13:15 +08:00
acqn
45da20e770 Fixed CheckedSizeOf() for unknown-size types (no such use case yet though). 2022-10-12 13:13:37 +08:00
acqn
1dccd1333b Added more type utility functions.
Changed result of GetBasicTypeName() for unknown types from "type" to "<type>".
2022-10-12 13:10:17 +08:00
acqn
cf3a0c4a30 Corrected and entailed comments and cleaned up code with type comparison. 2022-10-13 13:45:22 +08:00
acqn
01d2b809a1 Renamed struct Segments to SegContext as well as some related functions. 2023-10-21 23:41:36 +08:00
acqn
5fd9169904 Renamed type facility functions for deciding code generation type flags. 2022-10-12 13:10:17 +08:00
acqn
a4a1230c62 Renamed some C type facility and fixed a few comments.
Added some new C type code facility.
Removed some unused type predicates.
2022-10-12 13:10:17 +08:00
acqn
feaedc5b50 Better organized stuff related to C types. 2022-10-12 13:10:17 +08:00
acqn
a2dfa7c721 More consistent names for SymEntry functions. 2022-10-12 13:10:17 +08:00
acqn
164eb198ce Moved type facility functions for deciding code generation type flags. 2022-10-12 13:10:17 +08:00
acqn
d1e84a6dae Avoided unnecessary BSS name duplication for tentative global variables. 2022-10-11 14:23:21 +08:00
acqn
2cda47cd36 More descriptive names for SymEntry usage. 2022-10-11 14:14:48 +08:00
acqn
959be2c98c SymEntry struct cleanups. 2022-10-11 14:14:38 +08:00
Bob Andrews
71d64a3c1c
Merge pull request #1857 from acqn/PPFix
[cc65] Improved preprocessor
2022-10-09 19:00:07 +02:00
Bob Andrews
a169e67e43
Merge pull request #1863 from acqn/LinkageFix
[cc65] Fixed symbol visibility and usage problems with extern/static declarations
2022-10-09 18:59:12 +02:00
Bob Andrews
911ff40f6b
Merge pull request #1862 from acqn/Testcase
[cc65] Renamed some more testcases
2022-09-30 16:50:02 +02:00
acqn
9eab36b95a Fixed block-scope extern declarations visibility.
Fixed missing file-scope static function codegen output in a rare care.
2022-09-30 14:32:08 +08:00
acqn
f6003b8e8c Renamed some testcases. 2022-09-30 09:41:54 +08:00
acqn
9900e7361d #pragma message now uses the new "note" level message routine. 2022-09-30 09:09:09 +08:00
Bob Andrews
702ec52161
Merge pull request #1861 from acqn/TestcaseFix
[cc65] Testcase whitespace/comments fixes
2022-09-29 17:53:14 +02:00
acqn
715aa919e6 C++ style comments in C89 mode will cause errors only once per input file. 2022-09-29 19:47:31 +08:00
acqn
29c9cb3e00 Improved diagnostics on conflicting type declarations. 2022-09-29 19:38:32 +08:00
acqn
96df4e8b5e Added a diagnostic level "note" for infomative messages. 2022-09-29 19:38:32 +08:00
acqn
1cbd6bc3f9 Fixed comments in test/val/bug1462-biefield-assign-4.c. 2022-09-29 18:23:41 +08:00
acqn
376afd0edb Fixed trailing spaces in some testcases. 2022-09-29 18:23:32 +08:00
acqn
133507b031 Fixed line info for #pragma messages and diagnostics. 2022-09-29 17:55:09 +08:00
mrdudz
846d51db72 change line endings to unix style, should fix #1858 2022-09-22 20:29:57 +02:00
Rutger van Bergen
61f48f7620 Merge branch 'kim1' of github.com:davepl/cc65 2022-09-19 23:58:26 +02:00
Rutger van Bergen
3b431d9fa3 Remove trailing whitespace 2022-09-19 23:57:26 +02:00
David W Plummer
c43b3582db
Merge pull request #1 from davepl/kim1
Add KIM-1 Support
2022-09-19 14:20:29 -07:00
David W Plummer
ab6840712b
Update kim1.sgml 2022-09-19 14:17:41 -07:00
Rutger van Bergen
3dd8968876 Merge branch 'master' of github.com:davepl/cc65 into kim1 2022-09-19 21:59:57 +02:00
Rutger van Bergen
fa6a5d9b72
Merge branch 'cc65:master' into master 2022-09-19 20:31:36 +02:00
Rutger van Bergen
2b07204952
Merge branch 'cc65:master' into kim1 2022-09-19 20:03:23 +02:00
Rutger van Bergen
d2a8e907ae
Merge pull request #2 from davepl/kim1-doc
Add documentation, make capitalization uniform
2022-09-19 19:59:19 +02:00
Rutger van Bergen
cb8cb876ec Add documentation, make capitalization uniform 2022-09-19 19:56:57 +02:00
Bob Andrews
65ce036b2e
Merge pull request #1854 from acqn/Testcase
[cc65] Renamed, fixed and added testcases
2022-09-19 13:19:09 +02:00
Rutger van Bergen
6cb6c241aa
Merge branch 'cc65:master' into master 2022-09-19 03:20:49 +02:00
acqn
5e7d9b5fe3 Renamed a few testcases. 2022-09-18 22:29:41 +08:00
acqn
080ec131d8 Added testcase for constant operands with side-effects. 2022-09-18 22:29:30 +08:00
acqn
16ba232d08 Fixed some testcases. 2022-09-18 22:29:01 +08:00
mrdudz
6fc2cd9f61 add test related to bug #1853 2022-09-17 14:42:18 +02:00
mrdudz
fd6d00a4dd revert 6096a24 - this breaks the case when the "label" is an expression containing spaces.
fixes bug #1853
2022-09-17 14:41:59 +02:00
Oliver Schmidt
5493c9e7c2
Don't empty the Receive Data Register on filling the Transmit Data Register
The Receive Data Register and the Transmit Data Register share share a single address. Accessing that address with STA abs,X in order to fill the Transmit Data Register causes a 6502 false read which causes the Receive Data Register to be emptied.

The simplest way to work around that issue - which I chose here - is to move the base address for all ACIA accesses from page $C0 to page $BF. However, that adds an additional cycle to all read accesses. An alternative approach would be to only modify the single line `sta ACIA_DATA,x`.
2022-09-08 17:11:30 +02:00
mrdudz
253af1ed07 Force 16bit address for absolute-indirect-x-indexed in 65816 mode.
should fix issue #1846 (and hopefully not break anything :))
2022-09-03 18:36:40 +02:00
Bob Andrews
1d01777943
Merge pull request #1849 from acqn/StructFix
[cc65] Reverted E_ADDRESS_OF logic fix
2022-09-02 17:27:34 +02:00
Bob Andrews
fe0d383bea
Merge pull request #1850 from polluks2/patch-6
Don't hide errors in error handling
2022-09-02 12:08:40 +02:00
polluks2
446a785f95
Don't hide errors in error handling
You don't want the low byte, see grep _ERR_ libsrc/tgi/*
2022-09-02 11:55:54 +02:00
acqn
b4ddd01d78 Fixed checks on __VA_ARGS__. 2022-09-01 12:58:52 +08:00
acqn
950606d46a Improved diagnostics on wrong number of arguments in function-like macro calls. 2022-09-01 12:59:00 +08:00
acqn
92f94e4e5b A space character will be inserted in front of a leading '#' pp-token as the result of macro expansion. 2022-09-01 12:58:52 +08:00
acqn
770e529b20 Fixed newline counting inside old C style comments. 2022-09-01 12:58:52 +08:00
acqn
3d1e322519 Fixed keeping spacing in certain rare cases. 2022-09-01 12:58:52 +08:00
acqn
942ee47d05 Changed supposed usage of the original line input stack. It is now used for reusing input lines. 2022-09-01 12:58:52 +08:00
acqn
dc001cb4be Reverted E_ADDRESS_OF logic fix.
Added testcase.
2022-09-01 12:56:46 +08:00
mrdudz
5bda57de87 add extra underscore to _bzero, add a test for bzero/memset 2022-08-29 23:20:48 +02:00
mrdudz
3b03a96375 add underscores to _poserror and _stroserror 2022-08-29 21:06:48 +02:00
mrdudz
89c08dc6d4 extra underscores for _randomize and _swap 2022-08-29 20:52:35 +02:00
mrdudz
145adf61ea define old names also for heap stuff 2022-08-29 20:10:21 +02:00
mrdudz
b09024aa32 add extra underscore to heap stuff 2022-08-29 19:55:48 +02:00
mrdudz
df4b6f9d14 remove extra spaces 2022-08-28 22:37:33 +02:00
mrdudz
54aff47513 fix some errno related stuff, "make all" works again 2022-08-28 22:09:44 +02:00
mrdudz
2dabb65ee0 fix errno related underscores in all libsrc/*.s files 2022-08-28 21:52:53 +02:00
mrdudz
5d390489a8 fix underscores in errno (and related) headers 2022-08-28 21:36:22 +02:00
mrdudz
6ba3deffa4 use __clocks_per_sec instead of _clocks_per_sec 2022-08-28 20:22:25 +02:00
mrdudz
f70020a2b8 use __sig_ign and __sig_dft instead of _sig_ign and _sig_dft 2022-08-28 20:18:34 +02:00
mrdudz
9246775ebe use __afailed instead of _afailed 2022-08-28 20:08:13 +02:00
mrdudz
8e5f6b822d fix setjmp.h 2022-08-28 20:05:11 +02:00
mrdudz
ce6ee1b891 test some more possible cases and move test into test/val 2022-08-28 03:43:54 +02:00
mrdudz
d371046ae4 Despite not technically needed, it seems to be desirable to remove all trailing whitespace from inline assembly 2022-08-28 03:43:02 +02:00
mrdudz
6096a24f1d dont add whitespace after a label to the actual label, this fixes the root cause of #1252 2022-08-28 03:41:48 +02:00
Bob Andrews
eb21e484ee
Merge pull request #1842 from acqn/PPCounter
[cc65] Added support for the popular __COUNTER__ macro
2022-08-27 11:18:29 +02:00
mrdudz
168f42bb83 fix whitespace 2022-08-27 02:14:52 +02:00
mrdudz
41b29d5c81 add testcase related to issue #1252 2022-08-27 02:10:02 +02:00
mrdudz
90b9438b48 added testcase related to issue #1768 2022-08-27 01:15:06 +02:00
Bob Andrews
d2628d5949
Merge pull request #1840 from acqn/FnParamFix
[cc65] Fixed function parameters declared as function types rather than function pointers
2022-08-26 23:19:55 +02:00
Bob Andrews
68610490c9
Merge pull request #1837 from acqn/PPLineFix
[cc65] Fixed predefined __FILE__, __LINE__ and added missing preprocessing directive #line
2022-08-26 23:12:59 +02:00
Bob Andrews
13fbd7d1b4
Merge pull request #1836 from acqn/PPDiag
[cc65] Fixes and improvements for preprocessor diagnostics and error handling
2022-08-26 23:08:29 +02:00
acqn
1dbc5cb325 Simple testcase for __LINE__, __FILE__ as well as #line. 2022-08-24 16:39:44 +08:00
acqn
26945c32ac Fixed function parameters declared as function types rather than function pointers. 2022-08-24 15:30:52 +08:00
Bob Andrews
22ea30c75f
"cat" result to console on failure (only on *nix right now) 2022-08-23 11:56:05 +02:00
acqn
9f8bfb859c Fixed handling adjacent macro expansions that should not concatenate.
Example: F()G /* expansion results of F() shall not be concatenated with G */
2022-08-22 14:34:50 +08:00
acqn
c7ff416ce9 Fixed wide strings for preprocessor. 2022-08-22 14:34:50 +08:00
acqn
be95cb8f58 Fixed stringized macro argument concatenation.
Example: #define s(a) L## #a.
2022-08-22 14:34:50 +08:00
acqn
6260414136 The '#' operator in macro replacement is now checked at macro definition instead of macro expansion. 2022-08-22 14:34:50 +08:00
acqn
2f6b5621cc Changed handling on nested macro replacement to match up with the behavior of other major C compilers, which is unspecified by the C standard. 2022-08-22 14:34:50 +08:00
acqn
95e5471cd6 Better preprocess macro expansion. 2022-08-22 14:34:50 +08:00
acqn
57ad7c8766 Improved diagnostics about C++ style comments for c89. 2022-08-22 14:31:53 +08:00
acqn
fd7f32ecd3 Improved error handling and diagnostics with failed macro definitions. 2022-08-22 14:31:51 +08:00
Bob Andrews
8605393953
Merge pull request #1834 from acqn/PPFix
[cc65] Minor improvements, fixes and cleanups with the preprocessor
2022-08-21 19:18:46 +02:00
Bob Andrews
f838ba7341
Merge pull request #1833 from acqn/TokenizerFix
[cc65] Tokenizer fixes
2022-08-21 17:45:38 +02:00
acqn
47ee543fe0 Added testcase for some part of PR #1833. 2022-08-21 00:11:19 +08:00
Bob Andrews
12b9b10355
Merge pull request #1832 from acqn/PPDefineFix
[cc65] Preprocessor directive #define fixes
2022-08-20 14:27:25 +02:00
Bob Andrews
03421694b2
Merge pull request #1817 from acqn/PPFix
[cc65] More preprocessor fixes
2022-08-19 21:37:16 +02:00
Bob Andrews
98491d7c92
Merge pull request #1831 from acqn/DeclFix
[cc65] Fixed issues with forward declaration of enums and global static variables put on zeropage
2022-08-19 20:58:28 +02:00
acqn
3fbefdef45 Fixed warning on forward declaration of enums.
Fixed the issue that global static variables put on zeropage were missing optimization.
2022-08-19 18:48:52 +08:00
acqn
9565f41381 Improved Diagnostic with #include. 2022-08-19 13:27:56 +08:00
acqn
5d5bd472c6 Removed extra whitespace at line ends in preprocess-only output (-E).
Increased threshold from 5 to 7 for skipped newlines with #line directives in preprocess-only output (-E).
2022-08-22 00:27:21 +08:00
acqn
79f97e7714 Reused code more for macros in preprocessing directives. 2022-08-22 00:24:28 +08:00
acqn
cf7558add3 Added check for ## at either end of macro expansion. 2022-08-18 23:16:29 +08:00
acqn
b93f9fbba4 Updated documents about the predefined macros. 2022-08-18 22:51:23 +08:00
acqn
47d5e74a6e Modified way to keep undefined macro handling more consistent. 2022-08-18 22:51:23 +08:00
Bob Andrews
b8211a2921
Update Contributing.md 2022-08-17 21:42:42 +02:00
acqn
624e5025b0 Fixed parsing wide char constants. 2022-08-17 22:28:00 +08:00
acqn
5cca1e8b1d Fixed parsing numeric constants. 2022-08-11 10:55:16 +08:00
Bob Andrews
623f047397
Merge pull request #1509 from mrdudz/rremd
C64 Retro Replay EMD driver
2022-08-11 01:11:16 +02:00
Bob Andrews
38c4449ab1
Merge pull request #1826 from alejandro-colomar/master
Make NULL conform to POSIX
2022-08-11 01:10:16 +02:00
mrdudz
c1fd3218df add test related to pr #1799 2022-08-11 00:59:09 +02:00
mrdudz
f942c629d7 simple test related to issue #1655 2022-08-11 00:04:36 +02:00
Bob Andrews
ec310fceb8
Merge pull request #1825 from ReallyNiceGuy/master
Revert: Parse file included inside a macro at definition time
2022-08-11 00:03:12 +02:00
Alejandro Colomar
f14e793197 Make NULL conform to POSIX
POSIX.1-2008 tightened the definition of NULL to be 0 cast to the
type 'void *'.

Defining NULL as 0 is problematic, because it requires users to
cast NULL to a pointer type before passing it to variadic
functions.  Using POSIX's definition is safer, because NULL can be
used in all contexts without a cast, due to the alignment of
'void *' and 'char *' being the same.  It also helps the compiler
be able to detect when NULL is being used in an integer context.

Link: <http://ewontfix.com/11/>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2022-08-10 12:56:23 +02:00
Bob Andrews
bdcc5ba549
Merge pull request #1821 from ZeroByteOrg/x16_waitvsync
CX16 waitvsync uses Kernal API to retreive jiffies
2022-08-09 19:02:15 +02:00
Bob Andrews
e30e233064
Merge pull request #1829 from acqn/VoidPtrFix
[cc65] Fixed superfluous warning on pointer types comparing a non-void pointer to a void pointer.
2022-08-09 14:29:56 +02:00
acqn
78e80eb942 Fixed superfluous warning on pointer types comparing a non-void pointer to a void pointer. 2022-08-09 13:13:33 +08:00
Bob Andrews
0c8366c1e9
Merge pull request #1828 from ZeroByteOrg/x16_ym
Fixed YM2151 struct to match HW behavior
2022-08-09 00:50:08 +02:00
ZeroByteOrg
5608453aea Fixed YM2151 struct to match HW behavior 2022-08-08 16:16:37 -05:00
ZeroByteOrg
582e43931d import RDTIM symbol instead of hard-wiring it here 2022-08-08 15:21:30 -05:00
ZeroByteOrg
9b3b652fa5 Switched to using tmp1 instead of self-mod to store the jiffies value 2022-08-08 15:17:28 -05:00
Marco Aurelio da Costa
71a9ed04a2 Revert: Parse file included inside a macro at definition time
The reverted change broke too many use cases where users
where expecting the compiler quirky behavior to be the correct
behavior.

A better solution is needed for the quirk which does not break
current usage.
2022-08-07 11:24:47 -03:00
acqn
4bb4f033ea Fixed the bug that C keywords were not simply recognized as identifiers in preprocessing. 2022-08-07 16:14:45 +08:00
acqn
a3a5fbe809 Disallowed 'defined' as a macro name. 2022-08-07 13:56:47 +08:00
acqn
7971eec3cc Fixed parentheses handling when a function-like macro name itself is used as an macro argument. 2022-08-07 12:45:48 +08:00
acqn
7a139a800e Added # and ## as punctuators recognized by the tokenizer.
Reorganized the token enum.
2022-08-06 18:45:49 +08:00
acqn
ae811baaf1 Fixed the bug that redefined macros could co-exist but not all be undefined with a single #undef. 2022-08-06 18:21:42 +08:00
acqn
0a051a4dee Unsupported #pragma within argument lists of function-like macro invocation. 2022-08-06 16:56:28 +08:00
ZeroByteOrg
78870219a4 CX16 waitvsync uses Kernal API to retreive jiffies 2022-08-05 17:44:18 -05:00
acqn
251e984ba8 Fixed error recovery with preprocessing directives failures. 2022-08-05 14:03:51 +08:00
Bob Andrews
4de40a20cb
Merge pull request #1820 from polluks2/patch-5
Shorter isascii
2022-08-04 00:43:10 +02:00
polluks2
7a93d3c707
Shorter isascii 2022-08-04 00:25:04 +02:00
mrdudz
fb8de287be test related to pr #1800 2022-07-28 01:50:54 +02:00
Bob Andrews
2c742ffc1c
Merge pull request #1800 from acqn/PPFix
[cc65] Preprocessor fixes
2022-07-28 01:48:41 +02:00
Bob Andrews
15756cc730
Update Contributing.md 2022-07-28 00:29:05 +02:00
Bob Andrews
9ab8026dbb
Merge pull request #1813 from IrgendwerA8/CharmapFixDocUpdate
Updated documentation while char-mapping is fixed.
2022-07-27 17:58:57 +02:00
IrgendwerA8
b3015ef731 Updated documentation while char-mapping is fixed. 2022-07-27 13:54:00 +02:00
mrdudz
5164b88a27 test was moved to test/val 2022-07-26 17:21:33 +02:00
Bob Andrews
a41b76795a
Merge pull request #1807 from acqn/CharmapFix
[cc65] Fixed #pragma charmap for string literals
2022-07-26 17:19:58 +02:00
acqn
f8d08b1e1a More post-C99 predefined macros. 2022-07-26 21:40:19 +08:00
acqn
2f357ba9b2 Preprocessor directives can now appear in the argument list of function-like macro calls.
#pragma PP-tokens can now be macro replaced.
#include header names directly enclosed in <> are free of macro replacement.
Preprocess-only mode (-E) now outputs with #line as source info.
Moved testcases for #760 and #1357.
Added testcase for #1643.
2022-07-26 21:10:38 +08:00
acqn
80fc8cd11e Added preprocessor warning on missing terminating characters of character/string literals. 2022-07-26 21:10:36 +08:00
acqn
2c9c8ee196 Fixed extra "Macro argument count mismatch" message when a macro argument list is unterminated. 2022-07-26 21:10:31 +08:00
acqn
60c1290468 Fixed the bug that preprocessor could run past the end of included files.
Fixed the wrong filename and 0 line number in disgnostics when a preprocessor error occurred at the end of a file.
Fixed diagnostics for missing #endif.
2022-07-26 21:10:26 +08:00
acqn
9f767770ac Added test case for #pragma charmap. 2022-07-26 15:19:48 +08:00
acqn
8289c94e69 Fixed skipped lines consist of a leading # followed by any non-directive PP-token sequence. 2022-07-26 14:28:27 +08:00
mrdudz
f99cb177c6 added example/test for cbm_read, related to issue #1306 2022-07-25 21:01:31 +02:00
mrdudz
d03f28d0ed dangling! 2022-07-24 23:52:53 +02:00
mrdudz
3c71455bd6 test related to issue #1373, should be move to val in pr #1807 2022-07-24 23:49:45 +02:00
mrdudz
416040dfb6 add prototype for static driver 2022-07-24 23:43:53 +02:00
mrdudz
a998d34907 remove tabs 2022-07-24 19:16:15 +02:00
mrdudz
aeb13b60a7 rename 2022-07-24 19:10:27 +02:00
Bob Andrews
073443d865
Merge pull request #1809 from cc65/revert-1805-something_to_pull
Revert "rename '_poserror' to '__poserror'"
2022-07-24 18:22:37 +02:00
Bob Andrews
6239fbe18c
Revert "rename '_poserror' to '__poserror'" 2022-07-24 18:14:21 +02:00
Bob Andrews
c642c07ea0
Merge pull request #1808 from acqn/LibFix
[Lib] Removed an extra colon from libsrc/dbg/dbg.c
2022-07-24 17:59:57 +02:00
acqn
43d2fd2a96 Added support for the popular __COUNTER__ macro. 2022-07-24 23:19:05 +08:00
acqn
bb9c98f4c9 Added support for the #line directive. 2022-07-24 23:19:05 +08:00
acqn
36123c9c8f Improved naming for stuff related to preprocessing directives. 2022-07-24 23:19:05 +08:00
acqn
0063f73f8a Fixed __FILE__ and __LINE__ macros for preprocessor. 2022-07-24 23:19:05 +08:00
acqn
8485d59aa6 Removed an extra colon from libsrc/dbg/dbg/c. 2022-07-24 20:58:10 +08:00
acqn
7381a2c420 Added check for extra tokens at the end of directives.
Improved diagnostics on missing/illegal macro names.
2022-07-24 19:07:16 +08:00
acqn
be26b0631b Fixed #ifdef and #ifndef. 2022-07-24 19:07:02 +08:00
acqn
066a5e0fec Fixed #pragma charmap for string literals. 2022-07-24 16:38:41 +08:00
mrdudz
10c2ce205b cleanup 2022-07-24 04:59:45 +02:00
mrdudz
193b7b9ee7 cleanup 2022-07-24 04:54:34 +02:00
mrdudz
d40def3d2d cleanup 2022-07-24 04:42:44 +02:00
mrdudz
7890f4102e cleanup 2022-07-24 04:14:48 +02:00
mrdudz
6dae5324dd cleanup 2022-07-24 03:59:19 +02:00
mrdudz
74098077d3 bleh 2022-07-24 03:36:19 +02:00
mrdudz
9ff58e5bc5 Merge remote-tracking branch 'origin/master' into coniopeek 2022-07-24 03:24:45 +02:00
Bob Andrews
fa9ec1fb71
Merge pull request #1805 from groessler/something_to_pull
rename '_poserror' to '__poserror'
2022-07-24 02:48:51 +02:00
mrdudz
8e19d84cb4 detect number of RAM pages 2022-07-24 02:47:02 +02:00
mrdudz
8db0def88b add a target for testcode.d81, which contains all drivers too 2022-07-24 02:43:18 +02:00
mrdudz
1bc05a7aa0 add rrr driver to list 2022-07-24 02:42:49 +02:00
Christian Groessler
758d9466c0 rename '_poserror' to '__poserror'
The old name could be non-conforming to the C standard. The new name
is definitely in the "implementation name space".

See issue #1796.
2022-07-24 00:33:56 +02:00
mrdudz
bc44bd583c Merge remote-tracking branch 'upstream/master' into rremd 2022-07-23 20:03:28 +02:00
Bob Andrews
d85ca8aedd
Merge pull request #1771 from spiro-trikaliotis/testsuite
Some test cases for ca65
2022-07-21 18:12:41 +02:00
Bob Andrews
46849a2919
Merge pull request #1798 from acqn/MiscFix
[cc65] Removed a mysterious "Hey!" message
2022-07-21 18:10:48 +02:00
acqn
ac4cb258be Removed a mysterious "Hey!" message. 2022-07-21 11:59:38 +08:00
acqn
16a8a64746 Use a dedicated expression parser for the preprocessor. 2022-07-21 11:10:02 +08:00
acqn
f91c8ad247 Allowed comments right after "#" in preporcessor directives. 2022-07-21 11:09:59 +08:00
acqn
d3d6de2704 Allowed the pp-tokens following #error and #warning directives to be optional. 2022-07-21 11:09:56 +08:00
mrdudz
3cb3d5dad3 cleanup 2022-07-21 03:45:40 +02:00
mrdudz
86091ac6bf some cleanup 2022-07-21 03:43:54 +02:00
mrdudz
a55807f682 cleanup 2022-07-21 03:30:47 +02:00
mrdudz
a5225b46fe Merge remote-tracking branch 'upstream/master' into rremd 2022-07-21 03:27:41 +02:00
Bob Andrews
c680c9fa05 Update lynx.h
remove TGI_COLOR_DARKBROWN
2022-07-21 03:24:17 +02:00
Kevin Pulo
35a4a03c51 lynx: fix TGI_COLOR_DARKBROWN 2022-07-21 03:24:17 +02:00
polluks2
358084806a Fixed term #1553 2022-07-21 03:24:17 +02:00
polluks2
ad051efa0b Fixed typo 2022-07-21 03:24:17 +02:00
acqn
4dcf18eca7 Fixed ICE with duplicate macro parameters. 2022-07-21 03:24:17 +02:00
acqn
a4ad212316 Now the compiler removes code that has no observable effect. 2022-07-21 03:24:17 +02:00
acqn
4cb5063e9c Now the compiler tracks code that has no observable effect. 2022-07-21 03:24:17 +02:00
acqn
fcbb4a5246 NoCodeConstExpr() fix to avoid exessive error messages. 2022-07-21 03:24:17 +02:00
acqn
51d7c0f1eb More detailed diagnostic info about conflicted function types. 2022-07-21 03:24:17 +02:00
acqn
80a468f8bd E_ADDRESS_OF logic fix. 2022-07-21 03:24:17 +02:00
acqn
9e82de4607 Better future-proof bit-masking. 2022-07-21 03:24:17 +02:00
acqn
55881e913d Replaced certain usage of "(New-)PointerTo()" with "AddressOf()". 2022-07-21 03:24:17 +02:00
acqn
7e1df39432 Replaced several occurance of PtrConversion() with StdConversion().
Variadic arguments of functions should be default-promoted.
2022-07-21 03:24:17 +02:00
acqn
3a6920bf10 Minor clean-ups and typo fixes. 2022-07-21 03:24:17 +02:00
acqn
9004c4fccb Made it easier to support 0-size structs in the future. 2022-07-21 03:24:17 +02:00
mrdudz
36315ecc06 omit an error message also when an unresolved import was added by the compiler. fixes bug #1551 2022-07-21 03:24:17 +02:00
mrdudz
1dae5062e9 more verbose comment 2022-07-21 03:24:17 +02:00
mrdudz
f614f3b9e2 reserve enough space for the longest string we can expect 2022-07-21 03:24:17 +02:00
jede
e60836add8 Telestrat cfg : fix space 2022-07-21 03:24:17 +02:00
jede
36a27055e8 Telestrat : change default start address 2022-07-21 03:24:17 +02:00
Greg King
a94b614f2d Removed an environment experiment. 2022-07-21 03:24:17 +02:00
Greg King
3bf3bfa294 Commented out the push command. 2022-07-21 03:24:17 +02:00
Greg King
f835412562 Changed a line that Github Actions claimed was bad. 2022-07-21 03:24:17 +02:00
Greg King
bcc8c5049b Went back to using actions/checkout@v2.
(Direct cloning doesn't support pushing with a hidden token.)

I'm putting this aside, for now. A Personal Access Token must be made for the repository. "git push" does a dry-run, so that the workflow will succeed.
2022-07-21 03:24:17 +02:00
Greg King
9dec4034e3 Passed the token through the environment. 2022-07-21 03:24:17 +02:00
Greg King
c00c89c2b7 Directly clone the document repo. 2022-07-21 03:24:17 +02:00
Greg King
4d045a68e3 Put doc.git next to cc65. 2022-07-21 03:24:17 +02:00
Greg King
964c4a220e Find out where doc.git is. 2022-07-21 03:24:17 +02:00
Greg King
e004e92f21 Fixed the action/checkout steps.
I misunderstood that action's docs.
2022-07-21 03:24:17 +02:00
Greg King
2290e70e0c Experiment: checkout the second repo first.
Maybe that will give it the github.token that it needs.
2022-07-21 03:24:17 +02:00
Greg King
4c74d4b851 Trying a verbose Git push.
If I'm lucky, it will tell me more.
2022-07-21 03:24:17 +02:00
Greg King
cb20b2e968 Tried to authorize a push by setting the access token explicitly. 2022-07-21 03:24:17 +02:00
Greg King
3232ce1bad Fixed a shell syntax bug. Try again. 2022-07-21 03:24:17 +02:00
Greg King
735f0cda25 Added Github action steps that update the online documentation repo. 2022-07-21 03:24:16 +02:00
mrdudz
e8e1889b0b handle loadaddr the same as with the other CBM targets 2022-07-21 03:22:52 +02:00
rofl0r
9cb8bf9500 cl65: fix regression in --print-target-path
since the "empty prefix means run from current dir" hack was removed,
cl65 --print-target-path no longer prints the path relative to the
binary, but the hardcoded library path which points to prefix, because
the code adds the hardcoded path first to the pathsearch, but then actually
only returns the first entry rather than looking whether the path exists.

closes #1754
2022-07-21 03:22:52 +02:00
Stephan Mühlstrasser
8ec1f76b9c Fix switched meaning of '\n' and '\r'
When conio was implemented for the osic1p target, the cbm
target was used as a blueprint. But it was overlooked that the
cbm target encodes CR as 0x0A and LF as 0x0D, while the
osic1p target uses the ASCII encoding of CR and LF. Therefore
conio output of '\n' moved the active position to the start of the
line and '\r' moved the active position to the next line.

This change implements the correct semantics of '\n' and '\r'
in conio for the osic1p target.

Fixes #1747.
2022-07-21 03:22:52 +02:00
Greg King
f69b993ee6 Fixed a multi-line comment.
The left border is thicker in cc65 than it is in VICE.
2022-07-21 03:22:52 +02:00
mrdudz
85fb6ba944 add check for +x flag 2022-07-21 03:22:52 +02:00
mrdudz
8e787c0c0a remove +x flag 2022-07-21 03:22:52 +02:00
compyx
4595d08c6e Fix set but unused variable 2022-07-21 03:22:52 +02:00
mrdudz
3717f36c52 rename the actual checkstyle target too :) 2022-07-21 03:22:52 +02:00
mrdudz
0e4d3aa7c5 rename the "check" target to "checkstyle".
also created a new "check" target which runs all tests, as it is common with GNU programs
2022-07-21 03:22:52 +02:00
mrdudz
0113d1328b don't try to build the checkversion sample for targets that do not have printf 2022-07-21 03:22:52 +02:00
mrdudz
976d07b98f clean and mostlyclean should also clean the test and targettest directories 2022-07-21 03:22:52 +02:00
Bob Andrews
08bad5b93b Update README.md 2022-07-21 03:22:52 +02:00
polluks2
133d703964 smarter manufacturer
some kind of promotion
2022-07-21 03:22:52 +02:00
mrdudz
1334a10101 sample program that demonstrates how to compare the value of __CC65__ for
any version of the compiler
2022-07-21 03:22:52 +02:00
mrdudz
b9779927e7 document changes to __CC65__ 2022-07-21 03:22:52 +02:00
mrdudz
354dcd6101 define __CC65__ as ((VER_MAJOR * 0x100) + VER_MINOR), fixes issue #1667 2022-07-21 03:22:52 +02:00
mrdudz
15047d9754 simple test related to #1678 2022-07-21 03:22:52 +02:00
mrdudz
3943dc1216 Fix endless loop on expanding a recursive macro, fixed issue #1678, patch by kugelfuhr 2022-07-21 03:22:52 +02:00
mrdudz
b8d0bd7f95 Add a directory for tests that exercise the supported C standard differences.
As a first test added the snippet given in issue #1670
2022-07-21 03:22:52 +02:00
mrdudz
4579d584b1 fix some header files to conform with C99 hopefully, should fix issue #1670 2022-07-21 03:22:52 +02:00
mrdudz
db2dfc9226 must include stdarg.h to use varargs 2022-07-21 03:22:52 +02:00
Bob Andrews
738d6dba88 Update Contributing.md 2022-07-21 03:22:52 +02:00
Bob Andrews
cb5ced7c9d Update Contributing.md 2022-07-21 03:22:52 +02:00
mrdudz
4285a30236 At the end of the optimizer run, remove jump cascades again. fixes the
regression reported in #1652
2022-07-21 03:22:52 +02:00
mrdudz
8ec41083e9 add extra optimizer step that replaces BRA by JMP if the target is external 2022-07-21 03:22:52 +02:00
mrdudz
4ddbe5f838 test related to issue #1652, shows regression broken by #1231 and the
case that #1231 improved.
2022-07-21 03:22:52 +02:00
mrdudz
ab7079df00 add sourcelines to the generated asm for easier inspection,
redirect output of sim65, including cycle count, into a seperate .out file per program
2022-07-21 03:22:52 +02:00
Bob Andrews
bfe9ddeb6a Update Contributing.md 2022-07-21 03:22:52 +02:00
polluks2
f8a940bce4 Some clean-up
One exit() too much
file is not optional
2022-07-21 03:22:52 +02:00
polluks2
395e072c3b typo 2022-07-21 03:22:52 +02:00
Bob Andrews
d365b8a4ee Adjust comments 2022-07-21 03:22:52 +02:00
rofl0r
5867d3a020 change GetProgPath() to return full & resolved binary path
GetProgPath() now resolves the path derived from argv[0] always
via realpath(3p) to its real location in the filesystem, and returns
the path including binary name, effectively making it work like
windows' GetModuleFileName(), so we can re-use the existing code
to strip the trailing binary name.
since symlinks are now always resolved, we no longer need the
special case code for linux to use /proc/self/exe for this purpose.
2022-07-21 03:22:52 +02:00
Bob Andrews
546e82965d Try reading from /proc/self first on linux, this is needed to make the edgy "make avail" work 2022-07-21 03:22:52 +02:00
rofl0r
6f74a2e9c7 rename AddSubSearchPathFromWinBin to AddSubSearchPathFromBin 2022-07-21 03:22:52 +02:00
rofl0r
6a5375ace4 implement AddSubSearchPathFromWinBin() counterpart for unix
this looks up paths relative to the binary used to start the
specific application.
2022-07-21 03:22:52 +02:00
rofl0r
6eeaf7485c build: allow empty prefix
there was some concern that this will break windows' way of doing
file lookups relatively from the binary, rather than via hardcoded
locations, but so far each occurence adding e.g. "CA65_INC" to
the pathsearch is already shielded with an #ifndef _WIN32.

addressing #1726
2022-07-21 03:22:52 +02:00
jede
e9bf0dd64f fix space 2022-07-21 03:22:52 +02:00
jede
16d896b73f fix mkdir 2022-07-21 03:22:52 +02:00
jede
e1fbb8465b fix spaces 2022-07-21 03:22:52 +02:00
jede
e1b8508798 fix typo 2022-07-21 03:22:52 +02:00
jede
244da9c911 missing fd_management and cleaning 2022-07-21 03:22:52 +02:00
Wayne Parham
dfab2b27cd Added myself as an external contributor for the Sym-1 target 2022-07-21 03:22:52 +02:00
Greg King
55ea831e2d Upgraded the cx16 library to the Commander X16 Kernal ROM's prerelease 39. 2022-07-21 03:22:52 +02:00
Bob Andrews
6e3e98220b Update Contributing.md 2022-07-21 03:22:52 +02:00
Bob Andrews
6fac3be97c Update README.md 2022-07-21 03:22:50 +02:00
mrdudz
976c6af74b test some more cases that should not change size 2022-07-21 03:20:45 +02:00
mrdudz
72e2751bfd added a test that must fail 2022-07-21 03:20:45 +02:00
jede
84e2fee9a4 fix bss 2022-07-21 03:20:45 +02:00
jede
164acad6cb fix space 2022-07-21 03:20:45 +02:00
jede
ebcf6ec52d FIX space 2022-07-21 03:20:45 +02:00
jede
c38504b06d cgetc export data now 2022-07-21 03:20:45 +02:00
rofl0r
058126ae41 remove orphaned STRINGIZE macro 2022-07-21 03:20:45 +02:00
rofl0r
910ce5c1fd build: properly quote strings passed as cpp macros
until now, the strings intended to be hardcoded into the binary,
such as directory names and build id, were passed unquoted, which
means they're interpreted by the preprocessor as C tokens, rather
than strings, which can result in all sorts of "interesting"
behaviour such as interpreting paths starting with // as C++-style
comment.
this was then worked around using a stringize macro which turned
the tokens into a string (if they happened to be in a compatible
format).

adresses #1726
2022-07-21 03:20:45 +02:00
rofl0r
09e0dd02a0 build: allow the user to specify make V=1 for verbose build
it's often required to see the full commandline when things go wrong.
the standard way for Makefile-only based buildsystems and autoconf
is to pass V=1 to make.
2022-07-21 03:20:45 +02:00
Karri Kaksonen
3922cccafb Speed up the cursor a bit 2022-07-21 03:20:45 +02:00
Karri Kaksonen
249a04dbde Move cursor IRQ processing to when the screen is being drawn 2022-07-21 03:20:45 +02:00
Bob Andrews
d2e8f7bc90 Update Contributing.md 2022-07-21 03:20:45 +02:00
Karri Kaksonen
7684918112 Too much time in irq fix 2022-07-21 03:20:45 +02:00
Karri Kaksonen
4ee3e59f19 Fix race condition 2022-07-21 03:20:45 +02:00
Bob Andrews
7f9909ef81 use jmp instead of jsr/rts 2022-07-21 03:20:45 +02:00
Karri Kaksonen
d8b8368e4e Add documentation 2022-07-21 03:20:45 +02:00
Karri Kaksonen
9ad2eea146 Add color setup 2022-07-21 03:20:45 +02:00
Karri Kaksonen
29b9a9f615 Rename font 2022-07-21 03:20:45 +02:00
Karri Kaksonen
5d0f064edc Not sharing umula0 and fix cursor bug 2022-07-21 03:20:45 +02:00
Karri Kaksonen
627ec17b14 Fix typo 2022-07-21 03:20:45 +02:00
Karri Kaksonen
4f195d46f9 Use consisten line lenght values 2022-07-21 03:20:45 +02:00
Karri Kaksonen
3954e9bccb Fix wrong screen in 2022-07-21 03:20:45 +02:00
Karri Kaksonen
9fab67761f Fix tabs 2022-07-21 03:20:45 +02:00
Karri Kaksonen
2e51b2b17c Fix tabs 2022-07-21 03:20:45 +02:00
Karri Kaksonen
f2f358262e Add mono conio files 2022-07-21 03:20:45 +02:00
Karri Kaksonen
b8c450cb46 Add mono conio files 2022-07-21 03:20:45 +02:00
Karri Kaksonen
bb20af1695 Add info 2022-07-21 03:20:45 +02:00
Karri Kaksonen
2db4592029 Add info 2022-07-21 03:20:45 +02:00
Karri Kaksonen
190911e26f Add x=0 to textcolor 2022-07-21 03:20:45 +02:00
Karri Kaksonen
a2aaeb0d1d Fix tabs 2022-07-21 03:20:45 +02:00
Karri Kaksonen
057fd866da Remove obsolete file and fix tabs 2022-07-21 03:20:45 +02:00
Karri Kaksonen
3edb27aa3b Remove obsolete file and fix tabs 2022-07-21 03:20:45 +02:00
Karri Kaksonen
02fbcad697 Split files 2022-07-21 03:20:45 +02:00
Karri Kaksonen
f0e16514e0 Split files 2022-07-21 03:20:45 +02:00
Karri Kaksonen
e0c7880e34 Split files 2022-07-21 03:20:45 +02:00
Karri Kaksonen
6a6581815d Import conio automatically 2022-07-21 03:20:45 +02:00
Karri Kaksonen
0f404280a1 Change attributes on gotoxy 2022-07-21 03:20:45 +02:00
Karri Kaksonen
141b887d4d Change order of gotox gotoy for correct x after newline 2022-07-21 03:20:45 +02:00
Karri Kaksonen
770b22e14d Remove duplicate code 2022-07-21 03:20:45 +02:00
Karri Kaksonen
7e7f9ffa58 Add blinking cursor 2022-07-21 03:20:45 +02:00
Karri Kaksonen
ff8d2e84bf Fix screen index bug 2022-07-21 03:20:45 +02:00
Karri Kaksonen
1d7bcb9348 Cleanup 2022-07-21 03:20:45 +02:00
Karri Kaksonen
3ba6dd0a4a Use local multiply for cursorzone calculations 2022-07-21 03:20:45 +02:00
Karri Kaksonen
9d4f1a0415 Add local multiply routine 2022-07-21 03:20:45 +02:00
Karri Kaksonen
c6b9a012c8 Allocate own zp pointer for conio implementation 2022-07-21 03:20:45 +02:00
Karri Kaksonen
60fffb289a Allocate own zp pointer for conio implementation 2022-07-21 03:20:45 +02:00
Karri Kaksonen
0eaf3eef6d Align font to 256 bytes 2022-07-21 03:20:45 +02:00
Karri Kaksonen
0f250d06b9 Fix conflicts with some conio routines 2022-07-21 03:20:45 +02:00
Karri Kaksonen
b8dbe0254a Add cputc method 2022-07-21 03:20:45 +02:00
Karri Kaksonen
1a2207ffc9 Add setcursor method 2022-07-21 03:20:45 +02:00
Karri Kaksonen
ebd2e5085a Remove export 2022-07-21 03:20:45 +02:00
Karri Kaksonen
9cdaf82f95 Add space to config 2022-07-21 03:20:45 +02:00
Karri Kaksonen
7f1e69f5e0 Add cursor processing 2022-07-21 03:20:45 +02:00
Karri Kaksonen
f576764214 Remove cursor from conio init 2022-07-21 03:20:45 +02:00
Karri Kaksonen
8b06ff18c0 Don't set cursor in clrscr 2022-07-21 03:20:45 +02:00
Karri Kaksonen
fce4bc0c58 Change order to make decoding easier 2022-07-21 03:20:45 +02:00
Karri Kaksonen
9775a71433 Use question mark instead of exclamation mark 2022-07-21 03:20:45 +02:00
Karri Kaksonen
8f86d5533b Remove clrscr from init 2022-07-21 03:20:45 +02:00
Karri Kaksonen
7fc69a34ac Change blue to white 2022-07-21 03:20:45 +02:00
Karri Kaksonen
ce313922d1 Change blue to white 2022-07-21 03:20:45 +02:00
Karri Kaksonen
646997ed43 Add the build tools for the font 2022-07-21 03:20:45 +02:00
Karri Kaksonen
f5c24be572 Fix cursor character 2022-07-21 03:20:45 +02:00
Karri Kaksonen
ff0ddcb52b Add the font160.png 2022-07-21 03:20:45 +02:00
Karri Kaksonen
e4c1bf15da Add basic conio buffer 2022-07-21 03:20:45 +02:00
Karri Kaksonen
ba3cd27d30 Add basic conio buffer 2022-07-21 03:20:45 +02:00
mrdudz
7c96af75c5 const value should never have default size, use 32bit instead 2022-07-21 03:20:45 +02:00
mrdudz
87d26b68f4 fix workdir path 2022-07-21 03:20:45 +02:00
mrdudz
623d763457 added a testprogram to check for some of the edge cases 2022-07-21 03:20:45 +02:00
mrdudz
501da2de2b Also handle the case when the non constant side of the AND expression is
known to have a smaller size than the constant side of the expression.
2022-07-21 03:20:45 +02:00
mrdudz
6702b3c85e special case for evaluating the AND operator, this should fix the problems
described in issue #1538
2022-07-21 03:20:45 +02:00
mrdudz
b523d72471 more descriptive error message 2022-07-21 03:20:45 +02:00
mrdudz
964546d444 typo 2022-07-21 03:20:45 +02:00
Greg King
320312e7cc Made the style-check scripts send their file lists to stderr.
A complete list will be shown before make shows its error message.  There will be less confusion about which lines are in the list.
2022-07-21 03:20:45 +02:00
mrdudz
4bb152eb65 remove dangling spaces
when changing the checker scripts and/or directly comitting to git head, please make sure to also run the checks first so you don't break the autobuilds
2022-07-21 03:20:45 +02:00
acqn
933e8c967d Testcases for long bit-fields. 2022-07-21 03:20:45 +02:00
acqn
bf7ef02fbc Added supports for long bit-fields. 2022-07-21 03:20:45 +02:00
acqn
3e614d9353 Separated data initializer stuff from declaration stuff. 2022-07-21 03:20:44 +02:00
acqn
087b7bd8c8 Optimized g_testbitfield() and g_extractbitfield() with enhanced support for long bit-fields. 2022-07-21 03:20:44 +02:00
acqn
ff1eca5701 Added and used new utility type functions for bit-fields.
Fixed GetUnderlyingTypeCode() for bit-fields with widths > 16.
2022-07-21 03:20:44 +02:00
Greg King
be5298925c Oops, forgot to check macros. 2022-07-21 03:20:44 +02:00
Greg King
fb97ce4bfd Remove work directory paths _before_ checking for style errors. 2022-07-21 03:20:44 +02:00
Greg King
1ea27c35d0 Moved a constant expression out of a loop. 2022-07-21 03:20:44 +02:00
Greg King
17b9f9c2a8 Fixed and tightenned the find commands' expressions. 2022-07-21 03:20:44 +02:00
Greg King
f8b05deef4 Made all of the Makefile's rules be phony. 2022-07-21 03:20:44 +02:00
mrdudz
37ebe3781b define CHECK_PATH rather than leaving it open 2022-07-21 03:20:44 +02:00
mrdudz
3834232c29 also check spaces at end of lines 2022-07-21 03:20:44 +02:00
mrdudz
eec62257c7 remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
9d3cdc5a10 remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
b54fb2dfd1 remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
78244351b7 remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
cd1b7a9e9d remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
c6f23eefc8 remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
5276033be1 remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
eb8490f13a remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
c317319d09 remove dangling spaces 2022-07-21 03:20:44 +02:00
mrdudz
3e84da0aca updated a bit 2022-07-21 03:20:44 +02:00
mrdudz
302016997a add more style checks 2022-07-21 03:20:44 +02:00
mrdudz
2cc46e11d3 add comment explaining what the empty file is about 2022-07-21 03:20:44 +02:00
mrdudz
be22b8ad4d add missing newline to a bunch of files 2022-07-21 03:20:44 +02:00
mrdudz
5d45c655bd add check action also to the snapshot build 2022-07-21 03:20:44 +02:00
mrdudz
db20b1dc14 run style checks on PR 2022-07-21 03:20:44 +02:00
mrdudz
59d386e18f added TAB checker script, to be added to the PR checker action 2022-07-21 03:20:44 +02:00
mrdudz
cbbdd3d9cf remove a bunch of TABs 2022-07-21 03:20:44 +02:00
mrdudz
45cbb04a04 remove literal TABs 2022-07-21 03:20:44 +02:00
Bob Andrews
c611077e3d Update README.md
link Contributing.md
2022-07-21 03:20:44 +02:00
Bob Andrews
722bdebd39 Create Contributing.md
Starting to move info hidden elsewhere into this file
2022-07-21 03:20:44 +02:00
mrdudz
175da4bcd6 add gitignores 2022-07-21 03:20:44 +02:00
Karri Kaksonen
f92e1f2e3c Change polarity for 2600 buttons 2022-07-21 03:20:44 +02:00
Karri Kaksonen
851c65344c Add comments 2022-07-21 03:20:44 +02:00
Karri Kaksonen
3ceae59857 Add stdjoy driver 2022-07-21 03:20:44 +02:00
Karri Kaksonen
cdf83d2a26 Fixed logic flaw 2022-07-21 03:20:44 +02:00
Karri Kaksonen
14956f3b15 Add atari7800-stdjoy 2022-07-21 03:20:44 +02:00
Fabrizio Caruso
1effa5944b Optimize delete cycles 2022-07-21 03:20:44 +02:00
Fabrizio Caruso
3050e3afcd Use lsr 2022-07-21 03:20:44 +02:00
Fabrizio Caruso
c40e099969 Ignore executables in util directory 2022-07-21 03:20:44 +02:00
Fabrizio Caruso
3d4772e1fe Remove executables 2022-07-21 03:20:44 +02:00
Fabrizio Caruso
6b3920f9e0 Make the intermediate gray/green levels available 2022-07-21 03:20:44 +02:00
Fabrizio Caruso
fc6548db5c Fix color 1 and 2 (grey/green levels) 2022-07-21 03:20:44 +02:00
polluks2
87e90b6e9a Fixed documentation typo 2022-07-21 03:20:44 +02:00
Fabrizio Caruso
82cfbb5fa8 Fix Gamate CONIO: non-solid characters bug 2022-07-21 03:20:44 +02:00
Karri Kaksonen
6f11c4ffad Export paldetected 2022-07-21 03:20:44 +02:00
Karri Kaksonen
ef13a470e8 Use proper mnemonics 2022-07-21 03:20:44 +02:00
Karri Kaksonen
fd305c1e31 Separate machine detection from crt0 and put it in get_tv 2022-07-21 03:20:44 +02:00
Karri Kaksonen
9fbeb68b22 Make STARTUP segment larger 2022-07-21 03:20:44 +02:00
Karri Kaksonen
cf8c7ee28d Split clock file to components 2022-07-21 03:20:44 +02:00
Karri Kaksonen
218c98d4d5 Add get_tv.s 2022-07-21 03:20:44 +02:00
Karri Kaksonen
9cf4f166c0 Add more space to init segmen 2022-07-21 03:20:44 +02:00
Karri Kaksonen
7c12916718 Add irq handling, PAL/NTSC detection and clock() 2022-07-21 03:20:44 +02:00
Karri Kaksonen
76fae9da82 Add irq handling, PAL/NTSC detection and clock() 2022-07-21 03:20:44 +02:00
Karri Kaksonen
d099df0533 Clear hw palette and set AUDIN low at startup 2022-07-21 03:20:44 +02:00
Karri Kaksonen
926959d80a Fix offset for MARIA 2022-07-21 03:20:44 +02:00
Karri Kaksonen
750ce30768 Make start of ROM depend on CARTSIZE 2022-07-21 03:20:44 +02:00
Karri Kaksonen
0be3882f08 Remove the EXEHDR from the default build 2022-07-21 03:20:44 +02:00
Karri Kaksonen
f7c59ee1ec Add CARTSIZE to cfg file for configuring the a78 header. Add descriptions of usage. 2022-07-21 03:20:44 +02:00
Karri Kaksonen
db48605434 Update docs 2022-07-21 03:20:44 +02:00
Karri Kaksonen
d586c83dae Add exehdr 2022-07-21 03:20:44 +02:00
Karri Kaksonen
dc75972e9e Add exehdr 2022-07-21 03:20:44 +02:00
Karri Kaksonen
4cd32829ea Add segment ONCE 2022-07-21 03:20:44 +02:00
Karri Kaksonen
3792347d5d Add crt0.s and ctype.s 2022-07-21 03:20:44 +02:00
Karri Kaksonen
92043bc7c8 Remove garbage 2022-07-21 03:20:44 +02:00
Karri Kaksonen
e653204ffe Add target atari7800 2022-07-21 03:20:44 +02:00
Karri Kaksonen
89716ac831 Add target atari7800 2022-07-21 03:20:44 +02:00
empathicqubit
06ddd042f2 Documentation 2022-07-21 03:20:44 +02:00
empathicqubit
2bd30afdeb Add --debug-tables <filename> option and output struct and union fields 2022-07-21 03:20:44 +02:00
Greg King
314cdd7feb Added Atari Lynx versions of three sample programs.
The Lynx target can't build the usual versions because its library doesn't have conio output and stdio.
2022-07-21 03:20:44 +02:00
Greg King
1951e84505 Made tgidemo draw circles in blue instead of orange.
That change lets it be built on two more platforms (Atmos, Telestrat).
2022-07-21 03:20:44 +02:00
Greg King
c6c199bd59 Added a URL to the snapshot's commit history as a comment in the Windows snapshot ZIPs. 2022-07-21 03:20:44 +02:00
nyanpasu64
aebf61464d Replace #include "inttypes.h" with <inttypes.h> 2022-07-21 03:20:44 +02:00
nyanpasu64
8afbf3f5ff Fix format strings to properly format uintptr_t 2022-07-21 03:20:44 +02:00
nyanpasu64
190e04b0ce Remove broken inttypes.h
src/common/inttypes.h is a shim to fix building cc65 on
non-C99-compliant compilers missing inttypes.h (like VS2012 and
earlier). The shim is actually incomplete and does not define the PRI...
macros supplied by the actual compiler headers. Since we're planning to
use those macros, delete this header so cc65's source files instead use
host-supplied inttypes.h containing macro definitions.
2022-07-21 03:20:44 +02:00
nyanpasu64
b9651e4b06 Fix segfault on 64-bit LLP64 Windows builds
There are many occurrences of unsigned long in codegen.h's function
arguments. Changing g_getimmed and g_defdata makes `make` succeed
without segfaulting. I don't know if it makes cc65 behave correctly in
all cases, or if there are more unsigned long that need to be changed.
2022-07-21 03:20:44 +02:00
mrdudz
eb2f2a2fca fix #warning directive so the test could actually compile :) 2022-07-21 03:20:44 +02:00
Wayne Parham
eb25027f7b Minor updates 2022-07-21 03:20:44 +02:00
Wayne Parham
cb322551e5 Documentation clarifications 2022-07-21 03:20:44 +02:00
Wayne Parham
d6fe34107e unsigned int format specifier 2022-07-21 03:20:44 +02:00
Wayne Parham
5dd952ba8c Added Sym-1 extended memory sample program and documentation 2022-07-21 03:20:44 +02:00
Karri Kaksonen
4f9b30d50d Fix black index in tgi_colors.s 2022-07-21 03:20:44 +02:00
Karri Kaksonen
b252059369 Mark index 0 as TRANSPARENT. Let palette start from index 1 2022-07-21 03:20:40 +02:00
Wayne Parham
12aa8693b8 Corrected size of BASROM definition 2022-07-21 03:18:13 +02:00
acqn
43abc5b01f Fixed signed long comparisons with smaller unsigned types. 2022-07-21 03:18:13 +02:00
acqn
0dc82c0d11 Fixed test/asm/listing/Makefile with mingw32-make.exe that has problems with comments lead with tabulators. 2022-07-21 03:18:13 +02:00
acqn
e95184e20e Testcase for #1675. 2022-07-21 03:18:13 +02:00
acqn
f0242fb7d5 Fixed LimitExprValue() for 64-bit long env. 2022-07-21 03:18:13 +02:00
acqn
7e3aaf199a Fixed bitwise shift with numeric constant operand(s). 2022-07-21 03:18:13 +02:00
Greg King
74bdc06529 Added a more general test to test/val/bug1690.c 2022-07-21 03:18:13 +02:00
acqn
1579d2ec41 Fixed OptCmp1 with certain code patterns with labels. 2022-07-21 03:18:13 +02:00
Jeff Tranter
93291add05 A couple of addtional fixes. 2022-07-21 03:18:13 +02:00
Jeff Tranter
ba13ba32a1 Fix some commonly made spelling errors in comments. 2022-07-21 03:18:13 +02:00
Greg King
cac1e26372 Made the c128, not the c64, target build the c128 version of "c64-c128-scpu-test.c".
Its placement in the wrong list caused a parallel race condition that sometimes led to failed test builds.
2022-07-21 03:18:13 +02:00
Greg King
9dcd7f8858 Reverted "do not use cl65 to prevent tests from failing randomly because of one process deleting the temp files from another".
This reverted commit 02a46e0237.  That commit didn't fix the real bug (a program name in the wrong list).
2022-07-21 03:18:13 +02:00
Spiro Trikaliotis
49bf32dc06 Add proper readmes 2022-07-21 03:18:13 +02:00
Spiro Trikaliotis
e85d7756a6 Rename target test to asm 2022-07-21 03:18:13 +02:00
Spiro Trikaliotis
2edd9543ce Reorganized test/asm 2022-07-21 03:18:13 +02:00
mrdudz
14b27f8317 do not use cl65 to prevent tests from failing randomly because of one process deleting the temp files from another 2022-07-21 03:18:13 +02:00
Greg King
e4f38f4476 Made the snapshot-on-push Github action run on only the upstream repository. 2022-07-21 03:18:13 +02:00
Spiro Trikaliotis
77fa71994f ca65: .constructor after .export fails
The actor directives (.constructor, .destructor, .interruptor, and .condes)
can't handle a symbol that's already exported.

The relevant code does the checks in the wrong order.

For example, the following correct snippet does not assemble:

        .export         C
C:      .constructor    C, 5

The assembler outputs: test.s:2: Error: Address size mismatch for symbol 'C'

Exchanging both lines makes it work.

This fixes #1647; the patch is provided by 'kugelfuhr' and taken from there.
2022-07-21 03:18:13 +02:00
Spiro Trikaliotis
bfaa2b37e0 Add link to DEB and RPM snapshots 2022-07-21 03:18:13 +02:00
Spiro Trikaliotis
e35f4fb48f Invalid flagged errors if token is missing
A missing factor in an expression causes an expected but missing token
to be skipped, leading to invalid flagged errors in the following line:

l = 3 +
lda     #$00

An error should be output for line 1, but not for line 2. Actually, both
are flagged as errors:

test.s(1): Error: Syntax error
test.s(2): Error: Unexpected trailing garbage characters

This patch (as proposed in issue #1634 by kugelfuhr) fixes this.
2022-07-21 03:18:13 +02:00
mrdudz
3b964c9674 add hint on VICE -moncommands 2022-07-21 03:18:13 +02:00
acqn
479f450d11 Testcase for #1662. 2022-07-21 03:18:13 +02:00
acqn
ace0bc414b Fixed anonymous bit-fields declared with typedef'ed type names. 2022-07-21 03:18:13 +02:00
acqn
879ed5bb95 Fixed crash with labels in non-function/block scopes. 2022-07-21 03:18:13 +02:00
Greg King
800568dd58 Added code that avoids infinite loops that were caused by circular references
(a symbol that was defined by referring to itself directly or indirectly).  Patch by kugelfuhr.
2022-07-21 03:18:13 +02:00
mrdudz
2628a176f9 attempt to prevent utils being compiled with cc65 2022-07-21 03:18:13 +02:00
mrdudz
648c8e21e3 build utilities in a seperate step 2022-07-21 03:18:13 +02:00
Greg King
c138454bcc Removed geos_apple and geos_cbm from the lists of targets.
They need resource files to go with the program source files.  The top-level samples and targettest programs don't have those resources.
2022-07-21 03:18:13 +02:00
Greg King
bc46c90cfa Added '+' to another SUBDIRS_recipe. 2022-07-21 03:18:13 +02:00
Greg King
9c1c1c04d8 Moved the platform-test enumerations from Github Actions over to makefiles.
Now, we can run those tests locally, as well as on Github.
2022-07-21 03:18:13 +02:00
Wayne Parham
bf46abf8c5 Correction of link typos 2022-07-21 03:18:13 +02:00
Wayne Parham
dd38de6263 Added note about return value being function status. 2022-07-21 03:18:13 +02:00
Wayne Parham
0302e7be97 Typo correction. 2022-07-21 03:18:13 +02:00
Wayne Parham
c60144afbb Documentation updates for Sym-1. 2022-07-21 03:18:13 +02:00
mrdudz
138d2badb2 upload snapshot to sourceforge 2022-07-21 03:18:08 +02:00
mrdudz
b9bda8c40d test upload again 2022-07-21 03:13:10 +02:00
mrdudz
561e973c5d try publishing on sf after snapshot 2022-07-21 03:13:10 +02:00
mrdudz
76026ed59e use gamate-fixcart from util dir 2022-07-21 03:13:10 +02:00
mrdudz
16acb7675e move some things from targettest to samples 2022-07-21 03:13:10 +02:00
mrdudz
1af84ed9a0 fix this too 2022-07-21 03:13:10 +02:00
mrdudz
6129ff532b fix again. sigh 2022-07-21 03:13:10 +02:00
mrdudz
f6e7a91fb4 fix 2022-07-21 03:13:10 +02:00
mrdudz
9509288b80 remove programs in util dir before making a snapshot. we might later
decide to leave them there anyway.
2022-07-21 03:13:10 +02:00
mrdudz
f800e71d7a cleanup 2022-07-21 03:13:10 +02:00
mrdudz
0300d4fcd1 utils before samples 2022-07-21 03:13:10 +02:00
mrdudz
0046d8ec5c build util dir when testing 2022-07-21 03:13:10 +02:00
mrdudz
bcc03acfc8 also compile the programs in the util directory by default, not only
do we want to test they can be compiled, but also samples may use/require
them. we might want to install them too, perhaps
2022-07-21 03:13:10 +02:00
Greg King
e0b23258dc Added the names of samples and targettest programs that the telestrat library can build now. 2022-07-21 03:13:10 +02:00
Greg King
8bf9766e9e Added to the telestrat library the name of the standard dynamic TGI driver. 2022-07-21 03:13:10 +02:00
Greg King
bdd7466afd Added telestrat to <time.h>.
That library has clock().
2022-07-21 03:13:10 +02:00
polluks
2ed9df708f Fixed many typos 2022-07-21 03:13:10 +02:00
polluks
ad95ba7854 Added tail call optimization 2022-07-21 03:13:10 +02:00
Oliver Schmidt
27f975666c Disable double hires on exit.
A program being run afterwards might not even know about the existence of double hires. So it's our task to turn double hires off on exit.
2022-07-21 03:13:10 +02:00
Greg King
103d3ccfcd Fixed the cart directory build code to handle even simple programs.
Carts can be built containing programs that don't link some segments.
2022-07-21 03:13:10 +02:00
Greg King
3885dd8504 Removed an obsolete command-line option from the cc65 compiler. 2022-07-21 03:13:10 +02:00
Greg King
5cad3ce55a Fixed heaptest.c compiler warnings in a way that's better than PR #1621.
This fix adds "unsigned" to one line instead of removing it from several lines.
2022-07-21 03:13:10 +02:00
mrdudz
f1e70517ec the forgotten minimal testprog 2022-07-21 03:13:10 +02:00
mrdudz
afc80949e3 build targettest progrs for all targets 2022-07-21 03:13:10 +02:00
mrdudz
6eca9a6aac fix Makefiles for all targets, dive into subdirs like in samples 2022-07-21 03:13:10 +02:00
polluks
33bb1a22ff Removed the colour purple
This commit may break compatibility.
2022-07-21 03:13:10 +02:00
polluks
df662f4b66 Added more purple (rain) 2022-07-21 03:13:10 +02:00
polluks
d6349e0f92 Save a few bytes 2022-07-21 03:13:10 +02:00
mrdudz
69346960b8 samples makefile already goes through the subdirs correctly 2022-07-21 03:13:10 +02:00
mrdudz
7a0d630d1b actually use all targets for the samples dir 2022-07-21 03:13:10 +02:00
mrdudz
f82208b009 fix for atari5200 2022-07-21 03:13:10 +02:00
mrdudz
1e7886b9c7 build samples for all targets 2022-07-21 03:13:10 +02:00
polluks
5f151b1316 Revert commits 2022-07-21 03:13:10 +02:00
mrdudz
09f2dc8d69 comment out all the non working targets 2022-07-21 03:13:10 +02:00
mrdudz
e602d6e9c3 add sym1 target 2022-07-21 03:13:10 +02:00
mrdudz
3fbfddc5fb fix pathes 2022-07-21 03:13:10 +02:00
mrdudz
53fed67bbc fix pathes 2022-07-21 03:13:10 +02:00
mrdudz
8867d55b83 and another 2022-07-21 03:13:10 +02:00
mrdudz
f2ac6796aa another try 2022-07-21 03:13:10 +02:00
mrdudz
e9e9d7aab8 iterate through all targettest builds 2022-07-21 03:13:10 +02:00
Sven Michael Klose
24a9886717 mostlyclean: Clean up. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
a45a92a71f main(): No return value. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
a60ac67783 main(): Re-introduce return value. Compiler rejects 'void'. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
d23c83dd1e Remove command line arguments and return value from main(). 2022-07-21 03:13:10 +02:00
Sven Michael Klose
d5591bc184 Make label file for c610 platform. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
6aabee0564 Remove -t option for linker only. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
a5ca1928f5 Use -t option alongside -C. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
582c2f65e3 Use suffix '.lbl' instead of '.lst'. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
0ac1b8d6b1 Remove most compiler warnings. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
20f7320bae cbmdir-test for VICs needs memory expansion. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
4bc9a9d9cc Make VICE monitor command lists for Commodore platforms. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
b40c76a632 Do not compile petscii test for unsupported platforms.
Only C64 is supported.
2022-07-21 03:13:10 +02:00
Matthew D. Steele
815e30c47f Add space after function names 2022-07-21 03:13:10 +02:00
Matthew D. Steele
db02a89b5d Move local variable declaration to top of block 2022-07-21 03:13:10 +02:00
Matthew D. Steele
ceca1c496d Adjust Pop() sequencing in paravirt.c 2022-07-21 03:13:10 +02:00
Matthew D. Steele
623e951e33 Fix Pop() implementation in src/sim65/paravirt.c (fixes #1625)
The Pop() function was not handling stack pointer wrap around correctly.

Also, change the simulated RTS implementation in ParaVirtHooks() to
explicitly sequence the two Pop() calls in the correct order.
2022-07-21 03:13:10 +02:00
Sven Michael Klose
c2608599aa More strict printf() format string. 2022-07-21 03:13:10 +02:00
Sven Michael Klose
d29ec4c800 Move strnlen() to non-ANSI section. 2022-07-21 03:13:09 +02:00
Sven Michael Klose
34e03fd9ec Add test of strnlen(). 2022-07-21 03:13:09 +02:00
Sven Michael Klose
2c27c075a9 strnlen(): Add comment with POSIX standard. 2022-07-21 03:13:09 +02:00
Sven Michael Klose
3ee9b35080 Fix strnlen(). 2022-07-21 03:13:09 +02:00
Sven Michael Klose
88fdaeb490 Add standard C library function strnlen(). 2022-07-21 03:13:09 +02:00
Daniel Lehenbauer
be594912eb asminc/pet.inc: Add PIA1 & PIA2 2022-07-21 03:13:09 +02:00
Christian Groessler
ded575c477 put Atari 20-column note to where it belongs... 2022-07-21 03:13:09 +02:00
Scott Prive
caa74b325d document special case on sub 40-col modes 2022-07-21 03:13:09 +02:00
polluks2
a270a56a71 Wrong platform
There was no conio for Lynx
````
../bin/ld65   -o mandelbrot -t lynx -m mandelbrot.map mandelbrot.o lynx.lib
mandelbrot.s:516: Error: Unresolved external '_clrscr'
conio/vcprintf.s:85: Error: Unresolved external '_cputc'
conio/cputs.s:25: Error: Unresolved external '_cputc'
conio/cputs.s:15: Error: Unresolved external 'gotoxy'
ld65: Error: 3 unresolved external(s) found - cannot create output file
make: *** [mandelbrot] Error 1
````
2022-07-21 03:13:09 +02:00
Greg King
baa582ac0b Made cbm_open() be more efficient.
The fastcall argument doesn't need to be put on a stack.  SETNAM can be called before SETLFS.
2022-07-21 03:13:09 +02:00
polluks2
5b97a74dbc Delete c-cpp.yml 2022-07-21 03:13:09 +02:00
Greg King
e1ef1325ec Put the alignment decrement code back into posix_memalign().
Without that code, the function returns a very broken pointer.
2022-07-21 03:13:09 +02:00
Oliver Schmidt
152241f26c Don't rely on (actually changed) unspecified compiler behavior. 2022-07-21 03:13:09 +02:00
polluks2
a08f9e51a0 Fixed many typos 2022-07-21 03:13:09 +02:00
polluks2
7a0a0edb89 Fixed many typos 2022-07-21 03:13:09 +02:00
polluks2
5afc349199 Fixed typo 2022-07-21 03:13:09 +02:00
Greg King
dd27a66a7b Install system packages before checking out the repo. 2022-07-21 03:13:09 +02:00
Greg King
81930053dd Used (size_t), instead of (long) where converting between pointers and integers.
(long) still is 32 bits on 64-bit Windows!
2022-07-21 03:13:09 +02:00
Greg King
c143dd1f41 Added a 64-bit Windows cross-compile.
That compiler catches pointer-integer width mismatches that other compilers ignore.
2022-07-21 03:13:09 +02:00
Greg King
32253a4e51 Removed unneeded package names.
sshpass isn't needed because the Windows packages are put on Github.
linuxdoc-tools is a dependency of linuxdoc-tools-info.
The binutils package is a dependency of the gcc package.
2022-07-21 03:13:09 +02:00
Greg King
67fc9a4d36 Changed a big script into separate named steps.
It makes the job log easier to navigate.

Also, Pull Requests don't need a Zip file.
2022-07-21 03:13:09 +02:00
Oliver Schmidt
919645f283 Updated URL and improved consistency. 2022-07-21 03:13:09 +02:00
polluks
687c8052ae Save a few bytes 2022-07-21 03:13:09 +02:00
polluks2
6c1c260e7b Create c-cpp.yml 2022-07-21 03:13:09 +02:00
polluks2
27bfc8e35f Update README.md
Commander X16
2022-07-21 03:13:07 +02:00
Bob Andrews
19ddffecba
Merge pull request #1770 from devkev/lynx_darkbrown
lynx: fix TGI_COLOR_DARKBROWN
2022-07-21 00:03:37 +02:00
Bob Andrews
dcbd75f6bf
Merge pull request #1760 from polluks2/master
Fixed term #1553
2022-07-21 00:02:13 +02:00
Bob Andrews
6a8160c374
Merge pull request #1756 from polluks2/patch-4
Fixed typo
2022-07-21 00:02:01 +02:00
Bob Andrews
092c0a6531
Update lynx.h
remove TGI_COLOR_DARKBROWN
2022-07-20 23:54:57 +02:00
Bob Andrews
560317c8ba
Merge pull request #1789 from acqn/PPDiagnostics
[cc65] Fixed ICE with duplicate macro parameters
2022-07-19 17:38:29 +02:00
Bob Andrews
6b0afe0834
Merge pull request #1785 from acqn/Effectless
[cc65] Avoid generating asm from C code that has no observable effects
2022-07-19 17:38:03 +02:00
Bob Andrews
c802980d6a
Merge pull request #1784 from acqn/Diagnostics
[cc65] Slight improvements on diagnostics
2022-07-19 17:37:42 +02:00
Bob Andrews
82b268ee50
Merge pull request #1783 from acqn/MiscFixes
[cc65] Misc fixes and improvements
2022-07-19 17:37:19 +02:00
mrdudz
7165b29809 omit an error message also when an unresolved import was added by the compiler. fixes bug #1551 2022-07-14 22:54:18 +02:00
mrdudz
a6b807b1d8 more verbose comment 2022-07-14 22:39:29 +02:00
mrdudz
16bf472e66 reserve enough space for the longest string we can expect 2022-07-13 23:10:19 +02:00
acqn
9e3b759540 Fixed ICE with duplicate macro parameters. 2022-07-05 22:22:49 +08:00
Bob Andrews
e95db437a9
Merge pull request #1781 from jedeoric/cfg_telestrat_start_addr
Telestrat : change default start address
2022-06-25 00:34:36 +02:00
jede
e0718314b3 Telestrat cfg : fix space 2022-06-25 00:21:19 +02:00
jede
590de7566d Telestrat : change default start address 2022-06-25 00:19:21 +02:00
Spiro Trikaliotis
6b7d23ca74 isequal with --wildcard: Allow DOS/Win paths
Allow a colon (':') at the second position of a DOS or Windows path, so
a path with drive specifier (i.e., "c:") is recognized as a path of the
wildcard should end with a colon.
2022-06-22 21:23:44 +02:00
Spiro Trikaliotis
a7b2a92fc2 isequal: add --wildcards option 2022-06-21 22:23:10 +02:00
Spiro Trikaliotis
c738c94935 Debugging fix 2022-06-20 23:13:49 +02:00
Spiro Trikaliotis
0d7fba2332 More make test output for debugging 2022-06-20 23:10:32 +02:00
Spiro Trikaliotis
b5b3654017 Un-silence Make 2022-06-20 23:07:36 +02:00
Spiro Trikaliotis
aa64234707 Testcases for case 2022-06-20 23:03:12 +02:00
Spiro Trikaliotis
3a5fee75a3 Remove TAB for reference file, too 2022-06-20 22:57:20 +02:00
Spiro Trikaliotis
b816ee6676 Remove TABs again 2022-06-20 22:53:46 +02:00
Spiro Trikaliotis
b3846ee1c4 Complete check of ld65 output
ld65 output was only checked for listing build before. No, both builds
are tested separately for better test coverage.
2022-06-20 22:19:22 +02:00
Spiro Trikaliotis
343bc1a489 More assert tests
Also test ldwarning and lderror options.
2022-06-20 22:16:55 +02:00
Spiro Trikaliotis
e9888a0c28 testcase for ca65 .align 2022-06-20 22:01:01 +02:00
Spiro Trikaliotis
77a6ea3704 Makefile fix for ld65 error processing 2022-06-20 16:34:14 +02:00
Spiro Trikaliotis
7476c86ba9 More .assert testcases
Add testcases with error generation.
2022-06-20 16:33:25 +02:00
Spiro Trikaliotis
2040da0520 Reorga of test/asm/listing/
add ref/ and control/ subdirectories, so the control files and result
files do not clutter the directory, and it is clear which file has which
purpose.
2022-06-20 16:30:51 +02:00
Greg King
68da626d9c Removed an environment experiment. 2022-06-20 03:08:47 -04:00
Spiro Trikaliotis
e17cb6d602 isequal: add --skip for both left and right file
isequal: New option --skip as a shortcut for --skipleft and --skipright
at once.

Use that for the .list-ref files, so they now contain the first line of
the output, too, which is ignored.
2022-06-19 22:42:44 +02:00
Spiro Trikaliotis
1446b7dcc3 isequal: Add options for better handling
--binary: handled binary files
--empty:  check if file is empty

--skipleft=<n>: Skip <n> lines at the start of the left (first) file
--skipright=<n>: Skip <n> lines at the start of the right (second) file

Note that --binary, --empty and one or both of --skipXXX are mutual
exclusive; that is, you cannot specify more than one of them at the same
time, or the behaviour will be unpredictable.
2022-06-18 23:50:26 +02:00
Spiro Trikaliotis
297a11fcec Add more assert tests 2022-06-18 22:22:27 +02:00
Spiro Trikaliotis
794ebd7a0b Test cases for .assert warnings 2022-06-18 21:04:36 +02:00
Greg King
16d259d2b4 Commented out the push command. 2022-06-17 21:44:42 -04:00
Greg King
268823fdbb Changed a line that Github Actions claimed was bad. 2022-06-17 21:22:43 -04:00
Greg King
a0e0c789db Went back to using actions/checkout@v2.
(Direct cloning doesn't support pushing with a hidden token.)

I'm putting this aside, for now. A Personal Access Token must be made for the repository. "git push" does a dry-run, so that the workflow will succeed.
2022-06-17 18:42:12 -04:00
Greg King
65c8b49430 Passed the token through the environment. 2022-06-17 13:52:45 -04:00
Greg King
43c0f5ecd7 Directly clone the document repo. 2022-06-17 12:58:56 -04:00
Greg King
997c67de35 Put doc.git next to cc65. 2022-06-17 09:00:53 -04:00
Greg King
0dab508c75 Find out where doc.git is. 2022-06-17 08:35:06 -04:00
Greg King
3f314c0ee9 Fixed the action/checkout steps.
I misunderstood that action's docs.
2022-06-17 08:18:51 -04:00
Greg King
86d68bea8c Experiment: checkout the second repo first.
Maybe that will give it the github.token that it needs.
2022-06-17 08:06:21 -04:00
Greg King
b4231401bd Trying a verbose Git push.
If I'm lucky, it will tell me more.
2022-06-17 05:38:59 -04:00
Greg King
0d5dbb2ce2 Tried to authorize a push by setting the access token explicitly. 2022-06-17 03:46:31 -04:00
Greg King
5b0023c3df Fixed a shell syntax bug. Try again. 2022-06-17 02:30:52 -04:00
Greg King
1628efd569 Added Github action steps that update the online documentation repo. 2022-06-17 01:44:40 -04:00
Spiro Trikaliotis
a9e0dba991 Remove TAB to comply to style 2022-06-16 21:59:37 +02:00
Spiro Trikaliotis
48ae6716ad Some test cases for ca65 2022-06-16 20:57:53 +02:00
Kevin Pulo
3ef8dd3c0c lynx: fix TGI_COLOR_DARKBROWN 2022-06-16 15:06:02 +10:00
David W Plummer
db44d59f7c
Update README.md 2022-06-06 15:17:39 -07:00
David W Plummer
46541237e0
Add to contributor list for KIM-1 target 2022-06-06 15:17:19 -07:00
Dave Plummer
8f9777d9e0 Fix ushot overflow, capitalization 2022-06-06 15:14:01 -07:00
mrdudz
5aa75ae81f handle loadaddr the same as with the other CBM targets 2022-06-06 14:01:16 +02:00
Dave Plummer
799aec23a6 Add KIM-1 Support 2022-06-04 13:00:48 -07:00
Bob Andrews
30dc9b8d1a
Merge pull request #1755 from rofl0r/fix_target_path
cl65: fix regression in --print-target-path
2022-06-04 16:33:46 +02:00
polluks2
e6e93f3d18
Fixed term #1553 2022-06-03 12:36:04 +02:00
polluks2
c2b8479ea3
Fixed typo 2022-05-30 17:10:33 +02:00
rofl0r
94e7b11870 cl65: fix regression in --print-target-path
since the "empty prefix means run from current dir" hack was removed,
cl65 --print-target-path no longer prints the path relative to the
binary, but the hardcoded library path which points to prefix, because
the code adds the hardcoded path first to the pathsearch, but then actually
only returns the first entry rather than looking whether the path exists.

closes #1754
2022-05-30 12:22:02 +00:00
Bob Andrews
dcdf7ade08
Merge pull request #1748 from smuehlst/issue-1747
Fix switched meaning of '\n' and '\r' for osic1p target
2022-05-19 01:04:17 +02:00
Stephan Mühlstrasser
44257b9b4a Fix switched meaning of '\n' and '\r'
When conio was implemented for the osic1p target, the cbm
target was used as a blueprint. But it was overlooked that the
cbm target encodes CR as 0x0A and LF as 0x0D, while the
osic1p target uses the ASCII encoding of CR and LF. Therefore
conio output of '\n' moved the active position to the start of the
line and '\r' moved the active position to the next line.

This change implements the correct semantics of '\n' and '\r'
in conio for the osic1p target.

Fixes #1747.
2022-05-18 18:57:52 +02:00
Greg King
93e94c8dea Fixed a multi-line comment.
The left border is thicker in cc65 than it is in VICE.
2022-05-18 05:09:48 -04:00
Bob Andrews
93ee91fb4b
Merge pull request #1644 from polluks2/missing-purple
Added more purple and removed the colour violet
2022-05-17 15:54:59 +02:00
Bob Andrews
e0cc3650e4
Merge branch 'master' into missing-purple 2022-05-17 15:34:51 +02:00
mrdudz
d30fc65dd5 add check for +x flag 2022-05-17 15:28:51 +02:00
mrdudz
91199c57e8 remove +x flag 2022-05-17 15:28:51 +02:00
Bob Andrews
25efedf3e6
Merge pull request #1745 from Compyx/codeopt-unused-var-fix
Fix set but unused variable
2022-05-17 14:47:19 +02:00
mrdudz
0f291aee86 rename the actual checkstyle target too :) 2022-05-17 14:39:35 +02:00
mrdudz
75441afb71 rename the "check" target to "checkstyle".
also created a new "check" target which runs all tests, as it is common with GNU programs
2022-05-17 14:30:41 +02:00
mrdudz
1a5852ab91 don't try to build the checkversion sample for targets that do not have printf 2022-05-17 13:52:30 +02:00
mrdudz
4674b09421 clean and mostlyclean should also clean the test and targettest directories 2022-05-17 13:25:12 +02:00
compyx
2fdb1e6b0d Fix set but unused variable 2022-05-17 10:05:25 +02:00
Bob Andrews
8328bbf51d
Update README.md 2022-05-10 01:56:52 +02:00
Bob Andrews
4da7e1553f
Merge pull request #1676 from polluks2/patch-1
smarter manufacturer
2022-05-10 01:32:10 +02:00
mrdudz
8062f8d029 sample program that demonstrates how to compare the value of __CC65__ for
any version of the compiler
2022-05-10 01:16:19 +02:00
mrdudz
1b73ffb8ae document changes to __CC65__ 2022-05-10 01:13:24 +02:00
mrdudz
f67fb3b326 define __CC65__ as ((VER_MAJOR * 0x100) + VER_MINOR), fixes issue #1667 2022-05-10 01:12:13 +02:00
mrdudz
1c3d386e09 simple test related to #1678 2022-05-09 21:27:21 +02:00
mrdudz
b6ffa4af64 Fix endless loop on expanding a recursive macro, fixed issue #1678, patch by kugelfuhr 2022-05-09 21:26:45 +02:00
mrdudz
1abb5f4734 Add a directory for tests that exercise the supported C standard differences.
As a first test added the snippet given in issue #1670
2022-05-08 19:29:57 +02:00
mrdudz
3640beaa46 fix some header files to conform with C99 hopefully, should fix issue #1670 2022-05-08 19:29:57 +02:00
mrdudz
d0ac06c9b0 must include stdarg.h to use varargs 2022-05-08 19:29:57 +02:00
Bob Andrews
1c34d798be
Update Contributing.md 2022-05-08 19:27:32 +02:00
Bob Andrews
fc4faa582a
Update Contributing.md 2022-05-08 18:46:12 +02:00
mrdudz
43af562ce1 At the end of the optimizer run, remove jump cascades again. fixes the
regression reported in #1652
2022-05-08 13:22:10 +02:00
mrdudz
5813fd81d3 add extra optimizer step that replaces BRA by JMP if the target is external 2022-05-08 13:20:18 +02:00
mrdudz
e6b9a4b292 test related to issue #1652, shows regression broken by #1231 and the
case that #1231 improved.
2022-05-08 13:19:32 +02:00
mrdudz
e0ae8ddc68 add sourcelines to the generated asm for easier inspection,
redirect output of sim65, including cycle count, into a seperate .out file per program
2022-05-08 13:18:27 +02:00
Bob Andrews
8bdc3b092c
Update Contributing.md 2022-05-06 22:13:33 +02:00
Bob Andrews
2314cddb5a
Merge pull request #1718 from polluks2/patch-2
Some clean-up
2022-05-06 13:08:14 +02:00
Bob Andrews
61bd7be6be
Merge pull request #1725 from polluks2/patch-4
typo in markdown
2022-05-06 13:05:01 +02:00
Bob Andrews
9beedbafdd
Merge pull request #1735 from rofl0r/empty_prefix
build: allow empty prefix - should this break on Amiga or other non POSIX systems, please speak up
2022-05-06 13:04:00 +02:00
Bob Andrews
14c7ae6f0c
Merge pull request #1742 from jedeoric/mkdir_fix_telestrat
Mkdir : fix registers calls
2022-05-06 13:00:03 +02:00
jede
47743d5fcf fix space 2022-05-05 22:50:37 +02:00
jede
348ea815b0 fix mkdir 2022-05-05 22:43:06 +02:00
Bob Andrews
71cec58d86
Adjust comments 2022-05-05 14:24:02 +02:00
Bob Andrews
b8f7167dcd
Merge pull request #1729 from jedeoric/fix_fd_cleaning_telestrat
[Telestrat] missing fd_management and cleaning
2022-05-04 02:34:58 +02:00
Bob Andrews
0fc1fb4a36
Merge pull request #1740 from WayneParham/master
Added myself as an external contributor for the Sym-1 target
2022-05-02 18:58:22 +02:00
Wayne Parham
f34bd59660 Added myself as an external contributor for the Sym-1 target 2022-05-02 11:44:47 -05:00
rofl0r
20dd6fd872 change GetProgPath() to return full & resolved binary path
GetProgPath() now resolves the path derived from argv[0] always
via realpath(3p) to its real location in the filesystem, and returns
the path including binary name, effectively making it work like
windows' GetModuleFileName(), so we can re-use the existing code
to strip the trailing binary name.
since symlinks are now always resolved, we no longer need the
special case code for linux to use /proc/self/exe for this purpose.
2022-05-02 08:22:21 +00:00
Bob Andrews
74f92564c3
Try reading from /proc/self first on linux, this is needed to make the edgy "make avail" work 2022-04-30 15:01:58 +02:00
Greg King
a5e69e7ea6 Upgraded the cx16 library to the Commander X16 Kernal ROM's prerelease 39. 2022-04-29 16:56:54 -04:00
rofl0r
d78672a4b4 rename AddSubSearchPathFromWinBin to AddSubSearchPathFromBin 2022-04-28 18:35:05 +00:00
rofl0r
b32c12dd83 implement AddSubSearchPathFromWinBin() counterpart for unix
this looks up paths relative to the binary used to start the
specific application.
2022-04-28 18:35:05 +00:00
Bob Andrews
75ee10478e
Update Contributing.md 2022-04-28 15:14:34 +02:00
rofl0r
8669710c0f build: allow empty prefix
there was some concern that this will break windows' way of doing
file lookups relatively from the binary, rather than via hardcoded
locations, but so far each occurence adding e.g. "CA65_INC" to
the pathsearch is already shielded with an #ifndef _WIN32.

addressing #1726
2022-04-27 16:19:06 +00:00
Bob Andrews
ba5859f724
Update README.md 2022-04-27 14:25:46 +02:00
Bob Andrews
e5b08baf56
Merge pull request #1724 from mrdudz/constexpr
Constexpr
2022-04-27 11:47:41 +02:00
mrdudz
f7a5f6ed73 test some more cases that should not change size 2022-04-26 17:08:19 +02:00
mrdudz
a3ae28a81c added a test that must fail 2022-04-26 17:07:57 +02:00
mrdudz
7c7c5af59f Merge remote-tracking branch 'upstream/master' into constexpr 2022-04-26 16:43:10 +02:00
Bob Andrews
01f151c3ab
Merge pull request #1734 from jedeoric/fix_kbhit
[Telestrat] Kbhit fix
2022-04-26 16:33:18 +02:00
jede
4bfd57153f fix bss 2022-04-26 14:14:27 +02:00
Bob Andrews
c34d6f0ea0
Merge pull request #1731 from rofl0r/paths_as_strings
build: properly quote strings passed as cpp macros
2022-04-26 12:26:12 +02:00
jede
4474ed2668 fix space 2022-04-26 11:10:07 +02:00
jede
1281032f33 FIX space 2022-04-26 10:23:38 +02:00
jede
e9597e8721 cgetc export data now 2022-04-26 00:40:16 +02:00
rofl0r
13081e0989 remove orphaned STRINGIZE macro 2022-04-25 17:12:09 +00:00
rofl0r
bf1ef6157c build: properly quote strings passed as cpp macros
until now, the strings intended to be hardcoded into the binary,
such as directory names and build id, were passed unquoted, which
means they're interpreted by the preprocessor as C tokens, rather
than strings, which can result in all sorts of "interesting"
behaviour such as interpreting paths starting with // as C++-style
comment.
this was then worked around using a stringize macro which turned
the tokens into a string (if they happened to be in a compatible
format).

adresses #1726
2022-04-25 16:52:46 +00:00
Bob Andrews
95b22298ab
Merge pull request #1730 from rofl0r/verbose_build
build: allow the user to specify make V=1 for verbose build
2022-04-25 17:25:40 +02:00
rofl0r
d8482fbd57 build: allow the user to specify make V=1 for verbose build
it's often required to see the full commandline when things go wrong.
the standard way for Makefile-only based buildsystems and autoconf
is to pass V=1 to make.
2022-04-25 14:58:38 +00:00
Bob Andrews
f9ba3b734c
Merge pull request #1715 from karrika/atari7800conio
[atari7800] conio
2022-04-24 17:27:12 +02:00
jede
8f40243315 fix spaces 2022-04-24 15:15:10 +02:00
jede
8c26b837ef fix typo 2022-04-24 00:41:12 +02:00
jede
c48df98145 missing fd_management and cleaning 2022-04-24 00:39:04 +02:00
Karri Kaksonen
f4260ed7bc Speed up the cursor a bit 2022-04-22 06:51:35 +03:00
Karri Kaksonen
c6decc7bb8 Move cursor IRQ processing to when the screen is being drawn 2022-04-21 21:54:33 +03:00
mrdudz
23831f08de const value should never have default size, use 32bit instead 2022-04-21 14:50:48 +02:00
mrdudz
fd02cbed9d fix workdir path 2022-04-20 14:54:44 +02:00
mrdudz
99919d2899 added a testprogram to check for some of the edge cases 2022-04-20 14:50:42 +02:00
Karri Kaksonen
643e88f9cb
Merge branch 'cc65:master' into atari7800conio 2022-04-20 15:31:00 +03:00
Bob Andrews
451acb3423
Update Contributing.md 2022-04-20 14:28:34 +02:00
mrdudz
a0280d4917 Also handle the case when the non constant side of the AND expression is
known to have a smaller size than the constant side of the expression.
2022-04-20 12:53:34 +02:00
polluks2
3ad83f2191
typo 2022-04-20 12:49:30 +02:00
mrdudz
f64bf76ae8 special case for evaluating the AND operator, this should fix the problems
described in issue #1538
2022-04-20 00:13:34 +02:00
mrdudz
8d0098b818 more descriptive error message 2022-04-20 00:12:03 +02:00
mrdudz
89fcb0d404 typo 2022-04-20 00:11:24 +02:00
Karri Kaksonen
c0f23d24ad
Merge branch 'cc65:master' into atari7800conio 2022-04-19 22:07:54 +03:00
Karri Kaksonen
fc244f6b95 Too much time in irq fix 2022-04-19 21:31:16 +03:00
Karri Kaksonen
26787ba380 Fix race condition 2022-04-19 20:01:47 +03:00
mrdudz
e2ad9efe41 Merge remote-tracking branch 'upstream/master' 2022-04-19 14:49:51 +02:00
Karri Kaksonen
f44af28a31 Merge branch 'atari7800conio' of github.com:karrika/cc65 into atari7800conio 2022-04-19 10:34:21 +03:00
Karri Kaksonen
eed8cec726 Add documentation 2022-04-19 10:33:58 +03:00
Karri Kaksonen
890a181ae5 Add color setup 2022-04-19 10:32:22 +03:00
Karri Kaksonen
6a9eeeb5b0 Rename font 2022-04-19 10:31:51 +03:00
Greg King
6ea1f8ee85 Made the style-check scripts send their file lists to stderr.
A complete list will be shown before make shows its error message.  There will be less confusion about which lines are in the list.
2022-04-18 19:47:02 -04:00
Karri Kaksonen
787d5c57ad
Merge branch 'cc65:master' into atari7800conio 2022-04-18 20:22:15 +03:00
Bob Andrews
47366cbbf6
use jmp instead of jsr/rts 2022-04-18 17:49:12 +02:00
mrdudz
ece6f10588 remove dangling spaces
when changing the checker scripts and/or directly comitting to git head, please make sure to also run the checks first so you don't break the autobuilds
2022-04-18 17:43:56 +02:00
Karri Kaksonen
6671a92a8e Not sharing umula0 and fix cursor bug 2022-04-18 13:49:29 +03:00
Karri Kaksonen
6a6aa094fa
Merge branch 'cc65:master' into atari7800conio 2022-04-18 12:40:18 +03:00
Karri Kaksonen
33f12acbc9 Fix typo 2022-04-18 12:26:21 +03:00
Karri Kaksonen
20ce50e8db Use consisten line lenght values 2022-04-18 12:21:12 +03:00
Karri Kaksonen
53337f8171 Fix wrong screen in 2022-04-18 12:12:30 +03:00
Karri Kaksonen
b195c10a4c Fix tabs 2022-04-18 12:09:19 +03:00
Karri Kaksonen
dbd39c63a9 Fix tabs 2022-04-18 12:05:36 +03:00
Karri Kaksonen
45c4f7d46f Add mono conio files 2022-04-18 11:59:54 +03:00
Karri Kaksonen
4fc1270110 Add mono conio files 2022-04-18 11:59:06 +03:00
Bob Andrews
35153a6dca
Merge pull request #1677 from acqn/LongBitField
[cc65] Added support for long-type bit-fields
2022-04-18 10:01:18 +02:00
Greg King
2cdccd5e8a Oops, forgot to check macros. 2022-04-17 19:10:29 -04:00
Greg King
5839298203 Remove work directory paths _before_ checking for style errors. 2022-04-17 16:10:28 -04:00
Greg King
a4e1cf9a0a Moved a constant expression out of a loop. 2022-04-17 15:08:42 -04:00
Greg King
86ca11222a Fixed and tightenned the find commands' expressions. 2022-04-17 15:04:36 -04:00
Greg King
b2319f3578 Made all of the Makefile's rules be phony. 2022-04-17 15:04:16 -04:00
mrdudz
e9fec5e3fe define CHECK_PATH rather than leaving it open 2022-04-17 17:12:52 +02:00
mrdudz
4e3bba0c3f also check spaces at end of lines 2022-04-17 16:08:21 +02:00
mrdudz
92e16432f7 remove dangling spaces 2022-04-17 16:08:04 +02:00
mrdudz
0129622383 remove dangling spaces 2022-04-17 16:07:52 +02:00
mrdudz
1be54d13bc remove dangling spaces 2022-04-17 16:07:20 +02:00
mrdudz
3c1bb85b8e remove dangling spaces 2022-04-17 16:07:09 +02:00
mrdudz
299f967527 remove dangling spaces 2022-04-17 16:06:45 +02:00
mrdudz
f8f901b05e remove dangling spaces 2022-04-17 16:06:22 +02:00
mrdudz
3c1641e3e3 remove dangling spaces 2022-04-17 16:05:19 +02:00
mrdudz
680f0c17f5 remove dangling spaces 2022-04-17 16:05:10 +02:00
mrdudz
bfb8568a5f remove dangling spaces 2022-04-17 16:04:58 +02:00
mrdudz
945291fd69 updated a bit 2022-04-16 22:08:03 +02:00
Karri Kaksonen
9fecf0b2cc Add info 2022-04-16 21:54:52 +03:00
Karri Kaksonen
1486886e13 Add info 2022-04-16 21:48:57 +03:00
Karri Kaksonen
1585a0532a Add x=0 to textcolor 2022-04-16 21:32:22 +03:00
Karri Kaksonen
702045cce1 Fix tabs 2022-04-16 21:22:44 +03:00
Karri Kaksonen
ecd1040e07 Remove obsolete file and fix tabs 2022-04-16 21:21:35 +03:00
Karri Kaksonen
ce4d1e0e54 Remove obsolete file and fix tabs 2022-04-16 21:21:27 +03:00
Karri Kaksonen
422d245cab Split files 2022-04-16 21:13:51 +03:00
mrdudz
eb04ce8190 add more style checks 2022-04-16 20:00:10 +02:00
mrdudz
c977afe0b8 add comment explaining what the empty file is about 2022-04-16 19:59:25 +02:00
mrdudz
8cacfa70d5 add missing newline to a bunch of files 2022-04-16 19:51:48 +02:00
mrdudz
fd6662bb64 add check action also to the snapshot build 2022-04-16 18:32:49 +02:00
mrdudz
4c58757064 run style checks on PR 2022-04-16 18:21:57 +02:00
mrdudz
4b492ed4e5 added TAB checker script, to be added to the PR checker action 2022-04-16 18:18:51 +02:00
mrdudz
2eb20b3e8a remove a bunch of TABs 2022-04-16 18:16:14 +02:00
Karri Kaksonen
cdc6e1c61f Split files 2022-04-16 19:15:19 +03:00
Karri Kaksonen
81e804ed7f Split files 2022-04-16 19:15:06 +03:00
mrdudz
3dd9ed0414 remove literal TABs 2022-04-16 17:36:25 +02:00
Bob Andrews
72e548fa84
Update README.md
link Contributing.md
2022-04-16 16:20:48 +02:00
Bob Andrews
e385ec1b5e
Create Contributing.md
Starting to move info hidden elsewhere into this file
2022-04-16 16:17:50 +02:00
mrdudz
f74ce463b2 add gitignores 2022-04-16 15:24:41 +02:00
Karri Kaksonen
5c648d545d Import conio automatically 2022-04-14 21:52:57 +03:00
Karri Kaksonen
18e27d6162 Change attributes on gotoxy 2022-04-10 19:35:29 +03:00
Karri Kaksonen
d287a0afa1 Change order of gotox gotoy for correct x after newline 2022-04-10 14:43:18 +03:00
Karri Kaksonen
a05f513779 Remove duplicate code 2022-04-09 07:37:07 +03:00
Karri Kaksonen
7ba7c6f69a Add blinking cursor 2022-04-07 08:17:36 +03:00
Karri Kaksonen
2fb0f6b47d Fix screen index bug 2022-04-07 07:46:28 +03:00
Karri Kaksonen
6b5c858b20 Cleanup 2022-04-07 07:22:19 +03:00
Karri Kaksonen
3f8c29d303 Use local multiply for cursorzone calculations 2022-04-06 14:08:03 +03:00
Karri Kaksonen
b6e18e14d5 Add local multiply routine 2022-04-06 13:27:47 +03:00
Karri Kaksonen
9caf7cefd8 Allocate own zp pointer for conio implementation 2022-04-05 11:13:38 +03:00
Karri Kaksonen
d5dcea65b7 Allocate own zp pointer for conio implementation 2022-04-05 11:13:18 +03:00
Karri Kaksonen
97fd42063b Align font to 256 bytes 2022-04-05 10:42:58 +03:00
Karri Kaksonen
6b16b99192 Fix conflicts with some conio routines 2022-04-05 10:35:59 +03:00
Karri Kaksonen
4c7c3d8f2f
Merge branch 'cc65:master' into atari7800conio 2022-04-04 23:27:21 +03:00
Bob Andrews
06d423d503
Merge pull request #1713 from karrika/atari7800stdjoy
[atari7800] Atari7800stdjoy
2022-04-04 22:23:02 +02:00
Karri Kaksonen
222693e3a3
Merge branch 'cc65:master' into atari7800conio 2022-04-04 15:32:40 +03:00
Karri Kaksonen
90fc16ff1c Add cputc method 2022-04-04 15:18:40 +03:00
Karri Kaksonen
43a1c24784 Add setcursor method 2022-04-04 15:18:13 +03:00
Karri Kaksonen
c7cb201070 Remove export 2022-04-04 15:17:26 +03:00
Karri Kaksonen
37456219eb Add space to config 2022-04-04 10:52:04 +03:00
Karri Kaksonen
04a13cf949 Add cursor processing 2022-04-04 10:51:43 +03:00
Karri Kaksonen
0e6b490c8b Remove cursor from conio init 2022-04-04 10:51:13 +03:00
Karri Kaksonen
6017671fd9 Don't set cursor in clrscr 2022-04-04 10:50:38 +03:00
Bob Andrews
ca5462a698
Merge pull request #1717 from Fabrizio-Caruso/GamateConioFix
Fix color 1 and 2 (grey/green levels)
2022-04-03 23:13:37 +02:00
Fabrizio Caruso
412fd70404 Optimize delete cycles 2022-04-03 17:23:36 +02:00
Fabrizio Caruso
b65084b459 Use lsr 2022-04-03 15:28:37 +02:00
Bob Andrews
bfd76b6dd7
Merge pull request #1719 from polluks2/patch-3
Fixed documentation typo
2022-04-03 14:33:53 +02:00
polluks2
91a5eb3770
Fixed documentation typo 2022-04-03 08:21:31 +02:00
polluks2
d0e9ceb2b5
Some clean-up
One exit() too much
file is not optional
2022-04-03 00:06:45 +02:00
Fabrizio Caruso
4121c64295 Ignore executables in util directory 2022-04-03 00:02:00 +02:00
Fabrizio Caruso
b7ba02d76f Remove executables 2022-04-02 23:58:35 +02:00
Fabrizio Caruso
2414a832d7 Make the intermediate gray/green levels available 2022-04-02 23:47:36 +02:00
Fabrizio Caruso
885b360a41 Fix color 1 and 2 (grey/green levels) 2022-04-02 23:09:05 +02:00
Karri Kaksonen
b3d28dd517 Change order to make decoding easier 2022-04-02 22:49:28 +03:00
Karri Kaksonen
5040a4b2a1 Use question mark instead of exclamation mark 2022-04-02 21:28:34 +03:00
Bob Andrews
d5cb3661f3
Merge pull request #1716 from Fabrizio-Caruso/GamateConioFix
[Tentative: please review] Fix Gamate CONIO: non-solid characters bug
2022-04-02 15:15:53 +02:00
Fabrizio Caruso
426e93b4bf Fix Gamate CONIO: non-solid characters bug 2022-04-02 12:44:27 +02:00
Karri Kaksonen
2e33185dcb Remove clrscr from init 2022-04-02 13:01:05 +03:00
Karri Kaksonen
19dab6bbab Change blue to white 2022-04-02 12:09:15 +03:00
Karri Kaksonen
c44557665c Change blue to white 2022-04-02 11:48:05 +03:00
Karri Kaksonen
2388d022aa Add the build tools for the font 2022-04-02 11:47:37 +03:00
Karri Kaksonen
3a21734c68 Fix cursor character 2022-04-02 10:51:45 +03:00
Karri Kaksonen
f8b53e91fa Add the font160.png 2022-04-02 10:04:53 +03:00
Karri Kaksonen
c31c7d2782 Add basic conio buffer 2022-04-02 09:39:55 +03:00
Karri Kaksonen
77b300682a Add basic conio buffer 2022-04-02 09:39:46 +03:00
Karri Kaksonen
26ab64f207 Change polarity for 2600 buttons 2022-03-31 11:04:10 +03:00
Karri Kaksonen
e4193451d4 Add comments 2022-03-31 09:09:11 +03:00
Karri Kaksonen
4e8f62fb96 Add stdjoy driver 2022-03-31 09:08:40 +03:00
Karri Kaksonen
67def0ca0d Fixed logic flaw 2022-03-31 08:05:41 +03:00
Karri Kaksonen
2c00f1e898 Add atari7800-stdjoy 2022-03-31 07:44:26 +03:00
Bob Andrews
84dba7f6ae
Merge pull request #1709 from karrika/atari7800clock
[Atari7800] clock()
2022-03-29 23:13:47 +02:00
Karri Kaksonen
5115a1b50f Export paldetected 2022-03-25 15:08:14 +02:00
Karri Kaksonen
4a71a1fbb2 Use proper mnemonics 2022-03-25 15:02:43 +02:00
Karri Kaksonen
8d0b0e6ffc Separate machine detection from crt0 and put it in get_tv 2022-03-25 14:44:54 +02:00
Karri Kaksonen
4c3120b935 Make STARTUP segment larger 2022-03-22 21:41:12 +02:00
Karri Kaksonen
865be55e66 Split clock file to components 2022-03-22 21:29:06 +02:00
Karri Kaksonen
d0d0941a64 Add get_tv.s 2022-03-22 21:28:35 +02:00
Karri Kaksonen
c577ec1383 Add more space to init segmen 2022-03-22 21:16:56 +02:00
Karri Kaksonen
d6009721d4 Add irq handling, PAL/NTSC detection and clock() 2022-03-22 20:02:54 +02:00
Karri Kaksonen
220171d0da Add irq handling, PAL/NTSC detection and clock() 2022-03-22 20:02:46 +02:00
Bob Andrews
0851474757
Merge pull request #1708 from karrika/lynxbootloader
Fix for #1706. Clear hw palette and set AUDIN low at startup
2022-03-21 15:24:42 +01:00
Karri Kaksonen
79c243ccef Clear hw palette and set AUDIN low at startup 2022-03-21 08:37:49 +02:00
Bob Andrews
4cf7db1ef5
Merge pull request #1692 from karrika/atari7800
#805 Atari7800 target
2022-03-20 20:39:36 +01:00
Bob Andrews
58de94edd4
Merge pull request #1560 from empathicqubit/master
Add --debug-tables <filename> option and output struct fields
2022-03-20 20:27:15 +01:00
Bob Andrews
004a57bdff
Merge pull request #1707 from greg-king5/lynx-samples
Add Atari Lynx versions of three samples programs.
2022-03-19 16:12:04 +01:00
Karri Kaksonen
d12c2d6810 Fix offset for MARIA 2022-03-19 09:09:50 +02:00
Greg King
9f2d27d9c1 Added Atari Lynx versions of three sample programs.
The Lynx target can't build the usual versions because its library doesn't have conio output and stdio.
2022-03-19 01:21:52 -04:00
Greg King
266f35ee37 Made tgidemo draw circles in blue instead of orange.
That change lets it be built on two more platforms (Atmos, Telestrat).
2022-03-18 01:06:48 -04:00
Karri Kaksonen
38b330482d Make start of ROM depend on CARTSIZE 2022-03-13 13:31:11 +02:00
Karri Kaksonen
889f3a7c14 Merge branch 'atari7800' of github.com:karrika/cc65 into atari7800 2022-03-13 12:33:12 +02:00
Karri Kaksonen
52d7991b9b Remove the EXEHDR from the default build 2022-03-13 12:32:13 +02:00
Greg King
b2ae73879b Added a URL to the snapshot's commit history as a comment in the Windows snapshot ZIPs. 2022-03-12 01:35:33 -05:00
Bob Andrews
2f4e2a34c3
Merge pull request #1694 from nyanpasu64/fix-win64-segfault
Fix cc65 segfault on 64-bit LLP64 Windows builds
2022-03-09 16:52:23 +01:00
Karri Kaksonen
dd6c1cfb7d
Merge branch 'cc65:master' into atari7800 2022-03-09 14:45:38 +02:00
mrdudz
6001d3eab9 fix #warning directive so the test could actually compile :) 2022-03-07 14:48:55 +01:00
Karri Kaksonen
25ecaf873b
Merge branch 'cc65:master' into atari7800 2022-03-07 09:03:25 +02:00
Karri Kaksonen
21c093476f Merge branch 'atari7800' of github.com:karrika/cc65 into atari7800 2022-03-07 08:49:29 +02:00
Karri Kaksonen
eb86bc33b9 Add CARTSIZE to cfg file for configuring the a78 header. Add descriptions of usage. 2022-03-07 08:48:59 +02:00
nyanpasu64
9cb81f1410 Replace #include "inttypes.h" with <inttypes.h> 2022-03-06 14:48:51 -08:00
nyanpasu64
3466abc60c Fix format strings to properly format uintptr_t 2022-03-06 14:48:03 -08:00
nyanpasu64
2feba69622 Remove broken inttypes.h
src/common/inttypes.h is a shim to fix building cc65 on
non-C99-compliant compilers missing inttypes.h (like VS2012 and
earlier). The shim is actually incomplete and does not define the PRI...
macros supplied by the actual compiler headers. Since we're planning to
use those macros, delete this header so cc65's source files instead use
host-supplied inttypes.h containing macro definitions.
2022-03-06 14:47:58 -08:00
nyanpasu64
f36b9b544d Fix segfault on 64-bit LLP64 Windows builds
There are many occurrences of unsigned long in codegen.h's function
arguments. Changing g_getimmed and g_defdata makes `make` succeed
without segfaulting. I don't know if it makes cc65 behave correctly in
all cases, or if there are more unsigned long that need to be changed.
2022-03-06 14:47:51 -08:00
Bob Andrews
10c1b050c7
Merge pull request #1699 from WayneParham/master
Added Sym-1 extended memory sample program and documentation
2022-03-06 16:00:36 +01:00
Karri Kaksonen
786b4310d0
Merge branch 'cc65:master' into atari7800 2022-03-05 19:09:05 +02:00
Bob Andrews
2d0bc67c41
Merge pull request #1686 from karrika/lynxtext
Mark index 0 as TRANSPARENT. Let palette start from index 1
2022-03-05 12:54:20 +01:00
Karri Kaksonen
cc9535e82f Update docs 2022-03-04 20:21:20 +02:00
Wayne Parham
3cb85fd5e8 Minor updates 2022-03-04 06:23:06 -06:00
Wayne Parham
7664a2f61e Documentation clarifications 2022-03-03 20:51:16 -06:00
Wayne Parham
dc9c0fe90b unsigned int format specifier 2022-03-03 19:57:43 -06:00
Wayne Parham
81338a61c3 Added Sym-1 extended memory sample program and documentation 2022-03-03 17:47:31 -06:00
Bob Andrews
d368005912
Merge pull request #1698 from WayneParham/master
Corrected size of BASROM definition in Sym1 config files
2022-03-03 20:37:11 +01:00
Wayne Parham
1cb18182ed Corrected size of BASROM definition 2022-03-03 12:06:15 -06:00
Bob Andrews
53b1a18680
Merge pull request #1697 from acqn/LongCmpUnsignedFix
[cc65] Long cmp unsigned fix
2022-03-03 15:41:07 +01:00
acqn
c8956ce19b Fixed signed long comparisons with smaller unsigned types. 2022-03-03 20:24:14 +08:00
Bob Andrews
18412e1cd2
Merge pull request #1695 from acqn/MakefileFix
[Build] Fixed test/asm/listing/Makefile with mingw32-make.exe
2022-03-03 12:50:17 +01:00
Bob Andrews
4379f9cc8f Merge pull request #1695 from acqn/MakefileFix
[Build] Fixed test/asm/listing/Makefile with mingw32-make.exe
2022-03-03 12:50:17 +01:00
acqn
67594cca70 Testcases for long bit-fields. 2022-03-03 16:14:26 +08:00
acqn
1ba39b678c Fixed test/asm/listing/Makefile with mingw32-make.exe that has problems with comments lead with tabulators. 2022-03-03 14:03:01 +08:00
Bob Andrews
0587d9f5d4
Merge pull request #1675 from acqn/ShiftFix
[cc65] Fixed bitwise shift with numeric constant operand(s)
2022-03-01 19:50:21 +01:00
Greg King
bca8fcb947 Added a more general test to test/val/bug1690.c 2022-03-01 12:56:34 -05:00
Bob Andrews
a88704c6b5
Merge pull request #1691 from acqn/OptCmp1_Fix
[cc65] Fixed OptCmp1 with certain code patterns with labels.
2022-03-01 14:28:53 +01:00
Karri Kaksonen
d679faaf22 Add exehdr 2022-03-01 09:28:15 +02:00
Karri Kaksonen
b861f6df8f Add exehdr 2022-03-01 09:28:06 +02:00
Karri Kaksonen
c293b299d8 Add segment ONCE 2022-03-01 07:44:47 +02:00
Karri Kaksonen
d059682692 Add crt0.s and ctype.s 2022-03-01 07:37:07 +02:00
Karri Kaksonen
8c975dfb36 Remove garbage 2022-03-01 07:03:29 +02:00
Karri Kaksonen
3266e70de4 Add target atari7800 2022-03-01 06:44:55 +02:00
Karri Kaksonen
328781bf8a Add target atari7800 2022-03-01 06:44:26 +02:00
acqn
5ef420af5a Fixed OptCmp1 with certain code patterns with labels. 2022-03-01 10:40:01 +08:00
Karri Kaksonen
b74de2319f Fix black index in tgi_colors.s 2022-02-25 16:00:03 +02:00
Karri Kaksonen
4e406b744c Mark index 0 as TRANSPARENT. Let palette start from index 1 2022-02-24 08:50:36 +02:00
Bob Andrews
f8cdb2ab63
Merge pull request #1685 from jefftranter/fix-typos
Fix some commonly made spelling errors in comments.
2022-02-22 13:01:38 +01:00
Greg King
39df6f8f66 Made the c128, not the c64, target build the c128 version of "c64-c128-scpu-test.c".
Its placement in the wrong list caused a parallel race condition that sometimes led to failed test builds.
2022-02-21 16:07:22 -05:00
Greg King
a49bf13b25 Reverted "do not use cl65 to prevent tests from failing randomly because of one process deleting the temp files from another".
This reverted commit 02a46e0237.  That commit didn't fix the real bug (a program name in the wrong list).
2022-02-21 16:00:38 -05:00
Jeff Tranter
5d8cf4ec48 A couple of addtional fixes. 2022-02-21 15:54:47 -05:00
Jeff Tranter
2bf8be5b3b Fix some commonly made spelling errors in comments. 2022-02-21 15:44:31 -05:00
Bob Andrews
fffb4c3b40
Merge pull request #1679 from spiro-trikaliotis/testsuite-ca65
Reorganized test/asm
2022-02-20 19:54:13 +01:00
mrdudz
7f0b4b090c Merge remote-tracking branch 'upstream/master' 2022-02-20 18:07:57 +01:00
mrdudz
02a46e0237 do not use cl65 to prevent tests from failing randomly because of one process deleting the temp files from another 2022-02-20 16:49:01 +01:00
empathicqubit
49b4a57add Documentation 2022-02-20 12:40:32 +01:00
Spiro Trikaliotis
0f6cb5b114 Add proper readmes 2022-02-20 11:20:20 +01:00
Spiro Trikaliotis
0e45976f9b Rename target test to asm 2022-02-19 12:52:02 +01:00
Spiro Trikaliotis
388ae87cb3 Reorganized test/asm 2022-02-19 12:44:20 +01:00
acqn
904a77e03c Testcase for #1675. 2022-02-18 15:20:01 +08:00
acqn
2bda128ef1 Fixed LimitExprValue() for 64-bit long env. 2022-02-26 23:02:51 +08:00
polluks2
246814e63b
smarter manufacturer
some kind of promotion
2022-02-18 00:43:49 +01:00
Greg King
d006317b0e Made the snapshot-on-push Github action run on only the upstream repository. 2022-02-17 00:30:31 -05:00
acqn
14988f5dda Fixed bitwise shift with numeric constant operand(s). 2022-02-16 20:10:54 +08:00
Bob Andrews
bfa9e77523
Merge pull request #1672 from spiro-trikaliotis/pr-1647
ca65: .constructor after .export fails
2022-02-15 22:34:04 +01:00
Bob Andrews
7c417359ec
Merge pull request #1674 from spiro-trikaliotis/obs-link
Add link to DEB and RPM snapshots
2022-02-15 22:25:20 +01:00
Spiro Trikaliotis
1df61b6ec7 Add link to DEB and RPM snapshots 2022-02-15 22:16:06 +01:00
Spiro Trikaliotis
364e72921c ca65: .constructor after .export fails
The actor directives (.constructor, .destructor, .interruptor, and .condes)
can't handle a symbol that's already exported.

The relevant code does the checks in the wrong order.

For example, the following correct snippet does not assemble:

        .export         C
C:      .constructor    C, 5

The assembler outputs: test.s:2: Error: Address size mismatch for symbol 'C'

Exchanging both lines makes it work.

This fixes #1647; the patch is provided by 'kugelfuhr' and taken from there.
2022-02-15 22:03:47 +01:00
Bob Andrews
9088d66758
Merge pull request #1671 from spiro-trikaliotis/pr-1634
Invalid flagged errors if token is missing
2022-02-15 21:57:00 +01:00
Spiro Trikaliotis
3d0013ab30 Invalid flagged errors if token is missing
A missing factor in an expression causes an expected but missing token
to be skipped, leading to invalid flagged errors in the following line:

l = 3 +
lda     #$00

An error should be output for line 1, but not for line 2. Actually, both
are flagged as errors:

test.s(1): Error: Syntax error
test.s(2): Error: Unexpected trailing garbage characters

This patch (as proposed in issue #1634 by kugelfuhr) fixes this.
2022-02-15 21:46:07 +01:00
mrdudz
ad82392428 add hint on VICE -moncommands 2022-02-15 21:25:24 +01:00
Bob Andrews
24c8de87c2
Merge pull request #1662 from acqn/StructFix
[cc65] Fixed ICE on unnamed bit-fields declared with typedef'ed types
2022-02-14 17:31:45 +01:00
acqn
6dbafda53f Testcase for #1662. 2022-02-14 22:28:22 +08:00
Greg King
86b6514c16 Added code that avoids infinite loops that were caused by circular references
(a symbol that was defined by referring to itself directly or indirectly).  Patch by kugelfuhr.
2022-02-13 07:38:00 -05:00
mrdudz
30b00ed076 attempt to prevent utils being compiled with cc65 2022-02-11 16:53:34 +01:00
mrdudz
118e73ddf9 build utilities in a seperate step 2022-02-11 16:38:40 +01:00
Greg King
1f51a9f587 Removed geos_apple and geos_cbm from the lists of targets.
They need resource files to go with the program source files.  The top-level samples and targettest programs don't have those resources.
2022-02-09 04:05:35 -05:00
Greg King
5747fa4df3 Added '+' to another SUBDIRS_recipe. 2022-02-09 04:05:35 -05:00
Greg King
9dd13d7047 Moved the platform-test enumerations from Github Actions over to makefiles.
Now, we can run those tests locally, as well as on Github.
2022-02-09 04:05:35 -05:00
Bob Andrews
ee345600b4
Merge pull request #1658 from WayneParham/master
Correction of link typos
2022-02-08 22:42:21 +01:00
Wayne Parham
9cb005c98f Correction of link typos 2022-02-08 14:22:09 -06:00
Bob Andrews
449341f873
Merge pull request #1657 from WayneParham/master
Documentation updates for Sym-1.
2022-02-08 11:50:27 +01:00
Wayne Parham
470b648b9f Added note about return value being function status. 2022-02-07 19:51:03 -06:00
Wayne Parham
84d639e40c Typo correction. 2022-02-07 19:46:16 -06:00
Wayne Parham
e488d7b2a6 Documentation updates for Sym-1. 2022-02-07 19:14:02 -06:00
Wayne Parham
10b8920ecc Merge https://github.com/cc65/cc65 2022-02-07 17:12:43 -06:00
mrdudz
856517a771 Merge remote-tracking branch 'upstream/master' 2022-02-06 18:51:21 +01:00
mrdudz
dfe478b154 upload snapshot to sourceforge 2022-02-06 18:20:09 +01:00
mrdudz
ddfbe932e3 test upload again 2022-02-06 17:29:14 +01:00
mrdudz
e7469212d7 try publishing on sf after snapshot 2022-02-06 16:49:01 +01:00
Bob Andrews
94d1bfc450
Merge pull request #1653 from mrdudz/movesamples
move some things from targettest to samples
2022-02-05 18:18:07 +01:00
mrdudz
0436c6e314 fix this too 2022-02-05 18:09:32 +01:00
mrdudz
1ff68e2894 Merge remote-tracking branch 'upstream/master' into movesamples 2022-02-05 17:57:00 +01:00
mrdudz
e0745204b6 fix again. sigh 2022-02-05 17:56:33 +01:00
mrdudz
766e0e2144 fix 2022-02-05 17:51:48 +01:00
mrdudz
9308f5147d Merge remote-tracking branch 'upstream/master' into movesamples 2022-02-05 17:48:09 +01:00
mrdudz
096c28bb52 remove programs in util dir before making a snapshot. we might later
decide to leave them there anyway.
2022-02-05 17:47:20 +01:00
mrdudz
2ea9cf0449 cleanup 2022-02-05 17:44:54 +01:00
mrdudz
179f2d05aa utils before samples 2022-02-05 17:44:46 +01:00
mrdudz
b3217ccb03 build util dir when testing 2022-02-05 17:44:32 +01:00
mrdudz
d23c9b6aa5 use gamate-fixcart from util dir 2022-02-05 17:34:22 +01:00
mrdudz
61dc15cad0 Merge remote-tracking branch 'upstream/master' into movesamples 2022-02-05 17:31:20 +01:00
mrdudz
afe9d6a2eb also compile the programs in the util directory by default, not only
do we want to test they can be compiled, but also samples may use/require
them. we might want to install them too, perhaps
2022-02-05 17:28:28 +01:00
mrdudz
4e5b521903 move some things from targettest to samples 2022-02-05 16:55:57 +01:00
Greg King
98bc021c5a Added the names of samples and targettest programs that the telestrat library can build now. 2022-02-03 18:23:23 -05:00
Greg King
f64ee3370d Added to the telestrat library the name of the standard dynamic TGI driver. 2022-02-03 18:23:23 -05:00
Greg King
bae2821d5a Added telestrat to <time.h>.
That library has clock().
2022-02-03 18:23:23 -05:00
Bob Andrews
7bbc006014
Merge pull request #1649 from polluks2/typos
Fixed many typos
2022-02-03 14:43:11 +01:00
Bob Andrews
24227482ea
Merge pull request #1648 from polluks2/tco
Added tail call optimization
2022-02-03 14:42:41 +01:00
polluks
f7fa81b244 Fixed many typos 2022-02-03 01:01:10 +01:00
polluks
a26778744a Added tail call optimization 2022-02-02 23:02:01 +01:00
polluks
8e60102e8e Removed the colour purple
This commit may break compatibility.
2022-02-02 00:58:50 +01:00
Oliver Schmidt
e3ca14116d
Disable double hires on exit.
A program being run afterwards might not even know about the existence of double hires. So it's our task to turn double hires off on exit.
2022-01-31 19:32:44 +01:00
Greg King
7118c9236b Fixed the cart directory build code to handle even simple programs.
Carts can be built containing programs that don't link some segments.
2022-01-31 08:14:26 -05:00
Greg King
112e216e53 Removed an obsolete command-line option from the cc65 compiler. 2022-01-30 22:10:06 -05:00
polluks
a29a1b0a59 Added more purple (rain) 2022-01-31 02:18:01 +01:00
Greg King
98f862b8fb Fixed heaptest.c compiler warnings in a way that's better than PR #1621.
This fix adds "unsigned" to one line instead of removing it from several lines.
2022-01-30 20:13:04 -05:00
mrdudz
25363ae00a the forgotten minimal testprog 2022-01-30 23:26:07 +01:00
mrdudz
c50f5c9467 build targettest progrs for all targets 2022-01-30 19:51:05 +01:00
mrdudz
d8366132c7 fix Makefiles for all targets, dive into subdirs like in samples 2022-01-30 19:51:05 +01:00
Bob Andrews
b00cb182d9
Merge pull request #1637 from polluks2/save_a_few_bytes
Save a few bytes
2022-01-30 13:21:41 +01:00
mrdudz
ccb77735d2 samples makefile already goes through the subdirs correctly 2022-01-30 13:18:51 +01:00
mrdudz
a0fc95bb15 actually use all targets for the samples dir 2022-01-30 12:49:33 +01:00
mrdudz
333c31e4ce fix for atari5200 2022-01-30 12:49:02 +01:00
mrdudz
6e5a988f85 build samples for all targets 2022-01-30 12:36:15 +01:00
Bob Andrews
82f55a930a
Merge pull request #1618 from polluks2/master
Fixed many typos
2022-01-30 12:21:07 +01:00
polluks
e327071615 Save a few bytes 2022-01-30 03:26:32 +01:00
polluks
e66a54ac14 Revert commits 2022-01-30 03:15:28 +01:00
polluks2
97c83de37b
Merge branch 'cc65:master' into master 2022-01-30 02:40:27 +01:00
mrdudz
11bcaba99b comment out all the non working targets 2022-01-30 02:29:11 +01:00
mrdudz
908173b663 add sym1 target 2022-01-30 02:14:01 +01:00
mrdudz
91cf347f31 fix pathes 2022-01-30 02:13:54 +01:00
mrdudz
273721e05e fix pathes 2022-01-30 02:07:50 +01:00
mrdudz
43fdc8781d and another 2022-01-30 01:54:06 +01:00
mrdudz
90cc44b410 another try 2022-01-30 01:46:47 +01:00
mrdudz
d1ae098190 iterate through all targettest builds 2022-01-30 01:23:10 +01:00
Bob Andrews
9da9b979f2
Merge pull request #1621 from SvenMichaelKlose/pixel_targettest_fixes
Fix VIC build, remove compiler warnings, add LST files for VICE emulator targets.
2022-01-30 00:10:30 +01:00
Bob Andrews
ad1ebb697f
Merge pull request #1626 from mdsteele/paravirt
Fix Pop() implementation in src/sim65/paravirt.c (fixes #1625)
2022-01-29 22:33:32 +01:00
Bob Andrews
6332f090d9
Merge pull request #1620 from SvenMichaelKlose/pixel_strnlen
Add standard C library function strnlen().
2022-01-29 21:32:27 +01:00
Bob Andrews
4579a7e181
Merge pull request #1629 from DLehenbauer/pet_asm_inc
asminc/pet.inc: Add PIA1 & PIA2 addresses
2022-01-29 21:21:58 +01:00
Christian Groessler
c3e01062ea put Atari 20-column note to where it belongs... 2022-01-24 20:13:49 +01:00
Christian Groessler
fc12b19659
Merge pull request #1633 from sprive/atari8-docs
document special case on sub 40-col modes
2022-01-24 20:00:13 +01:00
Scott Prive
91920f807e document special case on sub 40-col modes 2022-01-23 18:53:14 -05:00
polluks2
3aeaa36a58
Wrong platform
There was no conio for Lynx
````
../bin/ld65   -o mandelbrot -t lynx -m mandelbrot.map mandelbrot.o lynx.lib
mandelbrot.s:516: Error: Unresolved external '_clrscr'
conio/vcprintf.s:85: Error: Unresolved external '_cputc'
conio/cputs.s:25: Error: Unresolved external '_cputc'
conio/cputs.s:15: Error: Unresolved external 'gotoxy'
ld65: Error: 3 unresolved external(s) found - cannot create output file
make: *** [mandelbrot] Error 1
````
2022-01-22 01:04:08 +01:00
Daniel Lehenbauer
12f9a2f1f8 asminc/pet.inc: Add PIA1 & PIA2 2022-01-17 08:22:15 -08:00
Matthew D. Steele
22a3d55e40 Add space after function names 2022-01-08 16:39:30 -05:00
Matthew D. Steele
1f6bc6240f Move local variable declaration to top of block 2022-01-08 16:29:42 -05:00
Matthew D. Steele
92bfbeb8ab Adjust Pop() sequencing in paravirt.c 2022-01-08 16:24:40 -05:00
Matthew D. Steele
cf1bc4fad4 Fix Pop() implementation in src/sim65/paravirt.c (fixes #1625)
The Pop() function was not handling stack pointer wrap around correctly.

Also, change the simulated RTS implementation in ParaVirtHooks() to
explicitly sequence the two Pop() calls in the correct order.
2022-01-07 09:56:46 -05:00
acqn
4f4487cb03 Added supports for long bit-fields. 2022-01-04 18:23:04 +08:00
acqn
6beb090193 Fixed anonymous bit-fields declared with typedef'ed type names. 2022-01-03 23:54:14 +08:00
acqn
38511843e5 Fixed crash with labels in non-function/block scopes. 2022-01-03 23:50:48 +08:00
acqn
21858b52e7 Separated data initializer stuff from declaration stuff. 2022-01-03 13:10:32 +08:00
polluks2
06725c166e
Merge branch 'cc65:master' into master 2021-12-31 17:21:20 +01:00
polluks
1bcf93d010 Merge branch 'master' of http://github.com/polluks2/cc65 2021-12-30 00:42:29 +01:00
polluks
4920ffa23a Save a few bytes 2021-12-30 00:04:57 +01:00
Sven Michael Klose
683739d6fc mostlyclean: Clean up. 2021-12-25 21:25:52 +01:00
Sven Michael Klose
05b8af07aa main(): No return value. 2021-12-25 21:21:01 +01:00
Sven Michael Klose
3bd72b9659 main(): Re-introduce return value. Compiler rejects 'void'. 2021-12-25 20:15:09 +01:00
Sven Michael Klose
0707cdbe2c Remove command line arguments and return value from main(). 2021-12-25 20:12:45 +01:00
Sven Michael Klose
f4702cbc40 Make label file for c610 platform. 2021-12-25 20:11:22 +01:00
Sven Michael Klose
412a30987a Remove -t option for linker only. 2021-12-25 20:10:53 +01:00
Sven Michael Klose
34dd29556f Use -t option alongside -C. 2021-12-25 20:09:18 +01:00
Sven Michael Klose
de158c0847 Use suffix '.lbl' instead of '.lst'. 2021-12-25 20:07:34 +01:00
Sven Michael Klose
d1cbb1deeb More strict printf() format string. 2021-12-25 20:04:10 +01:00
Sven Michael Klose
666f266e90 Move strnlen() to non-ANSI section. 2021-12-25 14:21:47 +01:00
Sven Michael Klose
65564a158c Remove most compiler warnings. 2021-12-25 09:57:18 +01:00
Sven Michael Klose
bdd18d958b cbmdir-test for VICs needs memory expansion. 2021-12-25 09:45:15 +01:00
Sven Michael Klose
58dd28f053 Make VICE monitor command lists for Commodore platforms. 2021-12-25 09:40:32 +01:00
Sven Michael Klose
ba93ab07bc Do not compile petscii test for unsupported platforms.
Only C64 is supported.
2021-12-25 09:19:37 +01:00
Sven Michael Klose
87fe2f5d0e Add test of strnlen(). 2021-12-25 09:13:43 +01:00
Sven Michael Klose
c9ccc82b9f strnlen(): Add comment with POSIX standard. 2021-12-25 09:12:13 +01:00
Sven Michael Klose
0b84465276 Fix strnlen(). 2021-12-25 09:11:58 +01:00
Sven Michael Klose
921e549172 Add standard C library function strnlen(). 2021-12-24 23:44:57 +01:00
Greg King
6ac4aa4e20 Made cbm_open() be more efficient.
The fastcall argument doesn't need to be put on a stack.  SETNAM can be called before SETLFS.
2021-12-24 00:10:04 -05:00
polluks2
7d6b6ef986
Delete c-cpp.yml 2021-12-22 09:50:38 +01:00
polluks2
cff0f71ea8 Merge branch 'master' of github.com:polluks2/cc65 2021-12-21 17:54:32 +01:00
polluks2
7ffbf7aa75
Merge branch 'cc65:master' into master 2021-12-21 17:43:07 +01:00
polluks2
c32846dc6e Merge branch 'master' of http://github.com/cc65/cc65 2021-12-20 13:49:20 +01:00
Greg King
884f72637b Put the alignment decrement code back into posix_memalign().
Without that code, the function returns a very broken pointer.
2021-12-19 21:08:46 -05:00
Oliver Schmidt
2235830e31 Don't rely on (actually changed) unspecified compiler behavior. 2021-12-19 16:55:32 +01:00
polluks2
1cdd4676b2 Fixed many typos 2021-12-14 13:13:16 +01:00
polluks2
89909cd4ed
Merge branch 'cc65:master' into master 2021-12-14 09:19:17 +01:00
Bob Andrews
6a76d6d905
Merge pull request #1611 from polluks2/patch-3
Fixed many typos
2021-12-13 20:05:31 +01:00
Bob Andrews
37d0c4066c
Merge pull request #1610 from polluks2/patch-2
Fixed typo
2021-12-13 18:49:40 +01:00
polluks2
1d3318c247
Fixed many typos 2021-12-13 17:20:56 +01:00
polluks2
9e9b3dbaca
Fixed typo 2021-12-13 17:14:57 +01:00
Greg King
230f4d3807 Install system packages before checking out the repo. 2021-12-12 23:54:17 -05:00
Greg King
325ff9667e Used (size_t), instead of (long) where converting between pointers and integers.
(long) still is 32 bits on 64-bit Windows!
2021-12-12 19:40:43 -05:00
Greg King
366701e066 Added a 64-bit Windows cross-compile.
That compiler catches pointer-integer width mismatches that other compilers ignore.
2021-12-12 19:02:37 -05:00
Greg King
33cf8608b7 Removed unneeded package names.
sshpass isn't needed because the Windows packages are put on Github.
linuxdoc-tools is a dependency of linuxdoc-tools-info.
The binutils package is a dependency of the gcc package.
2021-12-12 19:02:37 -05:00
Greg King
2feadf865c Changed a big script into separate named steps.
It makes the job log easier to navigate.

Also, Pull Requests don't need a Zip file.
2021-12-12 19:02:37 -05:00
Oliver Schmidt
b35a9d97a6 Updated URL and improved consistency. 2021-12-12 23:59:22 +01:00
Bob Andrews
c0c89a81e4
Merge branch 'master' into rremd 2021-12-11 22:36:12 +01:00
Bob Andrews
332742b688
Merge branch 'master' into master 2021-12-11 22:35:50 +01:00
dqh-github
bd94879be2
Re-added build status badge
(Github Actions is now doing a snapshot build and test for updates to the master branch)
2021-12-11 15:28:29 +11:00
dqh-github
308b5b68e9
Merge pull request #1607 from dqh-github/snapshot-builds
Snapshot build on push master.
2021-12-11 15:13:48 +11:00
David Hogan
a39c23f796 Snapshot build on push master.
For now, the snapshot zip can be obtained from the latest successful snapshot build at:
https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml

TODO: Update docs at https://github.com/cc65/doc
TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io
2021-12-11 14:10:19 +11:00
dqh-github
f09f0dd913
Merge pull request #1605 from dqh-github/master
Automated Github pull request build and test
2021-12-11 13:02:05 +11:00
dqh-github
ad009f0ff6
Merge pull request #1 from dqh-github/gha-test
Automated Github pull request build and test
2021-12-11 12:50:43 +11:00
David Hogan
4eaf68d414 Automated Github pull request build and test 2021-12-11 12:43:59 +11:00
polluks2
380f6e7db5
Merge branch 'cc65:master' into master 2021-12-10 15:15:53 +01:00
acqn
970607cde5 Optimized g_testbitfield() and g_extractbitfield() with enhanced support for long bit-fields. 2021-12-05 12:21:01 +08:00
acqn
2d96f79bc7 Added and used new utility type functions for bit-fields.
Fixed GetUnderlyingTypeCode() for bit-fields with widths > 16.
2021-12-01 09:45:17 +08:00
Wayne Parham
1d36f255ec Added Sym-1 link to documentation doc/index.sgml 2021-11-24 22:26:43 +01:00
Wayne Parham
622d2c4e39 Added Sym-1 link to documentation doc/index.sgml 2021-11-24 14:30:19 -06:00
Oliver Schmidt
cb0dca0ca7
No more Travis-CI ! 2021-11-24 14:17:18 +01:00
Oliver Schmidt
37e7e65f43
Merge pull request #1500 from WayneParham/master
Synertek Systems Sym-1 files
2021-11-23 22:59:48 +01:00
Oliver Schmidt
8b0de8a931
Merge branch 'master' into master 2021-11-23 22:56:51 +01:00
Gerhard Gruber
a7e6f9840c VIC-20 and C128 cfg added for ASM programming 2021-11-23 21:51:57 +01:00
gorlik
1918f0ac9b adding missing VIC register definition to c64.inc 2021-11-23 21:34:49 +01:00
Gabriele Gorla
6637e28831 saves 2 bytes in the standard c64 joystick driver
remove redundant code and add jmp to the common sequence
two more bytes could be saved at the expense of longer sequence with interrupts disabled by moving sei/cli
2021-11-23 21:34:49 +01:00
Oliver Schmidt
f796c26091
Added hint on clock().
clock() isn't available on the Apple II - and never will be.
2021-11-21 22:56:02 +01:00
polluks2
ba33c3f57d
Merge branch 'cc65:master' into master 2021-10-29 10:46:59 +02:00
mrdudz
4f87c7cc64 move samples that only work for a specific target into subdirs named the same as the target 2021-10-23 01:18:17 +02:00
Christian Groessler
c3d7a90084 targettest/atari/ostype.c: remove warnings 2021-10-05 19:19:54 +02:00
Christian Groessler
f6636635fa targettest/atari/multi-xex.cfg: fix comments 2021-10-05 19:17:16 +02:00
Oliver Schmidt
c48e821c4b
Don 2021-09-29 14:48:09 +02:00
Oliver Schmidt
674a543909
Parallelize build
Travis CI defaults to 2 core environments.
2021-09-29 12:33:51 +02:00
cc65 Owner
2338e70709
travis-ci.org -> travis-ci.com 2021-09-29 10:37:44 +02:00
empathicqubit
fd8d51497c Add --debug-tables <filename> option and output struct and union fields 2021-09-29 05:20:44 +02:00
mrdudz
94445cd16f remove conio.pce from the default target and print a message instead 2021-09-28 22:37:34 +02:00
mrdudz
cf1c0b6774 move hints on how to run binaries from the target specific pages to the intro page, where they should be. 2021-09-28 22:18:49 +02:00
mrdudz
86f1965202 added test related to issue #1552 fixed in pr #1571 2021-09-28 18:55:23 +02:00
mrdudz
6ba8a385a0 add test related tu issue #1562 2021-09-28 18:11:23 +02:00
acqn
eeaa111835 Fixed crash in Opt_a_toscmpbool caused by wrong order of condition checks. 2021-09-28 17:02:37 +02:00
Oliver Schmidt
28b1687aaf Be explicit about hardware flow control (RTS/CTS) being the only supported option. 2021-09-26 12:09:50 +02:00
polluks2
fb7b880dc0
Create c-cpp.yml 2021-09-09 11:05:39 +02:00
polluks2
bd23ad4d6d
Merge branch 'cc65:master' into master 2021-08-30 13:56:54 +02:00
Greg King
52e4387929 Added a program that tests the Commodore-specific directory functions. 2021-08-12 13:21:24 -04:00
Spiro Trikaliotis
62da869e49 doc: psg_silence: Remove empty notes
The notes section of psg_silence (Creativision funcref) contained an
empty Notes section, consisting of an empty <itemize> only.

Newer sgmltools fail on this, as they insist on having an <item>
element, or they fail compilation:

[  225s] Processing file ../doc/funcref.sgml
[  225s] onsgmls:/tmp/linuxdoc-tools.NfxbjODQbW/sgmltmp.funcref.01.precmdout:5884:9:E:end tag for "ITEMIZE" which is not finished

Fixed this by removing the (empty) Notes section altogether.
2021-06-21 22:10:31 +02:00
Wayne Parham
5f4605c4fc Remove trailing blank lines from read.s, write.s and tapeio.s 2021-06-16 17:28:19 -05:00
Wayne Parham
d6ef8326f9 Remove trailing blank line from libsrc/sym1/display.s 2021-06-16 17:24:18 -05:00
Wayne Parham
85d345088d Remove trailing two blank lines from libsrc/sym1/crt0.s 2021-06-16 17:21:57 -05:00
Wayne Parham
5d90087e66 Add space after every function or statement, before parenthesis 2021-06-16 17:14:44 -05:00
Wayne Parham
82bdc77e41 puts() whitespace style change 2021-06-16 16:47:38 -05:00
Wayne Parham
bed61df837 Removed unnecessary blank line from samples/Makefile 2021-06-16 16:28:17 -05:00
Wayne Parham
a93542e80c Added __fastcall__ to comments 2021-06-16 16:24:26 -05:00
Wayne Parham
f1f700799b All samples use 'int main' and 'return int' 2021-06-16 07:35:18 -05:00
Wayne Parham
f98e5f4feb Stylistic changes 2021-06-15 17:14:27 -05:00
Wayne Parham
11d81b1f43 Stylistic changes 2021-06-15 16:39:28 -05:00
Greg King
fcda94f258 Made a slight improvement in the ld65 expression evaluator. 2021-06-13 20:36:05 -04:00
Wayne Parham
4db50e8e93 Documentation update: Mention where to find sym1 sample programs 2021-06-13 11:29:30 -05:00
Wayne Parham
faf6266cde typo in comment 2021-06-12 06:28:53 -05:00
Wayne Parham
c9bb1483ac Add BEL->beep functionality 2021-06-12 06:17:03 -05:00
Wayne Parham
9e6c1d1303 tapeio and symNotepad updates 2021-06-11 19:55:13 -05:00
Greg King
14d05c61b6 Made Creativision's joystick driver more efficient. 2021-06-11 07:43:25 -04:00
Greg King
af3d4581d3 Moved Creativision's playsound() into a separate file.
It won't waste space in a cartridge if it isn't used.
2021-06-11 07:43:25 -04:00
Greg King
f636d4e634 Fixed the Creativision library's bios_playsound().
It was disabling interrupts permanently.
2021-06-11 07:43:24 -04:00
Wayne Parham
24f5bac899 Added BEL -> beep() functionality 2021-06-10 16:07:39 -05:00
acqn
31128d4809 Added test cases for result types of certain operations. 2021-06-10 21:54:32 +02:00
acqn
25a35d6b59 Fixed result type of certain operations, which was broken with the bit-field fix. 2021-06-10 21:54:32 +02:00
Christian Groessler
f3db74395d fix last change and use stdbool.h 2021-06-10 20:08:58 +02:00
Christian Groessler
7f1f0249f3 enumdevdir.c: allocate path name buffers from the heap. 2021-06-10 20:08:58 +02:00
Christian Groessler
c90c3c9133 stdio.inc,stdio.h: set CBM PATH_MAX/FILENAME_MAX value to 255
Some parts of the runtime library cannot handle larger paths.
2021-06-10 20:08:58 +02:00
Christian Groessler
ae9101961e stdio.inc,stdio.h: increase CBM PATH_MAX/FILENAME_MAX value to 256+1 2021-06-10 20:08:58 +02:00
Christian Groessler
9a523abbfb limits.h: provide PATH_MAX
- stdio.h: define FILENAME_MAX to PATH_MAX
- stdio.h, stdio.inc: increase FILENAME_MAX/PATH_MAX for Atari
  (For DOSes with subdirectory support.)
2021-06-10 20:08:58 +02:00
Wayne Parham
7d6541274d Changes to I/O access 2021-06-09 10:23:42 -05:00
acqn
d69e81cd66 Moved and improved test cases for Issue #1462.
Fixed an old test case for unsigned enum bit-fields that are supposed to be int-promoted.
2021-06-09 08:03:12 +02:00
acqn
5adb29ce31 Made "bit-field-ness" a type property instead of a SymbolEntry or ExprDesc property.
Fixed integer promotion and result type in certain operations.
Fixed bit-fields 'op=' and postfix inc/dec operators.
2021-06-09 08:03:12 +02:00
acqn
1d7bf7355c Better function naming in declare.c.
Scalar initialization routines need only 'const Type*' as parameters.
2021-06-09 08:03:12 +02:00
acqn
004c60de39 Optional flags for the codegen to skip restoring the expression results into the primary registers. 2021-06-09 08:03:12 +02:00
acqn
dcacba472a Moved ArithmeticConvert() from cc65/expr.c to cc65/datatype.c.
Reorganized a few functions in cc65/datatype.c.
Added SignedType() and UnsignedType() for future usage.
Made LimitExprValue() external so that it can be used more often.
2021-06-09 08:03:12 +02:00
Filip Golewski
09862e7ce9 Update src/msbuild.cmd script to optionally include Visual Studio 2019 Community build tools 2021-06-08 21:16:20 +02:00
acqn
2324bd62f6 If __A__,__AX__ or __EAX__ is used, post-inc/dec within the same statement will not modify it.
Moved testcase from src/test/todo to src/test/val plus minor improvement on portability.
2021-06-08 14:16:14 +08:00
Wayne Parham
2a25921515 Sym-1 documentation updates 2021-06-07 20:00:18 -05:00
Wayne Parham
2635655e8c sym1.cfg cosmetic changes 2021-06-07 19:07:36 -05:00
Wayne Parham
89fb731e2e samples/helloworld.c 2021-06-07 19:01:06 -05:00
polluks2
ed9f9ccbab Fix #1536 2021-06-07 23:12:50 +02:00
Wayne Parham
886e9e83b2 Removed stdin->stdout echo from read.s 2021-06-07 12:33:29 -05:00
Wayne Parham
6cf4bd99bb Added Makefile for targettest/sym1 2021-06-07 11:50:47 -05:00
Wayne Parham
79757ee280 Removed 'return' from samples (with void main) 2021-06-07 01:04:55 -05:00
Wayne Parham
732a5fb9a7 Remove bin and hex references from samples/Makefile 2021-06-07 00:56:50 -05:00
Wayne Parham
5eafd8115f Cleanup whitespace in Makefile 2021-06-07 00:53:15 -05:00
Wayne Parham
975e43892f Samples cleanup 2021-06-07 00:48:02 -05:00
Wayne Parham
a3fce656b7 Samples updates 2021-06-07 00:42:13 -05:00
Wayne Parham
88ee45e9ef tapeio.s updates 2021-06-07 00:35:20 -05:00
Wayne Parham
dc9333a3bb tapeio.s updates 2021-06-07 00:18:26 -05:00
Wayne Parham
c961782192 Removed libref.s 2021-06-07 00:07:09 -05:00
Wayne Parham
0bbff54378 return val updates 2021-06-07 00:03:44 -05:00
Wayne Parham
33af3d7997 sym1.h updates 2021-06-06 23:53:53 -05:00
Wayne Parham
9d509735a8 Makefile changes 2021-06-06 21:56:23 -05:00
Wayne Parham
64afb50d5a Makefile changes 2021-06-06 21:45:58 -05:00
Wayne Parham
6c4c959141 Sym-1 lib changes 2021-06-06 21:28:03 -05:00
Wayne Parham
e687f2f048 Clarified 'Limited memory applications' section 2021-06-06 17:55:58 -05:00
Wayne Parham
7d5fc7eb43 Changed kb references to KB 2021-06-06 17:51:24 -05:00
Wayne Parham
69e2313a63 First round of requested code changes 2021-06-06 23:20:54 +01:00
Greg King
1c16e46f23 Improved ld65's error messages about ca65's .BANK() function.
* Split a message into two more specific messages.
2021-06-05 11:31:28 -04:00
Greg King
39ef63cbbc Don't check for circular references of imports that don't have matching exports.
This fix will avoid referring to a struct member through a null pointer.
2021-06-04 13:35:26 -04:00
bbbradsmith
d5d9183ccf conform to prevailing if bracket style 2021-06-04 07:09:58 -04:00
bbbradsmith
6ebe551919 return is sufficient, TooComplex flag is unnecessary to resolve this crash case
suggested by greg-king5 in #1409
2021-06-04 07:09:58 -04:00
bbbradsmith
3584c4c87f fix crash when a NULL ExprNode is checked for circular references 2021-06-04 07:09:58 -04:00
acqn
4d5fe38540 Fixed OptStackOps when the stuff pushed on stack top is accessed before the op. 2021-06-03 12:03:53 +02:00
acqn
79be6dec16 More quick hack for CE_GenRegInfo. 2021-06-03 12:03:53 +02:00
acqn
0bfa13722b More funcinfo on register usage fixes. 2021-06-03 12:03:53 +02:00
IrgendwerA8
fe003eedd4 Fix Atari keyboard code for cursor up key 2021-05-31 11:19:24 +02:00
Greg King
0d3c827d80 Made the C preprocessor #if nesting stack have 256 levels.
Closes #1523.
2021-05-30 03:52:32 -04:00
Greg King
ee5014c595 Simplified the Supervision "hello world" sample program. 2021-05-29 09:04:47 -04:00
Greg King
c0f29993e0 Fixed the descriptions of the Creativision's functions.
Fixed bios_playsound()'s position in the alphabetical list of functions.
2021-05-29 08:53:13 -04:00
Greg King
6bedade593 Fixed the creativision function prototypes.
Added const to a pointer parameter.
2021-05-29 08:37:38 -04:00
polluks2
4973fc2246 Merge branch 'cc65:master' into master 2021-05-25 17:20:49 +02:00
mrdudz
010eea12a2 move test for issue #1211 into misc 2021-05-25 13:38:06 +02:00
Polluks
30830e1348 Added missing Creativision functions 2021-05-25 10:42:21 +02:00
mrdudz
65c640d2cf added missing atari5200 target 2021-05-24 15:15:07 +02:00
mrdudz
022935320c test for issue #897 2021-05-24 14:30:10 +02:00
mrdudz
ae3d3a4b5d make readme a bit more clear (hopefully) 2021-05-24 13:53:44 +02:00
mrdudz
adda9438d2 testcase for issue #1357 2021-05-24 13:53:14 +02:00
Wayne Parham
ae9434e02e seven-segment display update 2021-05-23 15:22:33 -05:00
Wayne Parham
db395e5988 Improved sample program symDisplay.c 2021-05-23 13:31:28 -05:00
mrdudz
0db23a8951 testcase for issue #263 2021-05-23 18:55:06 +02:00
polluks2
4865caa593 Merge branch 'cc65:master' into master 2021-05-22 23:39:34 +02:00
mrdudz
b08dc28cc1 another testcase related to issue #1462 2021-05-22 22:34:52 +02:00
mrdudz
e13f57e86c added another testcase for issue #1462 2021-05-21 16:09:10 +02:00
Greg King
663268dca9 Syncronize the Supervision crt0.s with its ld65 config files.
.segment "VECTOR" -> "VECTORS". Fixes #1506.
2021-05-21 03:32:43 -04:00
Christian Groessler
681c9594cc libsrc/atari5200/crt0.s: fix formatting 2021-05-21 01:45:55 +02:00
Olli Savia
0ae1aad3d3 Fix typo: VIAx_CR -> VIAx_ACR 2021-05-19 20:26:11 +02:00
mrdudz
6d560f4236 change prototype for GraphicsString() to void __fastcall__ GraphicsString(const void *myGfxString); 2021-05-18 15:16:14 +02:00
Greg King
d14148ab4f Restricted commit b9a3c78888 to classic-style Assembly macros.
.include will work at expansion-time for .define macros.
2021-05-17 19:48:47 -04:00
mrdudz
4a57656f69 add test for issue #1504 2021-05-17 14:40:09 +02:00
mrdudz
d736032675 added a missing comment 2021-05-17 14:25:33 +02:00
mrdudz
c53059468e fix documentation for the driver _init calls 2021-05-17 14:25:18 +02:00
mrdudz
d2da30a7e2 give the "samples" target something to do to supress the "nothing to be done for 'samples'" message 2021-05-16 23:38:17 +02:00
mrdudz
5fc9d3f048 change driver _install calls from taking "void*" to "const void*" 2021-05-16 22:57:28 +02:00
mrdudz
ce487651b0 as suggested by Oliver:
- only output messages if MAKELEVEL is 0
- indent nested ifeq
- use if (,) syntax
2021-05-16 22:24:35 +02:00
acqn
1450f146a5 Fixed '[]', '()' '.' and '->' operators following a postfix increment/decrement. 2021-05-16 20:43:49 +02:00
acqn
43ca887263 Fixed 'case'/'default' labels in non-compound 'switch' body statement. 2021-05-16 20:43:49 +02:00
mrdudz
a9af6aa743 fix warnings 2021-05-16 18:29:45 +02:00
mrdudz
4ba3ff3048 redirect c64 to geos-cbm and apple2enh to geos-apple when given with SYS= on the command line, as suggested by oliver 2021-05-16 18:23:23 +02:00
mrdudz
53f0552fe7 fix warnings 2021-05-16 17:12:50 +02:00
WayneParham
e9fd87d07a
Merge branch 'master' into master 2021-05-16 10:02:37 -05:00
mrdudz
aecb01986a fix list of executables for geos-apple 2021-05-16 15:45:34 +02:00
acqn
f5dacda69b NoCodeConstExpr() fix to avoid exessive error messages. 2021-05-16 19:08:43 +08:00
acqn
6a3b9a9880 E_ADDRESS_OF logic fix. 2021-05-16 19:08:42 +08:00
acqn
aac03eae6f Better future-proof bit-masking. 2021-05-16 19:08:42 +08:00
acqn
2d014383cd Replaced certain usage of "(New-)PointerTo()" with "AddressOf()". 2021-06-08 00:43:26 +08:00
acqn
924fcf5d06 Replaced several occurance of PtrConversion() with StdConversion().
Variadic arguments of functions should be default-promoted.
2021-06-08 09:32:58 +08:00
mrdudz
86bd6b9add Added executable list for all targets and print a message when certain
samples are not available for a target (instead of failing). This makes
"make SYS=<target>" in samples recursively work for all supported targets.
2021-05-15 19:48:19 +02:00
polluks2
930dc7efc2 Merge branch 'cc65:master' into master 2021-05-14 22:14:21 +02:00
acqn
18ae09f682 Less excessive errors with failed array declarations. 2021-05-14 10:48:17 +02:00
acqn
dfba8d77ca Error messages shouldn't raise warnings about unused expressions by themselves. 2021-05-14 10:48:17 +02:00
Wayne Parham
321bac4178 Remove TAB characters 2021-05-13 14:43:16 -05:00
Christian Groessler
09e0e74124 (again) remove TABs 2021-05-13 18:12:12 +02:00
Greg King
e5813cfb1a Removed two duplicate TYPEDEFs from a header.
The first one is replaced by an #include of the header that has its original TYPEDEF.
The second one is replaced by its base type.

That change allows pedantic C90-compliant compilers to accept the header.
2021-05-13 00:24:32 -04:00
Greg King
af4c4f6aaf Removed a "return" keyword from an inline function that must return (void). 2021-05-12 19:43:32 -04:00
Greg King
5d198d6842 Fixed some URL links in a couple of documents. 2021-05-12 05:05:39 -04:00
Wayne Parham
f09ffb2a45 symNotepad.c 2021-05-12 01:08:13 +01:00
polluks2
3d541d0d10 Merge branch 'cc65:master' into master 2021-05-11 18:28:07 +02:00
Andrea Odetti
05f545e189 More line number related changes. 2021-05-11 17:41:59 +02:00
Andrea Odetti
93762a2117 ld65: move 2 more cases to the notation file:line. 2021-05-11 17:41:59 +02:00
Andrea Odetti
feccc68c54 ld65: avoid redundant error message information. 2021-05-11 17:41:59 +02:00
Andrea Odetti
467844963a Update failing test due to error format changes. 2021-05-11 17:41:59 +02:00
Andrea Odetti
bcc670ee36 Standard formatting of error messages.
https://www.gnu.org/prep/standards/html_node/Errors.html

Issue: https://github.com/cc65/cc65/issues/1494
2021-05-11 17:41:59 +02:00
Oliver Schmidt
bda5bf70ce
Merge pull request #1487 from mrdudz/wrapped-call
Extend #pragma wrapped-call to support "bank" argument
2021-05-11 14:32:28 +02:00
Bob Andrews
82ee502f57
Merge branch 'master' into wrapped-call 2021-05-11 14:16:25 +02:00
mrdudz
07dd1e3849 fix formatting 2021-05-11 14:14:44 +02:00
mrdudz
18f94d1fe0 rework to use a magic value instead of a flag, as suggested by Oliver 2021-05-11 14:00:49 +02:00
mrdudz
ef74226993 improve error message 2021-05-11 13:37:53 +02:00
mrdudz
ef8c70c7af use url instead of htmlurl, add note on least significant 8bits of the bank value 2021-05-11 13:36:30 +02:00
Oliver Schmidt
b7856ddd4f Just some source formatting adjustments. 2021-05-11 10:40:44 +02:00
Wayne Parham
a2def19de5 Added TGT_SYM1 2021-05-10 15:20:49 +01:00
Wayne Parham
27e04b36b0 Makefile updates 2021-05-09 17:24:15 -05:00
Wayne Parham
f81aefe8bd Synertek Systems Sym-1 config files 2021-05-09 17:13:24 -05:00
Wayne Parham
aea5db48cb fix typo in README.md 2021-05-09 16:55:17 -05:00
Wayne Parham
044a0838a3 Changes to existing cc65 source to support Synertek Systems Sym-1 2021-05-09 16:52:48 -05:00
Wayne Parham
6e79379405 Synertek Systems Sym-1 machine-specific files 2021-05-09 16:34:53 -05:00
polluks2
ab9db5b503 Merge branch 'cc65:master' into master 2021-05-09 21:01:33 +02:00
Oliver Schmidt
07bd5089ec Define CLOCKS_PER_SEC as _clocks_per_sec() if _clocks_per_sec() is actually available.
There are programs checking for the existence of CLOCKS_PER_SEC before usage. We don't want to mislead them.
2021-05-09 19:27:33 +02:00
polluks2
9dffc8ab0f Merge branch 'cc65:master' into master 2021-05-08 20:01:45 +02:00
polluks2
b1f81d5e21 Optimised code 2021-05-08 19:48:31 +02:00
Polluks
4c37f12a4d Optimised strlen 2021-05-08 19:36:37 +02:00
polluks2
80877a600a Merge branch 'cc65:master' into master 2021-05-08 17:56:22 +02:00
mrdudz
3ea330f15f update docs 2021-05-08 01:03:43 +02:00
mrdudz
0fbf2af09d Fix the warning that is produced for unused functions 2021-05-08 01:03:43 +02:00
mrdudz
729690e9e9 document the wrapped-call extension 2021-05-05 16:07:47 +02:00
mrdudz
c9f242e566 Extend #pragma wrapped-call to support "bank" argument 2021-05-05 14:42:29 +02:00
Greg King
216bb22b20 Added a special version of a function which uses an absolute addressing mode to access the zero page.
The PCEngine needs such operands to be redirected to RAM page $20 explicitly.  Fixes #1482; fixes #1483.
2021-05-04 12:10:43 -04:00
Marco Aurelio da Costa
04cd884f8f Prevent missed .ENDMACRO in included file 2021-05-02 14:17:11 +02:00
Marco Aurelio da Costa
b9a3c78888 Parse file included inside a macro at definition time 2021-05-02 14:17:11 +02:00
Evgeny Vrublevsky
8e02f8f5ec Add .REFTO as an alias to .REFERTO. Update the docs related to it. 2021-04-29 07:55:43 -04:00
Evgeny Vrublevsky
50a58e7706 Added documentation for the .REFERTO. 2021-04-29 07:55:43 -04:00
Evgeny Vrublevsky
83e7c37277 Use .REFERTO instead of .REF as the command. 2021-04-29 07:55:43 -04:00
Evgeny Vrublevsky
e9a72b2462 Add .REF control command implementation. 2021-04-29 07:55:43 -04:00
mrdudz
f3663b8d2e added test for issue #1461 2021-04-28 14:21:48 +02:00
acqn
71bd6415d6 No more unnecessary jump-over labels generated for logical OR false cases. 2021-04-24 23:53:26 +02:00
Greg King
1f4ce41846 Fixed the alphabetic sorting of the "Pseudo functions" section. 2021-04-24 13:48:42 -04:00
Greg King
4866ee53e6 Moved some Assembly function descriptions out of the "Control commands" section, and into the "Pseudo functions" section. 2021-04-24 13:20:10 -04:00
mrdudz
080cb1bac9 added testcase for issue #1462 2021-04-23 21:52:36 +02:00
Oliver Schmidt
5d84a4ba13 Removed non-ASCII chars. 2021-04-19 16:06:10 +02:00
Oliver Schmidt
f272bc8f42 Removed non-ASCII chars. 2021-04-19 15:50:52 +02:00
Marco Aurelio da Costa
fd3d5d35fb mc: Implemented .LITERAL 2021-04-19 15:42:29 +02:00
acqn
f901adba22 Predefined type strings for inlined std function parameters. 2021-04-19 15:36:55 +02:00
acqn
9cea9ce5e2 Made the code more constness-correct with 'Type' usage. 2021-04-19 15:36:55 +02:00
acqn
cb64aaf20c Made the code more constness-correct with 'Type' usage for inlined std functions. 2021-04-19 15:36:55 +02:00
acqn
328345b9c3 Removed a helper function that is no longer used. 2021-04-19 15:36:55 +02:00
acqn
24d36854d2 Minor cleanups with array element qualifiers. 2021-04-19 15:36:55 +02:00
acqn
896f463a23 Used more specific pointers instead of the "arbitary attribute pointer" used in type strings. 2021-04-19 15:36:55 +02:00
acqn
bfb7c936aa Preparation for constness-correction. 2021-04-19 15:36:55 +02:00
Oliver Schmidt
a982f6a668 Removed obsolete file.
c658acbf85 made this file unnecessary.
2021-04-18 21:14:49 +02:00
Evgeny Vrublevsky
ac08482fa3 Allow editing cc65.props from Property Manager. 2021-04-18 21:12:51 +02:00
Evgeny Vrublevsky
ee8c7b47bc Add new lines at the end of the project files. 2021-04-18 21:12:51 +02:00
Evgeny Vrublevsky
7be3b53f72 cc65.props uses spaces instead of tabs. 2021-04-18 21:12:51 +02:00
Evgeny Vrublevsky
2120dd662c Move all common project settings into cc65.props. 2021-04-18 21:12:51 +02:00
Marco Aurelio da Costa
9941855dc6 mc: Removed original version comment, not relevant for assembler 2021-04-18 20:39:05 +02:00
Marco Aurelio da Costa
f7613b529c mc: Added default charmap include files for assembler 2021-04-18 20:39:05 +02:00
Marco Aurelio da Costa
1993d5c091 mc: Documentation for .PUSHCHARMAP/.POPCHARMAP 2021-04-18 20:39:05 +02:00
Marco Aurelio da Costa
83ee928fb1 mc: Formatting, remove stray lines 2021-04-18 20:39:05 +02:00
Marco Aurelio da Costa
c915b5d7f3 Implemented charmap stack
New commands:
 .PUSHCHARMAP: will push the current charmap state into an internal stack
 .POPCHARMAP: will restore the current charmap to the last pushed charmap

Details:
  The push and pop facilities are implemented directly inside the tgttrans.h,
  to facilitate its reuse on the C compiler.
2021-04-18 20:39:05 +02:00
Greg King
ffc30c0c6e Added RAM_BANK and ROM_BANK macro definitions to cx16.h header. 2021-04-18 01:39:44 -04:00
acqn
6e61093e79 Fixed pointer subtraction in certain very rare cases. 2021-04-17 11:14:37 +02:00
Greg King
6bb1b6953f Documented the options to control cc65's warnings about induced pointer type changes. 2021-04-17 01:59:09 -04:00
acqn
e9545d68ee Minor clean-ups and typo fixes. 2021-04-17 11:43:03 +08:00
Dirk Lehmann
eb1cf750f2 -W-unreachable-code option added, alphabetic order of --list-warnings 2021-04-13 09:37:55 +02:00
acqn
5f8d163045 Moved one test case for #1209. 2021-04-06 22:20:39 +02:00
acqn
e435da6234 Interim fix for Issue #897. 2021-04-06 22:20:39 +02:00
Oliver Schmidt
0ed41db478 Some minor clarifications. 2021-04-06 01:45:41 +02:00
acqn
39700c77ee Added test case for Issue #1451. 2021-04-05 15:49:54 +02:00
acqn
bd8eae67f1 Fixed local struct field access via the address of the struct. 2021-04-05 15:49:54 +02:00
polluks2
f5365c7ffd Update README.md
Commander X16
2021-04-03 21:29:18 -04:00
polluks2
2583dfb71a
Update README.md
Commander X16
2021-04-04 03:13:45 +02:00
polluks2
4c0ee3e0d8
Merge pull request #3 from cc65/master
Update
2021-04-04 02:34:41 +02:00
acqn
5d05451ab2 Fixed test case for Issue #1263. 2021-04-03 17:50:46 +02:00
acqn
1a3628df1a Fixed the term 'argument' vs 'parameter' in function parser. 2021-04-03 17:50:46 +02:00
acqn
2864b3ef8a Fixed composition of prototypes and old-style function definitions with default promotions.
Fixed function parameter list comparison with empty ones.
2021-04-03 17:50:46 +02:00
acqn
91fd30611a Fixed ICE on error cases such as '&func + int a'. 2021-04-03 17:45:52 +02:00
Christian Groessler
200b420562 Export LMARGN_save to C. People might want to preserve this setting in their program.
In turn rearrange startup code in order that LMARGN can be set by a 'constructor' (Do
"initlib" later.)
2021-04-01 15:19:06 +02:00
acqn
4a38965384 Warnings on discarding pointer qualifiers always.
Added new -W options to turn on/off warnings on certain pointer conversion cases:
- pointer-sign: to a pointer type differing in pointee signedness. Default on.
- pointer-types: to a pointer type incompatible. Default on.
2021-03-30 19:41:20 +02:00
acqn
b802efde54 Fixed ternary result type detection with pointer types.
Fixed pointer type comparison and conversion, especially regarding qualifiers.
Improved diagnostics about type comparison and conversion.
Reorganized some type-comparison/conversion functions.
2021-03-30 19:41:20 +02:00
acqn
31c1172a3a zlib: Use correct (un)signedness of char in prototypes and functions.
Also ensure we are using the same constness qualifiers.
2021-03-30 19:41:20 +02:00
acqn
f9812930c1 More detailed diagnostic info about conflicted function types. 2021-03-30 16:47:57 +08:00
acqn
cb8fbf4772 Removed the non-existing-in-C "struct/union scope" for structs/unions.
Fixed handling of struct/union field declarations without identifiers, which do nothing.
2021-03-29 19:28:22 +02:00
Greg King
edecbc86b8 Reverted "Second address" back to "Secondary address". 2021-03-27 13:34:39 -04:00
mrdudz
bf1bb7a032 ooopsie :) 2021-03-27 15:13:32 +01:00
mrdudz
54920193e5 added test for issue #1438 2021-03-27 15:11:47 +01:00
Oliver Schmidt
1bd04e8462
Merge pull request #1439 from acqn/CConvFix
[cc65] Issue #1438 fix
2021-03-27 01:33:07 +01:00
mrdudz
d2bc449598 Merge branch 'master' of https://github.com/cc65/cc65 2021-03-26 22:18:31 +01:00
mrdudz
02392d6220 added test related to issue #1437 2021-03-26 22:18:05 +01:00
acqn
f273b1ebcb Fixed crash with non-inlined __fastcall__ function invocation with no arguments. 2021-03-26 11:02:46 +08:00
Greg King
710c6c6f2f Fixed cbm_k_readst() to work around a VIC-20 Kernal bug.
It properly returns the RS-232 device's status.
2021-03-25 15:22:18 -04:00
Greg King
0f1386ff4c Added documentation about the slightly different behavior of cpeekcolor() on the cx16 platform. 2021-03-25 08:28:15 -04:00
acqn
3755e4a863 Replaced checking for __fastcall__ aginst AutoCDecl etc. with IsFastcallFunc(). 2021-03-24 14:35:44 +08:00
mrdudz
d3cd668585 also test (some of) the cases with an external function 2021-03-22 23:37:33 +01:00
mrdudz
55e89416cd test related to issue #1196 and pr #1424 respectively 2021-03-22 19:12:44 +01:00
Christian Groessler
531a31722e fix typo 2021-03-22 14:06:40 +01:00
Oliver Schmidt
203c4da15b
Merge pull request #1434 from mrdudz/test1423
Test for pr #1423
2021-03-20 02:01:46 +01:00
acqn
3c2e7ce41c More reliable test for true/false with addresses for AND, OR and ternary operators.
Minor comment typo fix.
2021-03-20 01:39:32 +01:00
acqn
f8835d2867 Fixed codegen with addresses as boolean test conditions.
Fixed warning on unreachable code of if body.
2021-03-20 01:39:32 +01:00
mrdudz
82fb9aa418 testcase related to pr #1423 2021-03-20 00:55:55 +01:00
mrdudz
bbfc24770e test related to pr #1425 2021-03-20 00:23:12 +01:00
acqn
325b7b4ab3 Enabled 'a ? b, c : d'. 2021-03-20 00:09:47 +01:00
acqn
a51d6d40de Ternary fix for some obscure cases. 2021-03-20 00:09:47 +01:00
mrdudz
cc040ca04a remove, fucking git 2021-03-19 23:39:56 +01:00
mrdudz
57e69d9647 test related to pr #1425 2021-03-19 23:35:34 +01:00
mrdudz
7d528d9eb0 fix typo 2021-03-19 22:26:49 +01:00
mrdudz
9ec9d1e20c test for issue #1431 / pr #1424 2021-03-19 20:53:52 +01:00
acqn
6974c1ff12 Fixed and cleaned up codegen logic with arithmetic conversion in addition and subtraction. 2021-03-19 16:35:03 +01:00
Christian Groessler
cd116e5ba0 src/ar65/library.c: style fix 2021-03-18 22:27:42 +01:00
Christian Groessler
9b05fe9982 src/ar65/library.c: fix compilation on Windows 2021-03-18 22:27:42 +01:00
Christian Groessler
358d750b3e ar65: fix parallel builds by using a per-process temp file 2021-03-18 22:27:42 +01:00
Christian Groessler
64449f0f54 ar65: better version of last change 2021-03-18 22:27:42 +01:00
Christian Groessler
d3c495e8b9 ar65: fix parallel builds by using a per-process temp file 2021-03-18 22:27:42 +01:00
acqn
b02838439c Changed g_addaddr_local() codegen to reduce code size. 2021-03-16 22:29:20 +01:00
acqn
8eeaaa3f36 Made certain types of comparison between addresses in constant expressions work. 2021-03-16 22:29:20 +01:00
acqn
99c7fe0ada Reusing code from parseadd() for ArrayRef().
Now index[ptr] works in constant expressions.
Fixed codegen for cast type in constant expressions.
Calls on swapstk in 'i[ptr]' is avoided when possible.
2021-03-16 22:29:20 +01:00
acqn
f5972dfd08 Made int+pointer work in constant expressions.
Fixed codegen for cast type addition in constant expressions.
Calls on swapstk in 'i+ptr' is avoided when possible.
2021-03-16 22:29:20 +01:00
acqn
aa6fdf58b8 Addresses in constant subtraction expressions now work.
Fixed codegen for cast type subtraction in constant expressions.
2021-03-16 22:29:20 +01:00
acqn
c4a2620e29 Added an utility function to check for quasi-constant addresses (of stack variables). 2021-03-16 22:29:20 +01:00
acqn
0a8ca3041a Changd all Find*Last*InOpenRange() to return the beginning of the open range.
Fixed FindArgLastUsageInOpenRange().
2021-03-16 22:24:19 +01:00
acqn
4376b83390 Fixed LoadAAt(). 2021-03-16 22:24:19 +01:00
acqn
bd5d5b7385 Removed the prototype of evalexpr() that no longer exists. 2021-03-16 22:24:19 +01:00
jede
41f796bbe1 left and right mask are inverted : fix in telestrat.h 2021-03-15 21:10:29 -04:00
jede
b9fd318985 fix space/column 2021-03-13 00:15:05 +01:00
jede
c0d638a26d add clock for Telestrat target and add some Telemon primitives 2021-03-13 00:15:05 +01:00
jedeoric
4f26650228
[Telestrat] chdir management (#1419)
* add syschdir

* revert read.s

* remove extra line

* Now we update __cwd

* Fix tab

* Fix another tab

* Fix tab

* Fix tab and jmp

* fix xgetcwd

* Fix comments
2021-03-11 09:42:14 +01:00
greg-king5
23fba6cc37
Merge pull request #1412 from jedeoric/master
[Telestrat] Fix many bugs in conio Telestrat target
2021-03-09 18:44:20 -05:00
jede
a05dddd0d6 Fix next column 2021-03-09 22:02:26 +01:00
jede
facc1b4914 Fix cputdirect 2021-03-08 21:16:44 +01:00
jede
df64fd859c Fix cvline bug 2021-03-07 23:00:15 +01:00
jede
48badc0816 Fix import return0 2021-03-06 21:40:26 +01:00
Oliver Schmidt
bc8cca9fc4 Revert "Now getchar works"
This reverts commit 1fc16cb9ed.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
f122837955 Revert "add syschdir"
This reverts commit d83e8a3f0e.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
d6f2fda575 Revert "revert read.s"
This reverts commit 65d5786da5.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
8ae5a4a134 Revert "remove extra line"
This reverts commit 973a5337ac.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
ab4ca51848 Revert "Now we update __cwd"
This reverts commit d417baf826.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
558dfa285e Revert "Fix tab"
This reverts commit 17ca09ba9a.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
24d63a96b1 Revert "Fix another tab"
This reverts commit 9b36565485.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
f9ca091bd0 Revert "Fix tab"
This reverts commit 2ae41e0a55.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
1d8479b411 Revert "Fix tab and jmp"
This reverts commit bf9d4ac3bb.
2021-03-06 12:03:05 +01:00
jede
bf9d4ac3bb Fix tab and jmp 2021-03-04 18:02:26 +01:00
jede
2ae41e0a55 Fix tab 2021-03-04 18:02:26 +01:00
jede
9b36565485 Fix another tab 2021-03-04 18:02:26 +01:00
jede
17ca09ba9a Fix tab 2021-03-04 18:02:26 +01:00
jede
d417baf826 Now we update __cwd 2021-03-04 18:02:26 +01:00
jede
973a5337ac remove extra line 2021-03-04 18:02:26 +01:00
jede
65d5786da5 revert read.s 2021-03-04 18:02:26 +01:00
jede
d83e8a3f0e add syschdir 2021-03-04 18:02:26 +01:00
jede
1fc16cb9ed Now getchar works 2021-03-04 18:02:26 +01:00
polluks2
1dcb21eaa7
Merge pull request #2 from cc65/master
Update
2021-03-04 09:09:46 +01:00
Greg King
5f145542b0 Exported the Commodore CHRIN and CHROUT Kernal functions, in the CBM libraries.
This commit complements commit 98f8064b83.
2021-03-03 17:39:53 -05:00
jede
872739b5f4 Fix comments, return line and bordercolor return 2021-03-03 22:14:29 +01:00
acqn
047d0f479b Comments format fix. 2021-03-03 10:07:24 +01:00
acqn
2aad72af90 Removed trailing whitespaces. 2021-03-03 10:07:24 +01:00
jede
cdbe23c351 Fix missing new line in bordercolr 2021-03-01 23:21:58 +01:00
jede
3adddf5825 Merge branch 'master' of https://github.com/jedeoric/cc65 2021-03-01 23:20:37 +01:00
jede
185c451000 Fix cputdirect 2021-03-01 23:19:30 +01:00
jedeoric
ba4310f589
Merge branch 'master' into master 2021-03-01 23:03:34 +01:00
jede
abef6566e7 Add revers.s 2021-03-01 22:45:05 +01:00
jede
8ec6d28f92 Revert read.s 2021-03-01 22:44:06 +01:00
jede
256b22f1c7 Add bordercolor and cvline 2021-03-01 22:36:09 +01:00
jede
02e52fe24d Fix many bugs 2021-03-01 22:33:12 +01:00
acqn
8b6d78a075 Added Opt_a_tosbitwise for 8-bit bitwise operations. 2021-03-01 22:11:22 +08:00
acqn
3caceb8174 Fixed result type in certain contant expression addition cases. 2021-02-26 19:45:46 +01:00
acqn
f2eed38fc8 Fixed expression type of the result of numeric constant comparison. 2021-02-26 19:45:46 +01:00
acqn
ea0c634e12 Improved codegen for unsigned char type comparison with numeric constants. 2021-02-23 22:06:21 +01:00
acqn
6f5ad51816 Added testcase for Issue #1408. 2021-02-23 22:06:21 +01:00
acqn
d628772cd1 Fixed signed char type comparison with unsigned numeric constants. 2021-02-23 22:06:21 +01:00
acqn
f1c715c455 Fixed a bug that pointer subtraction results from two absolute addresses are calculated as unsigned long. 2021-02-22 14:14:59 -05:00
acqn
da4cc08b78 Moved and improved test case for Issue #1310. 2021-02-22 14:14:59 -05:00
acqn
81d6321cd7 Fixed internal representation of calculated constant results.
Minor clean-up.
2021-02-22 14:14:59 -05:00
acqn
24985f1b33 Added testcase for the "deferred ops in unevaluated context" bug. 2021-02-22 11:02:47 +01:00
acqn
eadaf2fef8 Fixed deferred post-inc and post-dec in unevaluated context such as 'sizeof(i++)'. 2021-02-22 11:02:47 +01:00
acqn
40b26f4060 Now the compiler removes code that has no observable effect. 2021-02-22 13:47:32 +08:00
Greg King
bb3a2db5a0 Fixed an ambiguous statement about CONDES segments. 2021-02-21 15:44:59 -05:00
Greg King
acb5af539f Fixed the ld65 configure files for the cx16 platform.
* Added ONCE and INIT segments to the Assembly configuration.
* Made more segments optional in the standard and the banked configurations.  That will make them a little easier to use with Assembly-source programs.
2021-02-21 14:02:49 -05:00
acqn
7f05bd797f Now the compiler tracks code that has no observable effect. 2021-02-21 16:36:29 +08:00
acqn
131f96eb1e Moved testcase for issue #1397. 2021-02-17 07:03:11 -05:00
acqn
55ae350fed Fixed 'Opt_staxspidx' for the invariant of 'staxspidx'. 2021-02-17 07:03:11 -05:00
Oliver Schmidt
3a7282544e Moved convert.system from geos-apple to apple2[enh].
The target util convert.system is to be used in conjunction with GEOS on the Apple II but has to be built as an "ordinary" Apple II program. The way the cc65 library build system is designed there's no way to define dependencies between targets. The solution used so far was to explicitly trigger a build of the target 'apple2enh' from the target 'geos-apple'. However, that approach tends to break parallel builds which may be in the middle of building 'appple2enh' at the time it is triggered by 'geos-apple'.

There might be ways to get this fixed - but the the cc65 library build systrem is already (more than) complex enough, so I really don't want to add anything special to it.

On the other hand there are easier ways (outside the scope of cc65) to archive what convert.system does so I don't presume convert.system to be actually used - it's more a reference type of thing.

Putting all facts together the decision was easy: Just move convert.system from the target it is used with to the target(s) it is built with.
2021-02-17 10:50:22 +01:00
Christian Groessler
b12758fe53 include/atari.h: fix typo in _setcolor() prototype 2021-02-16 14:07:47 +01:00
Greg King
98f8064b83 Made the directory functions compatible with the Commander X16's DOS.
It's directory listing's last line says, "mb free."
2021-02-15 08:56:31 -05:00
Christian Groessler
43881afca2 doc/atari5200.sgml: document splash screen user changeable settings 2021-02-11 21:02:24 +01:00
Christian Groessler
9cd1ffa6a6 doc/ld65.sgml: document the INIT segment
- re-arrange the segments in the "Special segments" section alphabetically
- some small changes in section 5.8 (FILE) regarding Atari XEX format
2021-02-11 20:58:17 +01:00
mrdudz
ab8bb26868 added testcase for issue #1937 2021-02-09 19:50:08 +01:00
Christian Groessler
6c90f3e2d2 atarixl configs: RAM memory area was renamed to MAIN in d8c31cf1d3
adjust comments accordingly
2021-02-09 11:22:58 +01:00
Oliver Schmidt
8551431233 Optimized based on https://github.com/cc65/cc65/pull/1393. 2021-02-05 11:54:07 +01:00
acqn
6617a017fa Added Opt_a_tossub for 8-bit subtraction. 2021-02-05 17:29:49 +08:00
jede
a9dac3b1ef Fix X register for kbhit 2021-02-02 14:09:57 +01:00
jede
b52ee25385 Rollback read.s 2021-02-02 14:09:57 +01:00
jede
f622783ae1 kbhit added for telestrat target 2021-02-02 14:09:57 +01:00
jede
6c59a6254f Now getchar works 2021-02-02 14:09:57 +01:00
acqn
95830cce29 Fixed test/misc/bug1265.c with its output. 2021-01-30 14:31:51 +01:00
acqn
bfc7a51a44 Fixed Issue #1265 according to C89/C99 standards. 2021-01-30 14:31:51 +01:00
acqn
c9ac515286 Functions with no prototypes might use EAX registers. 2021-01-30 14:31:51 +01:00
acqn
a1992702f8 Declarations of 'extern' object and function should be visible in the file scope. 2021-01-30 14:31:51 +01:00
acqn
a040c28cc4 Moved test for #1374. 2021-01-19 14:33:27 +01:00
acqn
b99455cc47 Fixed Issue #1374. 2021-01-19 14:33:27 +01:00
mrdudz
0846219672 added testprogram for issue #1374 2021-01-16 16:40:58 +01:00
polluks2
0636c4bc30
Merge pull request #1 from cc65/master
Update
2021-01-13 12:26:00 +01:00
Oliver Schmidt
a861d84011
Fixed recent addition of __A__. 2021-01-06 16:09:55 +01:00
Piotr Kaczorowski
0884278ae3 Correction in documentation regarding __A__ pseudo variable 2021-01-06 16:05:04 +01:00
Piotr Kaczorowski
e3fa247012 Yet another fix typo in cc65.sgml 2021-01-06 16:05:04 +01:00
Piotr Kaczorowski
601e628343 Another fix typo in cc65.sgml 2021-01-06 16:05:04 +01:00
Piotr Kaczorowski
68e1faa2c8 Fix typo in cc65.sgml 2021-01-06 16:05:04 +01:00
Piotr Kaczorowski
9662469957 Return-type warning and pseudo variable __A__ documentation added. 2021-01-06 16:05:04 +01:00
Rocky
a9b71b6207 return-type - new warning suppression type added 2021-01-06 16:05:04 +01:00
Greg King
d90cd11212 Fixed outdated comments. 2020-12-27 18:22:12 -05:00
Sven Michael Klose
9800555bbb Remove stale comments. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
9d62abb7ac Fix comment. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
db31204950 Remove stale comment. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
6201300816 Fold constant calculation. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
f59cb9af06 Use more compact loops. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
99c0815cdb Clear up comments a bit. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
3957310950 Knock off two bytes from getcwd(), cbm_read() and cbm_write(). 2020-12-27 17:54:49 -05:00
Jesse Rosenstock
e0c12c90cd g_asr, g_asl: Use ROL/ROR for char shifts by >= 6
Instead of `val` right (left) shifts, we can also do `9 - val` left (right)
rotates and a mask.  This saves 3 bytes and 8 cycles for `val == 7` and
1 byte and 4 cycles for `val == 6`.
2020-12-27 14:22:40 -05:00
Christian Groessler
ef258bdc19 remove TABs which again slipped in.... 2020-12-25 07:16:26 +01:00
michael
d67b955e52 Fixed example of the OS struct usage for Atari 5200 2020-12-25 01:35:38 +01:00
baktrasf
2e9bada1f2 Atari 5200 OS header refinements 2020-12-25 01:35:38 +01:00
baktrasf
1c72da4904 Add operating system symbols for the Atari 5200 target 2020-12-25 01:35:38 +01:00
Jesse Rosenstock
dfd047ce6a g_typeadjust: Use CF_CHAR for char args
If lhs and rhs are either both signed char or both unsigned char,
return flags for that type instead of (unsigned) int.  The flags
are used only for codegen.  Currently, this does nothing, since
codegen treats chars as ints unless CF_FORCECHAR is set, but it
allows more efficient char x char -> int codegen to be added in
the future.
2020-12-24 14:40:39 -05:00
Greg King
b2c1a77bb3 Fixed the cc65 code that optimizes 16-bit compares when the high bytes are known to be equal.
Only the low bytes are compared.  Originally, signed 16-bit compares were optimized into signed 8-bit compares.  But, the sign bits are in the high bytes; and, they're equal.  Therefore, the low bytes always must be compared as unsigned numbers.
Fixes #1348.
2020-12-24 12:27:09 -05:00
Oliver Schmidt
0f4cb443b4 Improved device I/O under DOS 3.3
Certain scenarios (e.g. not running any Applesoft program at all since booting DOS 3.3) can make DOS 3.3 consider cc65 device input (e.g. getchar()) that reads a CR interpreting the command in the keyboard buffer. Setting the hibyte of the Applesoft currently executed line number to some value <> $FF (beside setting the input prompt to some value <> ']') makes DOS 3.3 understand that we're not in intermediate mode and that therefore I/O not preceded with ctrl-d mustn't be fiddled with (see DOS 3.3 routine at $A65E).
2020-12-19 19:54:12 +01:00
Greg King
59c58acbe3 Documented the address size argument of the bss-name, code-name, data-name, and rodata-name pragmas. 2020-12-05 23:04:48 -05:00
Olli Savia
b22d8c7441 Added STATUS (0) definition 2020-12-03 12:13:23 +01:00
Polluks
9563541870 crt0 clean-up 2020-11-29 18:08:33 +01:00
Polluks
5fa7b90e05 crt0 clean-up 2020-11-29 17:10:34 +01:00
Tim Gates
2646c06f61 docs: fix simple typo, paramater -> parameter
There is a small typo in src/cc65/pragma.c.

Should read `parameter` rather than `paramater`.
2020-11-29 10:26:08 +01:00
Polluks
c663f64542 Added features; changed FFF0 segments 2020-11-28 20:56:12 +01:00
Polluks
a538188d90 Fixed some config mistakes 2020-11-28 20:56:12 +01:00
Polluks
9538ca29b2 Unified #1345 2020-11-28 20:56:12 +01:00
Greg King
a0d986faf8 Fixed the horizontal movement of the mouse pointer on platforms with the VIC-II display chip.
ca65's logical (Boolean) NOT operator was used where bitwise NOT should be used.  The effect was that all sprites were shifted to the left side of a screen when the mouse sprite was put on the left side.
2020-11-27 21:22:22 -05:00
Greg King
8b42f570e9 Fixed code that caused a seg-fault after parsing a (deferred) post-count argument followed by a (nested) function-call argument.
The old broken code defers the count until the end of the (parent function's) argument list.  But, a nested function call clears the pointer to the deferred type.  That leads to an access violation.
The new code defers only until the end of each argument.  Fixes #1320.
2020-11-20 17:45:14 -05:00
Oliver Schmidt
79bdc2d51f Set correct prerequisite.
See https://github.com/cc65/cc65/issues/1318
2020-11-20 19:19:55 +01:00
Oliver Schmidt
cffcbce60f Bumped version.
I placed the Git tag V2.19 in hindsight at 555282497c. But I certainly don't want to rewrite the Git history just for the reported version, so I simply set the reported version at today's HEAD to 2.19.
2020-11-20 19:11:20 +01:00
mrdudz
c11e389a94 move testcase for issue #1320 into test/misc 2020-11-20 17:25:10 +01:00
mrdudz
48710af55a make plasma sample work again despite issue #1348 2020-11-19 23:21:06 +01:00
mrdudz
0d46af2e9c Merge branch 'master' of https://github.com/cc65/cc65 2020-11-19 23:12:46 +01:00
mrdudz
23273584a0 testcase for issue #1348 2020-11-19 23:12:16 +01:00
Zsolt Branyiczky
032b4e3979 Fixed typo 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
63543dee07 Revert transient modification of EATab Table 0 comment 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
adad3d2e87 Revert "adding c64dtv device to the supported ones"
This reverts commit 1d9e378fe3.
2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
b2c55c3338 adding c64dtv device to the supported ones 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
36f5dcbb6e added 6502dtv opdoces testcases and corrected cpudetect 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
527500cedc instruction table contained wrong parameters at SIR opcode 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
0e98818db5 assembled SAC and SIR opcodes of 6502DTV cpu were wrong 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
1c5c07406c cpudetect.s needs this file to run its test for 6502dtv cpu 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
843b94388a added asm test for 6502DTV cpu 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
130d3b52a2 new macros supporting 6502DTV cpu 2020-11-19 22:02:07 +01:00
Zsolt Branyiczky
4205a04a34 6502DTV is not a superset of 6502X more 2020-11-19 22:02:07 +01:00
Polluks
c59e8277ae Added prototype 2020-11-18 10:28:19 +01:00
Polluks
a0596eae6e Added waitvsync for PET 2020-11-18 10:28:19 +01:00
Polluks
bd6e5927c4 Fixed #1341 2020-11-18 10:28:19 +01:00
Greg King
5ba16654a3 Refined the hints about making new test reference files. 2020-11-17 15:06:05 -05:00
Greg King
b0497f40b2 'test/isequal.c' doesn't change. Don't rebuild it for each test subdirectory. 2020-11-17 13:40:36 -05:00
Greg King
47bceb0eab Streamlined some makefiles.
foreach isn't needed because make automatically iterates through lists of words when substituting patterns.
2020-11-17 13:34:22 -05:00
Greg King
2ffb6af5d9 Simplified a bug test. Gave it an appropriate description, 2020-11-17 08:15:34 -05:00
Jesse Rosenstock
68cb15d0f9 Add test case for #1320
From https://github.com/cc65/cc65/issues/1320#issuecomment-726866015
2020-11-17 09:45:02 +01:00
Oliver Schmidt
0cd8d37613
Fixed comment. 2020-11-17 08:53:48 +01:00
Oliver Schmidt
69c0363c7e Fixed CPU bitmask constants to match the CPU instruction set bitmasks computed in src/common/cpu.h. 2020-11-16 18:50:15 +01:00
Oliver Schmidt
116682c190 Avoid C99 idioms. 2020-11-16 18:08:00 +01:00
Jesse Rosenstock
c2c73e7d06 Move #1332 test from todo/ to val/
This bug was fixed by 2915464.
2020-11-16 03:23:52 -05:00
Jesse Rosenstock
060417b0dc Adjust type of int constants that fit in char
When there is an integral constant like `3` in an expression, it has
type `int` according to the C spec, even though it can be represented
as an `unsigned char`.  Change codegen (`hie_internal` and `typeadjust`)
to treat it as `unsigned char` instead of `int` so that faster,
unsigned operations can be used.

For the test case in #1298, reduces the cycles per iteration from
4311 to 1884.  This is a great improvement, but still much worse than
the 1053 cycles/iter from `c4698df~`, so more work remains to be done.

Further partial fix for #1298 and #1308.
2020-11-16 00:56:19 +01:00
Jesse Rosenstock
83ac2755fe Add test case for #1332 2020-11-15 21:32:45 +01:00
Greg King
2915464667 Fixed cc65's generation of char-type bit-shift code.
Fixed CHAR-to-INT type conversions in the right-shift code generator.  Also fixed some printf-style format specifiers.
2020-11-15 15:22:23 -05:00
Greg King
5f65252fa6 Added the cputdirect entry point to the cputc() functions in the two Oric libraries.
It now is available in all libraries that have cputc().
2020-11-15 11:44:12 -05:00
Zsolt Branyiczky
2d7777b604 Instruction table is synchronized with the c65's one 2020-11-15 16:35:55 +01:00
Zsolt Branyiczky
0f7cf87bfa Synchronizin InsTab6502DTV instructions table for DTV with the illegal opcodes verified by VICE-emu tests 2020-11-15 16:35:55 +01:00
Zsolt Branyiczky
dd44dc4d77 Fix typo 2020-11-15 16:35:55 +01:00
Zsolt Branyiczky
06dfef81a1 Added 6502dtv description to cpu option 2020-11-15 16:35:55 +01:00
Zsolt Branyiczky
92c013944e Mistyped comment, missing comma 2020-11-15 16:35:55 +01:00
Zsolt Branyiczky
b33b053307 add c64dtv support 2020-11-15 16:35:55 +01:00
Christian Groessler
77da8d5490 vic20.cfg: add missing comma 2020-11-11 17:20:25 +01:00
Sven Michael Klose
53f055fb1d Reduce stack size to 256B for unexpanded VICs. 2020-11-11 12:42:35 +01:00
Jesse Rosenstock
93145246fd Add tests for u8 op s16_const
Test expressions like `unsigned char x = ...; ... = x / 2;`
These use `int` constants with values representable by
`unsigned int` / `unsigned char`, so using unsigned codegen should
be possible.

Additional tests for #1308.  These are things we want to generate better
code for, so add tests that the behavior doesn't change.
2020-11-09 21:20:16 +01:00
Jesse Rosenstock
5db74b4b19 Use u16 codegen for u8 x u8 ops
In g_typeadjust, before we apply the integral promotions, we check if
both types are unsigned char.  If so, we promote to unsigned int, rather
than int, which would be chosen by the standard rules.  This is only a
performance optimization and does not affect correctness, as the flags
returned by g_typeadjust are only used for code generation, and not to
determine types of other expressions containing this one.  All unsigned
char bit-patterns are valid as both int and unsigned int and represent
the same value, so either signed or unsigned int operations can be used.
This special case part is not duplicated by ArithmeticConvert.

Partial fix for #1308.
2020-11-09 21:19:22 +01:00
Greg King
81edc3f582 Updated a comment about Kernal's STATUS variable. 2020-11-08 17:45:54 -05:00
Jesse Rosenstock
b5f0c0468d Add stdint.h types for C89 compilers
Add `intN_t` and `uintN_t` for N = 8, 16, 32.
2020-11-03 21:24:52 +01:00
Jesse Rosenstock
65193c6aaf Add stdint.h constants INT32_MIN and UINT32_MAX
These were missing before
2020-11-03 09:26:26 +01:00
Jesse Rosenstock
0e482c7f92 Add test for issue #1310 2020-11-01 19:09:20 +01:00
Christian Groessler
39c0abed54 atarixl: fix compilation problem when CHARGEN_RELOC is defined 2020-10-30 15:01:47 +01:00
Greg King
aad17a6f05 Made two GEOS directory functions return NULL if they can't give a valid entry. 2020-10-29 18:06:01 -04:00
Oliver Schmidt
d8e6fa61bb Return NULL on error (or end of directory). 2020-10-29 17:44:19 +01:00
Christian Groessler
944ebbc23c atarixl configs: make size of CHARGEN configurable
If text mode is not used, its space can be reclaimed by setting __CHARGENSIZE__
to 0.
Following a suggestion from issue #1314.
2020-10-29 17:43:49 +01:00
Jesse Rosenstock
a686988d0e Add test cases for integral promotion of chars
Both signed and unsigned chars are promoted to int by C's evaluation
rules.  It is more efficient to use unsigned operations when possible,
however.  These tests will help test the correctness of optimizations
doing that.  See #1308.
2020-10-29 13:54:37 +01:00
Christian Groessler
262631039d atari.h, atari5200.h: style fixes 2020-10-28 21:12:32 +01:00
Christian Groessler
3537210674 add waitvsync() for atari and atari5200 2020-10-28 21:12:32 +01:00
Oliver Schmidt
79cf1e13a7
Adjusted to recent change in time.h 2020-10-25 21:33:08 +01:00
Oliver Schmidt
f723147f04 Streamlined clock rate handling.
* Docs say that CLK_TCK is an obsolete alias of CLOCKS_PER_SEC so there's no point in individual definitions.
* All targets determining the clock rate at runtime can use a common handling.
2020-10-25 14:06:44 +01:00
acqn
07cc6a3d20 Made optimization steps aware of long branches better. 2020-10-24 21:25:24 +02:00
Oliver Schmidt
2fcd8b934a Made HGR segment obligatory.
Requiring the HGR segment makes the configs a little less flexible, but for the intended use case the HGR segment actually is necessary. And as we learned now, making the HGR segment obligatory helps users to not shoot themselves in the foot.
2020-10-24 13:57:35 +02:00
jede
b8889bf37e Now getchar works 2020-10-23 23:47:30 +02:00
Oliver Schmidt
8e685a0071
Mention recursion. 2020-10-23 18:35:14 +02:00
Oliver Schmidt
947dd9aca0
Adjusted ChkDkGEOS. 2020-10-22 08:54:07 +02:00
acqn
5c43d1e04f Changed codegen for postfix inc/dec operations by deferring them till sequence points.
This usually allows faster & smaller code.
Note that deferred operations must still be called at sequence points even if the whole expressions containing them had constant values.
2020-10-20 22:01:55 +02:00
acqn
bb7b69f513 Added OptShiftBack for shifting the C flag into register A and back. 2020-10-20 21:55:39 +02:00
acqn
0354322413 Added OptSignExtened for testing signness right after sign extention. 2020-10-20 21:55:39 +02:00
acqn
9c776a24e5 Use bcc instead of bne in OptNegAX2 to ease optimizations. 2020-10-20 21:55:39 +02:00
acqn
4f3a96a535 Added new opt OptPushPop2.
Also renamed OptPushPop to OptPushPop1.
2020-10-20 21:55:39 +02:00
Greg King
0f66f7569e Updated the cx16 library to the upstream project's prerelease 38. 2020-10-17 14:48:01 -04:00
mrdudz
77bfd163cd makefile cleanup 2020-10-16 15:50:18 +02:00
Greg King
a25b28a972 Added files to the pet library that support the overlay demo sample program.
cbm_load() is needed because the Pet/CBM Kernals don't have a LOAD function that can be used by machine code programs.
2020-10-15 21:22:04 -04:00
Greg King
e682f7c8c3 Protect the C stack from overlays on the c64 target. 2020-10-15 14:00:25 -04:00
mrdudz
b773bb9ded some more $(RM) vs $(DEL) fixing 2020-10-15 19:34:40 +02:00
mrdudz
6920b8be78 $(RM) abc -> @$(DEL) abc 2>$(NULLDEV) 2020-10-15 18:53:56 +02:00
mrdudz
a0dc7cd9e4 fix grc example, fix makefiles to compile grc example correctly 2020-10-15 18:41:17 +02:00
mrdudz
f60af0301a fix non working Makefiles 2020-10-15 18:35:54 +02:00
Oliver Schmidt
095de4ea52 Write o65 files as SEQ files. 2020-10-15 12:54:01 +02:00
Greg King
e72e44d14f Shortenned the VIC-20's cputc() by 17 bytes.
Changed to a modified table look-up method to convert PetSCII to screen-codes.
2020-10-13 07:55:20 -04:00
Greg King
4905329ff6 Fixed the misspelling of "height" in a GEOS header. 2020-10-12 08:33:45 -04:00
acqn
262c4235df Symbols in ZP segments will use '.exportzp' instead of '.export' if exported. 2020-10-11 23:05:20 +02:00
acqn
e58c84acf7 Support for optionally specifying address size for segments with:
#pragma ***-name([push,] "name"[, "addrsize"])
where "addrsize" is any addressing size supported in ca65.
2020-10-11 23:05:20 +02:00
acqn
f8c9dde989 The instruction parser can now recognize ZP locations and set the addressing mode for them. 2020-10-11 23:05:20 +02:00
Jesse Rosenstock
81550ca1ee CS_MergeLabels: Keep labels referenced by data
Partial fix for ICE in #1211.  This may fix enough to allow #1049 to be
fixed.

When merging labels, keep the first label with a ref that has no JumpTo;
this is a data segment label, used by computed gotos.

The real fix is to track and rewrite labels in data, but this is more
involved.
2020-10-08 12:11:03 +02:00
mrdudz
037a806036 also rename README to readme.txt in the Makefile :) 2020-10-04 17:20:40 +02:00
acqn
dbba5f3fc9 Fixed handling of %v in inline asm parser. 2020-10-04 12:25:24 +02:00
acqn
a85d5330fa Fixed StrBuf initialization in PreparseArg(). 2020-10-04 12:17:14 +02:00
Oliver Schmidt
fd208fdf0b - Added support for calling subdir Makefiles for the make targets 'samples' and 'clean'.
- Adjusted the 'tutorial' Makefile to actually work as expected.

Note: The 'disasm' and 'geos' Makefiles don't seem to work so they are not called as of now.
2020-10-03 19:35:23 +02:00
Jesse Rosenstock
b931e65811 Fix ICE for bit-fields with typedef
Fixes #1267

Avoid ICE, but treat plain int bit-fields declared via typedef as
signed rather than unsigned.  It is more efficient to treat them
as unsigned, but this requires distinguishing int from signed int,
and this is curently not done.
2020-10-03 15:04:31 +02:00
Oliver Schmidt
4acdc9ced9 Fixed paramcount build. 2020-10-03 14:55:30 +02:00
Greg King
c05a750f47 Fixed some copy-&-paste typo mistakes about HuC6280's TMA mnemonic. 2020-10-01 07:25:08 -04:00
mrdudz
4777e98f57 rename testcode/ to targettest/ 2020-09-29 19:14:46 +02:00
mrdudz
dcee493e94 move remaining stuff from testcode/lib/ one level up to testcode/ 2020-09-29 19:12:34 +02:00
mrdudz
3d8e787e66 move testcode/grc to samples/geos 2020-09-29 19:08:40 +02:00
mrdudz
bbece736f5 move testcode/disasm into samples/ instead 2020-09-29 19:06:05 +02:00
mrdudz
b549e83fb2 move program from testcode/assembler to test/asm and remove testcode/assembler 2020-09-29 19:03:42 +02:00
mrdudz
eb87c6d373 rename README to readme.txt 2020-09-29 18:54:30 +02:00
acqn
b525554bfe Added support for parsing asm byte size expressions with a pair of parentheses. 2020-09-27 12:22:05 +02:00
acqn
688342e194 Now every code entry has its argument parsed to tell some info.
It fixes the compiling performance regression as well.
Built-in ZPs are recognized.
2020-09-27 12:22:05 +02:00
acqn
cc0f8422f2 More fixes and new utils to check if opcode arguments can be used elsewhere.
Fixed tracking with LI_RELOAD_Y and LI_DIRECT.
Fixed tracking with LI_CHECK_Y and LI_RELOAD_Y.
2020-09-27 12:22:05 +02:00
acqn
f3771a465d Fixed various issues in the usage-tracking code.
Added some utility functions.
2020-09-27 12:22:05 +02:00
acqn
d379affc4b Moved some reusable code from cc65/coptstop.c into new files. 2020-09-27 12:22:05 +02:00
acqn
28c7aa2bc8 Replaced direct CEF_NUMARG flag checks on code entries with CE_HasNumArg(). 2020-09-27 12:22:05 +02:00
acqn
c45a6b3685 Utility function ParseOpcArgStr(). 2020-09-27 12:22:05 +02:00
Jesse Rosenstock
d0089aef95 Fix bit-field truncation warning message
Fix copy & paste bug with warning message.

struct X {
      signed int a : 3;
};
struct X g = { 5 };

Before:
s.c(4): Warning: Implicit truncation from 'int' to 'int : 3' in bit-field
initializer changes value from 5 to 5

After:
s.c(4): Warning: Implicit truncation from 'int' to 'int : 3' in bit-field
initializer changes value from 5 to -3

Fixes #1268
2020-09-26 17:41:45 -04:00
mrdudz
34177d9edd test related to issue #1094 2020-09-25 20:08:32 +02:00
mrdudz
7ff08c85cf Merge branch 'master' of https://github.com/cc65/cc65 2020-09-25 16:25:53 +02:00
mrdudz
61d934fd7b test related to issue #1265 2020-09-25 16:25:32 +02:00
Greg King
47ee179273 Fixed a copy & paste error in the test/misc/ makefile.
Fixed a warning that's changed to an error in Travis CI tests.
2020-09-25 00:31:07 -04:00
Fabrizio Caruso
61ebe2c34b Indentation in vga.s for gamate 2020-09-24 19:42:34 +02:00
Fabrizio Caruso
6fdb356db7 Simplify Gamate tile redefinition (as already done for PCE) 2020-09-24 19:42:34 +02:00
mrdudz
5ba9d28488 test related to pr #1189 2020-09-24 16:16:16 +02:00
mrdudz
97a1093ee0 test related to issue #1222 2020-09-24 12:23:18 +02:00
mrdudz
fb8b45e479 added note on how to manage the sample programs 2020-09-24 00:18:28 +02:00
mrdudz
a86644eff1 test related to issue #1221 2020-09-24 00:08:36 +02:00
mrdudz
b3491e3d9a test related to issue #1244 2020-09-23 23:57:36 +02:00
mrdudz
46ebb15c76 test related to issue #1245 2020-09-23 23:57:25 +02:00
mrdudz
6fdd90fa63 fix typo 2020-09-23 23:51:37 +02:00
mrdudz
99121688f8 added test related to issue #1263 2020-09-23 23:51:24 +02:00
Greg King
81ac28ff71 Used TAY/TYA instead of PHA/PLA when extracting a bit-field.
Without optimization, it saves a few CPU cycles.  With optimization, it saves more cycles and a few bytes.
2020-09-22 12:47:09 -04:00
Greg King
ea95728330 Avoided an avalanche of messages from bad bit-field declarations.
Made cc65 replace a bad bit-field type with a good one, and always parse the field width.

Shortenned a parameter name to a spelling that's consistent with other function headers.
2020-09-22 12:47:09 -04:00
Greg King
07ea5259ac Changed a cc65 error message to say that the sizes of bit-field types (not bit-fields) are limited. 2020-09-22 12:47:08 -04:00
Greg King
d906204e84 Allowed UPDCRAMPTR to be exported as a constuctor in the VIC-20 library. 2020-09-22 12:31:27 -04:00
Greg King
dc14751954 Exported the direct Kernal entries that were moved from target headers to "cbm_kernal.inc". 2020-09-22 00:04:24 -04:00
Greg King
41bd8d909b Added ld65's bank attribute to the cx16 library's bank (overlay) configuration file.
That attribute makes it easier for Assembly code to know which bank holds a label.
2020-09-20 19:55:25 -04:00
Greg King
0b64ca0d7d Fixed the ld65 cx16 Assembly configuration file.
The CODE segment immediately follows the EXEHDR segment.  Added a segment for the zero-page area that's free when the BASIC ROM isn't used.
2020-09-20 16:09:58 -04:00
Greg King
bf4b195016 Added some comments that explain where the g_branch() code generator can and can't be used. 2020-09-18 15:50:26 -04:00
acqn
de630a1245 Fixed quick hack for known registers after calling certain runtime functions,
and new quick hack for tosshrax.
2020-09-18 09:04:15 +02:00
acqn
079f4a99dd Added processor state info to the OPCDesc table. However, since some opcodes are affected by the addressing mode, this info is unused in codegen/optimizer but just as quick in-code documentation/hints. 2020-09-18 09:04:15 +02:00
acqn
a7d6eb9190 Added processor flag usage/change-tracking for non-JSR/RTS code entries.
Some existing optimizations are impacted and need fixes in order to work correctly again.
Fixed and improved OptPrecalc. Now it respects the C/V/Z/N flags.
Fixed optimizations impacted by added support of tracking processor flags.
2020-09-18 09:04:15 +02:00
acqn
d02b12fa6c Made local code/data labels really local to the functions where they live in. 2020-09-18 09:02:16 +02:00
acqn
86ced2bd4c Avoided unnecessarily boosting the code label numbers with boolean AND. 2020-09-18 08:59:56 +02:00
Jesse Rosenstock
0482e4d6e4 Fix CRLFs introduced by fe3f267 2020-09-18 08:57:28 +02:00
acqn
b8ae5c28fe Added debug output support for processor flags. 2020-09-13 13:50:35 +02:00
acqn
810e17edfe Fixed processor states tracking for the BIT/TRB/TSB opcode.
Added new opcode descriptions about whether and how the opcode accesses memory.
2020-09-13 13:50:35 +02:00
acqn
66c5faeb9a Added processor flags usage tracking.
Added ZNRegs for tracking what register(s) Z/N flags currently reflect.
Added utility functions to check if the specified processor state is known to be a certain value.
2020-09-13 13:50:35 +02:00
acqn
fe3f267233 Added new runtime sub bcasta/bcastax/bcasteax opposing to bnega/bnegax/bnegeax. 2020-09-11 13:33:54 +02:00
acqn
142b0bf9b3 Added utility functions to get names of comparison function/transformer subroutines. 2020-09-11 13:33:54 +02:00
Greg King
ae6696fcb9 Removed some ambiguity from a statement.
A limited number of bit-field types are required by the C standard, not by cc65.
2020-09-08 10:55:07 -04:00
acqn
ab7e9f8424 Hotfix for Issue #1250. 2020-09-08 16:28:21 +02:00
Jesse Rosenstock
4e4e4c2d21 Allow char bit-fields
These are not required to be supported (only int, signed int, and
unsigned int are required), but most compilers support it.

https://port70.net/~nsz/c/c89/c89-draft.html#3.5.2.1
https://port70.net/~nsz/c/c89/c89-draft.html#A.6.5.8

For consistency with other integral types, plain `char` bit-fields
are unsigned, regardless of the `--signed-chars` option.

Fixes #1047
2020-09-08 14:24:04 +02:00
acqn
41cee0eb44 Extended support for more addressing modes in tos* optimizations. 2020-09-08 14:19:48 +02:00
acqn
7553b60ef0 Improved OptStackOps for optimizating further when operands have equal hi-bytes. 2020-09-08 14:19:48 +02:00
acqn
57117fa687 Utility functions about compare conditions. 2020-09-08 14:19:48 +02:00
acqn
64ef562fa7 Moved all optimization steps from codeopt.c and some optimization steps from coptind.c into new separate files. 2020-09-08 14:18:22 +02:00
Jesse Rosenstock
9a0e4a35e1 Fix enum bit-field ICE #1244
This previously resulted in an ICE:
cc65: Check failed: (Entry->Type->C & T_MASK_SIGN) == T_SIGN_SIGNED,
file 'cc65/symtab.c', line 874

This CHECK is in the code that deals with changing `int` bitfields to
`unsigned int`.

Work around this by treating enum bit-fields as having their signedness
specified, so this type change code does not get called.

Fixes #1244.
2020-09-07 11:21:23 +02:00
Tevo
1e7a9e44af Update comment to reflect addition of integer boundary constants 2020-09-06 23:32:00 +02:00
Tevo
23a8b2c303 Define integer size macros for lacking systems
Define integer size macros for lacking systems
2020-09-06 23:32:00 +02:00
acqn
6bb2d1d5d1 Fixed a comment on struct/union types in DoCompare(). 2020-09-06 22:47:11 +02:00
acqn
1cde952cf5 Fixed comparing an enum type with a non-enum type in DoCompare(). 2020-09-06 22:47:11 +02:00
acqn
6e0fb630d7 Fixed check for processor flags usage in case of PHP. 2020-09-06 13:32:38 +02:00
acqn
e2f950b15e Avoided referencing string literals with sizeof so that they are not output if unused elsewhere. 2020-09-05 13:21:21 +02:00
acqn
903e84c24c Std-functions are no longer inlined if they are unevaluated. 2020-09-05 13:21:21 +02:00
acqn
df07e23f2c Fixed bnegeax funcinfo on register usage. 2020-09-05 02:25:56 -04:00
acqn
f849de6769 Object addresses as non-NULL for comparison with NULL. 2020-09-04 19:50:32 +02:00
acqn
8e0b2f0833 Object addresses as non-NULL in boolean context. 2020-09-04 19:50:32 +02:00
acqn
bc5570b708 Fixed logical-NOT in constant context. 2020-09-04 19:50:32 +02:00
Jesse Rosenstock
44b719d957 Change line endings from CRLF to LF
test/ref/pr1220.c was somehow added with CRLFs.
Other files use just LF.
2020-09-04 14:01:21 +02:00
acqn
676b14429d Better opt chance for certain optimization steps e.g. OptPtrStore1 etc. 2020-09-04 12:00:10 +02:00
acqn
29d1999947 Rearranged the OptFunc's in alphabetic order. 2020-09-04 12:00:10 +02:00
acqn
761d00b7dc Ignore running removed old optimization steps. Neither list them in help info. 2020-09-04 12:00:10 +02:00
acqn
ae340703f2 OptDupLoads shouldn't silently do optimizations. 2020-09-04 11:58:25 +02:00
acqn
f45d2515eb Fixed OptPush1 in case later code would rely on that pushax zeroes register Y. 2020-09-04 11:58:25 +02:00
acqn
2a3d996077 Improved test case for PR #1220. 2020-09-02 21:36:59 +02:00
acqn
fb6bc275bc Fixed evaluation flags propagation to subexpressions in assignments and function calls. 2020-09-02 21:36:59 +02:00
acqn
2379504449 Fixed AND/OR in certain cases where the 'E_NEED_TEST' flag set for usage only in subexpressions should be cleared. 2020-09-02 21:36:59 +02:00
acqn
28de3423eb Merged some switch cases in code generation subroutines. 2020-08-31 09:12:03 +02:00
acqn
6b64b43395 Made local static data use a separated label pool from the code label pool. 2020-08-31 09:12:03 +02:00
acqn
9398e1cd33 Use a dedicated label pool for literals. 2020-08-31 09:12:03 +02:00
Oliver Schmidt
bee559d5f4
Merge pull request #1220 from acqn/StaticConst
[cc65] Fixed constant boolean expressions
2020-08-31 08:59:25 +02:00
acqn
74def4608a The 'E_NEED_TEST' flag shouldn't be overwritten when loading the expression result. 2020-08-31 02:30:12 +08:00
acqn
c0a873e0c8 Reduced exess errors on wrong initializations with curly braces. 2020-08-30 17:35:48 +02:00
acqn
8b580e1191 Disabled struct/union fields of 'void' type. 2020-08-30 17:33:36 +02:00
acqn
f1161daee9 Recursively checking for incomplete/unknown-sized types. 2020-08-30 17:33:36 +02:00
acqn
8541f18340 Improved diagnostic info on assignment to void types. 2020-08-30 17:33:36 +02:00
acqn
abcc2a8f1a Disallowed void arrays of elements of variant sizes. 2020-08-30 17:33:36 +02:00
acqn
d87846e1e1 Improved comments according to PR reviews. 2020-08-30 22:12:30 +08:00
acqn
60c59f59a3 Renamed StaticConstExpr() and StaticConstAbsIntExpr() with clearer comments. 2020-08-30 00:26:52 +08:00
acqn
492ee7fc45 Improved test/ref/pr1220.c. 2020-08-30 03:10:24 +08:00
acqn
df755df44d Warning about ESU types declared inside parameter list as they are invisble outside. 2020-08-29 16:37:16 +02:00
acqn
33a75e0a73 Optimized parameter list checking.
Fixed function type comparison between ANSI and K&R styles.
2020-08-29 16:37:16 +02:00
acqn
0a96ffc878 Fixed function parameter checking.
Fixed function return type checking.
2020-08-29 16:37:16 +02:00
acqn
4e61ae5b36 Fixed function parameter type conversion. 2020-08-29 16:37:16 +02:00
acqn
632da3f4ee Fixed tracking and checking flexible array members. 2020-08-29 16:35:42 +02:00
IrgendwerA8
f54e01781b Tiny optimizations for multiplication. 2020-08-29 16:34:20 +02:00
mrdudz
5158ee2092 preliminary makefile to build all programs in the testcode directory 2020-08-27 14:50:00 +02:00
mrdudz
5e2d2a54f6 added makefile for the GEOS samples. geosconio.c and rmvprot.c do not compile right now, someone with more GEOS knowledge should look at them 2020-08-27 14:25:33 +02:00
mrdudz
4008ab556c added a Makefile 2020-08-27 01:34:18 +02:00
mrdudz
f34644186f build a bogus "ROM image" that can be disassembled, fix the makefile, remove generated files 2020-08-27 01:19:33 +02:00
acqn
504aee3835
Merge branch 'master' into StaticConst 2020-08-27 06:27:23 +08:00
mrdudz
7a453d1f90 add a "disk" target to build the disk images as suggested by Oliver 2020-08-27 00:08:22 +02:00
mrdudz
41dbd31b02 fix makefile, remove the unneeded .cfg again. oops :) 2020-08-27 00:04:34 +02:00
mrdudz
c1a514c0f8 added test related to issue #1201 2020-08-26 23:20:28 +02:00
mrdudz
39a3de3119 made geoslib testcode compile again, added the required linker config and a Makefile 2020-08-26 22:47:47 +02:00
mrdudz
bf5384a712 some more refactoring of Makefiles, preparing for CI 2020-08-26 22:46:45 +02:00
acqn
bb9c203222 Fixed integer promotion of unary operations. 2020-08-26 22:17:16 +02:00
acqn
8d225c32b1 Fixed checks on assignment to incomplete types. 2020-08-26 22:14:51 +02:00
acqn
43cb092a68 Fixed CHECK failures on certain usage of incomplete enums. 2020-08-26 22:14:51 +02:00
acqn
1957dc7a5c Disallowed arrays of incomplete types.
Fixed diagnostics on incomplete local arrays.
2020-08-26 22:14:51 +02:00
acqn
f5b1b69376 Forbid struct/union fields of incomplete types. 2020-08-26 22:14:51 +02:00
mrdudz
bee11ec11b Merge branch 'master' of https://github.com/cc65/cc65 2020-08-26 21:28:32 +02:00
mrdudz
8649859bc5 added/updated Makefiles, preparing for CI (later) 2020-08-26 21:28:19 +02:00
Oliver Schmidt
b0d3b19a6a The bug1209 test fails at link stage. 2020-08-26 21:01:02 +02:00
mrdudz
ad1579140b Merge branch 'master' of https://github.com/cc65/cc65 2020-08-26 20:54:13 +02:00
mrdudz
c6adf4364f make atari testcode compile again, added makefile 2020-08-26 20:53:45 +02:00
Oliver Schmidt
c658acbf85 Avoid cl65 in tests.
cl65 creates intermediate files based on the source file name in the source file directory. Calling cl65 in parallel with the same source file causes those intermediate files to get overwritten.

Fixes #1080
2020-08-26 20:39:34 +02:00
mrdudz
4c912a0fbe make gamate testcode compile again 2020-08-26 15:59:52 +02:00
mrdudz
83cc115112 re-add define for pad bits hw address, which was accidently removed in some refactor commit 2020-08-26 15:51:20 +02:00
mrdudz
e5a1755133 added some ifdefs to make testcode compile for apple2 and atari targets 2020-08-26 15:08:17 +02:00
mrdudz
d21fbed1bb Merge branch 'master' of https://github.com/cc65/cc65 2020-08-26 13:37:07 +02:00
mrdudz
c216b3534b fix compilation, fixes issue #1184 2020-08-26 13:36:43 +02:00
Bob Andrews
4cd19711f2
Merge pull request #1219 from acqn/Test
Bug #1113 was fixed "long" ago
2020-08-26 11:09:11 +02:00
acqn
b6a4715a38 Added test/ref/pr1220 for testing constant AND/OR code generation. 2020-08-26 08:45:01 +08:00
acqn
d68925c6a8 Bug #1113 was fixed long ago. 2020-08-25 22:34:25 +08:00
Jesse Rosenstock
344aea0669 Add additional test cases for #1209
These test cases don't use dynamic labels.
https://github.com/cc65/cc65/issues/1209#issuecomment-678738971

Also update the original test case for consistency:
* Change failure message to just "FAIL", as there is only one failure
* Outdent label definitions
* Clarify description
2020-08-24 19:15:06 +02:00
Jesse Rosenstock
d38e5858f0 Add tests for #1211
CL_MoveRefs: Add CHECK (E->JumpTo != NULL) to make failure clearer.
2020-08-24 18:10:22 +02:00
Jesse Rosenstock
4b7cd491e3 Move #1209 test from err/ to misc/
misc/ is the correct place for tests that should compile
but do not.

Revert err/Makefile changes from #1210.
2020-08-24 18:07:31 +02:00
acqn
c3a6b39945 Made struct assignment less hackish. 2020-08-24 18:02:29 +02:00
acqn
d1995fc81a Fixed rvalue-ness of cast results. 2020-08-24 17:16:37 +02:00
acqn
63fa9a5a42 Fixed usage of "lvalue-cast" in _scanf implementation. 2020-08-24 17:16:37 +02:00
acqn
911a79796d Fixed checks and diagnostics on type-casting. 2020-08-24 17:16:37 +02:00
Jesse Rosenstock
23621f3299 Add test case for #1209
Change err/ tests to use cl65 and .prg instead of cc65 and .s
since this test only fails at the link stage.
2020-08-22 15:27:49 +02:00
acqn
0486d28abc Fixed Issue #327. 2020-08-22 13:44:18 +02:00
acqn
f289ea6c14 Avoided generating unnecessary true-case labels in logic AND/OR. 2020-08-22 11:10:17 +08:00
acqn
0536f4f9bd Minor fixes on constant expression checking and comments. 2020-08-21 23:27:41 +02:00
acqn
63256fd15d Changed negation of signed long stored in unsigned long to unsigned subtraction. 2020-08-21 23:16:17 +02:00
acqn
f59c2a08d9 Added support for changing multiplications with certain negative multipliers into bit-shifts. Only enable certain kinds of signed mul replacements with shift according to the code size factor settings. 2020-08-21 23:16:17 +02:00
acqn
ea7336591c Removed special-casing code for scaling up. Now it uses the normal multiplying code. 2020-08-21 23:16:17 +02:00
Greg King
75dc234988 Guarded the static_assert macro with a C standards test. 2020-08-21 15:15:19 -04:00
acqn
85ea06687b Fixed logical AND and logical OR. 2020-08-20 07:52:15 +08:00
acqn
725511131a Fixed constant expression checks with no-code requirement.
Used return-by-value initialization for ExprDesc.
2020-08-20 07:52:11 +08:00
acqn
1abb9da2b2 Moved bug250.c to test/val as it is fixed. 2020-08-26 09:40:32 +08:00
acqn
3ea3887c77 Fixed warnings on const comparison.
Warnings on expressions with no effects.
Fixed const ternary.
Fixed ternary with struct/union types as the true/false-branch expressions.
2020-08-20 07:52:06 +08:00
acqn
b15ab348ba Moved bug250.c from test/misc as it is to be fixed. 2020-08-26 08:23:05 +08:00
acqn
17bbba7327 Added integer boolean type string.
No longer set the "expression tested" flag with constant results in comparison.
2020-08-20 07:52:03 +08:00
mrdudz
794adcc512 remove unneeded rule 2020-08-19 22:33:10 +02:00
mrdudz
e6b8f4d715 move/fix bug264.c as suggested in issue #1122 2020-08-19 22:25:18 +02:00
mrdudz
1a92368aed rename bdiff.c to isequal.c, make it handle different line-endings as equal 2020-08-19 14:50:12 +02:00
Jesse Rosenstock
85e8a6cb9f Clarify docs that bss is zero-initialized
Addresses comment raised in #1202.
2020-08-19 13:24:15 +02:00
acqn
9fcde120aa Made function signatures in asm output use the parameter lists from original definitions instead of the composites. 2020-08-19 08:40:19 +02:00
Greg King
36dd82f0e6 Added g_branch() to cc65's code generator.
It uses BRA if the platform's CPU has BRA.  Else, it generates a JMP.

(Used it in the bitfield sign-extending code.)
2020-08-18 19:11:18 -04:00
mrdudz
0690a12ad2 change "the cc65 authors" to "The cc65 Authors" as per jmrs request 2020-08-18 22:41:42 +02:00
mrdudz
0c22d5011e added test related to pr #1190 2020-08-18 17:58:29 +02:00
mrdudz
ab89c168de replace "Copyright 2020 Google LLC" by "Copyright 2020 the cc65 authors" 2020-08-18 17:47:35 +02:00
Jesse Rosenstock
ff535b8e1a Treat signed int bit-fields as signed
Prior to this PR, `int`, `signed int`, and `unsigned int`
bitfields are all treated as `unsigned int`.

With this PR, `signed int` will be treated as `signed int`,
and the others remain unsigned.

Since `Type` does not distinguish between `int` and `signed int`,
add an extra `int* SignenessSpecified` param to `ParseTypeSpec`
so we can tell these apart for bit-fields and treat plain `int : N`
as `unsigned int : N` since it is more efficient to zero-extend
than sign-extend.

Fixes #1095
2020-08-18 12:23:20 +02:00
Jesse Rosenstock
55cebc7b9e Move bit-field adjustment to codegen.c
Extract functions g_testbitfield and g_extractbitfield from LoadExpr.

This helps prepare for #1192, since g_extractbitfield will get much
longer and call AddCodeLine.
2020-08-18 10:55:31 +02:00
acqn
56b659c0be Made char type a distinct type. 2020-08-18 10:48:38 +02:00
acqn
87889df9e9 Fixed type checking in relation operations. 2020-08-18 09:39:43 +02:00
mrdudz
2663561c62 added test related to pr #1135 2020-08-18 00:41:35 +02:00
mrdudz
6d8860b9de added test related to issue #1145 2020-08-18 00:41:07 +02:00
mrdudz
cf41fccc0a added test related to issue #1143 2020-08-18 00:40:29 +02:00
acqn
f206833a20 Alternative fix for Issue #1167. 2020-08-17 20:31:02 +02:00
acqn
0afa1a9a95 Fixed function signatures in asm output.
Improved full type name production.
2020-08-17 20:30:32 +02:00
acqn
ebae994dc9 Fixed CHECK failure when calling functions defined with repeated parameter names.
Clarified the terms "parameter" vs "argument" in FunctionParamList().
2020-08-17 20:27:57 +02:00
Bob Andrews
531de44c95
Merge pull request #1193 from jmr/bitfield-union-bug
Add test of union of bit-field from mailing list
2020-08-17 14:33:51 +02:00
Jesse Rosenstock
6db93d58cf Add test of union of bit-field from mailing list
36152700/

This currently works, but add a test to prevent future regressions.
2020-08-17 09:54:31 +02:00
acqn
15f28c3a8c Fixed getting the basic raw type names. 2020-08-17 00:00:03 +02:00
acqn
11cd3e5cbd Utility for checking general datatype categories, incomplete ESU types and arrays of unknown sizes. 2020-08-17 00:00:03 +02:00
Jesse Rosenstock
7e61b11f23 Add _Static_assert docs to cc65 extensions
Fixes #1149.
2020-08-16 21:57:04 +02:00
Jesse Rosenstock
1cf9404c19 Support C2X _Static_assert(expr) syntax
This makes the message in _Static_assert(expr, message) optional.

Fixes #1188.
2020-08-16 11:38:20 +02:00
Jesse Rosenstock
c4698dfd07 Use C89 semantics for integer conversions
Previously, the following rules were used for binary operators:
* If one of the values is a long, the result is long.
* If one of the values is unsigned, the result is also unsigned.
* Otherwise the result is an int.

C89 specifies the "usual arithmetic conversions" as:
* The integral promotions are performed on both operands.
* Then the following rules are applied:
  * If either operand has type unsigned long int, the other operand is
    converted to unsigned long int.
  * Otherwise, if one operand has type long int and the other has type
    unsigned int, if a long int can represent all values of an unsigned int,
    the operand of type unsigned int is converted to long int; if a long int
    cannot represent all the values of an unsigned int, both operands are
    converted to unsigned long int.
  * Otherwise, if either operand has type long int, the other operand is
    converted to long int.
  * Otherwise, if either operand has type unsigned int, the other operand is
    converted to unsigned int.
  * Otherwise, both operands have type int.
https://port70.net/~nsz/c/c89/c89-draft.html#3.2.1.5

As one example, these rules give a different result for an operator
with one long operand and one unsigned int operand.  Previously,
the result type was unsigned long.  With C89 semantics, it is just long,
since long can represent all unsigned ints.

Integral promotions convert types shorter than int to int (or unsigned int).
Both char and unsigned char are promoted to int since int can represent
all unsigned chars.
https://port70.net/~nsz/c/c89/c89-draft.html#3.2.1.1

Rename promoteint to ArithmeticConvert, since this is more accurate.

Fixes #170
2020-08-15 19:14:31 +02:00
acqn
fdded33097 Made it easier to support 0-size structs in the future. 2020-08-15 06:27:11 +08:00
mrdudz
8197e3c7cd make it actually compile again :) 2020-08-14 21:07:39 +02:00
mrdudz
f0e4053a0d added test related to issue #1178 2020-08-14 19:58:58 +02:00
acqn
1d28e8e3de Improved test case for Issue #191. 2020-08-14 18:33:54 +02:00
acqn
b19bb14348 Fixed checking conflitcing declarations with external vs other linkage. 2020-08-14 18:33:54 +02:00
acqn
13ed557b92 Fixed compatibility checking of function declarations by using the composite types of them. 2020-08-14 18:33:54 +02:00
acqn
44d52935da Utility for getting the composite types of functions. 2020-08-14 18:33:54 +02:00
acqn
8a417ff039 Improved ESU declaration failure handling. 2020-08-14 18:15:31 +02:00
mrdudz
dc83eb15af added test related to issue #1181 2020-08-14 16:12:17 +02:00
Bob Andrews
83452ae6b3
Merge pull request #1182 from acqn/StructPtrField
[cc65] Fixed testing 'struct->field'
2020-08-14 14:13:39 +02:00
acqn
0dfe9ff5fe Fixed testing 'struct->field'. 2020-08-14 08:32:22 +08:00
acqn
0fa18886c0 Fixed copying structs/unions > 4 bytes. 2020-08-13 08:59:05 +02:00
acqn
03b37cf712 Fixed type comparisons of typedefs and arrays. 2020-08-12 15:04:26 +02:00
acqn
eb4464e828 Fixed type comparisons of ESU types with stricter rules. 2020-08-12 15:04:26 +02:00
acqn
8b8561161c Moved #1098 bug tests from test/misc to test/err as they are fixed now. 2020-08-12 15:02:43 +02:00
acqn
fe44fe963f Disallowed empty enums. 2020-08-12 15:02:43 +02:00
acqn
97065faf1a Disallowed struct/union types of 0 size as cc65 is not ready to support them. 2020-08-12 15:02:43 +02:00
acqn
4dfc1a5ded Using a dedicated SC_FICTITIOUS flag in case of parsing errors. 2020-08-12 15:01:31 +02:00
acqn
bde5be6793 Improved error message on initializing extern variables inside functions. 2020-08-12 15:01:31 +02:00
acqn
b62b1650f5 Improved error messages on struct/union type multiple definitions. 2020-08-12 15:01:31 +02:00
acqn
fe3f726fd6 Improved incomplete enum typed diagnostics. 2020-08-12 15:01:31 +02:00
acqn
0d53806490 Avoided excess errors in incomplete struct assignment. 2020-08-12 15:01:31 +02:00
acqn
9317db6642 Slightly improved type error messages of 'op='. 2020-08-12 15:01:31 +02:00
acqn
9fcfa3fc49 Fixed full type names of functions with "empty" parameter list. 2020-08-12 15:01:31 +02:00
acqn
68d63b089d Reduced error flood raised by misplaced variable declarations. 2020-08-12 15:01:31 +02:00
acqn
0f1a5e0520 Set enum tag definition flags. 2020-08-09 22:12:36 +02:00
acqn
1dd899c7c9 Fixed non-file-scope multiple definition checking. 2020-08-09 22:12:36 +02:00
acqn
d68cd90e47 Function declaration in functions cannot have storage classes other than 'extern'. 2020-08-07 10:16:33 +02:00
acqn
43efc256f1 Changed error/warning messages not using the term 'tentative' according to PR reviews. 2020-08-07 10:16:33 +02:00
acqn
b2d3b8379c Warning about forward declaration of enum types in non-cc65 modes. 2020-08-07 10:16:33 +02:00
acqn
8cdffc1944 No storage for unsuccessfully parsed variables. 2020-08-07 10:16:33 +02:00
acqn
fdef067629 Fixed tentative definition of variables of incomplete types that may be completed later.
Tenative arrays that never get completed are now assumed each to have one element.
2020-08-07 10:16:33 +02:00
acqn
fdd120db49 Enabled to output errors and warnings about tentative definitions. 2020-08-07 10:16:33 +02:00
acqn
f59d6b8f6a Redefining enums/structs/unions of 0 size is no longer treated as declarations and thus forbidden. 2020-08-07 10:16:33 +02:00
Jesse Rosenstock
cdfc1afd89 Fix vacuous comparison warning from 0df45fe
cc65/symentry.c:306:60: warning: address of array 'Sym->Name' will always evaluate to 'true' [-Wpointer-bool-conversion]
    sprintf (TypeName, "%s %s", GetBasicTypeName (T), Sym->Name ? Sym->Name : "<unknown>");
                                                      ~~~~~^~~~ ~
2020-08-05 17:48:13 +02:00
Jesse Rosenstock
d8f9201ecd LoadExpr: Optimize <= 8-bit bit-field loads
Set CF_FORCECHAR to do as many operations as char ops as possible.
Clear high byte at the end.
2020-08-05 12:49:46 +02:00
Jesse Rosenstock
0c72647edd Remove extra ED_TestDone call
Accidentally added in #1141.
2020-08-03 12:40:58 +02:00
acqn
bae431eab0 Fixed error message of CheckedPSizeOf(). 2020-08-03 06:18:28 +02:00
acqn
e3d913b81a Fixed the reference output of test/misc/goto.c (test/misc/goto.ref). 2020-08-02 23:51:11 +02:00
acqn
d6aa446b54 Error info for loading expressions of incomplete enum types.
No more "Illegal type 0016".
2020-08-02 23:51:11 +02:00
acqn
6df4f1996b Improved diagnostics with more detailed type names. 2020-08-02 23:51:11 +02:00
acqn
11a5f0edf1 No "Statement has no effect" warnings on statements with errors. 2020-08-02 23:51:11 +02:00
acqn
7e68a24625 Clearer warning messages on unused symbols. 2020-08-02 23:51:11 +02:00
acqn
e8c2886455 Improved error messages on redefinitions of constants and bit-fields. 2020-08-02 23:51:11 +02:00
acqn
ef5a4db12e Improved warning messages on UB shifts. 2020-08-02 23:51:11 +02:00
acqn
2ab7272673 Improved warning on comparison of unsigned type < 0. 2020-08-02 23:51:11 +02:00
acqn
99ac1c46da Made errors/warnings statistic message visible when there are errors. 2020-08-02 23:51:11 +02:00
acqn
44e3080ea9 Increased upper limit of allowed errors before aborting. 2020-08-02 23:51:11 +02:00
acqn
00c16d34a4 Minor fixes for HandleSymRedefinition(). 2020-08-02 23:51:11 +02:00
acqn
80b0e57543 Changed parameter constness of TypeConversion(). 2020-08-02 18:55:46 +02:00
acqn
003d47cc8b Improved type conversion diagnostic messages.
Allowed incompatible pointer assignments with warnings.
Fixed Issue #1089.
2020-08-02 18:55:46 +02:00
acqn
d841bbe498 Utility to check for castability. 2020-08-02 18:55:46 +02:00
acqn
52051f444e Using tracked individual string buffers instead of a shared static string buffer for full type names. 2020-08-02 18:55:46 +02:00
acqn
4ccf10f3fa Utility to get full type names. 2020-08-02 18:55:46 +02:00
acqn
0df45fe2f2 Utility for getting ESU tag type symbols. 2020-08-02 18:55:46 +02:00
Oliver Schmidt
c831f40e9b Unfortunately there's no other way than using the absolute path to init the correct MSVC 2017 environment. 2020-08-02 18:44:13 +02:00
Oliver Schmidt
35d6a75b37 Fixed Windows path notation. 2020-08-02 17:49:18 +02:00
Oliver Schmidt
992596c981 Initialize MSVC 2017 environment before build. 2020-08-02 17:32:36 +02:00
Oliver Schmidt
ce19d7b84f Made use of Travis CI's Windows support.
At least for now there seems to be no point in trying to build the libraries (and run the tests) on Windows. Rather we only want to check that the MSVC solution is still valid.
2020-08-02 15:50:31 +02:00
Jesse Rosenstock
adda28f5c5 LoadExpr: Set CF_FORCECHAR if test is required
If we are testing, we do not need to load the high byte(s).
2020-08-02 12:31:57 +02:00
acqn
2a555d198c Changed 'switch' to 'if' according PR review comments. 2020-08-02 12:28:11 +02:00
acqn
30fd8592ae Avoid internal errors when using function-type objects in expressions. 2020-08-02 12:28:11 +02:00
acqn
e526cbbff6 Fixed handling multiple storage specifiers in one declaration. 2020-08-02 02:20:25 +02:00
Jesse Rosenstock
633cd17a3e Add enum size test case for #1050 2020-08-02 01:18:28 +02:00
Oliver Schmidt
e1043fac12 Adjusted to https://github.com/cc65/cc65/pull/1124. 2020-08-01 10:56:05 +02:00
Jesse Rosenstock
9c70bd44a6 Clarify comment about large shift
This is to avoid overflow on host platform.
2020-07-31 19:33:28 +02:00
Jesse Rosenstock
847982c6bf Handle bit-field test after shift/mask
Previously, bit-field tests were incorrectly combined with load in
`if (x.bitfield)`.  Delay the test until after the shift/mask
is done.  Still combine tests with load if no shift/mask is required.

Fixes #1139
2020-07-31 19:33:28 +02:00
Jesse Rosenstock
d0c7108dcf Change copyright notice to "The cc65 Authors" 2020-07-30 19:17:11 +02:00
Jesse Rosenstock
3df6c383c0 Add support for static_assert
Add C11's _Static_assert and static_assert macro.

This is like #error, but is handled at a later stage
of translation, so it is possible to check sizes of
types, values of enums, etc.

https://en.cppreference.com/w/c/language/_Static_assert
https://port70.net/~nsz/c/c11/n1570.html#6.7.10
2020-07-30 19:17:11 +02:00
Jesse Rosenstock
c72fa735b9 Add test for #1139 2020-07-30 19:13:19 +02:00
Jesse Rosenstock
2d5fd0fc63 Use char ops if possible for bit-field loads
Set CF_FORCECHAR and change type to char once we have
shifted into a char.

This saves some unnecessary ldx #0 instructions.
2020-07-30 14:59:23 +02:00
acqn
e38f601fcc Fixed padding at the ends of structs with bit-fields. 2020-07-30 08:38:24 +02:00
acqn
8a511bb63d Fixed nested array initializers. 2020-07-30 08:38:24 +02:00
acqn
9075a853dc Allows one trailing comma before the closing curly of a struct/union initializer. 2020-07-30 08:38:24 +02:00
acqn
25d10d9d9a Fixed nested struct/union initialization.
Fixed bit-fields offsets in anonymous structs.
2020-07-30 08:38:24 +02:00
acqn
d6d667a688 Improved error handling with symbol redefinitions. 2020-07-30 08:22:29 +02:00
acqn
92de4fa0d0 Enabled to recognize labels when parsing local variable declarations. 2020-07-30 08:22:29 +02:00
acqn
19c81ed866 Fixed type mask usage. 2020-07-30 08:13:23 +02:00
Jesse Rosenstock
fb9b50ff9c Move type checks before bit-field width parsing 2020-07-30 08:10:38 +02:00
Jesse Rosenstock
aaa0cf5448 Add err tests for bitfield width errors
! ../../bin/cc65 -o ../../testwrk/err/bitfield-named-zero-width.s bitfield-named-zero-width.c
bitfield-named-zero-width.c(27): Error: Zero width for named bit-field
! ../../bin/cc65 -o ../../testwrk/err/bitfield-negative-width.s bitfield-negative-width.c
bitfield-negative-width.c(26): Error: Negative width in bit-field
! ../../bin/cc65 -o ../../testwrk/err/bitfield-too-wide.s bitfield-too-wide.c
bitfield-too-wide.c(26): Error: Width of bit-field exceeds its type
2020-07-30 08:10:38 +02:00
Jesse Rosenstock
a2561d07f3 Remove special-case bit-field width code
cbb33f8 restricted allowed bit-field types to int,
so this is equivalent for now, but forward-compatible.

Fixes FIXME

Also move the int type check before parsing the colon.
2020-07-30 08:10:38 +02:00
Jesse Rosenstock
74dda01919 Add test that plain int bitfields are unsigned
We want to make sure this doesn't change when #1095 is fixed;
unsigned is much more efficient.
2020-07-29 16:43:17 +02:00
Oliver Schmidt
8eab28012a
Adjusted project name. 2020-07-28 23:29:16 +02:00
acqn
cbb33f86e8 Disabled using non-int-size types to declare bit-fields. 2020-07-28 23:26:25 +02:00
acqn
c37f9f1a41 Check if the integer size is known in GetIntegerTypeMin/Max() to prevent potential misuse. 2020-07-28 23:26:25 +02:00
acqn
0f412b6beb Small fixes according to PR review. 2020-07-28 23:26:25 +02:00
acqn
35e1efc7f2 Moved misc/bug1048 as it is already correctly rejected by the compiler. 2020-07-28 23:26:25 +02:00
acqn
7e243e0f2c Allowed using all integer types including enum and char types to define bit-fields,
but kept the currently behavior that all of them are treated as unsigned int.
2020-07-28 23:26:25 +02:00
acqn
d8184fbe54 No longer insert all enums in the global symbol table. 2020-07-28 23:26:25 +02:00
acqn
daa65199b3 Fixed underlying types of enums.
Made enumerator diagnostics more sensible.
Fixed Issue #1048 as a natural result.
2020-07-28 23:26:25 +02:00
Jesse Rosenstock
c272c73686 Add err test for char bit-fields #1047 2020-07-28 22:03:01 +02:00
Jesse Rosenstock
c0f2b69bef Add test case for sign extending < 1 byte 2020-07-28 22:01:22 +02:00
Jesse Rosenstock
04d16b3740 Make $WORKDIR for tests/err
Without this, if there is a test that can compile,
it will still fail because the WORKDIR does not exist:

```
pass.c(1): Fatal: Cannot open output file '../../testwrk/err/pass.s': No such file or directory
```
2020-07-28 21:59:12 +02:00
Oliver Schmidt
cdd23edd37 Added building of samples. 2020-07-27 17:59:24 +02:00
Oliver Schmidt
4316242d7e Adjusted to 5df2de0629 (and slightly simplified). 2020-07-27 17:47:14 +02:00
mrdudz
ed3f281b9e fix wording 2020-07-27 14:40:27 +02:00
compyx
81d3dedb41 Move comment block as requested 2020-07-24 15:24:28 -04:00
compyx
294b5d1cf1 C64 soft80 conio: shave off a few bytes and cycles 2020-07-24 15:24:28 -04:00
Oliver Schmidt
5df2de0629 Added test target. 2020-07-22 23:27:04 +02:00
mrdudz
ffaae965d4 Merge branch 'master' of https://github.com/cc65/cc65 2020-07-22 15:56:23 +02:00
mrdudz
afe455238c added test related to issue #1113 2020-07-22 15:55:55 +02:00
mrdudz
98b2d43c2b added tests related to pr #1110 2020-07-22 15:52:04 +02:00
mrdudz
ce06b20c6c add some details to the readme 2020-07-22 15:31:39 +02:00
mrdudz
844f5a9d33 hook up test/todo in the toplevel test makefile 2020-07-22 15:12:29 +02:00
mrdudz
6abf24e25e move test for issue #1077 to test/val 2020-07-22 15:12:02 +02:00
mrdudz
e22e9c403c added testcase for issue #1098 2020-07-22 14:57:40 +02:00
Greg King
44c82eb1c3 Made da65 disassemble branch instructions with relative address expression operands if there's no label. 2020-07-21 18:43:32 -04:00
mrdudz
eb094ecf6a remove ifdef magic 2020-07-22 00:21:23 +02:00
mrdudz
4a9c5ff63b use uint16_t instead of magic ifdefs, leaving support for bit type in there incase we support it some day 2020-07-22 00:09:48 +02:00
mrdudz
6d518a61a5 Merge branch 'master' of https://github.com/cc65/cc65 2020-07-21 23:52:24 +02:00
mrdudz
df900e30b8 removed references to macros from common.h 2020-07-21 23:50:23 +02:00
Oliver Schmidt
77674352f6
Minor style change. 2020-07-21 23:44:36 +02:00
Brad Smith
041f981960
rand() use XOR to break up unwanted pair correlation (#1107)
* rand() use XOR to break up unwanted pair correlation

This form of rand() cannot return the same value twice in a row.
Two additonal EOR instructions produce a more even distribution of successive pairs.
see comments on #951

* rand.s document purpose of XOR

* suggested srand() optimization: zero fill unnecessary

* test to validate implementation of rand()

* srand() improving behaviour and adding startup test

* srand() with a tail call to rand() for better initial shuffle

* srand() can fall through to rand() instead of tail call
2020-07-21 23:38:18 +02:00
mrdudz
7e1f4760e7 remove common.h from test/misc, its no more used 2020-07-21 23:31:58 +02:00
mrdudz
2bbea6779a properly configure sitest so it could work, if we had the respective features :) 2020-07-21 23:04:03 +02:00
mrdudz
9e43c0a569 added a test related to pr#1102 - we can now return structs by value when they are max. 4 bytes 2020-07-21 21:04:41 +02:00
mrdudz
145084c41c move test for issue #1075 to test/var 2020-07-21 20:02:51 +02:00
mrdudz
42c162c15e rework test for issue #1075 to return an exit code 2020-07-21 19:58:36 +02:00
mrdudz
a0c80a8c72 move (now working) tests to test/val 2020-07-21 19:24:39 +02:00
mrdudz
b2d7998241 update makefile to use $(NOT) as discussed with Oliver 2020-07-21 19:15:41 +02:00
acqn
07e18774f7 Added spaces around '|' with regex replacement. 2020-07-21 18:23:52 +02:00
acqn
c66d0881b9 Made the enum/enumerator types clearer and improved DumpSymEntry() output. 2020-07-21 18:23:52 +02:00
acqn
18bd76bb90 Minor fixes and improvements. 2020-07-21 18:23:52 +02:00
acqn
65081aebed Made able to recognize global declarations of static arrays. Fixed Issue #975. 2020-07-21 18:23:52 +02:00
acqn
0250c87ac6 Fixed SC_* type masks by making them all bitwise-exclusive. 2020-07-21 18:23:52 +02:00
mrdudz
e4fc7a0fec reworked pptest3 into an exectutable test and moved to test/val 2020-07-21 15:30:35 +02:00
mrdudz
010ed6d729 reworked pptest1/4/5 into executable tests and moved to test/val 2020-07-21 14:58:15 +02:00
mrdudz
638e254668 rework pptest2 into a runable test and move to test/misc (since it does not compile with cc65) 2020-07-21 14:48:49 +02:00
Greg King
b60b303c5d Added a missing asterisk to a "hardware" struct definition. 2020-07-20 21:40:44 -04:00
Greg King
517df130cc Made a regression test increment a variable after, instead of before, using it.
That change allows the initial value of zero to be tested.
2020-07-20 17:16:11 -04:00
mrdudz
5a9d76ad52 added test for issue #1108 2020-07-20 15:50:11 +02:00
acqn
78342fa82c Fix for "auto" variables made "static" with the "-Cl" options. 2020-07-20 15:01:47 +02:00
acqn
71c2d27705 Removed an ED_IsBitField() test according to PR review. 2020-07-20 14:54:32 +02:00
acqn
2245783345 Fixed ability to do actual type conversion from bit-fields to integers. Note this doesn't try to fix the signedness issues. 2020-07-20 14:54:32 +02:00
acqn
b67b8ddd38 Disabled applying 'sizeof' to bit-fields. 2020-07-20 14:54:32 +02:00
acqn
62a6e37487 Made the code handling '&expression' slightly tidier. 2020-07-20 14:54:32 +02:00
acqn
3c52ad1d9e New utility ED_DisBitField() to make an expression no longer a bit-field. 2020-07-20 14:54:32 +02:00
Greg King
fd0a6955da Changed "IsTypeStruct() || IsTypeUnion()" expressions into shorter "IsClassStruct()" expressions.
Type-classes are groups of types that can be handled in the same way (similar syntax).
2020-07-19 14:30:22 -04:00
Oliver Schmidt
ee208aecd6 Removed unnecessary tool.
It's not the domain of cc65 to provide tools already available elsewhere.
2020-07-19 13:16:29 +02:00
acqn
29c50ab25f Corrected the error message about struct/union members not found. 2020-07-19 12:57:59 +02:00
Jesse Rosenstock
bbcb39978c Add test of signed bitfields for #1095 2020-07-19 11:05:27 +02:00
acqn
768e03a474 Small fixes and tidy-up based on PR review.
Renamed GetReplacementType() to GetStructReplacementType().
Clarified in comments that most *Struct* facilities work for unions as well.
Made it clear in some error messages with regards to structs/unions.
2020-07-19 10:58:33 +02:00
acqn
0c3e1b491f Disabled -Wstruct-param by default. 2020-07-19 10:58:33 +02:00
acqn
b45d373fd6 Fixed passing by value structs/unions <= 4 bytes in size to functions. Larger ones are forbidden for now. 2020-07-19 10:58:33 +02:00
acqn
9f67b45ea0 Fixed returning by value structs/unions <= 4 bytes in size from functions. Larger ones are forbidden for now. 2020-07-19 10:58:33 +02:00
acqn
66ecc0e52c New utility to get the proper replacement type for passing structs/unions by value.
New utility to get basic type names such as 'struct', 'union' and so on.
2020-07-19 10:58:33 +02:00
acqn
333fa97326 Whitespaces/newlines fixes. 2020-07-18 12:54:29 +02:00
acqn
9198b3be00 Fixed '&function' and '&array'. 2020-07-18 12:54:29 +02:00
acqn
d23b577331 More compiler flags on address types to match the location types of expressions. 2020-07-18 12:54:29 +02:00
acqn
2108489523 Fix for Issue #1075 and #1077. 2020-07-18 12:54:29 +02:00
Greg King
ba48dfe65d Fixed a typo in the CX16 document. 2020-07-16 14:06:23 -04:00
Spiro Trikaliotis
0e55d33cc3 Fix info page building for newer linuxdoc
In ca65.sgml, the following pattern was used in tables in order to
create an empty row:

||~@

That is, the first two columns are empty, the last one has an &nbsp;

Unfortunately, with newer linuxdoc, this fails, as the empty columns
create two @item directly after each other, which is not allowed.

Changing this to

~|~|~@

fixes it by adding an "&nbsp;" into each column.

Furthermore, the last line had a "newrow" (@) separator, which created
an artifact. Removed that one.
2020-07-16 19:25:40 +02:00
Greg King
4296cbaf82 Added a 320x200x256 TGI driver to the Commander X16 library.
Made the mandelbrot sample program handle the X16's 256 colors.
2020-07-15 17:30:58 -04:00
Christian Groessler
72fff0cfbc atari.h: fix definition of KEY_UP
noticed by Stefan Wessels
2020-07-15 23:00:12 +02:00
Greg King
ba0ef5938d Moved the font into a separate module in the library.
The font can be replaced, at link-time, by a custom file.
2020-07-15 04:58:32 -04:00
Olli Savia
a02bec11e9 Another code style fix 2020-07-14 22:54:03 -04:00
Olli Savia
b3703de983 Code style fixes 2020-07-14 22:54:03 -04:00
Olli Savia
de5678af5d Added optimizations by dmsc 2020-07-14 22:54:03 -04:00
Olli Savia
e2ec517aae Save another 3 bytes 2020-07-14 22:54:03 -04:00
mrdudz
306f421aa9 Merge branch 'master' of https://github.com/cc65/cc65 2020-07-15 00:17:41 +02:00
mrdudz
6035f1cb75 added missing gotox/gotoy functions 2020-07-15 00:17:11 +02:00
Greg King
9023e975df Stopped the C128 mouse drivers from blocking certain keys such as '1', '2', and 'Q'.
This extra fix is needed because the C128 keyboard scanner works a little differently than the C64 scanner works.
Fixes #696. Fixes #853.
2020-07-14 16:06:21 -04:00
mrdudz
3558c0796d added a second test that checks all available characters (including inverse) 2020-07-14 15:00:43 +02:00
mrdudz
f99a44d8e1 added rudimentary testing for the peek functions 2020-07-14 14:24:19 +02:00
mrdudz
1f2fdbd9b1 implemented conio peek functions for PCE target 2020-07-14 14:23:58 +02:00
mrdudz
a4f1e37f0c increase the maximum amount of cycles, else the shift test will fail 2020-07-13 21:26:31 +02:00
mrdudz
5ad365c5df some tweaks to the moved tests to make them more suitable for automatic testing 2020-07-13 21:26:07 +02:00
mrdudz
882194c221 move a bunch of tests from testcode/lib to test/val (and a failing one to test/todo) 2020-07-13 21:25:13 +02:00
mrdudz
d940c9aa85 added a bit more precise description 2020-07-13 17:04:22 +02:00
mrdudz
e758110f61 added testcode to check petscii char mapping, related to issue #988 2020-07-13 17:00:17 +02:00
mrdudz
390f972014 updated Makefile with exception rules for the added tests 2020-07-13 15:16:26 +02:00
mrdudz
5597b83d04 added testcase for issue #975 2020-07-13 15:13:38 +02:00
mrdudz
36ff372149 added testcase for issue #760 2020-07-13 15:13:22 +02:00
mrdudz
bec140143b added testcase for issue #760 2020-07-13 15:13:06 +02:00
mrdudz
f8873c2508 added testcase for issue #250 2020-07-13 15:12:47 +02:00
mrdudz
f5d99106e6 added testcase for issue #1075 2020-07-13 15:12:30 +02:00
mrdudz
693e3a7109 added testcase for issue #1048 2020-07-13 15:12:04 +02:00
Olli Savia
a43cac580e Tiny optimization 2020-07-13 10:14:21 +02:00
Oliver Schmidt
bcb8b49907 Removed executable bit. 2020-07-12 23:11:43 +02:00
Oliver Schmidt
04cc463452 Implemented some CONIO peek functions.
Please refer to https://github.com/cc65/cc65/pull/532 for background info.

I wrote in 35873183/

===
cputs() wraps to the next line if the strings is too long to fit in the current line. I don't know if it's worth the effort to allow cpeeks() to continue reading from the next line. I'd like to discuss this aspect with the actual implementers.
===

This is still as unclear today as it was when I wrote the above. Therefore this change just doesn't add cpeeks() at all.

Since f8c6c58373 the Apple II CONIO implementation doesn't "need" revers() anymore - meaning that (nearly) every possible value can be placed in VRAM with a straight cputc() (without the need for a previous revers(1)).

The implementation of cpeekc() leverages that cputc() ability by always returning the value that can be fed into cputc() without a previous revers(1). Accordingly, cpeekrevers() always returns 0.

So after the sequence revers(1); cputc(x); a cpeekc() will return a value different from x! However, I don't see this behavior braking the cpeekc() contract. I see the cpeekc() contract being defined by the sequence textcolor(cpeekcolor()); revers(cpeekrevers()); cputc(cpeekc()); placing the very same value in VRAM that there was before. And that contract is fulfilled.
2020-07-12 22:19:55 +02:00
acqn
727040d1ac Comment fix. 2020-07-12 12:35:42 +02:00
acqn
7d652d42dc Added a warning on promoting a decimal constant without a 'u'/'U' suffix to unsigned long. 2020-07-12 12:35:42 +02:00
compyx
381a32d9aa C64 soft80-conio cgetc: save 14 cycles in invertcursor
By 'inverting' the loop, we can save 16 cycles by removing the `cpy #8`,
saving 16 cycles. But we need an extra `ldy #7` at the start of the
loop, so the total cycles saved is 14. Code size doesn't increase due to
the addition of the `ldy #7` negating the removal of the `cpy #xx`.
2020-07-11 17:46:29 +02:00
compyx
2c4dd5decf Shorten comment as requested 2020-07-11 11:59:45 +02:00
compyx
e45e57d7ce C64 soft80 conio: save 4 bytes in firstinit
Also save 6 cycles as a very small bonus.
2020-07-11 11:59:45 +02:00
compyx
fb7996b0ce Revert "C64 soft80 conio: save 6 bytes in firstinit"
This reverts commit 943e68be6a.
2020-07-11 11:59:45 +02:00
compyx
695b1b01d8 C64 soft80 conio: save 6 bytes in firstinit
As a bonus, save 6 cycles.
2020-07-11 11:59:45 +02:00
Jesse Rosenstock
df97570471 Set .NOTPARALLEL in test/misc and test/val
The cl65 intermediate files stomp each other in
these directories.
2020-07-10 13:08:19 +02:00
Jesse Rosenstock
3999f2ad75 Move .NOTPARALLEL closer to rule that needs it 2020-07-10 13:08:19 +02:00
Jesse Rosenstock
878e4a57c8 Make Makefiles more -j friendly
Add .$1.$2 to outputs missing them.
2020-07-10 13:08:19 +02:00
Jesse Rosenstock
f5afc75cbd ar65/LibClose: Include filename in error messages
```
ar65: Error: Problem deleting temporary library file '../lib/apple2enh.lib.temp': No such file or directory
```
is the error I'm getting with `make -j 19` when trying
to debug #1080.
2020-07-09 21:56:02 +02:00
mrdudz
579b50f0c5 test for issue #927 2020-07-09 16:18:08 +02:00
mrdudz
2428285694 test for issue #327 2020-07-09 16:17:31 +02:00
mrdudz
ff18218b0a test for issue #170 2020-07-09 16:17:16 +02:00
mrdudz
5925a7f8ee test for issue #1077 2020-07-09 16:16:46 +02:00
mrdudz
4b8b15a07a tests for issue #169 2020-07-09 16:05:57 +02:00
mrdudz
93f0df58e5 test related to issue #1071 2020-07-09 15:57:51 +02:00
acqn
85e73e91f8 Only enable signed div replacements with shift according to the code size factor settings.
Also with better comments.
2020-07-09 10:00:50 +02:00
acqn
09bcff0862 Added support for changing divisions by negative power-of-2 denominators into bit shifts,
and fixed #169 including the case of -2147483648 which is negative but appears positive.
2020-07-09 10:00:50 +02:00
acqn
30835e3d9d More optimized codegen for the correct cases of the Issue #169 fix. 2020-07-09 10:00:50 +02:00
acqn
e98fe04cc2 Almost fixed Issue #169. The only denominator not working right now is -2147483648. 2020-07-09 10:00:50 +02:00
Jesse Rosenstock
82c8bd6e2b Replace unary negation with subtraction
Remove MSVC pragma.
2020-07-09 09:49:24 +02:00
Jesse Rosenstock
2c16453a9f Guard MSVC pragma with ifdef _MSC_VER
Fix broken travis-ci with gcc -Werror [-Werror=unknown-pragmas].
2020-07-09 09:49:24 +02:00
Jesse Rosenstock
9e5b8d99a3 Fix MSVC build broken by #1058
MSVC complains about unary negation of unsigned, but it's
intended.  Suppress the warning.

https://github.com/cc65/cc65/pull/1058#discussion_r451757967

"Tested" with godbolt.org.
2020-07-09 09:49:24 +02:00
Jesse Rosenstock
359da1ae76 Update bit-field tests after #1058 merge 2020-07-08 17:20:15 +02:00
Jesse Rosenstock
8449c9eaa0 Add zlib license text 2020-07-08 17:20:15 +02:00
Jesse Rosenstock
532e6b2554 Add copyright notice 2020-07-08 17:20:15 +02:00
Jesse Rosenstock
6f85ee9d95 Add another test for bit-field unit overlap
Test when there is another field after bit-fields with
allocation unit overlap.
2020-07-08 17:20:15 +02:00
Jesse Rosenstock
2f456ce4e2 Add comment explaining four_bits_with_int 2020-07-08 17:20:15 +02:00
Jesse Rosenstock
8a331ee7ec Print to stdout instead of stderr
Print number of failures.

This makes it consistent with the other val/ tests.
2020-07-08 17:20:15 +02:00
Jesse Rosenstock
a70ac6be30 Add test of bit-field packing for #1054 and #1055 2020-07-08 17:20:15 +02:00
Jesse Rosenstock
6dc2bf1226 Rename PaddingBitWidth to PaddingBits 2020-07-08 16:46:34 +02:00
Jesse Rosenstock
9858e47dfd Pad bit-fields only to the next byte
Fixes #1054.

Previously, bit-fields followed by another field were aligned
to two bytes.  Bit-fields ending the struct were (and continue
to be) aligned only to a single byte.

```
struct s {
  unsigned int x : 4;
};

struct t {
  unsigned int x : 4;
  unsigned int y;
};
```

Before: `sizeof(struct s) == 1`, sizeof(struct t) == 4`
After: `sizeof(struct s) == 1` sizeof(struct t) == 3`
2020-07-08 16:46:34 +02:00
Jesse Rosenstock
9e881a497e Fix formatting 2020-07-08 16:45:00 +02:00
Jesse Rosenstock
c273c90bf2 Fix formatting 2020-07-08 16:45:00 +02:00
Jesse Rosenstock
527df094ca Use xrealloc in cl65
Previously, xmalloc and xfree were used.
2020-07-08 16:45:00 +02:00
Jesse Rosenstock
416adbce82 Add blank line 2020-07-08 16:44:06 +02:00
Jesse Rosenstock
021362fb75 cl65: Remove temporary .o files 2020-07-08 16:44:06 +02:00
Greg King
410e4502ee Added a 160x192x2 TGI (graphics) driver to the VIC-20 library.
The driver requires a special linker configuration: "vic20-tgi.cfg".
The VIC-20 computer needs at least 8K of expansion RAM!

"tgidemo.c" needed to be adjusted because the VIC-20's vertical (y) range is greater than its horizontal (x) range -- the opposite of most other platforms.  Also, the circle demo would jam on the VIC-20.
2020-07-08 05:55:30 -04:00
mrdudz
d1833cc441 Fix handling of charcodes 254 and 255, fixes issue #988 2020-07-08 00:48:39 +02:00
acqn
539924249b More complete fix for Issue #1071. 2020-07-07 18:28:56 +02:00
acqn
286da30a26 Quick fix for Issue #1071. 2020-07-07 18:28:56 +02:00
Daniel Serpell
17c5504129 In Atari XEX output format, join memory areas if possible.
This makes executables shorter if two memory areas are consecutive.
2020-07-04 23:28:10 +02:00
Oliver Schmidt
0f8b587bc2 Added directory for currently failing regression tests. 2020-07-01 00:13:55 +02:00
Jesse Rosenstock
8891a896b5 test/ref: Use separate .out files
Use different .out files for different options / targets.
This allows make -j N to work.

Previously all test.*.*.prgs would use the same test.out file.
Now test.*.*.out is also used.
2020-06-29 22:34:44 +02:00
Jesse Rosenstock
d31171164e Fix formatting 2020-06-29 14:49:36 -04:00
Jesse Rosenstock
fae25bc459 CHECK we have at most a partial byte 2020-06-29 14:49:36 -04:00
Jesse Rosenstock
f4a6d08847 Fix full bytes vs full word in comment 2020-06-29 14:49:36 -04:00
Jesse Rosenstock
a00611798d Output bit-field data as chars instead of ints
This prepares for #1058, which will pad bit-fields only to
the next byte, instead of the next sizeof(int) (two bytes).

OutputBitFieldData now outputs chars instead of ints, and
calls to this function loop until there is less than one byte
to output.  A final partial byte is written out with zero padding
as a final partial int was previously.
2020-06-29 14:49:36 -04:00
Jesse Rosenstock
90d1c89bff
Allow overlap of bit-field storage units (#1055)
* Allow overlap of bit-field storage units

Previously,
struct s {
    unsigned int x : 10;
    unsigned int y : 10;
};
had sizeof(struct s) == 4.

With this change, allow the storage units of x and y to overlap,
so sizeof(struct s) == 3, with y stored immediately after x,
with no padding between them.

An int bit-field (the only type currently supported) will still
never occupy more than two bytes.

* ParseStructInit: Fix typo and expand comment

Explain why there are at most 30, not 32 bits.

* ParseStructDecl: Rewrite AddBitFieldCall

No behavior change.

Co-authored-by: Jesse Rosenstock <jmr@users.noreply.github.com>
2020-06-27 15:02:11 +02:00
Oliver Schmidt
5277ea0b73 Add test license description. 2020-06-27 02:23:40 +02:00
Jesse Rosenstock
18246278c5 switch2.c: Remove use of REFCC and UNSIGNED_CHARS
Explicitly use `signed char` or `unsigned char`, rather than
```

signed char k;
char k;

signed char k;
char k;
```
This should have resulted in the same thing; however, note that
`REFCC` was never defined, and `common.h` was not included, so
the old code in fact tested `char` then `unsigned char`,
which are the same.

The only difference is that a switch using plain `char` is not
tested, but since this is the same as either `signed char` or
`unsigned char`, the lack of test coverage seems relatively safe.
2020-06-25 13:18:08 +02:00
Jesse Rosenstock
8fe317e7fa Remove REFCC_UNSIGNED_CHARS from test/ref/
Explicitly use signed char or unsigned char for REFCC.
2020-06-25 13:18:08 +02:00
Jesse Rosenstock
86ba877a99 Define REFCC and REFCC_UNSIGNED_CHARS in reference
switch2.c uses these macros.  With them unset, signed chars
are not tested.
2020-06-25 13:18:08 +02:00
mrdudz
6e6ce4e5ee added various tests related to bug #1045 2020-06-23 00:46:12 +02:00
Dirk Jagdmann
aaecf3cfec replace JMP with BEQ to save 1 byte. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
3cbe485b94 fix description of Kerberos memory 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
6465c3b687 change order of declarations. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
9227b0ccaf sort items 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
def27ed4e2 change whitespace 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
070264acc4 remove tab characters. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
ba79b2db9b add kerberos em driver variable. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
cb26766651 add C64 documentation 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
76091b96d4 C64 Kerberos extended memory driver 2020-06-22 23:55:45 +02:00
acqn
e9307ce58e Moved test/ref/cc65141011.c to test/val/cc65141011.c. 2020-06-22 23:23:39 +02:00
acqn
8a166ac82f Fixed register usage tracking interfered by CE_SetArg. 2020-06-22 23:23:39 +02:00
acqn
2220c58f51 If the previous insn may be skipped, we cannot simply predict the output values of the registers. 2020-06-22 23:23:39 +02:00
acqn
53eb6a948d No more duplicated stores by Opt_tosshift which could result in worse optimizations. 2020-06-22 23:23:39 +02:00
acqn
49c5cfd65b Improved fix for Issues #167 and #784 and somehow #781. 2020-06-22 23:23:39 +02:00
acqn
48d3578c24 Fixed Issue #784. 2020-06-22 23:23:39 +02:00
acqn
b2268765bf The ref test cc65141011.c now passes. 2020-06-22 23:23:39 +02:00
acqn
a7a8426a90 Just keep Lhs loads in OptStackOps and leave them to OptUnusedLoads,
whilst Rhs loads must be removed for OptStackOps to work right.
Fixed Issue #167 as well as similar issues with tosshift.
2020-06-22 23:23:39 +02:00
Jesse Rosenstock
1c2edc5434 AddBitField: Rename Width arg to BitWidth
This makes the arg consistent with the SymEntry field name.
2020-06-21 01:08:44 +02:00
Jesse Rosenstock
4afc552e17 ParseStructDecl: Make BitOffs unsigned
This makes it consistent with SymEntry and removes the need for
some casts that were added to avoid warnings about signed vs
unsigned comparison.
2020-06-21 01:07:45 +02:00
Oliver Schmidt
37107174c6 Added waitvsync() for the Enhanced Apple //e.
The implementation is a bit tricky as it requires to take different code paths for the //e, the //c and the IIgs. Additionally the //c only provides a VBL IRQ flag supposed to be used by an IRQ handler to determine what triggered the IRQ. However, masking IRQs on the CPU, activating the VBL IRQ, clearing any pending VBL IRQs and then polling for the IRQ flag does the trick.
2020-06-18 21:44:57 +02:00
mrdudz
baa5d051e4 use same description as in the docs 2020-06-16 00:11:07 +02:00
mrdudz
349a84d972 remove superfluous TAB 2020-06-16 00:08:55 +02:00
mrdudz
98c7186221 Add description for --debug-opt-output to the --help output 2020-06-15 23:39:50 +02:00
Oliver Schmidt
e0a0b2dc25 Streamlined machine detection. 2020-06-15 19:31:18 +02:00
Oliver Schmidt
6adf175691 Optimized get_ostype() return values for asm usage.
Making sure that all but //c machines have bit 6 clear allows to use BIT/BVS to detect the //c machines.
2020-06-15 19:31:18 +02:00
Greg King
2acb3b153b Added some "See also" links to the TGI color-count descriptions. 2020-06-08 20:09:45 -04:00
Greg King
87144a15dd Fixed the "verbatim" tags in the TGI document. 2020-06-08 17:22:02 -04:00
Greg King
bc1e884988 Documented how the TGI API shows when a palette has 256 colors. 2020-06-08 16:39:11 -04:00
Oliver Schmidt
20a9c0c336 Replaced call to paddle read ROM routine with custom code.
As described e.g. in the Apple IIe Technote #6: 'The Apple II Paddle Circuits' it doesn't work to call PREAD several times in immediate succession. However, so far the Apple II joystick driver did just that in order to read the two joystick axis.

Therefore the driver now uses a custom routine that reads both paddles _at_the_same_time_. The code doing so requires nearly twice the cycles meaning that the overall time for a joy_read() stays roughly the same. However, twice the cycles in the read loop means half the resolution. But for the cc65 joystick driver use case that doesn't hurt at all as the driver is supposed to only detect neutral vs. left/right and up/down.

CPU accelerators are supposed to detect access to $C070 and slow down for some time automatically. However, the IIgs rather comes with a modified ROM routine. Therefore it is necessary to manually slow down the IIgs when replacing the ROM routine.
2020-06-06 15:15:13 +02:00
Greg King
8b5ae001e5 Refactored the TGI demo.
Cleared the screen at the beginning of each demo instead of at the end.  Setting the colors before clearing makes it more reliable and consistent across platforms.
2020-06-05 13:37:20 -04:00
Oliver Schmidt
7b2e4d0c7f Reflect that the Apple //c supports only one joystick. 2020-06-04 23:24:24 +02:00
Oliver Schmidt
15e2afcdf3 Split libref.s into multiple files to prevent inclusion of unnecessary code. 2020-06-04 23:24:24 +02:00
Greg King
14c62f1368 Allowed the TGI API to support 256 colors. 2020-06-04 12:58:05 -04:00
acqn
f9204e5b6f Fixed g_addlocal codegen with long types. 2020-06-01 22:37:40 +02:00
acqn
8066cd9ace Fixed wrong case in PreDec codegen, which never seems to be in use though. 2020-06-01 22:37:40 +02:00
acqn
07a5324a81 Fixed Issue #1028 by outputing local literals when exiting the function scope. 2020-06-01 22:37:40 +02:00
acqn
68f53e69f1 Fixed Issues #420 and #919 by always outputing the code segment before the three data segments for functions. 2020-06-01 22:37:40 +02:00
acqn
33e103fdc6 Fixed Issue #1040: non-byte pointer +=/-= byte codegen bug. 2020-06-01 22:37:40 +02:00
Oliver Schmidt
555282497c Removed --lib option from cl65.
The general approach of cl65 when generating the command lines to be executed is to first put options and the put files. However, this doesn't work well with the --lib option which would rather need to be put when libraries in general are put. I opted to not add this special behavior to cl65 as
* the use case for the --lib option is _VERY_ specific
* cl65 is after all a wrapper for ordinary use cases
2020-05-30 21:03:15 +02:00
laubzega
dc4142e1a9 Minor formatting changes after review. 2020-05-29 10:00:33 +02:00
laubzega
083f3ae26b Fix for #928. 2020-05-29 10:00:33 +02:00
Greg King
68eb0f2cdc Put the Telestrat static drivers names together. 2020-05-28 10:33:08 -04:00
Greg King
3890492a9b Added a JOY_FIRE() macro to the Atmos and Telestrat C headers. 2020-05-28 09:59:21 -04:00
jede
6521930880 Fixed the name of the driver 2020-05-28 08:50:20 -04:00
jede
6c2d578c61 Fix eor bug 2020-05-28 08:50:20 -04:00
jede
50192fc65e Change name of the driver (telestrat-joy.s renamed to telestrat.s 2020-05-28 08:50:20 -04:00
jede
1d358a4734 Fix bug 2020-05-28 08:50:20 -04:00
jede
e8b1d51d28 Fix typo 2020-05-28 08:50:20 -04:00
jede
cd7abdb58d Fix typo 2020-05-28 08:50:20 -04:00
jede
7ae6430728 Fix typo 2020-05-28 08:50:20 -04:00
jede
532240a2db Telestrat joystick management 2020-05-28 08:50:20 -04:00
Greg King
f8be35b41e Fixed some typos in the "large alignment" support. 2020-05-15 21:09:02 -04:00
Chris Cacciatore
3adeb0f907 Removed invalid link to ca65 document. 2020-05-15 17:54:41 -04:00
Chris Cacciatore
ad1eadd60d Added support for --large-alignment in ld65.
Implemented the same way as in ca65.
2020-05-15 17:54:41 -04:00
Oliver Schmidt
5b56c6e3a2 Disable potentially enabled double-width graphics. 2020-05-04 22:23:01 +02:00
Greg King
cbf0c1d1dd Updated the cx16 library to the Commander X16's ROM prerelease 37. 2020-05-02 13:46:06 -04:00
itaych
31daa706b7 PMG_SIZE_QUAD is 3, not 2.
From "Mapping the Atari": "Size of player. POKE with zero or two for normal size (eight color clocks wide), POKE with one to double a player's width (sixteen color clocks wide), and POKE with three for quadruple width (32 color clocks wide). Each player can have its own width set."
2020-04-16 17:06:18 +02:00
Stefan
4a224878d8 Preserve the accu 2020-04-06 18:13:54 +02:00
Oliver Schmidt
0981c020b2 Shortened names and adjusted style. 2020-04-02 22:58:16 +02:00
Oliver Schmidt
411fe87f64 Fixed tolower() and toupper() to save high byte. 2020-04-02 22:14:22 +02:00
Oliver Schmidt
df015f4766 Adjusted tolower() and toupper() to https://github.com/cc65/cc65/pull/997
For some reason or another both the author of the PR in question and its reviewers didn't notice that the two functions in question were totally overlooked.
2020-04-02 11:15:53 +02:00
Oliver Schmidt
65dd931d22 Some style adjustments. 2020-04-02 10:42:06 +02:00
Oliver Schmidt
4cc95a2c6c Matched comment to the one in the C header file. 2020-04-02 09:45:11 +02:00
Dirk Jagdmann
c15f4975d0 fix the clean: target to remove any disk images. 2020-03-30 21:19:12 +02:00
Greg King
8b5a2f135c Added missing <tag> and <itemize> Linuxdoc tags to some ctype.h function descriptions. 2020-03-27 00:59:15 -04:00
greg-king5
4ea2bfef0a Aligned comment. 2020-03-26 23:08:49 -04:00
marko.lauke
3e12840933 +code style 2020-03-26 23:08:49 -04:00
marko.lauke
68ff89ba0a +cc65 inline asm stp mnemonic support 2020-03-26 23:08:49 -04:00
Oliver Schmidt
a53bd345d8
Adjusted comments due to recent change. 2020-03-26 12:29:56 +01:00
Jeremy Rand
62eb3137ab Update get_ostype.s
Do not check $fbbe when detecting the Apple //e card.  This byte is a version number for the Apple //e card according to misc technote #7 and it appears that the last version of the software that I am aware of has a 3 at this location.

Prior to this change, Apple //e cards which we not version 0 would be detected as an Apple //e enhanced.
2020-03-26 12:25:41 +01:00
Dirk Jagdmann
beaa77d2d6 fix whitespace 2020-03-23 11:47:51 +01:00
bbbradsmith
e0cb33d9d4 SEGMENT start of 0 should be valid 2020-03-22 21:03:07 +01:00
Greg King
2fc24847ac Fixed an error message printer.
The disassembler can be built and won't crash if it sees duplicate labels, and one of them is an unnamed label.
2020-03-11 18:07:08 -04:00
Oliver Schmidt
b91ad02da1 Made use of 65C02 opcode (thx to polluks). 2020-03-05 14:38:36 +01:00
Greg King
e2c6648607 Fixed a typo in commit 2e5fbe89cd.
Changed a && to ||.
2020-02-21 08:12:05 -05:00
Oliver Schmidt
857a566a2e
Normalized Atari naming. 2020-02-17 11:07:52 +01:00
jede
0962a9f286 Fix 16 bits values 2020-02-13 05:46:46 -05:00
jede
026e57279d Fix bug in tgi_line : HRS(X) parameters are 16 bits. 2020-02-13 05:46:46 -05:00
IrgendwerA8
08705a3fdc Changes resulting from 2nd code review 2020-02-03 20:45:09 +01:00
IrgendwerA8
002d1801ec Changes resulting from code review. 2020-02-03 20:45:09 +01:00
IrgendwerA8
ce80624f62 ctype size optimization 2020-02-03 20:45:09 +01:00
acqn
dc5114b071 Just disable OptPushPop if N/Z is used after the PLA.
This is a more conservative way to fix Issue #971.
2020-02-01 18:04:32 +01:00
acqn
6d530931bf Quick fix for the OptPushPop bug reported in Issue #337. 2020-02-01 18:04:32 +01:00
acqn
9559625ee8 Always insert a LDA after the removed PLA during the optimization in OptPushPop.
Fixed Issue 971.
2020-02-01 18:04:32 +01:00
acqn
5b11eb4bb9 Corrected check in OptTransfers2 for register usage. Fixed Issue 992. 2020-02-01 18:04:32 +01:00
Daniel Serpell
f68cc06ec7 Fixes Atari OS devhdl_t, init field needs an JMP byte.
This fixes issue #1002.
2020-01-29 13:58:10 +01:00
mrdudz
a59402d5f5 store y first, then a. fix by willymanilly 2020-01-26 02:18:04 +01:00
mrdudz
a2bbb6f1be added regression test related to bug #1001 2020-01-25 20:56:52 +01:00
Greg King
90a2edcfa2 Made cc65 detect a possibly missing argument at the end of a function argument list.
(It could be a stray comma at the end of the list.)
2020-01-25 04:14:58 -05:00
Oliver Schmidt
0f08ae2c12 Minor cleanup. 2020-01-18 19:29:24 +01:00
Greg King
b66f7272af Updated the cx16 library to the ROM's prerelease 36. 2020-01-11 02:20:52 -05:00
mc78
244dc358e5 Changed the order in which lo/hi bytes of vdc addr are set according to willimanilys ((z64k) suggestions. Changed offset for vdc ramsize detection from 000 to 000. 2020-01-03 13:51:20 -05:00
mc78
390878e831 Added reservation of second byte for pagecount 2020-01-03 13:51:20 -05:00
mc78
2a42139674 Changes in INSTALL routine from emd/c128-vdc.s.
tmp1 was used at two places resulting in the bug that VDC_CSET was set to garbage on 16k VDC.
pagecount and curpage were not reset on INSTALL resulting in non-reentrant code on static linkage of emd driver.
2020-01-03 13:51:20 -05:00
Greg King
5109c0b68f Made ca65 give error messages when it sees duplicate .define commands. 2020-01-02 04:26:02 -05:00
Greg King
00ab3c2d34 Fixed the target guards around the usage messages. 2019-12-30 19:53:39 -05:00
Greg King
b56ba8f073 Added real-time clock functions to the cx16 library. 2019-12-27 18:07:37 -05:00
Greg King
f067c4530f Made the program-chaining exec() handle the X16 emulator's file-system. 2019-12-25 14:53:32 -05:00
Greg King
3fa253d31f Updated the cx16 library to the Commander X16 Kernal's prerelease 35. 2019-12-25 10:56:32 -05:00
Greg King
cab4910a7d Added the missing BANK_RAM array to the Commander X16's header. 2019-12-10 05:59:33 -05:00
Greg King
fb0d09a277 Changed sim65's internal error codes from 9-bit values to 7-bit values.
Some shells truncate process return codes to 8 bits.  And, the eigth bit often is used to show that a signal stopped the process.
2019-12-06 14:47:47 -05:00
Oliver Schmidt
d5c804f851 Expanded Sim65 zero page. 2019-11-26 22:18:12 +01:00
Greg King
f75657d7e2 Added <cx16.h> to the function reference document. 2019-11-20 12:11:47 -05:00
Stefan
d1fd7ffc59 Update status.s 2019-11-20 12:54:47 +01:00
Stefan
9d4d00737e Update slow.s 2019-11-20 12:54:47 +01:00
Stefan
eeefd10f8f Update revers.s 2019-11-20 12:54:47 +01:00
Stefan
2c34723a97 Update isfast.s 2019-11-20 12:54:47 +01:00
Stefan
df752ff7a5 Update fast.s 2019-11-20 12:54:47 +01:00
Stefan
3f360fe3ee Update cputc.s 2019-11-20 12:54:47 +01:00
Stefan
06c98952fc Update conio.s 2019-11-20 12:54:47 +01:00
Stefan
4497998944 Update color.s 2019-11-20 12:54:47 +01:00
Stefan
c9d2c10cbd Update vic20.sgml 2019-11-20 12:54:47 +01:00
Stefan
a56b176749 Update plus4.sgml 2019-11-20 12:54:47 +01:00
Stefan
ea16316e33 Update pce.sgml 2019-11-20 12:54:47 +01:00
Stefan
7361aa9959 Update nes.sgml 2019-11-20 12:54:47 +01:00
Stefan
c08f1e4bfd Update funcref.sgml 2019-11-20 12:54:47 +01:00
Stefan
63ab22f97f Update cx16.sgml 2019-11-20 12:54:47 +01:00
Stefan
49ebac7ac1 Update cbm510.sgml 2019-11-20 12:54:47 +01:00
Stefan
94892231bc Update c64.sgml 2019-11-20 12:54:47 +01:00
Stefan
9bf2bf308a Update c128.sgml 2019-11-20 12:54:47 +01:00
Stefan
9ab614d764 Update c16.sgml 2019-11-20 12:54:47 +01:00
Stefan
d9a6fbac48 Fixed C16 #978 2019-11-20 12:54:47 +01:00
mc78
db971d8a65 Removed unnecessary #include <cc65.h> from convert.c
Adjusted block comments to predominant style
2019-11-19 14:08:00 +01:00
mc78
1dee2360fa added additional empty line after header guard in cc65.h to conform to other headers 2019-11-19 14:08:00 +01:00
mc78
8d2617110f Removed additional exit constants definitions from cc65.h to stdlih.h. Guarded the definitions by #ifdef. Removed cc65.h includes from abort and assert implementations. 2019-11-19 14:08:00 +01:00
mc78
a139c4057c Removed CC65_ prefixes from exit statements in abort and assert code as well from definition 2019-11-19 14:08:00 +01:00
mc78
16a66f19e1 Replaced enum in cc65.h by defines. added comment that cc65 exit constants should not redefine 0 and 1 as they are reserved for exit_success and exit_failure 2019-11-19 14:08:00 +01:00
mc78
694dd9240f Added comment to debugger exit with error 2019-11-19 14:08:00 +01:00
mc78
3daecfb3dd Added enum for cc65 exit codes. replaced stdlib exit code names constants in libsrc with cc65 exit code named constants 2019-11-19 14:08:00 +01:00
mc78
7bae9038cf Replaced plain 0's and 1's in exit statements with EXIT_SUCCESS or EXIT_FAILURE 2019-11-19 14:08:00 +01:00
bbbradsmith
c9355734f5 make linker generated export warning conistent with the import warning 2019-11-18 21:50:44 +01:00
bbbradsmith
788fbcc9c8 Fix silent crash failure on warning from linker command line define import size mismatch 2019-11-18 21:50:44 +01:00
Greg King
5da525e0ea Added a standard mouse driver to the cx16 library. 2019-11-16 14:51:24 -05:00
Greg King
d78133e1f0 Updated cx16 to match the Commander X16 ROMs and emulator, release 34. 2019-11-16 13:11:40 -05:00
Greg King
4dda5d2173 Changed a "See also" link in the abort() and assert() descriptions from raise() to signal().
Programmers might want to use signal() to catch the SIGABRT that's sent by abort() and assert().
2019-11-12 11:57:38 -05:00
Stefan
659d1729eb Fixed exit code #974 2019-11-12 08:05:25 -05:00
Greg King
ac4866c027 Made assert() send SIGABRT when an assertion fails.
A signal handler can catch it, and do anything needed to make stderr work.
2019-11-10 12:46:01 -05:00
Stefan
7f7db01e25 Fixed typos 2019-11-10 03:21:43 -05:00
Piotr Fusik
d38417b347 Optimize sign extension. 2019-11-07 21:45:19 +01:00
Piotr Fusik
985371433b Swap the positive/negative paths to save a branch. 2019-11-07 21:45:19 +01:00
Piotr Fusik
421c3f2b4f Don't set carry when already set. 2019-11-07 21:45:19 +01:00
Piotr Fusik
2bec637637 Optimize a negation in signed division. 2019-11-07 21:45:19 +01:00
Richard Halkyard
0d21a2b5a4 Reformat comments to style guide rules 2019-11-02 11:21:50 +01:00
Richard Halkyard
0402fbd4b8 Fix comment alignment 2019-10-31 11:07:33 -05:00
Richard Halkyard
44065f5e12 Remove unncessary symbol 2019-10-31 11:05:57 -05:00
Richard Halkyard
2c9c704522 Use cl65 for linking samples
ld65 doesn't accept a config option (needed for plus4 TGI demos)
combined with -t, but cl65 does.
2019-10-31 11:03:21 -05:00
Richard Halkyard
917e5d4f01 Code-style fixes as per PR feedback 2019-10-31 11:01:00 -05:00
Fabrizio Caruso
2bd798fa13 Optimizations 2019-10-30 18:00:27 -04:00
Fabrizio Caruso
78d660da55 kbhit checks KBEDG and getc resets KBEDG 2019-10-30 18:00:27 -04:00
Fabrizio Caruso
43f24afe29 stz 2019-10-30 18:00:27 -04:00
Fabrizio Caruso
609f63ac74 Second tentative fix 2019-10-30 18:00:27 -04:00
Richard Halkyard
bf4c9c3c8c Fix handling of IRQs that occur when ROM is active 2019-10-30 09:13:15 -05:00
Richard Halkyard
89c8a988bf Use Kernal locations for serial buffer ptrs 2019-10-30 08:50:48 -05:00
Richard Halkyard
3bd4d05598 TGI driver and matching linker config for Plus/4 2019-10-30 08:50:35 -05:00
Curt J. Sampson
1d39863a60 vic20/cputc: Fix incorrect CRAM_PTR at startup when using conio
To do this we add a constructor call to UPDCRAMPTR, which is the ROM
routine that fixes up CRAM_PTR to match the screen location pointed to
by SCREEN_PTR.

This adds two additional bytes to programs using cputc() or other
routines that call it. These are in theory recoverable, but the VIC-20
does not yet free space used by constructors after the constructors
have been called.

Thanks to <greg.king5@verizon.net> (GitHub: greg-king5) for
investigating the difference in the VIC-20 KERNAL from the C64 and
proposing this solution to the problem.[1]

[1]: https://github.com/cc65/cc65/issues/946#issuecomment-538502820
2019-10-25 16:03:38 -04:00
Curt J. Sampson
128991d868 libsrc/*/kplot.s: Use cbm_kernal.inc symbols, not hardcoded addrs
On C64, VIC-20 and Plus/4, the conio library PLOT routine uses direct
calls into the Kernal, including the Kernal PLOT routine that we're
replacing. These were previously hardcoded addresses; we change these
to use the symbols for those routines defined in cbm_kernal.inc. (This
changes no functionality.)

To do this, we need to import cbm_kernal.inc in a namespace so we
don't have a collision between the PLOT that we're defining and the
Kernal definition.

We also add a UPDCRAMPTR symbol (used by kplot for VIC-20 and C64) to
the direct entry kernal routines in in cbm_kernal.inc, and expand the
comments describing what the "direct entry" Kernal routines are.

<greg.king5@verizon.net> (GitHub: greg-king5) came up with this idea
and did initial testing of it.

This has been tested on VICE xvic, x64 and xplus4 emulators with a
program that does a cputs() call (github.com/0cjs/vic20cc65) to
confirm that it works the same way after as it did before.
2019-10-25 16:03:38 -04:00
Greg King
9fa90e2265 Added VERA peek() and poke() to the cx16 library.
They simplify C programs' direct access to VERA's internal address space.
2019-10-24 05:15:42 -04:00
Fabrizio Caruso
1074d35a15 remove bra 2019-10-18 11:15:54 -04:00
Fabrizio Caruso
e4b60e1068 Remove useless tax 2019-10-18 11:15:54 -04:00
Fabrizio Caruso
da01286037 Tentative solution for cgetc in Lynx 2019-10-18 11:15:54 -04:00
Greg King
f3d898d6a3 Added the GIF switch to the X16 emulator's control port. 2019-10-15 12:10:34 -04:00
Stephan Mühlstrasser
55444b8337 Removed redundant LDA
After the removal of the redundant AND in commit
704c8df04f also the
subsequent LDA became redundant.
2019-10-15 09:38:23 -04:00
Stephan Mühlstrasser
7547c4c77c Address review comments
- removed typo from comment
- removed redundant AND instruction
2019-10-15 09:38:23 -04:00
Stephan Mühlstrasser
668273cdf5 Remove source file that was only used for testing 2019-10-15 09:38:23 -04:00
Stephan Mühlstrasser
8704d42005 Remove obsolete comment 2019-10-15 09:38:23 -04:00
Stephan Mühlstrasser
eb2317d014 Restructured according to review
Restructured according to review in pull request #567.

The "inputc" function was moved in slightly modified form
to kbhit.s and replaces the old keyboard scanner.
cgetc() uses the new kbhit() to read a character.
2019-10-15 09:38:23 -04:00
Jeff Tranter
e2007d0743 New OSI input routine based on disassembly of ROM code. 2019-10-15 09:38:23 -04:00
Fabrizio Caruso
9a3e521358 small m and n fixed 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
bac6f94929 Fix 127 (second left arrow) 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
b91e233714 Fix left arrow (char 77=13+64) 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
d04f7935c3 M N fixed 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
0210d76694 Fix 4 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
5eda1c256c Fix char 35 38 42 47 52 2019-10-13 09:03:46 -04:00
Greg King
4f24a06f0e Fixed error handling for missing names in ld65 configure files. 2019-10-12 07:59:49 -04:00
LRFLEW
e660a49347 [cx16] Update ROM banks to new mapping 2019-10-12 04:51:27 -04:00
Greg King
f3f15cfd25 Fixed problems with the Atari Lynx's TGI driver.
* The sprite-types for black and transparent backgrounds were swapped.
* A filler-byte for text output isn't printed.  (A hardware bug might not need that work-around in most cases.)
2019-10-12 04:01:03 -04:00
Greg King
39b10f9599 Added new program descriptions to the list. 2019-10-11 10:48:56 -04:00
LRFLEW
216105f6df Update comments in rand.s 2019-10-09 17:09:05 +02:00
LRFLEW
3994fee595 Significantly faster rand() implementation 2019-10-09 17:09:05 +02:00
Fabrizio Caruso
fb260ef17f Init is no longer in crt0.s 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
7706ea2f13 Improve comments 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
1b1d29ca9e Comments 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
40cf719068 Use decimal for lcd size initialization 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
b051c913e9 Add supervisionhello in samples/Makefile 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
eb83a3fd0f Improve helloworld example for Supervision 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
915836b3ec Improve init code readability 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
cdb8035cf0 Move screen init into crt0.s 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
74a904be54 Hello world example for the Supervision 2019-10-09 17:01:02 +02:00
Stefan
96547d1dd4 Fix colors for #948 2019-10-09 06:15:38 -04:00
Fabrizio Caruso
9bd92178b6 Fix Gamate RVS 2019-10-04 10:22:25 +02:00
Greg King
2e5fbe89cd Made the "none" CPU allow all address sizes. 2019-10-02 10:09:48 -04:00
Greg King
9dfc8f84bc Fixed cgetc().
The GETIN function doesn't protect CPU registers.
2019-10-01 05:30:36 -04:00
Greg King
3cece61525 Added character codes to change between the two CBM fonts. 2019-10-01 04:16:44 -04:00
Greg King
d7ec817f0a Fixed a typo in the cx16 document. 2019-09-30 10:41:21 -04:00
Greg King
2546c6ba1c Put the C64 code into cx16/_scrsize.s.
(I forgot that SCREEN is an official jumptable function.
2019-09-28 01:38:16 -04:00
Greg King
6cae84a25d Updated the cx16 start-up to the emulator's release 32.
Made the Kernal ROM be visible when programs start.
2019-09-28 00:54:27 -04:00
Greg King
18afc7c703 Created a target and a library for the Commander X16 prototype computer. 2019-09-27 03:38:51 -04:00
Greg King
0896deedef Added a .ORG keyword to ca65 structs/unions.
Allow 24-bit numbers as operands in ca65 structs/unions.
2019-09-11 19:00:08 -04:00
Oliver Schmidt
3b128ba59f Use MACHID to check for realtime clock.
There's no need to do guesswork to know if a realtime clock is present/active.
2019-09-10 09:49:06 +02:00
Greg King
c53b167307 Added a charmap header that converts no character encodings.
It can be used in programs, on non-ASCII machines, that need to send/write ASCII strings.
2019-09-07 23:02:31 -04:00
Jeremy Chadwick
4e3abf417f Use the word 'macros' universally (not macroes) 2019-08-27 08:34:35 +02:00
Jeremy Chadwick
57b997355f Grammatical modifications 2019-08-26 09:32:14 -04:00
Jeremy Chadwick
cc373cc41d doc: clarify need for .IMPORT on some special symbols 2019-08-26 09:32:14 -04:00
jede
3d63a8bb62 Cleaning 2019-07-31 18:07:28 +02:00
jede
3b07b8b8e3 Add cclear and cclearxy 2019-07-31 18:07:28 +02:00
Greg King
a0db846a97 Allowed old-style (K and R) function declarations to be fastcall.
That lets them match old-style definitions.  It avoids "Type conflict" error messages.  It allows shorter function calls.

Fixed the types of some variables in "test/ref/otccex.c".  It avoids crashes on 64-bit Windows (32-bit Windows with 64-bit pointers).
2019-07-22 09:26:23 -04:00
jede
cceffbdb8c Fix bug $FF 2019-07-21 14:11:51 -04:00
jede
e7bb0aad19 Fix comment and gotox force colour change 2019-07-21 14:11:51 -04:00
jede
996537282c Cleaning import variables 2019-07-21 14:11:51 -04:00
jede
848df36f6b Optimize Clrscr 2019-07-21 14:11:51 -04:00
jede
0fe98a7ca8 Fix bgcolor and textcolor must return last color, jmp remove. 2019-07-21 14:11:51 -04:00
jede
f9e13abc11 jmp instead of jsr 2019-07-21 14:11:51 -04:00
jede
ede64f68a9 Fix bug with bgcolor and textcolor 2019-07-21 14:11:51 -04:00
jede
6f7f6b5119 Fix label, optimize code 2019-07-21 14:11:51 -04:00
jede
a0a6537bda Fix typo and optimize 2019-07-21 14:11:51 -04:00
jede
28eba8bff9 fix import 2019-07-21 14:11:51 -04:00
jede
7767a0e88e fix typo 2019-07-21 14:11:51 -04:00
jede
3d5811d8f5 Fix gotoy changecolor 2019-07-21 14:11:51 -04:00
jede
7f9e73a1ce Add textcolor and bgcolor.s 2019-07-21 14:11:51 -04:00
jede
14ac1a7ff6 Fix bug : gotoxy does not working because Y does not update the adress on the screen 2019-07-21 14:11:51 -04:00
Lauri Kasanen
5cbbb4597f Document binary literals 2019-07-20 17:21:42 +02:00
Lauri Kasanen
1bfdce55ed binlit: Add a few random leading zeros 2019-07-20 17:21:42 +02:00
Lauri Kasanen
925ea9d544 cc65: Add support for binary literals
Binary literals, 0b001, are a GCC extension in C and a C++14 feature.
2019-07-20 17:21:42 +02:00
jede
76fe064e03 Add XSCROH & XSCROB value 2019-07-20 17:10:00 +02:00
jede
99de3cb6ea Add page 0 variables from Telemon 2.4 2019-07-20 17:10:00 +02:00
Greg King
88c6dd2da8 Changed empty parameter lists into (void) lists on functions with asm() statements.
The fix avoids any possible problems with how cc65 will handle old-style (K & R) function declarations, in the future.
2019-07-16 13:16:02 -04:00
Björn Esser
2f3955dbc7 src/Makefile: Simplify BUILD_ID logic. 2019-07-15 12:42:48 +02:00
Oliver Schmidt
9be25dab9c Minor URL update. 2019-07-15 12:29:25 +02:00
Greg King
28584b31f1 Made the ld65 configure file's segment offset attribute accept zero as a value.
Expressions are allowed as values.  Therefore, zero might be set explicitly by some conditions.
2019-06-30 22:44:10 -04:00
Björn Esser
93b6efcb2f zlib: Use correct (un)signedness of char in prototypes and functions.
Also ensure we are using the same constness qualifiers.
2019-06-19 19:01:30 +02:00
Björn Esser
e0ac9d5d8e util/zlib/deflater: Fix several compiler warnings. 2019-06-19 19:01:30 +02:00
Björn Esser
9faca05e6a test/ref/otccex: Fix ramdomly occurring segfault.
The variables named tab and p are used in the context of pointers
and thus must be declared as such.  Determining the purpose they
serve, using char over int seems more feasible here as well.
2019-06-09 20:26:12 +02:00
Björn Esser
83e0c70de5 Replace GIT_SHA with a more versatile BUILD_ID definition.
When compiling cc65, it will by default place the git hash (if available) of
the checked out commit in the version string.  This isn't useful when building
a package for a Linux distribution, since there either won't be an upstream
git hash if there is one at all.

Thus we replace GIT_SHA with a more versatile BUILD_ID, which can be defined
to any arbitrary string.  When building, its contents will be appended to the
version string instead of the git hash.

If BUILD_ID is not defined by the user the behaviour will be exactly the same
as before.  That means BUILD_ID gets automatically defined to Git <GIT_SHA>,
if it can be determined from a checkout.
2019-06-09 20:17:15 +02:00
Oliver Schmidt
e34ee32973 Reduced shadow for h2 to improve readability. 2019-06-04 11:46:15 +02:00
bbbradsmith
5269552346 sim65 common define for paravirt hooks base location
allows the loaded binary to take up as much space as possible
restored some documentation of the hooks but without reference to specific location
2019-05-31 10:40:04 +02:00
Oliver Schmidt
6efb71bea7 Rearranged paravirt function vector.
- exit right below 6502 vectors.
- keep exit addr stable as it may be called from asm.
2019-05-30 00:10:17 +02:00
Oliver Schmidt
c6bbea0bb0 Renamed program start label. 2019-05-30 00:06:31 +02:00
bbbradsmith
7e4c4ee53e sim65/main.c spaces were requested 2019-05-29 22:56:51 +02:00
bbbradsmith
9fcd91ebe9 sim65 header comment fix 2019-05-29 22:56:51 +02:00
bbbradsmith
3612edf4fa sim65.sgml typo: bold is bf not ** 2019-05-29 22:56:51 +02:00
bbbradsmith
fb7d4acd5c versionable header for sim65
load and run address now configured from header
fix error codes not to conflict with test
fix test/misc/endless.c which is supposed to fail if an endless loop does not occur
2019-05-29 22:56:51 +02:00
bbbradsmith
07ca772932 adjust literal width to match variable type 2019-05-29 22:56:51 +02:00
bbbradsmith
2f3cae0d2e movable sp for sim65 2019-05-29 22:56:51 +02:00
Brad Smith
38d2eb7a0e cc65.sgml incorrectly closed tt 2019-05-29 22:41:24 +02:00
Brad Smith
26d436b90d separating standard file I/O from low-level paravirtualization 2019-05-27 21:09:19 +02:00
Brad Smith
53bfd2e8cd added name 2019-05-27 21:09:19 +02:00
bbbradsmith
4acf011fa4 noting that standard file functions work as well
correcting target name
2019-05-27 21:09:19 +02:00
Brad Smith
42beb29f72 sim65.sgml syntax error unclosed tt 2019-05-27 21:09:19 +02:00
bbbradsmith
17505e2173 sim65.sgml noting sim65c02 target as well 2019-05-27 21:09:19 +02:00
bbbradsmith
69c7acb3bc some documentation for sim65 2019-05-27 21:09:19 +02:00
bbbradsmith
4642421da4 are more specific version of the comparison removal #895 2019-05-27 10:03:25 +02:00
bbbradsmith
7a863e5cda bug895 test: more specific description comment 2019-05-27 10:03:25 +02:00
bbbradsmith
df90a005cd bug895 testing against more permutations of comparison 2019-05-27 10:03:25 +02:00
bbbradsmith
1461ad6fcc unit test to catch regression of bug #895 2019-05-27 10:03:25 +02:00
bbbradsmith
3a3107b244 Disabling too-aggressive optimization in OptCmp8
Generates incorrect code for some 16-bit cases. See: #895
2019-05-27 10:03:25 +02:00
Richard Halkyard
448aa35f50 Fix realloc() bug in gr65
The pointer to the input buffer was not being updated after a call to
realloc(), causing the program to crash if realloc() moved the buffer.
2019-05-22 11:33:43 +02:00
Greg King
644d623d31 Reset the name of the "current bss segment" before writing bss variables into the output Assembly file.
Then, cc65 can notice a single "#pragma bss-name()" at the beginning of the variables list.
2019-05-18 12:16:52 -04:00
Brad Smith
d56e3adf2f CC65 -> cc65 2019-05-15 18:19:45 +02:00
Brad Smith
0d000bb629 Document --debug-opt-output and --debug-opt 2019-05-15 18:19:45 +02:00
Lauri Kasanen
f16ce22281 doc: Rename aux member to data 2019-05-15 11:17:45 +02:00
Lauri Kasanen
c2f3421dee Document using inline asm with SoA, structs with array members 2019-05-15 11:17:45 +02:00
bbbradsmith
9299e550a5 fix NearAddr case in comment 2019-05-11 12:32:44 +02:00
bbbradsmith
7d14cff6bb o65.c: missed a link time resolution of EXPR_NEARADDR 2019-05-11 12:32:44 +02:00
bbbradsmith
10cefdb456 move EXPR_NEARADDR to end of enum list to avoid invalidation of existing object binaries? 2019-05-11 12:32:44 +02:00
bbbradsmith
ac2ecb0b2c 65816 now generate EXPR_NEARADDR instead of EXPR_WORD0 for default assumed address mode, which will be validated by the linker's range check rather than blindly truncated. Assuming the assembler correctly validated this, the linker is allowed to truncate. 2019-05-11 12:32:44 +02:00
Oliver Schmidt
a01c4231f2
Fixed _textcolor definition.
The _textcolor() macro doesn't just turn on the macro optimization. It defines the return value of textcolor() - and that is supposed to be a COLOR_... value.
2019-05-08 10:22:12 +02:00
Christian Groessler
a24e3d9e72 ld65.sgml: document '--allow-multiple-definition' switch 2019-05-01 10:57:48 +02:00
Christian Groessler
dd53c2ddc3 src/ld65/main.c: fix copy'n'paste error in comment 2019-05-01 10:57:48 +02:00
Christian Groessler
5a05acf936 ld65: implement '--allow-multiple-definition' command line parameter 2019-05-01 10:57:48 +02:00
Christian Groessler
c248c14075 src/ld65/exports.c: Issue an error instead of a warning for duplicate global symbols. 2019-05-01 10:57:48 +02:00
Brad Smith
1a5fa6dc51 goto.c warning fix for implicit truncation 2019-05-01 10:53:41 +02:00
Christian Groessler
392e6e10fc again, some TABs slipped into the code... 2019-04-30 18:21:13 +02:00
Oliver Schmidt
7b234d4497
Adjusted doc to code.
The requirement in question was lifted with 6ead4abf24 back in 2011.
2019-04-30 17:55:26 +02:00
IrgendwerA8
37f80534c9 Fix for #830 supplied by UvB 2019-04-25 15:19:53 +02:00
Christian Groessler
14d8f3d81d cfg/atari-xex.cfg: fix typo in comment 2019-04-24 13:17:11 +02:00
Greg King
214c90f957 Made the code that logs indirect-goto referals be a little more efficient. 2019-04-23 19:12:02 -04:00
Lauri Kasanen
55ce618bf2 Document computed gotos 2019-04-21 12:46:03 -04:00
Lauri Kasanen
f328481a48 Replace hard returns with an "else", add an error for non-IDENT tokens, and test for static 2019-04-21 12:46:03 -04:00
Lauri Kasanen
60d8559372 Return after errors, move left bracket consumption down 2019-04-21 12:46:03 -04:00
Lauri Kasanen
654d972288 C90 param, void 2019-04-21 12:46:03 -04:00
Lauri Kasanen
a9cbb5305c Fix missing spaces 2019-04-21 12:46:03 -04:00
Lauri Kasanen
304473d857 Adjustment for '816 2019-04-21 12:46:03 -04:00
Lauri Kasanen
3b3b16ee9c Add support for computed gotos
This is a GCC extension that allows C to use fast jump tables.
2019-04-21 12:46:03 -04:00
Lauri Kasanen
c2220f3c30 Add a goto indirect jump from pointer 2019-04-21 12:46:03 -04:00
Lauri Kasanen
37f00e6644 Export the label symbol table 2019-04-21 12:46:03 -04:00
Lauri Kasanen
2af76c7cff Only for jumps, the lib uses named asm labels in branches 2019-04-21 12:46:03 -04:00
Lauri Kasanen
c3d809b129 Fix jmp-callax.c bug 2019-04-21 12:46:03 -04:00
Lauri Kasanen
f29220be1b Add test showing optimizer failure, OptUnusedLoads removes needed loads 2019-04-21 12:46:03 -04:00
Oliver Schmidt
ac0b452834 Added '_' prefix to sin and cos.
Users complained that otherwise the names might clash with their functions.
2019-04-13 11:25:54 +02:00
Christian Groessler
cb7882a202 atari5200.sgml: small fix for last change 2019-04-13 11:07:06 +02:00
Christian Groessler
03311e7268 atari5200: update docs for recent conio changes
also renames libsrc/atari5200/extra/conioscreen_20x12.s to
libsrc/atari5200/extra/conioscreen-20x12.s to be in line with
other optional link modules
2019-04-13 11:07:06 +02:00
Christian Groessler
78daf84f12 atari5200: name conio constructor 'initconio' 2019-04-12 12:49:38 +02:00
Christian Groessler
34942a2da5 atari5200: testcode/lib/atari5200/hello.c: adapt to changed COLOR_xxx defines 2019-04-12 12:49:38 +02:00
Christian Groessler
8590de5cf3 Revert "atari5200: fix COLOR defines' names"
This reverts commit 87e653f47b.
2019-04-12 12:49:38 +02:00
Christian Groessler
e1e6bec9ff atari5200: changes from discussions in #870
- rename screen_setup to initconio
- use Greg King's version of bgcolor()
2019-04-12 12:49:38 +02:00
Christian Groessler
d7eecb57f8 atari5200: get rid of conio_colors table
use system color variables instead; improve testcode/lib/atari5200/hello.c
test program
2019-04-12 12:49:38 +02:00
Christian Groessler
dfb7c0f24d atari5200: fix COLOR defines' names
COLOR_RED -> COLOR_LIGHTRED and COLOR_GREEN -> COLOR_LIGHTGREEN
2019-04-12 12:49:38 +02:00
Christian Groessler
be6bba66a9 atari5200: conio now uses just four colors altogether
See discussion in PR #870.
2019-04-12 12:49:38 +02:00
Christian Groessler
79b9a8d2df atari5200: add screensize function 2019-04-12 12:49:38 +02:00
Christian Groessler
db01036e2e atari5200: add alternative conio screen (20x12 resolution) 2019-04-12 12:49:38 +02:00
Christian Groessler
ec5e38617a atari5200: implement bgcolor() and textcolor()
Includes some other small fixes/cleanups.
2019-04-12 12:49:38 +02:00
Christian Groessler
edd596b2a4 atari: split color.s into bordercolor.s and bgcolor.s 2019-04-12 12:49:38 +02:00
Oliver Schmidt
0576fe51e7 Minor clarification. 2019-04-04 17:13:09 +02:00
Oliver Schmidt
5daed49e97 Fixed typo. 2019-04-04 16:38:40 +02:00
Oliver Schmidt
fc6a63a15e Avoid unintended file "shadowing".
3d8c3a4948 caused an unintended "shadowing" of files in /libsrc/runtime by files in /libsrc/common. Therefore the files in question are renamed (again) in /libsrc/common to make the files in /libsrc/runtime "visible" again.
2019-04-04 09:16:59 +02:00
IrgendwerA8
dcbe03f23b Adjusted to the current multiline-comment style. 2019-04-02 16:34:22 +02:00
IrgendwerA8
1530020a1f Fix for multiplication optimization issue #367 2019-04-02 16:34:22 +02:00
Steven Hugg
ae261e91f2 Code cleanup per code review 2019-03-31 22:33:22 -04:00
Steven Hugg
9faaa0689b cleaned up code per review 2019-03-31 22:33:22 -04:00
Steven Hugg
a71f764c33 fixed optimization bug where array index is 16-bit, e.g. arr16[i & 0x7f7f] 2019-03-31 22:33:22 -04:00
Steven Hugg
dca99d59e5 rearranged order of new optimizations to better handle -Oi flag 2019-03-31 22:33:22 -04:00
Steven Hugg
5d274e4bc5 added optimization for indexed 16-bit array load of form (array[i & 0x7f]) 2019-03-31 22:33:22 -04:00
Steven Hugg
ffc118cd94 added optimization for indexed pointer load of a constant, e.g.: y = ((unsigned char*)0x100)[i] 2019-03-31 22:33:22 -04:00
Olli Savia
f95481fabf Fixed gcc compiler warning (#867)
* Changed spelling FALLTHRU -> FALLTHROUGH
2019-03-30 16:09:16 -04:00
greg-king5
60e40c854c
Removed a "cc65_" prefix.
This change is needed because of commit 3d8c3a4948.
2019-03-30 11:06:09 -04:00
IrgendwerA8
df80d071e8 Added space after function name. 2019-03-29 22:53:04 +01:00
IrgendwerA8
3d8c3a4948 Code review adaptations, removed "cc65_" prefix from functions 2019-03-29 22:53:04 +01:00
IrgendwerA8
435f417c64 Moved documentation to funcref. 2019-03-29 22:53:04 +01:00
IrgendwerA8
db8bd84a82 Changes due to code review. 2019-03-29 22:53:04 +01:00
IrgendwerA8
399250a105 Optimized mul20 & mul40 and extracted to new library. 2019-03-29 22:53:04 +01:00
greg-king5
fbf302e6cd
Merge pull request #863 from Compyx/master
Removed trailing spaces from CBM-related asm files.
2019-03-24 21:36:41 -04:00
Bas Wassink
9e0ab14cfe Restore src/cc65/locals.c:278 to its orignal state 2019-03-24 23:05:11 +01:00
Bas Wassink
41e449b306 Forgot a cast, sorry 2019-03-24 21:41:00 +01:00
Bas Wassink
56c96e8ab0 Revert accidentally committed changes for a future PR 2019-03-24 21:15:34 +01:00
Bas Wassink
96d0b00a76 Merge https://github.com/cc65/cc65
Pull to fix extra changes in PR #863
2019-03-24 20:49:53 +01:00
Greg King
2cd4b5109a Fixed LinuxDoc Tools issues in some verbatim blocks in the Atari document. 2019-03-24 14:39:04 -04:00
Daniel Serpell
f94a125f30 Adds address after JVB instruction in the display list example. 2019-03-23 18:38:26 +01:00
Bas Wassink
0614078198 Fix 32/64-bit int/pointer casts 2019-03-23 01:14:04 +01:00
Bas Wassink
2eac69a943 Remove trailings spaces from CBM-related asm files 2019-03-22 22:54:05 +01:00
IrgendwerA8
5c8854fff6 Changed enum for FP-register index. 2019-03-16 20:37:42 +01:00
IrgendwerA8
bcbcbbd9c0 AtariOS: Fix for FPIDX enum 2019-03-13 08:19:04 +01:00
Greg King
2617e9a3c0 Added a C header that translates from the source file's encoding to PetSCII.
It can be used to undo what "cbm_screen_charmap.h" does.  Together, those headers let you mix screen-code and PetSCII string and character literals in a C source file's Assembly output.
2019-03-11 09:00:49 -04:00
Christian Groessler
fc7e79d2cc Merge remote-tracking branch 'irgendwer/AtariOS_Structure' into master 2019-03-11 12:23:09 +01:00
IrgendwerA8
203f4c80d4 Code review changes and improved formatting. 2019-03-09 21:40:57 +01:00
IrgendwerA8
1359ad793d Atari OS: Reestablished DCB structure, fixed union span and timer2. 2019-03-08 11:48:37 +01:00
Greg King
2362db22f7 Renamed a C header.
All of Commodore's 8-bit computer models use the same screen-codes.
2019-03-05 21:20:05 -05:00
Greg King
7e298e347d Fixed the CBM screen-code C header.
Changed the number literals from Assembly format to C format.  Swapped the (upper-/lower-case) mappings of letters because the header converts from ASCII, not PetSCII.
2019-03-05 21:20:05 -05:00
Christian Groessler
3627452249
Merge pull request #852 from IrgendwerA8/AtariOS_Structure
Access Atari OS variables by structure. seems good. Thanks!
2019-03-05 22:21:15 +01:00
IrgendwerA8
3d9ac21b80 Added missing pointer star for Basic structure. 2019-03-05 00:26:14 +01:00
IrgendwerA8
e1a4910580 Code review changes and build fix. 2019-03-04 23:32:56 +01:00
Greg King
13fa31a3bc Refactorred a CBM screen-code macro, so that we can use it as an operand.
For example: lda #scrbyte 'B'
2019-03-04 10:23:47 -05:00
IrgendwerA8
8ead5f2f5a Access Atari OS variables by structure. 2019-03-03 22:50:57 +01:00
IrgendwerA8
cc6559c3f6 Minor math optimizations 2019-02-28 19:48:29 +01:00
Oliver Schmidt
0ea78be056
Merge pull request #849 from polluks/patch-4
Update cbm510.sgml
2019-02-28 08:35:35 +01:00
Stefan
01489f9ffc
Update cbm510.sgml
There is just one CIA but it's not called "CIA1"...
2019-02-26 18:38:05 +01:00
Christian Groessler
de519b969a Merge remote-tracking branch 'dmsc/xex-c' into upstream-master 2019-02-23 01:14:54 +01:00
Daniel Serpell
824e30934e Change XEX configuration file names to better reflect original names.
Also, updates documentation with the new files.
2019-02-21 19:00:17 -03:00
Daniel Serpell
0e33a653d7 Add sample linker configurations for Atari binary output in C. 2019-02-21 19:00:17 -03:00
Daniel Serpell
258ba05660 Separate header and trailers of Atari system_check chunk.
This allows to omit the headers and trailers if needed.
2019-02-21 19:00:17 -03:00
Daniel Serpell
61463e1a70 Don't write INITAD if the memory area is empty. 2019-02-21 19:00:17 -03:00
Daniel Serpell
b03ae76b54 Add support for INITAD to the Atari binary format. 2019-02-21 19:00:03 -03:00
Christian Groessler
b6f22d332b un-remove TABs in doc/using-make.sgml 2019-02-21 13:45:51 +01:00
Bill Kendrick
417ef278a3 Move Atari-specific PIA reg vals to atari.h
PIA is also used in the Commodore PET, and for different
purposes (see http://www.6502.org/users/andre/petindex/progmod.html#pia1),
so extracted Atari-specific register #defines and placed them in atari.h.
2019-02-17 23:23:30 +01:00
Christian Groessler
7445550831 remote TABs in doc/ and test/ 2019-02-12 22:50:49 +01:00
Oliver Schmidt
b9ea77b185
Merge pull request #834 from jedeoric/master
Update telestrat target doc, add tgi_clear support for telestrat target, stratsed & telemon 2.4 vars added
2019-02-12 17:51:24 +01:00
Oliver Schmidt
10a31d006b Add translation from PETSCII to screen codes. 2019-02-12 17:47:17 +01:00
Stefan
08ec9fc392 Fixed 65C02 timing again. 2019-02-12 11:15:47 -05:00
Oliver Schmidt
3915323528
Merge pull request #843 from polluks/patch-4
Fixed 65C02 timing.
2019-02-07 12:29:00 +01:00
Stefan
50fd96bbab
Fixed 65C02 timing. 2019-02-07 12:19:49 +01:00
Christian Groessler
58484449b4 remove TABs 2019-02-05 23:27:52 +01:00
jede
a4a968dfd1 Fix typo 2019-02-04 20:42:03 +01:00
Daniel Serpell
2190703a57 Adds test code for the Atari (xex) linker file format. 2019-02-03 18:23:11 -03:00
Daniel Serpell
e767c8990d Adds documentation and a sample config file for the ATARI format. 2019-02-03 18:16:46 -03:00
Daniel Serpell
2aa5b4cafe Rewrites ATARI EXE segment writing to optimally write segment sizes.
We now expand segments as needed to write a minimal set of headers.
2019-02-03 18:13:35 -03:00
Daniel Serpell
4e51fcbdd4 Don't support overwrite segments.
This simplifies the memory area size calculations.
2019-02-03 18:11:53 -03:00
Daniel Serpell
63d9b492b7 Only write full ATARI XEX header in the first chunk. 2019-02-03 18:09:51 -03:00
Daniel Serpell
8e3fe2ef86 Remove unused function. 2019-02-03 18:05:15 -03:00
Daniel Serpell
0e947d594f Add support for Atari XEX file format to LD65 2019-02-03 18:04:46 -03:00
Greg King
c37582bb00 Fixed a note in "ca65.sgml".
String escapes are converted to a target platform's encoding.
2019-01-30 12:18:32 -05:00
jede
620359fa2e add more clearly what rom stratoric contains 2019-01-30 13:28:50 +01:00
Christian Groessler
055c294ac0 Use Timer2 for mouse polling.
This follows a suggestion by Sijmen Schouten in issue #818.
Platoterm64 now works with mouse at 1200 baud.

Bump MOUSE_API_VERSION in asminc/mouse-kernel.inc.

Fix typo in testcode/lib/mouse-test.c.
2019-01-29 22:00:55 +01:00
jede
bade791570 fix uppercase 2019-01-29 20:46:16 +01:00
jede
a3d876b737 fix comma in telestrat.sgml 2019-01-26 12:01:48 +01:00
jede
dfa91106fd fix doc/telestrat.sgml 2019-01-26 12:00:13 +01:00
jede
b360a128f9 fix uppercase command 2019-01-26 11:39:24 +01:00
jedeoric
63e64f801a
Merge branch 'master' into master 2019-01-25 10:15:21 +01:00
jede
2848ddf8ab Telemon variables added 2019-01-24 23:07:49 +01:00
Piotr Fusik
7a034f505b Comment the ATASCII to screen code conversion. 2019-01-23 19:02:26 +01:00
Piotr Fusik
1781a5cfe7 Optimize the conversions from Atari ASCII to screen codes. 2019-01-23 00:05:31 +01:00
Oliver Schmidt
cd72f816d3
Merge pull request #829 from inexorabletash/string-escapes
ca65: Add string_escapes feature. Resolves #535
2019-01-20 21:58:06 +01:00
Bill Kendrick
9a83284b7b Cleaned up _pia.h register stuff a bit
Most documentation say that most of the bits are normally set to 1 or 0,
so just mentioning that in the comments.

A.N.A.L.O.G. issue 59 (April 1988) "Bits & Pieces" column, "Atari Zucchini"
(https://www.atarimagazines.com/analog/issue59/bits_pieces.php) implies
that they are used for specific things, but it's not clear enough to be
useful (or specifically states "Too complex and not pertinent").

This is probably sufficient for most purposes; if any PIA / PACTL/PBCTL
experts pop up, they can tell us exactly how those 4 bits can be utilized.
2019-01-17 23:53:53 -08:00
Bill Kendrick
af8eb57f63 Atari colors into _gtia.h; NMIRES/NMIST as union
Use a C "union" to give both read (NMIST) and write (NMIRES) labels
to their shared register in ANTIC. (h/t @groessler).

Consolodate duplicated color definitions (HUE_..., COLOR_... and TGI_COLOR_...;
and the "_gtia_mkcolor()" macro), found in both "atari.h" and "atari5200.h",
moving it to "_gtia.h", which they both share (and which makes the most sense).
2019-01-17 22:44:25 -08:00
Bill Kendrick
32525e0ddb atari.h: Shadow registers for hardware registers 2019-01-17 00:23:04 -08:00
Bill Kendrick
93a13315de Comment adjustments; removed surperfluous keycodes
Cleaned up comments in Atari 8-bit headers.
Internal keycodes (POKEY's KBCODE) were already #defined in atari.h,
so didn't need a whole new set in _pokey.h.
2019-01-16 23:29:41 -08:00
Bill Kendrick
4b61c54092 Relocate register values outside structs, + more
Relocated register #define'd values outside of the structs,
improved comment format, expanded & corrected some things.

h/t Trevin Beattie (https://user.xmission.com/~trevin/) for the PIA
register descriptions.
2019-01-15 01:24:12 -08:00
Bill Kendrick
d52af69d69 Adjustments per most feedback on cc65 PR 831
(I appreciate the feedback!)
2019-01-14 20:47:05 -08:00
Bill Kendrick
5ee3c88017 Some PIA register #defines
Some register #defines for PIA.

(Some may be too Atari-centric -- I know PIA chip was used by PET &
perhaps other platforms supported by cc65.  If so, perhaps we can
define them elsewhere.  Not sure whether they'd be the same for 5200;
I admit I know zilch about that system except that it's _more or less_
an Atari 400)
2019-01-13 21:31:18 -08:00
Bill Kendrick
3783010091 POKEY: Add register #defines & internal kybd codes
Add #defines for certain registers' values.
Also add #defines for internal keyboard codes (unrelated to ATASCII;
e.g. [Q] = 47, [W] = 46, [Shift] adds 64, etc), as seen in KBCODE.
2019-01-13 20:32:55 -08:00
Bill Kendrick
d371d1bd51
Note about hues varying depending on environment
There aren't really standard color names (e.g., Compute!'s Mapping the Atari and First Book of Atari Graphics have different names), and exact colors shown depend on the system & device, anyway. Added a note.
2019-01-13 01:59:41 -08:00
Bill Kendrick
10f44c18a3
Tweaks to description of ANTIC chip in _antic.h
Tweak to comments at the top
2019-01-13 01:58:10 -08:00
Bill Kendrick
95b791bf0e
Added #defines for GTIA register values 2019-01-13 01:57:21 -08:00
Bill Kendrick
ab31b3edfe
Add more register #defines to ANTIC header file
* DMACTL - playfield size, DMA access, PMG resolution
 * CHACTL - inverted text, inverse effects
 * NMIEN

Also, added #define equivalents for Display List mode line instructions
based on Atari 8-bit OS (aka Atari BASIC "GRAPHICS" command) values
(e.g., "DL_GRAPHICS0" == "DL_CHR40x8x1").

Added some more documentation in the comments.

Added macros with assembly language for the start/end of Display List
Interrupt (DLI) functions.
2019-01-13 00:31:31 -08:00
Greg King
a6b04f6e97 Changed most "backticks" (grave accents) into apostrophes.
Quotations that are embraced by tick marks now look better, in most fonts.
2019-01-05 14:57:12 -05:00
Joshua Bell
c8bf652982 ca65: Add string_escapes feature. Resolves #535 2019-01-05 11:29:54 -08:00
Greg King
5ac11b5e88 Added an error message, in case there's a typo in the definitions of long command-line options. 2019-01-04 03:35:49 -05:00
Greg King
cd6e167982 Fixed a duplicate-label test.
Don't call strcmp() if either argument is NULL.
2019-01-04 02:29:17 -05:00
Greg King
2959ade6e6 Added, to Plus4 and GEOS linker configure files, the ability to set the start and end addresses of the program region. 2019-01-03 10:49:56 -05:00
Oliver Schmidt
a4591138ec
Merge pull request #828 from Marrin/marrin-docfix
Fixed documented return type.
2019-01-02 21:17:55 +01:00
Marrin
003d6542e4 Fixed documented return type. 2019-01-02 12:06:01 +01:00
Scott Hutter
59ab140dc9 fix for err blank line removal 2018-12-30 18:57:46 +01:00
Scott Hutter
fa27c9dfc6 Moved contents of SetNewMode doc 2018-12-30 18:57:46 +01:00
Scott Hutter
94e623165d removed fastcall from SetNewMode 2018-12-30 18:57:46 +01:00
Scott Hutter
74f622d9c6 corrected text formatting 2018-12-30 18:57:46 +01:00
Scott Hutter
a6725edb15 moved to better folder location 2018-12-30 18:57:46 +01:00
Scott Hutter
9160b8ddc2 Issue 814 2018-12-30 18:57:46 +01:00
Scott Hutter
0012b6d811 SetNewMode() documentation = issue #814 2018-12-30 18:57:46 +01:00
Scott Hutter
2f6f468aad Added SetNewMode() to geoslib - #814 2018-12-30 18:57:46 +01:00
Paul Gardner-Stephen
1b46dfe820 change reference to $0200FF to $0200xx 2018-12-30 03:49:26 -05:00
Paul Gardner-Stephen
576d64da38 remove redundant line 2018-12-30 03:49:26 -05:00
Paul Gardner-Stephen
837b9b3c2c use pre-existing ZP storage. Make 32-bit pointer value loading more self-evident 2018-12-30 03:49:26 -05:00
Paul Gardner-Stephen
19ca1f6b48 add support for detecting 45GS02 2018-12-30 03:49:26 -05:00
Marc Rintsch
80a43d732d Added missing external declaration of c64_65816_emd. 2018-12-21 09:51:27 +01:00
jede
d707ef4c72 Now tgi_clear() works 2018-12-10 21:48:09 +01:00
Oliver Schmidt
180bb0823a Fixed typo. 2018-12-03 12:52:00 +01:00
Olli Savia
b7a3abad62 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
b6529225e9 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
b269b3f5b2 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
b9054ec9a7 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
4304f11549 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
7147e780e6 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
5901ea80a4 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
ad0b0982d0 Added SER_ prefix 2018-11-26 22:14:31 +01:00
Olli Savia
7b4807a8f7 Changed prefix SWL_ to SER_ 2018-11-26 22:14:31 +01:00
Olli Savia
aeff90ca90 Updated to use cbm_kernal.inc. Whitespace cleanups 2018-11-26 22:14:31 +01:00
Olli Savia
e69bc65cf1 Moved kernal entries to cbm_kernal.inc 2018-11-26 22:14:31 +01:00
Oliver Schmidt
01857cd4de Updated Visual Studio solution files to VS 2017. 2018-11-24 14:10:58 +01:00
Christian Groessler
462d8096c0 atari.sgml: use consistent naming for realtime clock. 2018-11-16 16:13:43 +01:00
Christian Groessler
9405323815 Some documentation fixes
- gamate.sgml: remove empty section "Hardware access"
- telestrat.sgml: remove wrong "<descrip>" tags
2018-11-16 16:13:43 +01:00
Christian Groessler
b8bd075e5e atari.sgml: fix typo 2018-11-16 16:13:43 +01:00
Christian Groessler
bc6127ffef atari.sgml: Add documentation for Atari clock_... functions implementation. 2018-11-16 16:13:43 +01:00
Oliver Schmidt
ee6b2edd72
Replaced systime() with clock_gettime(). 2018-11-16 12:54:26 +01:00
Oliver Schmidt
3ffefb0f0d
Fixed reference to clock_settime(). 2018-11-16 12:45:45 +01:00
Oliver Schmidt
582aa41f2a Fixed typo. 2018-11-14 18:02:56 +01:00
Oliver Schmidt
4b42d6ad54 Added target docs on the clock_... functions. 2018-11-13 18:33:51 +01:00
Oliver Schmidt
83768a1e8a Fixed two typos. 2018-11-13 18:33:51 +01:00
IrgendwerA8
d0053422e9 Code review aftermath 2: Put defines into parentheses 2018-11-12 14:36:40 +01:00
IrgendwerA8
61a9871c21 Adaptations due to code review. 2018-11-12 14:36:40 +01:00
IrgendwerA8
f86ebbd258 Support for self explanatory KBCODE values 2018-11-12 14:36:40 +01:00
Olli Savia
8b4179d104 Added VIC control register names 2018-11-12 14:14:16 +01:00
jede
b0495cb44a Update doc (how telestrat works), tgi_outtext doc added 2018-11-10 14:54:43 +01:00
jede
2fb4b568e4 Fix duplicated variables 2018-11-10 12:31:15 +01:00
jede
b80e11febc Stratsed vectors added 2018-11-10 12:31:15 +01:00
jede
a6b0b9d850 Some variables from TELEMON 2.4 added 2018-11-10 12:31:15 +01:00
jede
f558d299c4 Fix duplicated variables 2018-11-10 00:54:58 +01:00
jede
be6d155b69 Stratsed vectors added 2018-11-10 00:47:09 +01:00
jede
be2a425eb1 Some variables from TELEMON 2.4 added 2018-11-10 00:10:37 +01:00
IrgendwerA8
923fa8fc93 Saved 2 bytes and fixed error in case of negative result. 2018-11-09 17:27:35 -05:00
Greg King
2acfa5e78f Made div-test.c use doesclrscrafterexit().
It no longer waits for a key tap if it doesn't need to do that.

Also, normalized the source code formatting.
2018-11-09 17:11:03 -05:00
Oliver Schmidt
8fd1db4d78 Added basic docs on the clock_... functions. 2018-11-08 20:43:46 +01:00
Oliver Schmidt
679d0468b9 Updated URLs. 2018-11-06 11:57:57 +01:00
Oliver Schmidt
40f42e977f Adjusted comments to match actual prototypes. 2018-11-06 11:13:23 +01:00
jede
f5534a5432 Add definitions in telestrat.inc (TELEMON 2.4) 2018-11-02 09:57:18 +01:00
Greg King
c2568d804d Fixed the Plus4's serial driver's ACIA address. 2018-10-23 19:52:23 -04:00
Greg King
554448a1f1 .byt "" emits no data; avoid a ca65 crash.
Fixes #775 on GitHub.
2018-10-20 13:41:52 -04:00
jede
385260e453 Fix comments and TELEMON uppercase 2018-10-19 23:43:40 +02:00
jede
a22b10e72b Correct grab default value 2018-10-19 23:43:40 +02:00
jede
af7b271f55 update ld65.sgml with telestrat target 2018-10-19 23:43:40 +02:00
jede
5585396532 By default, we get the memory reserved for hires mode 2018-10-19 23:43:40 +02:00
jede
6a18ad5fbf Clean wherey.s 2018-10-19 23:43:40 +02:00
jede
ff182f9498 Cleaning telestrat.cfg (no need to have bashead segment). Some primitives added 2018-10-19 23:43:40 +02:00
jede
ee7514fea2 Remove BASHEAD segment which is not useful 2018-10-19 23:43:40 +02:00
Evgeny Vrublevsky
f73aa2af71 '--no-std-lib' was renamed to '--no-target-lib' 2018-10-19 10:57:10 +02:00
Evgeny Vrublevsky
d4088f9eee Don't output a warning about alignment when section address is defined by START or OFFSET and fits required alignment requirements 2018-10-18 15:37:14 +02:00
Oliver Schmidt
96196f00e9 Adjusted library name. 2018-10-18 13:22:26 +02:00
Evgeny Vrublevsky
8084702a58 Renamed to '--no-std-lib' 2018-10-18 13:08:56 +02:00
Evgeny Vrublevsky
23b5cc870e Renamed to '--no-crt-lib' 2018-10-18 13:08:56 +02:00
Evgeny Vrublevsky
2a9bb0d8de CL65: --no-rtl option for disabling default runtime library 2018-10-18 13:08:56 +02:00
Brad Smith
16aec54276 ca65.sgml fails to document z: a: f: address size override prefixes. 2018-10-18 08:12:55 +02:00
laubzega
5fa79be997 Post-review tweaks. 2018-10-16 09:55:02 +02:00
laubzega
7d9485f6bc Typo 2018-10-16 09:55:02 +02:00
laubzega
cf7f3abadd Even more optimization, cleanup, bugfix, comments. 2018-10-16 09:55:02 +02:00
laubzega
d3665b263e Stack adjustment code optimizations. 2018-10-16 09:55:02 +02:00
laubzega
249248ccc8 Formatting tweaks. 2018-10-16 09:45:30 +02:00
laubzega
6d8c315cdb Testcase added. 2018-10-16 09:45:30 +02:00
laubzega
8eb9f4a8aa Fix for issue #735 2018-10-16 09:45:30 +02:00
Greg King
03e43d1fbf Changed a comment and an error message into more specific text. 2018-10-08 20:39:46 -04:00
laubzega
92defb7a2b Fix crash due to mistaken symbol identity. 2018-10-08 16:27:00 +02:00
greg-king5
4a38b92a4b
Merged pull request #771 from DankRank/master.
da65: properly scan empty strings in info file.
2018-10-08 01:24:04 -04:00
Egor
0149de4da7 da65: properly scan empty strings
Previously, doing something like `LABEL { NAME ""; ADDR $1000; };` would
result in $1000 being labeled as NAME: instead of being unnamed.
2018-10-06 21:55:42 +03:00
Greg King
f11ae87ada Always put goto stack-adjustments in the RODATA segment. 2018-10-02 23:19:38 -04:00
Oliver Schmidt
88d1d20cd0
Minor style adjustment. 2018-10-02 18:53:01 +02:00
laubzega
2bb4abda23 Testcase .ref updated for new warning style. 2018-10-02 18:49:53 +02:00
laubzega
02a914625b Formatting fixes. 2018-10-02 18:49:53 +02:00
laubzega
2ec21c5b7f Fix non-goto jumps (i.e. inline assembly). 2018-10-02 18:49:53 +02:00
laubzega
8845e71161 Another warning. 2018-10-02 18:49:53 +02:00
laubzega
6ad79067ac Fix a warning. 2018-10-02 18:49:53 +02:00
laubzega
c797b3b376 Proper warnings for "risky" gotos. 2018-10-02 18:49:53 +02:00
laubzega
c835f49913 Clean-up 2018-10-02 18:49:53 +02:00
laubzega
4b78d40e97 Added testcase for between-blocks gotos.
Deleted old testcase.
2018-10-02 18:49:53 +02:00
laubzega
2ac2ffcd43 Adjust SP on gotos between blocks with local variables. 2018-10-02 18:49:53 +02:00
laubzega
a48bbc4be0 Switched from warning to error. Tightened the testcase. 2018-10-02 18:49:53 +02:00
Laubzega
7a5acaf39a Missed the comment. 2018-10-02 18:49:53 +02:00
Laubzega
403783b649 Add a testcase for https://github.com/cc65/cc65/pull/757 2018-10-02 18:49:53 +02:00
Laubzega
a4b6bb63c0 Minor changes after review. 2018-10-02 18:49:53 +02:00
Laubzega
f5b3c5351e Fix for variableless main(). 2018-10-02 18:49:53 +02:00
Laubzega
581c46c213 Add checks for risky goto statements. 2018-10-02 18:49:53 +02:00
Christian Groessler
df3c43bede Atari: implement clock_getres() 2018-09-28 09:47:20 +02:00
Christian Groessler
6dc7309e50 Atari: add support for BW-DOS. Initially contributed by Daniel Serpell. 2018-09-27 17:37:59 +02:00
Christian Groessler
fe7845b5f0 clock-test.c: remove "static" optimization 2018-09-25 21:11:05 +02:00
Christian Groessler
1203e9e0c4 clock-test.c: do doesclrscrafterexit() handling the canonical way. 2018-09-25 21:11:05 +02:00
Christian Groessler
b1ca01f720 asminc/atari.inc: remove TABs which slipped in 2018-09-25 21:11:05 +02:00
Christian Groessler
3a2d68fd1f Add testcode/lib/clock-test.c.
A test program for the "clock" functions.
2018-09-25 21:11:05 +02:00
Christian Groessler
9c7cccf3e5 Atari: clock_gettime() and clock_settime() implementations
They are using SpartaDOS-X interfaces and are therefore only working
in this environment.
2018-09-25 21:11:05 +02:00
Christian Groessler
bfba206d16 asminc/atari.inc: add some SpartaDOS-X defines 2018-09-25 21:11:05 +02:00
Christian Groessler
118bc996fb libsrc/atari/getdefdev.s: small comment change 2018-09-20 23:58:23 +02:00
Oliver Schmidt
6cce110345 Adjusted URL to use https (and removed obsolete dates). 2018-09-20 12:45:15 +02:00
Oliver Schmidt
b6e4add9b5
Switch to https links.
Most targets redirected to https anyway.
2018-09-20 12:21:58 +02:00
Oliver Schmidt
aa219d1ec7 The doc now lives in the 'master' branch of the 'doc' project. 2018-09-18 23:39:11 +02:00
Christian Groessler
d52d986aca libsrc/atari/getdefdev.s: small optimization and fix a typo 2018-09-14 16:54:20 +02:00
greg-king5
d8ad89c4b4
Merge pull request #740 from laubzega/master
Add segment type "overwrite".
2018-09-14 00:59:47 -04:00
Christian Groessler
4691974466 Atari: Make a good "default device" on AtariDOS (2.0 and 2.5) and MyDOS.
The default device will be the one the program was loaded from instead of
always D1:.
2018-09-13 22:33:54 +02:00
Laubzega
3bace79604 Fixed reference link. 2018-09-12 23:51:38 -07:00
Laubzega
3432788763 Slight fixes to the documentation. 2018-09-11 22:14:45 -07:00
Christian Groessler
08d164a811 fix comment in last change 2018-09-12 01:20:12 +02:00
Christian Groessler
e4e3dbf756 atarixl: check at startup whether RAM beneath the ROM is in use
If detected, the program refuses to run, preventing a crash.
The check only works with SpartaDOS. I don't have an overview which
DOSes potentially use the RAM under the ROM. Or which other installed
programs might use it.

No additional runtime memory space is consumed, since the change
is in the "system check" load chunk which gets replaced by the
user program during loading.
2018-09-12 01:05:52 +02:00
Laubzega
1646acb26f First cut of "overwrite" segment docs. 2018-09-08 19:20:01 -07:00
Laubzega
d293d766ef New segment type renamed to "overwrite". 2018-09-08 19:18:41 -07:00
Oliver Schmidt
c7a40db1b7 Added hint random number generator hint. 2018-09-08 23:59:39 +02:00
Oliver Schmidt
a9a102b0e8 Protect random counter against ProDOS.
Although documented nowhere (!!!) ProDOS trashes the random counter locations $4E/$4F. Is discovered this because my TCP connections didn't have random local ports.

It's a really funny coincidence that David Finnigan discovered only 3 years ago the very same issue because of the very same reason: https://groups.google.com/forum/#!topic/comp.sys.apple2.programmer/1ciep_Oetvo
2018-09-08 23:29:59 +02:00
Oliver Schmidt
cddc4da3bb Just removed some trailing spaces. 2018-09-08 23:14:54 +02:00
Oliver Schmidt
73faf60fe0 Support randomize().
In order to have randomize() work as expected (and the Apple II random number generation in general) it is necessary to update the random counter during keypress wait just like the ROM function does.
2018-09-08 18:45:20 +02:00
Christian Groessler
b6ccd4d5d4 Atari: RealDOS adaptations
RealDOS is a SpartaDOS clone. Handle it the same way as SpartaDOS.
2018-09-06 15:55:07 +02:00
Christian Groessler
e9b8f5d814 Atari: Add detection of RealDOS (http://www.realdos.net/realdos.html). 2018-09-06 12:08:50 +02:00
Laubzega
c7bb27bac9 Rename more stuff from "overlay" to "replace". 2018-09-06 00:18:39 -07:00
Christian Groessler
af50b5e516 Atari: atarixl config files already had a LOWBSS segment. 2018-09-05 11:28:15 +02:00
Christian Groessler
a104c289da Atari: atari-cart.cfg: There's a simpler way to discard the contents of the LOWBSS segment.
Thanks to Greg King for the hint.
2018-09-05 11:28:15 +02:00
Christian Groessler
1cc4fa9356 Atari: fix interrupt handling if extended memory is banked in
Extendend memory is mapped over the main memory in the 0x4000..0x7FFF
area. Many DOSes disable interrupts while extended memory is banked in,
but not all (e.g. SpartaDOS-X).
This change modifies the initial interrupt handler to map in main memory
before chaining to the "worker" handlers.
Since the initial interrupt handler uses a data segment to store the
trampoline to chain to the original handler, introduce a new "LOWBSS"
segment to hold this trampoline. Otherwise the trampoline may end up
inside the 0x4000..0x7FFF area.

Add a link time warning if "LOWCODE" segment lays within the extended
memory window.
2018-09-05 11:28:15 +02:00
Christian Groessler
d199ca1460 Atari, Atari5200: disable "attract mode" on mouse or joystick input
Fixes #736.
2018-09-05 11:23:12 +02:00
Laubzega
cd9efd53fe Segment OVERLAY renamed to REPLACE. Bugfix for read-only segments. Formatting. 2018-09-04 00:34:28 -07:00
Oliver Schmidt
70a131e09a Just a minor comment improvement. 2018-09-02 23:07:26 +02:00
Greg King
39694d0aaa Fixed bugs; and, improved the efficiency of some pce library functions. 2018-08-30 11:48:46 +02:00
Greg King
959eff34a3 Fixed and improved some pce comments. 2018-08-30 11:48:46 +02:00
Greg King
2cc822b44e Fixed some mistakes (mostly in the documentation). 2018-08-30 11:48:46 +02:00
Greg King
b5d939c858 Style changes. 2018-08-30 11:48:46 +02:00
Greg King
203200e259 Used I/O mirror locations that avoid (redirected) zero-page accesses. 2018-08-30 11:48:46 +02:00
Greg King
c39d07dd17 Document style clean-up. 2018-08-29 15:43:20 -04:00
Greg King
f2d2f3c193 Moved the NES font into its own object module.
It can be replaced by a custom font when a program is built.
2018-08-29 12:13:58 -04:00
greg-king5
a08192b53e
Merge pull request #706 from xlar54/master
* tgi driver for c128 VIC-II

* Made the VIC-IIe TGI driver put its bitmap behind the ROMs.

* c128-hi.tgi doc
2018-08-29 10:34:05 -04:00
Laubzega
1b0e2cf783 Fix for multiple overlay segments. 2018-08-25 20:21:12 -07:00
Laubzega
8b584cb89f Add segment type "overlay". 2018-08-25 10:18:23 -07:00
Christian Groessler
2d4210b309 Atari5200 joystick driver: enable POT input.
The "Atari800" emulator doesn't emulate this aspect, therefore the problem
wasn't noticed before.
2018-08-24 17:04:31 +02:00
Greg King
31461aaf02 Made cc65's "Illegal escaped character" diagnostic show which code was escaped. 2018-08-21 08:58:21 -04:00
Stefan
f3ef819b43 Update crt0.s 2018-08-21 12:21:56 +02:00
Stefan
3ae5161636 CMOS optimisation 3rd
"The decimal flag D is cleared" [...]
http://shu.emuunlim.com/download/pcedocs/pce_cpu.html
2018-08-21 12:21:56 +02:00
Greg King
a76dcdc419 Removed the compiler's recovery code for illegal escaped characters.
It caused the error cascade that it was supposed to prevent.
2018-08-20 17:51:22 -04:00
Stefan
199226d089 Update irq.s 2018-08-20 22:31:08 +02:00
Stefan
e335b50ed1 CMOS optimisation
The Lynx CPU always cleared the flag.
2018-08-20 22:30:41 +02:00
Patrick Pelletier
357d94e834 seek test: Test some additional error cases. 2018-08-20 22:24:48 +02:00
Patrick Pelletier
0a7702626f seek test: remove trailing newline from filename
Looks like no one ever tried this?  fopen was returning EINVAL because
fgets was leaving a trailing newline at the end of the filename.
(Which is what fgets is documented to do.)
2018-08-20 22:24:48 +02:00
Patrick Pelletier
b37d0a444c lseek: Return EINVAL if new position is less than 0 or greater than 2^24 - 1.
Also, implemented @greg-king5's suggestion to save a byte on error paths.
2018-08-20 22:24:48 +02:00
Patrick Pelletier
59a4ab8778 lseek: Implement additional feedback from PR #723.
* Check CPU_ISET_65SC02 rather than APPLE2ENH.
* Set sreg and sreg+1 to $FF on error, to return -1 as a long.
2018-08-20 22:24:48 +02:00
Patrick Pelletier
8cb930b50e lseek: use STZ for APPLE2ENH
(As suggested in pull request.)
2018-08-20 22:24:48 +02:00
Patrick Pelletier
68a115cacf Fix ftell() on Apple II to return the correct value.
Fixes this issue:
https://github.com/cc65/cc65/issues/722

ftell() returns the value returned by lseek(), and lseek() for the
Apple II wasn't returning a value.
2018-08-20 22:24:48 +02:00
Greg King
9fee605e65 Added more source-code improvements to the conio test program.
Also, made the f6/f5 function keys change the border color instead of the background color.
2018-08-20 14:55:39 -04:00
Oliver Schmidt
13790bdbf0 Improved CONIO test in several ways.
- Use more consistent source code style.
- Don't presume that CH_F... constants are present.
- Allow to quit the program via 'Enter'.
2018-08-20 00:30:17 +02:00
Oliver Schmidt
1644bcdf03 Implemented line wrap.
According to https://github.com/cc65/wiki/wiki/Direct-console-IO it is undefined what happens when the end of the sceen is reached. But it is _not_ undefined what happens when the end of the line is reached. So implement the usual thing - which was easy enough to do after all.
2018-08-20 00:30:17 +02:00
Oliver Schmidt
f8c6c58373 Made Apple II CONIO more flexible.
Originally the Apple II had a 64 char set and used the upper two bits to control inverse and blinking. The Apple //e brought then an alternate char set without blinking but more individual chars. However, it does _not_ contain 128 chars and use the upper bit to control inverse as one would assume. Rather it contains more than 128 chars - the MouseText chars. And because Apple wanted to provide as much backward compatibility as possible with the original char set, the alternate char set has a rather weird layout for chars > 128 with the inverse lowercase chars _not_ at (normal lowercase char + 128).

So far the Apple II CONIO implementation mapped chars 128-255 to chars 0-127 (with the exception of \r and \n). It made use of alternate chars > 128 transparently for the user via reverse(1). The user didn't have direct access to the MouseText chars, they were only used interally for things like chline() and cvline().

Now the mapping of chars 128-255 to 0-127 is removed. Using chars > 128 gives the user direct access to the "raw" alternate chars > 128. This especially give the use direct access to the MouseText chars. But this clashes with the exsisting (and still desirable) revers(1) logic. Combining reverse(1) with chars > 128 just doesn't result in anything usable!

What motivated this change? When I worked on the VT100 line drawing support for Telnet65 on the Apple //e (not using CONIO at all) I finally understood how MouseText is intended to be used to draw arbitrary grids with just three chars: A special "L" type char, the underscore and a vertical bar at the left side of the char box. I notice that with those chars it is possible to follow the CONIO approach to boxes and grids: Combining chline()/cvline() with special CH_... char constants for edges and intersections.

But in order to actually do so I needed to be able to define CH_... constants that when fed into the ordinary cputc() pipeline end up as MouseText chars. The obvious approach was to allow chars > 128 to directly access MouseText chars :-)

Now that the native CONIO box/grid approach works I deleted the Apple //e proprietary textframe() function that I added as replacement quite some years ago.

Again: Please note that chline()/cvline() and the CH... constants don't work with reverse(1)!
2018-08-20 00:30:17 +02:00
Greg King
7b8d4b28c7 Fixed the system banking in the cbm510 and the cbm610 targets' versions of clock_gettime() and clock_settime().
Their library function calls must run in the execution bank.
2018-08-19 17:12:54 -04:00
Stefan
b93b88211c WDM support (#721)
WDM support
2018-08-19 10:29:25 -04:00
Oliver Schmidt
03a99569e3 Optimize for size. 2018-08-19 14:35:30 +02:00
Oliver Schmidt
3598fb505d Fixed Visual C++ build (and some style adjustments). 2018-08-19 00:01:40 +02:00
Oliver Schmidt
250e4ed9e0 Added dummy clock_settime() for the Atari.
Allow to build ip65/date65.
2018-08-18 01:36:56 +02:00
Oliver Schmidt
fe5af26f9f Express assumption about struct timespec.
We basically cast a struct timespec pointer to a time_t pointer when we pass the clock_settime() paramter to localtime(). Explicitly express that in the source code.
2018-08-18 01:29:40 +02:00
Oliver Schmidt
eb9872c684 Added clock_settime() for some CBMs.
The CIA TOD only stores the time but not the date. Therefore the date set by clock_settime() ist just stored inside the C library for retrieval via clock_gettime().

The "very special" handling of 12AM/PM is based on https://groups.google.com/d/msg/comp.sys.cbm/ysVYSX4AMbc/vHrXCWEhCOUJ saying:

==========

24hr: Wr => Rd => Nx
--------------------
  0 : 92 => 12 => 01   <= Switch from 00 to 01 (24-hour notation)
  1 : 01 => 01 => 02
  2 : 02 => 02 => 03
 11 : 11 => 11 => 92
 12 : 12 => 92 => 81   <= Switch from 12 to 13 (24-hour notation)
 13 : 81 => 81 => 82
 14 : 82 => 82 => 83
 23 : 91 => 91 => 12

1. column ("24hr"): hour to be tested (decimal)
2. column ("Wr"):   hour written to TOD register (BCD)
3. column ("Rd"):   hour read from TOD register (BCD) immediately after writing the value in column 2 to see the conversion between AM/PM, if any
4. column ("Nx"):   next hour (BCD) after the hour switch

==========

Thanks Paul!
2018-08-18 01:29:40 +02:00
Oliver Schmidt
cb7ec508f6 Fixed 12 AM/PM handling.
Midnight is 12 AM and noon is 12 PM (see https://en.wikipedia.org/wiki/12-hour_clock). Therefore we need to subtract 12 hours in exactly those two hours.
2018-08-18 01:29:40 +02:00
Patrick Pelletier
e549e23a87 Use non-POSIX values for S_IREAD and S_IWRITE.
(As requested in the PR.)
2018-08-17 23:28:45 +02:00
Patrick Pelletier
411a5a9483 Don't pass mode argument to open() from _fopen().
It isn't necessary, since paravirt.c has a default if the mode isn't
pushed onto the stack.
2018-08-17 23:28:45 +02:00
Patrick Pelletier
f72d355b18 sim65: Use mode_t for OMode. 2018-08-17 23:28:45 +02:00
Patrick Pelletier
b30f790587 sim65: Blindly guessing to get Travis build to pass. 2018-08-17 23:28:45 +02:00
Patrick Pelletier
a7d158e077 sim65: Build was failing on Windows, too.
Microsoft loves putting underscores in front of everything!
2018-08-17 23:28:45 +02:00
Patrick Pelletier
12fbdbf418 sim65: S_IREAD and S_IWRITE are nonstandard.
The Linux build was failing with:

sim65/paravirt.c: In function ‘PVOpen’:
sim65/paravirt.c:217:18: error: ‘S_IREAD’ undeclared (first use in this function)
         OMode |= S_IREAD;
                  ^
sim65/paravirt.c:217:18: note: each undeclared identifier is reported only once for each function it appears in
sim65/paravirt.c:220:18: error: ‘S_IWRITE’ undeclared (first use in this function)
         OMode |= S_IWRITE;
                  ^
make[1]: *** [../wrk/sim65/paravirt.o] Error 1
2018-08-17 23:28:45 +02:00
Patrick Pelletier
974188796c sim65: If mode argument is omitted, use a reasonable default. 2018-08-17 23:28:45 +02:00
Patrick Pelletier
aba320eade Allow "mode" argument to open() to be passed from 6502 code.
Implements this suggestion:
https://github.com/cc65/cc65/pull/719#issuecomment-413809096
2018-08-17 23:28:45 +02:00
Patrick Pelletier
d602572bbe Fix permissions for files created by sim65.
Files created by my programs running under sim65 had really weird permissions:
--w-r--r-x  1 ppelleti  staff  19 Aug 16 23:22 json.test.print.tmp

So, for example, my program running under sim65 was not able to read
the file it had just written.

This is because the third argument to open (mode) was not being
specified in paravirt.c, so it was just picking up random crud off the
stack to use as the mode.

I added a mode of 0666, and now my program runs correctly.
2018-08-17 23:28:45 +02:00
Greg King
d13d068e71 Fixed the generation of the opcode byte when BRK is given an operand, in 65816 CPU mode.
The bug was created by commit 7e8bb7b700.
2018-08-16 23:51:04 -04:00
Oliver Schmidt
f40dcb5883 Added clock_getres() / clock_settime() for the Apple II.
The situation on the Apple II is rather special: There are several types of RTCs. It's not desirable to have specific code for all of them. As the OS supports file timestamps RTC owners usually use OS drivers for their RTC. Those drivers read the RTC and write the result in a "date/time location" in RAM. The OS reads the date/time from the RAM location. If there's no RTC the RAM location keeps containing zeros. The OS uses those zeros as timestamps and the files show up in a directory as "<NO DATE>".

There's no common interface to set RTCs so if an RTC _IS_ present there's just nothing to do. However, if there's _NO_ RTC present the user might very well be interest to "manually" set the RAM location in order to have timestamps. But he surely doesn't want to manually set the RAM location over an over again. Rather he wants to set it just once after booting the OS.

From that perspective it makes most sense to not set both the date and the time but rather only set the date and have the time just stay zero. Then files show up in a directory as "DD-MON-YY  0:00".

So clock_settime() checks if the current time equals 0:00. If it does _NOT_ then an RTC is supposed to be active and clock_settime() fails with ERANGE. Otherwise clock_settime() ignores sets the date - and completely ignores the time provided as parameter.

clock_getres() too checks if the current time equals 0:00. If it does _NOT_ then an RTC is supposed to be active and clock_getres() returns a time resolution of one minute. Otherwise clock_getres() presumes that the only one who sets the RAM location is clock_settime() and therefore returns a time resolution of one day.
2018-08-15 21:34:35 +02:00
Oliver Schmidt
326ca263c9 Minor style fix. 2018-08-15 19:40:56 +02:00
Oliver Schmidt
59a8149556 Added clock_getres() for CBMs.
All CBMs have a clock (CIA TOD) resolution of 1/10 second.
2018-08-15 19:40:27 +02:00
Oliver Schmidt
842c151edd Replaced _systime with clock_gettime.
We want to add the capability to not only get the time but also set the time, but there's no "setter" for the "getter" time().

The first ones that come into mind are gettimeofday() and settimeofday(). However, they take a struct timezone argument that doesn't make sense - even the man pages says "The use of the timezone structure is obsolete; the tz argument should normally be specified as NULL." And POSIX says "Applications should use the clock_gettime() function instead of the obsolescent gettimeofday() function."

The ...timeofday() functions work with microseconds while the clock_...time() functions work with nanoseconds. Given that we expect our targets to support only 1/10 of seconds the microseconds look preferable at first sight. However, already microseconds require the cc65 data type 'long' so it's not such a relevant difference to nanoseconds. Additionally clock_getres() seems useful.

In order to avoid code duplication clock_gettime() takes over the role of the actual time getter from _systime(). So time() now calls clock_gettime() instead of _systime().

For some reason beyond my understanding _systime() was mentioned in time.h. _systime() worked exactly like e.g. _sysremove() and those _sys...() functions are all considered internal. The only reason I could see would be a performance gain of bypassing the time() wrapper. However, all known _systime() implementations internally called mktime(). And mktime() is implemented in C using an iterative algorithm so I really can't see what would be left to gain here. From that perspective I decided to just remove _systime().
2018-08-15 16:06:44 +02:00
Oliver Schmidt
55a07c1dcd Removed stray /t char. 2018-08-15 16:06:44 +02:00
Oliver Schmidt
bbed9fdb63 Fixed typo. 2018-08-15 16:06:44 +02:00
Olli Savia
e6e9c72f66 Added CHKOUT and CLRCHN 2018-08-15 11:53:17 +02:00
Scott Hutter
b18aa27aa1
Merge pull request #1 from greg-king5/c128-hi-tgi
Make c128-hi.tgi put its graphics data into the RAM behind the ROMs.
2018-08-13 21:28:07 -05:00
Scott Hutter
ad67fe51dd
Merge pull request #2 from polluks/patch-13
c128-hi.tgi doc
2018-08-13 21:25:46 -05:00
greg-king5
188e3a74ed
Merge pull request #712 from ppelleti/fix-bit
sim65: Fix "$2C: BIT abs" to access the correct address.
2018-08-11 01:48:11 -04:00
Patrick Pelletier
5cdaa96e4c sim65: Fix "$2C: BIT abs" to access the correct address.
Bug is documented here:
http://forum.6502.org/viewtopic.php?f=2&t=5242
2018-08-10 12:58:48 -07:00
Oliver Schmidt
a9ce4dc76c "Inverted" time_t value handling.
So far time_t values were interpreted as local time values. However, usually time_t values are to be interpreted as "seconds since 1 Jan 1970 in UTC". Therefore all logic handling time_t values has to be changed.

- So far gmtime() called localtime() with an adjusted time_t, now localtime() calls gmtime() with an adjusted time_t.
- mktime() has to do "the opposite" of localtime(), to keep it that way mktime() does now the inverse adjustment made by localtime().
- All currently present time() implementations internally call mktime() so they don't require individual adjustments.
2018-08-02 17:12:12 +02:00
Oliver Schmidt
753b48647f
Increased consistency.
The test program works as-is only if the timezone isn't set (to something different than UTC). However, using localtime() instead of gmtime() makes it at least consistent in that the original time (given to mktime()) is identical to the time retrieved.
2018-08-02 15:45:57 +02:00
Stefan
3e8c6bf4bd
c128-hi.tgi doc 2018-07-30 15:33:52 +00:00
Greg King
5e67eee362 Made the VIC-IIe TGI driver put its bitmap behind the ROMs. 2018-07-29 23:46:03 -04:00
Greg King
ad6c2dbe7b Added code to make the 65816's MVN and MVP instructions handle both immediate (bank) and far-address operands. 2018-07-29 03:50:02 -04:00
Greg King
e6fc904e3c Fixed some code, to adapt to register-use changes caused by pull request #652. 2018-07-27 09:21:31 -04:00
Oliver Schmidt
e86a7db18b Some minor cleanups. 2018-07-26 14:35:26 +02:00
Oliver Schmidt
e949a3e642 Fixed regression introduced by https://github.com/cc65/cc65/pull/652. 2018-07-26 14:31:17 +02:00
Oliver Schmidt
97be359d4a Updated comment. 2018-07-26 13:09:21 +02:00
IrgendwerA8
c9869c1a26 Quick fix for missing _div() adaptation after 95223be. 2018-07-26 10:44:22 +02:00
Oliver Schmidt
b04028b5d8 Added test for mktime() and gmtime().
A recent regression makes gmtime()/localtime() fail. So it's obviously desirable to have a test for that code.
2018-07-24 03:26:40 +02:00
Scott Hutter
1981af0bbd tgi driver for c128 VIC-II 2018-07-23 15:54:15 -05:00
Greg King
eeb1b927ce Fixed the order in which the 65816's block-move instructions' operands are written and assembled.
The source bank number is written first; but, assembled second.
The destination bank is written second; but, assembled first.
2018-07-05 10:58:59 -04:00
Oliver Schmidt
cc5c0931a3
Merge pull request #695 from ops/cbmkernal_imports
CBM: Add imports for standard kernal entries
2018-07-04 23:47:33 +02:00
Olli Savia
fdce8fb34d Added a blank line between .include statements and .import/.export statements 2018-07-04 17:40:28 +03:00
Olli Savia
f7636fe8f2 Removed .import for std kernal entries. Added .include "cbm.inc" 2018-07-03 22:47:42 +03:00
Olli Savia
032a3877e0 Added .import for std kernal entries 2018-07-03 22:44:59 +03:00
Oliver Schmidt
e98bb13271
Merge pull request #693 from ops/cbmkernal_stage3
cbm_kernal enhancements
2018-07-02 10:39:57 +02:00
Olli Savia
3e94f7f55c Moved C128 specific definitions to cbm_kernal.inc 2018-07-01 09:58:39 +03:00
Olli Savia
820c0efcb3 Use common include file cbm_kernal.inc 2018-07-01 09:56:37 +03:00
Olli Savia
4c45de2c45 Updated comment 2018-07-01 09:54:39 +03:00
Oliver Schmidt
9f913ae109
Merge pull request #692 from ops/cbmkernal_stage2
Update library to use cbm_kernal.inc for kernal entry points
2018-06-30 22:26:04 +02:00
Olli Savia
635a99c083 TAB to space conversion 2018-06-30 16:25:43 +03:00
Olli Savia
d5bc751f54 Removed RAMTAS 2018-06-29 22:59:53 +03:00
Olli Savia
96e6a0a114 Common include file is now cbm_kernal.inc 2018-06-29 22:58:16 +03:00
Olli Savia
42e9b971c5 Merge remote-tracking branch 'upstream/master' into cbmkernal_stage2 2018-06-29 22:50:02 +03:00
Oliver Schmidt
18966eab63
Merge pull request #688 from ops/cbmkernalasm
RFC: Common kernal inc file for Commodore targets
2018-06-29 18:59:48 +02:00
Olli Savia
f185e28892 cbmkernal.inc -> cbm_kernal.inc 2018-06-29 16:14:00 +03:00
Olli Savia
f7fbac4c6b Use common include file cbmkernal.inc 2018-06-27 21:39:24 +03:00
Oliver Schmidt
153bb29501
Merge pull request #682 from shinra-jp/da65-synclines
Support for preprocessing info file via cpp or m4.
2018-06-26 10:26:15 +02:00
AIDA Shinra
31fdec2e2e Style fix 2018-06-25 23:50:46 +09:00
AIDA Shinra
d5acfeb426 Merge remote-tracking branch 'origin' into da65-synclines 2018-06-25 23:38:43 +09:00
Olli Savia
8c4a0768cc TAB to space conversion 2018-06-22 11:29:03 +03:00
Olli Savia
accfc14fb1 RESTOR and VECTOR moved under own ifdef/endif block 2018-06-22 11:21:00 +03:00
Oliver Schmidt
86945a1270
Merge pull request #687 from polluks/patch-12
Smaller driver code
2018-06-21 22:37:29 +02:00
Stefan
6a70d1dab1
Removed unused label 2018-06-21 20:30:14 +00:00
Olli Savia
a22e19a902 Added asminc/cbmkernal.inc 2018-06-21 18:32:38 +03:00
greg-king5
4980fade74
Made LINE plot single-point lines correctly. 2018-06-21 08:18:53 -04:00
Stefan
23534beaa6
Smaller driver code 2018-06-21 00:25:33 +00:00
AIDA Shinra
9439b5b645 Merge branch 'da65-synclines' of github:shinra-jp/cc65 into da65-synclines 2018-06-14 02:04:06 +09:00
AIDA Shinra
fd67284b4d Followed the discussions in the Pull request #682.
* Fixed a misspelling
* Fixed styles
* Added sample codes
2018-06-14 02:02:16 +09:00
AIDA Shinra
2b25329423 Support for preprocessing info file via cpp or m4. 2018-06-14 02:02:16 +09:00
Oliver Schmidt
6c320f7d65
Merge pull request #681 from shinra-jp/voperand
Support for "inline parameters" of subroutines
2018-06-13 14:41:24 +02:00
AIDA Shinra
75c4972021 Style and alignment fixes. 2018-06-13 21:24:34 +09:00
AIDA Shinra
a3ab3cb458 Changed the wording of the doc/da65.sgml. 2018-06-13 01:23:01 +09:00
AIDA Shinra
8899d71cad Followed the discussions in the Pull request #682.
* Fixed a misspelling
* Fixed styles
* Added sample codes
2018-06-12 02:06:01 +09:00
AIDA Shinra
03bb2f6a48 Followed discussions in the Pull reequest #681.
In particular, renamed "virtual operands" to "inline parameters".
2018-06-12 00:18:11 +09:00
AIDA Shinra
335a8972b9 Support for preprocessing info file via cpp or m4. 2018-06-11 01:53:35 +09:00
Oliver Schmidt
535088fe73 Support --print-target-path with spaces.
Don't try this at home ;-))
2018-06-10 18:12:09 +02:00
AIDA Shinra
9283e9ca98 Support for "virtual operands" of subroutines like this:
jsr	SomeProc
.byte	$00, $01 ; argument to SomeProc
; return here from SomeProc
bit	$3F
2018-06-10 18:09:11 +09:00
Oliver Schmidt
b74ab9de89 Allow spaces in path names.
The Microsoft C Library needs to have spawnvp() parameters with spaces quoted manually. We do this only if actually necessary to limit issues with parameters already containing double quotes.
2018-06-08 19:16:18 +02:00
Oliver Schmidt
9877042450 Use --print-target-path only as last resort.
--print-target-path may return a path with (escaped) spaces. We'll use that path with $(wildcard ...), that's fine. But then we use the outcome with $(foreach ...) and there things fail badly and there's nothing to do about it.

Therefore we a) try to avoid --print-target-path in the first place and b) explicitly bail out if we end up with spaces.
2018-06-08 18:58:36 +02:00
Oliver Schmidt
d861be8ad5 Escape spaces in target path.
cc65 escapes spaces in paths it writes to dependency files (see WriteEscaped() in cc65/input.c). Given that the output of OptPrintTargetPath() is supposed to be used in Makefiles in pretty much the same way it is appropriate to escape spaces here too.
2018-06-07 17:10:33 +02:00
Oliver Schmidt
aea34c5410
Merge pull request #673 from bengdahl/master
Fix `make` failing in parent directories containing spaces
2018-06-07 17:01:42 +02:00
Oliver Schmidt
d002f6e5be
Merge pull request #676 from Fabrizio-Caruso/master
Fix joystick for the Supervision target
2018-06-06 21:37:13 +02:00
Fabrizio Caruso
9af2d6b4a1 spaces instead of tab 2018-06-06 21:18:47 +02:00
Fabrizio Caruso
e626180b28 Fix joystick for the Supervision target 2018-06-06 21:11:17 +02:00
Oliver Schmidt
e99a5ff1fe
Fixed usage indentation. 2018-06-06 18:59:25 +02:00
existensialMemory
4fd17161eb
Update Makefile 2018-06-04 22:17:25 -04:00
Ben
1f245fbc0b Fix make failing in parent directories containing spaces 2018-06-04 21:27:04 -04:00
Oliver Schmidt
f8bd96868b
Merge pull request #670 from greg-king5/string-pointer-break
Fix strpbrk() problems.
2018-06-01 13:15:52 +02:00
Greg King
6d87370881 Fixed strpbrk().
Added its prototype.  Documented it.
2018-05-29 14:29:50 -04:00
Oliver Schmidt
a0832b62c6
Merge pull request #668 from IrgendwerA8/mul_second_thoughts
Mul second thoughts
2018-05-29 09:01:34 +02:00
IrgendwerA8
465a651090 Free 2 bytes again. 2018-05-29 01:51:24 +02:00
IrgendwerA8
0f108cb4d8 1 byte code size donation for Fabrizio ;) 2018-05-29 01:12:51 +02:00
Oliver Schmidt
19cd149be2
Merge pull request #666 from IrgendwerA8/1_byte_donation_for_fabrizio
1 byte donation for Fabrizio ;)
2018-05-27 12:17:52 +02:00
IrgendwerA8
f55b564ca1 Save the three bytes for the plus4 too. 2018-05-27 00:10:58 +02:00
IrgendwerA8
30a679ba36 Saved 3 bytes for the C16 target. 2018-05-26 20:30:38 +02:00
IrgendwerA8
49a9b88734 Saved even one more byte. 2018-05-26 19:53:44 +02:00
IrgendwerA8
e77ac8a230 1 byte donation for Fabrizio ;) 2018-05-26 16:37:03 +02:00
IrgendwerA8
ea463d95e3 1 byte code size donation for Fabrizio ;) 2018-05-26 16:33:19 +02:00
Oliver Schmidt
95223be101
Merge pull request #663 from IrgendwerA8/more_popptr1_adaptations
Adapted div & mod for popptr1.
2018-05-26 13:01:27 +02:00
IrgendwerA8
8a5d1b9674 Reestablished entry state of signed operation and optimized that (again). 2018-05-25 23:52:42 +02:00
IrgendwerA8
ba5b580368 Fixed first letter of comments (should be upper case). 2018-05-25 16:10:16 +02:00
Oliver Schmidt
0b323f717b
Update symbols.txt 2018-05-25 14:48:20 +02:00
Oliver Schmidt
0138e110cc
Merge pull request #662 from Compyx/master
Add CBM kernal call SECOND to CBM library (see issue #525)
2018-05-25 14:00:36 +02:00
Bas Wassink
b98517f90b Add __fastcall__ to cbm_k_second() documentation 2018-05-25 13:17:12 +02:00
IrgendwerA8
71420223bc Changed the name of the file too. 2018-05-24 11:37:17 +02:00
IrgendwerA8
9c1cb0801c Changed naming absvaludiv -> absvaludiv16. 2018-05-24 11:31:43 +02:00
IrgendwerA8
dd411efd1c Adapted div & mod for popptr1. 2018-05-24 03:55:40 +02:00
compyx
dade099b9d CBM kernal call SECOND, update cbm.h 2018-05-23 17:37:48 +02:00
compyx
8ffe623e74 Add CBM kernal call SECOND to CBM library (see issue #525) 2018-05-23 17:32:02 +02:00
Oliver Schmidt
9246b14f68
Merge pull request #658 from polluks/patch-9
Indicate a dummy outtext & some clean-up
2018-05-23 17:05:12 +02:00
Oliver Schmidt
4459b8973b
Merge pull request #659 from polluks/patch-10
Fixed typos and added references for #655
2018-05-23 15:51:25 +02:00
Oliver Schmidt
b6b11e3b43
Merge pull request #660 from polluks/patch-11
More references
2018-05-23 15:48:43 +02:00
Stefan
d28fce082d
Update funcref.sgml 2018-05-23 13:40:14 +00:00
Stefan
21a69c8aff
Update tgi.sgml 2018-05-23 13:34:37 +00:00
Stefan
714a347dc9
Update funcref.sgml 2018-05-23 13:32:17 +00:00
Stefan
0a1e68d7a9
Update funcref.sgml 2018-05-23 13:30:57 +00:00
Oliver Schmidt
746e3d1454
Merge pull request #656 from Compyx/master
Add CBM kernal call TKSA to CBM library (see issue #525)
2018-05-23 09:47:41 +02:00
Oliver Schmidt
f485be1b84
Merge pull request #657 from IrgendwerA8/VariousSpeedSizeOptimizations
Various speed size optimizations
2018-05-23 09:46:30 +02:00
Stefan
1dcd4a19ea
More references 2018-05-23 04:51:32 +00:00
greg-king5
486678e557
Merge pull request #653 from IrgendwerA8/cbm_rw_popptr1
* Saved 6 bytes by using popptr1.

* Fix typo for import.

* Beautified comment.
2018-05-23 00:31:53 -04:00
Stefan
9e4833e21f
Added documentation of cbm_k_untlk 2018-05-23 04:27:05 +00:00
Stefan
37e6b05b4a
Fixed typos and added references for #655 2018-05-23 01:51:54 +00:00
Stefan
a4c06f2572
Clean-up because of tgidrv_line.inc 2018-05-22 22:32:50 +00:00
Stefan
b945beb6a7
Indicate a dummy outtext 2018-05-22 21:18:10 +00:00
IrgendwerA8
6175271651 Removed optimizations which break the compiler ones. 2018-05-22 19:10:07 +02:00
compyx
e3a8cfcdb0 cbm_k_tksa() from the PET docs 2018-05-22 18:48:43 +02:00
IrgendwerA8
808d3ab471 Fix for 8x16 multiplication if operants are swapped. 2018-05-22 18:35:05 +02:00
IrgendwerA8
ba2c6d9008 Further optimizations in common/conio. 2018-05-22 16:00:05 +02:00
compyx
30ada49458 Add CBM kernal call TKSA to CBM library
This adds the CBM kernal call TKSA as cbm_k_tksa() to the CBM library.
2018-05-22 14:16:00 +02:00
IrgendwerA8
95b4a6f881 Beautified comment. 2018-05-22 11:25:26 +02:00
IrgendwerA8
99e13eeaa2 Fix typo for import. 2018-05-21 18:19:39 +02:00
IrgendwerA8
d7da827be8 Apply faster popptr1 to functions and/or use register instead of stack to save accu. 2018-05-21 18:18:01 +02:00
IrgendwerA8
c40ae4d774 Saved 6 bytes by using popptr1. 2018-05-21 16:21:45 +02:00
Oliver Schmidt
81b3c16c7e
Merge pull request #652 from IrgendwerA8/popptr1
Added Popptr1 to save some bytes and ease parameter extraction
2018-05-21 14:52:59 +02:00
IrgendwerA8
d4081b43a6 Fixed comments. 2018-05-21 14:41:12 +02:00
IrgendwerA8
166425f807 Converted unintentionally introduced tabs to spaces. 2018-05-21 14:33:44 +02:00
Irgendwer
32bbacbb78
Merge branch 'master' into popptr1 2018-05-21 13:33:14 +02:00
IrgendwerA8
839aa93198 Resolved conflict and removed adaptation for strpbrk for time being. 2018-05-21 13:30:27 +02:00
IrgendwerA8
911b86de67 Fixed formatting and two import issues. 2018-05-21 13:02:56 +02:00
IrgendwerA8
c95ed4b8b5 Added "popptr1" which is of common use to save some bytes. 2018-05-20 15:30:18 +02:00
Oliver Schmidt
a795a27689
There's no 'closeallstreams' (anymore ?). 2018-05-17 11:11:40 +02:00
Oliver Schmidt
96006dba96
Merge pull request #646 from polluks/patch-8
Update c64.sgml
2018-05-15 12:09:44 +02:00
Oliver Schmidt
5a7fc8d334
Merge pull request #647 from polluks/patch-9
Make NMI ready
2018-05-15 11:07:41 +02:00
Stefan
472a107358
Make NMI ready 2018-05-14 23:22:09 +00:00
Stefan
b3358c462e
Update c64.sgml
Do not use last page!
2018-05-14 23:10:34 +00:00
Oliver Schmidt
5928af8adc
Merge pull request #645 from polluks/patch-7
Update c64.sgml
2018-05-14 20:28:15 +02:00
Oliver Schmidt
ad59689946
Merge pull request #644 from greg-king5/anon-struct
Make union declarations know the sizes of anonymous structs/unions.
2018-05-14 18:37:51 +02:00
Stefan
df79409f76
Update c64.sgml
soft80 is NMI ready
2018-05-14 14:17:09 +00:00
Greg King
362b6afacf Made a C union declaration know the sizes of anonymous struct/union members when it determines its size.
The bug was located, and the fix was written, by Francesco.
2018-05-13 18:54:45 -04:00
Oliver Schmidt
4e137cf9f5
Merge pull request #643 from mikeakohn/fix/sweet16_op_bs
The opcode for BS should be 0x0C.
2018-05-13 16:32:18 +02:00
Michael Kohn
5ecd902fbf The opcode for BS should be 0x0C. 2018-05-13 06:31:05 -05:00
greg-king5
ca31e3af1e
Fixed a bug that didn't preserve the accumulator's value when a simple 16-bit fetch-and-store is optimized. (#637)
Fix a 16-bit fetch-and-store cc65 optimizer bug.
2018-05-12 13:46:16 -04:00
greg-king5
2a78b9d3fe
Merge pull request #642 from polluks/patch-6
NMI-friendly c64-hi.tgi
2018-05-10 09:00:34 -04:00
Stefan
b449ded176
Update c64-hi.s 2018-05-09 23:56:35 +00:00
Stefan
b81a04f157
Update c64-hi.s 2018-05-09 23:52:52 +00:00
Stefan
cdce753a09
NMI friendly c64-hi
Don't clear all vectors, see #639.
2018-05-09 23:31:42 +00:00
Oliver Schmidt
334e30c407
Merge pull request #636 from blackystardust/master
Added C64 Turbo Master accelerator code and documentation.
2018-05-03 18:18:13 +02:00
Marco van den Heuvel
cdebf6baa7 Harmonized the comments (as in added 1 space) ;) 2018-05-03 09:11:20 -07:00
Marco van den Heuvel
04675fca2a Order fix. 2018-05-02 11:23:43 -07:00
Marco van den Heuvel
e88ac62d06 Optimized the code a bit, thanks to Greg for the suggestions/comments. 2018-05-01 14:46:57 -07:00
Marco van den Heuvel
b1c3daca3a Fixed the order of some functions. 2018-05-01 14:45:51 -07:00
Marco van den Heuvel
21e6f25e70 Added missing file. 2018-05-01 14:44:23 -07:00
Marco van den Heuvel
b12678e90d Fixed a typo. 2018-04-30 14:34:46 -07:00
Marco van den Heuvel
ad7b339c44 Added C64 Turbo Master accelerator code and documentation. 2018-04-30 14:30:35 -07:00
Oliver Schmidt
5c07db3a74
Merge pull request #634 from blackystardust/master
Added C65/C64DX accelerator code and documentation.
2018-04-30 22:51:42 +02:00
Marco van den Heuvel
5b4929ef98 Removed obsolete bit opcode. 2018-04-29 12:13:52 -07:00
Marco van den Heuvel
63cad26656 Merge branch 'master', remote-tracking branch 'origin' 2018-04-29 12:12:13 -07:00
Oliver Schmidt
a482b54ed7
Removed extern keyword from function prototype. 2018-04-29 13:50:09 +02:00
Marco van den Heuvel
d0088fbc0f Fixed a wrong branch. 2018-04-28 13:26:20 -07:00
Marco van den Heuvel
a012fab090 Added a comment to make the situation more clear. 2018-04-28 13:25:16 -07:00
Marco van den Heuvel
11629bcf99 Added C65/C64DX accelerator code and documentation. 2018-04-27 14:22:41 -07:00
Oliver Schmidt
47e4b36180
Merge pull request #631 from blackystardust/master
Added C64 Chameleon accelerator code and documentation.
2018-04-27 20:47:03 +02:00
Marco van den Heuvel
97e69952c4 Removed extern keyword from function prototypes. 2018-04-27 09:16:25 -07:00
Marco van den Heuvel
1428015158 Optimized the code a bit as suggested by Greg. 2018-04-26 09:18:54 -07:00
Greg King
c92a3c5bd5 Improved the accelerator code. Fixed an infinite loop.
Removed the execute permissions from some files.
2018-04-26 05:46:34 -04:00
Marco van den Heuvel
f2e46f0fdf Added C64 Chameleon accelerator code and documentation. 2018-04-25 12:53:29 -07:00
Oliver Schmidt
fc61bc79c5
Merge pull request #629 from blackystardust/master
Added C128 accelerator code and documentation for both C128 mode and C128 in C64 mode.
2018-04-25 15:08:11 +02:00
Marco van den Heuvel
cc2bcb8a4d Changed c128 accelerator code and documention to include both C64 and C128 support. 2018-04-23 19:25:11 -07:00
Oliver Schmidt
fe33a39d6c
Merge pull request #628 from ops/VIAFIX_PET
Pet: Add missing VIA register names
2018-04-23 15:58:13 +02:00
Marco van den Heuvel
28f26991ac Updated c128 accelerator code and documentation. 2018-04-21 09:52:50 -07:00
Greg King
30aed2330d Updated a joystick adapter URL. 2018-04-21 04:30:56 -04:00
Marco van den Heuvel
3f5683b391 Added C128 in C64 mode accelerator code and documentation. 2018-04-20 12:08:28 -07:00
Olli Savia
c2adade8a8 Updated to use the new VIA register names 2018-04-20 21:25:43 +03:00
Olli Savia
7292b571de Added missing VIA register names. 2018-04-20 21:24:37 +03:00
Oliver Schmidt
305c6e7ae4
Merge pull request #626 from blackystardust/master
Added c64dtv accelerator code and documentation.
2018-04-20 20:01:16 +02:00
Oliver Schmidt
53df4da8e8
Merge pull request #625 from ops/VIAFIX
VIC-20: Add missing VIA register names
2018-04-18 17:09:35 +02:00
Greg King
e235ac2a0e Added a preprocessor guard to tgidemo.c that avoids a compiler warning.
DoWarning() is compiled only if it will be used.
2018-04-17 16:53:10 -04:00
Oliver Schmidt
d314a27e76
Merge pull request #627 from jedeoric/master
[Telestrat target] fix fwrite bug, cputc, chline, remove & mkdir added
2018-04-16 22:46:56 +02:00
jede
cc2b5af601 Fix comment 2018-04-16 21:51:15 +02:00
Marco van den Heuvel
ef73310cce Fixed more comments. 2018-04-16 11:05:52 -07:00
Marco van den Heuvel
0aa2735d4e Fixed another comment. 2018-04-15 12:15:19 -07:00
Marco van den Heuvel
c5f15fa1d5 Fixed some comment and documentation errors. 2018-04-15 11:55:58 -07:00
Greg King
5f6d024804 Made the samples Makefile be able to build the samples for targets other than the ones named explicitly in that file. 2018-04-14 18:10:11 -04:00
jede
626fed88b7 chline added 2018-04-14 22:05:03 +02:00
jede
e34ef0fc17 add cputc & remove 2018-04-14 21:52:11 +02:00
Marco van den Heuvel
cb04bc5465 Fixed an issue with the changing the d040 value while detecting. 2018-04-14 11:31:28 -07:00
Marco van den Heuvel
6076316f38 Added c64dtv accelerator code and documentation. 2018-04-14 10:40:13 -07:00
Olli Savia
7b1db91d36 Changed register addresses relative to the base address 2018-04-14 18:45:15 +03:00
Olli Savia
59cb7da334 VIA1 and VIA2 no longer marked deprecated 2018-04-14 08:39:30 +03:00
Oliver Schmidt
a10f36c837
Merge pull request #623 from blackystardust/master
Added C64/C128 SuperCPU accelerator functions and started on a generic framework for accelerators.
2018-04-13 21:43:34 +02:00
Marco van den Heuvel
859422f357 Fixed non-address constants. 2018-04-12 09:35:02 -07:00
Oliver Schmidt
f1a7ab9bc6
Merge pull request #624 from polluks/patch-5
Simpler get_tv
2018-04-12 17:47:46 +02:00
Olli Savia
79433ddb60 Updated to use the new VIA register names. 2018-04-11 22:40:46 +03:00
Olli Savia
165b98bba5 Added missing VIA registers. Register names from the COMPUTE!'s book 'Mapping the VIC' 2018-04-11 22:38:23 +03:00
Marco van den Heuvel
e2cf4987cf Added some accelerator test code. 2018-04-10 15:24:15 -07:00
Stefan
a50d214ffb
Simpler get_tv
You don't have to count the beam, just check the KERNAL.
2018-04-10 18:37:10 +00:00
Marco van den Heuvel
89c3ed6d7f Added C64/C128 SuperCPU accelerator functions and started on a generic framework for accelerators. 2018-04-09 19:36:53 -07:00
Bob Andrews
60b9ea3222
Merge pull request #621 from blackystardust/master
Fixed cpu detection.
2018-04-04 20:40:25 +02:00
Marco van den Heuvel
61e5b9d218 Changed #10 to #-basha for clarity. 2018-04-01 13:14:44 -07:00
Greg King
098a30725f Moved declarations that are common to the C16 and the Plus4 libraries over to their common header. 2018-04-01 15:47:48 -04:00
Marco van den Heuvel
9db6f059ac Fixed cpu detection. 2018-03-31 18:59:15 -07:00
Oliver Schmidt
8886e6f100
Merge pull request #620 from blackystardust/master
Added c16/plus4 fast(), isfast() and slow() functions, and updated the documentation accordingly.
2018-03-31 11:57:27 +02:00
Oliver Schmidt
a7ae8e0a18
Adjusted style. 2018-03-30 00:11:40 +02:00
Oliver Schmidt
e2b38c96f8
Adjusted style. 2018-03-30 00:10:55 +02:00
Oliver Schmidt
a2a4868825 Added HGR and DHGR slide show programs.
The DHGR program is sort of a hack as it first switches to double (aka 80 col) text mode to prepare for double graphics mode. Therefore only one additional soft switch access is necessary after using TGI to generally switch to hires.
2018-03-30 00:08:26 +02:00
Greg King
b844572159 Moved most of the tgi_colors.s files into the libsrc/common/ directory.
Only the Apple2 and Lynx platforms use different codes for the white color; they have their own files.
2018-03-27 07:28:46 -04:00
Greg King
155f3ade41 C64 TGI: LINE: Optimization: Don't check boundaries; LINE always is called by tgi_clippedline().
Submitted in Pull Request #611 by Sven Michael Klose.
2018-03-26 07:28:01 -04:00
Marco van den Heuvel
8424286a3e Add c16 files as well. 2018-03-23 14:31:53 -07:00
Marco van den Heuvel
03ba3f7473 Added c16/plus4 fast(), isfast() and slow() functions, and updated the documentation accordingly. 2018-03-23 14:27:15 -07:00
Oliver Schmidt
d869368679
Merge pull request #619 from blackystardust/master
Added isfast function which returns a 1 when the C128 is in 2MHz mode.
2018-03-22 11:50:38 +00:00
Marco van den Heuvel
d34c93a464 Set X register to 0 so that 16bit promotion works as expected. 2018-03-20 14:05:55 -07:00
Marco van den Heuvel
5d4116f05f Added isfast function which returns a 1 when the C128 is in 2MHz mode. 2018-03-20 13:11:24 -07:00
Oliver Schmidt
b7a5dd76e9
Merge pull request #617 from blackystardust/master
Added the vic20 georam emd.
2018-03-20 13:24:04 +00:00
Marco van den Heuvel
2533cc8d75 Added the vic20 georam emd. 2018-03-19 11:34:41 -07:00
Oliver Schmidt
eaaab65d3c
Merge pull request #615 from blackystardust/master
Added vic20 $a000-$bfff ram emd.
2018-03-18 19:16:11 +00:00
Marco van den Heuvel
4fdc2d7209 Fix documentation building issue. 2018-03-18 12:06:43 -07:00
Marco van den Heuvel
12f72a5ed7 Added vic20 emd documentation. 2018-03-17 09:25:42 -07:00
Marco van den Heuvel
0c7496f08b Added vic20 - ram emd. 2018-03-16 14:23:52 -07:00
Marco van den Heuvel
9a763588e2 Merge branch 'master' of https://github.com/blackystardust/cc65 2018-03-16 12:33:49 -07:00
Marco van den Heuvel
13a485d885 Merge remote-tracking branch 'upstream/master' 2018-03-16 12:33:01 -07:00
Oliver Schmidt
2ad1850639
Merge pull request #613 from polluks/patch-4
Added another console
2018-03-15 18:37:44 +00:00
Marco van den Heuvel
9948ab7d79 Merge branch 'master' of https://github.com/cc65/cc65 2018-03-15 11:15:40 -07:00
Stefan
7efd9940f2
Added console 2018-03-13 22:19:19 +00:00
Oliver Schmidt
8b3e12d632
Added missing ror absolute override.
Fixes https://github.com/cc65/cc65/issues/489 as suggested by EtchedPixels.
2018-03-12 12:14:25 +01:00
Oliver Schmidt
316d8e9d37
Merge pull request #609 from polluks/master
Added missing PCE conio functions.
2018-03-11 08:58:23 +00:00
Stefan
789ce59fb5 Added missing PCE conio functions. 2018-03-11 00:49:40 +01:00
Oliver Schmidt
be30c0bd70
Merge pull request #606 from pfusik/ldec
Optimize deceaxy
2018-03-10 11:28:46 +00:00
Marco van den Heuvel
0eb1eb625f Undo my previous commit. 2018-03-09 10:46:02 -08:00
Piotr Fusik
18ada212e7 Fix coding style. 2018-03-09 18:48:24 +01:00
Marco van den Heuvel
22d4b0d497 Improved tv timing detection for the c64. 2018-03-08 16:06:33 -08:00
Piotr Fusik
970c5f6184 Add comments. 2018-03-08 22:10:11 +01:00
Bob Andrews
7e6942953c
Merge pull request #604 from blackystardust/master
Improved reu size detection.
2018-03-08 19:19:35 +01:00
Oliver Schmidt
d602105dd4
Merge pull request #605 from mrdudz/4playerfix
4playerfix
2018-03-08 08:09:24 +00:00
mrdudz
85e480db3d style fixes 2018-03-08 04:05:10 +01:00
Oliver Schmidt
8e75906737 Switched Apple II output format to AppleSingle.
Although the primary target OS for the Apple II for sure isn't DOS 3.3 but ProDOS 8 the Apple II binary files contained a DOS 3.3 4-byte header. Recently I was made aware of the AppleSingle file format. That format is a much better way to transport Apple II meta data from the cc65 toolchain to the ProDOS 8 file system. Therefore I asked AppleCommander to support the AppleSingle file format. Now that there's an AppleCommander BETA with AppleSingle support it's the right time for this change.

I bumped version to 2.17 because of this from the perspective of Apple II users of course incompatible change.
2018-03-07 23:05:21 +01:00
Oliver Schmidt
03c60efec9
Merge pull request #607 from pfusik/runtime-typos
Fix comment typos
2018-03-07 20:56:02 +00:00
Piotr Fusik
5251b67d73 Fix comment typos. 2018-03-07 21:01:29 +01:00
Piotr Fusik
a32c50a6bc Optimize deceaxy. 2018-03-07 20:45:50 +01:00
Marco van den Heuvel
74117bbe46 Merge remote-tracking branch 'upstream/master' 2018-03-06 18:00:57 -08:00
Marco van den Heuvel
2418c0e0af Updated documentation for the reu emd. 2018-03-06 18:00:36 -08:00
mrdudz
3afbed48e0 tweak driver to no more use IRQ 2018-03-07 00:20:42 +01:00
mrdudz
38fedfd78b also show pressed key, so we can verify keyboard works with the joystick driver 2018-03-07 00:19:14 +01:00
mrdudz
c0d8021fd5 add comment on linking, tweak a bit for easier debugging 2018-03-06 23:36:11 +01:00
Oliver Schmidt
223750cde9 CC65_HOME is gone for quite some time by now. 2018-03-06 20:43:08 +01:00
Marco van den Heuvel
b783280577 Replaced reu commands with defined constants. 2018-03-05 17:46:51 -08:00
Marco van den Heuvel
1539acafc1 Merge remote-tracking branch 'upstream/master' 2018-03-05 15:02:14 -08:00
Marco van den Heuvel
40e93dd931 Improved reu size detection. 2018-03-05 15:01:55 -08:00
Oliver Schmidt
bc58bf572c Fixed -W cmdline option handling.
Reverted part of 3157e4be1e as it actually introduced a regression.

It doesn't make sense to check for Arg[3] == '\0' _before_ checking Arg[2] != '\0'. This made the Win32 builds fail to correctly parse e.g. cl65 -W unused-var test.c
2018-03-05 22:31:10 +01:00
Oliver Schmidt
19f3229f45 Made 'wrapped call' code build with VS 2015. 2018-03-05 20:44:32 +01:00
Oliver Schmidt
c3610aa971 Updated from Visual Studio 2013 to Visual Studio 2015. 2018-03-05 20:42:37 +01:00
Oliver Schmidt
59ba224f93
Merge pull request #602 from blackystardust/master
Added 2a03/2a07 and HuC6280 detection.
2018-03-03 17:55:05 +00:00
Marco van den Heuvel
24cfcfdd4f Merge remote-tracking branch 'upstream/master' 2018-03-02 14:09:22 -08:00
Marco van den Heuvel
b37e06da8f Fixed hex digits case. 2018-03-02 14:09:02 -08:00
Oliver Schmidt
57abfcd581 Joystick drivers don't depend on interrupts anymore. 2018-03-02 22:17:49 +01:00
Marco van den Heuvel
9afbb0e2b7 Merge remote-tracking branch 'upstream/master' 2018-03-01 14:57:55 -08:00
Marco van den Heuvel
5a9d908007 Added 2a03/2a07 and HuC6280 detection. 2018-03-01 14:57:42 -08:00
Bob Andrews
b148fd50d7
Merge pull request #601 from blackystardust/master
Updated the getcpu() function documentation.
2018-03-01 19:07:36 +01:00
Marco van den Heuvel
c7764cfe50 Merge remote-tracking branch 'upstream/master' 2018-03-01 09:32:38 -08:00
Marco van den Heuvel
102d486207 Updated getcpu() function documentation. 2018-03-01 08:55:29 -08:00
Oliver Schmidt
298fe25281
Merge pull request #599 from greg-king5/pce-point-func
Fix how the PC-Engine calls functions through pointers.
2018-03-01 16:50:40 +00:00
Oliver Schmidt
8bf1a78d5d
Merge pull request #598 from blackystardust/master
Added proper 65sc02, 65ce02 and 4510 detection.
2018-03-01 16:47:52 +00:00
Greg King
549f09db9c Made two indirect jumps through the zero-page go through page $20 on the PC-Engine. 2018-02-28 14:59:52 -05:00
Oliver Schmidt
9ca004eacf
Merge pull request #600 from polluks/patch-3
Update docu
2018-02-28 07:54:36 +00:00
Stefan
85467231ab
Update
More conio targets
2018-02-28 00:24:28 +00:00
Marco van den Heuvel
5d029af79e Fixed the 65816/65802 detection. 2018-02-27 11:44:34 -08:00
Marco van den Heuvel
e79e779aba Removed bit opcode, not needed anymore. 2018-02-26 19:30:25 -08:00
Marco van den Heuvel
e66f04e056 Merge branch 'master' of https://github.com/blackystardust/cc65 2018-02-26 19:23:35 -08:00
Marco van den Heuvel
e3779978b2 Added proper 65sc02, 65ce02 and 4510 detection. 2018-02-26 19:22:54 -08:00
Marco van den Heuvel
122def9f12 Added proper 65sc02, 65ce02 and 4510 detection. 2018-02-26 19:19:13 -08:00
Greg King
33f602f9ad Shortenned the CBM close() by a byte and a cycle. 2018-02-26 15:07:13 -05:00
Oliver Schmidt
fc3fa173ae
Merge pull request #597 from polluks/patch-3
Small typo
2018-02-26 10:02:11 +00:00
Stefan
71e3330eca
Merge pull request #7 from cc65/master
Update
2018-02-26 01:36:38 +01:00
Stefan
924364d73d
Small typo 2018-02-25 22:38:58 +00:00
Oliver Schmidt
f19651cfea
Merge pull request #594 from greg-king5/pce-32k-rom
Change the PC-Engine's config., so that we can make 8K, 16K, and 32K carts.
2018-02-24 11:00:57 +00:00
Oliver Schmidt
938db1551f
Merge pull request #595 from greg-king5/geo-dio
Fix sector-number conversions in the CBM GEOS DIO code.
2018-02-24 10:54:26 +00:00
Greg King
39b4b6838f Made dio_read(), dio_write(), and dio_write_verify() catch sector number conversion errors. 2018-02-23 16:12:12 -05:00
Greg King
6fd56bf9b6 Fixed bugs in the geos-cbm DIO sector-number converter functions.
* The 16-bit comparison code actually didn't compare the high byte.
* This implementation supports only the 1541, 1571, and 1581; but, it didn't exclude the other drive types that GEOS supports.
* Two error code numbers were swapped.
* A 1571 converter didn't catch sector numbers that are too high.
* A 1581 converter didn't catch sector numbers that are too high.
2018-02-23 16:12:12 -05:00
Greg King
8476360e9f Fixed bugs in geos-cbm's dio_open().
* Trying to open an unused drive would leave a byte on the hardware stack.

* Too high device numbers weren't caught.
2018-02-23 16:12:12 -05:00
Greg King
3a0506ccb3 Changed the PC-Engine's configuration file, so that the command line can build 8K, 16K, and 32K carts.
Adjusted the PCE's document, the start-up code, and the PCE library test makefile.  That makefile shows how to post-process the linker's output file.
2018-02-23 16:06:49 -05:00
Oliver Schmidt
83890e56eb
Update dio.sgml 2018-02-22 13:30:50 +01:00
Stefan
631db73d35
Merge pull request #6 from cc65/master
Update
2018-02-21 22:44:17 +01:00
Bob Andrews
5df40bfe3e
Merge pull request #593 from blackystardust/master
Added GEOS 1.3 and 1.5 detection.
2018-02-16 17:35:18 +01:00
Marco van den Heuvel
b0ef67d14c Added GEOS 1.3 and 1.5 detection. 2018-02-15 15:24:58 -08:00
Bob Andrews
5d73f28a85
Merge pull request #592 from blackystardust/master
Improved GeOS version detection.
2018-02-14 19:36:43 +01:00
Marco van den Heuvel
e17b9177de Fixed GeOS -> GEOS and added newline to geossym2.inc. 2018-02-14 10:22:10 -08:00
Marco van den Heuvel
d93f84f4bc Improved GeOS version detection. 2018-02-13 19:19:40 -08:00
Greg King
33f05d1162 Added a definition for the CBM610's first CIA chip. 2018-02-10 16:14:53 -05:00
Oliver Schmidt
6f6fd33cae Added size_t. 2018-02-10 11:45:50 +01:00
Oliver Schmidt
b65981fc3a Reduced default stack size to a reasonable value.
The unexpanded Creativision has only $206 bytes of RAM available to cc65 programs. So it's a bad idea(tm) to reserve $180 bytes for the software stack. $40 bytes seems a much better default (aka guess).
2018-02-10 11:30:10 +01:00
Oliver Schmidt
4f3b47c3d7
Merge pull request #588 from polluks/master
Cleanup notes
2018-02-10 00:35:14 +00:00
Stefan
89799cd02e More notes 2018-02-10 00:08:28 +01:00
Stefan
46bdc016db Removed empty notes 2018-02-07 18:08:40 +01:00
Stefan
54f8dea29b Added note 2018-02-07 17:23:23 +01:00
Oliver Schmidt
af8a995116
Merge pull request #587 from polluks/master
Added missing documentation of header
2018-02-07 15:45:36 +00:00
Stefan
4d7098f2f2 Requested changes 2018-02-07 16:23:49 +01:00
Stefan
b69ee802fd Sorted 2018-02-07 03:07:30 +01:00
Stefan
a48f998162 Added missing function 2018-02-07 01:55:56 +01:00
Stefan
a227089ba1 Added missing documentation of header 2018-02-07 00:11:55 +01:00
Greg King
e9cbd42b18 Normalized the definitions of structs in <supervision.h>.
The change matches the way that I/O register structures are defined in other headers.  The names are defined as "struct", instead of as "pointer to struct".
2018-02-06 08:52:36 -05:00
Christian Groessler
ae4e9fab8c Atari: CONSOL port of GTIA is readable and writable.
Adjust include/_gtia.h accordingly.
2018-02-02 18:28:52 +01:00
Oliver Schmidt
dacee3b9ed Removed IRQ support from TGI drivers.
All but one TGI drivers didn't use IRQs. Especially when the TGI driver kernel was the only .interruptor this meant quite some unnecessary overhead because it pulled in the whole IRQ infrastructure.

The one driver using IRQs (the graphics driver for the 160x102x16 mode on the Lynx) now uses a library reference to set up a JMP to its IRQ handler.
2018-02-02 18:15:45 +01:00
Oliver Schmidt
7521ae888a Marked Apple II EXEHDR segment as optional.
The docs say "Use -D __EXEHDR__=0 to omit the header." so it should work without generating a linker warning.
2018-02-02 14:46:57 +01:00
Oliver Schmidt
d7afadb2fe Factored out target specific inclusion of target header.
So far conio.h included the target header to get the CH_... and COLOR_... macros. However tgi.h never did the same to get the TGI_COLOR_... macros. And some time ago the JOY_..._MASK macros moved from joystick.h into the target header yet joystick.h didn't include the target header.

Why wasn't that issue detected so far? Because about every program using TGI and/or the joystick uses CONIO too and therefore includes the target header that way.

However, conceptually it's clean to factor out the target header inclusion and have tgi.h and joystick.h do it like conio.h.

Apart from that user code may make direct use of target.h too.
2018-02-02 12:59:05 +01:00
Oliver Schmidt
2cf1bb89be Removed ACE header.
There's no code in the tool chain to set __ACE__ nor is there an ace.lib C library.
2018-02-02 12:35:40 +01:00
Oliver Schmidt
935f68f686 Harmonized the style of including headers from headers.
We surely don't care about some file I/O on host machines in 2018 ;-)
2018-02-02 12:28:22 +01:00
Oliver Schmidt
f15cd3e468 Removed IRQ support from joystick drivers. 2018-02-02 12:02:52 +01:00
Oliver Schmidt
1976d6cd32 Removed IRQ support from joystick drivers.
All but one joystick drivers didn't use IRQs. Espsecially when the joystick driver kernel was the only .interruptor this meant quite some unnecessary overhead because it pulled in the whole IRQ infrastructure.

I was told that the one driver using IRQs (the DXS/HIT-4 Player joystick driver for the C64) can be reworked to not do it. Until this is done that driver is defunct.
2018-02-01 22:38:36 +01:00
Oliver Schmidt
27dacca4d3 Added missing dummy libref. 2018-02-01 22:06:59 +01:00
Oliver Schmidt
9031320dff Added Makefile for recently added linker config test program. 2018-02-01 21:50:54 +01:00
Oliver Schmidt
5145235b97 Updated AppleCommander URL. 2018-02-01 21:46:56 +01:00
Oliver Schmidt
ef5461a32c Mention the recently added linker configs. 2018-02-01 00:18:07 +01:00
Oliver Schmidt
58bfe28244 Updated AppleCommander URL. 2018-01-31 23:52:08 +01:00
Stefan
fb03b1105c
Merge pull request #5 from cc65/master
Update
2018-01-31 20:40:49 +01:00
Oliver Schmidt
19ed94fe25 Adjust alternative ProDOS 8 I/O buffer allocation module to linker configs.
The Apple II linker configs don't define symbols for the STARTP segment anymore. There refer to the load/start address in the same way the executable file header does.
2018-01-31 15:06:37 +01:00
Oliver Schmidt
38049d22ba Provide symbole for RAM memory area.
The RAM memory area symbols are referred by the startup code. The 64k and 128k variant say "for assembler" so it may be not necessary to do that there. However given the "limited" state of documentation for the target I don't assign too much value to those statements.

Additionally it's unclear to me why two variants provide symbols for the ROM memory.
2018-01-31 14:53:31 +01:00
Oliver Schmidt
80b09ba9fc Significantly simplified recently added linker config files.
I just forgot about the 'start' segment attribute - which makes the scenario at hand dead easy.
2018-01-31 08:54:48 +01:00
Oliver Schmidt
855aceaba8 Added Apple II linker configs for programs including a hires screen.
The Apple II hires screen buffer is located at $2000 (and can't be moved). The usual way to get along with this is to load the cc65 program above the hires screen buffer at $4000. However, that means that it becomes difficult to make good use of the memory below the hires screen buffer. The simplest approach is to add that memory to the heap. But there are programs containing just lots of code and not much data. One could think of moving the code to the area below the hires screen after loading (like it is done with the code for the language card). But if the program is really large (and already contains code to be moved to the language card) it won't just fit into memory in the first place.

The alternative is to load the program at the usual $803 and have it "cover" the hires screen buffer. Of course the part of the program that actually "covers" the hires screen buffer mustn't contain anything necessary for the program. The downside of this approach is that the program file on disk contains 8kB that can't be used by the program. But instead of just containing zeros the program can as well contain a hires screen picture that can be displayed right after startup.

Now the user can have code loaded below the hires screen buffer by setting the code-name to LOWCODE. However, he needs to explicitly do so. Otherwise the memory below the hires screen is totally wasted.

Trivia: Allowing to do this hires screen buffer "covering" was the very reason to change tgi_init() to not clear the hires screen anymore.
2018-01-29 17:46:36 +01:00
Oliver Schmidt
374c7e815c
Merge pull request #577 from polluks/master
Moved initcgetc to initcputc
2018-01-25 12:35:21 +00:00
Stefan
caa40866c3 Moved initcgetc to initcputc 2018-01-23 13:02:47 +01:00
Oliver Schmidt
5cc1426346
Merge pull request #575 from groessler/something_to_pull
atari5200: put default display list into its own memory area
2018-01-22 15:03:58 +00:00
Christian Groessler
356c73f2cf atari5200.cfg: fix formatting 2018-01-21 15:42:12 +01:00
Christian Groessler
643152fb38 Fix last change, put display list at beginning of ROM. 2018-01-21 15:40:22 +01:00
Christian Groessler
2ef6514e47 atari5200: put default display list into its own memory area
This avoids 1K boundary crossing of the display list. Fix for issue #560.
2018-01-19 15:18:43 +01:00
Oliver Schmidt
811424cc1b
Added recently published ProDOS version. 2018-01-18 12:37:21 +01:00
Oliver Schmidt
ed3546d8b2
Merge pull request #574 from prandeamus/paravirt-fix
Call ParaVirtHooks on JMP (indirect)
2018-01-15 08:37:32 +00:00
prandeamus
1a95be9c3a 65C02 JMP (ind,x) opcode 7C 2018-01-14 19:42:29 +00:00
prandeamus
009f56afb6 65C02 version too. 2018-01-13 22:42:39 +00:00
prandeamus
c23f264fe4 Call ParaVirtHooks on JMP (indirect) 2018-01-13 18:30:53 +00:00
Christian Groessler
f0708db792 crt0.s ("none" target): fix initialization of sp variable. 2018-01-11 13:15:19 +01:00
Oliver Schmidt
9229bb1f3e
Merge pull request #571 from greg-king5/win64
Change the type of a cc65 variable that holds both integers and pointers.
2018-01-10 12:48:28 +00:00
Oliver Schmidt
5a39dfd56c
Merge pull request #570 from prandeamus/compiler-optimizer-check
Complain if unsupported flags are provided after -O
2018-01-10 12:21:09 +00:00
Greg King
c67e90dd19 Changed the type of a compiler variable that holds either integers or pointers.
The change allows cc65 to be compiled on 64-bit Windows, without getting warnings.  That OS is actually 32 bits with 64-bit pointers.  Its pointers are "long long" instead of "long".  The change uses type-names that are configured for the actual pointer width.
2018-01-09 05:34:16 -05:00
Greg King
da22c90d33 Shrank Telestrat initcwd.s by 3 bytes.
Changing when a loop test is done allowed the removal of an extra STA instruction.
2018-01-09 04:48:39 -05:00
prandeamus
e7aabce8e9 Complain if unsupported flags are provided after -O 2018-01-07 18:57:48 +00:00
Oliver Schmidt
1ea5889a87
Merge pull request #564 from bauen1/none-library
Add none.lib
2018-01-05 11:05:30 +00:00
bauen1
94077404f9
Added ctype.s to none.lib as suggested by oliverschmidt 2018-01-05 10:39:23 +01:00
bauen1
aa34aed7dd
Fixed unused import and export of none.cfg and none/crt0.s 2018-01-04 22:27:39 +01:00
bauen1
45482b4fb1
Fixed none/crt0.s to respect none.cfg 2018-01-04 22:14:01 +01:00
bauen1
cea8332084
Fixed none.cfg 2018-01-04 22:01:44 +01:00
bauen1
ef993f2fcf
none.cfg consistency changes 2018-01-04 21:29:58 +01:00
bauen1
60c68b1111
cl65 now links against none.lib when using --target none 2018-01-04 17:11:44 +01:00
bauen1
4759d3956e
Removed initialization of the stack from none.lib 2018-01-04 13:54:00 +01:00
bauen1
884dfcf3c1
Fixed none.lib missing symbols 2018-01-04 12:22:42 +01:00
bauen1
98b2b2544d
Added crt0 to none.lib 2018-01-04 12:07:35 +01:00
bauen1
14909f12fe
Implemented the requested changes.
Moved none to its alphabetic place in the Makefile
Reverted all changes to doc/customizing.sgml
2018-01-04 11:17:20 +01:00
bauen1
72bb32fcda
Revert "Renamed none.lib to no-platform.lib"
This reverts commit 26350714ee.

It breaks the build
2018-01-02 15:32:27 +01:00
bauen1
26350714ee
Renamed none.lib to no-platform.lib 2018-01-02 15:15:27 +01:00
Oliver Schmidt
040134e775
Fixed typo. 2018-01-02 13:48:30 +01:00
Oliver Schmidt
d348d82d5a
Merge pull request #561 from mrdudz/soft80peek
C64 soft80 cpeek stuff
2018-01-01 16:13:04 +00:00
mrdudz
4abe12c729 fix spelling 2018-01-01 14:01:25 +01:00
bauen1
d9ba279e89
Fixed a typo in doc/customizing.sqml 2018-01-01 01:34:53 +01:00
bauen1
b08839cac4
Added libray to none target 2017-12-31 16:15:27 +01:00
Oliver Schmidt
fc5bf3f5e8
Merge pull request #562 from groessler/something_to_pull
Implementation of getfirstdevice/getnextdevice for Atari.
2017-12-29 12:39:06 +00:00
mrdudz
783408080c convert to petscii 2017-12-28 17:52:27 +01:00
Christian Groessler
30c6018887 Implementation of getfirstdevice/getnextdevice for Atari. 2017-12-28 04:54:18 +01:00
mrdudz
f207a60365 some cleanup 2017-12-28 02:26:23 +01:00
mrdudz
142ba12634 updated testprog 2017-12-28 01:58:58 +01:00
mrdudz
0543ecabe2 added peek functions for soft80 2017-12-28 01:58:03 +01:00
Oliver Schmidt
9a8b7d9a23
Merge pull request #557 from polluks/master
Optimizing the stack size
2017-12-19 11:51:18 +00:00
greg-king5
c8dd88efad
Added missing "break;" statements to a "switch" statement. 2017-12-18 17:09:06 -05:00
Stefan
98e2b79ef4 Optimizing the stack size 2017-12-18 19:19:59 +01:00
Stefan
2fde8d35c2
Merge pull request #4 from cc65/master
Update
2017-12-18 11:21:00 +01:00
Oliver Schmidt
f5a2c52f80
Merge pull request #554 from polluks/patch-3
oops #550 again
2017-12-18 09:40:45 +00:00
Stefan
6497da262a
oops
I made a mistake.
2017-12-17 18:45:57 +01:00
Oliver Schmidt
bbbd4e4742
Merge pull request #553 from polluks/patch-1
Fixed memory config #551
2017-12-16 18:29:27 +00:00
Oliver Schmidt
fb193933cb
Merge pull request #552 from polluks/master
Added Oric-1 compatibility #550
2017-12-16 18:26:34 +00:00
Stefan
b4fe03e49f
Update c16.cfg 2017-12-16 02:36:31 +01:00
Stefan
afb758bd6c
Update c16-32k.cfg 2017-12-16 02:35:00 +01:00
Stefan
6452fbac89
Added new config #551 2017-12-16 01:04:05 +01:00
Stefan
41fab61253
Fixed memory config #551 2017-12-16 00:41:00 +01:00
Stefan
6faef87b49 Fixed Oric-1 compatibility #550 2017-12-15 23:51:39 +01:00
Oliver Schmidt
1a3b0e41f5
Merge pull request #545 from mrdudz/cbmpeek
cbm stuff from greggs pull request
2017-12-15 19:42:02 +00:00
mrdudz
2957acd133 some tweaks to testprog 2017-12-12 17:05:52 +01:00
mrdudz
892732f340 fix cpeeks() for C128 VDC 2017-12-12 17:05:24 +01:00
mrdudz
4da22fc6a0 fix cpeeks for CBM610 2017-12-12 04:32:39 +01:00
mrdudz
4d95e578f4 added missing tests 2017-12-12 03:49:07 +01:00
mrdudz
74b5540f76 copy cpeeks from generic version, this at least makes it work for 40 columns 2017-12-12 03:48:43 +01:00
mrdudz
9a609f6766 fix petscii conversion for C128 2017-12-11 21:53:00 +01:00
mrdudz
a54b4bebde PET screen memory is at $8000, not $0800 2017-12-11 21:15:29 +01:00
mrdudz
8902730756 cbm stuff from greggs pull request 2017-12-11 19:52:11 +01:00
Oliver Schmidt
947b09ad96 Removed OPC_EOR_abx duplicate. 2017-12-07 20:39:28 +01:00
Oliver Schmidt
563185998f Removed CBM chartype table. 2017-12-02 11:04:59 +01:00
Oliver Schmidt
e485e96de0 Suppress potential svnversion error output. 2017-11-30 19:17:45 +01:00
Oliver Schmidt
4641e36f0d
Merge pull request #541 from greg-king5/tgi-fix
Fix bugs in the Tiny Graphics Interface's document.
2017-11-30 18:11:18 +00:00
Greg King
ad9b7c0bfa Fixed the sort order of the function descriptions in the TGI document. 2017-11-30 11:56:38 -05:00
Greg King
a029c00660 Fixed a Table-Of-Contents bug in the TGI document.
The <toc> tag can't be put inside of a section.  It isn't needed, anyway; we can get a TOC by putting the header as a section, and the functions as subsections.
2017-11-30 11:38:12 -05:00
Oliver Schmidt
7e834a47b0
Merge pull request #533 from polluks/master
Splitting of funcref
2017-11-26 20:16:29 +00:00
Stefan
fa9a1cf2dc
Update tgi.sgml
Added missing ref.
2017-11-25 23:32:52 +01:00
Stefan
9725c44934
Update tgi.sgml
I should take more attention of Travis.
2017-11-25 23:09:19 +01:00
Stefan
aa30f50fbe
Update tgi.sgml
Fixed toc.
2017-11-25 22:39:41 +01:00
Stefan
41df21855a Splitting of funcref 2017-11-25 19:31:36 +01:00
Greg King
1912287231 Added missing names for the CIA registers in the C64/C128. 2017-11-25 13:29:50 -05:00
Oliver Schmidt
b74c179bf4
Merge pull request #530 from polluks/patch-1
Subversion fallback
2017-11-22 18:59:14 +00:00
Stefan
7e4db1fdd6
Option removed 2017-11-22 18:17:43 +01:00
Oliver Schmidt
d32d77c6a5
Merge pull request #531 from polluks/patch-2
Fix docs for #526
2017-11-22 09:26:58 +00:00
Stefan
61b2264327
Fix docs for #526
funcref.sgml is still growing and growing, how about outsourcing all TGI functions into tgi.sgml?
2017-11-22 01:35:42 +01:00
Stefan
44b13c1ca0
Subversion fallback
If you use don't use Git to access the repository, you will still get a revision number.
2017-11-22 01:02:02 +01:00
Oliver Schmidt
ab54f92024 Make use of C library waitvsync(). 2017-11-21 23:03:50 +01:00
Oliver Schmidt
6034b68f06 Bumped API version.
Removal of the joy_masks array with 7f52a770d9 was exactly the very type of change asking for a new API version.
2017-11-21 22:42:43 +01:00
Oliver Schmidt
3f8de9f026
Merge pull request #529 from polluks/master
Added standard joystick driver for the Supervision.
2017-11-21 10:09:53 +00:00
Stefan
f2e12b4715
defined DYN_DRV 2017-11-21 10:56:35 +01:00
Stefan
7d1c92dc12
New API 2017-11-21 10:33:48 +01:00
Stefan
c4baf9588e
directive removed 2017-11-21 10:29:35 +01:00
Stefan
f8f464846a
directive removed 2017-11-21 10:27:08 +01:00
Stefan
e49744ecd0
New API 2017-11-21 10:22:53 +01:00
Stefan
f9b4e0b574
Update supervision.h 2017-11-21 10:12:35 +01:00
Stefan
40f960f733
Date 2017-11-21 09:59:31 +01:00
Stefan
e9c16e62e7
Fix docs for #453 2017-11-21 09:51:35 +01:00
Stefan
55117039f0
Merge pull request #3 from polluks/polluks-sv-joy
Added standard joystick driver for the Supervision.
2017-11-21 06:59:55 +01:00
Stefan
949c2aa76f
Add files via upload 2017-11-21 06:57:02 +01:00
Stefan
12bfed04b1
Create supervision-stdjoy.s 2017-11-21 06:53:26 +01:00
Stefan
51731cb1f9
Merge pull request #2 from cc65/master
Update
2017-11-21 00:58:58 +01:00
Oliver Schmidt
c99a36155b
Merge pull request #524 from groessler/something_to_pull
Creativision documentation enhancements.
2017-11-15 10:02:29 +00:00
Christian Groessler
9ead405938 Creativision documentation enhancements. 2017-11-15 00:13:06 +01:00
jede
4e0958eae6 Bug corrected : Fwrite did not return number of byte written. 2017-11-14 22:04:57 +01:00
Stefan
88e96ff4d8
Merge pull request #1 from cc65/master
Update
2017-11-14 03:36:03 +01:00
Oliver Schmidt
06794b221d Made cbm_k_untlk() available. 2017-11-13 20:38:41 +01:00
Oliver Schmidt
258cdf2e07
Merge pull request #521 from jedeoric/master
Fix cc65 doc for Telestrat target
2017-11-12 10:02:56 +00:00
jede
3c97a04b25 Fix cc65 doc for telestrat target 2017-11-12 10:42:09 +01:00
Oliver Schmidt
0f87844a7c
Merge pull request #519 from jedeoric/master
[Telestrat] mkdir is now available
2017-11-11 21:09:59 +00:00
jede
64ed0a1937 Doc modified 2017-11-10 10:58:01 +01:00
Oliver Schmidt
da3a5081fe
Merge pull request #518 from polluks/patch-1
Missing declaration
2017-11-09 16:44:32 +00:00
Stefan
2fd99e9dec
Missing declaration 2017-11-09 17:36:21 +01:00
Oliver Schmidt
e49c33148c
Merge pull request #517 from Fabrizio-Caruso/gamate_joy2
Correct bits in gamate joystick detection
2017-11-09 15:43:41 +00:00
Fabrizio Caruso
0a61b061c7
Update gamate-stdjoy.s 2017-11-09 16:42:52 +01:00
Fabrizio Caruso
bf0ae22969
Update gamate-stdjoy.s 2017-11-09 16:36:06 +01:00
U-AMAIISDOM\fcaruso
e4a235b233 Correct bits in gamate joystick detection 2017-11-09 13:51:04 +01:00
Oliver Schmidt
b6f854be5e
Merge pull request #514 from pfusik/zlib-fix2
Fix another zlib bug
2017-11-08 10:45:12 +00:00
Piotr Fusik
84edf4cbfd Fix more than 256 codes of same length.
Fix all 256 literal codes of same length.
2017-11-07 20:10:19 +01:00
Oliver Schmidt
afcfba9355 Use macro actually defined in cbm_filetype.h. 2017-11-06 21:02:14 +01:00
Oliver Schmidt
59fed23824
Merge pull request #513 from pfusik/zlib-fix1
Fix zlib bug
2017-11-06 19:47:56 +00:00
Piotr Fusik
d3451bb299 Fix 256 codes of same length 2017-11-06 19:46:26 +01:00
Oliver Schmidt
e7137a230c
Merge pull request #510 from polluks/master
Alternative joystick interface for Atmos
2017-11-05 12:38:32 +00:00
Stefan
e64c42f224
Update atmos.sgml 2017-11-03 20:49:49 +01:00
Stefan
9ee4431994
Add files via upload
Alternative joystick interface
2017-11-02 21:11:08 +01:00
Greg King
de1f80571a Fixed the way that the disassembler looks for the end of a segment.
It checks only the bytes that actually were printed.  It won't show a bad error message when disassembling address $0000.  Fixes #506 on cc65's Github project.
2017-10-31 00:47:07 -04:00
jede
eae485dc64 Empty item removed 2017-10-28 00:40:56 +02:00
jede
807b55862d Now mkdir is working 2017-10-28 00:37:47 +02:00
jede
7435c2f3ca Fix doc/telestrat.sgml 2017-10-26 22:00:12 +02:00
Oliver Schmidt
15d9373ad7 Merge pull request #507 from jedeoric/master
[telestrat] tgi_line & tgi_outtext are available, toascii.s added, doc updated
2017-10-25 14:49:14 +00:00
jede
3bc0843afc FIX label for setpixelmode 2017-10-23 23:25:08 +02:00
jede
aaf8863de5 Merge branch 'master' of https://github.com/jedeoric/cc65 2017-10-23 23:04:22 +02:00
jede
ebfd218f62 Comment correction 2017-10-23 23:02:54 +02:00
jede
ed4458c162 Comment correction 2017-10-23 23:00:43 +02:00
jede
1403d797f0 Remove toascii.s 2017-10-23 20:52:22 +02:00
Oliver Schmidt
c0ce20e9cc Save/restore jmpvec as it is used by generated code - see g_callind(). 2017-10-23 18:57:28 +02:00
Oliver Schmidt
bd9b4ef60c Replaced three (logically) identical files with a single file. 2017-10-23 18:35:06 +02:00
Oliver Schmidt
c8d6ca908d Minor style fix. 2017-10-23 18:22:51 +02:00
jede
0517a2c2ab removing extra spaces 2017-10-22 23:12:12 +02:00
jedeoric
af1c7f0c8b Merge branch 'master' into master 2017-10-22 23:11:18 +02:00
jede
93f202850a toascii.s added, doc updated, tgi_line & tgi_outtext are available 2017-10-22 23:06:56 +02:00
Oliver Schmidt
4da1d3232f Merge pull request #504 from jedeoric/master
[Telestrat] TGI initialization,  some bugs (clrscr) correction, cgetc optimization, irq management
2017-10-22 11:14:55 +00:00
jede
2b7d4fff5a comment correction 2017-10-20 21:29:16 +02:00
jede
351a5ab20a Now setPixel works in TGI. 2017-10-20 21:03:30 +02:00
jede
f964fdbe56 Correction : authors 2017-10-16 18:18:36 +02:00
jede
195b5f0a07 Optimizing (from Polluks tip) 2017-10-16 18:15:53 +02:00
jede
18c94e123f tgi_clear, tgi_init, tgi_done, tgi_getmaxx, tgi_getmaxy are working 2017-10-16 18:08:48 +02:00
jede
7b74264720 irq.s added 2017-10-16 17:34:32 +02:00
jede
7107019d6f Adding IRQVec 2017-10-16 17:33:10 +02:00
jede
db1319de4c clrscr.s switch to text mode 2017-10-16 17:28:00 +02:00
jede
2ee7cf0377 I/O identifiers added 2017-10-16 16:11:37 +02:00
jede
256ba6bddf Adding XSOUT : Send A register to RS232 2017-10-16 16:06:18 +02:00
Greg King
bea5364b97 Added commit ca4ed290d5964dbe833224d967d3707e20972278's command-line option to the cl65 document. 2017-10-16 09:39:33 -04:00
Oliver Schmidt
820b4dbc77 Merge pull request #503 from jedeoric/master
[telestrat] cgetc is now available
2017-10-08 17:56:04 +00:00
jede
a01c8c238c Correcting comments 2017-10-08 18:14:26 +02:00
jede
ff12835ee2 Adding cgetc 2017-10-08 18:11:09 +02:00
Oliver Schmidt
e67bbcb0b2 Merge pull request #501 from clbr/master
cl65: Add support for --all-cdecl
2017-10-03 23:07:09 +02:00
Christian Groessler
a084ea8e42 Atari: split "setcursor" function out of cgetc.s source file into setcursor.s.
This function is used by many other CONIO functions, and the user program not
necessarily uses 'cgetc'. Having "setcursor" in a different object file saves
space in this case and also allows the user program to override it (e.g. when
not using GRAPHICS 0 mode).
2017-10-03 21:58:52 +02:00
Lauri Kasanen
ca4ed290d5 cl65: Add support for --all-cdecl 2017-10-03 18:46:39 +03:00
jede
56360ea054 optimize 2017-10-02 12:20:52 +02:00
jede
a1c8860f63 telestrat : cgetc add for conio 2017-10-01 23:23:03 +02:00
Oliver Schmidt
3a6430b13d Merge pull request #494 from jedeoric/master
[telestrat] Adding some vars, adding getcwd management, changing ZP address and ZP length
2017-09-27 09:52:19 +02:00
jede
95a88a787d remove FILENAME_MAX 2017-09-25 21:47:05 +02:00
jede
d8904c550b Fixing buffer overflow with cwd command (FILENAME_MAX must be at 50 +1 bytes) 2017-09-25 21:39:57 +02:00
jede
86741cb1dd correcting missing _ 2017-09-24 20:07:02 +02:00
jede
5bbb27c8af Fixing bug for cwd 2017-09-24 20:04:50 +02:00
jede
fabb6acf3f Initcwd is now working for telestrat 2017-09-24 19:23:44 +02:00
jede
60e41e3110 Adding XVARS primitive 2017-09-24 19:22:43 +02:00
jede
d4c6c995ba Correcting missing return line :/ 2017-09-24 11:57:52 +02:00
jede
fdd789edd8 correcting some return lines 2017-09-24 11:56:55 +02:00
jede
c640619db5 Add some bytes in ZP block in order to able to link with o65 files 2017-09-24 11:55:37 +02:00
jede
1c7c44e12c adding some vars 2017-09-24 11:46:52 +02:00
greg-king5
cdca644c83 Merge pull request #487 from polluks/patch-1
Fixed address in CBM 510 document.
2017-09-14 12:08:10 -04:00
Stefan
945dcfd63a Fixed address
See cbm510.cfg
2017-09-13 23:51:07 +02:00
Christian Groessler
7623d4ea83 conio.h: include 'creativision.h' when compiling for this target. 2017-09-12 21:57:16 +02:00
Greg King
5802b0963f Made <conio.h> include <atari5200.h> when we compile for the Atari 5200 console.
atari5200.lib has some conio functions.
2017-09-10 12:27:57 -04:00
Oliver Schmidt
308f74561c Merge pull request #482 from greg-king5/pet-kbrepeat
Make the CBM Pet kbrepeat() work on both 40-/80-column machines.
2017-09-06 09:19:04 +02:00
Greg King
51765c6e5c Removed an unwanted button mask table from a VIC-20 joystick driver.
It had put the jump table at the wrong place.  Programs crashed as soon as they tried to initiate the driver.
2017-09-05 16:56:20 -04:00
Greg King
3c0b8c4e86 Made the CBM Pet kbrepeat() work on both 40-column and 80-column machines.
Put the kbrepeat() description in an alphabetical position in the function document.
2017-09-05 09:19:01 -04:00
Oliver Schmidt
0deeccebf8 Added JOY_FIRE.
According to https://en.wikipedia.org/wiki/Atari_8-bit_computer_peripherals it seems appropriate to add a JOY_FIRE definition for the ATARI.
2017-09-04 09:41:19 +02:00
Oliver Schmidt
4cfa3e6f92 Merge pull request #480 from phs/phs/docs-typo
At most 256 bytes will be reserved
2017-09-04 09:15:36 +02:00
Phil Smith
ded1c20190
Reserve space in examples with .res 2017-09-02 19:30:14 -07:00
Phil Smith
929553dc8d
At most 256 bytes will be reserved 2017-09-02 00:02:47 -07:00
Oliver Schmidt
4aa19494f5 Removed dysfunctional kbrepeatdelay() and kbrepeatrate().
As discussed in https://github.com/cc65/cc65/pull/452 after my premature merge the two functions in question don't work as expected.

Additionally I adjusted several style deviations in the pull request in question.
2017-08-30 16:37:59 +02:00
Greg King
7a1f5358df Fixed missing name and semicolon in two device structs. 2017-08-23 01:46:57 -04:00
Oliver Schmidt
acf831658f Adjusted to recent driver interface change.
Please note that this change is absolutely untested!

Apart from the recent driver interface change:
- vic20-stdjoy.s was "slightly broken" because it didn't clear x on return from joy_read.
- vic20-ptvjoy.s was "heavily broken" because it returned a totally different set of bits of the first joystick.
2017-08-20 17:17:39 +02:00
Oliver Schmidt
20c85c8a1c Minor style adjustment. 2017-08-20 17:17:38 +02:00
Oliver Schmidt
a817da7c6b Adjusted to recent driver interface change.
Please note that this change is absolutely untested!
2017-08-20 17:17:37 +02:00
Oliver Schmidt
b5a4e5667a Merge pull request #452 from mrdudz/kbrepeat
kbrepeatdelay and kbrepeatrate for cbm targets
2017-08-20 14:15:37 +02:00
Oliver Schmidt
0c54a19a0b Adjusted to recent driver interface change.
The change is inspired by the code of the standard joystick driver. It is however absolutely untested.

Note: Sites like http://raster.atariportal.cz/english.htm state that there needs to be a delay when reading joysticks via the MultiJoy adapter. There's no such delay in the driver. But I don't dare to decide to add it.
2017-08-20 11:49:02 +02:00
mrdudz
3c3558892e add note on fastcall 2017-08-19 19:16:31 +02:00
mrdudz
960957075f use fastcall 2017-08-19 19:14:24 +02:00
Oliver Schmidt
7f52a770d9 Removed joy_masks array.
So far the joy_masks array allowed several joystick drivers for a single target to each have different joy_read return values. However this meant that every call to joy_read implied an additional joy_masks lookup to post-process the return value.

Given that almost all targets only come with a single joystick driver this seems an inappropriate overhead. Therefore now the target header files contain constants matching the return value of the joy_read of the joystick driver(s) on that target.

If there indeed are several joystick drivers for a single target they must agree on a common return value for joy_read. In some cases this was alredy the case as there's a "natural" return value for joy_read. However a few joystick drivers need to be adjusted. This may cause some overhead inside the driver. But that is for sure smaller than the overhead introduced by the joy_masks lookup before.

!!! ToDo !!!

The following three joystick drivers become broken with this commit and need to be adjusted:
- atrmj8.s
- c64-numpad.s
- vic20-stdjoy.s
2017-08-19 19:11:28 +02:00
Bob Andrews
5dcebbccb6 Merge branch 'master' into kbrepeat 2017-08-06 20:22:52 +02:00
mrdudz
99e6dd18d6 resolve conflict 2017-08-06 20:20:22 +02:00
mrdudz
dafe3c1e3c added documentation for the kbrepeat... functions 2017-08-06 20:15:35 +02:00
mrdudz
bd9208879e added prototypes and proposed constants 2017-08-06 18:09:40 +02:00
Oliver Schmidt
f5e9b4012a Merge pull request #473 from groessler/something_to_pull
atari5200.inc: fix formatting
2017-08-03 00:46:22 +02:00
Christian Groessler
f9c59a0976 atari5200.inc: fix formatting 2017-08-02 23:59:32 +02:00
Oliver Schmidt
92ff854bff Removed undesirable empty lines. 2017-07-31 13:50:27 +02:00
Oliver Schmidt
16ec131586 Merge pull request #472 from gungwald/master
Added doc for file types and aux types
2017-07-31 13:46:20 +02:00
Bill Chatfield
0bd5a8a331 Made corrections according to review comments 2017-07-30 19:51:23 -04:00
Bill Chatfield
85e572f4e1 Made corrections according to review comments 2017-07-30 19:49:20 -04:00
Bill Chatfield
9d89613bb2 Added documentation for setting the file type for fopen. 2017-07-29 01:25:07 -04:00
Bill Chatfield
2c7b757b4c Documented _filetype and _auxtype 2017-07-28 17:44:13 -04:00
Oliver Schmidt
375ee571c2 Removed 'fire'. 2017-07-28 19:19:11 +02:00
Oliver Schmidt
ef17e65c1b Merge pull request #467 from pmjdebruijn/joy
joy: refactor generic joy_masks array indices and macros
2017-07-28 19:17:50 +02:00
Oliver Schmidt
5bb6e62b84 Merge pull request #471 from gungwald/master
Added ProDOS file types and auxiliary types
2017-07-28 18:22:24 +02:00
Bill Chatfield
80c1c94a87 Corrected comment formatting 2017-07-28 12:16:55 -04:00
Bill Chatfield
f40bb93677 Added Variables section comment per convention 2017-07-28 12:12:18 -04:00
Bill Chatfield
abb2e8034b Moved file type variables to apple2_filetype.h 2017-07-28 12:09:58 -04:00
Bill Chatfield
9459f11688 Corrected copyright and moved file type globals
The file type globals., _filetype and _auxtype, were moved from apple2.h to this file.
2017-07-28 12:01:57 -04:00
Bill Chatfield
91d0659663 Rolled back changes to exclude vim swap files
Only files generated by the tools in the project are to be ignored
2017-07-28 11:29:11 -04:00
Bill Chatfield
e64e11d2c5 Finished adding all types and comments 2017-07-27 14:44:02 -04:00
Bill Chatfield
a623169477 Added ProDOS file type definitions 2017-07-26 11:15:49 -04:00
Pascal de Bruijn
c802c9c946 joy: refactor generic joy_masks array indices and macros 2017-07-23 23:45:52 +02:00
Oliver Schmidt
5d333239c6 Merge pull request #468 from pmjdebruijn/samples
make changes
2017-07-23 02:09:20 +02:00
Oliver Schmidt
f0d760de4a Merge pull request #462 from pmjdebruijn/pragma-message
pragma: add minimalist message pragma implementation
2017-07-22 16:54:23 +02:00
Pascal de Bruijn
19f6ae1d54 make: change uppercase prefix var 2017-07-22 16:38:50 +02:00
Pascal de Bruijn
64581b65b0 samples: install to subdirectory 2017-07-22 16:33:42 +02:00
Pascal de Bruijn
80b27bde5e pragma: add minimalist message pragma documentation
documents 6e93c1ba73
2017-07-22 15:35:24 +02:00
Oliver Schmidt
d90f032114 Merge pull request #464 from pmjdebruijn/joy
expand nes/pce joystick defines
2017-07-21 16:18:26 +02:00
Pascal de Bruijn
8ad72fc9ca pce: add system specific joy_masks array indices and macros 2017-07-19 18:29:35 +02:00
Pascal de Bruijn
d277055b5a nes: add system specific joy_masks array indices and macros 2017-07-19 18:14:44 +02:00
Pascal de Bruijn
2d9922a46e nes: remove semiredundant KEY_ defines
There are already JOY_ defines for most of these, and this should
be expanded upon instead.
2017-07-19 18:02:13 +02:00
Pascal de Bruijn
6e93c1ba73 pragma: add minimalist message pragma implementation
for example:

#pragma message ("in a bottle")

results in:

hello.c(207): Note: in a bottle
2017-07-19 17:58:13 +02:00
Oliver Schmidt
6002e59c28 Merge pull request #453 from mrdudz/waitvsync
waitvblank for cbm targets
2017-07-18 15:38:27 +02:00
mrdudz
b6d3d32e88 wait for line 0 instead of last line 2017-07-18 01:06:20 +02:00
mrdudz
8eee51913a add headers/fix formatting 2017-07-18 01:04:53 +02:00
mrdudz
c24080f289 do banking 2017-07-18 00:41:54 +02:00
mrdudz
cbdad764f0 oops 2017-07-18 00:01:15 +02:00
mrdudz
fe850fece8 implement waitvsync for plus4/c16 2017-07-17 23:55:18 +02:00
mrdudz
33791c6efd added prototype to cbm.h 2017-07-17 23:43:08 +02:00
mrdudz
d965601a5e fix sgml 2017-07-17 23:31:01 +02:00
mrdudz
1abce3a2a1 rename all waitvblank() to waitvsync() 2017-07-17 23:15:05 +02:00
greg-king5
f5615c6ed4 Merged pull request #459 from "pmjdebruijn/pragma".
pragma: bring pragma_t enum in line with Pragmas struct
2017-07-17 15:52:16 -04:00
Pascal de Bruijn
ea7f4d7489 pragma: bring pragma_t enum in line with Pragmas struct
fixes an inconsequential inconsistency, might prevent some
confusion in the future.
2017-07-17 19:43:11 +02:00
Oliver Schmidt
6de78c536f Made DOS 3.3 IRQ statement more general.
I recently came across that the question if a driver is compatible with DOS 3.3 isn't about the fact if it actually uses IRQs but if it potentially could use IRQs as the driver kernel pulls in the IRQ handler anyway. This is especially suboptimal in the scenario of statically linked drivers where it is concpetually totally clear at link time they use IRQs or not. Apart from that it might make sense to be able to define on a per-target basis if _any_ of the drivers of a certain class uses IRQs. If that isn't the cases the driver kernel for that driver class for that target could omit IRQ handling too. I'm aware that Uz imagined drivers being loaded which weren't known when the program was linked - but I don't see this.
2017-06-30 09:50:28 +02:00
Oliver Schmidt
26a2d8a5c6 Merge pull request #457 from pfusik/const-arrays
Make some arrays const.
2017-06-30 09:28:40 +02:00
Oliver Schmidt
7c560bef87 Merge pull request #456 from greg-king5/make-dep
Add a makefile dependency for the libraries' "extra" files.
2017-06-30 09:25:10 +02:00
Piotr Fusik
c0812670c1 Fix coding style. 2017-06-30 07:35:21 +02:00
Greg King
141c25b42b Added the extra dependency file's directory as an order-only prerequisite.
The extra dependency files are put into different places than the extra object files' location.  Therefore, the rule must pre-make two directories.
2017-06-29 13:56:29 -04:00
Piotr Fusik
b31ae57be1 Make some arrays const. 2017-06-28 20:43:31 +02:00
Greg King
d1501731e4 Added a makefile dependency for the libraries' "extra" files.
Some of the files in "libsrc/*/extra/" include other library files.  But, the "lib/*.o" files weren't rebuilt when those other files changed.

The new dependency rules must be "bootstrapped".  You must force a rebuild of all of the extra library object files (it will create the dependency files).  Use these commands:

rm lib/*.o
make lib
2017-06-28 05:51:46 -04:00
Oliver Schmidt
4cf7ee1dba Merge pull request #455 from greg-king5/osic1p-code
Add functions that make it easier to write portable programs for OSI computers.
2017-06-26 14:28:55 +02:00
Greg King
bd883327ac Added two functions that make it easier to write portable programs for Ohio Scientific computers. 2017-06-26 02:34:23 -04:00
mrdudz
3ff4a1333c use BIT so akku wont get trashed at least in 40 cols mode 2017-06-22 00:19:39 +02:00
mrdudz
e985e0beb4 fixed zp locations provided by polluks :) 2017-06-22 00:04:42 +02:00
mrdudz
49aad01bf1 dont trash akku if possible, use VDC register when in 80column mode 2017-06-21 23:18:00 +02:00
Oliver Schmidt
8fcb5139da Merge pull request #454 from greg-king5/dup-segment
Stop cc65 from putting redundant .segment directives into its output file.
2017-06-17 11:25:10 +02:00
Greg King
d3ccc289c1 Stopped cc65 from putting redundant .segment directives into its Assembly output. 2017-06-16 21:53:50 -04:00
mrdudz
dd14f15f94 added fixed files for c64/c16/plus4/vic20/pet 2017-06-17 03:46:53 +02:00
mrdudz
b523f070f3 fixed a few things, compiles again :) 2017-06-17 03:01:31 +02:00
mrdudz
a42feca228 fixed some stuff, compiles again :) 2017-06-17 02:37:34 +02:00
mrdudz
035621aa95 fixed code a bit so it compiles again :) 2017-06-17 02:26:54 +02:00
Oliver Schmidt
98a2c324f8 Merge pull request #450 from greg-king5/gotoxy-label
Add a missing label to some conio cursor movement functions.
2017-06-16 09:20:29 +02:00
Greg King
30f941ba39 Added a missing label to some conio cursor movement functions.
It had prevented other functions, e.g. cputs(), from being linked into a program.
2017-06-15 16:44:46 -04:00
Oliver Schmidt
f44406c46f Merge pull request #446 from clbr/lz4
Add LZ4 decompression support
2017-06-10 23:23:12 +02:00
Lauri Kasanen
4235e569d2 Small lz4 optimizations 2017-06-09 16:57:47 +03:00
Lauri Kasanen
135041ac3c Add lz4 doc 2017-06-09 10:54:50 +03:00
Lauri Kasanen
c444ed5e4f Mention the optimizations in a comment 2017-06-09 10:42:24 +03:00
Lauri Kasanen
bba961e54d Use hex immediates 2017-06-09 10:40:17 +03:00
Lauri Kasanen
cd460a8160 Remove _ from internal vars 2017-06-09 10:37:50 +03:00
Lauri Kasanen
e85796e028 Edit comment style, add second const 2017-06-09 10:35:16 +03:00
Oliver Schmidt
4156538546 Merge pull request #447 from greg-king5/regression-optimate
Add a missing -O configuration to some regression-test make-files.
2017-06-07 16:52:37 +02:00
greg-king5
06c3cd8307 Added a missing -O configuration. 2017-06-07 10:31:09 -04:00
greg-king5
e24bb372d0 Added a missing -O configuration. 2017-06-07 10:26:34 -04:00
greg-king5
a397a8c1a1 Added missing -O configuration. 2017-06-07 10:20:20 -04:00
Lauri Kasanen
ee49ecdf43 Expand tabs to spaces in lz4.s 2017-06-06 19:31:16 +03:00
Lauri Kasanen
e75a59d7a8 Add LZ4 decompression support 2017-06-06 18:48:25 +03:00
Oliver Schmidt
b8f30ba0de Merge pull request #436 from bbbradsmith/ca65_define_macro_doc
Small improvement to ca65 macro documentation
2017-06-05 15:03:37 +02:00
Oliver Schmidt
682fd226ae Merge pull request #442 from polluks/patch-6
Use verbosity
2017-06-03 22:06:27 +02:00
Oliver Schmidt
6549457929 Merge pull request #443 from polluks/patch-7
More POSIX.2, staying compatible
2017-06-03 22:05:10 +02:00
Oliver Schmidt
1a20630d2a Merge pull request #444 from polluks/patch-8
Verbosity was missing; POSIX operations
2017-06-03 22:04:52 +02:00
Stefan
52642f6c8f Deprecated commands mentioned 2017-05-30 02:05:35 +02:00
Stefan
0a011c31ea Update ar65.sgml 2017-05-28 16:22:34 +02:00
Stefan
80feb80168 Update main.c 2017-05-28 16:17:34 +02:00
Stefan
ed65eaf682 Verbosity was missing; POSIX operations 2017-05-28 16:12:02 +02:00
Stefan
49e22f566f Update main.c 2017-05-28 15:29:49 +02:00
Stefan
ea9430e28e Update list.c 2017-05-28 15:22:33 +02:00
Stefan
c9c2562c14 Update list.c 2017-05-28 15:13:43 +02:00
Stefan
843c5442b1 Update list.c 2017-05-28 13:13:53 +02:00
Stefan
9bdcb0a31b More POSIX.2, staying compatible 2017-05-28 00:35:38 +02:00
Stefan
ff33939385 Use verbosity 2017-05-28 00:29:53 +02:00
Oliver Schmidt
035baa49bd Merge pull request #438 from bbbradsmith/ca65_rand_comment
rand.s comment update
2017-05-26 15:16:42 +02:00
Oliver Schmidt
c269caaded Merge pull request #441 from polluks/patch-3
Small typo
2017-05-26 11:03:57 +02:00
Oliver Schmidt
8f9c7f0d60 Merge pull request #440 from polluks/patch-5
Also Oricutron mentioned
2017-05-26 11:03:06 +02:00
Oliver Schmidt
162d01519b Merge pull request #439 from polluks/patch-4
Some clean-up
2017-05-26 11:02:02 +02:00
Stefan
3b33af88cf Oricutron mentioned 2017-05-26 01:44:33 +02:00
Brad Smith
950d65e8ed detectabl > detectable 2017-05-25 03:20:11 -04:00
Brad Smith
1602aab6e9 forgot to update comments from earlier #323 rand.s change 2017-05-25 03:01:25 -04:00
Greg King
e31133c804 Added "html" and "info" goals to the top-level Makefile.
They are for people who don't want to build both types of documents at the same time.
2017-05-24 18:49:02 -04:00
Oliver Schmidt
242532a8df Merge pull request #437 from greg-king5/cl65-E
Add a "-E" description to cl65's document.
2017-05-24 23:41:16 +02:00
Greg King
ca1b9deb59 Added a description of the "-E" command-line option to cl65's document.
Improved other descriptions, to make them more consistent and accurate.
2017-05-24 16:47:12 -04:00
Oliver Schmidt
1bbe7043e1 Merge pull request #426 from MonteCarlos/master
added -E switch to cl65 for >>stop after the preprocessing stage<<.
2017-05-24 09:44:24 +02:00
Stefan
87a9e0ce4f clean-up 2017-05-24 00:04:52 +02:00
Brad Smith
051cf11ce6 expanding macro examples, trying to adhere to style guidelines 2017-05-23 17:07:45 -04:00
mc78
f87a575d4d added missing spaces before braces. added unknown option msg if not given -Wc|l|a when passing options to subprocess 2017-05-23 22:57:27 +02:00
Brad Smith
355696d17d ca65 documentation of .define macros, making note that parentheses in ca65 macros are problematic especially when thinking of them as "C style", replacing unclear example with an example showing how accidental parentheses can cause a problem. 2017-05-22 21:33:02 -04:00
Stefan
d9a8c30053 typo 2017-05-22 23:53:51 +02:00
mc78
21b1add984 added four escaped tabs to -E Stop after .... description 2017-05-22 23:21:55 +02:00
mc78
3157e4be1e added empty lines and spaces according to olivers comments. Made local functions static. 2017-05-22 23:07:31 +02:00
Oliver Schmidt
1c54213091 Merge pull request #433 from clbr/trampoline-fixes
Trampoline fixes
2017-05-20 12:29:10 +02:00
Oliver Schmidt
ce56ba927a Merge pull request #435 from greg-king5/wrapped-call
Add more info to the docs about "#pragma wrapped-call".
2017-05-20 12:28:24 +02:00
Lauri Kasanen
05b73276c2 Update test description 2017-05-20 09:53:30 +03:00
Greg King
39e55bdb77 Added more info to the documentation of "#pragma wrapped-call". 2017-05-20 01:41:49 -04:00
Lauri Kasanen
e8a735492d Correct comment style 2017-05-19 15:38:50 +03:00
Lauri Kasanen
901ac80026 Wrapper functions use all registers 2017-05-19 15:25:50 +03:00
Lauri Kasanen
80e6afd335 Add two new trampoline test cases 2017-05-19 14:34:10 +03:00
Oliver Schmidt
938fd5e655 Merge pull request #431 from polluks/patch-2
shorter code
2017-05-19 00:23:50 +02:00
Stefan
75028e4108 shorter code 2017-05-18 23:58:10 +02:00
Oliver Schmidt
0d4edc326e Merge pull request #430 from polluks/patch-1
VIC's kernal does not support CTRL+[
2017-05-18 22:45:50 +02:00
Oliver Schmidt
16a2beaaca Adjusted VS project files to commit 11b01b908d 2017-05-18 22:40:18 +02:00
Stefan
70b541b81e Changed section 2017-05-18 21:21:02 +02:00
Oliver Schmidt
11b01b908d Merge pull request #424 from clbr/trampoline
Trampoline support
2017-05-18 16:29:34 +02:00
Lauri Kasanen
219b239a34 Adjustments in response to latest comments 2017-05-18 17:14:26 +03:00
Lauri Kasanen
4c05c46cd1 Remove RAM-trampoline array support 2017-05-18 16:11:39 +03:00
Lauri Kasanen
f6fa74a636 Rename trampoline to wrappedcall everywhere 2017-05-18 16:00:04 +03:00
Lauri Kasanen
7feced8862 More tabs to spaces 2017-05-18 15:54:47 +03:00
Lauri Kasanen
a590b99f5b Align with spaces instead of tabs here 2017-05-18 14:21:43 +03:00
Stefan
c6cab0bb27 VIC's kernal does not support CTRL+[ 2017-05-18 12:59:03 +02:00
Oliver Schmidt
390ee4e22f Merge pull request #429 from pfusik/opt-stdfunc
Optimize the inlined strlen/memcpy/memset
2017-05-17 22:58:54 +02:00
Oliver Schmidt
73f1c0e11d Migrate 'encrypted variables' variables to 'repository settings'.
The GitHub token used for GitHub Pages deployment was revoked (see https://blog.travis-ci.com/2017-05-08-security-advisory) so I took the opportunity to make use of the "new" repository settings feature instead of fiddling with variable encryption again.
2017-05-17 20:56:21 +02:00
Oliver Schmidt
f151142e6a Keep GCC from complaining about 'List' may be used uninitialized in this function. 2017-05-17 19:39:02 +02:00
Oliver Schmidt
298dda0e71 Increased GCC optimization level. 2017-05-17 18:30:35 +02:00
Piotr Fusik
675dd3c963 Optimize the inlined memcpy/memset for the sizes of 128/129. 2017-05-17 10:08:08 +02:00
Piotr Fusik
6011bdb2f6 Optimize the inlined strlen. 2017-05-17 10:00:35 +02:00
Lauri Kasanen
ac7a0e21ac Correct missed doc label 2017-05-16 20:14:19 +03:00
Lauri Kasanen
ca41af41c2 Rename pragma trampoline to wrapped-call, value to identifier 2017-05-16 20:10:24 +03:00
mc78
d70a9507a7 replaced tabs with spaces which accidently were introduced. 2017-05-16 13:31:10 +02:00
mc78
691df09a1f According to recent comments on my recent pull request, -Wc checking for -E flag has been removed again. Intead, -E flag has been added to cl65 without need of -Wc. Two functions have been introduced to disable compile, link or both. These function remove assigment repetions to DoAssemble and DoLink for litte overhead, having the maintainability in mind. 2017-05-16 13:13:09 +02:00
mc78
4cbfb4e199 added -E switch to cl65 for >>stop after the preprocessing stage<<.
added compilation and assemblation disable after -Wc -E also with -E beeing part of a comma separated list of arguments
2017-05-12 12:23:30 +02:00
Oliver Schmidt
0291c92ffb Merge pull request #425 from clbr/arrayaccess
Add fast paths for char postinc/dec
2017-05-09 19:26:41 +02:00
Lauri Kasanen
077b14ccfa test/val/postincdec: Test for the final val value 2017-05-08 10:19:26 +03:00
Lauri Kasanen
7adcde1707 Add explicit postinc/dec testcase 2017-05-07 20:35:49 +03:00
Lauri Kasanen
a2f61c667a Update comments and location checks according to Greg 2017-05-07 20:31:41 +03:00
Lauri Kasanen
ead0338c0d Add fast path for char postdec 2017-05-06 13:35:39 +03:00
Lauri Kasanen
767f093ff8 Add fast path for char postinc 2017-05-06 13:35:39 +03:00
Lauri Kasanen
2890b3a810 Pragma trampoline 2017-05-02 20:51:53 +03:00
Lauri Kasanen
9c86c03a96 Add test case 2017-05-02 20:43:41 +03:00
Lauri Kasanen
d091a57e91 Trampoline stack 2017-05-02 20:43:41 +03:00
Lauri Kasanen
679bfb0ae9 Add IntPtrStack 2017-05-01 21:08:04 +03:00
Lauri Kasanen
a84463a3df callptr4 2017-05-01 21:08:03 +03:00
Lauri Kasanen
82e62209d6 Document pragma trampoline 2017-05-01 21:08:03 +03:00
Oliver Schmidt
18b0aaf9f2 Removed help for non-existent option. 2017-04-15 23:12:19 +02:00
Oliver Schmidt
9b243ff68c Merge pull request #418 from greg-king5/while-nothing
Fix the handling of the C construct "while (0) { }".
2017-04-07 16:07:38 +02:00
Greg King
1aab287189 Fixed the handling of "while (0) {}".
It's a corner case; but, conditional macroes might create it -- better safe than sorry.
2017-04-07 09:26:58 -04:00
Oliver Schmidt
e43dbe1c24 Just some white space fixes of recently contributed code. 2017-04-06 17:53:57 +02:00
Oliver Schmidt
be772c0198 Bumped version.
As suggested the incompatibility resulting from 02daf9f8b5 makes a new version appropriate.
2017-04-06 12:22:39 +02:00
Oliver Schmidt
5d129f6e8a Merge pull request #417 from greg-king5/sim-interrupts
sim65: Fix the simulations of the stack pointer and the "break" and decimal flags.
2017-04-05 10:57:47 +02:00
Greg King
dce5783dc9 Fixed the simulations of the stack pointer and the "break" and decimal-mode flags.
* The pointer wraps around the stack page.
* The break flag exists on only the stack, and only after an interrupt.
* 65C02 interrupts clear the decimal-mode flag.
2017-04-04 13:23:44 -04:00
Oliver Schmidt
e806515541 Removed workaround. 2017-04-04 15:53:14 +02:00
Oliver Schmidt
93193727be Removed workaround. 2017-04-04 15:52:37 +02:00
Oliver Schmidt
cd27fef6a8 Removed workaround. 2017-04-04 15:52:01 +02:00
Oliver Schmidt
3789174162 Removed workaround. 2017-04-04 15:51:00 +02:00
Oliver Schmidt
14268510f5 Removed workaround. 2017-04-04 15:45:24 +02:00
Oliver Schmidt
275b27647e Removed superfluous final linefeed. 2017-04-04 15:43:56 +02:00
Oliver Schmidt
233dd5062a Merge pull request #389 from IrgendwerA8/stringimprovements
Optimization of string functions (size & speed).
2017-04-04 15:39:37 +02:00
Oliver Schmidt
4e856546c1 Minor language update. 2017-04-04 13:42:57 +02:00
Greg King
3b17c3a411 Fixed 2 typoes.
Warning messages from nsgmls usually mean a typing mistake a few lines above the first line that's named by nsgmls.
2017-04-04 07:23:05 -04:00
Oliver Schmidt
9b34509956 Use the more explicit tag style for recently added internal links. 2017-04-04 00:41:40 +02:00
Oliver Schmidt
02daf9f8b5 So far the built-in inlining of several known standard function was always (!) enabled and the option -Os enabled additional, potentially unsafe inlining of some of those functions.
There were two aspects of this behavior that were considered undesirable:
- Although the safe inlining is in general desirable it should only be enabled if asked for it - like any other optimization.
- The option name -Os implies that it is a safe option, the potentially unsafe inlining should have a more explicit name.

So now:
- The option -Os enables the safe inlining.
- The new option --eagerly-inline-funcs enables the potentially unsafe inlining (including the safe inlining).

Additionally was added:
- The option --inline-stdfuncs that does like -Os enable the safe inlining but doesn't enable optimizations.
- The pragma inline-stdfuncs that works identical to --inline-stdfuncs.
- The pragma allow-eager-inline that enables the potentially unsafe inlining but doesn't include the safe inlining. That means that by itself it only marks code as safe for potentially unsafe inlining but doesn't actually enable any inlining.
2017-04-03 23:20:26 +02:00
Oliver Schmidt
cbb2833c01 Merge pull request #414 from IrgendwerA8/SED_Fix
Fixed sim65 SED
2017-03-30 12:26:37 +02:00
IrgendwerA8
170d96898f Fixed SED 2017-03-30 12:17:29 +02:00
Oliver Schmidt
5dbacb538e Merge pull request #411 from pfusik/bss-name-regression
Fix regression of #pragma bss-name
2017-03-22 13:44:48 +01:00
Greg King
01f5baf03d Fixed SGML typo. 2017-03-21 21:23:48 -04:00
Piotr Fusik
8e35a82c91 Fix regression of #pragma bss-name
Closes #409
2017-03-21 22:35:25 +01:00
Oliver Schmidt
5b3611265b Revert to recursively expanded var.
4a6bca0b56 needed to move to a simply expanded variable but cc82cd9992 made that unnecessary again.
2017-03-21 20:54:55 +01:00
Oliver Schmidt
669113b595 Added missing line continuation.
Fixes https://github.com/cc65/cc65/issues/408
2017-03-21 20:45:51 +01:00
Oliver Schmidt
fe59626953 Merge pull request #407 from IrgendwerA8/sim65_fix
Fixed addressing error for TSB/TSR and enabled tests again.
2017-03-21 11:21:48 +01:00
IrgendwerA8
cc82cd9992 Fixed addressing error for TSB/TSR and enabled tests again. 2017-03-20 21:53:07 +01:00
Oliver Schmidt
5095dd72b2 Merge pull request #402 from IrgendwerA8/runtime_improvements
few 6502 and some 65SC02 runtime optimizations
2017-03-20 11:34:06 +01:00
Oliver Schmidt
0851e3d694 Allow to control test Makefile output via QUIET (like libsrc). 2017-03-20 11:22:04 +01:00
IrgendwerA8
1abfa98290 minor style changes 2017-03-19 20:51:54 +01:00
Oliver Schmidt
50174d9860 Hide stdout of tests returning an exit code.
Now that we doubled our tests by running them for both 6502 and 65C02 Travis CI complains (again) about a too long build output. So let's reduce it by omitting the (useless) stdout of tests.
2017-03-19 20:32:23 +01:00
Oliver Schmidt
4a6bca0b56 Run test for the 65C02 code generator / runtime too.
Now that sim65's 65C02 support is actually functional we can run test for the 65C02 support in the compiler and the runtime.

We learn the hard way this is a good idea as there are tests failing when built with optimizations for the 65C02:
- val/compare7
- val/compare8
- val/compare9
- val/compare10
- val/or1
2017-03-19 20:07:19 +01:00
Oliver Schmidt
ff9b77b6cc Shortened test subdir names. 2017-03-19 17:57:25 +01:00
Oliver Schmidt
66634ef683 Cleaned up test Makefiles. 2017-03-19 17:48:44 +01:00
Oliver Schmidt
3a30669ff6 Merge pull request #405 from IrgendwerA8/65SC02_sim65_support
Added 65SC02 support for simulator.
2017-03-18 23:38:05 +01:00
IrgendwerA8
e14e13abf4 fixed curly brackets for single line scopes 2017-03-18 22:52:13 +01:00
Oliver Schmidt
2048d6cfb5 Removed top blank line. 2017-03-18 20:57:12 +01:00
IrgendwerA8
ad003e5991 style changes 2017-03-18 20:27:41 +01:00
IrgendwerA8
0985655ac7 Fixed bug in original sim65 implementation (reason for C&P error in last commit) 2017-03-18 17:02:22 +01:00
IrgendwerA8
c50e4d25e2 additional fix for scrambled code (sorry) 2017-03-18 16:56:36 +01:00
IrgendwerA8
4ba34f2a69 fixed scrambled semicolon 2017-03-18 16:54:00 +01:00
IrgendwerA8
360372420b Added 65SC02 support for simulator. 2017-03-18 16:37:15 +01:00
Oliver Schmidt
aa75789f58 Merge pull request #404 from groessler/something_to_pull
Creativison changes.
2017-03-18 12:51:46 +01:00
Christian Groessler
a3d8829be9 Creativison changes.
This change includes some cleanups, removal of mainargs.s (game console
programs never have arguments), and a workaround for a problem I'm seeing.

The problem is that sometimes (in fact, more often than not) the clrscr()
call in testcode/lib/joy-test.c writes some garbage chars on the screen (most
often a "P"). Could be my hardware (I haven't seen it on MAME), but to
me the root cause is still unknown.
2017-03-17 21:42:51 +01:00
IrgendwerA8
0de44517ac few 6502 and some 65SC02 optimizations 2017-03-12 23:21:43 +01:00
Oliver Schmidt
0bbe4f56a5 Merge pull request #401 from greg-king5/void-size
Make C's sizeof operator work with cc65's void variables.
2017-03-12 20:06:34 +01:00
Greg King
750a527100 Made C's sizeof operator work with initialized void variables.
Added regression tests that check cc65's handling of void variables.
2017-03-12 14:41:32 -04:00
Oliver Schmidt
a780df1fe1 Merge pull request #381 from pfusik/static-forward-decl
"static" forward declarations
2017-03-12 18:26:14 +01:00
Oliver Schmidt
2e8d792f9a Added .gitattributes to force LF line endings on commit. 2017-03-12 18:13:18 +01:00
Oliver Schmidt
d7689b43cd Merge pull request #400 from greg-king5/yaccdbg-fix
Fix a yaccdbg pointer test again.
2017-03-12 16:10:54 +01:00
Greg King
73261ea48f Fixed a pointer test again -- but, it's better than in pull request #391.
This time, the expression compares the pointer directly, instead of comparing the pointer's target.  The new expression avoids an array underrun.
2017-03-11 15:11:15 -05:00
Oliver Schmidt
23d4534f94 Merge pull request #395 from greg-king5/no-Os
Remove a pointless cc65 command-line option from "samples/Makefile".
2017-03-10 15:33:02 +01:00
Greg King
acb7c61302 Removed a pointless cc65 command-line option from the samples makefile.
"-Oi --codesize 500" is the same as "-O --codesize 200 --codesize 500".  That first "--codesize" is replaced by the second one.  Don't set it twice.
2017-03-10 08:47:48 -05:00
Oliver Schmidt
949333e37b Merge pull request #399 from groessler/something_to_pull
Fix line endings (CRLF -> LF) on all affected files.
2017-03-10 11:31:50 +01:00
Christian Groessler
8a81f9c0c8 Fix line endings (CRLF -> LF) on all affected files. 2017-03-10 11:21:14 +01:00
Piotr Fusik
05d1b8072b Add regression tests for duplicate globals with different linkage. 2017-03-09 21:18:48 +01:00
Piotr Fusik
6c3873316b Add regression tests for duplicate global/static variables detected by the compiler. 2017-03-09 20:49:42 +01:00
Piotr Fusik
ce0cf85386 Add regression test for #204. 2017-03-09 20:40:20 +01:00
Piotr Fusik
d2c89d2ba9 "static int n; int n;" is an error.
Fixes test/err/static-4.c regression.
2017-03-09 19:14:31 +01:00
Oliver Schmidt
b332064cb5 Just some minor style fix. 2017-03-09 14:39:08 +01:00
Oliver Schmidt
98e51d10d1 Merge pull request #397 from groessler/something_to_pull
fix creativision joystick driver
2017-03-08 13:38:24 +01:00
Christian Groessler
64c4cef901 Implement diagonal direction handling in creativision joystick driver. 2017-03-08 13:19:53 +01:00
Christian Groessler
97e3472c87 creativision.inc: add symbolic names for joystick direction values 2017-03-08 13:16:40 +01:00
IrgendwerA8
371e8efb79 temporarily disable optimizations altogether until a fine grain control
is implemented on Makefile level only disabling the compiler option -Os
2017-03-07 19:16:31 +01:00
IrgendwerA8
8d1b80e6fd Fixed CPU-flag usage which fails on build server?! 2017-03-05 11:38:55 +01:00
IrgendwerA8
81115aa826 Added further optimizations and unit tests. 2017-03-05 02:09:12 +01:00
Oliver Schmidt
e7cf8fb45c Merge pull request #394 from groessler/something_to_pull
creativision/crt0.s: enable display interrupts in display controller configuration
2017-03-04 19:08:33 +01:00
Christian Groessler
9558ebf86c creativision/crt0.s: enable display interrupts in display controller configuration
Otherwise the joystick zero page locations won't get updated.
2017-03-04 10:04:32 +01:00
Oliver Schmidt
ca3e5e8b8c Merge pull request #391 from greg-king5/yaccdbg-fix
Fix the "yaccdbg.c" compiler regression test.
2017-03-02 09:45:44 +01:00
Greg King
8f0ea644dd Fixed a pointer-difference, comparison-with-zero expression.
Some GCC C compilers can't subtract higher pointers from lower pointers properly, when those pointers must be scaled (because they point to objects that are wider than a char). The scaling is done as unsigned which makes the difference positive instead of negative.

So, a broken expression was changed into a direct comparison between the two pointers.
2017-03-01 06:52:43 -05:00
Greg King
99f3c7d01d Fixed a makefile: "yaccdbg.c" includes "yacc.c". So, yaccdbg must depend on both of them. 2017-03-01 06:29:53 -05:00
Oliver Schmidt
2306c3bde2 Merge pull request #390 from jedeoric/master
Adding some conio's function
2017-02-28 12:34:18 +01:00
IrgendwerA8
09de875330 Changed the location of unittest.h 2017-02-28 08:05:11 +01:00
IrgendwerA8
3d28f5ca90 Fixed indentation 2017-02-26 22:36:19 +01:00
IrgendwerA8
c240d42a9e Added "strrchr" optimizaion a matching unit test and tiny unit test framework. (Documentation for that will follow later) 2017-02-26 20:03:05 +01:00
jede
b0e035ba2b Cleaning 2017-02-25 22:23:46 +01:00
jede
7bc3bff83f adding gotox.s gotoy.s wherex.s wherey.s 2017-02-25 22:20:17 +01:00
jede
1497330cc0 adding clrscr.s 2017-02-25 22:10:13 +01:00
jede
4f1d007fb4 Correcting typo 2017-02-25 21:32:42 +01:00
jede
f6002a149c adding gotoxy.s 2017-02-25 21:32:06 +01:00
IrgendwerA8
6afcc370ed Optimization of two string functions (size & speed). 2017-02-25 20:19:50 +01:00
Oliver Schmidt
0ec4534bd6 Merge pull request #387 from groessler/something_to_pull
atari_antic.inc: use "or" instead of "plus" in the usage example
2017-02-24 20:39:04 +01:00
Oliver Schmidt
4bf10d87b0 Merge pull request #386 from IrgendwerA8/EasierDisplayLists
Improved display list instruction definition for more comfortable use…
2017-02-24 20:37:59 +01:00
Christian Groessler
aeee5610e1 atari_antic.inc: use "or" instead of "plus" in the usage example 2017-02-24 19:06:32 +01:00
Irgendwer
e5af45b913 Update displaylist.c 2017-02-24 11:21:56 +01:00
Irgendwer
f55d334435 Update atari.sgml 2017-02-24 11:19:33 +01:00
IrgendwerA8
ae7fa8f2ea Improved display list instruction definition for more comfortable use within void data definition. 2017-02-24 00:10:02 +01:00
Oliver Schmidt
97e64c388c Merge pull request #385 from groessler/something_to_pull
README.md: PC-Engine is a console
2017-02-22 14:28:32 +01:00
Christian Groessler
bb27d8d14e README.md: PC-Engine is a console 2017-02-22 14:25:10 +01:00
Oliver Schmidt
cbe2e3ca29 Merge pull request #383 from greg-king5/index-update
Add the Telestrat doc. to the index.
2017-02-15 23:26:50 +01:00
Greg King
39d655278d Added "telestrat.html" to index. Sorted "gamate.html". 2017-02-15 16:10:16 -05:00
Piotr Fusik
5988ec37cd Revert "Disallow global variable declarations with an initializer."
This reverts commit 1f12a06f7c.
2017-02-15 18:51:27 +01:00
Oliver Schmidt
21d94929dd Merge pull request #374 from groessler/something_to_pull2
creativision target
2017-02-15 16:03:43 +01:00
Christian Groessler
ddae920ee9 remove old joystick code 2017-02-15 15:53:57 +01:00
Christian Groessler
e6530d68dd Fix joystick driver. Add interruptor support.
Note that the joystick driver doesn't support combined movements (like
left/up or right/down). This should be fixed.
2017-02-15 15:45:49 +01:00
Christian Groessler
6df0ba5244 Merge remote-tracking branch 'upstream/master' into something_to_pull2 2017-02-15 15:43:34 +01:00
Christian Groessler
b858b0d623 Add joystick driver to documentation. 2017-02-15 15:37:06 +01:00
Oliver Schmidt
38427f84b0 Merge pull request #382 from groessler/something_to_pull
Add testcode/lib/mouse-test.c. Rename samples/mousetest.c to mousedemo.c
2017-02-15 09:50:29 +01:00
Christian Groessler
c0803ed53a fix indentation 2017-02-14 23:52:44 +01:00
Christian Groessler
ccdbb2b0e6 Add testcode/lib/mouse-test.c. Rename samples/mousetest.c to mousedemo.c.
mouse-test.c can be use to test all available mouse drivers for a given target.
Currently supported targets are Atari, C64, and C128.
To avoid confusion, rename samples/mousetest.c to mousedemo.c.
2017-02-13 22:48:34 +01:00
Christian Groessler
a5fba551d1 Merge remote-tracking branch 'upstream/master' into something_to_pull2 2017-02-13 21:38:38 +01:00
Piotr Fusik
31f19fbc65 Issue an error for duplicate global variables.
Previously it was an assembler error.
2017-02-13 21:10:21 +01:00
Piotr Fusik
730d01a25f Global uninitialized variable is only a tentative definition.
Closes #204
2017-02-13 21:04:45 +01:00
Piotr Fusik
1f12a06f7c Disallow global variable declarations with an initializer.
E.g.
extern int i = 42;
2017-02-13 19:41:05 +01:00
Oliver Schmidt
287c5d6cd3 Merge pull request #380 from greg-king5/ca65-816
Fix ca65's BRK instruction for the 65816.
2017-02-13 12:39:47 +01:00
Oliver Schmidt
420bb6ee17 Merge pull request #379 from pfusik/zlib-update
Optimize inflatemem.
2017-02-13 12:34:16 +01:00
Greg King
7e8bb7b700 Fixed ca65's BRK instruction encoding for the 65816.
BRK is two bytes on all 6502 variants; but, the 65816's maker declared officially that assemblers should support an optional operand.
2017-02-12 14:54:57 -05:00
Piotr Fusik
4266e712f2 Optimize inflatemem.
The new version is 30% shorter and 10% faster.
It also avoids the indirect-X addressing mode, which was a problem for PC-Engine.
2017-02-12 11:41:11 +01:00
Oliver Schmidt
5bbf010029 Merge pull request #371 from jedeoric/master
Create an Oric Telestrat target library
2017-02-10 23:47:13 +01:00
jede
9cde534b23 Rollback for *.vcxproj, telestrat.sgml modified for "don't" instead of "did not" for telemon2.4 2017-02-09 18:46:56 +01:00
Christian Groessler
38451fa8a4 intermediate check-in -- creativision joystick driver 2017-02-08 14:34:35 +01:00
Greg King
69e3bbea7e Reverted 'Used more mundane addressing in some of the instructions in "zlib/inflatemem.s".'
This reverted some of commit e7e65044e6.
2017-02-07 07:33:27 -05:00
Christian Groessler
c33383e6de Add Creativision to README.md and html index 2017-02-06 21:06:08 +01:00
Christian Groessler
e6359ec019 Add initial creativision.sgml, contributed by Stefan Haubenthal. 2017-02-06 20:59:52 +01:00
Christian Groessler
984f901604 Merge remote-tracking branch 'upstream/master' into something_to_pull2 2017-02-06 19:32:00 +01:00
Oliver Schmidt
e581ad3633 Merge pull request #376 from groessler/something_to_pull
gamate, lynx, nes, pce: remove joy_stddrv.s
2017-02-06 19:29:46 +01:00
Christian Groessler
39a1a142e3 gamate, lynx, nes, pce: remove joy_stddrv.s
These targets don't support dynamically loaded joystick drivers.
2017-02-06 19:26:12 +01:00
jede
d2fc2c74fb Correcting scrsize.s into _scrsize.s 2017-02-03 21:11:37 +01:00
jede
d76911d38a Fixing telestrat.h 2017-02-02 22:53:28 +01:00
jede
ad6e54c2d8 Updating doc 2017-02-02 22:44:06 +01:00
jede
5abb40b229 Last push for tonight :) 2017-02-02 00:11:11 +01:00
jede
4b77072fed Correcting alignment 2017-02-02 00:05:50 +01:00
jede
bbff709d9f Correcting return line 2017-02-02 00:00:21 +01:00
jede
0e649f24ea Correcting some code from github comments 2017-02-01 23:58:33 +01:00
Christian Groessler
a08f905224 Cleanups for Creativision. 2017-02-01 20:09:03 +01:00
Christian Groessler
0b2a699b46 Merge remote-tracking branch 'upstream/master' into creativision-neu 2017-02-01 18:49:31 +01:00
Oliver Schmidt
aa4493df9f Merge pull request #373 from groessler/something_to_pull
pce/memcpy.s: remove superfluous comma in comment
2017-02-01 18:29:42 +01:00
Christian Groessler
07f840f11c Merge remote-tracking branch 'upstream/master' into creativision 2017-02-01 18:15:05 +01:00
Christian Groessler
034c668b15 pce/memcpy.s: remove superfluous comma in comment 2017-02-01 17:52:30 +01:00
jede
d9778994fa Correcting some spaces 2017-01-31 22:33:19 +01:00
jede
37185b20dd correcting README.md to add telestrat target 2017-01-31 22:21:53 +01:00
jede
6f58b9a22d Correcting comments alignment
Correcting an address error in telestrat.inc when cleaning files which broke read.s primitive
2017-01-31 22:20:19 +01:00
jede
b5fef66f37 Merge telemon24 and telemon30 into telestrat target.
Cleaning, and replace tab to spaces
Converting hex lowercase value into uppercase char.
Changing := and = when it was needed
2017-01-31 22:09:14 +01:00
jede
06b2b83ab2 Correcting spaces 2017-01-29 23:18:32 +01:00
jede
858e952505 Fix 2017-01-29 23:05:18 +01:00
jede
db3b6603e5 Fix 2017-01-29 23:03:01 +01:00
jede
bd82bf6a7f Fix 2017-01-29 22:59:53 +01:00
jede
e21eca942b new pull fix 2017-01-29 22:55:35 +01:00
jede
2697499b3c Fixing old pull request 2017-01-29 22:53:50 +01:00
jede
0f8fb4d79d Merge with current version 2017-01-29 22:39:51 +01:00
jede
29881fb7c9 Revert 2017-01-29 22:28:54 +01:00
jede
6ed57af9fd removing ch376.h 2017-01-29 22:14:56 +01:00
jede
d1b5a6632d Adding telemon30 and telemon24 primitives 2017-01-29 21:18:49 +01:00
Oliver Schmidt
6878ede5d7 Merge pull request #370 from groessler/something_to_pull
libsrc/c16/get_tv.s: remove code duplication
2017-01-26 17:07:13 +01:00
Christian Groessler
bba7c980e4 libsrc/c16/get_tv.s: remove code duplication
Use the plus4 version of get_tv.s.
2017-01-26 16:43:47 +01:00
Oliver Schmidt
cc8ecd836f Merge pull request #369 from groessler/something_to_pull
Small space optimization in libsrc/atari/is_cmdline_dos.s.
2017-01-25 11:04:49 +01:00
Christian Groessler
f613ee0f57 More optimization in libsrc/atari/is_cmdline_dos.s.
Suggestion by Spiro Trikaliotis.
2017-01-24 21:01:42 +01:00
Christian Groessler
6f463d60a3 Small space optimization in libsrc/atari/is_cmdline_dos.s. 2017-01-24 20:21:56 +01:00
jede
038ac5a65a Correcting doc adding telemon 2.4 primitives 2017-01-22 21:41:49 +01:00
Oliver Schmidt
69c293919a Fixed typo. 2017-01-22 12:04:21 +01:00
Oliver Schmidt
251f8cf229 Merge pull request #368 from greg-king5/tgi-mouse
Add a way to show the default mouse pointer on C64 TGI  screens.
2017-01-20 11:21:09 +01:00
Greg King
54ff808c2c Added a way to show the default mouse pointer on C64 TGI (graphics) screens. 2017-01-18 16:05:47 -05:00
Oliver Schmidt
977bca922b Merge pull request #365 from FlorentFlament/master
Add C support for Atari 2600 (VCS)
2017-01-16 16:26:48 +01:00
Florent Flament
2a81eaa06e Add Atari 2600 documentation 2017-01-15 20:53:34 +01:00
Florent Flament
3d52856dd2 Add Atari2600 ASM header (.inc) files 2017-01-15 12:09:38 +01:00
Florent Flament
c1aac0de0e Add C support for Atari 2600 (VCS) 2017-01-13 21:12:22 +01:00
jede
d5ba063602 Correcting some bugs 2017-01-04 20:03:19 +01:00
Oliver Schmidt
1fc2dfb64f Merge pull request #363 from kylophone/master
doc/ca65: fix typo
2016-12-27 22:27:00 +01:00
Kyle Swanson
1b4a7e37ce doc/ca65: fix typo 2016-12-27 11:46:12 -06:00
Oliver Schmidt
5878155b68 Merge pull request #361 from marshallward/master
NES memory map amend (16k prg, 8k chr default)
2016-12-25 12:42:56 +01:00
Marshall Ward
09495519c0 NES memory map amend (16k prg, 8k chr default)
The configuration file and runtime (crt0.s) provided for the default NES
ROM layout (2x16k PRG, 8k CHR) incorrectly added interrupts (IRQ1, IRQ2,
TIMERIRQ) which are not supported by the NES hardware.  For example, see
the NESdev wiki, which makes no reference to these interrupts.

    https://wiki.nesdev.com/w/index.php/CPU_memory_map

The VECTORS region was also incorrectly set to 0xFFF6, which would have
left the 0xFFF4 normally unspecified.  This did not result in any error,
however, since cc65 simply placed ROMV directly after ROM0 regardless of
start address.

(This layout may be due to a copy-and-paste from the PC-Engine
configuration, whose interrupt registers start at 0xFFF6, begins with
the three interrupts listed above, followed by NMI and START, and does
not end with a final IRQ interrupt.)

Despite the absence of any actual error, since START is still placed at
0xFFFC, this patch removes the nonexistent interrupts and also correctly
aligns the ROM0 and ROMV regions.  It also has the (admittedly very
minor) benefit of freeing up 6 additional bytes for ROM0.
2016-12-24 08:32:54 +11:00
Oliver Schmidt
4b78364b8b Merge pull request #360 from cacciatc/master
Added 'any' to --list-opt-steps.
2016-12-15 22:53:08 +01:00
Chris Cacciatore
66b30f0c7a Added 'any' to --list-opt-steps. 2016-12-15 09:06:15 -08:00
jede
15ac85b50c Adding ch376.h header, correcting some bugs 2016-12-14 23:45:20 +01:00
jede
252e4afb9c Adding files for telemon30 2016-12-14 21:22:10 +01:00
Oliver Schmidt
b53206cde7 Merge pull request #359 from peterferrie/master
fix build break on da65
2016-12-04 13:12:49 +01:00
Peter Ferrie
8a08413263 fix build break on da65 2016-12-03 20:54:14 -08:00
greg-king5
f4c51046f0 Merge pull request #358 from EtchedPixels/master
* scanner: Correct handling of \0101

The C language has this oddity that octal constants are 3 bytes so the sequence
"\0101" is two bytes and well defined by the langage. cc65 currently misparses
this as a 1 byte octal code. Add a count to fix this.

Signed-off-by: Alan Cox <etchedpixels@gmail.com>

* cc65: remove un-needed logic from octal parsing

We no longer need the extra error handling logic for octal parsing so simplify
it as requested by Greg King.

Signed-off-by: Alan Cox <etchedpixels@gmail.com>
2016-11-26 17:30:38 -05:00
Alan Cox
e4aee2ba34 cc65: remove un-needed logic from octal parsing
We no longer need the extra error handling logic for octal parsing so simplify
it as requested by Greg King.

Signed-off-by: Alan Cox <etchedpixels@gmail.com>
2016-11-20 18:02:45 +00:00
Alan Cox
6ee1fd2a67 scanner: Correct handling of \0101
The C language has this oddity that octal constants are 3 bytes so the sequence
"\0101" is two bytes and well defined by the langage. cc65 currently misparses
this as a 1 byte octal code. Add a count to fix this.

Signed-off-by: Alan Cox <etchedpixels@gmail.com>
2016-11-19 13:02:19 +00:00
Oliver Schmidt
79e1b25c6c Removed DEL as suggested by Greg. 2016-10-16 13:47:31 +02:00
Oliver Schmidt
dfbd96f09e Make use of doesclrscrafterexit(). 2016-10-15 15:47:25 +02:00
greg-king5
23cfb51e72 Shorten a URL. 2016-09-29 20:00:09 -04:00
Oliver Schmidt
4ea6e38c20 Merge pull request #353 from SvOlli/da65
da65: adding support for 4510 cpu of c65
2016-09-27 14:56:28 +02:00
Sven Oliver Moll
476260a6fa 4510 support for da65: fixed docs and Makefile for testcase. 2016-09-27 12:02:57 +02:00
Sven Oliver Moll
2d76d0a657 da65: 4510 support
- cleaned up unnecessary static function
- adjusted table formatting
2016-09-23 13:10:38 +02:00
Oliver Schmidt
bc94d53514 Merge pull request #354 from sur5r/master
Add missing tag and remove duplicate text
2016-09-23 11:34:50 +02:00
Jakob Haufe
86fc0240a9
Add missing tag and remove duplicate text 2016-09-23 10:50:46 +02:00
Sven Oliver Moll
d0ed84c2d0 da65: adding support for 4510 cpu of c65 2016-09-20 17:37:10 +02:00
Oliver Schmidt
819ecbda26 Merge pull request #348 from SvOlli/release
ca65: added .P4510 and .IFP4510 pseudo commands
2016-09-20 16:19:45 +02:00
Oliver Schmidt
709ee6a28b Merge pull request #341 from alexthissen/master
Update exehdr.s for Lynx target
2016-09-14 10:23:44 +02:00
Alex Thissen
601c6102e8 Fixed last linefeed and notation convention errors. 2016-09-13 22:02:37 +02:00
Sven Oliver Moll
bcdd190020 removed 'make clean' invoked from test/Makefile for test/assembler/Makefile, as all artifacts are now created in testwrk and will be cleaned up out of directory 2016-09-13 11:54:56 +02:00
Sven Oliver Moll
95a2f4b9dd re-adding WORKDIR to Makefile
- added workaround to remove *.o files after assembling
- also removed now obsolete clean target
2016-09-13 11:28:11 +02:00
Sven Oliver Moll
aaa26c7d57 Revert "test/assembler: removed WORKDIR variable, as remote assembling does only work partly"
This reverts commit 7a9a7c3188.
2016-09-13 11:21:25 +02:00
Oliver Schmidt
8b7767b748 Merge pull request #349 from groessler/something_to_pull
Atari: fix lookup of default device on XDOS.
2016-09-13 10:27:48 +02:00
Christian Groessler
6198e10f67 Atari: fix lookup of default device on XDOS.
Stefan Dorndorf, author of XDOS, pointed out that retrieving the
default device by looking at an undocumented memory location won't
work in future XDOS versions.
He also showed a way to get the default device in a compatible
manner.

This change implements his method and adds a version check (XDOS
versions below 2.4 don't support this -- for them the behaviour
will be the same as, for example, AtariDOS: no notion of a default
drive).
2016-09-12 23:40:25 +02:00
Sven Oliver Moll
0949b2e104 added missing ',' in documentation. 2016-09-12 18:38:10 +02:00
Alex Thissen
ef7e9db116 Changed __BLOCKSIZE__ to __BANK0BLOCKSIZE__.
Added __BANK1BLOCKSIZE__ which defaults to 0.
2016-09-11 22:26:52 +02:00
Sven Oliver Moll
a5772f7dc3 added forgotten testcase for testing cpu based conditional assembling 2016-09-07 19:49:21 +02:00
Sven Oliver Moll
c0d2643952 added 4510 cpu detection to getcpu.s 2016-09-07 19:44:11 +02:00
Sven Oliver Moll
7a9a7c3188 test/assembler: removed WORKDIR variable, as remote assembling does only work partly 2016-09-07 19:41:37 +02:00
Sven Oliver Moll
ae3f9bbd77 Added assembler pseudo commands .P4510 and .IFP4510 together with docs and testcase 2016-09-07 19:21:24 +02:00
Oliver Schmidt
05279f8302 Merge pull request #345 from SvOlli/release
migrated opcodes tests for assembler from testcode to test...
2016-09-07 10:11:47 +02:00
Oliver Schmidt
32d4937363 Merge pull request #347 from groessler/something_to_pull
Fix some typos.
2016-09-06 17:59:12 +02:00
Christian Groessler
3531bcbf3e Fix some typos. 2016-09-06 15:13:44 +02:00
Sven Oliver Moll
f007fc13d5 added README for test/assembler 2016-09-06 14:54:21 +02:00
Oliver Schmidt
00a9406bb4 Merge pull request #344 from greg-king5/huc6280-disassembler
Fix some bugs in the da65 disassembler's HuC6280 section.
2016-09-04 12:25:28 +02:00
Oliver Schmidt
896b7c1116 Added comment about commented-out value. 2016-09-04 12:22:11 +02:00
Sven Oliver Moll
89e2bf89cb migrated opcodes tests for assembler from testcode to test for inclusion on automated testing 2016-09-03 16:52:23 +02:00
greg-king5
a982e434f2 Added commented placeholder for future Mitsubishi 740 CPU in "cpu.mac". 2016-09-02 17:55:39 -04:00
Greg King
4b2e3be2fc Fixed some bugs in da65's HuC6280 section. 2016-09-02 14:24:29 -04:00
Greg King
579b89ad98 Skipped the bit flag for the (not implemented) Mitsubishi 740 in "cpu.mac". 2016-08-31 20:41:17 -04:00
Oliver Schmidt
9c38521ea8 Merge pull request #343 from SvOlli/release
Add 4510 support for C65/C64DX
2016-08-31 22:05:49 +02:00
Sven Oliver Moll
48f64de720 4510 support: yet another round up little updates 2016-08-31 20:18:54 +02:00
Sven Oliver Moll
4384603eeb 4510 support: added some other small improvements:
- fixed typo in doc/ca65.sgml
- Greg found a way to get rid of one extra opcode handling in total
2016-08-30 22:58:40 +02:00
Sven Oliver Moll
91f8e09bcc 4510 support: fixed some cosmetical stuff and documentation 2016-08-29 23:29:31 +02:00
Sven Oliver Moll
0538184699 Add 4510 support for C65/C64DX 2016-08-29 10:45:18 +02:00
Oliver Schmidt
1e7a992663 Merge pull request #338 from IrgendwerA8/master
Allow use of different charmaps on Atari target
2016-08-28 11:22:44 +02:00
IrgendwerA8
d65f587f69 Internal/screen character mapping: Supressed warnings for re-map and added documentation. 2016-08-27 22:02:08 +02:00
alexthissen
e786d1cf49 Update exehdr.s
Fix for memory bank 1 which should be zero for almost all cartridges for emulators to work correctly.
2016-08-27 21:58:13 +02:00
Greg King
1dee57bf1f Made cc65 not warn us when we change character code 0x00 back to itself. 2016-08-26 08:08:44 -04:00
Oliver Schmidt
2f6fb1de1c Added -Wc to the (pseudo) output dump. 2016-08-26 11:06:58 +02:00
Oliver Schmidt
0fca806b0a Merge pull request #336 from cacciatc/switch-error-fix
Switch error fix
2016-08-21 15:07:42 +02:00
Chris Cacciatore
e9295b2a98 Updated comment regarding curly braces. 2016-08-20 09:42:29 -07:00
Chris Cacciatore
7919812378 Updated switch statement comments.
* Now comments represent the fact that there may not be curly braces.
2016-08-19 20:21:10 -07:00
IrgendwerA8
024f66a84f Allow use of different charmaps on Atari target 2016-08-19 17:27:41 +02:00
Oliver Schmidt
e52feb2b91 Merge pull request #335 from IrgendwerA8/SMC_macro_fixes
SMC macro fixes for changed .paramcount and byte overflow behavior
2016-08-16 09:23:28 +02:00
Chris Cacciatore
ac4bdbd411 Now testing switch statements with empty bodies. 2016-08-15 11:36:50 -07:00
Chris Cacciatore
c4823c6fd4 Added Duff's Device to tests. 2016-08-15 11:26:03 -07:00
Chris Cacciatore
3bd3fd8749 Removed check for LCURLY in switch statements. 2016-08-15 11:03:02 -07:00
Oliver Schmidt
0ad1880c42 Merge pull request #334 from cacciatc/standard-versioning
All programs print version and exit successfully.
2016-08-14 22:18:19 +02:00
Irgendwer
aea312746b Update smc.inc 2016-08-14 19:35:35 +02:00
IrgendwerA8
7f4b14ee49 SMC macro fixes for changed .paramcount and byte overflow behavior 2016-08-14 19:33:09 +02:00
Chris Cacciatore
bad8412131 All programs print version and exit successfully.
* All programs are now using the ProgName variable as well.
2016-08-12 08:54:41 -07:00
Oliver Schmidt
d9a2452b81 Merge pull request #332 from greg-king5/interrupt-functions
Add C-code interfaces for the CBM Kernal functions SCNKEY and UDTIM.
2016-08-11 19:12:36 +02:00
Oliver Schmidt
22d1f1da1b Minor style fix. 2016-08-10 11:38:11 +02:00
Chris Cacciatore
f9482a1b72 Fixed test negation. (#329)
Fixed test negation.
2016-08-09 15:46:51 -04:00
Greg King
2c03b9a1bc Added C-code interfaces for the CBM Kernal functions SCNKEY and UDTIM. 2016-08-07 15:50:10 -04:00
Oliver Schmidt
d90dff5861 Merge pull request #328 from cacciatc/print-sym-name-incompatible-ptr-types
Reporting sym name for incompatible pointer types.
2016-08-05 13:31:34 +02:00
Greg King
33b1d82791 Added the WDC65c02S WAI and STP mnemonics to the disassembler. 2016-08-02 16:38:39 -04:00
Chris Cacciatore
9accf983e1 Reporting sym name for incompatible pointer types. 2016-08-02 11:31:09 -07:00
greg-king5
ac17751699 Merge pull request #326 from dmlloyd/master
Add missing WDC instructions
2016-07-29 13:09:15 -04:00
David M. Lloyd
8f0146f14a Add missing WDC instructions 2016-07-28 11:55:25 -05:00
Greg King
e7e65044e6 Used more mundane addressing in some of the instructions in "zlib/inflatemem.s".
That avoids conflicts with ca65's future .setdp feature.
2016-07-19 10:42:49 -04:00
Oliver Schmidt
fb53bfc25d Merge pull request #323 from bbbradsmith/rand_fix
Fix broken rand() implementation.
2016-07-14 21:58:26 +02:00
Brad Smith
32d000fb4c Fix broken rand() implementation. The high 8 bits were unused, reducing it to a 24-bit implementation (while still doing all the work for a 32-bit one). The best entropy is in the unused high byte, returning these bits in A instead of bits 8-15, which had considerably lower entropy (i.e. rand() & 255 was effectively a 16-bit LCG). 2016-07-11 20:48:47 -04:00
Oliver Schmidt
06bb95d197 Merge pull request #322 from greg-king5/inflatemem
Make inflatemem()'s source file use its enhanced instructions for 65SC02 CPUs, too.
2016-07-10 19:36:35 +02:00
Greg King
c2945bf1ff Made the zlib's inflatemem()'s source file use enhanced instructions for all 65SC02-compatible CPUs (not only the 65C02). 2016-07-10 05:05:38 -04:00
Oliver Schmidt
48448e6bbb Merge pull request #320 from groessler/something_to_pull
sim65: add command line parameter to print number of CPU cycles at exit
2016-07-06 09:12:54 +02:00
Christian Groessler
85d755f214 fix indentation 2016-07-05 17:10:10 +02:00
Christian Groessler
97b517a892 sim65: add command line parameter to print number of CPU cycles at exit 2016-07-05 17:07:39 +02:00
Greg King
a6eb7d0763 Fixed how ca65 handles some debug info from cc65.
ca65 used to claim that an assembler error/warning was found on a C code line; and, that an Assembly line is only indirectly related to it.
Now, ca65 says that the Assembly line has the problem; and, that the Assembly line was produced from the C line.
2016-07-03 07:07:09 -04:00
Greg King
4014783275 Made the samples Makefile run cl65 only when we want a disk image.
That change avoids an error message when we "make clean" from the top-level make-file (it removes the tools before it cleans the samples).
2016-07-03 02:23:59 -04:00
Greg King
90b2f5aff8 Fixed some code that adjusts an index after a deletion from a collection. 2016-07-02 10:26:33 -04:00
Oliver Schmidt
dfea22389c Merge pull request #315 from skry/fixes
Fix typo in samples makefile
2016-06-23 14:57:21 +02:00
Joni Lapilainen
ab10bd4014 Fix typo in samples makefile 2016-06-23 15:46:09 +03:00
Greg King
5d9f4dc89d Made the overlay demo programs compile for CBM targets again.
<conio.h> includes target-specific headers; so, we didn't bother to include <cbm.h> where it is needed.  But, '#include <conio.h>' was removed from some files; so now, we must include <cbm.h> explicitly.
2016-06-19 17:41:18 -04:00
Oliver Schmidt
c9e9679a06 Improved doc and samples default target.
The 'all' target deliberately doesn't build the doc nor the samples. But that doesn't mean that the Makefiles in the 'doc' and 'samples' directories must default to the (empty) 'all' target.
2016-06-19 18:55:00 +02:00
Oliver Schmidt
e47485f925 Added CONIO cursor support.
For quite some time I deliberately didn't add cursor support to the Apple II CONIO imöplementation. I consider it inappropriate to increase the size of cgetc() unduly for a rather seldom used feature.

There's no hardware cursor on the Apple II so displaying a cursor during keyboard input means reading the character stored at the cursor location, writing the cursor character, reading the keyboard and finally writing back the character read initially.

The naive approach is to reuse the part of cputc() that determines the memory location of the character at the cursor position in order to read the character stored there. However that means to add at least one additional JSR / RTS pair to cputc() adding 4 bytes and 12 cycles :-( Apart from that this approach means still a "too" large cgetc().

The approach implemented instead is to include all functionality required by cgetc() into cputc() - which is to read the current character before writing a new one. This may seem surprising at first glance but an LDA(),Y / TAX sequence adds only 3 bytes and 7 cycles so it cheaper than the JSR / RTS pair and allows to brings down the code increase in cgetc() down to a reasonable value.

However so far the internal cputc() code in question saved the X register. Now it uses the X register to return the old character present before writing the new character for cgetc(). This requires some rather small adjustments in other functions using that internal cputc() code.
2016-06-19 15:03:20 +02:00
Oliver Schmidt
2ef43e425a Adjusted to recent change. 2016-06-19 01:39:27 +02:00
Oliver Schmidt
66561c23c1 Made Makefile actually work.
Supported target systems:
* c64 (default)
* apple2
* apple2enh
* atari
* atarixl
2016-06-19 01:22:59 +02:00
Oliver Schmidt
64c10aa2fe Minor simplification. 2016-06-18 23:57:18 +02:00
Oliver Schmidt
9bc096d9b0 Make use of doesclrscrafterexit(). 2016-06-18 23:57:17 +02:00
Oliver Schmidt
520641890d Merge pull request #313 from greg-king5/plus4-joy
Fix the Plus/4 (and C16) joystick driver.
2016-06-18 23:23:55 +02:00
Greg King
f91a7e749b Fixed the Plus/4 joystick driver.
It chooses a stick correctly.  And, it reads the fire button.
2016-06-18 13:18:26 -04:00
Oliver Schmidt
a7323d399e Merge pull request #312 from groessler/atari-exec-devel
Fix exec() for atarixl target.
2016-06-16 11:49:18 +02:00
Christian Groessler
a9c69bb8c9 A small rearrangement of instructions in Atari's exec() to let the comments
make sense again.
2016-06-16 00:47:13 +02:00
Christian Groessler
ec7751332f Fix exec() for atarixl target.
The final part of exec() called 'excexit' and only then restored the
stack pointer to its value at program entry.  'excexit' does all
cleanup (the same as '_exit()'), which means that on the atarixl
target the ROM is banked in again.  On big programs the 'SP_save'
variable might reside at a high memory address which is no longer
accessible after the ROM has been banked in.
The change just moves the restoration of the stack pointer before
the call to 'excexit'.

Another change lets exec.s compile if UCASE_FILENAME is not defined.
And some other small cleanups, also in open.s.
2016-06-15 23:52:16 +02:00
Oliver Schmidt
2c8b8d90bf Merge pull request #311 from groessler/something_to_pull
Fix doesclrscrafterexit() function on atarixl target.
2016-06-15 08:59:50 +02:00
Oliver Schmidt
d8dfc29297 Merge pull request #310 from groessler/atari-exec-devel
Implement exec() for Atari XDOS.
2016-06-15 08:58:23 +02:00
Christian Groessler
d0faf471b8 Some improvements to Atari exec() after review. 2016-06-14 20:44:57 +02:00
Christian Groessler
4aa9a414c6 Fix doesclrscrafterexit() function on atarixl target.
On atarixl, the screen is always cleared, regardless of the running DOS.
2016-06-13 21:16:27 +02:00
Christian Groessler
94ba9575ec Implement exec() for Atari XDOS.
- Adds new ENOEXEC error code, also used by Apple2 targets.
- Maximum command line length is 40, incl. program name. This is
  an XDOS restriction.
- testcode/lib/tinyshell.c has been extended to be able to run
  programs.
2016-06-13 20:40:01 +02:00
Oliver Schmidt
271b65aa70 Added hint on how to quit program. 2016-06-12 23:48:19 +02:00
Oliver Schmidt
98973ee901 Avoid warnings on monochrom targets (and remove unnecessary code). 2016-06-12 23:30:29 +02:00
Oliver Schmidt
524813ff60 Allow to build samples from the main Makefile. 2016-06-12 23:30:29 +02:00
Oliver Schmidt
4fc27ffc98 Merge pull request #309 from greg-king5/map-zero
Allow character code 0x00 to be remapped with other character codes.
2016-06-11 16:13:24 +02:00
Greg King
573381a340 Allowed character code zero to be remapped with other character codes. 2016-06-11 06:43:19 -04:00
Oliver Schmidt
e95d07aa97 Merge pull request #308 from greg-king5/funcref
Update the function reference document.
2016-06-09 08:57:03 +02:00
Greg King
0835985999 Updated the function reference document.
* Added doesclrscrafterexit() to cc65.h's list.
* Added header-file function lists for some new target platforms.
2016-06-08 21:05:56 -04:00
Oliver Schmidt
2f486b6201 Merge pull request #307 from groessler/something_to_pull2
Add Atari version of of doesclrscrafterexit().
2016-06-07 15:13:28 +02:00
Christian Groessler
5705d0b55b Use 'return0' for default 'doesclrscrafterexit()' implementation in libsrc/common.
Fix include/atari.h formatting.
2016-06-07 15:05:00 +02:00
Christian Groessler
308767cbae fix wrong header reference in doesclrscrafterexit() description 2016-06-07 12:22:25 +02:00
Christian Groessler
346d88a6a7 Add issues from pull request #307. 2016-06-07 12:07:38 +02:00
Oliver Schmidt
effdc58d88 Merge pull request #306 from groessler/something_to_pull
Some Atari runtime library fixes.
2016-06-07 10:21:59 +02:00
Christian Groessler
c7874b9f60 Add Atari version of of doesclrscrafterexit().
- Update documentation.
- Update atari.h and apple2.h header files.
- Adapt Atari test/target programs.
- Fix a typo in "div" entry in funcref.sgml.
2016-06-07 00:42:51 +02:00
Christian Groessler
27841c7b40 Some Atari runtime library fixes.
* libsrc/atari/ucase_fn.s: Fix handling if input parameter 'tmp2' is 0.
* libsrc/atari/open.s: Set 'tmp2' parameter for 'ucase_fn' if DEFAULT_DEVICE
  is not defined.
2016-06-06 22:45:20 +02:00
Oliver Schmidt
13482984ca Introduced internal gotoxy that pops both parameters.
About all CONIO functions offering a <...>xy variant call
  popa
  _gotoxy

By providing an internal gotoxy variant that starts with a popa all those CONIO function can be shortened by 3 bytes. As soon as program calls more than one CONIO function this means an overall code size reduction.
2016-06-05 14:58:38 +02:00
Oliver Schmidt
d670998814 Added Apple II version of doesclrscrafterexit().
The prototype and documentation is supposed to be provided together with the ATARI version.
2016-06-05 13:01:42 +02:00
Oliver Schmidt
02b8469875 Added full stop. 2016-06-03 21:21:22 +02:00
Oliver Schmidt
6f0b57fe51 Added chrcvt65 to the Visual Studio project. 2016-06-03 11:37:15 +02:00
Oliver Schmidt
8dd003d2b3 Added --print-target-path option.
If cc65 is installed and used as designed there's no need whatsoever for CC65_HOME (both on *IX and Windows) from the perspective of the cc65 binaries. If the user however has to access files from the 'target' directory thenhe ends up with some assumption on the cc65 installation path nevertheless :-(

In order to avoid this I added the --print-target-path option. It "exports" the logic used by the cc65 binaries to locate their files to the user thus allowing him to leverage the same logic to locate the target files in his build scripts / Makefiles.
2016-06-03 11:08:53 +02:00
Oliver Schmidt
9f01392922 Write overlays to d64 image. 2016-06-02 20:49:10 +02:00
Oliver Schmidt
ce45f75987 Harmonized goal name. 2016-06-01 23:51:43 +02:00
Oliver Schmidt
d653054d98 Allow usage of C1541 environment variable. 2016-06-01 23:48:09 +02:00
Oliver Schmidt
24256256fb Removed shell for-loop.
Just a few of the many reasons why shell for-loops have no place in (GNUmake) Makefiles:
* They don't conform to https://www.gnu.org/software/make/manual/html_node/Utilities-in-Makefiles.html
* They break Windows builds for sure
* They don't fit to make's approach of working with sets
* They break make parallelism
2016-06-01 23:47:02 +02:00
Oliver Schmidt
38778cdeb6 Don't cleanup files "just in case".
The build doesn't create *.lbl files so we're not deleting *.lbl files.
2016-06-01 23:04:46 +02:00
Oliver Schmidt
1ab725e526 Don't hide build commands.
The samples Makefile serves educational purposes. From that perspective it's counterproductive to hide the actual build commands. Apart fom that it becomes visible if an installed cc65 is used to build the samples.
2016-06-01 23:00:37 +02:00
Oliver Schmidt
506e44fb5d Corrected cleanup semantics.
There's no zap goal in cc65 Makefiles.
2016-06-01 22:50:42 +02:00
Oliver Schmidt
b75e36bba1 Don't ignore more than necessary.
We know that the one and only cc65.zip we want to ignore lives in the root directory.
2016-06-01 22:36:38 +02:00
Oliver Schmidt
ec06d162bd Fixed clean goal on Windows.
Now that the clean goal of the samples Makefile is part of the global clean goal it should work on Windows!

BTW: Ideally the whole samples Makefile should work on Windows ;-))
2016-06-01 22:14:30 +02:00
Oliver Schmidt
d78b44f8c6 Adjusted to the cc65 Makefile style.
The cc65 Makefiles have a single .PHONY target. It serves as an overview of the "interesting" goals supported by the Makfile.
2016-06-01 21:08:47 +02:00
Oliver Schmidt
6fca6897cd Removed tab characters.
The cc65 code base uses tab character only for make recipes.
2016-06-01 20:59:33 +02:00
Oliver Schmidt
d455263e66 Don'r presume that the C64 is the only target.
Other targets have disks too and if at some point some one is interested enough to add support for disk creation for other targets too then 'disk' is no good goal name for a C64 disk.
2016-06-01 19:46:02 +02:00
Oliver Schmidt
3c8fd588f6 Don't fiddle with foreign files.
No cc65 tool creates *~ files so we don't cleanup *~ files. If some other tool (like an editor) creates *~ files it's up to the user - and only him - to decide when those files are to be deleted !
2016-06-01 19:41:51 +02:00
Oliver Schmidt
04dc8e340c Merge pull request #305 from silverdr/target_goodies
corrected samples and samples.d64 targets
2016-06-01 16:44:57 +02:00
Patrycjusz R. Łogiewa
b7e7d1496b corrected all samples and samples.d64 targets 2016-06-01 16:37:05 +02:00
Oliver Schmidt
89329f1519 Merge pull request #287 from silverdr/target_goodies
moved output of target utils and drivers to separate directory
2016-06-01 11:01:56 +02:00
Oliver Schmidt
f1a052f259 Merge pull request #303 from groessler/something_to_pull
Atari: get current drive on XDOS
2016-05-31 12:47:11 +02:00
Christian Groessler
0114a850d9 Atari, getdefdev.s: use mnemonics for 'crvec'. 2016-05-31 12:24:21 +02:00
Oliver Schmidt
1a436d897e Merge pull request #304 from groessler/something_to_pull2
w2cas: use atexit() to wait for key press at program ternination.
2016-05-31 11:45:40 +02:00
Christian Groessler
4d02d47832 Use atexit() to wait for key press at program ternination.
Idea by polluks.
2016-05-31 10:38:02 +02:00
Christian Groessler
c1f17e9c18 Atari: make __getdefdev function ROM-friendly 2016-05-31 09:28:53 +02:00
Christian Groessler
9523fa2d33 Atari: get current drive on XDOS 2016-05-31 07:37:58 +02:00
Patrycjusz R. Łogiewa
4dcfc036c8 samples zip and install targets moved into samples/Makefile as agreed 2016-05-30 17:42:01 +02:00
Oliver Schmidt
b979fb5763 Minor adjustment to recent change. 2016-05-30 14:31:53 +02:00
Oliver Schmidt
37ad190820 Merge pull request #302 from groessler/something_to_pull
Small optimization in apple2 exec.s.
2016-05-30 14:29:56 +02:00
Christian Groessler
a6c306500a Small optimization in apple2 exec.s. 2016-05-30 14:16:37 +02:00
Patrycjusz R. Łogiewa
e36a636eee Indenting optimised 2016-05-29 16:34:22 +02:00
Patrycjusz R. Łogiewa
ac5bb6707d Post-review changes 2016-05-29 16:19:03 +02:00
Oliver Schmidt
7845f1b1ca Merge pull request #300 from clbr/ld65
ld65: Be more verbose in token errors
2016-05-28 12:02:22 +02:00
Lauri Kasanen
8951e74ba7 ld65: Be more verbose in token errors 2016-05-27 20:03:58 +03:00
Oliver Schmidt
aa4a7735d7 Merge pull request #297 from groessler/something_to_pull
Atari: add new function '_is_cmdline_dos()' and some other small changes
2016-05-26 23:36:22 +02:00
Oliver Schmidt
9eee35468c Merge pull request #294 from greg-king5/standard-functions
Make a small optimization to some library functions' inlined versions.
2016-05-25 10:36:57 +02:00
Oliver Schmidt
55b4b00449 Merge pull request #298 from groessler/something_to_pull2
make BSS segment optional in atari-cassette.cfg
2016-05-25 10:31:41 +02:00
Christian Groessler
e2d14291b7 make BSS segment optional in atari-cassette.cfg 2016-05-25 01:29:00 +02:00
Christian Groessler
b3d7c09ba1 forgot to add the new file atari/is_cmdline_dos.s in my last commit... 2016-05-25 01:06:53 +02:00
Christian Groessler
da65866e24 Atari: add new function '_is_cmdline_dos()' and some other small changes.
- use this function instead of directly looking at _dos_type in the included
  targetutil and test programs
- fixes/improvements to the Atari runtime library regarding the recently
  changed _dos_type values
- libsrc/atari/targetutil/w2cas.c: exit if no filename was entered
- add documentation for the new function
2016-05-25 00:57:43 +02:00
Greg King
8d5717b57a Small optimization of some cc65-generated loops.
"bne" means also branch-on-not-zero.  Therefore, this optimization doesn't put a compare-to-zero between an increment and a "bne".
2016-05-24 15:52:12 -04:00
Oliver Schmidt
a76153cb9f Merge pull request #295 from groessler/something_to_pull
Atari: add command line support for XDOS
2016-05-24 16:18:36 +02:00
Christian Groessler
2abbd94492 Fix style issue. 2016-05-24 15:47:34 +02:00
Christian Groessler
2dd8f9f5ef atari.h: update _dos_type values 2016-05-24 04:37:35 +02:00
Christian Groessler
6d7dfad80b add support for XDOS command lines 2016-05-24 03:06:00 +02:00
Christian Groessler
03cb0bd2fd atari.inc: add XDOS defines and remove trailing whitespace 2016-05-24 03:06:00 +02:00
Patrycjusz R. Łogiewa
759f5f5f48 docs for targets with target utilities adjusted 2016-05-18 16:42:51 +02:00
Patrycjusz R. Łogiewa
cc747946b2 removed variable usage 2016-05-16 22:35:24 +02:00
Patrycjusz R. Łogiewa
9c3f89fa1f ignoring zip target output 2016-05-16 22:34:43 +02:00
Patrycjusz R. Łogiewa
37f9929094 adapted for zip/install targets 2016-05-16 22:14:05 +02:00
Patrycjusz R. Łogiewa
a5bff259bc Ignores adjusted 2016-05-16 19:50:02 +02:00
Patrycjusz R. Łogiewa
ba10c74a7a directory structure changed from driver-centric to target-centric 2016-05-16 19:49:43 +02:00
greg-king5
b0e929420b Merge pull request #289 from OzHawk/patch-1
Update the missing entries in the kernel jump table for the Vic20 wit…
2016-05-15 22:48:03 -04:00
OzHawk
1369bed881 Update kernal.s 2016-05-16 08:41:13 +09:30
Patrycjusz R. Łogiewa
93f55c274b moved output of target utils and drivers to separate directory 2016-05-13 14:28:58 +02:00
OzHawk
8bd2628d1e Update the missing entries in the kernel jump table for the Vic20 with the actual function addresses.
The Vic20 does not have kernal table entries for the following functions.

;-----------------------------------------------------------------------------
; Functions which are not in the kernal jump table for VIC-20 but are for C64

CINT        := $E518
IOINIT      := $FDF9
RAMTAS      := $FD8D

All other kernal entries are the same as the C64, however, without this change, the startup code fails.

Without this change the vic20.lib builds incorrectly.
2016-05-11 19:24:16 +09:30
Oliver Schmidt
b3d84d511c Merge pull request #285 from greg-king5/asm-volatile
Add the C keyword "volatile" to the __asm__ statement grammar.
2016-04-24 21:40:46 +02:00
Greg King
2c7ccca210 Added the optional C keyword "volatile" to the __asm__ statement grammar.
It prevents the statement's Assembly code from being optimized (e.g., moved or removed).  Optimization is disabled for that statement's entire function (other functions aren't affected).
2016-04-22 11:33:52 -04:00
Oliver Schmidt
62c2177599 Merge pull request #283 from polluks/sp65
Fixed CPU definition of Lynx.
2016-04-14 11:28:25 +02:00
Polluks
b14021e9ac Fixed CPU definition of Lynx. Removed nonsense target vc20. 2016-04-12 23:58:30 +02:00
Oliver Schmidt
e809d6bf0d Merge pull request #281 from polluks/sp65
sp65: A forgotten option. Empty arguments are not silent anymore.
2016-04-10 21:13:02 +02:00
KORISNIK
7f06405bdb A forgotten option. Empty arguments are not silent anymore. 2016-04-10 02:21:36 +02:00
Oliver Schmidt
1fee359056 Merge pull request #280 from greg-king5/misaligned
Show a warning message about misaligned segments, for all badly-aligned segments.
2016-03-29 12:19:24 +02:00
Greg King
fac246c799 Moved a warning message, about misaligned segments, to a configuration function.
It used to be shown only if the segment was written into a binary file.  Now, it's shown for all badly-aligned segments.
2016-03-29 05:40:12 -04:00
Oliver Schmidt
8b685763d4 Renamed chrcvt to chrcvt65 and added it to the build.
The /Makefile presumes that all binaries are are named *65 so chrcvt had to be renamed in order to be added to the build.
2016-03-27 19:09:00 +02:00
Oliver Schmidt
d2f012e414 Updated Protovision Shop URL. 2016-03-27 18:50:54 +02:00
Oliver Schmidt
f103617512 Use .macpack to include macro package. 2016-03-27 18:29:45 +02:00
Oliver Schmidt
e92f354740 Made use of recently added Apple scrcode macro. 2016-03-27 18:27:53 +02:00
Oliver Schmidt
e2419ece0b Added scrcode macro for the Apple II.
Although the Apple II generally works with plain ASCII (i.e. in the ProDOS 8 MLI) the actual screen codes differ. This fixes #260.
2016-03-27 18:26:46 +02:00
Oliver Schmidt
c0e82f4200 Merge pull request #279 from greg-king5/atmos-reconfig
Convert the Atmos configuration to the new constructor segment model.
2016-03-27 00:36:05 +01:00
Oliver Schmidt
29d1400340 Allow _sys() to call ROM routines.
_sys() is supposed to be (primarily) intended to call ROM routines. Leveraging the "file overlay" mechanism of the cc65 build system allows to provide a Apple II specific _sys() implementation that temporarily switches in the ROM.
2016-03-25 21:57:06 +01:00
Oliver Schmidt
c9734004ee Minor fixes for recent doc change. 2016-03-25 19:03:12 +01:00
Oliver Schmidt
9aac382afb Updated documentation to reflect the current linker configs. 2016-03-25 18:48:23 +01:00
Greg King
7773fcb1e1 Converted the Atmos configuration to the new constructor segment model. 2016-03-18 11:28:56 -04:00
Oliver Schmidt
78dcb61cb8 Harmonized asm linker configs.
- All segments but CODE are optional and CODE is R/W. Both together allow to "just" write code/data without ever explicitly using a segment.

- Symbols are defined for the BSS. This allows to use/implement zerobss.

- The ZP memory area isn't artificially limited.
2016-03-17 21:51:20 +01:00
Oliver Schmidt
d5092d2d3f Consider the segment attributes 'define' and 'optional' mutually exclusive.
In normal situations it isn't too useful to define symbols for optional segments as those symbols can't be presumed to be always present.

I in fact suspect that most currently present combinations of 'define' and 'optional' aren't useful - apart form the overlay configurations of course.
2016-03-17 21:31:43 +01:00
Oliver Schmidt
e3cbc7e8b8 Moved run location of ONCE segment.
Make the same changes to the Apple II that were done with 0ee9b2e446 to the C64.

Notes:
- The startup code deliberately doesn't make use of symbols defined for the LC segment as that segment is optional.
- The <...>-asm.cfg configs move the segment BSS to an own memory area BSS although this doesn't seem necessary. However the benefit is that the size of the memeory area MAIN is identical to the number of bytes loaded from disk into RAM. To keep this an invariant for all Apple II configs allows to simplify the EXEHDR to just refer to the symbols defined for MAIN.
2016-03-17 21:07:19 +01:00
Oliver Schmidt
1d1ba3ed3b Adjusted constructors.
The constructors are _NOT_ allowed anymore to access the BSS. Rather they must use the DATA segment or the INIT segment. The latter isn't cleared at any point so the constructors may use it to expose values to the main program. However they must make sure to always write the values as they are not pre-initialized.
2016-03-16 16:28:32 +01:00
Oliver Schmidt
3d6cbec6a1 Adjust linker config to match startup code.
Apply aaf90c1252 to the Supervision default configuration.
2016-03-16 16:00:09 +01:00
Oliver Schmidt
4270b8a96c Fixed segment properties.
The CBMx10 targets don't use the INIT segment in the startup code. So it may turn out to be not necessary at all for certain programs.

The CBMx10 targets don't need symbols for the ONCE segment. Likely their definition was a C&P error in the first place.
2016-03-15 22:55:39 +01:00
Oliver Schmidt
a2c9cb021a Moved things into ONCE.
Code and or data used only during initialization belongs into the ONCE segment.
2016-03-15 22:55:36 +01:00
Oliver Schmidt
0edd05b4bf Removed symbol definition for ONCE.
Almost all targets don't need symbols for the ONCE segment. Likely their definition was a C&P error in the first place.
2016-03-15 22:55:34 +01:00
Oliver Schmidt
46d4307bbb Removed ONCE segment.
Pure assembler programs don't have constructors. Therefore constructor code ending up in an assembler program should trigger an error.
2016-03-15 22:55:32 +01:00
Oliver Schmidt
c768de156a Fixed INIT properties.
The main chunk load header references __BSS_LOAD__ so BSS must be the first bss type segment. Subsequent changes will move ONCE to share its address with the BSS. Then it'll be necessary to load INIT from disk. Therefore we do it right now.
2016-03-13 22:18:51 +01:00
Oliver Schmidt
692f96409d Fixed BSS properties.
The cassette boot file header references __BSS_RUN__ so BSS must be the first bss type segment (and for sure isn't optional).
2016-03-13 22:13:41 +01:00
Oliver Schmidt
56a8c69b14 Use AX paradigm. 2016-03-13 21:23:45 +01:00
Oliver Schmidt
a3a22733f8 Cleaned up C64 linker configs.
The BSS segment and the ONCE segment share the same start address. So they need to be placed in two different memory areas.

So far BSS was placed in the MAIN memory area and ONCE was placed in an additional memory area. Both memory areas were written to the output file. They just "happened" to be loadable and runnable at a stretch.

Now ONCE is placed in the MAIN memory area and BSS is placed in an additional memory area. Only MAIN is written to the output file. It becomes more obvious that BSS is "just" defined to share memory with ONCE.
2016-03-13 14:32:07 +01:00
Oliver Schmidt
084453ba57 Don't presume the stack size to be a multiple of pages. 2016-03-10 10:07:09 +01:00
Oliver Schmidt
aac0b1cbbb Merge pull request #274 from bbbradsmith/doc-cc65-intern
New documentation: cc65-intern.sgml
2016-03-08 21:50:18 +01:00
Oliver Schmidt
69fbcb30fd Use AX paradigm for stack initalization. 2016-03-07 01:44:19 +01:00
Oliver Schmidt
d8c31cf1d3 Renamed RAM to MAIN for all disk based targets.
The name RAM doesn't make much sense in general for a memeory area because i.e. the zero page is for sure RAM but is not part of the memory area named RAM.

For disk based targets it makes sense to put the disk file more into focus and here MAIN means the main part of the file - in contrast to some header.

Only for ROM based targets the name RAM is kept as it makes sense to focus on the difference between RAM and ROM.
2016-03-07 01:28:55 +01:00
Oliver Schmidt
419eb700b5 Renamed INITBSS to INIT and INIT to ONCE.
The way we want to use the INITBSS segment - and especially the fact that it won't have the type bss on all ROM based targets - means that the name INITBSS is misleading. After all INIT is the best name from my perspective as it serves several purposes and therefore needs a rather generic name.

Unfortunately this means that the current INIT segment needs to be renamed too. Looking for a short (ideally 4 letter) name I came up with ONCE as it contains all code (and data) accessed only once during initialization.
2016-03-06 21:27:19 +01:00
Oliver Schmidt
ab1600b346 Merge pull request #269 from jbrandwood/squarebracket
New ".feature" to use brackets instead of parens for 6502 indirect addressing.
2016-03-03 09:07:21 +01:00
Brad Smith
97e6a8c569 cc65-intern update minor change notes from greg-king5 2016-03-02 21:01:46 -05:00
Brad Smith
fa5b0d88c5 Merge remote-tracking branch 'refs/remotes/cc65/master' into doc-cc65-intern 2016-03-02 21:01:04 -05:00
Brad Smith
85a58453cb cc65-intern adjusting mailing address 2016-03-02 02:03:23 -05:00
Brad Smith
18dec35312 cc65-intern sgml fixes 2016-03-02 01:58:44 -05:00
mrdudz
1d877494bf initial commit from c64-rrr-1.0 2016-02-28 23:37:04 +01:00
mrdudz
eb96a90e5f initial import from old sources 2016-02-28 22:35:46 +01:00
mrdudz
dd2972d699 initial commit from old source 2016-02-28 22:23:40 +01:00
mrdudz
85760e0c53 initial import from old sources 2016-02-28 22:13:05 +01:00
Oliver Schmidt
60958f005a Merge pull request #273 from mrdudz/emddocs
updated docs with recently added extended memory drivers
2016-02-28 21:53:46 +01:00
mrdudz
7d2969d5ac fixed copypaste errors 2016-02-28 21:39:49 +01:00
mrdudz
f328532030 updated docs with recently added extended memory drivers 2016-02-28 20:12:28 +01:00
Oliver Schmidt
3d08abcfa8 Load INITBSS segment from disk.
Conceptually the INITBSS segment is not initialized in any way. Therefore it makes sense to not load it from disk. However the INIT segment has to be loaded from disk and therefore moved to its run location above the INITBSS segment. The necessary move routine increases runtime RAM usage :-(

Therefore we now "unnecessarily" load the INITBSS segment from disk too meaning that the INIT segment is loaded at its run location. Therefore there's no need for the move routine anymore.

After all we trade disk space for (runtime) RAM space - an easy decision ;-)

Notes:

- The code allowing to re-run a program without re-load present so far could not have worked as far as I can see as it only avoided to re-run the move routine but still tried to re-run the code in the INIT segment that was clobbered by zeroing the BSS. Therefore I removed the code in question altogether. I'm personally not into this "dirty re-run" but if someone wants to add an actually working solution I won't block that.

- INITBSS is intentionally not just merged with the DATA segment as ROM-based targets can't reuse the INIT segment for the BSS and therefore have no reason to place the INIT segment above INITBSS.

- Because ROM-based targets don't copy INITBSS from the ROM (like it is done with the DATA segment) all users of INITBSS _MUST_NOT_ presume INITBSS to be initialized with zeros!
2016-02-28 19:45:36 +01:00
mrdudz
0dc85268c4 fix merge fxxxup 2016-02-28 19:11:04 +01:00
Oliver Schmidt
54e09fdd03 Added basic frame for new target 'creativision'.
Kym Greenshields <kym.greenshields@gmail.com> has expressed interest
in contributing and maintaining support for the VTech CreatiVision system.

this resembles commit 8e6b8dd0af from oliver
2016-02-28 19:05:40 +01:00
Bob Andrews
a8d3b83c43 Merge pull request #7 from cvemu/master
Initial Creativision Import
2016-02-28 18:25:01 +01:00
Bob Andrews
25f4482641 Merge pull request #238 from mrdudz/gamate
Bit Corporation 'Gamate' support
2016-02-27 18:44:26 +01:00
Bob Andrews
3f72e59e93 Merge pull request #241 from blackystardust/c128-function-ram-emd
C128 function ram emd
2016-02-27 18:08:55 +01:00
Oliver Schmidt
669205600f Merge pull request #271 from silverdr/blackystardust_pr_post_review
Blackystardust pr post review
2016-02-27 00:55:11 +01:00
Patrycjusz R. Łogiewa
01d9d3d151 Merge branch 'blackystardust_pr_post_review' of github.com:silverdr/cc65 into blackystardust_pr_post_review 2016-02-26 23:56:22 +01:00
silverdr
2bcdf32458 blackystardust pull request with post-review changes 2016-02-26 23:55:55 +01:00
Patrycjusz R. Łogiewa
8a3a0e95ad blackystardust pull request with post-review changes 2016-02-26 23:51:37 +01:00
silverdr
2abd077dfd Merge pull request #1 from cc65/master
sync
2016-02-26 23:42:50 +01:00
Brad Smith
222ab93026 revise note on prototypes/K&R conventions 2016-02-26 17:33:46 -05:00
Brad Smith
fd708d30ec draft of cc65-intern document 2016-02-26 17:11:11 -05:00
John Brandwood
ef153364ea Add indirect JMP examples and fix typos in the documentation. 2016-02-26 08:10:11 -08:00
John Brandwood
d23db09f7f Add optional feature to use brackets instead of parens for 6502 indirect addressing. 2016-02-25 12:40:31 -08:00
Oliver Schmidt
f7cdfbf5cb Minor fix 2016-01-21 20:51:17 +01:00
Oliver Schmidt
5c3e09685f Added Watara. 2016-01-21 20:49:21 +01:00
Oliver Schmidt
0535075856 Fixed #258. 2016-01-16 22:41:14 +01:00
Oliver Schmidt
2f61c5433e Merge pull request #257 from greg-king5/actor-lineinfo
Make ca65's CONDES-type pseudo-instructions save line numbers correctly.
2016-01-16 13:39:11 +01:00
Greg King
7a39b85e30 Fixed how ca65's CONDES-type pseudo-instructions save line numbers (for error messages). 2016-01-15 17:18:09 -05:00
Oliver Schmidt
8e297aacd1 Merge pull request #256 from polluks/master
Changed stdout to stderr to separate sim65's output streams. Suggeste…
2016-01-05 21:13:12 +01:00
polluks
cb3700ef66 Changed stdout to stderr to separate sim65's output streams. Suggested doc edit. 2016-01-05 17:45:18 +01:00
Oliver Schmidt
22348e2f07 Merge pull request #255 from polluks/master
Some missing docu.
2016-01-05 17:26:31 +01:00
polluks
f69f8add17 Updated index. 2016-01-05 15:57:18 +01:00
polluks
231150bc3c Added sim65 documentation. 2016-01-05 15:45:51 +01:00
polluks
804f1fded6 Fixed typos. 2016-01-05 15:38:05 +01:00
Oliver Schmidt
d34edf8b1f Merge pull request #254 from greg-king5/offset-pointer
Fix an unbalanced C stack that happens when a pointer is added to a 32-bit offset.
2016-01-02 13:55:42 +01:00
Greg King
e050655757 Added a cc65 regression test for pointer and offset addition operations. 2016-01-01 11:39:55 -05:00
Greg King
7e14dde07b Fixed the cc65 code that handled an addition of a pointer to a 32-bit offset.
It didn't demote the offset to int because it looked at the pointer (instead of the offset) which already was 16 bits.
2015-12-31 17:41:48 -05:00
Oliver Schmidt
104f898260 Merge pull request #253 from greg-king5/pointer-compares
Make cc65 accept comparisons between pointers with different qualifiers.
2015-12-29 12:11:33 +01:00
Greg King
3b303396bf Made cc65 accept comparisons between pointers with different qualifiers (similarly to subtractions between pointers). 2015-12-29 04:18:17 -05:00
Oliver Schmidt
02e4b5bfe3 Merge pull request #249 from polluks/master
My first PR
2015-12-27 13:40:20 +01:00
polluks
a8a6e9df5b Added chrcvt documentation 2015-12-27 02:09:12 +01:00
polluks
11786b198e Amiga support #192 2015-12-27 01:26:28 +01:00
mrdudz
5d3e7eeae3 tweaked soft env 2015-12-25 00:59:22 +01:00
Oliver Schmidt
51bcf28a87 Update package index (as recommended by Travis CI). 2015-12-16 12:24:47 +01:00
Oliver Schmidt
8a2ba97c60 Merge pull request #248 from greg-king5/nes-registers
Remove a const qualifier from <nes.h>.
2015-12-16 10:40:41 +01:00
Greg King
abfc36ec9c Programs need to reset NES input controllers by writing to them. 2015-12-15 11:26:04 -05:00
Oliver Schmidt
82860423f3 Merge pull request #247 from clbr/master
nes: Fix reading the second controller
2015-12-15 16:01:54 +01:00
Lauri Kasanen
a954e713ad nes: Fix reading the second controller
See
http://wiki.nesdev.com/w/index.php/Controller_port_registers
2015-12-14 19:28:53 +02:00
Oliver Schmidt
a7793bcf65 Merge pull request #246 from greg-king5/shift-signed-char
Fix a signed char right-shift compiler optimization.
2015-12-14 18:25:57 +01:00
Greg King
bdbf75372c Added another op-code to the test pattern for a right-shift optimizer in cc65. 2015-12-14 11:50:43 -05:00
Greg King
5e7c7d78fc Added a regression test program for the changes in the right-shift optimizer. 2015-12-14 11:46:30 -05:00
Greg King
651b1b40ec Extended a signed char shift optimization, to handle shifts that are longer than 4 bits. 2015-12-13 17:10:31 -05:00
Greg King
4716083f3f Fixed a signed char shift optimization so that it won't be used on signed int also.
(It would lose significant bits from the high byte.)
2015-12-13 17:04:43 -05:00
Oliver Schmidt
377f31d085 Fixed soft80 shutdown.
A call to $FDA3 cannot be used because it re-enables the BASIC ROM. If a large program (such as Contiki's webbrowser80) has destructor code or data "behind" that ROM, then the program might crash when it tries to quit gracefully. Changing that code to set CIA2_PRA works well enough.
2015-12-02 21:34:08 +01:00
Oliver Schmidt
d403c1e7f0 Merge pull request #240 from blackystardust/fix-c128-ram-rts
Fixed the c128 bank 1 emd.
2015-12-02 10:40:06 +01:00
Marco van den Heuvel
433eeb1bc7 Renamed MMU_CFG_INT_FROM -> MMU_CFG_IFROM and MMU_CFG_EXT_FROM -> MMU_CFG_EFROM 2015-12-02 00:30:30 -08:00
Marco van den Heuvel
7cd80e7450 optimized the sei/cli pairing a bit. 2015-12-02 00:21:55 -08:00
Marco van den Heuvel
f55505820a optimized the sei/cli pairing a bit for internal function ram emd as well. 2015-12-02 00:17:29 -08:00
Marco van den Heuvel
83c63a65c3 optimized the sei/cli pairing a bit. 2015-12-02 00:14:56 -08:00
mrdudz
8a499fdf4e fixup conio.c some more. also includes merge of upstream/master because git is retarded. 2015-12-02 00:13:32 +01:00
Oliver Schmidt
22f10b1459 Made conio program compatible with joystick-only target(s). 2015-12-01 23:06:51 +01:00
mrdudz
7de50b17c7 fix comments 2015-12-01 16:55:02 +01:00
mrdudz
d86397fd7d fix grammar 2015-12-01 16:38:00 +01:00
Oliver Schmidt
bdf4a7bd89 Merge pull request #237 from blackystardust/master
Added a menu to em-test.c and a struct that holds the available emd's…
2015-12-01 16:18:31 +01:00
Marco van den Heuvel
2e2f19ba79 Finished adding c128 internal/external function ram emd's. 2015-11-30 20:14:45 -08:00
mrdudz
5bf8523dcd fix hello.c 2015-11-30 19:48:10 +01:00
mrdudz
b851be1b23 naive music test 2015-11-30 19:16:28 +01:00
Marco van den Heuvel
3a01ba9509 Fixed emd driver names for atari-xl and apple2e. 2015-11-30 10:15:28 -08:00
Marco van den Heuvel
7df35cac94 Started on making c128 function ram emd's. 2015-11-30 09:53:30 -08:00
mrdudz
a95c95a5d3 added black line :) 2015-11-30 18:49:52 +01:00
mrdudz
7496e669be fixed stuff according to Olivers review 2015-11-30 18:44:04 +01:00
Marco van den Heuvel
18208f4d2e Fixed the c128 ram (bank 1) emd. 2015-11-29 23:04:23 -08:00
mrdudz
3bc1375c90 fix typo 2015-11-29 22:00:59 +01:00
mrdudz
aff2d95cb9 fix docs 2015-11-29 21:15:28 +01:00
mrdudz
4d1dc55138 dont use that silly buffer 2015-11-29 21:15:10 +01:00
Marco van den Heuvel
cf9e7856cf Removed an 'rts'. 2015-11-29 11:35:25 -08:00
mrdudz
b39a8b7a61 more cleanup 2015-11-29 20:04:10 +01:00
Marco van den Heuvel
97c9ed3273 Changed according to suggestions. 2015-11-29 10:50:22 -08:00
mrdudz
c636675521 moved cart header into seperate file, moved nmi stub into several file, tweaked linker config 2015-11-29 16:01:36 +01:00
Marco van den Heuvel
25ab2c60d5 Added a menu to em-test.c and a struct that holds the available emd's, this way the user that wants to test an emd can use the menu to select which one to test. 2015-11-28 22:06:32 -08:00
mrdudz
1893e24da9 updated 2015-11-29 01:24:01 +01:00
mrdudz
9fbf8a4299 conio and most other stuff working now 2015-11-29 01:14:59 +01:00
Oliver Schmidt
d99451ca50 Merge pull request #236 from fo-fo/master
Escaping of spaces in ca65 dependency files
2015-11-26 20:19:14 +01:00
f
4dc4ea60ee Implemented escaping of spaces in ca65 dependency files. Largely based on input.c from cc65 (WriteEscaped was copied verbatim). 2015-11-26 19:00:47 +02:00
Oliver Schmidt
d1d57f5cd6 Merge pull request #233 from mrdudz/soft80shutdown
reset screen editor at shutdown
2015-11-23 10:24:03 +01:00
mrdudz
4a49b0c8f8 reset screen editor at shutdown 2015-11-22 19:20:58 +01:00
mrdudz
88e7b5776a some more fiddling 2015-11-22 19:02:47 +01:00
Oliver Schmidt
d54e515e08 Merge pull request #232 from greg-king5/arg-count
Fix ca65's ".paramcount" Assembly-code read-only variable.
2015-11-17 21:23:30 +01:00
Greg King
3c8c62c6ab Fixed the ca65 Assembly-code variable ".paramcount".
Fixed how it's described in the ca65 document.
2015-11-17 14:21:40 -05:00
mrdudz
60285097e3 initial import of the gamate stuff 2015-11-14 13:15:29 +01:00
Oliver Schmidt
b6f429f934 Merge pull request #229 from greg-king5/nes-registers
Update the <nes.h> include file.
2015-11-12 13:20:45 +01:00
Greg King
c5d624c941 Added C declarations of the NES's I/O registers to <nes.h>. 2015-11-12 05:40:47 -05:00
Oliver Schmidt
f70acd9f51 Merge pull request #227 from mrdudz/soft80syms
remove unneeded exports
2015-11-07 13:37:46 +01:00
mrdudz
54de8ac031 remove unneeded exports 2015-11-07 11:45:38 +01:00
Oliver Schmidt
ced08a1f44 Merge pull request #226 from greg-king5/pce-memset
Add a PC-Engine version of memset().
2015-11-07 11:37:36 +01:00
Greg King
5e36315d05 Style changes. 2015-11-07 00:29:07 -05:00
Greg King
999d57401c Added a version of memset() that uses the HuC6280's TII instruction to get more speed. 2015-11-06 23:59:19 -05:00
Oliver Schmidt
d8174af7fb Merge pull request #225 from greg-king5/pce-memmove
Handle the special case of a zero-length move on the PC Engine.
2015-11-03 10:13:20 +01:00
Greg King
8180ac20d3 Added code to handle the special case of a zero-length move.
Added more tests of memcpy() and memmove().
2015-11-02 17:09:45 -05:00
Oliver Schmidt
281dc33e5a Made addr/size hex consts 4 digits wide. 2015-10-30 17:19:19 +01:00
Oliver Schmidt
202ad62419 Merge pull request #224 from greg-king5/ld65-segstart
Change the way that ld65 handles bad offset/start segment-attributes.
2015-10-24 17:12:49 +02:00
Oliver Schmidt
fdf71df3a1 Merge pull request #223 from greg-king5/pce-memmove
Add PC Engine-specific substitutes for memcpy() and memmove().
2015-10-24 17:10:25 +02:00
Greg King
8e8d112029 Added pce-specific substitutes for memcpy() and memmove().
They are smaller and faster because they take advantage of the pce CPU's block-copy instructions.

Also, made a small improvement to the common memmove(), so that it is similar to the pce version.
2015-10-23 18:02:21 -04:00
Oliver Schmidt
43bda6928d Merge pull request #221 from undisbeliever/master
Added .asize and .isize pseudo variables in ca65
2015-10-23 20:41:28 +02:00
Marcus Rowe
25e0b157be Fixed code style 2015-10-24 01:07:47 +10:00
Greg King
8e9bf4d419 Changed the way that ld65 handles bad offset/start segment attributes, and reports memory area overflows.
1. Offset/start attributes within a memory area are ignored after an overflow.
2. If a previous segment ends past an offset/start address, then that address is not used.
3. Short map files were generated for memory overflows; now, they are generated for bad offset/start addresses, too.
2015-10-22 19:24:08 -04:00
Oliver Schmidt
2cbc8fbd64 Merge pull request #222 from mrdudz/pcedatacopy
use tii instead of copy loop to copy data section to ram
2015-10-22 21:17:50 +02:00
mrdudz
8f8f12ceab use tii instead of copy loop to copy data section to ram 2015-10-22 19:48:21 +02:00
Oliver Schmidt
a957f80204 Merge pull request #213 from mrdudz/soft80
soft80 implementation for C-64
2015-10-22 17:56:21 +02:00
mrdudz
ba901d2de7 removed apple2 specific note 2015-10-22 17:33:01 +02:00
Marcus Rowe
67cd0c2197 Added .asize and .isize pseudo variables
These pseudo variables will return the size of the accumulator/index
in bits.

For the 65816 instruction set .ASIZE/.ISIZE will return either 8 or 16,
depending on the current size of the operand in immediate addressing
mode.

For all other CPU instruction sets, .ASIZE/.ISIZE will always return 8.

For example:

	; Reverse Subtract with Accumulator
	; A = memory - A
	.macro rsb param
		.if .asize = 8
			eor	#$ff
		.else
			eor	#$ffff
		.endif
		sec
		adc	param
	.endmacro
2015-10-20 09:30:25 +10:00
mrdudz
07a77d1259 updated docs 2015-10-19 03:12:19 +02:00
mrdudz
60334c40e6 added size optimized monochrom soft80 driver 2015-10-19 02:49:32 +02:00
mrdudz
d6d016bb80 updated comments 2015-10-19 02:47:40 +02:00
mrdudz
5099910b18 updated docs 2015-10-18 23:57:58 +02:00
Oliver Schmidt
f4335eca87 Merge pull request #220 from greg-king5/holes
Fix a samples/sieve.s typo.
2015-10-17 21:37:41 +02:00
Greg King
f94945308f Added missing parentheses.
A function call had looked like a function pointer (which caused an incompatible comparison).
2015-10-17 12:09:06 -04:00
mrdudz
8263083506 move variables into INITBSS 2015-10-15 15:11:05 +02:00
mrdudz
63d4c93006 Merge remote-tracking branch 'upstream/master' into soft80 2015-10-15 15:07:44 +02:00
Oliver Schmidt
76a5a72403 Adjusted current working directory initialization on Apple and Atari.
Moving __cwd from BSS into INITBSS does of course ;-) not only impact the CBM targets but all targets with disk I/O support.

Note: Code using `__cwd-1` may trigger an ld65 range error because __cwd may end up at the very begining of a segment. As far as I see this is an ld65 bug which I'm not try to fix - at least here.
2015-10-15 00:15:38 +02:00
Oliver Schmidt
0ee9b2e446 Changed run location of INIT segment.
So far the INIT segment was run from the later heap+stack. Now the INIT segment is run from the later BSS. The background is that so far the INIT segment was pretty small (from $80 to $180 bytes). But upcoming changes will increase the INIT segment in certain scenarios up to ~ $1000 bytes. So programs with very limited heap+stack might just not been able to move the INIT segment to its run location. But moving the INIT segment to the later BSS allows it to occupy the later BSS+heap+stack.

In order to allow that the constructors are _NOT_ allowed anymore to access the BSS. Rather they must use the DATA segment or the new INITBSS segment. The latter isn't cleared at any point so the constructors may use it to expose values to the main program. However they must make sure to always write the values as they are not pre-initialized.
2015-10-14 22:52:09 +02:00
mrdudz
b9c688d997 remove deleted function from comment 2015-10-14 17:52:14 +02:00
mrdudz
e6f5c7d8da some comments 2015-10-14 17:50:44 +02:00
mrdudz
795a1a1b87 fix bordercolor in test 2015-10-14 17:34:29 +02:00
mrdudz
f391c1c3d5 remove soft80_bordercolor override 2015-10-14 17:33:58 +02:00
mrdudz
59dd15aa55 split regular color.s into color.s and bordercolor.s 2015-10-14 17:25:35 +02:00
mrdudz
d4f88c8f71 update conio test 2015-10-14 17:24:42 +02:00
mrdudz
c708031374 use 'soft80_internal_cellcolor' for the current cell color, and CHARCOLOR for the actual textcolor 2015-10-14 17:24:16 +02:00
Oliver Schmidt
023b461bb8 According to the contributor the VGA data is accessed only by the constructor. 2015-10-14 11:50:54 +02:00
Oliver Schmidt
8f67dd5cc7 Merge pull request #215 from greg-king5/c64-init
Save space by using the apple2 target's INIT overlay scheme on the c64 target.
2015-10-14 10:43:11 +02:00
mrdudz
ffda2a3603 updated conio test 2015-10-13 04:14:23 +02:00
mrdudz
08d7eefdd7 another size optimization, make bgcolor() much more robust 2015-10-13 04:14:04 +02:00
mrdudz
f462c173fb move some stuff to init segment, saves roughly 1480 bytes :) 2015-10-12 23:39:47 +02:00
mrdudz
362a172477 remove chline/cvline dupes 2015-10-12 21:23:27 +02:00
mrdudz
f876ff4c09 Merge remote-tracking branch 'upstream/master' into soft80 2015-10-12 21:13:32 +02:00
Oliver Schmidt
5e960d106e Allow to override chars used for horizontal and vertical lines. 2015-10-12 21:04:06 +02:00
mrdudz
d6f48629ad export mouse driver related symbols 2015-10-12 21:02:48 +02:00
mrdudz
5840d1c08c increase conio constructor priority 2015-10-12 20:46:53 +02:00
mrdudz
df3549f502 Merge remote-tracking branch 'upstream/master' into soft80 2015-10-12 20:43:19 +02:00
mrdudz
57a43b6735 style issues 2015-10-12 20:38:06 +02:00
Oliver Schmidt
08efc299ff Allow to override mouse sprite location data. 2015-10-12 20:18:13 +02:00
mrdudz
e9f0b7943e some renaming, preparing plot table names 2015-10-12 19:57:33 +02:00
mrdudz
bf3ea5328f inverted result for checkchar, saving some bytes and cycles 2015-10-12 19:03:50 +02:00
mrdudz
4557e8d004 optimize charcode conversion, shorter and faster now :) 2015-10-12 18:53:55 +02:00
mrdudz
aed0549760 remove some commented out code 2015-10-12 18:09:50 +02:00
mrdudz
ead9950044 some code shuffling to get rid of long branches 2015-10-12 18:01:48 +02:00
mrdudz
cf8b21b27e size optimization 2015-10-12 17:12:44 +02:00
mrdudz
bc85d90468 check for space bottom up, which is faster for the average case 2015-10-12 16:15:40 +02:00
mrdudz
a2b514a7cf fix some style issues 2015-10-12 15:54:08 +02:00
mrdudz
21732e3c5b maintain lsb of cursor x position internally, saves some bytes and some cycles too :) 2015-10-12 15:44:41 +02:00
mrdudz
2a0f6c420b moved bordercolor function into a seperate file 2015-10-12 15:18:36 +02:00
mrdudz
7f2df8e8e6 move internal text/bgcolor variables into the file that also contains the init code for them. also rename them to avoid namespace pollution 2015-10-12 15:04:55 +02:00
mrdudz
07f1879f85 added some more comments and -headers 2015-10-12 14:40:12 +02:00
mrdudz
d8d7f53d1b move charset to seperate file again, added comments on charset layout 2015-10-11 17:13:28 +02:00
mrdudz
32397b9a2b print a space for 0x0a and 0x0d in the char matrix 2015-10-11 17:07:48 +02:00
Oliver Schmidt
c4966ac6a6 Fixed stupid adressing mode bug.
Thanks Greg for pointing out :-)
2015-10-10 11:15:43 +02:00
mrdudz
70ed96d06d updated conio test 2015-10-09 23:39:55 +02:00
mrdudz
03c6af3e15 rewrote color voodoo 2015-10-09 23:39:37 +02:00
Oliver Schmidt
ccc7c2b1f9 Minor style adjustment. 2015-10-09 22:18:51 +02:00
Oliver Schmidt
326da85145 Consistently place constructors (and their exclusive subroutines) in "INIT". 2015-10-09 21:44:20 +02:00
Oliver Schmidt
575f859a03 Keep low level VIC sprite stuff out of user code. 2015-10-09 18:33:35 +02:00
Greg King
8c609dd931 Explained why two variables were moved out of the BSS segment. 2015-10-09 12:00:41 -04:00
Oliver Schmidt
f21e3ae895 According to the contributor the prio wasn't intentionally set. 2015-10-09 13:42:25 +02:00
mrdudz
0b9d67d8a8 use default prio for the constructor 2015-10-09 13:40:10 +02:00
mrdudz
f712e9448a some cleanup/rework 2015-10-09 13:34:23 +02:00
mrdudz
e54ad81ce8 some more rework, second attempt on fixing the color issues. added ifdefs to disable the color voodoo alltogether for debugging purposes. 2015-10-08 20:43:25 +02:00
Greg King
8b89f4f5a6 Reduced c64-overlay.cfg's size by factoring out a different common expression. 2015-10-08 06:11:37 -04:00
Greg King
ca70700a0b Restored the old C-stack initiation code.
I had forgotten that the stack must be put below the CBM overlays.
2015-10-08 06:04:49 -04:00
Greg King
8a880580dc Reduced the size of the moveinit subroutine.
Made other changes that were recommended by Oliver.
* Changed its name from move_init to moveinit.
* Used self-modifying code in the subroutine.
* The INIT segment doesn't need to be optional (it's used by the start-up file).
2015-10-07 14:56:14 -04:00
mrdudz
67dabb8489 attempted fix for the color problem noticed by oliver 2015-10-06 20:18:40 +02:00
mrdudz
ee54f7f40c optimized clrscr for size 2015-10-06 19:33:43 +02:00
Oliver Schmidt
e6008026aa Fixed bogus formatting of recent contribution.
I wasn't in the mood for discussion ;-)
2015-10-05 16:28:16 +02:00
Oliver Schmidt
08e4cbfdbc Merge pull request #217 from clbr/master
Some nes documentation updates, joypad defines
2015-10-05 16:24:53 +02:00
Lauri Kasanen
7f409c3edb nes: Expose and document all joypad keys 2015-10-05 17:19:36 +03:00
Lauri Kasanen
04be8020b6 nes: Document whether waitvblank waits for the start or end of vblank 2015-10-05 17:18:53 +03:00
Greg King
074e10d288 Adapted, to the c64 target, the INIT-segment overlay scheme from the apple2 targets.
When a program starts running, INIT is moved from one place to another place.  Then, INIT's code is executed; and, the first place is re-used for variables.  After the INIT code has finished, the second place can be re-used by the heap and the C stack.  That means that initiation code and data won't waste any RAM space after they stop being needed.
2015-10-05 05:47:43 -04:00
mrdudz
23473641f4 fix clrscr so it doesnt wipe sprite pointers 2015-10-01 17:16:02 +02:00
mrdudz
5ea842b88b SCREEN->screensize 2015-10-01 15:03:11 +02:00
Oliver Schmidt
24c2da980b Merge pull request #214 from greg-king5/cbm-exec
Make the CBM exec() work in gigantic programs.
2015-09-30 20:52:31 +02:00
Greg King
6217f8fa3a Made the Commodore version of exec() work in programs that are so big that they load into all of BASIC RAM.
The function won't cause an "out of memory" error.
2015-09-28 11:27:39 -04:00
mrdudz
f39337a6ec added input test 2015-09-28 17:12:33 +02:00
mrdudz
4949836d16 fixed kplot 2015-09-28 17:12:20 +02:00
mrdudz
841d764a83 some cleanup, checked usage of __bgcolor and __textcolor 2015-09-28 16:10:11 +02:00
mrdudz
7486923c17 dont use seperate file for charset data 2015-09-28 15:57:16 +02:00
mrdudz
d211eeaa41 fix conio test to work on vic20 screen 2015-09-28 15:29:14 +02:00
mrdudz
6cc654cca8 added extra check for graphical chars 2015-09-28 15:10:57 +02:00
mrdudz
257183fa55 removed duplicate copy of charset and shift it at init time, saves 1k 2015-09-27 19:34:43 +02:00
mrdudz
c221fe22f6 prepend soft80_ to some more internally used functions 2015-09-27 19:10:06 +02:00
mrdudz
b5a6578dca include bitmap and vram row tables directly rather than generating them (saves space) 2015-09-27 18:49:30 +02:00
mrdudz
fba28f46f6 fix initial text- and background colors 2015-09-27 18:36:53 +02:00
mrdudz
9e08c53b01 initial commit of soft80 implementation 2015-09-27 18:12:25 +02:00
kym
11be575b6d Initial Creativision Import 2013-12-05 11:40:44 +00:00
4127 changed files with 576920 additions and 8 deletions

15
.editorconfig Normal file
View file

@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
guidelines = 80, 120
[*.{c,h}]
cpp_new_line_before_open_brace_block=same_line
cpp_new_line_before_open_brace_function=new_line
cpp_space_before_function_open_parenthesis=insert
cpp_new_line_before_else=false

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
* text=auto

16
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -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.

View file

@ -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.

9
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -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

46
.github/checks/Makefile vendored Normal file
View file

@ -0,0 +1,46 @@
ifneq ($(shell echo),)
CMD_EXE = 1
endif
ifdef CMD_EXE
.PHONY: checkstyle sorted
checkstyle:
$(info INFO: style checks require bash.)
sorted:
$(info INFO: table checks require bash.)
else
.PHONY: checkstyle lineendings tabs lastline spaces noexec sorted
all: checkstyle sorted
checkstyle: lineendings tabs lastline spaces noexec
lineendings: lineendings.sh
@./lineendings.sh
tabs: tabs.sh
@./tabs.sh
lastline: lastline.sh
@./lastline.sh
spaces: spaces.sh
@./spaces.sh
noexec: noexec.sh
@./noexec.sh
sorted: sorted.sh sorted_codeopt.sh sorted_opcodes.sh
@./sorted.sh
@./sorted_codeopt.sh
@./sorted_opcodes.sh
checksp: checksp.sh
@./checksp.sh
endif

22
.github/checks/checksp.sh vendored Executable file
View file

@ -0,0 +1,22 @@
#! /bin/bash
OD65_EXE=../bin/od65
CHECK_PATH=../../libwrk
cd "${CHECK_PATH}" || {
echo "error: Directory ${CHECK_PATH} doesn't seem to exist" >&2
exit 1
}
[ -x "${OD65_EXE}" ] || {
echo "error: This check requires the od65 executable to be built" >&2
exit 1
}
EXITCODE=0
find . -name \*.o -print | while read OBJ; do
"${OD65_EXE}" --dump-imports "${OBJ}" | grep -q "\"sp\"" && {
echo "error: Usage of symbol 'sp' found in module ${OBJ}" >&2
EXITCODE=1
}
done
exit ${EXITCODE}

26
.github/checks/lastline.sh vendored Executable file
View file

@ -0,0 +1,26 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
nl='
'
nl=$'\n'
r1="${nl}$"
FILES=`find $CHECK_PATH -type f -size +0 \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | while read f; do
t=$(tail -c2 $f; printf x)
[[ ${t%x} =~ $r1 ]] || echo "$f"
done`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found following files that have no newline at the end:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi
exit 0

19
.github/checks/lineendings.sh vendored Executable file
View file

@ -0,0 +1,19 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
FILES=`find $CHECK_PATH -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | grep -v "libwrk/" | grep -v "testwrk/" | xargs grep -IUl $'\r'`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found CR in the following files:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi
exit 0

19
.github/checks/noexec.sh vendored Executable file
View file

@ -0,0 +1,19 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
FILES=`find $CHECK_PATH -executable -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: executable flag is set for the following files:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi
exit 0

40
.github/checks/sorted.sh vendored Executable file
View file

@ -0,0 +1,40 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_DIR=../../src
SORT_OPT="-u -c"
# $1: filename
function checkarray_quoted_name
{
CHECK_FILE="$1"
START="\\/\\* BEGIN SORTED.SH \\*\\/"
END="\\/\\* END SORTED.SH \\*\\/"
awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {printf("%04d##%s\n", count, $0)}' "$CHECK_FILE" | \
sed -e 's:\(.*\)##.*\"\(.*\)\".*:\1##\2:g' > .a.tmp
if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then
echo "error: "$1" table is empty"
rm -rf .a.tmp
exit -1
fi
if `LC_COLLATE=C sort $SORT_OPT .a.tmp`; then
echo ""$1" tables OK"
else
echo "error: "$1" tables are not sorted."
rm -rf .a.tmp
exit -1
fi
rm -rf .a.tmp
}
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

70
.github/checks/sorted_codeopt.sh vendored Executable file
View file

@ -0,0 +1,70 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_DIR=../../src
SORT_OPT="-u -c"
# $1: filename
function checkarray
{
CHECK_FILE="$1"
START="\\/\\* BEGIN DECL SORTED_CODEOPT.SH \\*\\/"
END="\\/\\* END DECL SORTED_CODEOPT.SH \\*\\/"
awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {printf("%04d##%s\n", count, $0)}' "$CHECK_FILE" | \
sed -e 's:\(.*##\).*"\(.*\)",.*:\1\2:g' > .a.tmp
if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then
echo "error: "$1" table is empty"
rm -rf .a.tmp
exit -1
fi
if `LC_COLLATE=C sort $SORT_OPT .a.tmp`; then
echo ""$1" decls sorted."
else
echo "error: "$1" decls are not sorted."
rm -rf .a.tmp
exit -1
fi
START="\\/\\* BEGIN SORTED_CODEOPT.SH \\*\\/"
END="\\/\\* END SORTED_CODEOPT.SH \\*\\/"
awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {printf("%04d##%s\n", count, $0)}' "$CHECK_FILE" | \
sed -e 's:\(.*##\).*&D\(.*\),.*:\1\2:g' > .b.tmp
if [[ -z $(grep '[^[:space:]]' .b.tmp) ]] ; then
echo "error: "$1" table is empty"
rm -rf .a.tmp .b.tmp
exit -1
fi
if `LC_COLLATE=C sort $SORT_OPT .b.tmp`; then
echo ""$1" tables sorted."
else
echo "error: "$1" tables are not sorted."
rm -rf .a.tmp .b.tmp
exit -1
fi
if cmp --silent -- .a.tmp .b.tmp; then
echo ""$1" tables OK"
else
echo "error: "$1" tables are different."
diff -y .a.tmp .b.tmp
rm -rf .a.tmp .b.tmp
exit -1
fi
rm -rf .a.tmp .b.tmp
}
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

41
.github/checks/sorted_opcodes.sh vendored Executable file
View file

@ -0,0 +1,41 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_DIR=../../src
SORT_OPT="-u -c"
# $1: filename
function checkarray_quoted_name
{
CHECK_FILE="$1"
START="\\/\\* BEGIN SORTED_OPCODES.SH \\*\\/"
END="\\/\\* END SORTED_OPCODES.SH \\*\\/"
awk '/'"$START"'/{flag=1; count++; next} /'"$END"'/{flag=0;} flag {printf("%04d##%s\n", count, $0)}' "$CHECK_FILE" | \
sed 's:/\*.*::g' | \
grep '".*",' | \
sed -e 's:\(.*\)##.*\"\(.*\)\".*:\1##\2:g' > .a.tmp
if [[ -z $(grep '[^[:space:]]' .a.tmp) ]] ; then
echo "error: "$1" table is empty"
rm -rf .a.tmp
exit -1
fi
if `LC_COLLATE=C sort $SORT_OPT .a.tmp`; then
echo ""$1" tables OK"
else
echo "error: "$1" tables are not sorted."
rm -rf .a.tmp
exit -1
fi
rm -rf .a.tmp
}
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

19
.github/checks/spaces.sh vendored Executable file
View file

@ -0,0 +1,19 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
FILES=`find $CHECK_PATH -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | grep -v "test/" | grep -v "libwrk/" | grep -v "testwrk/" | xargs grep -l ' $'`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found dangling spaces in the following files:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi
exit 0

19
.github/checks/tabs.sh vendored Executable file
View file

@ -0,0 +1,19 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
FILES=`find $CHECK_PATH -type f \( \( -name \*.inc -a \! -name Makefile.inc \) -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | grep -v "test/" | grep -v "libwrk/" | grep -v "testwrk/" | xargs grep -l $'\t'`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found TABs in the following files:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi
exit 0

View file

@ -0,0 +1,101 @@
name: Build Pull Request
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_linux:
name: Build and Test (Linux)
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64
- shell: bash
run: git config --global core.autocrlf input
- name: Checkout Source
uses: actions/checkout@v4
- name: Do some simple style checks
shell: bash
run: make -j2 checkstyle
- name: Check bsearch tables
shell: bash
run: make -j2 sorted
- name: Build the tools.
shell: bash
run: make -j2 bin USER_CFLAGS=-Werror QUIET=1
- name: Build the dbginfo example
shell: bash
run: make -j2 -C src test QUIET=1
- name: Build the utilities.
shell: bash
run: make -j2 util QUIET=1
- name: Build the platform libraries.
shell: bash
run: make -j2 lib QUIET=1
- name: check test that no modules use sp
shell: bash
run: make -j2 checksp QUIET=1
- name: Run the regression tests.
shell: bash
run: make -j2 test QUIET=1
- name: Test that the samples can be built.
run: make -C samples platforms QUIET=1
- name: Test that the targettest programs can be built.
run: make -C targettest platforms QUIET=1
- name: Build the document files.
shell: bash
run: make -j2 doc QUIET=1
- name: Upload a documents snapshot.
uses: actions/upload-artifact@v4
with:
name: docs
path: ./html
- name: Build 64-bit Windows versions of the tools.
run: |
make -C src clean QUIET=1
make -j2 bin QUIET=1 USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32-
build_windows:
name: Build and Test (Windows)
runs-on: windows-latest
steps:
- shell: bash
run: git config --global core.autocrlf input
- name: Checkout Source
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build app (x86 debug)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug -property:Platform=Win32
- name: Build app (x86 release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release -property:Platform=Win32
- name: Build app (x64 release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug -property:Platform=x64
- name: Build app (x64 release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release -property:Platform=x64
- name: Build utils (MinGW)
shell: cmd
run: make -j2 util QUIET=1 SHELL=cmd
- name: Build the platform libraries (make lib)
shell: cmd
run: make -j2 lib QUIET=1 SHELL=cmd
- name: Run the regression tests (make test)
shell: cmd
run: make -j2 test QUIET=1 SHELL=cmd

View file

@ -0,0 +1,160 @@
name: Snapshot Build
on:
push:
branches:
master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_windows:
name: Build (Windows)
if: github.repository == 'cc65/cc65'
runs-on: windows-latest
steps:
- shell: bash
run: git config --global core.autocrlf input
- name: Checkout Source
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build app (debug)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug
- name: Build app (release)
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
build_linux:
name: Build, Test, and Snapshot (Linux)
if: github.repository == 'cc65/cc65'
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
- shell: bash
run: git config --global core.autocrlf input
- name: Checkout Source
uses: actions/checkout@v4
- name: Do some simple style checks
shell: bash
run: make -j2 checkstyle
- name: Check bsearch tables
shell: bash
run: make -j2 sorted
- name: Build the tools.
shell: bash
run: |
make -j2 bin USER_CFLAGS=-Werror QUIET=1
make -j2 util QUIET=1
- name: Build the platform libraries.
shell: bash
run: make -j2 lib QUIET=1
- name: Run the regression tests.
shell: bash
run: make -j2 test QUIET=1
- name: Test that the samples can be built.
shell: bash
run: make -j2 samples QUIET=1
- name: Remove the output from the samples tests.
shell: bash
run: make -C samples clean QUIET=1
- name: Remove programs in util directory
shell: bash
run: make -C util clean QUIET=1
- name: Build the document files.
shell: bash
run: make -j2 doc QUIET=1
- name: Build and package 64-bit Windows versions of the tools.
run: |
make -C src clean QUIET=1
make -j2 bin QUIET=1 USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32-
make zip
mv cc65.zip cc65-snapshot-win64.zip
- name: Build and package 32-bit Windows versions of the tools.
run: |
make -C src clean QUIET=1
make -j2 bin USER_CFLAGS=-Werror QUIET=1 CROSS_COMPILE=i686-w64-mingw32-
make zip
mv cc65.zip cc65-snapshot-win32.zip
- name: Upload a 32-bit Snapshot Zip
uses: actions/upload-artifact@v4
with:
name: cc65-snapshot-win32
path: cc65-snapshot-win32.zip
- name: Upload a 64-bit Snapshot Zip
uses: actions/upload-artifact@v4
with:
name: cc65-snapshot-win64
path: cc65-snapshot-win64.zip
- name: Get the online documents repo.
uses: actions/checkout@v4
with:
repository: cc65/doc
# this token will expire, if it does, generate a new one as decribed in https://github.com/cc65/cc65/issues/2065
# - apparently only a "classic" token works here
# - the token must exist in the cc65/cc65 repo
token: ${{ secrets.DOC_PAT }} # use secret token instead of default
path: doc.git
- name: Update the online documents.
run: |
cd doc.git
rm *.*
cp ../html/*.* .
git config user.name "cc65-github"
git config user.email "cc65.nomail@github.com"
git config push.default simple
git add -A
# prevent failure when there is nothing to commit
git diff-index --quiet HEAD || git commit -m "Updated from https://github.com/cc65/cc65/commit/${GITHUB_SHA}"
git push
- name: Package offline documents.
run: 7z a cc65-snapshot-docs.zip ./html/*.*
- name: Upload a Documents Snapshot Zip
uses: actions/upload-artifact@v4
with:
name: cc65-snapshot-docs
path: cc65-snapshot-docs.zip
# enter secrets under "repository secrets"
- name: Upload 32-bit Windows snapshot to sourceforge
uses: nogsantos/scp-deploy@master
with:
src: cc65-snapshot-win32.zip
host: ${{ secrets.SSH_HOST }}
remote: ${{ secrets.SSH_DIR }}
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
- name: Upload 64-bit Windows snapshot to sourceforge
uses: nogsantos/scp-deploy@master
with:
src: cc65-snapshot-win64.zip
host: ${{ secrets.SSH_HOST }}
remote: ${{ secrets.SSH_DIR }}
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
- name: Upload documents snapshot to sourceforge
uses: nogsantos/scp-deploy@master
with:
src: cc65-snapshot-docs.zip
host: ${{ secrets.SSH_HOST }}
remote: ${{ secrets.SSH_DIR }}
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
# TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io

View file

@ -0,0 +1,78 @@
name: Windows Test Scheduled
# Scheduled or manually dispatched because it's slower than the Linux test.
on:
schedule:
- cron: '0 0 */1 * *'
# every 1 days
workflow_dispatch:
# allow manual dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# don't run more than once at a time
jobs:
build_windows:
name: Build, Test (Windows MSVC)
runs-on: windows-latest
steps:
# This cache is used to remember the last build.
# If there are no changes and the last build was successful,
# the build and test steps will be omitted.
# If the last build failed, the full attempt will be repeated.
# Github Actions will retain the last build cache for up to 7 days.
- name: Create Cache
shell: bash
run: mkdir ~/.cache-sha
- name: Cache SHA
uses: actions/cache@v4
id: check-sha
with:
path: ~/.cache-sha
key: cache-sha-wintest-${{ github.sha }}
- name: Git Setup
if: steps.check-sha.outputs.cache-hit != 'true'
shell: bash
run: git config --global core.autocrlf input
- name: Checkout source
if: steps.check-sha.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Add msbuild to PATH
if: steps.check-sha.outputs.cache-hit != 'true'
uses: microsoft/setup-msbuild@v2
- name: Build app (MSVC debug)
if: steps.check-sha.outputs.cache-hit != 'true'
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug
- name: Build app (MSVC release)
if: steps.check-sha.outputs.cache-hit != 'true'
run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
- name: Build utils (MinGW)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 util SHELL=cmd QUIET=1
- name: Build the platform libraries (make lib)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 lib QUIET=1 SHELL=cmd QUIET=1
- name: Run the regression tests (make test)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 test QUIET=1 SHELL=cmd QUIET=1
- name: Test that the samples can be built (make samples)
if: steps.check-sha.outputs.cache-hit != 'true'
shell: cmd
run: make -j2 samples SHELL=cmd QUIET=1

12
.gitignore vendored Normal file
View file

@ -0,0 +1,12 @@
/bin/
/html/
/info/
/lib/
/libwrk/
/target/
/testwrk/
/wrk/
/cc65.zip
/util/atari/*.exe
/util/gamate/*.exe
/*.7z

26
.travis.yml Normal file
View file

@ -0,0 +1,26 @@
language: c
jobs:
include:
- os: linux
name: Linux
install:
- sudo apt-get update
- sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686 sshpass
script:
- make -j2 bin USER_CFLAGS=-Werror
- make -j2 lib QUIET=1
- make test QUIET=1
- make -j2 samples
- make -C src clean
- make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32-
- make -C samples clean
- make -j2 doc zip
after_success:
- make -f Makefile.travis
- os: windows
name: Windows
script:
- src/msbuild.cmd src\\cc65.sln

122
Code_of_Conduct.md Normal file
View file

@ -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

366
Contributing.md Normal file
View file

@ -0,0 +1,366 @@
Contributing to cc65
====================
This document contains all kinds of information that you
should know if you want to contribute to the cc65 project.
Before you start, please read all of it. If something is not
clear to you, please ask - this document is an ongoing effort
and may well be incomplete.
Also, before you put a lot of work into implementing
something you want to contribute, please get in touch with
one of the developers and ask if what you are going to do is
actually wanted and has a chance of being merged. Perhaps
someone else is already working on it, or perhaps what you
have in mind is not how we'd expect it to be - talking to us
before you start might save you a lot of work in those cases.
(''Note:'' The word "must" indicates a requirement. The word
"should" indicates a recommendation.)
*this is work in progress and is constantly updated - if in
doubt, please ask*
# Generally
* You must obey these rules when contributing new code or
documentation to cc65. We are well aware that not all
existing code may respect all rules outlined here - but this
is no reason for you not to respect them.
* One commit/patch/PR per issue. Do not mix several things
unless they are very closely related.
* Sometimes when you make a PR, it may break completely
unrelated tests. However, any PR is expected to merge
cleanly with no failures. That means in practise that you
are expected to fix/update the failing tests if required -
for example this might be needed if you make changes to the
compiler that changes the format of error- or warning
messages. In that case you might have to update some
reference files in the testbench. Obviously still check if
that is actually the right thing to do. ;)
# Codestyle rules
## All sources
### Line endings
All files must only contain Unix style 'LF' line endings.
Please configure your editors accordingly.
### TABs and spaces
This is an ongoing controversial topic - everyone knows
that. However, the following is how we do it :)
* TAB characters must be expanded to spaces.
* 4 spaces per indentation level (rather than 8) are
preferred, especially if there are many different levels.
* No extra spaces at the end of lines.
* All text files must end with new-line characters. Don't
leave the last line "dangling".
The (bash) scripts used to check the above rules can be
found in ```.github/check```. You can also run all checks
using ```make check```.
### Identifiers and symbol names
The C Standard defines certain identifiers and symbol names,
which we can not use in our code. Since it is not always
obvious which parts of the library code will actually end up
in a linked program, the following applies to ALL of the
library.
Any non standard identifier/symbol/function that is exported
from source files, or appears in header files:
* must not be in the "_symbol" form in C, or "__symbol" form
in assembly,
* must start with (at least) two (C Code) or three (assembly
code) underscores, unless the symbol appears in a non
standard header file.
This is likely more than the standard dictates us to do -
but it is certainly standard compliant - and easy to
remember.
Also see the discussion in
https://github.com/cc65/cc65/issues/1796
### Miscellaneous
* 80 characters is the desired maximum width of files. But,
it isn't a "strong" rule; sometimes, you will want to type
longer lines, in order to keep the parts of expressions or
comments together on the same line.
* You should avoid typing non-ASCII characters.
* If you change "normal" source code into comments, then you
must add a comment about why that code is a comment.
* When you want to create a comment from several lines of
code, you should use preprocessor lines, instead of ```/*
*/``` or "```;```". Example:
~~~C
#if 0
one (); two ();
three = two () + one ();
#endif
~~~
* You should type upper case characters for hex values.
* When you type zero-page addresses in hexadecimal, you
should type two hex characters (after the hex prefix).
When you type non-zero-page addresses in hex, you should
type four hex characters.
* When you type lists of addresses, it is a good idea to
sort them in ascending numerical order. That makes it
easier for readers to build mental pictures of where things
are in an address space. And, it is easier to see how big
the variables and buffers are. Example:
~~~asm
xCoord := $0703
yCoord := $0705 ; (this address implies that xCoord is 16 bits)
cmdbuf := $0706 ; (this address implies that yCoord is 8 bits)
cmdlen := $0786 ; (this address implies that cmdbuf is 128 bytes)
color := $0787
~~~
## C sources
The following is still very incomplete - if in doubt please
look at existing sourcefiles and adapt to the existing style.
Your files should generally obey the C89 standard, with a
few C99 things (this is a bit similar to what cc65 itself
supports). The exceptions are:
* Use stdint.h for variables that require a certain bit size
* In printf-style functions use the PRIX64 (and similar)
macros to deal with 64bit values (from inttypes.h) This
list is not necessarily complete - if in doubt, please ask.
* We generally have a "no warnings" policy
* Warnings must not be hidden by using typecasts - fix the
code instead
* The normal indentation width should be four spaces.
* You must use ANSI C comments (```/* */```); you must not
use C++ comments (```//```).
* When you add functions to an existing file, you should
separate them by the same number of blank lines that
separate the functions that already are in that file.
* All function declarations must be followed by a comment
block that tells at least briefly what the function does,
what the parameters are, and what is returned. This comment
must sit between the declaration and the function body, like
this:
~~~C
int foo(int bar)
/* Add 1 to bar, takes bar and returns the result */
{
return bar + 1;
}
~~~
* When a function's argument list wraps around to a next
line, you should indent that next line by either the
normal width or enough spaces to align it with the arguments
on the previous line.
* All declarations in a block must be at the beginning of
that block.
* You should put a blank line between a list of local
variable declarations and the first line of code.
* Always use curly braces even for single statements after
```if```, and the single statement should go into a new
line.
* Use "cuddling" braces, ie the opening brace goes in the
same line as the ```if```:
~~~C
if (foo > 42) {
bar = 23;
}
~~~
* Should the ```if``` statement be followed by an empty
conditional block, there should be a comment telling why
this is the case:
~~~C
if (check()) { /* nothing happened, do nothing */ }
~~~
* You must separate function names and parameter/argument
lists by one space.
* When declaring/defining pointers, you must put the
asterisk (```*```) next to the data type, with a space
between it and the variable's name. Examples:
~~~C
int* namedPtr[5];
char* nextLine (FILE* f);
~~~
### Header files
* All Headers should start with a copyright/license banner
* Function prototypes must be a single line, not contain the redundant
"extern" keyword, and followed by a brief comment that explains what
the function does, and separated from the next prototype by a blank
line:
~~~C
void __fastcall__ cclear (unsigned char length);
/* Clear part of a line (write length spaces). */
~~~
Headers that belong to the standard library (libc) must
conform with the C standard. That means:
* All non standard functions, or functions that only exist
in a certain standard, should be in #ifdefs
* The same is true for macros or typedefs.
You can refer to Annex B of the ISO C99 standard
([here](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf)
is the draft). Example:
~~~C
#if __CC65_STD__ == __CC65_STD_C99__ /* stuff that only exists in C99 here */
#endif
#if __CC65_STD__ == __CC65_STD_CC65__ /* non standard stuff here */
#endif </pre>
~~~
## Assembly sources
* Opcode mnemonics must have lower-case letters. The names
of instruction macroes may have upper-case letters.
* Opcodes must use their official and commonly used
mnemonics, ie 'bcc' and 'bcs' and not 'bgt' and 'blt'.
* Hexadecimal number constants should be used except where
decimal or binary numbers make much more sense in that
constant's context.
* Hexadecimal letters should be upper-case.
* When you set two registers or two memory locations to an
immediate 16-bit zero, you should use the expressions
```#<$0000``` and ```#>$0000``` (they make it obvious where
you are putting the lower and upper bytes).
* If a function is declared to return a char-sized value, it
actually must return an integer-sized value. (When cc65
promotes a returned value, it sometimes assumes that the value
already is an integer.)
This must be done in one of the following ways:
~~~asm
lda #RETURN_VALUE
ldx #0 ; Promote char return value
; If the value is 0, you can use:
lda #RETURN_VALUE
.assert RETURN_VALUE = 0
tax
; Sometimes jumping to 'return0' could save a byte:
.assert RETURN_VALUE = 0
jmp return0
~~~
* Functions, that are intended for a platform's system
library, should be optimized as much as possible.
* Sometimes, there must be a trade-off between size and
speed. If you think that a library function won't be used
often, then you should make it small. Otherwise, you should
make it fast.
* Comments that are put on the right side of instructions
must be aligned (start in the same character columns).
* Assembly source fields (label, operation, operand,
comment) should start ''after'' character columns that are
multiples of eight (such as 1, 9, 17, 33, and 41).
## LinuxDoc sources
* TAB characters must be expanded to spaces.
* All text files must end with new-line characters. Don't
leave the last line "dangling".
* 80 characters is the desired maximum width of files.
* You should avoid typing non-ASCII characters.
* You should put blank lines between LinuxDoc sections:
* Three blank lines between ```<sect>``` sections.
* Two blank lines between ```<sect1>``` sections.
* One blank line between other sections.
# Library implementation rules
* By default the toolchain must output a "standard" binary
for the platform, no emulator formats, no extra headers
used by tools. If the resulting binaries can not be run as
is on emulators or eg flash cartridges, the process of
converting them to something that can be used with these
should be documented in the user manual.
* Generally every function should live in a separate source
file - unless the functions are so closely related that
splitting makes no sense.
* Source files should not contain commented out code - if
they do, there should be a comment that explains why that
commented out code exists.
# Makefile rules
* Makefiles must generally work on both *nix (ba)sh and
windows cmd.exe.
* Makefiles must not use external tools that are not
provided by the cc65 toolchain itself.
The only exception to the above are actions that are exclusive
to the github actions - those may rely on bash and/or linux tools.
# Documentation rules
## User manual (LinuxDoc)
* This is the primary documentation.
## Wiki
* The Wiki is strictly for additional information that does
not fit into the regular user manual (LinuxDoc). The wiki
must not duplicate any information that is present in the
user manual.
# Roadmap / TODOs / open ends
## Documentation
* The printf() family of functions does not completely
implement all printf() modifiers and does not behave as
expected in some cases - all this should be documented in
detail.
## Compiler
* We need a way that makes it possible to feed arbitrary
assembler code into the optimizer, so we can have proper
tests for it.
### Floating point support
The first step is implementing the datatype "float" as IEEE
754 floats. Help welcomed!
* WIP compiler/library changes are here:
https://github.com/cc65/cc65/pull/1777
## Library
Some name clashes need to be resolved. Please see the
[detailed list of name clashes](libsrc/NameClashes.md).
## Test suite
* Specific tests to check the optimizer (rather than the code
generator) are needed.
* We need more specific tests to check standard conformance
of the library headers.

17
LICENSE Normal file
View file

@ -0,0 +1,17 @@
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from
the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software in
a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

106
Makefile Normal file
View file

@ -0,0 +1,106 @@
# ---- Display info during parsing phase ----
SILENT:=$(findstring s,$(word 1, $(MAKEFLAGS)))
ifneq ($(SILENT),s)
$(info Using Makefile: $(realpath $(firstword $(MAKEFILE_LIST))) $(MAKECMDGOALS))
endif
.PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test util checkstyle check checkprefix
.SUFFIXES:
all:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C util --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
@$(MAKE) checkprefix --no-print-directory
zip:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C util --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
install:
ifndef PREFIX
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 $@
@$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C util --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
mostlyclean clean:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C util --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
@$(MAKE) -C test --no-print-directory $@
@$(MAKE) -C targettest --no-print-directory $@
avail unavail:
# FIXME: actually not true, PREFIX is ignored?
#ifndef PREFIX
# $(error Error: PREFIX must be set for avail/unavail to work)
#endif
@$(MAKE) -C src --no-print-directory $@
bin:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) checkprefix --no-print-directory
lib libtest:
@$(MAKE) -C libsrc --no-print-directory $@
doc html info:
@$(MAKE) -C doc --no-print-directory $@
samples:
@$(MAKE) -C samples --no-print-directory $@
util:
@$(MAKE) -C util --no-print-directory $@
%65:
@$(MAKE) -C src --no-print-directory $@
%:
@$(MAKE) -C libsrc --no-print-directory $@
checkprefix:
ifndef PREFIX
ifndef DESTDIR
$(warning Warning: PREFIX and DESTDIR are empty - make install will not work)
endif
endif
# check the code style
checkstyle:
@$(MAKE) -C .github/checks --no-print-directory $@
# check bsearch tables
sorted:
@$(MAKE) -C .github/checks --no-print-directory $@
# check that no modules use "sp", requires the binaries to be built first
checksp:
@$(MAKE) -C .github/checks --no-print-directory $@
# runs regression tests, requires libtest target libraries
test:
@$(MAKE) -C test --no-print-directory $@
# GNU "check" target, which runs all tests
check:
@$(MAKE) -C .github/checks checkstyle --no-print-directory
@$(MAKE) -C .github/checks sorted --no-print-directory
@$(MAKE) -C src test --no-print-directory
@$(MAKE) test
@$(MAKE) -C targettest platforms --no-print-directory
@$(MAKE) -C samples platforms --no-print-directory

36
Makefile.travis Normal file
View file

@ -0,0 +1,36 @@
.PHONY: all gh-pages sf-files
.SUFFIXES:
all: gh-pages sf-files
GH_NAME = Oliver Schmidt
GH_MAIL = ol.sc@web.de
GH_PATH = ../doc
gh-pages:
ifdef GH_TOKEN
@echo 'git clone https://$$(GH_TOKEN)@github.com/cc65/doc.git $(GH_PATH)'
@git clone https://$(GH_TOKEN)@github.com/cc65/doc.git $(GH_PATH)
cd $(GH_PATH) && git config user.name "$(GH_NAME)"
cd $(GH_PATH) && git config user.email "$(GH_MAIL)"
cd $(GH_PATH) && git config push.default simple
$(RM) $(GH_PATH)/*.*
cp html/*.* $(GH_PATH)
cd $(GH_PATH) && git add -A
-cd $(GH_PATH) && git commit -m "Updated from commit $(TRAVIS_COMMIT)."
cd $(GH_PATH) && git push -q
endif
SF_USER = oliverschmidt
SF_HOST = frs.sourceforge.net
SF_FILE = /home/frs/project/cc65/cc65-snapshot-win32.zip
SCPFLAGS = -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -q
sf-files:
ifdef SF_PASS
echo $(TRAVIS_COMMIT) | zip -z cc65
@echo 'sshpass -p $$(SF_PASS) scp $(SCPFLAGS) cc65.zip $(SF_USER)@$(SF_HOST):$(SF_FILE)'
@sshpass -p $(SF_PASS) scp $(SCPFLAGS) cc65.zip $(SF_USER)@$(SF_HOST):$(SF_FILE)
endif

108
README.md Normal file
View file

@ -0,0 +1,108 @@
The cc65 cross-compiler suite
=============================
cc65 is a complete cross-development package for 65(C)02 systems,
including a powerful macro assembler, a C compiler, linker, archiver,
simulator and several other tools. cc65 has C and runtime library
support for many of the old 6502 machines. For details look at
the [cc65 web site](https://cc65.github.io):
| Company / People | Machine / Environment |
|-------------------------|-------------------------------------|
| Apple | Apple II |
| | Apple IIe enhanced |
| Atari | Atari 400/800 |
| | Atari 2600 |
| | Atari 5200 |
| | Atari 7800 |
| | Atari XL |
| | Lynx |
| Tangerine | Oric Atmos |
| Eureka | Oric Telestrat |
| Acorn | BBC series |
| Commodore | C128 |
| | C16 |
| | C64 |
| | CBM 510/610 |
| | PET |
| | Plus/4 |
| | VIC-20 |
| VTech | CreatiVision |
| Commander X16 Community | Commander X16 |
| Bit Corporation | Gamate |
| Berkeley Softworks | GEOS (Apple/CBM) |
| LUnix Team | LUnix (C64) |
| Nintendo | Nintendo Entertainment System (NES) |
| Ohio Scientific | OSI C1P |
| MOS Technology, Inc. | KIM-1 |
| NEC | PC Engine (PCE) |
| Rumbledethumps | Picocomputer 6502 (RP6502) |
| Watara | Watara/QuickShot Supervision |
| Synertek | SYM-1 |
| USSR | Agat-7/9 |
A generic configuration to adapt cc65 to new targets is also around.
## People
cc65 is originally based on the "Small C" compiler by Ron Cain and
enhanced by James E. Hendrix.
### Project founders
* John R. Dunning: [original implementation](https://public.websites.umich.edu/~archive/atari/8bit/Languages/Cc65/)
of the C compiler and runtime library, Atari hosted.
* Ullrich von Bassewitz:
* moved Dunning's code to modern systems,
* rewrote most parts of the compiler,
* rewrote all of the runtime library.
### Core team members
* [Christian Groessler](https://github.com/groessler): Atari, Atari5200, and CreatiVision library Maintainer
* [dqh](https://github.com/dqh-au): GHA help
* [Greg King](https://github.com/greg-king5): all around hackery
* [groepaz](https://github.com/mrdudz): CBM library, Project Maintainer
* [Oliver Schmidt](https://github.com/oliverschmidt): Apple II library Maintainer
### External contributors
* [acqn](https://github.com/acqn): various compiler fixes
* [jedeoric](https://github.com/jedeoric): Telestrat target
* [jmr](https://github.com/jmr): compiler fixes
* [karrika](https://github.com/karrika): Atari 7800 target
* [Stephan Mühlstrasser](https://github.com/smuehlst): osic1p target
* [Wayne Parham](https://github.com/WayneParham): Sym-1 target
* [Dave Plummer](https://github.com/davepl): KIM-1 target
* [Rumbledethumps](https://github.com/rumbledethumps): RP6502 target
*(The above list is incomplete, if you feel left out - please speak up or add yourself in a PR)*
For a complete list look at the [full team list](https://github.com/orgs/cc65/teams)
or the list of [all contributors](https://github.com/cc65/cc65/graphs/contributors).
# Contact
For general discussion, questions, etc subscribe to the
[mailing list](https://cc65.github.io/mailing-lists.html)
or use the [github discussions](https://github.com/cc65/cc65/discussions).
Some of us may also be around on IRC [#cc65](https://web.libera.chat/#cc65) on libera.chat.
# Documentation
* The main [Documentation](https://cc65.github.io/doc) for users and
developers.
* Info on [Contributing](Contributing.md) to the CC65 project. Please
read this before working on something you want to contribute, and
before reporting bugs.
* The [Wiki](https://github.com/cc65/wiki/wiki) contains some extra info
that does not fit into the regular documentation.
# Downloads
* [Windows 64bit Snapshot](https://sourceforge.net/projects/cc65/files/cc65-snapshot-win64.zip)
* [Windows 32bit Snapshot](https://sourceforge.net/projects/cc65/files/cc65-snapshot-win32.zip)
* [Linux Snapshot DEB and RPM](https://software.opensuse.org/download.html?project=home%3Astrik&package=cc65)
[![Snapshot Build](https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml/badge.svg?branch=master)](https://github.com/cc65/cc65/actions/workflows/snapshot-on-push-master.yml)

27
asminc/_file.inc Normal file
View file

@ -0,0 +1,27 @@
;
; _file.inc
;
; (C) Copyright 2002 Ullrich von Bassewitz (uz@cc65.org)
;
; Assembler include file that makes the constants and structures in _file.h
; available for asm code.
; Struct _FILE
.struct _FILE
f_fd .byte
f_flags .byte
f_pushback .byte
.endstruct
; Flags field
_FCLOSED = $00
_FOPEN = $01
_FEOF = $02
_FERROR = $04
_FPUSHBACK = $08
; File table
.global __filetab

35
asminc/_heap.inc Normal file
View file

@ -0,0 +1,35 @@
;
; _heap.inc
;
; (c) Copyright 2003, Ullrich von Bassewitz (uz@cc65.org)
;
; Assembler include file that makes the constants and structures in _heap.h
; available for asm code.
; Struct freeblock
; NOTE: For performance reasons, the asm code often uses increment/decrement
; operators to access other offsets, so just changing offsets here will
; probably not work.
.struct freeblock
size .word
next .addr
prev .addr
.endstruct
; Struct usedblock
; See notes above
.struct usedblock
size .word
start .addr
.endstruct
HEAP_MIN_BLOCKSIZE = .sizeof (freeblock) ; Minimum size of an allocated block
HEAP_ADMIN_SPACE = .sizeof (usedblock) ; Additional space for used bock
; Variables
.global ___heaporg
.global ___heapptr
.global ___heapend
.global ___heapfirst
.global ___heaplast

80
asminc/accelerator.inc Normal file
View file

@ -0,0 +1,80 @@
;
; Accelerator definitions.
;
; ---------------------------------------------------------------------------
; Speed definitions for all accelerator, to be used as input for the 'set'
; functions.
SPEED_SLOW = $00
SPEED_FAST = $FF
SPEED_1X = SPEED_SLOW
SPEED_2X = 2 - 1
SPEED_3X = 3 - 1
SPEED_4X = 4 - 1
SPEED_5X = 5 - 1
SPEED_6X = 6 - 1
SPEED_7X = 7 - 1
SPEED_8X = 8 - 1
SPEED_10X = 10 - 1
SPEED_12X = 12 - 1
SPEED_16X = 16 - 1
SPEED_20X = 20 - 1
; ---------------------------------------------------------------------------
; C64/C128 Super CPU cartridge
SuperCPU_Slow := $D07A
SuperCPU_Fast := $D07B
SuperCPU_Speed_Mode := $D0B8
SuperCPU_Detect := $D0BC
; ---------------------------------------------------------------------------
; C64DTV
C64DTV_Extended_Regs := $D03F
C64DTV_Slow = $00
C64DTV_Fast = $03
; ---------------------------------------------------------------------------
; C128 native and C128 in C64 mode
C128_VICIIE_CLK := $D030
; ---------------------------------------------------------------------------
; C64 Chameleon cartridge
CHAMELEON_CFGTUR := $D0F3
CHAMELEON_CFGENA := $D0FE
CHAMELEON_ENABLE_REGS = $2A
CHAMELEON_DISABLE_REGS = $FF
CHAMELEON_CFGTUR_LIMIT_1MHZ = %00001100
CHAMELEON_CFGTUR_LIMIT_NONE = %10000000
; ---------------------------------------------------------------------------
; C65/C64DX in C64 mode
C65_VICIII_KEY := $D02F
C65_VICIII_CTRL_B := $D031
C65_VICIII_UNLOCK_1 = $A5
C65_VICIII_UNLOCK_2 = $96
; ---------------------------------------------------------------------------
; C64 Turbo Master cartridge
TURBOMASTER_DETECT := $BF53
TURBOMASTER_SPEED_REG := $00

39
asminc/agat.inc Normal file
View file

@ -0,0 +1,39 @@
;-----------------------------------------------------------------------------
; Zero page stuff
WNDLFT := $20 ; Text window left
WNDWDTH := $21 ; Text window width
WNDTOP := $22 ; Text window top
WNDBTM := $23 ; Text window bottom+1
CH := $24 ; Cursor horizontal position
CV := $25 ; Cursor vertical position
BASL := $28 ; Text base address low
BASH := $29 ; Text base address high
CURSOR := $2D ; Cursor character
TATTR := $32 ; Text attributes
PROMPT := $33 ; Used by GETLN
VCOUT := $36 ; COUT Subroutine Vector
VCIN := $38 ; CIN Subroutine Vector
RNDL := $4E ; Random counter low
RNDH := $4F ; Random counter high
HIMEM := $73 ; Highest available memory address+1
;-----------------------------------------------------------------------------
; Vectors
DOSWARM := $03D0 ; DOS warmstart vector
BRKVec := $03F0 ; Break vector
SOFTEV := $03F2 ; Vector for warm start
PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1
;-----------------------------------------------------------------------------
; Hardware
; Keyboard input
KBD := $C000 ; Read keyboard
KBDSTRB := $C010 ; Clear keyboard strobe
; Game controller
BUTN0 := $C061 ; Open-Apple Key
BUTN1 := $C062 ; Closed-Apple Key

95
asminc/apple2.inc Normal file
View file

@ -0,0 +1,95 @@
;-----------------------------------------------------------------------------
; Zero page
WNDLFT := $20 ; Text window left
WNDWDTH := $21 ; Text window width
WNDTOP := $22 ; Text window top
WNDBTM := $23 ; Text window bottom+1
CH := $24 ; Cursor horizontal position
CV := $25 ; Cursor vertical position
BASL := $28 ; Text base address low
BASH := $29 ; Text base address high
INVFLG := $32 ; Normal/inverse(/flash)
PROMPT := $33 ; Used by GETLN
RNDL := $4E ; Random counter low
RNDH := $4F ; Random counter high
HIMEM := $73 ; Highest available memory address+1
CURLIN := $75 ; Current line number being executed
;-----------------------------------------------------------------------------
; Vectors
DOSWARM := $03D0 ; DOS warmstart vector
BRKVec := $03F0 ; Break vector
SOFTEV := $03F2 ; Vector for warm start
PWREDUP := $03F4 ; This must be = EOR #$A5 of SOFTEV+1
ROM_RST := $FFFC ; 6502 reset vector
ROM_IRQ := $FFFE ; 6502 IRQ vector
;-----------------------------------------------------------------------------
; 80 column firmware
OURCH := $057B ; Cursor horizontal position
OURCV := $05FB ; Cursor vertical position
;-----------------------------------------------------------------------------
; Hardware
; Keyboard input
KBD := $C000 ; Read keyboard
KBDSTRB := $C010 ; Clear keyboard strobe
; 80 column video
CLR80COL:= $C000 ; Disable 80 column store
SET80COL:= $C001 ; Enable 80 column store
RD80COL := $C018 ; >127 if 80 column store enabled
RD80VID := $C01F ; >127 if 80 column video enabled
; Character set
CLRALTCHAR := $C00E ; Normal Apple II char set
SETALTCHAR := $C00F ; Norm/inv LC, no flash
ALTCHARSET := $C01E ; >127 if alt charset switched in
; Language card
RDLCBNK2:= $C011 ; >127 if LC bank 2 in use
RDLCRAM := $C012 ; >127 if LC is read enabled
ROMIN := $C081 ; Swap in D000-FFFF ROM
LCBANK2 := $C083 ; Swap in LC bank 2
LCBANK1 := $C08B ; Swap in LC bank 1
; Vertical blanking
RDVBLBAR := $C019 ; >127 if not vertical blanking
RDVBLMSK := $C041 ; >127 if VBL interrupts enabled
DISVBL := $C05A ; Disable VBL interrupts
ENVBL := $C05B ; Enable VBL interrupts
; Video mode
TXTCLR := $C050 ; Display graphics
TXTSET := $C051 ; Display text
MIXCLR := $C052 ; Disable 4 lines of text
MIXSET := $C053 ; Enable 4 lines of text
LOWSCR := $C054 ; Page 1
HISCR := $C055 ; Page 2
LORES := $C056 ; Lores graphics
HIRES := $C057 ; Hires graphics
DHIRESON := $C05E ; Enable double-width graphics
DHIRESOFF := $C05F ; Disable double-width graphics
; Game controller
TAPEIN := $C060 ; Read casette input / Switch input 3
BUTN0 := $C061 ; Switch input 0 / Open-Apple key
BUTN1 := $C062 ; Switch input 1 / Closed-Apple key
BUTN2 := $C063 ; Switch input 2 / Shift key
PADDL0 := $C064 ; Analog input 0
PADDL1 := $C065 ; Analog input 1
PADDL2 := $C066 ; Analog input 2
PADDL3 := $C067 ; Analog input 3
PTRIG := $C070 ; Analog input reset
; Input/Output Unit
IOUDISON := $C07E ; Disable IOU
IOUDISOFF := $C07F ; Enable IOU
; Control Your Apple
CYAREG := $C036 ; Bits 0-3=disk detect 4=shadow all banks 7=fast

54
asminc/apple2.mac Normal file
View file

@ -0,0 +1,54 @@
; Convert characters to screen codes
; Helper macro that converts and outputs one character
.macro _scrcode char
.if (char < 256)
.byte (char + 128)
.else
.error "scrcode: Character constant out of range"
.endif
.endmacro
.macro scrcode arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
; Bail out if next argument is empty
.if .blank (arg1)
.exitmacro
.endif
; Check for a string
.if .match ({arg1}, "")
; Walk over all string chars
.repeat .strlen (arg1), i
_scrcode {.strat (arg1, i)}
.endrepeat
; Check for a number
.elseif .match (.left (1, {arg1}), 0)
; Just output the number
_scrcode arg1
; Check for a character
.elseif .match (.left (1, {arg1}), 'a')
; 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"
.endif
; Call the macro recursively with the remaining args
scrcode arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
.endmacro

287
asminc/ascii_charmap.inc Normal file
View file

@ -0,0 +1,287 @@
;/*****************************************************************************/
;/* */
;/* ascii_charmap.inc */
;/* */
;/* No translations, encodings are stored as they were typed in the host. */
;/* */
;/* */
;/* 2019-09-07, Greg King */
;/* */
;/* This software is provided "as-is", without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated, but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice must not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
;/* ASCII */
.charmap $00, $00
.charmap $01, $01
.charmap $02, $02
.charmap $03, $03
.charmap $04, $04
.charmap $05, $05
.charmap $06, $06
.charmap $07, $07
.charmap $08, $08
.charmap $09, $09
.charmap $0A, $0A
.charmap $0B, $0B
.charmap $0C, $0C
.charmap $0D, $0D
.charmap $0E, $0E
.charmap $0F, $0F
.charmap $10, $10
.charmap $11, $11
.charmap $12, $12
.charmap $13, $13
.charmap $14, $14
.charmap $15, $15
.charmap $16, $16
.charmap $17, $17
.charmap $18, $18
.charmap $19, $19
.charmap $1A, $1A
.charmap $1B, $1B
.charmap $1C, $1C
.charmap $1D, $1D
.charmap $1E, $1E
.charmap $1F, $1F
.charmap $20, $20
.charmap $21, $21
.charmap $22, $22
.charmap $23, $23
.charmap $24, $24
.charmap $25, $25
.charmap $26, $26
.charmap $27, $27
.charmap $28, $28
.charmap $29, $29
.charmap $2A, $2A
.charmap $2B, $2B
.charmap $2C, $2C
.charmap $2D, $2D
.charmap $2E, $2E
.charmap $2F, $2F
.charmap $30, $30
.charmap $31, $31
.charmap $32, $32
.charmap $33, $33
.charmap $34, $34
.charmap $35, $35
.charmap $36, $36
.charmap $37, $37
.charmap $38, $38
.charmap $39, $39
.charmap $3A, $3A
.charmap $3B, $3B
.charmap $3C, $3C
.charmap $3D, $3D
.charmap $3E, $3E
.charmap $3F, $3F
.charmap $40, $40
.charmap $41, $41
.charmap $42, $42
.charmap $43, $43
.charmap $44, $44
.charmap $45, $45
.charmap $46, $46
.charmap $47, $47
.charmap $48, $48
.charmap $49, $49
.charmap $4A, $4A
.charmap $4B, $4B
.charmap $4C, $4C
.charmap $4D, $4D
.charmap $4E, $4E
.charmap $4F, $4F
.charmap $50, $50
.charmap $51, $51
.charmap $52, $52
.charmap $53, $53
.charmap $54, $54
.charmap $55, $55
.charmap $56, $56
.charmap $57, $57
.charmap $58, $58
.charmap $59, $59
.charmap $5A, $5A
.charmap $5B, $5B
.charmap $5C, $5C
.charmap $5D, $5D
.charmap $5E, $5E
.charmap $5F, $5F
.charmap $60, $60
.charmap $61, $61
.charmap $62, $62
.charmap $63, $63
.charmap $64, $64
.charmap $65, $65
.charmap $66, $66
.charmap $67, $67
.charmap $68, $68
.charmap $69, $69
.charmap $6A, $6A
.charmap $6B, $6B
.charmap $6C, $6C
.charmap $6D, $6D
.charmap $6E, $6E
.charmap $6F, $6F
.charmap $70, $70
.charmap $71, $71
.charmap $72, $72
.charmap $73, $73
.charmap $74, $74
.charmap $75, $75
.charmap $76, $76
.charmap $77, $77
.charmap $78, $78
.charmap $79, $79
.charmap $7A, $7A
.charmap $7B, $7B
.charmap $7C, $7C
.charmap $7D, $7D
.charmap $7E, $7E
.charmap $7F, $7F
;/* beyond ASCII */
.charmap $80, $80
.charmap $81, $81
.charmap $82, $82
.charmap $83, $83
.charmap $84, $84
.charmap $85, $85
.charmap $86, $86
.charmap $87, $87
.charmap $88, $88
.charmap $89, $89
.charmap $8A, $8A
.charmap $8B, $8B
.charmap $8C, $8C
.charmap $8D, $8D
.charmap $8E, $8E
.charmap $8F, $8F
.charmap $90, $90
.charmap $91, $91
.charmap $92, $92
.charmap $93, $93
.charmap $94, $94
.charmap $95, $95
.charmap $96, $96
.charmap $97, $97
.charmap $98, $98
.charmap $99, $99
.charmap $9A, $9A
.charmap $9B, $9B
.charmap $9C, $9C
.charmap $9D, $9D
.charmap $9E, $9E
.charmap $9F, $9F
.charmap $A0, $A0
.charmap $A1, $A1
.charmap $A2, $A2
.charmap $A3, $A3
.charmap $A4, $A4
.charmap $A5, $A5
.charmap $A6, $A6
.charmap $A7, $A7
.charmap $A8, $A8
.charmap $A9, $A9
.charmap $AA, $AA
.charmap $AB, $AB
.charmap $AC, $AC
.charmap $AD, $AD
.charmap $AE, $AE
.charmap $AF, $AF
.charmap $B0, $B0
.charmap $B1, $B1
.charmap $B2, $B2
.charmap $B3, $B3
.charmap $B4, $B4
.charmap $B5, $B5
.charmap $B6, $B6
.charmap $B7, $B7
.charmap $B8, $B8
.charmap $B9, $B9
.charmap $BA, $BA
.charmap $BB, $BB
.charmap $BC, $BC
.charmap $BD, $BD
.charmap $BE, $BE
.charmap $BF, $BF
.charmap $C0, $C0
.charmap $C1, $C1
.charmap $C2, $C2
.charmap $C3, $C3
.charmap $C4, $C4
.charmap $C5, $C5
.charmap $C6, $C6
.charmap $C7, $C7
.charmap $C8, $C8
.charmap $C9, $C9
.charmap $CA, $CA
.charmap $CB, $CB
.charmap $CC, $CC
.charmap $CD, $CD
.charmap $CE, $CE
.charmap $CF, $CF
.charmap $D0, $D0
.charmap $D1, $D1
.charmap $D2, $D2
.charmap $D3, $D3
.charmap $D4, $D4
.charmap $D5, $D5
.charmap $D6, $D6
.charmap $D7, $D7
.charmap $D8, $D8
.charmap $D9, $D9
.charmap $DA, $DA
.charmap $DB, $DB
.charmap $DC, $DC
.charmap $DD, $DD
.charmap $DE, $DE
.charmap $DF, $DF
.charmap $E0, $E0
.charmap $E1, $E1
.charmap $E2, $E2
.charmap $E3, $E3
.charmap $E4, $E4
.charmap $E5, $E5
.charmap $E6, $E6
.charmap $E7, $E7
.charmap $E8, $E8
.charmap $E9, $E9
.charmap $EA, $EA
.charmap $EB, $EB
.charmap $EC, $EC
.charmap $ED, $ED
.charmap $EE, $EE
.charmap $EF, $EF
.charmap $F0, $F0
.charmap $F1, $F1
.charmap $F2, $F2
.charmap $F3, $F3
.charmap $F4, $F4
.charmap $F5, $F5
.charmap $F6, $F6
.charmap $F7, $F7
.charmap $F8, $F8
.charmap $F9, $F9
.charmap $FA, $FA
.charmap $FB, $FB
.charmap $FC, $FC
.charmap $FD, $FD
.charmap $FE, $FE
.charmap $FF, $FF

1169
asminc/atari.inc Normal file

File diff suppressed because it is too large Load diff

65
asminc/atari.mac Normal file
View file

@ -0,0 +1,65 @@
; Convert characters to screen codes
; Helper macro that converts and outputs one character
.macro _scrcode char
.if (char >= 0) .and (char <= 31)
.byte (char + 64)
.elseif (char >= 32) .and (char <= 95)
.byte (char - 32)
.elseif (char >= 96) .and (char <= 127)
.byte char
.elseif (char >= 128) .and (char <= 159)
.byte (char + 64)
.elseif (char >= 160) .and (char <= 223)
.byte (char - 32)
.elseif (char >= 224) .and (char <= 255)
.byte char
.else
.error "scrcode: Character constant out of range"
.endif
.endmacro
.macro scrcode arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
; Bail out if next argument is empty
.if .blank (arg1)
.exitmacro
.endif
; Check for a string
.if .match ({arg1}, "")
; Walk over all string chars
.repeat .strlen (arg1), i
_scrcode {.strat (arg1, i)}
.endrepeat
; Check for a number
.elseif .match (.left (1, {arg1}), 0)
; Just output the number
_scrcode arg1
; Check for a character
.elseif .match (.left (1, {arg1}), 'a')
; 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"
.endif
; Call the macro recursively with the remaining args
scrcode arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
.endmacro

7
asminc/atari2600.inc Normal file
View file

@ -0,0 +1,7 @@
; Atari 2600 TIA & RIOT read / write registers
;
; Florent Flament (contact@florentflament.com), 2017
; TIA & RIOT registers mapping
.include "atari2600_tia.inc"
.include "atari2600_riot.inc"

20
asminc/atari2600_riot.inc Normal file
View file

@ -0,0 +1,20 @@
; Atari 2600 RIOT read / write registers
;
; Source: DASM - vcs.h
; Details available in: Stella Programmer's Guide by Steve Wright
;
; Florent Flament (contact@florentflament.com), 2017
; Read registers
SWCHA := $0280
SWACNT := $0281
SWCHB := $0282
SWBCNT := $0283
INTIM := $0284
TIMINT := $0285
; Write registers
TIM1T := $0294
TIM8T := $0295
TIM64T := $0296
T1024T := $0297

69
asminc/atari2600_tia.inc Normal file
View file

@ -0,0 +1,69 @@
; Atari 2600 TIA read / write registers
;
; Source: DASM - vcs.h
; Details available in: Stella Programmer's Guide by Steve Wright
;
; Florent Flament (contact@florentflament.com), 2017
; Read registers
VSYNC := $00
VBLANK := $01
WSYNC := $02
RSYNC := $03
NUSIZ0 := $04
NUSIZ1 := $05
COLUP0 := $06
COLUP1 := $07
COLUPF := $08
COLUBK := $09
CTRLPF := $0A
REFP0 := $0B
REFP1 := $0C
PF0 := $0D
PF1 := $0E
PF2 := $0F
RESP0 := $10
RESP1 := $11
RESM0 := $12
RESM1 := $13
RESBL := $14
AUDC0 := $15
AUDC1 := $16
AUDF0 := $17
AUDF1 := $18
AUDV0 := $19
AUDV1 := $1A
GRP0 := $1B
GRP1 := $1C
ENAM0 := $1D
ENAM1 := $1E
ENABL := $1F
HMP0 := $20
HMP1 := $21
HMM0 := $22
HMM1 := $23
HMBL := $24
VDELP0 := $25
VDELP1 := $26
VDELBL := $27
RESMP0 := $28
RESMP1 := $29
HMOVE := $2A
HMCLR := $2B
CXCLR := $2C
; Write registers
CXM0P := $00
CXM1P := $01
CXP0FB := $02
CXP1FB := $03
CXM0FB := $04
CXM1FB := $05
CXBLPF := $06
CXPPMM := $07
INPT0 := $08
INPT1 := $09
INPT2 := $0A
INPT3 := $0B
INPT4 := $0C
INPT5 := $0D

133
asminc/atari5200.inc Normal file
View file

@ -0,0 +1,133 @@
;-------------------------------------------------------------------------
; Atari 5200 System Equates
; by Christian Groessler <chris@groessler.org>
; taken from EQUATES.INC from Atari Inc.
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; ATASCII CHARACTER DEFS
;-------------------------------------------------------------------------
ATEOL = $9B ; END-OF-LINE, used by CONIO
;-------------------------------------------------------------------------
; CONIO CHARACTER DEFS
;-------------------------------------------------------------------------
CH_ULCORNER = $0B ; '+' sign
CH_URCORNER = $0B
CH_LLCORNER = $0B
CH_LRCORNER = $0B
CH_HLINE = $0D ; dash
CH_VLINE = $01 ; exclamation mark
;-------------------------------------------------------------------------
; Zero Page
;-------------------------------------------------------------------------
POKMSK = $00 ; Mask for Pokey IRQ enable
RTCLOK = $01 ; 60 hz. clock
JUMP = $01
CRITIC = $03 ; Critical section
ATRACT = $04 ; Attract Mode
SDLSTL = $05 ; DLISTL Shadow
SDLSTH = $06 ; DLISTH "
SDMCTL = $07 ; DMACTL "
PCOLR0 = $08 ; COLPM0 Shadow
PCOLR1 = $09 ; COLPM1 "
PCOLR2 = $0A ; COLPM2 "
PCOLR3 = $0B ; COLPM3 "
COLOR0 = $0C ; COLPF0 Shadow
COLOR1 = $0D ; COLPF1 "
COLOR2 = $0E ; COLPF2 "
COLOR3 = $0F ; COLPF3 "
COLOR4 = $10 ; COLBK "
PADDL0 = $11 ; POT0 Shadow
PADDL1 = $12 ; POT1 "
PADDL2 = $13 ; POT2 "
PADDL3 = $14 ; POT3 "
PADDL4 = $15 ; POT4 "
PADDL5 = $16 ; POT5 "
PADDL6 = $17 ; POT6 "
PADDL7 = $18 ; POT7 "
; cc65 runtime zero page variables
ROWCRS_5200 = $19
COLCRS_5200 = $1A
SAVMSC = $1B ; pointer to screen memory (conio)
;-------------------------------------------------------------------------
; Page #2
;-------------------------------------------------------------------------
;Interrupt Vectors
VIMIRQ = $0200 ; Immediate IRQ
; Preset $FC03 (SYSIRQ)
VVBLKI = $0202 ; Vblank immediate
; Preset $FCB8 (SYSVBL)
VVBLKD = $0204 ; Vblank deferred
; Preset $FCB2 (XITVBL)
VDSLST = $0206 ; Display List
; Preset $FEA1 (OSDLI)
VKYBDI = $0208 ; Keyboard immediate
; Preset $FD02 (SYSKBD)
VKYBDF = $020A ; Deferred Keyboard
; Preset $FCB2 (XITVBL)
VTRIGR = $020C ; Soft Trigger
VBRKOP = $020E ; BRK Opcode
VSERIN = $0210 ; Serial in Ready
VSEROR = $0212 ; Serial Out Ready
VSEROC = $0214 ; Serial Output complete
VTIMR1 = $0216 ; Pokey Timer 1
VTIMR2 = $0218 ; Pokey Timer 2
VTIMR4 = $021A ; Pokey Timer 4
;-------------------------------------------------------------------------
; CTIA/GTIA Address Equates
;-------------------------------------------------------------------------
GTIA = $C000 ; CTIA/GTIA area
.include "atari_gtia.inc"
;-------------------------------------------------------------------------
; ANTIC Address Equates
;-------------------------------------------------------------------------
ANTIC = $D400 ; ANTIC area
.include "atari_antic.inc"
;-------------------------------------------------------------------------
; POKEY Address Equates
;-------------------------------------------------------------------------
POKEY = $E800 ; POKEY area
.include "atari_pokey.inc"
;-------------------------------------------------------------------------
; conio color defines
;-------------------------------------------------------------------------
COLOR_WHITE = 0
COLOR_RED = 1
COLOR_GREEN = 2
COLOR_BLACK = 3
;-------------------------------------------------------------------------
; Cartridge Parameters
;-------------------------------------------------------------------------
CARTNM = $BFE8 ; Cartridge Name Area
COPYD = $BFFC ; Copyright Decade in Cart
COPYR = $BFFD ; Copyright Year in Cart
; $FF=Diagnostic Cart
GOCART = $BFFE ; Cartridge Start Vector
CHRORG = $F800 ; Character Generator Base

14
asminc/atari7800.inc Normal file
View file

@ -0,0 +1,14 @@
; Atari 7800 TIA & RIOT read / write registers
;
; Karri Kaksonen (karri@sipo.fi), 2022
; TIA, RIOT & MARIA registers mapping
.include "atari7800_tia.inc"
.include "atari7800_riot.inc"
.include "atari7800_maria.inc"
; constants for the conio implementation
mono_charsperline = 40
charsperline = 20
screenrows = 28

View file

@ -0,0 +1,39 @@
; Atari 7800 MARIA read / write registers
;
; Read registers
BKGRND := $20
P0C1 := $21
P0C2 := $22
P0C3 := $23
MWSYNC := $24
P1C1 := $25
P1C2 := $26
P1C3 := $27
MSTAT := $28
P2C1 := $29
P2C2 := $2A
P2C3 := $2B
DPPH := $2C
P3C1 := $2D
P3C2 := $2E
P3C3 := $2F
DPPL := $30
P4C1 := $31
P4C2 := $32
P4C3 := $33
CHBASE := $34
P5C1 := $35
P5C2 := $36
P5C3 := $37
OFFSET := $38
P6C1 := $39
P6C2 := $3A
P6C3 := $3B
CTRL := $3C
P7C1 := $3D
P7C2 := $3E
P7C3 := $3F
; Write registers

20
asminc/atari7800_riot.inc Normal file
View file

@ -0,0 +1,20 @@
; Atari 7800 RIOT read / write registers
;
; Source: DASM - vcs.h
; Details available in: Stella Programmer's Guide by Steve Wright
;
; Florent Flament (contact@florentflament.com), 2017
; Read registers
SWCHA := $0280
CTLSWA := $0281
SWCHB := $0282
CTLSWB := $0283
INTIM := $0284
TIMINT := $0285
; Write registers
TIM1T := $0294
TIM8T := $0295
TIM64T := $0296
T1024T := $0297

69
asminc/atari7800_tia.inc Normal file
View file

@ -0,0 +1,69 @@
; Atari 7800 TIA read / write registers
;
; Source: DASM - vcs.h
; Details available in: Stella Programmer's Guide by Steve Wright
;
; Florent Flament (contact@florentflament.com), 2017
; Read registers
VSYNC := $00
VBLANK := $01
WSYNC := $02
RSYNC := $03
NUSIZ0 := $04
NUSIZ1 := $05
COLUP0 := $06
COLUP1 := $07
COLUPF := $08
COLUBK := $09
CTRLPF := $0A
REFP0 := $0B
REFP1 := $0C
PF0 := $0D
PF1 := $0E
PF2 := $0F
RESP0 := $10
RESP1 := $11
RESM0 := $12
RESM1 := $13
RESBL := $14
AUDC0 := $15
AUDC1 := $16
AUDF0 := $17
AUDF1 := $18
AUDV0 := $19
AUDV1 := $1A
GRP0 := $1B
GRP1 := $1C
ENAM0 := $1D
ENAM1 := $1E
ENABL := $1F
HMP0 := $20
HMP1 := $21
HMM0 := $22
HMM1 := $23
HMBL := $24
VDELP0 := $25
VDELP1 := $26
VDELBL := $27
RESMP0 := $28
RESMP1 := $29
HMOVE := $2A
HMCLR := $2B
CXCLR := $2C
; Write registers
CXM0P := $00
CXM1P := $01
CXP0FB := $02
CXP1FB := $03
CXM0FB := $04
CXM1FB := $05
CXBLPF := $06
CXPPMM := $07
INPT0 := $08
INPT1 := $09
INPT2 := $0A
INPT3 := $0B
INPT4 := $0C
INPT5 := $0D

95
asminc/atari_antic.inc Normal file
View file

@ -0,0 +1,95 @@
;-------------------------------------------------------------------------
; ANTIC Address Equates
;-------------------------------------------------------------------------
; Read Addresses
VCOUNT = ANTIC + $0B ;vertical line counter
PENH = ANTIC + $0C ;light pen horizontal position
PENV = ANTIC + $0D ;light pen vertical position
NMIST = ANTIC + $0F ;NMI interrupt status
; Write Addresses
DMACTL = ANTIC + $00 ;DMA control
CHACTL = ANTIC + $01 ;character control
DLISTL = ANTIC + $02 ;low display list address
DLISTH = ANTIC + $03 ;high display list address
HSCROL = ANTIC + $04 ;horizontal scroll
VSCROL = ANTIC + $05 ;vertical scroll
PMBASE = ANTIC + $07 ;player-missile base address
CHBASE = ANTIC + $09 ;character base address
WSYNC = ANTIC + $0A ;wait for HBLANK synchronization
NMIEN = ANTIC + $0E ;NMI enable
NMIRES = ANTIC + $0F ;NMI interrupt reset
;-------------------------------------------------------------------------
; Antic opcodes
;-------------------------------------------------------------------------
; usage example:
;
; ScreenDL:
; .byte DL_BLK8
; .byte DL_BLK8
; .byte DL_CHR40x8x1 | DL_LMS | DL_DLI
; .word ScreenAlignment
; .byte DL_BLK1 | DL_DLI
; .byte DL_MAP320x1x1 | DL_LMS
; .word Screen
;
; .repeat 99
; .byte DL_MAP320x1x1
; .endrepeat
; .byte DL_MAP320x1x1 | DL_LMS
; .word Screen + 40 * 100 ; 100 lines a 40 byte, 'Screen' has to be aligned correctly!
; .repeat 92
; .byte DL_MAP320x1x1
; .endrepeat
;
; .byte DL_JVB
; absolute instructions (non mode lines)
DL_JMP = 1
DL_JVB = 65
; DL_BLKn display n empty lines (just background)
DL_BLK1 = 0
DL_BLK2 = 16
DL_BLK3 = 32
DL_BLK4 = 48
DL_BLK5 = 64
DL_BLK6 = 80
DL_BLK7 = 96
DL_BLK8 = 112
; absolute instructions (mode lines)
DL_CHR40x8x1 = 2 ; monochrome, 40 character & 8 scanlines per mode line (GR. 0)
DL_CHR40x10x1 = 3 ; monochrome, 40 character & 10 scanlines per mode line
DL_CHR40x8x4 = 4 ; colour, 40 character & 8 scanlines per mode line (GR. 12)
DL_CHR40x16x4 = 5 ; colour, 40 character & 16 scanlines per mode line (GR. 13)
DL_CHR20x8x2 = 6 ; colour (duochrome per character), 20 character & 8 scanlines per mode line (GR. 1)
DL_CHR20x16x2 = 7 ; colour (duochrome per character), 20 character & 16 scanlines per mode line (GR. 2)
DL_MAP40x8x4 = 8 ; colour, 40 pixel & 8 scanlines per mode line (GR. 3)
DL_MAP80x4x2 = 9 ; 'duochrome', 80 pixel & 4 scanlines per mode line (GR.4)
DL_MAP80x4x4 = 10 ; colour, 80 pixel & 4 scanlines per mode line (GR.5)
DL_MAP160x2x2 = 11 ; 'duochrome', 160 pixel & 2 scanlines per mode line (GR.6)
DL_MAP160x1x2 = 12 ; 'duochrome', 160 pixel & 1 scanline per mode line (GR.14)
DL_MAP160x2x4 = 13 ; 4 colours, 160 pixel & 2 scanlines per mode line (GR.7)
DL_MAP160x1x4 = 14 ; 4 colours, 160 pixel & 1 scanline per mode line (GR.15)
DL_MAP320x1x1 = 15 ; monochrome, 320 pixel & 1 scanline per mode line (GR.8)
; modifiers on mode lines...
DL_HSCROL = 16
DL_VSCROL = 32
DL_LMS = 64
; general modifier...
DL_DLI = 128

View file

@ -0,0 +1,301 @@
;/*****************************************************************************/
;/* */
;/* atari_atascii_charmap.inc */
;/* */
;/* Atari system standard string mapping ISO-8859-1 -> AtASCII */
;/* */
;/* */
;/* */
;/* C 2016 Christian Krueger */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice may not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
.charmap $00, $00
.charmap $01, $01
.charmap $02, $02
.charmap $03, $03
.charmap $04, $04
.charmap $05, $05
.charmap $06, $06
.charmap $07, $FD
.charmap $08, $08
.charmap $09, $7F
.charmap $0A, $9B
.charmap $0B, $0B
.charmap $0C, $7D
.charmap $0D, $0D
.charmap $0E, $0E
.charmap $0F, $0F
.charmap $10, $10
.charmap $11, $11
.charmap $12, $12
.charmap $13, $13
.charmap $14, $14
.charmap $15, $15
.charmap $16, $16
.charmap $17, $17
.charmap $18, $18
.charmap $19, $19
.charmap $1A, $1A
.charmap $1B, $1B
.charmap $1C, $1C
.charmap $1D, $1D
.charmap $1E, $1E
.charmap $1F, $1F
.charmap $20, $20
.charmap $21, $21
.charmap $22, $22
.charmap $23, $23
.charmap $24, $24
.charmap $25, $25
.charmap $26, $26
.charmap $27, $27
.charmap $28, $28
.charmap $29, $29
.charmap $2A, $2A
.charmap $2B, $2B
.charmap $2C, $2C
.charmap $2D, $2D
.charmap $2E, $2E
.charmap $2F, $2F
.charmap $30, $30
.charmap $31, $31
.charmap $32, $32
.charmap $33, $33
.charmap $34, $34
.charmap $35, $35
.charmap $36, $36
.charmap $37, $37
.charmap $38, $38
.charmap $39, $39
.charmap $3A, $3A
.charmap $3B, $3B
.charmap $3C, $3C
.charmap $3D, $3D
.charmap $3E, $3E
.charmap $3F, $3F
.charmap $40, $40
.charmap $41, $41
.charmap $42, $42
.charmap $43, $43
.charmap $44, $44
.charmap $45, $45
.charmap $46, $46
.charmap $47, $47
.charmap $48, $48
.charmap $49, $49
.charmap $4A, $4A
.charmap $4B, $4B
.charmap $4C, $4C
.charmap $4D, $4D
.charmap $4E, $4E
.charmap $4F, $4F
.charmap $50, $50
.charmap $51, $51
.charmap $52, $52
.charmap $53, $53
.charmap $54, $54
.charmap $55, $55
.charmap $56, $56
.charmap $57, $57
.charmap $58, $58
.charmap $59, $59
.charmap $5A, $5A
.charmap $5B, $5B
.charmap $5C, $5C
.charmap $5D, $5D
.charmap $5E, $5E
.charmap $5F, $5F
.charmap $60, $60
.charmap $61, $61
.charmap $62, $62
.charmap $63, $63
.charmap $64, $64
.charmap $65, $65
.charmap $66, $66
.charmap $67, $67
.charmap $68, $68
.charmap $69, $69
.charmap $6A, $6A
.charmap $6B, $6B
.charmap $6C, $6C
.charmap $6D, $6D
.charmap $6E, $6E
.charmap $6F, $6F
.charmap $70, $70
.charmap $71, $71
.charmap $72, $72
.charmap $73, $73
.charmap $74, $74
.charmap $75, $75
.charmap $76, $76
.charmap $77, $77
.charmap $78, $78
.charmap $79, $79
.charmap $7A, $7A
.charmap $7B, $7B
.charmap $7C, $7C
.charmap $7D, $7D
.charmap $7E, $7E
.charmap $7F, $7F
.charmap $80, $80
.charmap $81, $81
.charmap $82, $82
.charmap $83, $83
.charmap $84, $84
.charmap $85, $85
.charmap $86, $86
.charmap $87, $87
.charmap $88, $88
.charmap $89, $89
.charmap $8A, $8A
.charmap $8B, $8B
.charmap $8C, $8C
.charmap $8D, $8D
.charmap $8E, $8E
.charmap $8F, $8F
.charmap $90, $90
.charmap $91, $91
.charmap $92, $92
.charmap $93, $93
.charmap $94, $94
.charmap $95, $95
.charmap $96, $96
.charmap $97, $97
.charmap $98, $98
.charmap $99, $99
.charmap $9A, $9A
.charmap $9B, $9B
.charmap $9C, $9C
.charmap $9D, $9D
.charmap $9E, $9E
.charmap $9F, $9F
.charmap $A0, $A0
.charmap $A1, $A1
.charmap $A2, $A2
.charmap $A3, $A3
.charmap $A4, $A4
.charmap $A5, $A5
.charmap $A6, $A6
.charmap $A7, $A7
.charmap $A8, $A8
.charmap $A9, $A9
.charmap $AA, $AA
.charmap $AB, $AB
.charmap $AC, $AC
.charmap $AD, $AD
.charmap $AE, $AE
.charmap $AF, $AF
.charmap $B0, $B0
.charmap $B1, $B1
.charmap $B2, $B2
.charmap $B3, $B3
.charmap $B4, $B4
.charmap $B5, $B5
.charmap $B6, $B6
.charmap $B7, $B7
.charmap $B8, $B8
.charmap $B9, $B9
.charmap $BA, $BA
.charmap $BB, $BB
.charmap $BC, $BC
.charmap $BD, $BD
.charmap $BE, $BE
.charmap $BF, $BF
.charmap $C0, $C0
.charmap $C1, $C1
.charmap $C2, $C2
.charmap $C3, $C3
.charmap $C4, $C4
.charmap $C5, $C5
.charmap $C6, $C6
.charmap $C7, $C7
.charmap $C8, $C8
.charmap $C9, $C9
.charmap $CA, $CA
.charmap $CB, $CB
.charmap $CC, $CC
.charmap $CD, $CD
.charmap $CE, $CE
.charmap $CF, $CF
.charmap $D0, $D0
.charmap $D1, $D1
.charmap $D2, $D2
.charmap $D3, $D3
.charmap $D4, $D4
.charmap $D5, $D5
.charmap $D6, $D6
.charmap $D7, $D7
.charmap $D8, $D8
.charmap $D9, $D9
.charmap $DA, $DA
.charmap $DB, $DB
.charmap $DC, $DC
.charmap $DD, $DD
.charmap $DE, $DE
.charmap $DF, $DF
.charmap $E0, $E0
.charmap $E1, $E1
.charmap $E2, $E2
.charmap $E3, $E3
.charmap $E4, $E4
.charmap $E5, $E5
.charmap $E6, $E6
.charmap $E7, $E7
.charmap $E8, $E8
.charmap $E9, $E9
.charmap $EA, $EA
.charmap $EB, $EB
.charmap $EC, $EC
.charmap $ED, $ED
.charmap $EE, $EE
.charmap $EF, $EF
.charmap $F0, $F0
.charmap $F1, $F1
.charmap $F2, $F2
.charmap $F3, $F3
.charmap $F4, $F4
.charmap $F5, $F5
.charmap $F6, $F6
.charmap $F7, $F7
.charmap $F8, $F8
.charmap $F9, $F9
.charmap $FA, $FA
.charmap $FB, $FB
.charmap $FC, $FC
.charmap $FD, $FD
.charmap $FE, $FE
.charmap $FF, $FF

119
asminc/atari_gtia.inc Normal file
View file

@ -0,0 +1,119 @@
;-------------------------------------------------------------------------
; CTIA/GTIA Address Equates
;-------------------------------------------------------------------------
; Read/Write Addresses
CONSOL = GTIA + $1F ;console switches and speaker control
; Read Addresses
M0PF = GTIA + $00 ;missile 0 and playfield collision
M1PF = GTIA + $01 ;missile 1 and playfield collision
M2PF = GTIA + $02 ;missile 2 and playfield collision
M3PF = GTIA + $03 ;missile 3 and playfield collision
P0PF = GTIA + $04 ;player 0 and playfield collision
P1PF = GTIA + $05 ;player 1 and playfield collision
P2PF = GTIA + $06 ;player 2 and playfield collision
P3PF = GTIA + $07 ;player 3 and playfield collision
M0PL = GTIA + $08 ;missile 0 and player collision
M1PL = GTIA + $09 ;missile 1 and player collision
M2PL = GTIA + $0A ;missile 2 and player collision
M3PL = GTIA + $0B ;missile 3 and player collision
P0PL = GTIA + $0C ;player 0 and player collision
P1PL = GTIA + $0D ;player 1 and player collision
P2PL = GTIA + $0E ;player 2 and player collision
P3PL = GTIA + $0F ;player 3 and player collision
TRIG0 = GTIA + $10 ;joystick trigger 0
TRIG1 = GTIA + $11 ;joystick trigger 1
TRIG2 = GTIA + $12 ;cartridge interlock
TRIG3 = GTIA + $13 ;ACMI module interlock
PAL = GTIA + $14 ;##rev2## PAL/NTSC indicator
; Write Addresses
HPOSP0 = GTIA + $00 ;player 0 horizontal position
HPOSP1 = GTIA + $01 ;player 1 horizontal position
HPOSP2 = GTIA + $02 ;player 2 horizontal position
HPOSP3 = GTIA + $03 ;player 3 horizontal position
HPOSM0 = GTIA + $04 ;missile 0 horizontal position
HPOSM1 = GTIA + $05 ;missile 1 horizontal position
HPOSM2 = GTIA + $06 ;missile 2 horizontal position
HPOSM3 = GTIA + $07 ;missile 3 horizontal position
SIZEP0 = GTIA + $08 ;player 0 size
SIZEP1 = GTIA + $09 ;player 1 size
SIZEP2 = GTIA + $0A ;player 2 size
SIZEP3 = GTIA + $0B ;player 3 size
SIZEM = GTIA + $0C ;missile sizes
GRAFP0 = GTIA + $0D ;player 0 graphics
GRAFP1 = GTIA + $0E ;player 1 graphics
GRAFP2 = GTIA + $0F ;player 2 graphics
GRAFP3 = GTIA + $10 ;player 3 graphics
GRAFM = GTIA + $11 ;missile graphics
COLPM0 = GTIA + $12 ;player-missile 0 color/luminance
COLPM1 = GTIA + $13 ;player-missile 1 color/luminance
COLPM2 = GTIA + $14 ;player-missile 2 color/luminance
COLPM3 = GTIA + $15 ;player-missile 3 color/luminance
COLPF0 = GTIA + $16 ;playfield 0 color/luminance
COLPF1 = GTIA + $17 ;playfield 1 color/luminance
COLPF2 = GTIA + $18 ;playfield 2 color/luminance
COLPF3 = GTIA + $19 ;playfield 3 color/luminance
COLBK = GTIA + $1A ;background color/luminance
PRIOR = GTIA + $1B ;priority select
VDELAY = GTIA + $1C ;vertical delay
GRACTL = GTIA + $1D ;graphic control
HITCLR = GTIA + $1E ;collision clear
; Hue values
HUE_GREY = 0
HUE_GOLD = 1
HUE_GOLDORANGE = 2
HUE_REDORANGE = 3
HUE_ORANGE = 4
HUE_MAGENTA = 5
HUE_PURPLE = 6
HUE_BLUE = 7
HUE_BLUE2 = 8
HUE_CYAN = 9
HUE_BLUEGREEN = 10
HUE_BLUEGREEN2 = 11
HUE_GREEN = 12
HUE_YELLOWGREEN = 13
HUE_YELLOW = 14
HUE_YELLOWRED = 15
; Color defines, similar to c64 colors (untested)
GTIA_COLOR_BLACK = (HUE_GREY << 4)
GTIA_COLOR_WHITE = (HUE_GREY << 4 | 7 << 1)
GTIA_COLOR_RED = (HUE_REDORANGE << 4 | 1 << 1)
GTIA_COLOR_CYAN = (HUE_CYAN << 4 | 3 << 1)
GTIA_COLOR_VIOLET = (HUE_PURPLE << 4 | 4 << 1)
GTIA_COLOR_GREEN = (HUE_GREEN << 4 | 2 << 1)
GTIA_COLOR_BLUE = (HUE_BLUE << 4 | 2 << 1)
GTIA_COLOR_YELLOW = (HUE_YELLOW << 4 | 7 << 1)
GTIA_COLOR_ORANGE = (HUE_ORANGE << 4 | 5 << 1)
GTIA_COLOR_BROWN = (HUE_YELLOW << 4 | 2 << 1)
GTIA_COLOR_LIGHTRED = (HUE_REDORANGE << 4 | 6 << 1)
GTIA_COLOR_GRAY1 = (HUE_GREY << 4 | 2 << 1)
GTIA_COLOR_GRAY2 = (HUE_GREY << 4 | 3 << 1)
GTIA_COLOR_LIGHTGREEN = (HUE_GREEN << 4 | 6 << 1)
GTIA_COLOR_LIGHTBLUE = (HUE_BLUE << 4 | 6 << 1)
GTIA_COLOR_GRAY3 = (HUE_GREY << 4 | 5 << 1)

43
asminc/atari_pokey.inc Normal file
View file

@ -0,0 +1,43 @@
;-------------------------------------------------------------------------
; POKEY Address Equates
;-------------------------------------------------------------------------
; Read Addresses
POT0 = POKEY + $00 ;potentiometer 0
POT1 = POKEY + $01 ;potentiometer 1
POT2 = POKEY + $02 ;potentiometer 2
POT3 = POKEY + $03 ;potentiometer 3
POT4 = POKEY + $04 ;potentiometer 4
POT5 = POKEY + $05 ;potentiometer 5
POT6 = POKEY + $06 ;potentiometer 6
POT7 = POKEY + $07 ;potentiometer 7
ALLPOT = POKEY + $08 ;potentiometer port status
KBCODE = POKEY + $09 ;keyboard code
RANDOM = POKEY + $0A ;random number generator
SERIN = POKEY + $0D ;serial port input
IRQST = POKEY + $0E ;IRQ interrupt status
SKSTAT = POKEY + $0F ;serial port and keyboard status
; Write Addresses
AUDF1 = POKEY + $00 ;channel 1 audio frequency
AUDC1 = POKEY + $01 ;channel 1 audio control
AUDF2 = POKEY + $02 ;channel 2 audio frequency
AUDC2 = POKEY + $03 ;channel 2 audio control
AUDF3 = POKEY + $04 ;channel 3 audio frequency
AUDC3 = POKEY + $05 ;channel 3 audio control
AUDF4 = POKEY + $06 ;channel 4 audio frequency
AUDC4 = POKEY + $07 ;channel 4 audio control
AUDCTL = POKEY + $08 ;audio control
STIMER = POKEY + $09 ;start timers
SKRES = POKEY + $0A ;reset SKSTAT status
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

View file

@ -0,0 +1,303 @@
;/*****************************************************************************/
;/* */
;/* atari_screen_charmap.inc */
;/* */
;/* Atari system internal string mapping ISO-8859-1 -> Internal/Screen-Code */
;/* */
;/* */
;/* */
;/* C 2016 Christian Krueger */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice may not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
.charmap $00, $40
.charmap $01, $41
.charmap $02, $42
.charmap $03, $43
.charmap $04, $44
.charmap $05, $45
.charmap $06, $46
.charmap $07, $FD
.charmap $08, $48
.charmap $09, $7F
.charmap $0A, $DB
.charmap $0B, $4B
.charmap $0C, $7D
.charmap $0D, $4D
.charmap $0E, $4E
.charmap $0F, $4F
.charmap $10, $50
.charmap $11, $51
.charmap $12, $52
.charmap $13, $53
.charmap $14, $54
.charmap $15, $55
.charmap $16, $56
.charmap $17, $57
.charmap $18, $58
.charmap $19, $59
.charmap $1A, $5A
.charmap $1B, $5B
.charmap $1C, $5C
.charmap $1D, $5D
.charmap $1E, $5E
.charmap $1F, $5F
.charmap $20, $00
.charmap $21, $01
.charmap $22, $02
.charmap $23, $03
.charmap $24, $04
.charmap $25, $05
.charmap $26, $06
.charmap $27, $07
.charmap $28, $08
.charmap $29, $09
.charmap $2A, $0A
.charmap $2B, $0B
.charmap $2C, $0C
.charmap $2D, $0D
.charmap $2E, $0E
.charmap $2F, $0F
.charmap $30, $10
.charmap $31, $11
.charmap $32, $12
.charmap $33, $13
.charmap $34, $14
.charmap $35, $15
.charmap $36, $16
.charmap $37, $17
.charmap $38, $18
.charmap $39, $19
.charmap $3A, $1A
.charmap $3B, $1B
.charmap $3C, $1C
.charmap $3D, $1D
.charmap $3E, $1E
.charmap $3F, $1F
.charmap $40, $20
.charmap $41, $21
.charmap $42, $22
.charmap $43, $23
.charmap $44, $24
.charmap $45, $25
.charmap $46, $26
.charmap $47, $27
.charmap $48, $28
.charmap $49, $29
.charmap $4A, $2A
.charmap $4B, $2B
.charmap $4C, $2C
.charmap $4D, $2D
.charmap $4E, $2E
.charmap $4F, $2F
.charmap $50, $30
.charmap $51, $31
.charmap $52, $32
.charmap $53, $33
.charmap $54, $34
.charmap $55, $35
.charmap $56, $36
.charmap $57, $37
.charmap $58, $38
.charmap $59, $39
.charmap $5A, $3A
.charmap $5B, $3B
.charmap $5C, $3C
.charmap $5D, $3D
.charmap $5E, $3E
.charmap $5F, $3F
.charmap $60, $60
.charmap $61, $61
.charmap $62, $62
.charmap $63, $63
.charmap $64, $64
.charmap $65, $65
.charmap $66, $66
.charmap $67, $67
.charmap $68, $68
.charmap $69, $69
.charmap $6A, $6A
.charmap $6B, $6B
.charmap $6C, $6C
.charmap $6D, $6D
.charmap $6E, $6E
.charmap $6F, $6F
.charmap $70, $70
.charmap $71, $71
.charmap $72, $72
.charmap $73, $73
.charmap $74, $74
.charmap $75, $75
.charmap $76, $76
.charmap $77, $77
.charmap $78, $78
.charmap $79, $79
.charmap $7A, $7A
.charmap $7B, $7B
.charmap $7C, $7C
.charmap $7D, $7D
.charmap $7E, $7E
.charmap $7F, $7F
.charmap $80, $C0
.charmap $81, $C1
.charmap $82, $C2
.charmap $83, $C3
.charmap $84, $C4
.charmap $85, $C5
.charmap $86, $C6
.charmap $87, $C7
.charmap $88, $C8
.charmap $89, $C9
.charmap $8A, $CA
.charmap $8B, $CB
.charmap $8C, $CC
.charmap $8D, $CD
.charmap $8E, $CE
.charmap $8F, $CF
.charmap $90, $D0
.charmap $91, $D1
.charmap $92, $D2
.charmap $93, $D3
.charmap $94, $D4
.charmap $95, $D5
.charmap $96, $D6
.charmap $97, $D7
.charmap $98, $D8
.charmap $99, $D9
.charmap $9A, $DA
.charmap $9B, $DB
.charmap $9C, $DC
.charmap $9D, $DD
.charmap $9E, $DE
.charmap $9F, $DF
.charmap $A0, $80
.charmap $A1, $81
.charmap $A2, $82
.charmap $A3, $83
.charmap $A4, $84
.charmap $A5, $85
.charmap $A6, $86
.charmap $A7, $87
.charmap $A8, $88
.charmap $A9, $89
.charmap $AA, $8A
.charmap $AB, $8B
.charmap $AC, $8C
.charmap $AD, $8D
.charmap $AE, $8E
.charmap $AF, $8F
.charmap $B0, $90
.charmap $B1, $91
.charmap $B2, $92
.charmap $B3, $93
.charmap $B4, $94
.charmap $B5, $95
.charmap $B6, $96
.charmap $B7, $97
.charmap $B8, $98
.charmap $B9, $99
.charmap $BA, $9A
.charmap $BB, $9B
.charmap $BC, $9C
.charmap $BD, $9D
.charmap $BE, $9E
.charmap $BF, $9F
.charmap $C0, $A0
.charmap $C1, $A1
.charmap $C2, $A2
.charmap $C3, $A3
.charmap $C4, $A4
.charmap $C5, $A5
.charmap $C6, $A6
.charmap $C7, $A7
.charmap $C8, $A8
.charmap $C9, $A9
.charmap $CA, $AA
.charmap $CB, $AB
.charmap $CC, $AC
.charmap $CD, $AD
.charmap $CE, $AE
.charmap $CF, $AF
.charmap $D0, $B0
.charmap $D1, $B1
.charmap $D2, $B2
.charmap $D3, $B3
.charmap $D4, $B4
.charmap $D5, $B5
.charmap $D6, $B6
.charmap $D7, $B7
.charmap $D8, $B8
.charmap $D9, $B9
.charmap $DA, $BA
.charmap $DB, $BB
.charmap $DC, $BC
.charmap $DD, $BD
.charmap $DE, $BE
.charmap $DF, $BF
.charmap $E0, $E0
.charmap $E1, $E1
.charmap $E2, $E2
.charmap $E3, $E3
.charmap $E4, $E4
.charmap $E5, $E5
.charmap $E6, $E6
.charmap $E7, $E7
.charmap $E8, $E8
.charmap $E9, $E9
.charmap $EA, $EA
.charmap $EB, $EB
.charmap $EC, $EC
.charmap $ED, $ED
.charmap $EE, $EE
.charmap $EF, $EF
.charmap $F0, $F0
.charmap $F1, $F1
.charmap $F2, $F2
.charmap $F3, $F3
.charmap $F4, $F4
.charmap $F5, $F5
.charmap $F6, $F6
.charmap $F7, $F7
.charmap $F8, $F8
.charmap $F9, $F9
.charmap $FA, $FA
.charmap $FB, $FB
.charmap $FC, $FC
.charmap $FD, $FD
.charmap $FE, $FE
.charmap $FF, $FF

117
asminc/atmos.inc Normal file
View file

@ -0,0 +1,117 @@
;
; Oric Atmos definitions
; BASIC 1.1 addresses
;
; ---------------------------------------------------------------------------
; Constants
SCREEN_XSIZE = 40 ; screen columns
SCREEN_YSIZE = 28 ; screen rows
FUNCTKEY = $A5
FNAME_LEN = 16 ; maximum length of file-name
; ---------------------------------------------------------------------------
; Zero page
SCRPTR := $12
BASIC_BUF := $35
CHARGOT := $E8
TXTPTR := $E9
; ---------------------------------------------------------------------------
; Low memory
MODEKEY := $0209
CAPSLOCK := $020C ; $7F = not locked, $FF = locked
PATTERN := $0213
IRQVec := $0245 ; "fast" interrupt vector
JOINFLAG := $025A ; 0 = don't joiu, $4A = join BASIC programs
VERIFYFLAG := $025B ; 0 = load, 1 = verify
CURS_Y := $0268
CURS_X := $0269
STATUS := $026A
BACKGRND := $026B
FOREGRND := $026C
TIMER3 := $0276
CFILE_NAME := $027F
CFOUND_NAME := $0293
FILESTART := $02A9
FILEEND := $02AB
AUTORUN := $02AD ; $00 = only load, $C7 = autorun
LANGFLAG := $02AE ; $00 = BASIC, $80 = machine code
LOADERR := $02B1
KEYBUF := $02DF
PARMERR := $02E0
PARAM1 := $02E1 ; & $02E2
PARAM2 := $02E3 ; & $02E4
PARAM3 := $02E5 ; & $02E6
BANGVEC := $02F5
; ---------------------------------------------------------------------------
; I/O locations
; 6522
.struct VIA ; Versatile Interface Adapter
.res $0300
PRB .byte ; Port Register B
PRA .byte ; Port Register A
DDRB .byte ; Data Direction Register B
DDRA .byte ; Data Direction Register A
T1 .word ; Timer 1
T1L .word ; Timer 1 Latch
T2 .word ; Timer 2
SR .byte ; Shift Register
ACR .byte ; Auxiliary Control Register
PCR .byte ; Peripheral Control Register
IFR .byte ; Interrupt Flags Register
IER .byte ; Interrupt Enable Register
PRA2 .byte ; Port Register A without handshaking
.endstruct
; 6551
.struct ACIA ; Asynchronous Communications Interface Adapter
.res $031C
DATA .byte
STATUS .byte
CMD .byte ; Command register
CTRL .byte ; Control register
.endstruct
SCREEN := $BB80
; ---------------------------------------------------------------------------
; ROM entries
GETLINE := $C592
TEXT := $EC21
HIRES := $EC33
CURSET := $F0C8
CURMOV := $F0FD
DRAW := $F110
CHAR := $F12D
POINT := $F1C8
PAPER := $F204
INK := $F210
PRINT := $F77C
; Sound Effects
PING := $FA9F
PING1 := $FA85
SHOOT := $FAB5
SHOOT1 := $FA9B
EXPLODE := $FACB
EXPLODE1 := $FAB1
ZAP := $FAE1
ZAP1 := $FAC7
TICK := $FB14
TICK1 := $FAFA
TOCK := $FB2A
TOCK1 := $FB10

224
asminc/c128.inc Normal file
View file

@ -0,0 +1,224 @@
;
; C128 generic definitions. Stolen from Elite128
;
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
TXTPTR := $3D ; Pointer into BASIC source code
STATUS := $90 ; Kernal I/O completion status
TIME := $A0 ; 60HZ clock
FNAM_LEN := $B7 ; Length of filename
SECADR := $B9 ; Secondary address
DEVNUM := $BA ; Device number
FNAM := $BB ; Address of filename
FNAM_BANK := $C7 ; Bank for filename
KEY_COUNT := $D0 ; Number of keys in input buffer
FKEY_COUNT := $D1 ; Characters for function key
MODE := $D7 ; 40-/80-column mode (bit 7: 80 columns)
GRAPHM := $D8 ; Graphics mode flags (bits 5-7)
CHARDIS := $D9 ; Bit 2 shadow for location $01
CURS_X := $EC ; Cursor column
CURS_Y := $EB ; Cursor row
SCREEN_PTR := $E0 ; Pointer to current char in text screen
CRAM_PTR := $E2 ; Pointer to current char in color RAM
CHARCOLOR := $F1
RVS := $F3 ; Reverse output flag
SCROLL := $F8 ; Disable scrolling flag
BASIC_BUF := $0200 ; Location of command-line
BASIC_BUF_LEN = 162 ; Maximum length of command-line
FETCH := $02A2 ; Fetch subroutine in RAM
FETVEC := $02AA ; Vector patch location for FETCH
STASH := $02AF ; Stash routine in RAM
STAVEC := $02B9 ; Vector patch location for STASH
IRQInd := $02FD ; JMP $0000 -- used as indirect IRQ vector
PALFLAG := $0A03 ; $FF=PAL, $00=NTSC
INIT_STATUS := $0A04 ; Flags: Reset/Restore initiation status
VM2 := $0A2D ; VIC-IIe shadow for $D018 -- graphics mode
FKEY_LEN := $1000 ; Function key lengths
FKEY_TEXT := $100A ; Function key texts
KBDREPEAT := $028a
KBDREPEATRATE := $028b
KBDREPEATDELAY := $028c
; ---------------------------------------------------------------------------
; Vectors
IRQVec := $0314
BRKVec := $0316
NMIVec := $0318
KeyStoreVec := $033C
; ---------------------------------------------------------------------------
; I/O: VIC
VIC := $D000
VIC_SPR0_X := $D000
VIC_SPR0_Y := $D001
VIC_SPR1_X := $D002
VIC_SPR1_Y := $D003
VIC_SPR2_X := $D004
VIC_SPR2_Y := $D005
VIC_SPR3_X := $D006
VIC_SPR3_Y := $D007
VIC_SPR4_X := $D008
VIC_SPR4_Y := $D009
VIC_SPR5_X := $D00A
VIC_SPR5_Y := $D00B
VIC_SPR6_X := $D00C
VIC_SPR6_Y := $D00D
VIC_SPR7_X := $D00E
VIC_SPR7_Y := $D00F
VIC_SPR_HI_X := $D010
VIC_SPR_ENA := $D015
VIC_SPR_EXP_Y := $D017
VIC_SPR_EXP_X := $D01D
VIC_SPR_MCOLOR := $D01C
VIC_SPR_BG_PRIO := $D01B
VIC_SPR_MCOLOR0 := $D025
VIC_SPR_MCOLOR1 := $D026
VIC_SPR0_COLOR := $D027
VIC_SPR1_COLOR := $D028
VIC_SPR2_COLOR := $D029
VIC_SPR3_COLOR := $D02A
VIC_SPR4_COLOR := $D02B
VIC_SPR5_COLOR := $D02C
VIC_SPR6_COLOR := $D02D
VIC_SPR7_COLOR := $D02E
VIC_CTRL1 := $D011
VIC_CTRL2 := $D016
VIC_HLINE := $D012
VIC_LPEN_X := $D013
VIC_LPEN_Y := $D014
VIC_VIDEO_ADR := $D018
VIC_IRR := $D019 ; Interrupt request register
VIC_IMR := $D01A ; Interrupt mask register
VIC_BORDERCOLOR := $D020
VIC_BG_COLOR0 := $D021
VIC_BG_COLOR1 := $D022
VIC_BG_COLOR2 := $D023
VIC_BG_COLOR3 := $D024
; 128 stuff:
VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
; ---------------------------------------------------------------------------
; I/O: SID
SID := $D400
SID_S1Lo := $D400
SID_S1Hi := $D401
SID_PB1Lo := $D402
SID_PB1Hi := $D403
SID_Ctl1 := $D404
SID_AD1 := $D405
SID_SUR1 := $D406
SID_S2Lo := $D407
SID_S2Hi := $D408
SID_PB2Lo := $D409
SID_PB2Hi := $D40A
SID_Ctl2 := $D40B
SID_AD2 := $D40C
SID_SUR2 := $D40D
SID_S3Lo := $D40E
SID_S3Hi := $D40F
SID_PB3Lo := $D410
SID_PB3Hi := $D411
SID_Ctl3 := $D412
SID_AD3 := $D413
SID_SUR3 := $D414
SID_FltLo := $D415
SID_FltHi := $D416
SID_FltCtl := $D417
SID_Amp := $D418
SID_ADConv1 := $D419
SID_ADConv2 := $D41A
SID_Noise := $D41B
SID_Read3 := $D41C
; ---------------------------------------------------------------------------
; I/O: VDC (128 only)
VDC_INDEX := $D600 ; register address port
VDC_DATA := $D601 ; data port
; Registers
VDC_DATA_HI = 18 ; video RAM address (big endian)
VDC_DATA_LO = 19
VDC_CSET = 28
VDC_RAM_RW = 31 ; RAM port
; ---------------------------------------------------------------------------
; I/O: Complex Interface Adapters
CIA1 := $DC00
CIA1_PRA := $DC00 ; Port A
CIA1_PRB := $DC01 ; Port B
CIA1_DDRA := $DC02 ; Data direction register for port A
CIA1_DDRB := $DC03 ; Data direction register for port B
CIA1_TA := $DC04 ; 16-bit timer A
CIA1_TB := $DC06 ; 16-bit timer B
CIA1_TOD10 := $DC08 ; Time-of-day tenths of a second
CIA1_TODSEC := $DC09 ; Time-of-day seconds
CIA1_TODMIN := $DC0A ; Time-of-day minutes
CIA1_TODHR := $DC0B ; Time-of-day hours
CIA1_SDR := $DC0C ; Serial data register
CIA1_ICR := $DC0D ; Interrupt control register
CIA1_CRA := $DC0E ; Control register for timer A
CIA1_CRB := $DC0F ; Control register for timer B
CIA2 := $DD00
CIA2_PRA := $DD00
CIA2_PRB := $DD01
CIA2_DDRA := $DD02
CIA2_DDRB := $DD03
CIA2_TA := $DD04
CIA2_TB := $DD06
CIA2_TOD10 := $DD08
CIA2_TODSEC := $DD09
CIA2_TODMIN := $DD0A
CIA2_TODHR := $DD0B
CIA2_SDR := $DD0C
CIA2_ICR := $DD0D
CIA2_CRA := $DD0E
CIA2_CRB := $DD0F
; ---------------------------------------------------------------------------
; I/O: MMU
MMU_CR := $FF00
MMU_CFG_CC65 := %00001110 ; Bank 0 with kernal ROM
MMU_CFG_RAM0 := %00111111 ; Bank 0 full RAM
MMU_CFG_RAM1 := %01111111 ; Bank 1 full RAM
MMU_CFG_RAM2 := %10111111 ; Bank 2 full RAM
MMU_CFG_RAM3 := %11111111 ; Bank 3 full RAM
MMU_CFG_IFROM := %01010111 ; Bank 1 with Internal Function RAM/ROM
MMU_CFG_EFROM := %01101011 ; Bank 1 with External Function RAM/ROM
; ---------------------------------------------------------------------------
; Super CPU
SCPU_VIC_Bank1 := $D075
SCPU_Slow := $D07A
SCPU_Fast := $D07B
SCPU_EnableRegs := $D07E
SCPU_DisableRegs:= $D07F
SCPU_Detect := $D0BC

9
asminc/c16.inc Normal file
View file

@ -0,0 +1,9 @@
;
; C16 generic definitions.
;
; The C16 and Plus/4 are identical, so just include the Plus/4 include file.
.include "plus4.inc"

219
asminc/c64.inc Normal file
View file

@ -0,0 +1,219 @@
;
; C64 generic definitions. Stolen from Elite128
;
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
VARTAB := $2D ; Pointer to start of BASIC variables
MEMSIZE := $37 ; Pointer to highest BASIC RAM location (+1)
TXTPTR := $7A ; Pointer into BASIC source code
STATUS := $90 ; Kernal I/O completion status
TIME := $A0 ; 60 HZ clock
FNAM_LEN := $B7 ; Length of filename
SECADR := $B9 ; Secondary address
DEVNUM := $BA ; Device number
FNAM := $BB ; Pointer to filename
KEY_COUNT := $C6 ; Number of keys in input buffer
RVS := $C7 ; Reverse flag
CURS_FLAG := $CC ; 1 = cursor off
CURS_BLINK := $CD ; Blink counter
CURS_CHAR := $CE ; Character under the cursor
CURS_STATE := $CF ; Cursor blink state
SCREEN_PTR := $D1 ; Pointer to current char in text screen
CURS_X := $D3 ; Cursor column
CURS_Y := $D6 ; Cursor row
CRAM_PTR := $F3 ; Pointer to current char in color RAM
FREKZP := $FB ; Five unused bytes
BASIC_BUF := $200 ; Location of command-line
BASIC_BUF_LEN = 89 ; Maximum length of command-line
CHARCOLOR := $286
CURS_COLOR := $287 ; Color under the cursor
PALFLAG := $2A6 ; $01 = PAL, $00 = NTSC
KBDREPEAT := $28a
KBDREPEATRATE := $28b
KBDREPEATDELAY := $28c
; ---------------------------------------------------------------------------
; Vector and other locations
IRQVec := $0314
BRKVec := $0316
NMIVec := $0318
; ---------------------------------------------------------------------------
; Screen size
XSIZE = 40
YSIZE = 25
; ---------------------------------------------------------------------------
; I/O: VIC
VIC := $D000
VIC_SPR0_X := $D000
VIC_SPR0_Y := $D001
VIC_SPR1_X := $D002
VIC_SPR1_Y := $D003
VIC_SPR2_X := $D004
VIC_SPR2_Y := $D005
VIC_SPR3_X := $D006
VIC_SPR3_Y := $D007
VIC_SPR4_X := $D008
VIC_SPR4_Y := $D009
VIC_SPR5_X := $D00A
VIC_SPR5_Y := $D00B
VIC_SPR6_X := $D00C
VIC_SPR6_Y := $D00D
VIC_SPR7_X := $D00E
VIC_SPR7_Y := $D00F
VIC_SPR_HI_X := $D010
VIC_SPR_ENA := $D015
VIC_SPR_EXP_Y := $D017
VIC_SPR_EXP_X := $D01D
VIC_SPR_MCOLOR := $D01C
VIC_SPR_BG_PRIO := $D01B
VIC_SPR_COLL := $D01E
VIC_SPR_BG_COLL := $D01F
VIC_SPR_MCOLOR0 := $D025
VIC_SPR_MCOLOR1 := $D026
VIC_SPR0_COLOR := $D027
VIC_SPR1_COLOR := $D028
VIC_SPR2_COLOR := $D029
VIC_SPR3_COLOR := $D02A
VIC_SPR4_COLOR := $D02B
VIC_SPR5_COLOR := $D02C
VIC_SPR6_COLOR := $D02D
VIC_SPR7_COLOR := $D02E
VIC_CTRL1 := $D011
VIC_CTRL2 := $D016
VIC_HLINE := $D012
VIC_LPEN_X := $D013
VIC_LPEN_Y := $D014
VIC_VIDEO_ADR := $D018
VIC_IRR := $D019 ; Interrupt request register
VIC_IMR := $D01A ; Interrupt mask register
VIC_BORDERCOLOR := $D020
VIC_BG_COLOR0 := $D021
VIC_BG_COLOR1 := $D022
VIC_BG_COLOR2 := $D023
VIC_BG_COLOR3 := $D024
; 128 stuff:
VIC_KBD_128 := $D02F ; Extended kbd bits (visible in 64 mode)
VIC_CLK_128 := $D030 ; Clock rate register (visible in 64 mode)
; ---------------------------------------------------------------------------
; I/O: SID
SID := $D400
SID_S1Lo := $D400
SID_S1Hi := $D401
SID_PB1Lo := $D402
SID_PB1Hi := $D403
SID_Ctl1 := $D404
SID_AD1 := $D405
SID_SUR1 := $D406
SID_S2Lo := $D407
SID_S2Hi := $D408
SID_PB2Lo := $D409
SID_PB2Hi := $D40A
SID_Ctl2 := $D40B
SID_AD2 := $D40C
SID_SUR2 := $D40D
SID_S3Lo := $D40E
SID_S3Hi := $D40F
SID_PB3Lo := $D410
SID_PB3Hi := $D411
SID_Ctl3 := $D412
SID_AD3 := $D413
SID_SUR3 := $D414
SID_FltLo := $D415
SID_FltHi := $D416
SID_FltCtl := $D417
SID_Amp := $D418
SID_ADConv1 := $D419
SID_ADConv2 := $D41A
SID_Noise := $D41B
SID_Read3 := $D41C
; ---------------------------------------------------------------------------
; I/O: VDC (128 only)
VDC_INDEX := $D600
VDC_DATA := $D601
; ---------------------------------------------------------------------------
; I/O: Complex Interface Adapters
CIA1 := $DC00
CIA1_PRA := $DC00 ; Port A
CIA1_PRB := $DC01 ; Port B
CIA1_DDRA := $DC02 ; Data direction register for port A
CIA1_DDRB := $DC03 ; Data direction register for port B
CIA1_TA := $DC04 ; 16-bit timer A
CIA1_TB := $DC06 ; 16-bit timer B
CIA1_TOD10 := $DC08 ; Time-of-day tenths of a second
CIA1_TODSEC := $DC09 ; Time-of-day seconds
CIA1_TODMIN := $DC0A ; Time-of-day minutes
CIA1_TODHR := $DC0B ; Time-of-day hours
CIA1_SDR := $DC0C ; Serial data register
CIA1_ICR := $DC0D ; Interrupt control register
CIA1_CRA := $DC0E ; Control register for timer A
CIA1_CRB := $DC0F ; Control register for timer B
CIA2 := $DD00
CIA2_PRA := $DD00
CIA2_PRB := $DD01
CIA2_DDRA := $DD02
CIA2_DDRB := $DD03
CIA2_TA := $DD04
CIA2_TB := $DD06
CIA2_TOD10 := $DD08
CIA2_TODSEC := $DD09
CIA2_TODMIN := $DD0A
CIA2_TODHR := $DD0B
CIA2_SDR := $DD0C
CIA2_ICR := $DD0D
CIA2_CRA := $DD0E
CIA2_CRB := $DD0F
; ---------------------------------------------------------------------------
; Super CPU
SCPU_VIC_Bank1 := $D075
SCPU_Slow := $D07A
SCPU_Fast := $D07B
SCPU_EnableRegs := $D07E
SCPU_DisableRegs:= $D07F
SCPU_Detect := $D0BC
; ---------------------------------------------------------------------------
; Processor Port at $01
LORAM = $01 ; Enable the basic rom
HIRAM = $02 ; Enable the kernal rom
IOEN = $04 ; Enable I/O
CASSDATA = $08 ; Cassette data
CASSPLAY = $10 ; Cassette: Play
CASSMOT = $20 ; Cassette motor on
TP_FAST = $80 ; Switch Rossmoeller TurboProcess to fast mode
RAMONLY = $F8 ; (~(LORAM | HIRAM | IOEN)) & $FF

239
asminc/c65.inc Normal file
View file

@ -0,0 +1,239 @@
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
TXTPTR := $3C ; Pointer into BASIC source code
STATUS := $90 ; Kernal I/O completion status
FNAM_LEN := $B7 ; Length of filename
SECADR := $B9 ; Secondary address
DEVNUM := $BA ; Device number
FNAM := $BB ; Address of filename
FNAM_BANK := $BE ; Bank for filename
KEY_COUNT := $D0 ; Number of keys in input buffer
FKEY_COUNT := $D1 ; Characters for function key
MODE := $D7 ; 40-/80-column mode (bit 7: 80 columns)
GRAPHM := $D8 ; Graphics mode flags (bits 5-7)
CHARDIS := $D9 ; Bit 2 shadow for location $01
CURS_X := $EC ; Cursor column
CURS_Y := $EB ; Cursor row
SCREEN_PTR := $E0 ; Pointer to current char in text screen
CRAM_PTR := $E2 ; Pointer to current char in color RAM
CHARCOLOR := $F1
RVS := $F3 ; Reverse output flag
SCROLL := $F8 ; Disable scrolling flag
BASIC_BUF := $0200 ; Location of command-line
BASIC_BUF_LEN = 161 ; Maximum length of command-line
FKEY_LEN := $1000 ; Function key lengths
FKEY_TEXT := $100A ; Function key texts
PALFLAG := $1103 ; $FF=PAL, $00=NTSC
INIT_STATUS := $1104 ; Flags: Reset/Restore initiation status
TIME := $110C ; 60HZ clock
KBDREPEAT := $111a
KBDREPEATRATE := $111b
KBDREPEATDELAY := $111c
; ---------------------------------------------------------------------------
; Vectors
IRQVec := $0314
BRKVec := $0316
NMIVec := $0318
; ---------------------------------------------------------------------------
; I/O: VIC
VIC := $D000
VIC_SPR0_X := $D000
VIC_SPR0_Y := $D001
VIC_SPR1_X := $D002
VIC_SPR1_Y := $D003
VIC_SPR2_X := $D004
VIC_SPR2_Y := $D005
VIC_SPR3_X := $D006
VIC_SPR3_Y := $D007
VIC_SPR4_X := $D008
VIC_SPR4_Y := $D009
VIC_SPR5_X := $D00A
VIC_SPR5_Y := $D00B
VIC_SPR6_X := $D00C
VIC_SPR6_Y := $D00D
VIC_SPR7_X := $D00E
VIC_SPR7_Y := $D00F
VIC_SPR_HI_X := $D010
VIC_SPR_ENA := $D015
VIC_SPR_EXP_Y := $D017
VIC_SPR_EXP_X := $D01D
VIC_SPR_MCOLOR := $D01C
VIC_SPR_BG_PRIO := $D01B
VIC_SPR_COLL := $D01E
VIC_SPR_BG_COLL := $D01F
VIC_SPR_MCOLOR0 := $D025
VIC_SPR_MCOLOR1 := $D026
VIC_SPR0_COLOR := $D027
VIC_SPR1_COLOR := $D028
VIC_SPR2_COLOR := $D029
VIC_SPR3_COLOR := $D02A
VIC_SPR4_COLOR := $D02B
VIC_SPR5_COLOR := $D02C
VIC_SPR6_COLOR := $D02D
VIC_SPR7_COLOR := $D02E
VIC_CTRL1 := $D011
VIC_CTRL2 := $D016
VIC_HLINE := $D012
VIC_LPEN_X := $D013
VIC_LPEN_Y := $D014
VIC_VIDEO_ADR := $D018
VIC_IRR := $D019 ; Interrupt request register
VIC_IMR := $D01A ; Interrupt mask register
VIC_BORDERCOLOR := $D020
VIC_BG_COLOR0 := $D021
VIC_BG_COLOR1 := $D022
VIC_BG_COLOR2 := $D023
VIC_BG_COLOR3 := $D024
; ---------------------------------------------------------------------------
; I/O: FDC
FDC := $D080
; ---------------------------------------------------------------------------
; I/O: SID
SID1 := $D400
SID1_S1Lo := $D400
SID1_S1Hi := $D401
SID1_PB1Lo := $D402
SID1_PB1Hi := $D403
SID1_Ctl1 := $D404
SID1_AD1 := $D405
SID1_SUR1 := $D406
SID1_S2Lo := $D407
SID1_S2Hi := $D408
SID1_PB2Lo := $D409
SID1_PB2Hi := $D40A
SID1_Ctl2 := $D40B
SID1_AD2 := $D40C
SID1_SUR2 := $D40D
SID1_S3Lo := $D40E
SID1_S3Hi := $D40F
SID1_PB3Lo := $D410
SID1_PB3Hi := $D411
SID1_Ctl3 := $D412
SID1_AD3 := $D413
SID1_SUR3 := $D414
SID1_FltLo := $D415
SID1_FltHi := $D416
SID1_FltCtl := $D417
SID1_Amp := $D418
SID1_ADConv1 := $D419
SID1_ADConv2 := $D41A
SID1_Noise := $D41B
SID1_Read3 := $D41C
SID2 := $D420
SID2_S1Lo := $D420
SID2_S1Hi := $D421
SID2_PB1Lo := $D422
SID2_PB1Hi := $D423
SID2_Ctl1 := $D424
SID2_AD1 := $D425
SID2_SUR1 := $D426
SID2_S2Lo := $D427
SID2_S2Hi := $D428
SID2_PB2Lo := $D429
SID2_PB2Hi := $D42A
SID2_Ctl2 := $D42B
SID2_AD2 := $D42C
SID2_SUR2 := $D42D
SID2_S3Lo := $D42E
SID2_S3Hi := $D42F
SID2_PB3Lo := $D430
SID2_PB3Hi := $D431
SID2_Ctl3 := $D432
SID2_AD3 := $D433
SID2_SUR3 := $D434
SID2_FltLo := $D435
SID2_FltHi := $D436
SID2_FltCtl := $D437
SID2_Amp := $D438
SID2_ADConv1 := $D439
SID2_ADConv2 := $D43A
SID2_Noise := $D43B
SID2_Read3 := $D43C
; ---------------------------------------------------------------------------
; I/O: Complex Interface Adapters
CIA1 := $DC00
CIA1_PRA := $DC00 ; Port A
CIA1_PRB := $DC01 ; Port B
CIA1_DDRA := $DC02 ; Data direction register for port A
CIA1_DDRB := $DC03 ; Data direction register for port B
CIA1_TA := $DC04 ; 16-bit timer A
CIA1_TB := $DC06 ; 16-bit timer B
CIA1_TOD10 := $DC08 ; Time-of-day tenths of a second
CIA1_TODSEC := $DC09 ; Time-of-day seconds
CIA1_TODMIN := $DC0A ; Time-of-day minutes
CIA1_TODHR := $DC0B ; Time-of-day hours
CIA1_SDR := $DC0C ; Serial data register
CIA1_ICR := $DC0D ; Interrupt control register
CIA1_CRA := $DC0E ; Control register for timer A
CIA1_CRB := $DC0F ; Control register for timer B
CIA2 := $DD00
CIA2_PRA := $DD00
CIA2_PRB := $DD01
CIA2_DDRA := $DD02
CIA2_DDRB := $DD03
CIA2_TA := $DD04
CIA2_TB := $DD06
CIA2_TOD10 := $DD08
CIA2_TODSEC := $DD09
CIA2_TODMIN := $DD0A
CIA2_TODHR := $DD0B
CIA2_SDR := $DD0C
CIA2_ICR := $DD0D
CIA2_CRA := $DD0E
CIA2_CRB := $DD0F
; ---------------------------------------------------------------------------
; I/O: DMA
DMA := $D700
; ---------------------------------------------------------------------------
; Processor Port at $01
LORAM = $01 ; Enable the basic rom
HIRAM = $02 ; Enable the kernal rom
IOEN = $04 ; Enable I/O
CASSDATA = $08 ; Cassette data
CASSPLAY = $10 ; Cassette: Play
CASSMOT = $20 ; Cassette motor on
TP_FAST = $80 ; Switch Rossmoeller TurboProcess to fast mode
RAMONLY = $F8 ; (~(LORAM | HIRAM | IOEN)) & $FF
; temporary, to get conio working
XSIZE = 80
YSIZE = 50

56
asminc/cbm.mac Normal file
View file

@ -0,0 +1,56 @@
; Convert characters to screen codes
; Macro that converts one character.
; scrbyte() can be used as an instruction operand
.define scrbyte(code) (<(.strat ("h@dbdlhh", code >> 5) << 4) ^ code)
; Helper macro that stores one character
.macro _scrcode char
.if (char < 256)
.byte scrbyte {char}
.else
.error "scrcode: Character constant out of range"
.endif
.endmacro
.macro scrcode arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
; Bail out if next argument is empty
.if .blank ({arg1})
.exitmacro
.endif
; Check for a string
.if .match ({arg1}, "")
; Walk over all string chars
.repeat .strlen (arg1), i
_scrcode {.strat (arg1, i)}
.endrepeat
; Check for a number
.elseif .match (.left (1, {arg1}), 0)
; Just output the number
_scrcode arg1
; Check for a character
.elseif .match (.left (1, {arg1}), 'a')
; 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"
.endif
; Call the macro recursively with the remaining args
scrcode arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
.endmacro

200
asminc/cbm510.inc Normal file
View file

@ -0,0 +1,200 @@
;
; Zero page variables and I/O definitions for the CBM 510
;
; Taken from a kernal disassembly done by myself in 2000/2001.
;
; 2001-09-13, Ullrich von Bassewitz
; 2014-04-02, Greg King
;-----------------------------------------------------------------------------
; Zeropage stuff
ExecReg := $00 ; Controls execution memory bank
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
; ---------------------------------------------------------------------------
; Screen size
XSIZE = 40
YSIZE = 25
;-----------------------------------------------------------------------------
; I/O Definitions
; Note: These numbers aren't addresses. They are offsets from the start of
; each chip's register set. They are used in the indirect indexed addressing
; mode.
; I/O $d800: VIC-II
VIC_SPR0_X = $00
VIC_SPR0_Y = $01
VIC_SPR1_X = $02
VIC_SPR1_Y = $03
VIC_SPR2_X = $04
VIC_SPR2_Y = $05
VIC_SPR3_X = $06
VIC_SPR3_Y = $07
VIC_SPR4_X = $08
VIC_SPR4_Y = $09
VIC_SPR5_X = $0A
VIC_SPR5_Y = $0B
VIC_SPR6_X = $0C
VIC_SPR6_Y = $0D
VIC_SPR7_X = $0E
VIC_SPR7_Y = $0F
VIC_SPR_HI_X = $10
VIC_SPR_ENA = $15
VIC_SPR_EXP_Y = $17
VIC_SPR_EXP_X = $1D
VIC_SPR_MCOLOR = $1C
VIC_SPR_BG_PRIO = $1B
VIC_SPR_MCOLOR0 = $25
VIC_SPR_MCOLOR1 = $26
VIC_SPR0_COLOR = $27
VIC_SPR1_COLOR = $28
VIC_SPR2_COLOR = $29
VIC_SPR3_COLOR = $2A
VIC_SPR4_COLOR = $2B
VIC_SPR5_COLOR = $2C
VIC_SPR6_COLOR = $2D
VIC_SPR7_COLOR = $2E
VIC_CTRL1 = $11
VIC_CTRL2 = $16
VIC_HLINE = $12
VIC_LPEN_X = $13
VIC_LPEN_Y = $14
VIC_VIDEO_ADR = $18
VIC_IRR = $19 ; Interrupt request register
VIC_IMR = $1A ; Interrupt mask register
VIC_BORDERCOLOR = $20
VIC_BG_COLOR0 = $21
VIC_BG_COLOR1 = $22
VIC_BG_COLOR2 = $23
VIC_BG_COLOR3 = $24
; I/O $da00: SID 6581
SID_S1Lo = $00
SID_S1Hi = $01
SID_PB1Lo = $02
SID_PB1Hi = $03
SID_Ctl1 = $04
SID_AD1 = $05
SID_SUR1 = $06
SID_S2Lo = $07
SID_S2Hi = $08
SID_PB2Lo = $09
SID_PB2Hi = $0A
SID_Ctl2 = $0B
SID_AD2 = $0C
SID_SUR2 = $0D
SID_S3Lo = $0E
SID_S3Hi = $0F
SID_PB3Lo = $10
SID_PB3Hi = $11
SID_Ctl3 = $12
SID_AD3 = $13
SID_SUR3 = $14
SID_FltLo = $15
SID_FltHi = $16
SID_FltCtl = $17
SID_Amp = $18
SID_ADConv1 = $19
SID_ADConv2 = $1A
SID_Noise = $1B
SID_Read3 = $1C
; I/O $db00: CIA 6526, Inter Process Communication
; I/O $dc00: CIA 6526
.struct CIA
PRA .byte
PRB .byte
DDRA .byte
DDRB .byte
.union
.struct
TALO .byte
TAHI .byte
.endstruct
TA .word
.endunion
.union
.struct
TBLO .byte
TBHI .byte
.endstruct
TB .word
.endunion
TOD10 .byte
TODSEC .byte
TODMIN .byte
TODHR .byte
SDR .byte
ICR .byte
CRA .byte
CRB .byte
.endstruct
; I/O $dd00: ACIA 6551
.struct ACIA
DATA .byte
STATUS .byte
CMD .byte
CTRL .BYTE
.endstruct
; I/O $de00: Triport #1 6525
; I/O $df00: Triport #2 6525
.struct TPI
PRA .byte
PRB .byte
.union
PRC .byte
INT .byte
.endunion
DDRA .byte
DDRB .byte
.union
DDRC .byte
IMR .byte
.endunion
CR .byte
AIR .byte
.endstruct
;-----------------------------------------------------------------------------
; Our video memory address
COLOR_RAM := $D400 ; System bank
;-----------------------------------------------------------------------------
BASIC_BUF := $FB5E ; Bank 0 location of command-line
BASIC_BUF_LEN = 162 ; Maximum length of command-line

121
asminc/cbm610.inc Normal file
View file

@ -0,0 +1,121 @@
;
; Zero page variables and I/O definitions for the CBM 610
;
; Taken from a kernal disassembly done by myself in 1987.
;
; 1998-09-28, Ullrich von Bassewitz
; 2014-04-02, Greg King
; ---------------------------------------------------------------------------
; Zeropage stuff
ExecReg := $00 ; Controls execution memory bank
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
; ---------------------------------------------------------------------------
; Screen size
XSIZE = 80
YSIZE = 25
; ---------------------------------------------------------------------------
; I/O definitions
; I/O $d800: CRTC 6545
.struct CRTC
ADDR .byte
DATA .byte
.endstruct
; I/O $db00: CIA 6526, Inter Process Communication
;
; IPCcia = $db00
.struct CIA
PRA .byte
PRB .byte
DDRA .byte
DDRB .byte
.union
.struct
TALO .byte
TAHI .byte
.endstruct
TA .word
.endunion
.union
.struct
TBLO .byte
TBHI .byte
.endstruct
TB .word
.endunion
TOD10 .byte
TODSEC .byte
TODMIN .byte
TODHR .byte
SDR .byte
ICR .byte
CRA .byte
CRB .byte
.endstruct
; I/O $dc00: CIA 6526
;
; cia = $dc00
; I/O $dd00: ACIA 6551
;
; acia = $dd00
.struct ACIA
DATA .byte
STATUS .byte
CMD .byte
CTRL .BYTE
.endstruct
; I/O $de00: Triport #1 6525
;
; tpi1 = $de00
.struct TPI
PRA .byte
PRB .byte
.union
PRC .byte
INT .byte
.endunion
DDRA .byte
DDRB .byte
.union
DDRC .byte
IMR .byte
.endunion
CR .byte
AIR .byte
.endstruct
; I/O $df00: Triport #2 6525
; tpi2 = $df00
;-----------------------------------------------------------------------------
BASIC_BUF := $FA5E ; Bank 1 location of command-line
BASIC_BUF_LEN = 162 ; Maximum length of command-line

34
asminc/cbm_filetype.inc Normal file
View file

@ -0,0 +1,34 @@
;
; Definitions for CBM file types. From cbm.h
;
; Ullrich von Bassewitz, 2012-06-03
;
; Define bitmapped constants for the table entries
.enum
CBM_T_REG = $10 ; Bit set for regular files
CBM_T_SEQ = $10 ; Sequential file
CBM_T_PRG = $11 ; Program file
CBM_T_USR = $12 ; User file
CBM_T_REL = $13 ; Relative file
CBM_T_VRP = $14 ; Vorpal fast-loadable format
CBM_T_DEL = $00 ; Deleted file
CBM_T_CBM = $01 ; 1581 sub-partition
CBM_T_DIR = $02 ; IDE64 and CMD sub-directory
CBM_T_LNK = $03 ; IDE64 soft-link
CBM_T_OTHER = $04 ; File-type not recognized
CBM_T_HEADER = $05 ; Disk header / title
.endenum
; The following function maps the start character for a file type to
; one of the file types above. Note: 'd' will always mapped to CBM_T_DEL.
; The calling function has to look at the following character to determine
; if the file type is actually CBM_T_DIR.
;
; unsigned char __fastcall__ _cbm_filetype (unsigned char c);
.global __cbm_filetype

248
asminc/cbm_kernal.inc Normal file
View file

@ -0,0 +1,248 @@
;
; Olli Savia <ops@iki.fi>
; Greg King
;
; Commodore-compatibles Kernal functions
;
.if .def(__CX16__)
; CX16 extended jump table
KBDBUF_PEEK := $FEBD
KBDBUF_GET_MODIFIERS := $FEC0
KBDBUF_PUT := $FEC3
I2C_READ_BYTE := $FEC6
I2C_WRITE_BYTE := $FEC9
CX_MONITOR := $FECC
ENTROPY_GET := $FECF
CONSOLE_SET_PAGE_MSG := $FED5
CONSOLE_PUT_IMAGE := $FED8
CONSOLE_INIT := $FEDB
CONSOLE_PUT_CHAR := $FEDE
CONSOLE_GET_CHAR := $FEE1
MEMORY_FILL := $FEE4
MEMORY_COPY := $FEE7
MEMORY_CRC := $FEEA
MEMORY_DECOMPRESS := $FEED
SPRITE_SET_IMAGE := $FEF0
SPRITE_SET_POSITION := $FEF3
FB_INIT := $FEF6
FB_GET_INFO := $FEF9
FB_SET_PALETTE := $FEFC
FB_CURSOR_POSITION := $FEFF
FB_CURSOR_NEXT_LINE := $FF02
FB_GET_PIXEL := $FF05
FB_GET_PIXELS := $FF08
FB_SET_PIXEL := $FF0B
FB_SET_PIXELS := $FF0E
FB_SET_8_PIXELS := $FF11
FB_SET_8_PIXELS_OPAQUE := $FF14
FB_FILL_PIXELS := $FF17
FB_FILTER_PIXELS := $FF1A
FB_MOVE_PIXELS := $FF1D
GRAPH_INIT := $FF20
GRAPH_CLEAR := $FF23
GRAPH_SET_WINDOW := $FF26
GRAPH_SET_COLORS := $FF29
GRAPH_DRAW_LINE := $FF2C
GRAPH_DRAW_RECT := $FF2F
GRAPH_MOVE_RECT := $FF32
GRAPH_DRAW_OVAL := $FF35
GRAPH_DRAW_IMAGE := $FF38
GRAPH_SET_FONT := $FF3B
GRAPH_GET_CHAR_SIZE := $FF3E
GRAPH_PUT_CHAR := $FF41
MULTI_ACPTR := $FF44
RESTORE_BASIC := $FF47
CLOCK_SET_DATE_TIME := $FF4D
CLOCK_GET_DATE_TIME := $FF50
JOYSTICK_SCAN := $FF53
JOYSTICK_GET := $FF56
SCREEN_MODE := $FF5F
SCREEN_SET_CHARSET := $FF62
MOUSE_CONFIG := $FF68
MOUSE_GET := $FF6B
.endif
.if .def (__MEGA65__)
; extended C65 jump table
; memory before $ff3b is all $ff in mega65 ROM?
; VERSIONQ := $FF2F
; RESET_RUN := $FF32
; CURSOR := $FF35
SAVEFL := $FF3B
GETIO := $FF41
GETLFS := $FF44
KEYLOCKS := $FF47
ADDKEY := $FF4A
.endif
.if .def(__C65__) || .def (__MEGA65__)
CURSOR := $E030 ; in editor ROM
SPIN_SPOUT := $FF4D
CLSALL := $FF50
C64MODE := $FF53
MonitorCall := $FF56
BOOT_SYS := $FF59
PHOENIX := $FF5C
LKUPLA := $FF5F
LKUPSA := $FF62
SWAPPER := $FF65
PFKEY := $FF68
SETBNK := $FF6B
JSRFAR := $FF6E
JMPFAR := $FF71
LDA_FAR := $FF74
STA_FAR := $FF77
CMP_FAR := $FF7A
PRIMM := $FF7D
.endif
.if .def(__C128__)
; C128 extended jump table
C64MODE := $FF4D
SWAPPER := $FF5F
SETBNK := $FF68
.endif
.if .def(__C128__) || .def(__CX16__)
; Extended jump table
CLSALL := $FF4A
LKUPLA := $FF59
LKUPSA := $FF5C
PFKEY := $FF65
JSRFAR := $FF6E
INDFET := $FF74
INDSTA := $FF77
INDCMP := $FF7A
PRIMM := $FF7D
.endif
.if .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) || .def(__C65__) || .def (__MEGA65__)
CINT := $FF81
IOINIT := $FF84
RAMTAS := $FF87
.elseif .def(__VIC20__)
CINT := $E518 ; No entries are in the Kernal jump table of the VIC-20 for these three (3) functions.
IOINIT := $FDF9 ; The entries for these functions have been set to point directly to the functions
RAMTAS := $FD8D ; in the Kernal, to maintain compatibility with the other Commodore platforms.
.elseif .def(__CBM510__) || .def(__CBM610__)
IOINIT := $FF7B
CINT := $FF7E
.endif
.if .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) || .def(__C65__) || .def (__MEGA65__)
RESTOR := $FF8A
VECTOR := $FF8D
.elseif .def(__CBM510__) || .def(__CBM610__)
VECTOR := $FF84
RESTOR := $FF87
.endif
.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__)
SETMSG := $FF90
SECOND := $FF93
TKSA := $FF96
MEMTOP := $FF99
MEMBOT := $FF9C
SCNKEY := $FF9F
SETTMO := $FFA2
.elseif .def(__C65__) || .def (__MEGA65__)
SETMSG := $FF90
SECOND := $FF93
TKSA := $FF96
MEMTOP := $FF99
MEMBOT := $FF9C
SCNKEY := $FF9F
MONEXIT := $FFA2
.endif
.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) || .def(__C65__) || .def(__MEGA65__)
ACPTR := $FFA5
CIOUT := $FFA8
UNTLK := $FFAB
UNLSN := $FFAE
LISTEN := $FFB1
TALK := $FFB4
READST := $FFB7
SETLFS := $FFBA
SETNAM := $FFBD
OPEN := $FFC0
CLOSE := $FFC3
.endif
; Available on all platforms including PET
CHKIN := $FFC6
CKOUT := $FFC9
CHKOUT := $FFC9
CLRCH := $FFCC
CLRCHN := $FFCC
BASIN := $FFCF
CHRIN := $FFCF
BSOUT := $FFD2
CHROUT := $FFD2
.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) || .def(__C65__) || .def(__MEGA65__)
LOAD := $FFD5
SAVE := $FFD8
SETTIM := $FFDB
RDTIM := $FFDE
.endif
; Available on all platforms including PET
STOP := $FFE1
GETIN := $FFE4
CLALL := $FFE7
.if .def(__C65__) || .def(__MEGA65__)
ScanStopKey := $FFEA
.else
UDTIM := $FFEA
.endif
.if .def(__CBM510__) || .def(__CBM610__) || .def(__VIC20__) || .def(__C64__) || .def(__C128__) || .def(__C16__) || .def(__CX16__) || .def(__C65__) || .def(__MEGA65__)
SCREEN := $FFED
PLOT := $FFF0
IOBASE := $FFF3
.endif
; ---------------------------------------------------------------------------
; Kernal routines, direct entries
;
; Unlike the above, these are not standard functions with entries in the jump
; table. They do not exist in all Kernals, and where they do the entry point is
; specific to that particular machine and possibly even Kernal version.
;
; This list is not comprehensive: missing items for particular machines
; should be added as needed.
;
; UPDCRAMPTR: Updates the color RAM pointer to match the screen RAM pointer.
;
.if .def(__VIC20__)
CLRSCR := $E55F
KBDREAD := $E5CF
UPDCRAMPTR := $EAB2
.elseif .def(__C64__)
CLRSCR := $E544 ; Clear the screen
KBDREAD := $E5B4 ; Get Character From Keyboard Buffer
NMIEXIT := $FEBC
UPDCRAMPTR := $EA24 ; Update color ram pointer
.elseif .def(__C128__)
CLRSCR := $C142
KBDREAD := $C006
NMIEXIT := $FF33
NEWLINE := $C363
PRINT := $C322
CURS_SET := $CD57
CURS_ON := $CD6F
CURS_OFF := $CD9F
.elseif .def(__C16__)
CLRSCR := $D88B
KBDREAD := $D8C1
.elseif .def(__C65__) || .def(__MEGA65__)
; CLRSCR := $E0EC ; ???
KBDREAD := $E006
.endif

View file

@ -0,0 +1,291 @@
;/*****************************************************************************/
;/* */
;/* cbm_petscii_charmap.inc */
;/* */
;/* CBM system standard string mapping ISO-8859-1 -> PetSCII */
;/* */
;/* */
;/* 2019-03-10, Greg King */
;/* */
;/* This software is provided "as-is", without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated, but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice must not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
.charmap $00, $00
.charmap $01, $01
.charmap $02, $02
.charmap $03, $03
.charmap $04, $04
.charmap $05, $05
.charmap $06, $06
.charmap $07, $07
.charmap $08, $14
.charmap $09, $09
.charmap $0A, $0D
.charmap $0B, $11
.charmap $0C, $93
.charmap $0D, $0A
.charmap $0E, $0E
.charmap $0F, $0F
.charmap $10, $10
.charmap $11, $0B
.charmap $12, $12
.charmap $13, $13
.charmap $14, $08
.charmap $15, $15
.charmap $16, $16
.charmap $17, $17
.charmap $18, $18
.charmap $19, $19
.charmap $1A, $1A
.charmap $1B, $1B
.charmap $1C, $1C
.charmap $1D, $1D
.charmap $1E, $1E
.charmap $1F, $1F
.charmap $20, $20
.charmap $21, $21
.charmap $22, $22
.charmap $23, $23
.charmap $24, $24
.charmap $25, $25
.charmap $26, $26
.charmap $27, $27
.charmap $28, $28
.charmap $29, $29
.charmap $2A, $2A
.charmap $2B, $2B
.charmap $2C, $2C
.charmap $2D, $2D
.charmap $2E, $2E
.charmap $2F, $2F
.charmap $30, $30
.charmap $31, $31
.charmap $32, $32
.charmap $33, $33
.charmap $34, $34
.charmap $35, $35
.charmap $36, $36
.charmap $37, $37
.charmap $38, $38
.charmap $39, $39
.charmap $3A, $3A
.charmap $3B, $3B
.charmap $3C, $3C
.charmap $3D, $3D
.charmap $3E, $3E
.charmap $3F, $3F
.charmap $40, $40
.charmap $41, $C1
.charmap $42, $C2
.charmap $43, $C3
.charmap $44, $C4
.charmap $45, $C5
.charmap $46, $C6
.charmap $47, $C7
.charmap $48, $C8
.charmap $49, $C9
.charmap $4A, $CA
.charmap $4B, $CB
.charmap $4C, $CC
.charmap $4D, $CD
.charmap $4E, $CE
.charmap $4F, $CF
.charmap $50, $D0
.charmap $51, $D1
.charmap $52, $D2
.charmap $53, $D3
.charmap $54, $D4
.charmap $55, $D5
.charmap $56, $D6
.charmap $57, $D7
.charmap $58, $D8
.charmap $59, $D9
.charmap $5A, $DA
.charmap $5B, $5B
.charmap $5C, $BF
.charmap $5D, $5D
.charmap $5E, $5E
.charmap $5F, $A4
.charmap $60, $AD
.charmap $61, $41
.charmap $62, $42
.charmap $63, $43
.charmap $64, $44
.charmap $65, $45
.charmap $66, $46
.charmap $67, $47
.charmap $68, $48
.charmap $69, $49
.charmap $6A, $4A
.charmap $6B, $4B
.charmap $6C, $4C
.charmap $6D, $4D
.charmap $6E, $4E
.charmap $6F, $4F
.charmap $70, $50
.charmap $71, $51
.charmap $72, $52
.charmap $73, $53
.charmap $74, $54
.charmap $75, $55
.charmap $76, $56
.charmap $77, $57
.charmap $78, $58
.charmap $79, $59
.charmap $7A, $5A
.charmap $7B, $B3
.charmap $7C, $DD
.charmap $7D, $AB
.charmap $7E, $B1
.charmap $7F, $DF
.charmap $80, $80
.charmap $81, $81
.charmap $82, $82
.charmap $83, $83
.charmap $84, $84
.charmap $85, $85
.charmap $86, $86
.charmap $87, $87
.charmap $88, $88
.charmap $89, $89
.charmap $8A, $8A
.charmap $8B, $8B
.charmap $8C, $8C
.charmap $8D, $8D
.charmap $8E, $8E
.charmap $8F, $8F
.charmap $90, $90
.charmap $91, $91
.charmap $92, $92
.charmap $93, $0C
.charmap $94, $94
.charmap $95, $95
.charmap $96, $96
.charmap $97, $97
.charmap $98, $98
.charmap $99, $99
.charmap $9A, $9A
.charmap $9B, $9B
.charmap $9C, $9C
.charmap $9D, $9D
.charmap $9E, $9E
.charmap $9F, $9F
.charmap $A0, $A0
.charmap $A1, $A1
.charmap $A2, $A2
.charmap $A3, $A3
.charmap $A4, $A4
.charmap $A5, $A5
.charmap $A6, $A6
.charmap $A7, $A7
.charmap $A8, $A8
.charmap $A9, $A9
.charmap $AA, $AA
.charmap $AB, $AB
.charmap $AC, $AC
.charmap $AD, $AD
.charmap $AE, $AE
.charmap $AF, $AF
.charmap $B0, $B0
.charmap $B1, $B1
.charmap $B2, $B2
.charmap $B3, $B3
.charmap $B4, $B4
.charmap $B5, $B5
.charmap $B6, $B6
.charmap $B7, $B7
.charmap $B8, $B8
.charmap $B9, $B9
.charmap $BA, $BA
.charmap $BB, $BB
.charmap $BC, $BC
.charmap $BD, $BD
.charmap $BE, $BE
.charmap $BF, $BF
.charmap $C0, $60
.charmap $C1, $61
.charmap $C2, $62
.charmap $C3, $63
.charmap $C4, $64
.charmap $C5, $65
.charmap $C6, $66
.charmap $C7, $67
.charmap $C8, $68
.charmap $C9, $69
.charmap $CA, $6A
.charmap $CB, $6B
.charmap $CC, $6C
.charmap $CD, $6D
.charmap $CE, $6E
.charmap $CF, $6F
.charmap $D0, $70
.charmap $D1, $71
.charmap $D2, $72
.charmap $D3, $73
.charmap $D4, $74
.charmap $D5, $75
.charmap $D6, $76
.charmap $D7, $77
.charmap $D8, $78
.charmap $D9, $79
.charmap $DA, $7A
.charmap $DB, $7B
.charmap $DC, $7C
.charmap $DD, $7D
.charmap $DE, $7E
.charmap $DF, $7F
.charmap $E0, $E0
.charmap $E1, $E1
.charmap $E2, $E2
.charmap $E3, $E3
.charmap $E4, $E4
.charmap $E5, $E5
.charmap $E6, $E6
.charmap $E7, $E7
.charmap $E8, $E8
.charmap $E9, $E9
.charmap $EA, $EA
.charmap $EB, $EB
.charmap $EC, $EC
.charmap $ED, $ED
.charmap $EE, $EE
.charmap $EF, $EF
.charmap $F0, $F0
.charmap $F1, $F1
.charmap $F2, $F2
.charmap $F3, $F3
.charmap $F4, $F4
.charmap $F5, $F5
.charmap $F6, $F6
.charmap $F7, $F7
.charmap $F8, $F8
.charmap $F9, $F9
.charmap $FA, $FA
.charmap $FB, $FB
.charmap $FC, $FC
.charmap $FD, $FD
.charmap $FE, $FE
.charmap $FF, $FF

View file

@ -0,0 +1,305 @@
;/*****************************************************************************/
;/* */
;/* cbm_screen_charmap.inc */
;/* */
;/* c Copyright 2019, Gerhard W. Gruber (sparhawk@gmx.at) */
;/* */
;/* When using CBM mode, this include converts character literals */
;/* from ASCII to screen-code mapping, so you can write directly */
;/* to the screen memory. */
;/* */
;/* If this include is used, no additional macros are needed. */
;/* */
;/*****************************************************************************/
; Char $00 -> c + 128
.charmap $00, $80
; Char $01 ... $1A -> c + 128 + 64 control alphabet
.charmap $01, $C1
.charmap $02, $C2
.charmap $03, $C3
.charmap $04, $C4
.charmap $05, $C5
.charmap $06, $C6
.charmap $07, $C7
.charmap $08, $C8
.charmap $09, $C9
.charmap $0A, $CA
.charmap $0B, $CB
.charmap $0C, $CC
.charmap $0D, $CD
.charmap $0E, $CE
.charmap $0F, $CF
.charmap $10, $D0
.charmap $11, $D1
.charmap $12, $D2
.charmap $13, $D3
.charmap $14, $D4
.charmap $15, $D5
.charmap $16, $D6
.charmap $17, $D7
.charmap $18, $D8
.charmap $19, $D9
.charmap $1A, $DA
; Char $1B ... $1F -> c + 128
.charmap $1B, $9B
.charmap $1C, $9C
.charmap $1D, $9D
.charmap $1E, $9E
.charmap $1F, $9F
; Char $20 ... $3F -> c
.charmap $20, $20
.charmap $21, $21
.charmap $22, $22
.charmap $23, $23
.charmap $24, $24
.charmap $25, $25
.charmap $26, $26
.charmap $27, $27
.charmap $28, $28
.charmap $29, $29
.charmap $2A, $2A
.charmap $2B, $2B
.charmap $2C, $2C
.charmap $2D, $2D
.charmap $2E, $2E
.charmap $2F, $2F
.charmap $30, $30
.charmap $31, $31
.charmap $32, $32
.charmap $33, $33
.charmap $34, $34
.charmap $35, $35
.charmap $36, $36
.charmap $37, $37
.charmap $38, $38
.charmap $39, $39
.charmap $3A, $3A
.charmap $3B, $3B
.charmap $3C, $3C
.charmap $3D, $3D
.charmap $3E, $3E
.charmap $3F, $3F
; Char $40 -> c - 64
.charmap $40, $00
; Char $41 ... $5A -> c upper-case alphabet
.charmap $41, $41
.charmap $42, $42
.charmap $43, $43
.charmap $44, $44
.charmap $45, $45
.charmap $46, $46
.charmap $47, $47
.charmap $48, $48
.charmap $49, $49
.charmap $4A, $4A
.charmap $4B, $4B
.charmap $4C, $4C
.charmap $4D, $4D
.charmap $4E, $4E
.charmap $4F, $4F
.charmap $50, $50
.charmap $51, $51
.charmap $52, $52
.charmap $53, $53
.charmap $54, $54
.charmap $55, $55
.charmap $56, $56
.charmap $57, $57
.charmap $58, $58
.charmap $59, $59
.charmap $5A, $5A
; Char $5B ... $5F -> c - 64
.charmap $5B, $1B
.charmap $5C, $1C
.charmap $5D, $1D
.charmap $5E, $1E
.charmap $5F, $1F
; Char $60 -> c - 32
.charmap $60, $40
; Char $61 ... $7A -> c - 32 - 64 lower-case alphabet
.charmap $61, $01
.charmap $62, $02
.charmap $63, $03
.charmap $64, $04
.charmap $65, $05
.charmap $66, $06
.charmap $67, $07
.charmap $68, $08
.charmap $69, $09
.charmap $6A, $0A
.charmap $6B, $0B
.charmap $6C, $0C
.charmap $6D, $0D
.charmap $6E, $0E
.charmap $6F, $0F
.charmap $70, $10
.charmap $71, $11
.charmap $72, $12
.charmap $73, $13
.charmap $74, $14
.charmap $75, $15
.charmap $76, $16
.charmap $77, $17
.charmap $78, $18
.charmap $79, $19
.charmap $7A, $1A
; Char $7B ... $7F -> c - 32
.charmap $7B, $5B
.charmap $7C, $5C
.charmap $7D, $5D
.charmap $7E, $5E
.charmap $7F, $5F
; Char $80 -> c + 64
.charmap $80, $C0
; Char $81 ... $9A -> c control alphabet
.charmap $81, $81
.charmap $82, $82
.charmap $83, $83
.charmap $84, $84
.charmap $85, $85
.charmap $86, $86
.charmap $87, $87
.charmap $88, $88
.charmap $89, $89
.charmap $8A, $8A
.charmap $8B, $8B
.charmap $8C, $8C
.charmap $8D, $8D
.charmap $8E, $8E
.charmap $8F, $8F
.charmap $90, $90
.charmap $91, $91
.charmap $92, $92
.charmap $93, $93
.charmap $94, $94
.charmap $95, $95
.charmap $96, $96
.charmap $97, $97
.charmap $98, $98
.charmap $99, $99
.charmap $9A, $9A
; Char $9B ... $9F -> c + 64
.charmap $9B, $DB
.charmap $9C, $DC
.charmap $9D, $DD
.charmap $9E, $DE
.charmap $9F, $DF
; Char $A0 ... $BF -> c - 64
.charmap $A0, $60
.charmap $A1, $61
.charmap $A2, $62
.charmap $A3, $63
.charmap $A4, $64
.charmap $A5, $65
.charmap $A6, $66
.charmap $A7, $67
.charmap $A8, $68
.charmap $A9, $69
.charmap $AA, $6A
.charmap $AB, $6B
.charmap $AC, $6C
.charmap $AD, $6D
.charmap $AE, $6E
.charmap $AF, $6F
.charmap $B0, $70
.charmap $B1, $71
.charmap $B2, $72
.charmap $B3, $73
.charmap $B4, $74
.charmap $B5, $75
.charmap $B6, $76
.charmap $B7, $77
.charmap $B8, $78
.charmap $B9, $79
.charmap $BA, $7A
.charmap $BB, $7B
.charmap $BC, $7C
.charmap $BD, $7D
.charmap $BE, $7E
.charmap $BF, $7F
; Char $C0 ... $DF -> c - 128
.charmap $C0, $40
; Char $C1 ... $DA -> c - 128 - 64 lower-case alphabet
.charmap $C1, $01
.charmap $C2, $02
.charmap $C3, $03
.charmap $C4, $04
.charmap $C5, $05
.charmap $C6, $06
.charmap $C7, $07
.charmap $C8, $08
.charmap $C9, $09
.charmap $CA, $0A
.charmap $CB, $0B
.charmap $CC, $0C
.charmap $CD, $0D
.charmap $CE, $0E
.charmap $CF, $0F
.charmap $D0, $10
.charmap $D1, $11
.charmap $D2, $12
.charmap $D3, $13
.charmap $D4, $14
.charmap $D5, $15
.charmap $D6, $16
.charmap $D7, $17
.charmap $D8, $18
.charmap $D9, $19
.charmap $DA, $1A
; Char $DB ... $DF -> c - 128
.charmap $DB, $5B
.charmap $DC, $5C
.charmap $DD, $5D
.charmap $DE, $5E
.charmap $DF, $5F
; Char $E0 ... $FF -> c - 128
.charmap $E0, $60
.charmap $E1, $61
.charmap $E2, $62
.charmap $E3, $63
.charmap $E4, $64
.charmap $E5, $65
.charmap $E6, $66
.charmap $E7, $67
.charmap $E8, $68
.charmap $E9, $69
.charmap $EA, $6A
.charmap $EB, $6B
.charmap $EC, $6C
.charmap $ED, $6D
.charmap $EE, $6E
.charmap $EF, $6F
.charmap $F0, $70
.charmap $F1, $71
.charmap $F2, $72
.charmap $F3, $73
.charmap $F4, $74
.charmap $F5, $75
.charmap $F6, $76
.charmap $F7, $77
.charmap $F8, $78
.charmap $F9, $79
.charmap $FA, $7A
.charmap $FB, $7B
.charmap $FC, $7C
.charmap $FD, $7D
.charmap $FE, $7E
.charmap $FF, $7F

4
asminc/cpu.mac Normal file
View file

@ -0,0 +1,4 @@
; 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"

66
asminc/creativision.inc Normal file
View file

@ -0,0 +1,66 @@
;*
;** VTech Creativision Definitions
;*
;** Screen
SCREEN_ROWS = 24
SCREEN_COLS = 32
SCREEN_PTR := $3A
CURSOR_X := $3C
CURSOR_Y := $3D
;** VDP
VDP_DATA_R := $2000
VDP_STATUS_R := $2001
VDP_DATA_W := $3000
VDP_CONTROL_W := $3001
;** PIA
PIA0_DATA := $1000
PIA0_STATUS := $1001
PIA1_DATA := $1002
PIA1_STATUS := $1003
;** General
CH_VLINE = 33
CH_HLINE = 34
CH_ULCORNER = 35
CH_URCORNER = 36
CH_LLCORNER = 37
CH_LRCORNER = 38
;** I/O (Zero-page variables)
ZP_KEYBOARD := $10
ZP_JOY0_DIR := $11
ZP_JOY1_DIR := $13
ZP_JOY0_BUTTONS := $16
ZP_JOY1_BUTTONS := $17
;** Joystick direction values (ZP_JOY0_DIR/ZP_JOY1_DIR)
JOY_N = $49
JOY_NNE = $48
JOY_NE = $47
JOY_ENE = $46
JOY_E = $45
JOY_ESE = $44
JOY_SE = $43
JOY_SSE = $42
JOY_S = $41
JOY_SSW = $40
JOY_SW = $4F
JOY_WSW = $4E
JOY_W = $4D
JOY_WNW = $4C
JOY_NW = $4B
JOY_NNW = $4A
;** BIOS routines
BIOS_NMI_RESET_ADDR := $F808
BIOS_PLAY_TUNE1 := $FBD6
BIOS_PLAY_SONG := $FBED
BIOS_PLAY_TUNE2 := $FCE6
BIOS_WRITE_VDP_REG := $FE1F
BIOS_QUIET_PSG := $FE54
BIOS_POKE_PSG := $FE77
BIOS_IRQ1_ADDR := $FF3F
BIOS_IRQ2_ADDR := $FF52

31
asminc/ctype.inc Normal file
View file

@ -0,0 +1,31 @@
; ctype.inc
;
; This file is part of
; cc65 - a freeware C compiler for 6502 based systems
;
; https://cc65.github.io
;
; See "LICENSE" file for legal information.
;
; Definitions for the character type tables
;
; Ullrich von Bassewitz, 08.09.2001
;
; Define bitmapped constants for the table entries
CT_NONE = %00000000 ; Nothing special
CT_LOWER = %00000001 ; 0 - Lower case char
CT_UPPER = %00000010 ; 1 - Upper case char
CT_DIGIT = %00000100 ; 2 - Numeric digit
CT_XDIGIT = %00001000 ; 3 - Hex digit (both, lower and upper)
CT_CTRL = %00010000 ; 4 - Control character
CT_SPACE = %00100000 ; 5 - The space character itself
CT_OTHER_WS = %01000000 ; 6 - Other whitespace ('\f', '\n', '\r', '\t' and '\v')
CT_SPACE_TAB = %10000000 ; 7 - Space or tab character
; Combined stuff
CT_ALNUM = (CT_LOWER | CT_UPPER | CT_DIGIT)
CT_ALPHA = (CT_LOWER | CT_UPPER)
CT_CTRL_SPACE = (CT_CTRL | CT_SPACE)
CT_NOT_PUNCT = (CT_SPACE | CT_CTRL | CT_DIGIT | CT_UPPER | CT_LOWER)

91
asminc/ctype_common.inc Normal file
View file

@ -0,0 +1,91 @@
; ctype_common.inc
;
; This file is part of
; cc65 - a freeware C compiler for 6502 based systems
;
; https://cc65.github.io
;
; See "LICENSE" file for legal information.
;
; Character specification table for some common targets.
;
.include "ctypetable.inc"
.export __ctypeidx
; The tables are readonly, put them into the rodata segment
.rodata
__ctypeidx:
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 0/00 ___ctrl_@___, 1/01 ___ctrl_A___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 2/02 ___ctrl_B___, 3/03 ___ctrl_C___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 4/04 ___ctrl_D___, 5/05 ___ctrl_E___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 6/06 ___ctrl_F___, 7/07 ___ctrl_G___
ct_mix CT_CTRL_IDX, CT_CTRL_WS_SPACETAB_IDX ; 8/08 ___ctrl_H___, 9/09 ___ctrl_I___
ct_mix CT_CTRL_WS_IDX, CT_CTRL_WS_IDX ; 10/0a ___ctrl_J___, 11/0b ___ctrl_K___
ct_mix CT_CTRL_WS_IDX, CT_CTRL_WS_IDX ; 12/0c ___ctrl_L___, 13/0d ___ctrl_M___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 14/0e ___ctrl_N___, 15/0f ___ctrl_O___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 16/10 ___ctrl_P___, 17/11 ___ctrl_Q___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 18/12 ___ctrl_R___, 19/13 ___ctrl_S___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 20/14 ___ctrl_T___, 21/15 ___ctrl_U___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 22/16 ___ctrl_V___, 23/17 ___ctrl_W___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 24/18 ___ctrl_X___, 25/19 ___ctrl_Y___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 26/1a ___ctrl_Z___, 27/1b ___ctrl_[___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 28/1c ___ctrl_\___, 29/1d ___ctrl_]___
ct_mix CT_CTRL_IDX, CT_CTRL_IDX ; 30/1e ___ctrl_^___, 31/1f ___ctrl_____
ct_mix CT_SPACE_SPACETAB_IDX, CT_NONE_IDX ; 32/20 ___SPACE___, 33/21 _____!_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 34/22 _____"_____, 35/23 _____#_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 36/24 _____$_____, 37/25 _____%_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 38/26 _____&_____, 39/27 _____'_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 40/28 _____(_____, 41/29 _____)_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 42/2a _____*_____, 43/2b _____+_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 44/2c _____,_____, 45/2d _____-_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 46/2e _____._____, 47/2f _____/_____
ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 48/30 _____0_____, 49/31 _____1_____
ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 50/32 _____2_____, 51/33 _____3_____
ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 52/34 _____4_____, 53/35 _____5_____
ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 54/36 _____6_____, 55/37 _____7_____
ct_mix CT_DIGIT_XDIGIT_IDX, CT_DIGIT_XDIGIT_IDX ; 56/38 _____8_____, 57/39 _____9_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 58/3a _____:_____, 59/3b _____;_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 60/3c _____<_____, 61/3d _____=_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 62/3e _____>_____, 63/3f _____?_____
ct_mix CT_NONE_IDX, CT_UPPER_XDIGIT_IDX ; 64/40 _____@_____, 65/41 _____A_____
ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 66/42 _____B_____, 67/43 _____C_____
ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_XDIGIT_IDX ; 68/44 _____D_____, 69/45 _____E_____
ct_mix CT_UPPER_XDIGIT_IDX, CT_UPPER_IDX ; 70/46 _____F_____, 71/47 _____G_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 72/48 _____H_____, 73/49 _____I_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 74/4a _____J_____, 75/4b _____K_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 76/4c _____L_____, 77/4d _____M_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 78/4e _____N_____, 79/4f _____O_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 80/50 _____P_____, 81/51 _____Q_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 82/52 _____R_____, 83/53 _____S_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 84/54 _____T_____, 85/55 _____U_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 86/56 _____V_____, 87/57 _____W_____
ct_mix CT_UPPER_IDX, CT_UPPER_IDX ; 88/58 _____X_____, 89/59 _____Y_____
ct_mix CT_UPPER_IDX, CT_NONE_IDX ; 90/5a _____Z_____, 91/5b _____[_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 92/5c _____\_____, 93/5d _____]_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 94/5e _____^_____, 95/5f _UNDERLINE_
ct_mix CT_NONE_IDX, CT_LOWER_XDIGIT_IDX ; 96/60 ___grave___, 97/61 _____a_____
ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 98/62 _____b_____, 99/63 _____c_____
ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_XDIGIT_IDX ; 100/64 _____d_____, 101/65 _____e_____
ct_mix CT_LOWER_XDIGIT_IDX, CT_LOWER_IDX ; 102/66 _____f_____, 103/67 _____g_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 104/68 _____h_____, 105/69 _____i_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 106/6a _____j_____, 107/6b _____k_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 108/6c _____l_____, 109/6d _____m_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 110/6e _____n_____, 111/6f _____o_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 112/70 _____p_____, 113/71 _____q_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 114/72 _____r_____, 115/73 _____s_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 116/74 _____t_____, 117/75 _____u_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 118/76 _____v_____, 119/77 _____w_____
ct_mix CT_LOWER_IDX, CT_LOWER_IDX ; 120/78 _____x_____, 121/79 _____y_____
ct_mix CT_LOWER_IDX, CT_NONE_IDX ; 122/7a _____z_____, 123/7b _____{_____
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 124/7c _____|_____, 125/7d _____}_____
ct_mix CT_NONE_IDX, CT_WS_IDX ; 126/7e _____~_____, 127/7f ____DEL____
.repeat 64
ct_mix CT_NONE_IDX, CT_NONE_IDX ; 128-255
.endrepeat

48
asminc/ctypetable.inc Normal file
View file

@ -0,0 +1,48 @@
; ctypetable.inc
;
; This file is part of
; cc65 - a freeware C compiler for 6502 based systems
;
; https://cc65.github.io
;
; See "LICENSE" file for legal information.
;
; Data covering all possible combinations of character flags for target specific definition
;
.include "ctype.inc"
.export __ctype
; Table definition covering all possible ctype combinations
.rodata
__ctype:
ct_none: .byte CT_NONE
ct_lower: .byte CT_LOWER
ct_upper: .byte CT_UPPER
ct_digit_xdigit: .byte CT_DIGIT | CT_XDIGIT
ct_lower_xdigit: .byte CT_LOWER | CT_XDIGIT
ct_upper_xdigit: .byte CT_UPPER | CT_XDIGIT
ct_ctrl: .byte CT_CTRL
ct_ws: .byte CT_OTHER_WS
ct_ctrl_ws: .byte CT_CTRL | CT_OTHER_WS
ct_space_spacetab: .byte CT_SPACE | CT_SPACE_TAB
ct_ctrl_ws_spacetab: .byte CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB
; build indices out of the table above:
CT_NONE_IDX = ct_none - __ctype
CT_LOWER_IDX = ct_lower - __ctype
CT_UPPER_IDX = ct_upper - __ctype
CT_DIGIT_XDIGIT_IDX = ct_digit_xdigit - __ctype
CT_LOWER_XDIGIT_IDX = ct_lower_xdigit - __ctype
CT_UPPER_XDIGIT_IDX = ct_upper_xdigit - __ctype
CT_CTRL_IDX = ct_ctrl - __ctype
CT_WS_IDX = ct_ws - __ctype
CT_CTRL_WS_IDX = ct_ctrl_ws - __ctype
CT_SPACE_SPACETAB_IDX = ct_space_spacetab - __ctype
CT_CTRL_WS_SPACETAB_IDX = ct_ctrl_ws_spacetab - __ctype
.macro ct_mix lower, upper
.byte ((lower) & $0F) | ((upper) << 4)
.endmacro

574
asminc/cx16.inc Normal file
View file

@ -0,0 +1,574 @@
;
; CX16 r39 definitions
;
; ---------------------------------------------------------------------------
; Constants
.enum COLOR
BLACK = $00
WHITE
RED
CYAN
PURPLE
GREEN
BLUE
YELLOW
ORANGE
BROWN
PINK
LIGHTRED = PINK
GRAY1
GRAY2
LIGHTGREEN
LIGHTBLUE
GRAY3
.endenum
; Special characters
.enum CH
COLOR_SWAP = $01
STOP = $03
UNDERLINE
WHITE
BOLD
BELL
BACKSPACE
TAB
LINEFEED
ITALIC
OUTLINE
ENTER
FONT_LOWER
FONT_ISO
F9
CURS_DOWN
REVERSE
HOME
DEL
F10
F11
F12
SHIFT_TAB
RED = $1C
CURS_RIGHT
GREEN
BLUE
LIRA = $5C
ORANGE = $81
RUN = $83
HELP
F1
F3
F5
F7
F2
F4
F6
F8
SHIFT_ENTER
FONT_UPPER
FONT_PET
BLACK
CURS_UP
ATTR_CLEAR
SCRN_CLEAR
INS
BROWN
PINK
LIGHTRED = PINK
GRAY1
GRAY2
LIGHTGREEN
LIGHTBLUE
GRAY3
PURPLE
CURS_LEFT
YELLOW
CYAN
SHIFT_SPACE
LTEE = $AB
LLCORNER = $AD
URCORNER
ULCORNER = $B0
BTEE
TTEE
RTEE
LRCORNER = $BD
HLINE = $C0
CROSS = $DB
VLINE = $DD
PI
.endenum
; ---------------------------------------------------------------------------
; Zero page
; Banking registers
RAM_BANK := $00
ROM_BANK := $01
; GEOS and graphics pseudo-registers
.struct gREG
.org $02
.union
r0 .word
.struct
r0L .byte
r0H .byte
.endstruct
.endunion
.union
r1 .word
.struct
r1L .byte
r1H .byte
.endstruct
.endunion
.union
r2 .word
.struct
r2L .byte
r2H .byte
.endstruct
.endunion
.union
r3 .word
.struct
r3L .byte
r3H .byte
.endstruct
.endunion
.union
r4 .word
.struct
r4L .byte
r4H .byte
.endstruct
.endunion
.union
r5 .word
.struct
r5L .byte
r5H .byte
.endstruct
.endunion
.union
r6 .word
.struct
r6L .byte
r6H .byte
.endstruct
.endunion
.union
r7 .word
.struct
r7L .byte
r7H .byte
.endstruct
.endunion
.union
r8 .word
.struct
r8L .byte
r8H .byte
.endstruct
.endunion
.union
r9 .word
.struct
r9L .byte
r9H .byte
.endstruct
.endunion
.union
r10 .word
.struct
r10L .byte
r10H .byte
.endstruct
.endunion
.union
r11 .word
.struct
r11L .byte
r11H .byte
.endstruct
.endunion
.union
r12 .word
.struct
r12L .byte
r12H .byte
.endstruct
.endunion
.union
r13 .word
.struct
r13L .byte
r13H .byte
.endstruct
.endunion
.union
r14 .word
.struct
r14L .byte
r14H .byte
.endstruct
.endunion
.union
r15 .word
.struct
r15L .byte
r15H .byte
.endstruct
.endunion
.endstruct
; Kernal
KTEMP2 := $80 ; 2 bytes for temporary storage
IMPARM := $82 ; Pointer for PRIMM function
FNAM := $8A ; Pointer to filename
; BASIC
TXTPTR := $EE ; Pointer into BASIC source code
; Page two
BASIC_BUF := $0200 ; Location of command-line
BASIC_BUF_LEN = 81 ; Maximum length of command-line
SCREEN_PTR := $0262 ; Pointer to current row on text screen (16 bits)
STATUS := $0287 ; Status from previous I/O operation
IN_DEV := $028B ; Current input device number
OUT_DEV := $028C ; Current output device number
FNAM_LEN := $028F ; Length of filename
SECADR := $0291 ; Secondary address
DEVNUM := $0292 ; Device number
CURS_COLOR := $0373 ; Color under the cursor
CHARCOLOR := $0376 ; Cursor's color nybbles (high: background, low: foreground)
RVS := $0377 ; Reverse flag
CURS_FLAG := $037B ; 1 = cursor off
CURS_BLINK := $037C ; Blink counter
CURS_CHAR := $037D ; Character under the cursor
CURS_STATE := $037E ; Cursor blink state
CURS_X := $0380 ; Cursor column
CURS_Y := $0383 ; Cursor row
LLEN := $0386 ; Line length
NLINES := $0387 ; Number of screen lines
; BASIC
VARTAB := $03E1 ; Pointer to start of BASIC variables
MEMSIZE := $0259 ; Pointer to highest BASIC RAM location (+1)
; ---------------------------------------------------------------------------
; Vector and other locations
IRQVec := $0314
BRKVec := $0316
NMIVec := $0318
; ---------------------------------------------------------------------------
; I/O locations
; 65C22 Versatile Interface Adapter
.struct VIA1 ; Versatile Interface Adapter
.org $9F00
PRB .byte ; mouse, LED, VIC bus (Port Register B)
PRA .byte ; keyboard, controllers (Port Register A)
DDRB .byte ; (Data Direction Register B)
DDRA .byte ; (Data Direction Register A)
T1 .word ; (Timer 1)
T1L .word ; (Timer 1 Latch)
T2 .word ; (Timer 2)
SR .byte ; (Shift Register)
ACR .byte ; (Auxiliary Control Register)
PCR .byte ; (Peripheral Control Register)
IFR .byte ; (Interrupt Flags Register)
IER .byte ; (Interrupt Enable Register)
PRA2 .byte ; keyboard, controllers (PRA without handshake)
.endstruct
; 65C22 Versatile Interface Adapter
.struct VIA2
.org $9F10
PRB .byte
PRA .byte
DDRB .byte
DDRA .byte
T1 .word
T1L .word
T2 .word
SR .byte
ACR .byte
PCR .byte
IFR .byte
IER .byte
PRA2 .byte
.endstruct
; Video Enhanced Retro Adapter
; Has audio and SPI.
.scope VERA
; External registers
.struct
.org $9F20
ADDR .faraddr ; Address for data port access
DATA0 .byte ; First data port
DATA1 .byte ; Second data port
CTRL .byte ; Control register
IRQ_EN .byte ; Interrupt enable bits
IRQ_FLAGS .byte ; Interrupt flags
IRQ_RASTER .byte ; Line where IRQ will occur
.endstruct
.enum ; Address automatic increment amounts
DEC0 = (($00 << 1) | $01) << 3
DEC1 = (($01 << 1) | $01) << 3
DEC2 = (($02 << 1) | $01) << 3
DEC4 = (($03 << 1) | $01) << 3
DEC8 = (($04 << 1) | $01) << 3
DEC16 = (($05 << 1) | $01) << 3
DEC32 = (($06 << 1) | $01) << 3
DEC64 = (($07 << 1) | $01) << 3
DEC128 = (($08 << 1) | $01) << 3
DEC256 = (($09 << 1) | $01) << 3
DEC512 = (($0A << 1) | $01) << 3
DEC40 = (($0B << 1) | $01) << 3
DEC80 = (($0C << 1) | $01) << 3
DEC160 = (($0D << 1) | $01) << 3
DEC320 = (($0E << 1) | $01) << 3
DEC640 = (($0F << 1) | $01) << 3
INC0 = (($00 << 1) | $00) << 3
INC1 = (($01 << 1) | $00) << 3
INC2 = (($02 << 1) | $00) << 3
INC4 = (($03 << 1) | $00) << 3
INC8 = (($04 << 1) | $00) << 3
INC16 = (($05 << 1) | $00) << 3
INC32 = (($06 << 1) | $00) << 3
INC64 = (($07 << 1) | $00) << 3
INC128 = (($08 << 1) | $00) << 3
INC256 = (($09 << 1) | $00) << 3
INC512 = (($0A << 1) | $00) << 3
INC40 = (($0B << 1) | $00) << 3
INC80 = (($0C << 1) | $00) << 3
INC160 = (($0D << 1) | $00) << 3
INC320 = (($0E << 1) | $00) << 3
INC640 = (($0F << 1) | $00) << 3
.endenum
.enum ; Interrupt request flags
VERT_SYNC = %00000001
RASTER_IRQ = %00000010
SPR_COLLIDED = %00000100
AUDIO_LOW = %00001000
.endenum
.scope DISP ; Display controller
SELECT1 = %00000010
.union
.org $9F29
.struct
; These four registers are visible when the DCSEL flag = %0
VIDEO .byte
HSCALE .byte
VSCALE .byte
FRAME .byte
.endstruct
.struct
; These four registers are visible when the DCSEL flag = %1
HSTART .byte
HSTOP .byte
VSTART .byte
VSTOP .byte
.endstruct
.endunion
.enum MODE ; Output mode
DISABLE = $00
VGA
NTSC
RGB ; Interlaced, composite sync
.endenum
.enum DISABLE
COLOR = %00000100 ; NTSC monochrome
.endenum
.enum ENABLE
LAYER0 = %00010000
LAYER1 = %00100000
SPRITES = %01000000
.endenum
.endscope
.struct L0 ; Display layer 0
.org $9F2D
CONFIG .byte
MAP_BASE .byte
TILE_BASE .byte
HSCROLL .word
VSCROLL .word
.endstruct
.struct L1 ; Display layer 1
.org $9F34
CONFIG .byte
MAP_BASE .byte
TILE_BASE .byte
HSCROLL .word
VSCROLL .word
.endstruct
.enum ; Layer display modes
TILE1BPP = %00000000 | $00
TILE2BPP
TILE4BPP
TILE8BPP
T256C = %00001000
BITMAP1BPP = %00000100 | $00
BITMAP2BPP
BITMAP4BPP
BITMAP8BPP
.endenum
.enum MAP ; Map geometry
WIDTH32 = $00 << 4
WIDTH64 = $01 << 4
WIDTH128 = $02 << 4
WIDTH256 = $03 << 4
HEIGHT32 = $00 << 6
HEIGHT64 = $01 << 6
HEIGHT128 = $02 << 6
HEIGHT256 = $03 << 6
.endenum
.enum TILE ; Tile geometry
WIDTH8 = $00
WIDTH16 = $01
WIDTH320 = WIDTH8
WIDTH640 = WIDTH16
HEIGHT8 = $00 << 1
HEIGHT16 = $01 << 1
.endenum
.scope PCM ; Pulse-Code Modulator
.struct
.org $9F3B
CTRL .byte
RATE .byte
DATA .byte
.endstruct
.enum
STEREO = %00010000
BITS16 = %00100000
RESET = %10000000
.endenum
.endscope
.scope SPI
.struct
.org $9F3E
DATA .byte
CTRL .byte
.endstruct
.enum
SELECT = %00000001
SLOW = %00000010
.endenum
.endscope
; Internal RAM and registers
.struct
.org $000000
VRAM .res $020000 ; 128 Kibibytes
.endstruct
.scope PSG ; Programmable Sound Generator
.struct
PITCH .word
VOL .byte ; Right, left sides; volume
WAVEFORM .byte ; Wave shape, pulse width
.endstruct
LEFT = %01 << 6
RIGHT = %10 << 6
.enum
PULSE = $00 << 6
SAWTOOTH = $01 << 6
TRIANGLE = $02 << 6
NOISE = $03 << 6
.endenum
.struct
.org $01F9C0
VOICES .res $10 * 4
.endstruct
.endscope
.struct
.org $01FA00
PALETTE .word $0100
.endstruct
.scope SPRITE
.struct ; Sprite attributes
ADDR .addr ; Address and color mode
XX .word ; Co-ordinates
YY .word
Z_FLIP .byte ; Collision mask, Z-depth, flip bits
SIZE_PAL .byte
.endstruct
.enum FLIP
NONE = %00000000
HORIZ
VERT
BOTH
.endenum
.enum DEPTH
DISABLE = $00 << 2
CANVAS = $01 << 2
LAYER0 = $02 << 2
LAYER1 = $03 << 2
.endenum
.enum ; Sprite geometry
WIDTH8 = $00 << 4
WIDTH16 = $01 << 4
WIDTH32 = $02 << 4
WIDTH64 = $03 << 4
HEIGHT8 = $00 << 6
HEIGHT16 = $01 << 6
HEIGHT32 = $02 << 6
HEIGHT64 = $03 << 6
COLORS16 = $00 << 7
COLORS256 = $01 << 7
.endenum
.endscope
.struct
.org $01FC00
SPRITES .res 128 * 8
.endstruct
.endscope
; YM2151 audio chip
.struct YM2151
.org $9F40
ADDR .byte
.union
DATA .byte
STATUS .byte
.endunion
.endstruct
; X16 Emulator device
; This device doesn't exist on the real machine.
.struct EMULATOR
.org $9FB0
DEBUG .byte ; Boolean: debugging enabled
VERALOG .byte ; Boolean: log VERA activity
KEYBOARDLOG .byte ; Boolean: log keyboard data
ECHO .byte ; Type of echo that's enabled
SAVEXIT .byte ; Boolean: save machine state on exit
GIFREC .byte ; Method of recording GIF movie
.res 2
CYCLECOUNT .dword ; Running count of CPU cycles (Read-Only)
.res 1
KEYMAP .byte ; Current keyboard layout number (Read-Only)
DETECT .byte 2 ; If is "16" string, then running on emulator (RO)
.endstruct
; ---------------------------------------------------------------------------
; Banked RAM and ROM
TIMER := $A03B ; (bank 0) 60 Hz. timer (3 bytes, big-endian)
.struct BANK
.org $A000
RAM .res $2000 ; 8 Kibibyte window into 512 Kibibytes or 2048 Kibibytes
ROM .res $4000 ; 16 Kibibyte window into 128 Kibibytes
.endstruct

49
asminc/em-error.inc Normal file
View file

@ -0,0 +1,49 @@
;/*****************************************************************************/
;/* */
;/* em-error.inc */
;/* */
;/* EM error codes */
;/* */
;/* */
;/* */
;/* (C) 2002-2012, Ullrich von Bassewitz */
;/* Roemerstrasse 52 */
;/* D-70794 Filderstadt */
;/* EMail: uz@cc65.org */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice may not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
; Error constants
.enum
EM_ERR_OK ; No error
EM_ERR_NO_DRIVER ; No driver available
EM_ERR_CANNOT_LOAD ; Error loading driver
EM_ERR_INV_DRIVER ; Invalid driver
EM_ERR_NO_DEVICE ; Device (hardware) not found
EM_ERR_INSTALLED ; A driver is already installed
EM_ERR_COUNT ; Special: Number of error messages
.endenum

106
asminc/em-kernel.inc Normal file
View file

@ -0,0 +1,106 @@
;/*****************************************************************************/
;/* */
;/* em-kernel.inc */
;/* */
;/* EM kernel interface */
;/* */
;/* */
;/* */
;/* (C) 2002-2003 Ullrich von Bassewitz */
;/* Roemerstrasse 52 */
;/* D-70794 Filderstadt */
;/* EMail: uz@cc65.org */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice may not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
;------------------------------------------------------------------------------
; The driver header
.struct EMD_HDR
ID .byte 3 ; Contains 0x65, 0x6d, 0x64 ("emd")
VERSION .byte 1 ; Interface version
LIBREF .addr ; Library reference
JUMPTAB .struct
INSTALL .addr ; INSTALL routine
UNINSTALL .addr ; UNINSTALL routine
PAGECOUNT .addr ; PAGECOUNT routine
MAP .addr ; MAP routine
USE .addr ; USE routine
MAPCLEAN .addr ; MAPCLEAN routine
COPYFROM .addr ; COPYFROM routine
COPYTO .addr ; COPYTO routine
.endstruct
.endstruct
;------------------------------------------------------------------------------
; The EMD API version, stored in EMD_HDR::VERSION
EMD_API_VERSION = $02
;------------------------------------------------------------------------------
; The asm equivalent to the C em_copy structure
.struct EM_COPY
BUF .addr ; Memory buffer to copy from or to
OFFS .byte ; Offset into page
PAGE .word ; Starting page to copy from or to
COUNT .word ; Number of bytes to copy
UNUSED .byte ; Make the size 8 bytes
.endstruct
;------------------------------------------------------------------------------
; Variables
.global _em_drv ; Pointer to driver
;------------------------------------------------------------------------------
; Driver entry points
.global emd_install
.global emd_uninstall
.global emd_pagecount
.global emd_map
.global emd_use
.global emd_commit
.global emd_copyfrom
.global emd_copyto
;------------------------------------------------------------------------------
; ASM functions
.global em_clear_ptr
;------------------------------------------------------------------------------
; C callable functions
.global _em_load_driver
.global _em_unload
.global _em_install
.global _em_uninstall
.global _em_pagecount
.global _em_map
.global _em_use
.global _em_commit
.global _em_copyfrom
.global _em_copyto

37
asminc/errno.inc Normal file
View file

@ -0,0 +1,37 @@
;
; Ullrich von Bassewitz, 16.05.2000
;
; Variables and functions
.global ___errno, ___oserror
.global ___osmaperrno
.global ___seterrno
.global ___directerrno, ___mappederrno
; Error codes, must match the values in the C headers
.enum
EOK ; No error
ENOENT ; No such file or directory
ENOMEM ; Out of memory
EACCES ; Permission denied
ENODEV ; No such device
EMFILE ; Too many open files
EBUSY ; Device or resource busy
EINVAL ; Invalid argument
ENOSPC ; No space left on device
EEXIST ; File exists
EAGAIN ; Try again
EIO ; I/O error
EINTR ; Interrupted system call
ENOSYS ; Function not implemented
ESPIPE ; Illegal seek
ERANGE ; Range error
EBADF ; Bad file number
ENOEXEC ; Exec format error
EUNKNOWN ; Unknown OS specific error - must be last!
EMAX = EUNKNOWN ; Highest error code
.endenum

21
asminc/fcntl.inc Normal file
View file

@ -0,0 +1,21 @@
;
; Ullrich von Bassewitz, 05.06.1999
;
; Predefined file handles
STDIN_FILENO = 0
STDOUT_FILENO = 1
STDERR_FILENO = 2
; File mode constants, must match the values in the C headers
O_RDONLY = $01
O_WRONLY = $02
O_RDWR = $03
O_CREAT = $10
O_TRUNC = $20
O_APPEND = $40
O_EXCL = $80

64
asminc/gamate.inc Normal file
View file

@ -0,0 +1,64 @@
;-------------------------------------------------------------------------------
; gamate.inc
;
; Gamate system specific definitions
;
; (w) 2015 Groepaz/Hitmen (groepaz@gmx.net)
; based on technical reference by PeT (mess@utanet.at)
;-------------------------------------------------------------------------------
; look at gamate.h for comments, they are not duplicated here
AUDIO_BASE = $4000
JOY_DATA = $4400
JOY_DATA_UP = $01
JOY_DATA_DOWN = $02
JOY_DATA_LEFT = $04
JOY_DATA_RIGHT = $08
JOY_DATA_FIRE_A = $10
JOY_DATA_FIRE_B = $20
JOY_DATA_START = $40
JOY_DATA_SELECT = $80
LCD_WIDTH = 160
LCD_HEIGHT = 152
LCD_BASE = $5000
LCD_MODE = $5001
LCD_XPOS = $5002
LCD_YPOS = $5003
LCD_X = $5004
LCD_Y = $5005
LCD_READ = $5006
LCD_DATA = $5007
LCD_MODE_INC_X = $00
LCD_MODE_INC_Y = $40
LCD_XPOS_PLANE1 = $00
LCD_XPOS_PLANE2 = $80
; constants for the conio implementation
charsperline = (LCD_WIDTH / 8)
screenrows = (LCD_HEIGHT / 8)
CH_HLINE = 1
CH_VLINE = 2
COLOR_WHITE = 0
COLOR_GREY2 = 1
COLOR_GREY1 = 2
COLOR_BLACK = 3
; bios zp usage:
ZP_NMI_4800 = $0a
ZP_IRQ_COUNT = $0b
ZP_IRQ_CTRL = $0c
ZP_IRQ_CNT1 = $0e
ZP_IRQ_CNT2 = $0f
ZP_IRQ_CNT3 = $10
ZP_IRQ_CNT4 = $11
ZP_NMI_FLAG = $e8

53
asminc/generic.mac Normal file
View file

@ -0,0 +1,53 @@
; add - Add without carry
.macro add Arg1, Arg2
clc
.if .paramcount = 2
adc Arg1, Arg2
.else
adc Arg1
.endif
.endmacro
; sub - subtract without borrow
.macro sub Arg1, Arg2
sec
.if .paramcount = 2
sbc Arg1, Arg2
.else
sbc Arg1
.endif
.endmacro
; bge - jump if unsigned greater or equal
.macro bge Arg
bcs Arg
.endmacro
; blt - Jump if unsigned less
.macro blt Arg
bcc Arg
.endmacro
; bgt - jump if unsigned greater
.macro bgt Arg
beq *+4
bcs Arg
.endmacro
; ble - jump if unsigned less or equal
.macro ble Arg
beq Arg
bcc Arg
.endmacro
; bnz - jump if not zero
.macro bnz Arg
bne Arg
.endmacro
; bze - jump if zero
.macro bze Arg
beq Arg
.endmacro

22
asminc/get_tv.inc Normal file
View file

@ -0,0 +1,22 @@
;
; get_tv.inc
;
; Ullrich von Bassewitz, 2004-10-15
;
; Defines for the get_tv function.
; Error codes returned by all functions
.enum TV
NTSC
PAL
OTHER
.endenum
; get_tv function
.global _get_tv

44
asminc/joy-error.inc Normal file
View file

@ -0,0 +1,44 @@
;/*****************************************************************************/
;/* */
;/* joy-error.inc */
;/* */
;/* Joystick error codes */
;/* */
;/* */
;/* */
;/* (C) 2002 Ullrich von Bassewitz */
;/* Wacholderweg 14 */
;/* D-70597 Stuttgart */
;/* EMail: uz@musoftware.de */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice may not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
; Error codes
JOY_ERR_OK = 0 ; No error
JOY_ERR_NO_DRIVER = 1 ; No driver available
JOY_ERR_CANNOT_LOAD = 2 ; Error loading driver
JOY_ERR_INV_DRIVER = 3 ; Invalid driver
JOY_ERR_NO_DEVICE = 4 ; Device (hardware) not found

83
asminc/joy-kernel.inc Normal file
View file

@ -0,0 +1,83 @@
;/*****************************************************************************/
;/* */
;/* joy-kernel.inc */
;/* */
;/* Internally used joystick functions */
;/* */
;/* */
;/* */
;/* (C) 2002-2006, Ullrich von Bassewitz */
;/* Roemerstrasse 52 */
;/* D-70794 Filderstadt */
;/* EMail: uz@cc65.org */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice may not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
;------------------------------------------------------------------------------
; Driver header stuff
.struct JOY_HDR
ID .byte 3 ; $6A, $6F, $79 ("joy")
VERSION .byte 1 ; Interface version
LIBREF .addr ; Library reference
JUMPTAB .struct
INSTALL .addr ; INSTALL routine
UNINSTALL .addr ; UNINSTALL routine
COUNT .addr ; COUNT routine
READ .addr ; READ routine
.endstruct
.endstruct
;------------------------------------------------------------------------------
; The JOY API version, stored in JOY_HDR::VERSION
JOY_API_VERSION = $05
;------------------------------------------------------------------------------
; Variables
.global _joy_drv ; Pointer to driver
.global _joy_masks
;------------------------------------------------------------------------------
; Driver entry points
.global joy_install
.global joy_uninstall
.global joy_count
.global joy_read
;------------------------------------------------------------------------------
; C callable functions
.global _joy_load_driver
.global _joy_unload
.global _joy_install
.global _joy_uninstall
.global _joy_count
.global _joy_read
.global _joy_clear_ptr

31
asminc/kim1.inc Normal file
View file

@ -0,0 +1,31 @@
; ---------------------------------------------------------------------------
;
; KIM-1 definitions
;
; ---------------------------------------------------------------------------
RAMSTART := $0200 ; Entry point
; ---------------------------------------------------------------------------
; Monitor Functions
; ---------------------------------------------------------------------------
OUTCHR := $1EA0 ; Output character
INTCHR := $1E5A ; Input character without case conversion
DUMPT := $1800 ; Dump memory to tape
LOADT := $1873 ; Load memory from tape
START := $1C4F ; Enter KIM-1 monitor
SCANDS := $1F1F ; Scan 7-segment display
KEYIN := $1F40 ; Open up keyboard channel
GETKEY := $1F6A ; Return key from keyboard
; ---------------------------------------------------------------------------
; System Memory
; ---------------------------------------------------------------------------
SAL := $17F5 ; Tape load address low
SAH := $17F6 ; Tape load address high
EAL := $17F7 ; Tape address end low
EAH := $17F8 ; Tape address end high
ID := $17F9 ; Tape Identification number

88
asminc/longbranch.mac Normal file
View file

@ -0,0 +1,88 @@
.macro jeq Target
.if .match(Target, 0)
bne *+5
jmp Target
.elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
beq Target
.else
bne *+5
jmp Target
.endif
.endmacro
.macro jne Target
.if .match(Target, 0)
beq *+5
jmp Target
.elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
bne Target
.else
beq *+5
jmp Target
.endif
.endmacro
.macro jmi Target
.if .match(Target, 0)
bpl *+5
jmp Target
.elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
bmi Target
.else
bpl *+5
jmp Target
.endif
.endmacro
.macro jpl Target
.if .match(Target, 0)
bmi *+5
jmp Target
.elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
bpl Target
.else
bmi *+5
jmp Target
.endif
.endmacro
.macro jcs Target
.if .match(Target, 0)
bcc *+5
jmp Target
.elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
bcs Target
.else
bcc *+5
jmp Target
.endif
.endmacro
.macro jcc Target
.if .match(Target, 0)
bcs *+5
jmp Target
.elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
bcc Target
.else
bcs *+5
jmp Target
.endif
.endmacro
.macro jvs Target
.if .match(Target, 0)
bvc *+5
jmp Target
.elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
bvs Target
.else
bvc *+5
jmp Target
.endif
.endmacro
.macro jvc Target
.if .match(Target, 0)
bvs *+5
jmp Target
.elseif .def(Target) .and .const((*-2)-(Target)) .and ((*+2)-(Target) <= 127)
bvc Target
.else
bvs *+5
jmp Target
.endif
.endmacro

460
asminc/lynx.inc Normal file
View file

@ -0,0 +1,460 @@
; Lynx system hardware includes
; Shawn Jefferson
; June 18th, 2004
;
; Reference:
; Bastian Schick's Lynx Documentation
; http://www.geocities.ws/SiliconValley/Byte/4242/lynx/
;
; ***
; *** Suzy Addresses
; ***
; Sprite Control Block
TMPADRL = $FC00
TMPADRH = $FC01
TILTACUML = $FC02
TILTACUMH = $FC03
HOFFL = $FC04
HOFFH = $FC05
VOFFL = $FC06
VOFFH = $FC07
VIDBASL = $FC08
VIDBASH = $FC09
COLLBASL = $FC0A
COLLBASH = $FC0B
VIDADRL = $FC0C
VIDADRH = $FC0D
COLLADRL = $FC0E
COLLADRH = $FC0F
SCBNEXTL = $FC10
SCBNEXTH = $FC11
SPRDLINEL = $FC12
SPRDLINEH = $FC13
HPOSSTRTL = $FC14
HPOSSTRTH = $FC15
VPOSSTRTL = $FC16
VPOSSTRTH = $FC17
SPRHSIZL = $FC18
SPRHSIZH = $FC19
SPRVSIZL = $FC1A
SPRVSIZH = $FC1B
STRETCHL = $FC1C
STRETCHH = $FC1D
TILTL = $FC1E
TILTH = $FC1F
SPRDOFFL = $FC20
SPRDOFFH = $FC21
SPRVPOSL = $FC22
SPRVPOSH = $FC23
COLLOFFL = $FC24
COLLOFFH = $FC25
VSIZACUML = $FC26
VSIZACUMH = $FC27
HSIZOFFL = $FC28
HSIZOFFH = $FC29
VSIZOFFL = $FC2A
VSIZOFFH = $FC2B
SCBADRL = $FC2C
SCBADRH = $FC2D
PROCADRL = $FC2E
PROCADRH = $FC2F
; Suzy Math
MATHD = $FC52
MATHC = $FC53
MATHB = $FC54
MATHA = $FC55
MATHP = $FC56
MATHN = $FC57
MATHH = $FC60
MATHG = $FC61
MATHF = $FC62
MATHE = $FC63
MATHM = $FC6C
MATHL = $FC6D
MATHK = $FC6E
MATHJ = $FC6F
; Suzy sprite engine
SPRCTL0 = $FC80
; Sprite bits-per-pixel definitions
BPP_MASK = %11000000 ; Mask for settings bits per pixel
BPP_1 = %00000000
BPP_2 = %01000000
BPP_3 = %10000000
BPP_4 = %11000000
; More sprite control 0 bit definitions
HFLIP = %00100000
VFLIP = %00010000
; Sprite types - redefined to reflect the reality caused by the shadow error
TYPE_SHADOW = %00000111
TYPE_XOR = %00000110
TYPE_NONCOLL = %00000101 ; Non-colliding
TYPE_NORMAL = %00000100
TYPE_BOUNDARY = %00000011
TYPE_BSHADOW = %00000010 ; Background shadow
TYPE_BACKNONCOLL = %00000001 ; Background non-colliding
TYPE_BACKGROUND = %00000000
SPRCTL1 = $FC81
LITERAL = %10000000
PACKED = %00000000
ALGO3 = %01000000 ; Broken, do not set this bit!
; Sprite reload mask definitions
RELOAD_MASK = %00110000
RENONE = %00000000 ; Reload nothing
REHV = %00010000 ; Reload hsize, vsize
REHVS = %00100000 ; Reload hsize, vsize, stretch
REHVST = %00110000 ; Reload hsize, vsize, stretch, tilt
; More sprite control 1 bit definitions
REUSEPAL = %00001000
SKIP = %00000100
DRAWUP = %00000010
DRAWLEFT = %00000001
SPRCOLL = $FC82
SPRINIT = $FC83
SUZYHREV = $FC88
SUZYSREV = $FC89
SUZYBUSEN = $FC90
SPRGO = $FC91
; SPRGO bit definitions
SPRITE_GO = %00000001 ; sprite process start bit
EVER_ON = %00000100 ; everon detector enable
SPRSYS = $FC92
; SPRSYS bit definitions for write operations
SIGNMATH = %10000000 ; signed math
ACCUMULATE = %01000000 ; accumulate multiplication results
NO_COLLIDE = %00100000 ; do not collide with any sprites (also SPRCOLL bit definition)
VSTRETCH = %00010000 ; stretch v
LEFTHAND = %00001000
CLR_UNSAFE = %00000100 ; unsafe access reset
SPRITESTOP = %00000010 ; request to stop sprite process
; SPRSYS bit definitions for read operations
MATHWORKING = %10000000 ; math operation in progress
MATHWARNING = %01000000 ; accumulator overflow on multiple or divide by zero
MATHCARRY = %00100000 ; last carry bit
VSTRETCHING = %00010000
LEFTHANDED = %00001000
UNSAFE_ACCESS = %00000100 ; unsafe access performed
SPRITETOSTOP = %00000010 ; requested to stop
SPRITEWORKING = %00000001 ; sprite process is active
JOYSTICK = $FCB0
; JOYSTICK bit definitions
JOYPAD_UP = %10000000
JOYPAD_DOWN = %01000000
JOYPAD_LEFT = %00100000
JOYPAD_RIGHT = %00010000
BUTTON_OPTION1 = %00001000
BUTTON_OPTION2 = %00000100
BUTTON_INNER = %00000010
BUTTON_OUTER = %00000001
SWITCHES = $FCB1
; SWITCHES bit definitions
CART1_IO_INACTIVE = %00000100
CART0_IO_INACTIVE = %00000010
BUTTON_PAUSE = %00000001
RCART0 = $FCB2
RCART1 = $FCB3
LEDS = $FCC0
PARSTATUS = $FCC2
PARDATA = $FCC3
HOWIE = $FCC4
;
; *** Mikey Addresses
; ***
; Mikey timers
; Logical timer names
TIMER0 = $FD00
TIMER1 = $FD04
TIMER2 = $FD08
TIMER3 = $FD0C
TIMER4 = $FD10
TIMER5 = $FD14
TIMER6 = $FD18
TIMER7 = $FD1C
HTIMER = TIMER0 ; horizontal line timer (timer 0)
VTIMER = TIMER2 ; vertical blank timer (timer 2)
STIMER = TIMER7 ; sound timer (timer 7)
HTIMBKUP = $FD00 ; horizontal line timer (timer 0)
HTIMCTLA = $FD01
HTIMCNT = $FD02
HTIMCTLB = $FD03
VTIMBKUP = $FD08 ; vertical blank timer (timer 2)
VTIMCTLA = $FD09
VTIMCNT = $FD0A
VTIMCTLB = $FD0B
BAUDBKUP = $FD10 ; serial timer (timer 4)
STIMBKUP = $FD1C ; sound timer (timer 7)
STIMCTLA = $FD1D
STIMCNT = $FD1E
STIMCTLB = $FD1F
TIM0BKUP = $FD00
TIM0CTLA = $FD01
TIM0CNT = $FD02
TIM0CTLB = $FD03
TIM1BKUP = $FD04
TIM1CTLA = $FD05
TIM1CNT = $FD06
TIM1CTLB = $FD07
TIM2BKUP = $FD08
TIM2CTLA = $FD09
TIM2CNT = $FD0A
TIM2CTLB = $FD0B
TIM3BKUP = $FD0C
TIM3CTLA = $FD0D
TIM3CNT = $FD0E
TIM3CTLB = $FD0F
TIM4BKUP = $FD10
TIM4CTLA = $FD11
TIM4CNT = $FD12
TIM4CTLB = $FD13
TIM5BKUP = $FD14
TIM5CTLA = $FD15
TIM5CNT = $FD16
TIM5CTLB = $FD17
TIM6BKUP = $FD18
TIM6CTLA = $FD19
TIM6CNT = $FD1A
TIM6CTLB = $FD1B
TIM7BKUP = $FD1C
TIM7CTLA = $FD1D
TIM7CNT = $FD1E
TIM7CTLB = $FD1F
; Timer offsets
TIM_BACKUP = 0
TIM_CONTROLA = 1
TIM_COUNT = 2
TIM_CONTROLB = 3
; TIM_CONTROLA control bits
ENABLE_INT = %10000000
RESET_DONE = %01000000
ENABLE_RELOAD = %00010000
ENABLE_COUNT = %00001000
AUD_CLOCK_MASK = %00000111
; Clock settings
AUD_LINKING = %00000111
AUD_64 = %00000110
AUD_32 = %00000101
AUD_16 = %00000100
AUD_8 = %00000011
AUD_4 = %00000010
AUD_2 = %00000001
AUD_1 = %00000000
; TIM_CONTROLB control bits
TIMER_DONE = %00001000
LAST_CLOCK = %00000100
BORROW_IN = %00000010
BORROW_OUT = %00000001
; Mikey Audio
AUDIO0 = $FD20 ; audio channel 0
AUDIO1 = $FD28 ; audio channel 1
AUDIO2 = $FD30 ; audio channel 2
AUDIO3 = $FD38 ; audio channel 3
AUD0VOL = $FD20
AUD0FEED = $FD21
AUD0OUT = $FD22
AUD0SHIFT = $FD23
AUD0BKUP = $FD24
AUD0CTLA = $FD25
AUD0CNT = $FD26
AUD0CTLB = $FD27
AUD1VOL = $FD28
AUD1FEED = $FD29
AUD1OUT = $FD2A
AUD1SHIFT = $FD2B
AUD1BKUP = $FD2C
AUD1CTLA = $FD2D
AUD1CNT = $FD2E
AUD1CTLB = $FD2F
AUD2VOL = $FD30
AUD2FEED = $FD31
AUD2OUT = $FD32
AUD2SHIFT = $FD33
AUD2BKUP = $FD34
AUD2CTLA = $FD35
AUD2CNT = $FD36
AUD2CTLB = $FD37
AUD3VOL = $FD38
AUD3FEED = $FD39
AUD3OUT = $FD3A
AUD3SHIFT = $FD3B
AUD3BKUP = $FD3C
AUD3CTLA = $FD3D
AUD3CNT = $FD3E
AUD3CTLB = $FD3F
; AUD_CONTROL bits are almost identical to TIM_CONTROLA bits.
; See TIM_CONTROLA above for the other definitions
FEEDBACK_7 = %10000000
ENABLE_INTEGRATE = %00100000
; Stereo control registers follow
; Stereo capability does not exist in all Lynxes
; Left and right may be reversed, and if so will be corrected in a later
; release
ATTENREG0 = $FD40 ; Stereo attenuation registers
ATTENREG1 = $FD41
ATTENREG2 = $FD42
ATTENREG3 = $FD43
MPAN = $FD44
MSTEREO = $FD50
; Bit definitions for MPAN and MSTEREO registers
LEFT_ATTENMASK = %11110000
RIGHT_ATTENMASK = %00001111
LEFT3_SELECT = %10000000
LEFT2_SELECT = %01000000
LEFT1_SELECT = %00100000
LEFT0_SELECT = %00010000
RIGHT3_SELECT = %00001000
RIGHT2_SELECT = %00000100
RIGHT1_SELECT = %00000010
RIGHT0_SELECT = %00000001
; Mikey interrupts
INTRST = $FD80
INTSET = $FD81
; Interrupt bits in INTRST and INTSET
TIMER0_INTERRUPT = %00000001
TIMER1_INTERRUPT = %00000010
TIMER2_INTERRUPT = %00000100
TIMER3_INTERRUPT = %00001000
TIMER4_INTERRUPT = %00010000
TIMER5_INTERRUPT = %00100000
TIMER6_INTERRUPT = %01000000
TIMER7_INTERRUPT = %10000000
HBL_INTERRUPT = TIMER0_INTERRUPT
VBL_INTERRUPT = TIMER2_INTERRUPT
SERIAL_INTERRUPT = TIMER4_INTERRUPT
SND_INTERRUPT = TIMER7_INTERRUPT
MAGRDY0 = $FD84
MAGRDY1 = $FD85
AUDIN = $FD86
SYSCTL1 = $FD87
; SYSCTL1 bit definitions
POWERON = %00000010
CART_ADDR_STROBE = %00000001
MIKEYHREV = $FD88
MIKEYSREV = $FD89
IODIR = $FD8A
IODAT = $FD8B
; IODIR and IODAT bit definitions
AUDIN_BIT = %00010000 ; Note that there is also the address AUDIN
READ_ENABLE = %00010000 ; Same bit for AUDIN_BIT
RESTLESS = %00001000
NOEXP = %00000100 ; If set, redeye is not connected
CART_ADDR_DATA = %00000010
CART_POWER_OFF = %00000010 ; Same bit for CART_ADDR_DATA
EXTERNAL_POWER = %00000001
SERCTL = $FD8C
; SERCTL bit definitions for write operations
TXINTEN = %10000000
RXINTEN = %01000000
PAREN = %00010000
RESETERR = %00001000
TXOPEN = %00000100
TXBRK = %00000010
PAREVEN = %00000001
; SERCTL bit definitions for read operations
TXRDY = %10000000
RXRDY = %01000000
TXEMPTY = %00100000
PARERR = %00010000
OVERRUN = %00001000
FRAMERR = %00000100
RXBRK = %00000010
PARBIT = %00000001
SERDAT = $FD8D
SDONEACK = $FD90
CPUSLEEP = $FD91
DISPCTL = $FD92
; DISPCTL bit definitions
DISP_COLOR = %10000000 ; must be set to 1
DISP_FOURBIT = %01000000 ; must be set to 1
DISP_FLIP = %00100000
DMA_ENABLE = %00010000 ; must be set to 1
PBKUP = $FD93
DISPADRL = $FD94
DISPADRH = $FD95
MTEST0 = $FD9C
; MTEST0 bit definitions
AT_CNT16 = %10000000
AT_TEST = %01000000
XCLKEN = %00100000
UART_TURBO = %00010000
ROM_SEL = %00001000
ROM_TEST = %00000100
M_TEST = %00000010
CPU_TEST = %00000001
MTEST1 = $FD9D
; MTEST1 bit definitions
P_CNT16 = %01000000
REF_CNT16 = %00100000
VID_TRIG = %00010000
REF_TRIG = %00001000
VID_DMA_DIS = %00000100
REF_FAST = %00000010
REF_DIS = %00000001
MTEST2 = $FD9E
; MTEST2 bit definitions
V_STROBE = %00010000
V_ZERO = %00001000
H_120 = %00000100
H_ZERO = %00000010
V_BLANKEF = %00000001
PALETTE = $FDA0 ; hardware rgb palette
GCOLMAP = $FDA0 ; hardware rgb palette (green)
RBCOLMAP = $FDB0 ; hardware rgb palette (red-blue)
; Memory mapping control and 6502 vectors
MAPCTL = $FFF9
; MAPCTL bit definitions
TURBO_DISABLE = %10000000
VECTOR_SPACE = %00001000 ; 1 maps RAM into specified space
ROM_SPACE = %00000100
MIKEY_SPACE = %00000010
SUZY_SPACE = %00000001
VECTORS = $FFFB
INTVECTL = $FFFE
INTVECTH = $FFFF
RSTVECTL = $FFFC
RSTVECTH = $FFFD
NMIVECTL = $FFFA
NMIVECTH = $FFFB

239
asminc/mega65.inc Normal file
View file

@ -0,0 +1,239 @@
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
TXTPTR := $3C ; Pointer into BASIC source code
STATUS := $90 ; Kernal I/O completion status
FNAM_LEN := $B7 ; Length of filename
SECADR := $B9 ; Secondary address
DEVNUM := $BA ; Device number
FNAM := $BB ; Address of filename
FNAM_BANK := $BE ; Bank for filename
KEY_COUNT := $D0 ; Number of keys in input buffer
FKEY_COUNT := $D1 ; Characters for function key
MODE := $D7 ; 40-/80-column mode (bit 7: 80 columns)
GRAPHM := $D8 ; Graphics mode flags (bits 5-7)
CHARDIS := $D9 ; Bit 2 shadow for location $01
CURS_X := $EC ; Cursor column
CURS_Y := $EB ; Cursor row
SCREEN_PTR := $E0 ; Pointer to current char in text screen
CRAM_PTR := $E2 ; Pointer to current char in color RAM
CHARCOLOR := $F1
RVS := $F3 ; Reverse output flag
SCROLL := $F8 ; Disable scrolling flag
BASIC_BUF := $0200 ; Location of command-line
BASIC_BUF_LEN = 161 ; Maximum length of command-line
FKEY_LEN := $1000 ; Function key lengths
FKEY_TEXT := $100A ; Function key texts
PALFLAG := $1103 ; $FF=PAL, $00=NTSC
INIT_STATUS := $1104 ; Flags: Reset/Restore initiation status
TIME := $110C ; 60HZ clock
KBDREPEAT := $111a
KBDREPEATRATE := $111b
KBDREPEATDELAY := $111c
; ---------------------------------------------------------------------------
; Vectors
IRQVec := $0314
BRKVec := $0316
NMIVec := $0318
; ---------------------------------------------------------------------------
; I/O: VIC
VIC := $D000
VIC_SPR0_X := $D000
VIC_SPR0_Y := $D001
VIC_SPR1_X := $D002
VIC_SPR1_Y := $D003
VIC_SPR2_X := $D004
VIC_SPR2_Y := $D005
VIC_SPR3_X := $D006
VIC_SPR3_Y := $D007
VIC_SPR4_X := $D008
VIC_SPR4_Y := $D009
VIC_SPR5_X := $D00A
VIC_SPR5_Y := $D00B
VIC_SPR6_X := $D00C
VIC_SPR6_Y := $D00D
VIC_SPR7_X := $D00E
VIC_SPR7_Y := $D00F
VIC_SPR_HI_X := $D010
VIC_SPR_ENA := $D015
VIC_SPR_EXP_Y := $D017
VIC_SPR_EXP_X := $D01D
VIC_SPR_MCOLOR := $D01C
VIC_SPR_BG_PRIO := $D01B
VIC_SPR_COLL := $D01E
VIC_SPR_BG_COLL := $D01F
VIC_SPR_MCOLOR0 := $D025
VIC_SPR_MCOLOR1 := $D026
VIC_SPR0_COLOR := $D027
VIC_SPR1_COLOR := $D028
VIC_SPR2_COLOR := $D029
VIC_SPR3_COLOR := $D02A
VIC_SPR4_COLOR := $D02B
VIC_SPR5_COLOR := $D02C
VIC_SPR6_COLOR := $D02D
VIC_SPR7_COLOR := $D02E
VIC_CTRL1 := $D011
VIC_CTRL2 := $D016
VIC_HLINE := $D012
VIC_LPEN_X := $D013
VIC_LPEN_Y := $D014
VIC_VIDEO_ADR := $D018
VIC_IRR := $D019 ; Interrupt request register
VIC_IMR := $D01A ; Interrupt mask register
VIC_BORDERCOLOR := $D020
VIC_BG_COLOR0 := $D021
VIC_BG_COLOR1 := $D022
VIC_BG_COLOR2 := $D023
VIC_BG_COLOR3 := $D024
; ---------------------------------------------------------------------------
; I/O: FDC
FDC := $D080
; ---------------------------------------------------------------------------
; I/O: SID
SID0 := $D400
SID0_S1Lo := $D400
SID0_S1Hi := $D401
SID0_PB1Lo := $D402
SID0_PB1Hi := $D403
SID0_Ctl1 := $D404
SID0_AD1 := $D405
SID0_SUR1 := $D406
SID0_S2Lo := $D407
SID0_S2Hi := $D408
SID0_PB2Lo := $D409
SID0_PB2Hi := $D40A
SID0_Ctl2 := $D40B
SID0_AD2 := $D40C
SID0_SUR2 := $D40D
SID0_S3Lo := $D40E
SID0_S3Hi := $D40F
SID0_PB3Lo := $D410
SID0_PB3Hi := $D411
SID0_Ctl3 := $D412
SID0_AD3 := $D413
SID0_SUR3 := $D414
SID0_FltLo := $D415
SID0_FltHi := $D416
SID0_FltCtl := $D417
SID0_Amp := $D418
SID0_ADConv1 := $D419
SID0_ADConv2 := $D41A
SID0_Noise := $D41B
SID0_Read3 := $D41C
SID1 := $D420
SID1_S1Lo := $D420
SID1_S1Hi := $D421
SID1_PB1Lo := $D422
SID1_PB1Hi := $D423
SID1_Ctl1 := $D424
SID1_AD1 := $D425
SID1_SUR1 := $D426
SID1_S2Lo := $D427
SID1_S2Hi := $D428
SID1_PB2Lo := $D429
SID1_PB2Hi := $D42A
SID1_Ctl2 := $D42B
SID1_AD2 := $D42C
SID1_SUR2 := $D42D
SID1_S3Lo := $D42E
SID1_S3Hi := $D42F
SID1_PB3Lo := $D430
SID1_PB3Hi := $D431
SID1_Ctl3 := $D432
SID1_AD3 := $D433
SID1_SUR3 := $D434
SID1_FltLo := $D435
SID1_FltHi := $D436
SID1_FltCtl := $D437
SID1_Amp := $D438
SID1_ADConv1 := $D439
SID1_ADConv2 := $D43A
SID1_Noise := $D43B
SID1_Read3 := $D43C
; ---------------------------------------------------------------------------
; I/O: Complex Interface Adapters
CIA1 := $DC00
CIA1_PRA := $DC00 ; Port A
CIA1_PRB := $DC01 ; Port B
CIA1_DDRA := $DC02 ; Data direction register for port A
CIA1_DDRB := $DC03 ; Data direction register for port B
CIA1_TA := $DC04 ; 16-bit timer A
CIA1_TB := $DC06 ; 16-bit timer B
CIA1_TOD10 := $DC08 ; Time-of-day tenths of a second
CIA1_TODSEC := $DC09 ; Time-of-day seconds
CIA1_TODMIN := $DC0A ; Time-of-day minutes
CIA1_TODHR := $DC0B ; Time-of-day hours
CIA1_SDR := $DC0C ; Serial data register
CIA1_ICR := $DC0D ; Interrupt control register
CIA1_CRA := $DC0E ; Control register for timer A
CIA1_CRB := $DC0F ; Control register for timer B
CIA2 := $DD00
CIA2_PRA := $DD00
CIA2_PRB := $DD01
CIA2_DDRA := $DD02
CIA2_DDRB := $DD03
CIA2_TA := $DD04
CIA2_TB := $DD06
CIA2_TOD10 := $DD08
CIA2_TODSEC := $DD09
CIA2_TODMIN := $DD0A
CIA2_TODHR := $DD0B
CIA2_SDR := $DD0C
CIA2_ICR := $DD0D
CIA2_CRA := $DD0E
CIA2_CRB := $DD0F
; ---------------------------------------------------------------------------
; I/O: DMA
DMA := $D700
; ---------------------------------------------------------------------------
; Processor Port at $01
LORAM = $01 ; Enable the basic rom
HIRAM = $02 ; Enable the kernal rom
IOEN = $04 ; Enable I/O
CASSDATA = $08 ; Cassette data
CASSPLAY = $10 ; Cassette: Play
CASSMOT = $20 ; Cassette motor on
TP_FAST = $80 ; Switch Rossmoeller TurboProcess to fast mode
RAMONLY = $F8 ; (~(LORAM | HIRAM | IOEN)) & $FF
; temporary, to get conio working
XSIZE = 80
YSIZE = 50

78
asminc/modload.inc Normal file
View file

@ -0,0 +1,78 @@
;*****************************************************************************/
;* */
;* modload.inc */
;* */
;* o65 module loader interface for cc65 */
;* */
;* */
;* */
;* (C) 2002 Ullrich von Bassewitz */
;* Wacholderweg 14 */
;* D-70597 Stuttgart */
;* EMail: uz@musoftware.de */
;* */
;* */
;* This software is provided 'as-is', without any expressed or implied */
;* warranty. In no event will the authors be held liable for any damages */
;* arising from the use of this software. */
;* */
;* Permission is granted to anyone to use this software for any purpose, */
;* including commercial applications, and to alter it and redistribute it */
;* freely, subject to the following restrictions: */
;* */
;* 1. The origin of this software must not be misrepresented; you must not */
;* claim that you wrote the original software. If you use this software */
;* in a product, an acknowledgment in the product documentation would be */
;* appreciated but is not required. */
;* 2. Altered source versions must be plainly marked as such, and must not */
;* be misrepresented as being the original software. */
;* 3. This notice may not be removed or altered from any source */
;* distribution. */
;* */
;*****************************************************************************/
; Exports structures and functions to load relocatable o65 modules at
; runtime.
; Offsets for the mod_ctrl struct. This struct is passed to the module loader.
; It contains stuff, the loader needs to work, and another area where the
; loader will place informational data if it was successful. You will have to
; check the return code of mod_load before accessing any of these additional
; struct members.
.struct MOD_CTRL
READ .addr
CALLERDATA .word
MODULE .addr ; Pointer to module data
MODULE_SIZE .word ; Total size of loaded module
MODULE_ID .word
.endstruct
; unsigned char mod_load (struct mod_ctrl* ctrl);
; /* Load a module into memory and relocate it. The function will return an
; * error code (see below). If MLOAD_OK is returned, the outgoing fields in
; * the passed mod_ctrl struct contain information about the module just
; * loaded.
; */
.global _mod_load
; void mod_free (void* module);
; /* Free a loaded module. Note: The given pointer is the pointer to the
; * module memory, not a pointer to a control structure.
; */
.global _mod_free
; Errors
.enum
MLOAD_OK ; Module load successful
MLOAD_ERR_READ ; Read error
MLOAD_ERR_HDR ; Header error
MLOAD_ERR_OS ; Wrong OS
MLOAD_ERR_FMT ; Data format error
MLOAD_ERR_MEM ; Not enough memory
.endenum

13
asminc/module.mac Normal file
View file

@ -0,0 +1,13 @@
.ifndef DYN_DRV
DYN_DRV = 1
.endif
.macro module_header module_label
.if DYN_DRV
.segment "HEADER"
.else
.data
.export module_label
module_label:
.endif
.endmacro

184
asminc/mouse-kernel.inc Normal file
View file

@ -0,0 +1,184 @@
;/*****************************************************************************/
;/* */
;/* mouse-kernel.inc */
;/* */
;/* Mouse API */
;/* */
;/* */
;/* */
;/* (C) 2003-2009, Ullrich von Bassewitz */
;/* Roemerstrasse 52 */
;/* D-70794 Filderstadt */
;/* EMail: uz@cc65.org */
;/* */
;/* */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice may not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
;------------------------------------------------------------------------------
; Error codes
.enum
MOUSE_ERR_OK ; No error
MOUSE_ERR_NO_DRIVER ; No driver available
MOUSE_ERR_CANNOT_LOAD ; Error loading driver
MOUSE_ERR_INV_DRIVER ; Invalid driver
MOUSE_ERR_NO_DEVICE ; Mouse hardware not found
MOUSE_ERR_INV_IOCTL ; Invalid ioctl code
MOUSE_ERR_COUNT ; Special: Number of error codes
.endenum
;------------------------------------------------------------------------------
; The driver header
.struct MOUSE_HDR
ID .byte 3 ; Contains 0x6D, 0x6F, 0x75 ("mou")
VERSION .byte 1 ; Interface version
LIBREF .addr ; Library reference
JUMPTAB .struct
INSTALL .addr
UNINSTALL .addr
HIDE .addr
SHOW .addr
SETBOX .addr
GETBOX .addr
MOVE .addr
BUTTONS .addr
POS .addr
INFO .addr
IOCTL .addr
IRQ .addr
.endstruct
FLAGS .byte ; Mouse driver flags
CALLBACKS .struct ; Jump instructions
.byte ; JMP opcode
CHIDE .addr ; Jump address
.byte
CSHOW .addr
.byte
CPREP .addr
.byte
CDRAW .addr
.byte
CMOVEX .addr
.byte
CMOVEY .addr
.endstruct
.endstruct
;------------------------------------------------------------------------------
; The mouse callback structure
.struct MOUSE_CALLBACKS
HIDE .addr ; Hide the mouse cursor
SHOW .addr ; Show the mouse cursor
PREP .addr ; Prepare to move the mouse cursor
DRAW .addr ; Draw the mouse cursor
MOVEX .addr ; Move the mouse cursor to X coord
MOVEY .addr ; Move the mouse cursor to Y coord
.endstruct
;------------------------------------------------------------------------------
; The mouse API version, stored in MOUSE_HDR::VERSION
MOUSE_API_VERSION = $06
;------------------------------------------------------------------------------
; Bitmapped mouse driver flags, stored in MOUSE_HDR::FLAGS.
; Note: If neither of MOUSE_FLAG_XXX_IRQ is set, no interrupts are supplied
; to the driver. If one of the bits is set, the interrupt vector MUST be
; valid.
; Beware: Some of the bits are tested using the BIT instruction, so do not
; change the values without checking the code!
MOUSE_FLAG_EARLY_IRQ = $40 ; Enable IRQ *before* calling INSTALL
MOUSE_FLAG_LATE_IRQ = $80 ; Enable IRQ *after* calling INSTALL
;------------------------------------------------------------------------------
; Mouse button definitions
MOUSE_BTN_LEFT = $10
MOUSE_BTN_RIGHT = $01
;------------------------------------------------------------------------------
; Structures used to return data from the mouse driver
.struct MOUSE_POS
XCOORD .word
YCOORD .word
.endstruct
.struct MOUSE_INFO
POS .tag MOUSE_POS
BUTTONS .byte
.endstruct
.struct MOUSE_BOX
MINX .word
MINY .word
MAXX .word
MAXY .word
.endstruct
;------------------------------------------------------------------------------
; Variables
.global _mouse_drv ; Pointer to driver
.global _mouse_hidden ; Counter, 0 = mouse is visible
;------------------------------------------------------------------------------
; C callable functions
.global _mouse_load_driver
.global _mouse_unload
.global _mouse_install
.global _mouse_uninstall
.global _mouse_geterrormsg
.global _mouse_hide
.global _mouse_show
.global _mouse_setbox
.global _mouse_getbox
.global _mouse_move
.global _mouse_buttons
.global _mouse_pos
.global _mouse_info
.global _mouse_ioctl
.global _mouse_clear_ptr
;------------------------------------------------------------------------------
; Driver entry points (asm callable)
.global mouse_install
.global mouse_uninstall
.global mouse_hide
.global mouse_show
.global mouse_setbox
.global mouse_getbox
.global mouse_move
.global mouse_buttons
.global mouse_pos
.global mouse_info
.global mouse_ioctl

93
asminc/nes.inc Normal file
View file

@ -0,0 +1,93 @@
;
; NES definitions. By Groepaz/Hitmem.
;
;; FIXME: optimize zeropage usage
SCREEN_PTR = $62 ;2
CRAM_PTR = $64 ;2
CHARCOLOR = $66
BGCOLOR = $67
RVS = $68
CURS_X = $69
CURS_Y = $6a
tickcount = $6b ;2
VBLANK_FLAG = $70
ringbuff = $0200
ringwrite = $71
ringread = $72
ringcount = $73
ppuhi = $74
ppulo = $75
ppuval = $76
screenrows = (30-1)
charsperline = 32
xsize = charsperline
;; PPU defines
PPU_CTRL1 = $2000
PPU_CTRL2 = $2001
PPU_STATUS = $2002
PPU_SPR_ADDR = $2003
PPU_SPR_IO = $2004
PPU_VRAM_ADDR1 = $2005
PPU_VRAM_ADDR2 = $2006
PPU_VRAM_IO = $2007
;; APU defines
APU_PULSE1CTRL = $4000 ; Pulse #1 Control Register (W)
APU_PULSE1RAMP = $4001 ; Pulse #1 Ramp Control Register (W)
APU_PULSE1FTUNE = $4002 ; Pulse #1 Fine Tune (FT) Register (W)
APU_PULSE1CTUNE = $4003 ; Pulse #1 Coarse Tune (CT) Register (W)
APU_PULSE2CTRL = $4004 ; Pulse #2 Control Register (W)
APU_PULSE2RAMP = $4005 ; Pulse #2 Ramp Control Register (W)
APU_PULSE2FTUNE = $4006 ; Pulse #2 Fine Tune Register (W)
APU_PULSE2STUNE = $4007 ; Pulse #2 Coarse Tune Register (W)
APU_TRICTRL1 = $4008 ; Triangle Control Register #1 (W)
APU_TRICTRL2 = $4009 ; Triangle Control Register #2 (?)
APU_TRIFREQ1 = $400A ; Triangle Frequency Register #1 (W)
APU_TRIFREQ2 = $400B ; Triangle Frequency Register #2 (W)
APU_NOISECTRL = $400C ; Noise Control Register #1 (W)
;;APU_ = $400D ; Unused (???)
APU_NOISEFREQ1 = $400E ; Noise Frequency Register #1 (W)
APU_NOISEFREQ2 = $400F ; Noise Frequency Register #2 (W)
APU_MODCTRL = $4010 ; Delta Modulation Control Register (W)
APU_MODDA = $4011 ; Delta Modulation D/A Register (W)
APU_MODADDR = $4012 ; Delta Modulation Address Register (W)
APU_MODLEN = $4013 ; Delta Modulation Data Length Register (W)
APU_SPR_DMA = $4014 ; Sprite DMA Register (W)
APU_CHANCTRL = $4015 ; Sound/Vertical Clock Signal Register (R)
APU_PAD1 = $4016 ; Joypad #1 (RW)
APU_PAD2 = $4017 ; Joypad #2/SOFTCLK (RW)
CH_HLINE = 11
CH_VLINE = 14
CH_ULCORNER = 176
CH_URCORNER = 174
CH_LLCORNER = 173
CH_LRCORNER = 189
CH_TTEE = 178
CH_RTEE = 179
CH_BTEE = 177
CH_LTEE = 171
CH_CROSS = 123
CH_CURS_UP = 145
CH_CURS_DOWN = 17
CH_CURS_LEFT = 157
CH_CURS_RIGHT = 29
CH_PI = 126
CH_DEL = 20
CH_INS = 148
CH_ENTER = 10
CH_STOP = 3
CH_ESC = 27

150
asminc/o65.inc Normal file
View file

@ -0,0 +1,150 @@
;*****************************************************************************/
;* */
;* o65.inc */
;* */
;* Definitions for the o65 file format */
;* */
;* */
;* */
;* (C) 2002-2009, Ullrich von Bassewitz */
;* Roemerstrasse 52 */
;* D-70794 Filderstadt */
;* EMail: uz@cc65.org */
;* */
;* */
;* This software is provided 'as-is', without any expressed or implied */
;* warranty. In no event will the authors be held liable for any damages */
;* arising from the use of this software. */
;* */
;* Permission is granted to anyone to use this software for any purpose, */
;* including commercial applications, and to alter it and redistribute it */
;* freely, subject to the following restrictions: */
;* */
;* 1. The origin of this software must not be misrepresented; you must not */
;* claim that you wrote the original software. If you use this software */
;* in a product, an acknowledgment in the product documentation would be */
;* appreciated but is not required. */
;* 2. Altered source versions must be plainly marked as such, and must not */
;* be misrepresented as being the original software. */
;* 3. This notice may not be removed or altered from any source */
;* distribution. */
;* */
;*****************************************************************************/
; This files exports structures and constants to handle the o65 relocatable
; file format as defined by Andre Fachat.
; The o65 header structure (6502 format)
.struct O65_HDR
MARKER .byte 2 ; Non-C64 marker: $01 $00
MAGIC .byte 3 ; o65 magic: "o65"
VERSION .byte 1 ; Version number
MODE .word ; Mode word
TBASE .word ; Original text (code) segment address
TLEN .word ; Size of text (code) segment
DBASE .word ; Original data segment address
DLEN .word ; Size of data segment
BBASE .word ; Original bss segment address
BLEN .word ; Size of bss segment
ZBASE .word ; Original zp segment address
ZLEN .word ; Size of zp segment
STACK .word ; Stacksize needed
.endstruct
; Marker, magic and version number
O65_MARKER_0 = $01
O65_MARKER_1 = $00
O65_MAGIC_0 = $6F ; 'o'
O65_MAGIC_1 = $36 ; '6'
O65_MAGIC_2 = $35 ; '5'
O65_VERSION = $00
; Defines for the mode word
O65_CPU_65816 = $8000 ; Executable is for 65816
O65_CPU_6502 = $0000 ; Executable is for the 6502
O65_CPU_MASK = $8000 ; Mask to extract CPU type
O65_RELOC_PAGE = $4000 ; Page wise relocation
O65_RELOC_BYTE = $0000 ; Byte wise relocation
O65_RELOC_MASK = $4000 ; Mask to extract relocation type
O65_SIZE_32BIT = $2000 ; All size words are 32bit
O65_SIZE_16BIT = $0000 ; All size words are 16bit
O65_SIZE_MASK = $2000 ; Mask to extract size
O65_FTYPE_OBJ = $1000 ; Object file
O65_FTYPE_EXE = $0000 ; Executable file
O65_FTYPE_MASK = $1000 ; Mask to extract type
O65_ADDR_SIMPLE = $0800 ; Simple addressing
O65_ADDR_DEFAULT = $0000 ; Default addressing
O65_ADDR_MASK = $0800 ; Mask to extract addressing
O65_CHAIN = $0400 ; Chained file, another one follows
O65_CHAIN_MASK = $0400 ; Mask to extract chain flag
O65_BSSZERO = $0200 ; BSS segment must be zeroed
O65_BSSZERO_MASK = $0200 ; Mask to extract bss zero flag
; The following is used if O65_CPU == 6502
O65_CPU2_6502 = $0000 ; Executable is for 6502
O65_CPU2_65C02 = $0010 ; Executable is for 65C02
O65_CPU2_65SC02 = $0020 ; Executable is for 65SC02
O65_CPU2_65CE02 = $0030 ; Executable is for 65CE02
O65_CPU2_6502X = $0040 ; Executable is for NMOS 6502
O65_CPU2_65816_EMU = $0050 ; Executable is for 65816 in emul mode
O65_CPU2_MASK = $00F0 ; Mask to extract CPU2 field
O65_ALIGN_1 = $0000 ; Bytewise alignment
O65_ALIGN_2 = $0001 ; Align words
O65_ALIGN_4 = $0002 ; Align longwords
O65_ALIGN_256 = $0003 ; Align pages (256 bytes)
O65_ALIGN_MASK = $0003 ; Mask to extract alignment
; The mode word as generated by the ld65 linker
O65_MODE_CC65 = O65_CPU_6502 | O65_RELOC_BYTE | O65_SIZE_16BIT | O65_FTYPE_EXE | O65_ADDR_SIMPLE | O65_ALIGN_1
; Relocation type codes
O65_RTYPE_WORD = $80
O65_RTYPE_HIGH = $40
O65_RTYPE_LOW = $20
O65_RTYPE_SEGADDR = $C0
O65_RTYPE_SEG = $A0
O65_RTYPE_MASK = $E0
; Segment IDs
O65_SEGID_UNDEF = $00
O65_SEGID_ABS = $01
O65_SEGID_TEXT = $02
O65_SEGID_DATA = $03
O65_SEGID_BSS = $04
O65_SEGID_ZP = $05
O65_SEGID_MASK = $07
; Option tags
O65_OPT_FILENAME = 0
O65_OPT_OS = 1
O65_OPT_ASM = 2
O65_OPT_AUTHOR = 3
O65_OPT_TIMESTAMP = 4
; Operating system codes for O65_OPT_OS
O65_OS_OSA65 = 1
O65_OS_LUNIX = 2
O65_OS_CC65 = 3
O65_OS_OPENCBM = 4
; Load errors
O65_LOAD_OK = 0 ; Module load successful
O65_LOAD_ERR_READ = 1 ; Read error
O65_LOAD_ERR_HDR = 2 ; Header error
O65_LOAD_ERR_OS = 3 ; Wrong OS
O65_LOAD_ERR_FMT = 4 ; Data format error
O65_LOAD_ERR_MEM = 5 ; Not enough memory

514
asminc/opcodes.inc Normal file
View file

@ -0,0 +1,514 @@
; opcodes.inc
; ca65 6502 - opcode definitions, mainly for self modifying code
;
; Christian Krüger, latest change: 18-Sep-2010
;
; This software is provided 'as-is', without any expressed or implied
; warranty. In no event will the authors be held liable for any damages
; arising from the use of this software.
;
; Permission is granted to anyone to use this software for any purpose,
; including commercial applications, and to alter it and redistribute it
; freely, subject to the following restrictions:
;
; 1. The origin of this software must not be misrepresented; you must not
; claim that you wrote the original software. If you use this software
; in a product, an acknowledgment in the product documentation would be
; appreciated but is not required.
; 2. Altered source versions must be plainly marked as such, and must not
; be misrepresented as being the original software.
; 3. This notice may not be removed or altered from any source
; distribution.
;
; Opcode-Table
; ------------
; Post fix explanation:
; imm = #$00
; zp = $00
; zpx = $00,X
; zpy = $00,Y
; izp = ($00)
; izx = ($00,X)
; izy = ($00),Y
; abs = $0000
; abx = $0000,X
; aby = $0000,Y
; ind = ($0000)
; iax = ($0000,X)
; rel = $0000 (PC-relative) (supressed here)
OPC_BRK = $00
OPC_ORA_izx = $01
OPC_ORA_zp = $05
OPC_ASL_zp = $06
OPC_PHP = $08
OPC_ORA_imm = $09
OPC_ASL = $0A
OPC_ORA_abs = $0D
OPC_ASL_abs = $0E
OPC_BPL = $10
OPC_ORA_izy = $11
OPC_ORA_zpx = $15
OPC_ASL_zpx = $16
OPC_CLC = $18
OPC_ORA_aby = $19
OPC_ORA_abx = $1D
OPC_ASL_abx = $1E
OPC_JSR_abs = $20
OPC_AND_izx = $21
OPC_BIT_zp = $24
OPC_AND_zp = $25
OPC_ROL_zp = $26
OPC_PLP = $28
OPC_AND_imm = $29
OPC_ROL = $2A
OPC_BIT_abs = $2C
OPC_AND_abs = $2D
OPC_ROL_abs = $2E
OPC_BMI = $30
OPC_AND_izy = $31
OPC_AND_zpx = $35
OPC_ROL_zpx = $36
OPC_SEC = $38
OPC_AND_aby = $39
OPC_AND_abx = $3D
OPC_ROL_abx = $3E
OPC_RTI = $40
OPC_EOR_izx = $41
OPC_EOR_zp = $45
OPC_LSR_zp = $46
OPC_PHA = $48
OPC_EOR_imm = $49
OPC_LSR = $4A
OPC_JMP_abs = $4C
OPC_EOR_abs = $4D
OPC_LSR_abs = $4E
OPC_BVC = $50
OPC_EOR_izy = $51
OPC_EOR_zpx = $55
OPC_LSR_zpx = $56
OPC_CLI = $58
OPC_EOR_aby = $59
OPC_EOR_abx = $5D
OPC_LSR_abx = $5E
OPC_RTS = $60
OPC_ADC_izx = $61
OPC_ADC_zp = $65
OPC_ROR_zp = $66
OPC_PLA = $68
OPC_ADC_imm = $69
OPC_ROR = $6A
OPC_JMP_ind = $6C
OPC_ADC_abs = $6D
OPC_ROR_abs = $6E
OPC_BVS = $70
OPC_ADC_izy = $71
OPC_ADC_zpx = $75
OPC_ROR_zpx = $76
OPC_SEI = $78
OPC_ADC_aby = $79
OPC_ADC_abx = $7D
OPC_ROR_abx = $7E
OPC_STA_izx = $81
OPC_STY_zp = $84
OPC_STA_zp = $85
OPC_STX_zp = $86
OPC_DEY = $88
OPC_TXA = $8A
OPC_STY_abs = $8C
OPC_STA_abs = $8D
OPC_STX_abs = $8E
OPC_BCC = $90
OPC_STA_izy = $91
OPC_STY_zpx = $94
OPC_STA_zpx = $95
OPC_STX_zpy = $96
OPC_TYA = $98
OPC_STA_aby = $99
OPC_TXS = $9A
OPC_STA_abx = $9D
OPC_LDY_imm = $A0
OPC_LDA_izx = $A1
OPC_LDX_imm = $A2
OPC_LDY_zp = $A4
OPC_LDA_zp = $A5
OPC_LDX_zp = $A6
OPC_TAY = $A8
OPC_LDA_imm = $A9
OPC_TAX = $AA
OPC_LDY_abs = $AC
OPC_LDA_abs = $AD
OPC_LDX_abs = $AE
OPC_BCS = $B0
OPC_LDA_izy = $B1
OPC_LDY_zpx = $B4
OPC_LDA_zpx = $B5
OPC_LDX_zpy = $B6
OPC_CLV = $B8
OPC_LDA_aby = $B9
OPC_TSX = $BA
OPC_LDY_abx = $BC
OPC_LDA_abx = $BD
OPC_LDX_aby = $BE
OPC_CPY_imm = $C0
OPC_CMP_izx = $C1
OPC_CPY_zp = $C4
OPC_CMP_zp = $C5
OPC_DEC_zp = $C6
OPC_INY = $C8
OPC_CMP_imm = $C9
OPC_DEX = $CA
OPC_CPY_abs = $CC
OPC_CMP_abs = $CD
OPC_DEC_abs = $CE
OPC_BNE = $D0
OPC_CMP_izy = $D1
OPC_CMP_zpx = $D5
OPC_DEC_zpx = $D6
OPC_CLD = $D8
OPC_CMP_aby = $D9
OPC_CMP_abx = $DD
OPC_DEC_abx = $DE
OPC_CPX_imm = $E0
OPC_SBC_izx = $E1
OPC_CPX_zp = $E4
OPC_SBC_zp = $E5
OPC_INC_zp = $E6
OPC_INX = $E8
OPC_SBC_imm = $E9
OPC_NOP = $EA
OPC_CPX_abs = $EC
OPC_SBC_abs = $ED
OPC_INC_abs = $EE
OPC_BEQ = $F0
OPC_SBC_izy = $F1
OPC_SBC_zpx = $F5
OPC_INC_zpx = $F6
OPC_SED = $F8
OPC_SBC_aby = $F9
OPC_SBC_abx = $FD
OPC_INC_abx = $FE
.if (.cpu .bitand ::CPU_ISET_65SC02)
; OPC_NOP = $02 ; doublet
; OPC_NOP = $03 ; doublet
OPC_TSB_zp = $04
; OPC_NOP = $0B ; doublet
OPC_TSB_abs = $0C
OPC_ORA_izp = $12
; OPC_NOP = $13 ; doublet
OPC_TRB_zp = $14
OPC_INC = $1A
; OPC_NOP = $1B ; doublet
OPC_TRB_abs = $1C
; OPC_NOP = $22 ; doublet
; OPC_NOP = $23 ; doublet
; OPC_NOP = $2B ; doublet
OPC_AND_izp = $32
; OPC_NOP = $33 ; doublet
OPC_BIT_zpx = $34
OPC_DEC = $3A
; OPC_NOP = $3B ; doublet
OPC_BIT_abx = $3C
; OPC_NOP = $42 ; doublet
; OPC_NOP = $43 ; doublet
; OPC_NOP = $44 ; doublet
; OPC_NOP = $4B ; doublet
OPC_EOR_izp = $52
; OPC_NOP = $53 ; doublet
; OPC_NOP = $54 ; doublet
; OPC_NOP = $5A ; doublet
; OPC_NOP = $5B ; doublet
; OPC_NOP = $62 ; doublet
; OPC_NOP = $63 ; doublet
OPC_STZ_zp = $64
; OPC_NOP = $6B ; doublet
OPC_ADC_izp = $72
; OPC_NOP = $73 ; doublet
OPC_STZ_zpx = $74
OPC_PLY = $7A
; OPC_NOP = $7B ; doublet
OPC_JMP_iax = $7C
OPC_BRA = $80
; OPC_NOP = $82 ; doublet
; OPC_NOP = $83 ; doublet
OPC_BIT_imm = $89
; OPC_NOP = $8B ; doublet
OPC_STA_izp = $92
; OPC_NOP = $93 ; doublet
; OPC_NOP = $9B ; doublet
OPC_STZ_abs = $9C
OPC_STZ_abx = $9E
; OPC_NOP = $A3 ; doublet
; OPC_NOP = $AB ; doublet
OPC_LDA_izp = $B2
; OPC_NOP = $B3 ; doublet
; OPC_NOP = $BB ; doublet
; OPC_NOP = $C2 ; doublet
; OPC_NOP = $C3 ; doublet
; OPC_NOP = $CB ; doublet
OPC_CMP_izp = $D2
; OPC_NOP = $D3 ; doublet
; OPC_NOP = $D4 ; doublet
OPC_PHX = $DA
; OPC_NOP = $DB ; doublet
; OPC_NOP = $DC ; doublet
; OPC_NOP = $E2 ; doublet
; OPC_NOP = $E3 ; doublet
; OPC_NOP = $EB ; doublet
OPC_SBC_izp = $F2
; OPC_NOP = $F3 ; doublet
; OPC_NOP = $F4 ; doublet
OPC_PLX = $FA
; OPC_NOP = $FB ; doublet
; OPC_NOP = $FC ; doublet
.if (.cpu .bitand ::CPU_ISET_65C02)
; bit instructions for 65C02
OPC_RMB0 = $07
OPC_RMB1 = $17
OPC_RMB2 = $27
OPC_RMB3 = $37
OPC_RMB4 = $47
OPC_RMB5 = $57
OPC_RMB6 = $67
OPC_RMB7 = $77
OPC_SMB0 = $87
OPC_SMB1 = $97
OPC_SMB2 = $A7
OPC_SMB3 = $B7
OPC_SMB4 = $C7
OPC_SMB5 = $D7
OPC_SMB6 = $E7
OPC_SMB7 = $F7
OPC_BBR0 = $0F
OPC_BBR1 = $1F
OPC_BBR2 = $2F
OPC_BBR3 = $3F
OPC_BBR4 = $4F
OPC_BBR5 = $5F
OPC_BBR6 = $6F
OPC_BBR7 = $7F
OPC_BBS0 = $8F
OPC_BBS1 = $9F
OPC_BBS2 = $AF
OPC_BBS3 = $BF
OPC_BBS4 = $CF
OPC_BBS5 = $DF
OPC_BBS6 = $EF
OPC_BBS7 = $FF
.else
; no bit instructions for 65SC02
; OPC_NOP = $07 ; doublet
; OPC_NOP = $17 ; doublet
; OPC_NOP = $27 ; doublet
; OPC_NOP = $37 ; doublet
; OPC_NOP = $47 ; doublet
; OPC_NOP = $57 ; doublet
; OPC_NOP = $67 ; doublet
; OPC_NOP = $77 ; doublet
; OPC_NOP = $87 ; doublet
; OPC_NOP = $97 ; doublet
; OPC_NOP = $A7 ; doublet
; OPC_NOP = $B7 ; doublet
; OPC_NOP = $C7 ; doublet
; OPC_NOP = $D7 ; doublet
; OPC_NOP = $E7 ; doublet
; OPC_NOP = $F7 ; doublet
; OPC_NOP = $0F ; doublet
; OPC_NOP = $1F ; doublet
; OPC_NOP = $2F ; doublet
; OPC_NOP = $3F ; doublet
; OPC_NOP = $4F ; doublet
; OPC_NOP = $5F ; doublet
; OPC_NOP = $6F ; doublet
; OPC_NOP = $7F ; doublet
; OPC_NOP = $8F ; doublet
; OPC_NOP = $9F ; doublet
; OPC_NOP = $AF ; doublet
; OPC_NOP = $BF ; doublet
; OPC_NOP = $CF ; doublet
; OPC_NOP = $DF ; doublet
; OPC_NOP = $EF ; doublet
; OPC_NOP = $FF ; doublet
.endif
.elseif (.cpu .bitand ::CPU_ISET_6502X)
; stable, undocumented opcodes
; OPC_KIL = $02 ; unstable
OPC_SLO_izx = $03
OPC_NOP_zp = $04
OPC_SLO_zp = $07
OPC_ANC_imm = $0B
OPC_NOP_abs = $0C
OPC_SLO_abs = $0F
; OPC_KIL = $12 ; unstable
OPC_SLO_izy = $13
OPC_NOP_zpx = $14
OPC_SLO_zpx = $17
;OPC_NOP = $1A
OPC_SLO_aby = $1B
OPC_NOP_abx = $1C
OPC_SLO_abx = $1F
; OPC_KIL = $22 ; unstable
OPC_RLA_izx = $23
OPC_RLA_zp = $27
OPC_ANC_imm = $2B
OPC_RLA_abs = $2F
; OPC_KIL = $32 ; unstable
OPC_RLA_izy = $33
OPC_NOP_zpx = $34
OPC_RLA_zpx = $37
; OPC_NOP = $3A ; doublet
OPC_RLA_aby = $3B
OPC_NOP_abx = $3C
OPC_RLA_abx = $3F
; OPC_KIL = $42 ; unstable
OPC_SRE_izx = $43
OPC_NOP_zp = $44
OPC_SRE_zp = $47
OPC_ALR_imm = $4B
OPC_SRE_abs = $4F
; OPC_KIL = $52 ; unstable
OPC_SRE_izy = $53
OPC_NOP_zpx = $54
OPC_SRE_zpx = $57
; OPC_NOP = $5A ; doublet
OPC_SRE_aby = $5B
OPC_NOP_abx = $5C
OPC_SRE_abx = $5F
; OPC_KIL = $62
OPC_RRA_izx = $63
OPC_NOP_zp = $64
OPC_RRA_zp = $67
OPC_ARR_imm = $6B
OPC_RRA_abs = $6F
; OPC_KIL = $72
OPC_RRA_izy = $73
OPC_NOP_zpx = $74
OPC_RRA_zpx = $77
; OPC_NOP = $7A ; doublet
OPC_RRA_aby = $7B
OPC_NOP_abx = $7C
OPC_RRA_abx = $7F
OPC_NOP_imm = $80
; OPC_NOP_imm = $82 ; doublet
OPC_SAX_izx = $83
OPC_SAX_zp = $87
; OPC_NOP_imm = $89 ; doublet
; OPC_XAA = $8B ; unstable
OPC_SAX_abs = $8F
; OPC_KIL = $92 ; unstable
; OPC_AHX_izy = $93 ; unstable
OPC_SAX_zpy = $97
; OPC_TAS_aby = $9B ; unstable
; OPC_SHY_abx = $9C ; unstable
; OPC_SHX_aby = $9E ; unstable
; OPC_AHX_aby = $9F ; unstable
OPC_LAX_izx = $A3
OPC_LAX_zp = $A7
; OPC_LAX_imm = $AB ; unstable
OPC_LAX_abs = $AF
; OPC_KIL = $B2 ; unstable
OPC_LAX_izy = $B3
OPC_LAX_zpy = $B7
OPC_LAS_aby = $BB
OPC_LAX_aby = $BF
; OPC_NOP_imm = $C2 ; doublet
OPC_DCP_izx = $C3
OPC_DCP_zp = $C7
OPC_AXS_imm = $CB
OPC_DCP_abs = $CF
; OPC_KIL = $D2 ; unstable
OPC_DCP_izy = $D3
OPC_NOP_zpx = $D4
OPC_DCP_zpx = $D7
OPC_NOP_DA = $DA
OPC_DCP_aby = $DB
OPC_NOP_abx = $DC
OPC_DCP_abx = $DF
; OPC_NOP_imm = $E2 ; doublet
OPC_ISC_izx = $E3
OPC_ISC_zp = $E7
; OPC_SBC_imm = $EB ; doublet
OPC_ISC_abs = $EF
; OPC_KIL = $F2 ; unstable
OPC_ISC_izy = $F3
OPC_NOP_zpx = $F4
OPC_ISC_zpx = $F7
OPC_NOP_FA = $FA
OPC_ISC_aby = $FB
OPC_NOP_abx = $FC
OPC_ISC_abx = $FF
.if (.cpu .bitand ::CPU_ISET_6502DTV)
OPC_BRA = $12
OPC_SAC_imm = $32
OPC_SIR_imm = $42
.endif
.endif

93
asminc/pce.inc Normal file
View file

@ -0,0 +1,93 @@
;
; PCE definitions. By Groepaz/Hitmen.
;
; FIXME: Screen dimensions can change according to the selected video mode.
screenrows = (224/8)
charsperline = 61
CH_HLINE = 1
CH_VLINE = 2
; HuC6270 -- Video Display Controller (VDC)
VDC_MAWR = 0 ; Memory Address Write Register
VDC_MARR = 1 ; Memory Address Read Register
VDC_VWR = 2 ; VRAM Write Register
VDC_VRR = 2 ; VRAM Read Register
VDC_UNK03 = 3 ; (unknown)
VDC_UNK04 = 4 ; (unknown)
VDC_CR = 5 ; Control Register
VDC_RCR = 6 ; Raster Counter Register
VDC_BXR = 7 ; Background X-Scroll Register
VDC_BYR = 8 ; Background Y-Scroll Register
VDC_MWR = 9 ; Memory-access Width Register
VDC_HSR = 10 ; Horizontal Sync Register
VDC_HDR = 11 ; Horizontal Display Register
VDC_VSR = 12 ; Vertical sync Register
VDC_VDR = 13 ; Vertical Display register
VDC_VCR = 14 ; Vertical display END position register
VDC_DCR = 15 ; (DMA) Control Register
VDC_SOUR = 16 ; (DMA) Source Register
VDC_DESR = 17 ; (DMA) Destination Register
VDC_LENR = 18 ; (DMA) Length Register
VDC_SATB = 19 ; Sprite Attribute Table
; VDC port
; Note: The zero-page addressing mode is redirected to page $20.
; We avoid it by using mirror locations that are outside of the zero page.
VDC_CTRL := $0200
VDC_DATA_LO := $0202
VDC_DATA_HI := $0203
; HuC6260 -- Video Color Encoder (VCE)
; The DAC has a palette of 512 colours.
; The bitmap of that data is 0000000gggrrrbbb (Green, Red, Blue).
; You can read and write the DAC registers.
VCE := $0400 ; base
VCE_CTRL := $0400 ; write $00 to reset
VCE_ADDR_LO := $0402 ; LSB of byte offset into palette
VCE_ADDR_HI := $0403 ; MSB of byte offset into palette
VCE_DATA_LO := $0404 ; LSB of 16-bit palette data
VCE_DATA_HI := $0405 ; MSB of 16-bit palette data
; Programmable Sound Generator (PSG)
PSG := $0800 ; base
PSG_CHAN_SELECT := $0800
PSG_GLOBAL_PAN := $0801
PSG_FREQ_LO := $0802
PSG_FREQ_HI := $0803
PSG_CHAN_CTRL := $0804
PSG_CHAN_PAN := $0805
PSG_CHAN_DATA := $0806
PSG_NOISE := $0807
PSG_LFO_FREQ := $0808
PSG_LFO_CTRL := $0809
; Timer
TIMER := $0C00 ; base
TIMER_COUNT := $0C00
TIMER_CTRL := $0C01
JOY_CTRL := $1000
IRQ_MASK := $1402
IRQ_STATUS := $1403
CDR_MEM_DISABLE := $1803
CDR_MEM_ENABLE := $1807
; Write to a VDC register.
.macro VREG arg1, arg2
st0 #arg1
st1 #<(arg2)
st2 #>(arg2)
.endmacro

100
asminc/pet.inc Normal file
View file

@ -0,0 +1,100 @@
;
; PET generic definitions.
;
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
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
CURS_BLINK := $A8 ; Blink counter
CURS_CHAR := $A9 ; Character under the cursor
CURS_STATE := $AA ; Cursor blink state
SCREEN_PTR := $C4 ; Pointer to current char in text screen
CURS_X := $C6 ; Cursor column
FNLEN := $D1 ; Length of filename
LFN := $D2 ; Current Logical File Number
SECADR := $D3 ; Secondary address
DEVNUM := $D4 ; Device number
SCR_LINELEN := $D5 ; Screen line length
CURS_Y := $D8 ; Cursor row
FNADR := $DA ; Pointer to file name
; 80-Column CBMs
KBDREPEAT80 := $E4
KBDRPTRATE80 := $E5
KBDRPTDELAY80 := $E6
BASIC_BUF := $200 ; Location of command-line
BASIC_BUF_LEN = 81 ; Maximum length of command-line
KEY_BUF := $26F ; Keyboard buffer
; 40-Column PETs/CBMs
KBDRPTDELAY40 := $3E9
KBDRPTRATE40 := $3EA
KBDREPEAT40 := $3EE
KBDREPEAT40B := $3F8
;----------------------------------------------------------------------------
; PET ROM type detection
PET_DETECT := $FFFB
PET_2000 = $CA
PET_3000 = $FC
PET_4000 = $FD
;----------------------------------------------------------------------------
; Vector and other locations
IRQVec := $0090
BRKVec := $0092
NMIVec := $0094
; ---------------------------------------------------------------------------
; I/O: 6520 PIA1
PIA1 := $E810 ; PIA1 base address
PIA1_PORTA := PIA1+$0 ; Port A (PA) and data direction register A (DDRA)
PIA1_PACTL := PIA1+$1 ; Port A control register (CRA)
PIA1_PORTB := PIA1+$2 ; Port B (PB) and data direction register B (DDRB)
PIA1_PBCTL := PIA1+$3 ; Port B control register (CRB)
; ---------------------------------------------------------------------------
; I/O: 6520 PIA2
PIA2 := $E820 ; PIA2 base address
PIA2_PORTA := PIA2+$0 ; Port A (PA) and data direction register A (DDRA)
PIA2_PACTL := PIA2+$1 ; Port A control register (CRA)
PIA2_PORTB := PIA2+$2 ; Port B (PB) and data direction register B (DDRB)
PIA2_PBCTL := PIA2+$3 ; Port B control register (CRB)
; ---------------------------------------------------------------------------
; I/O: 6522 VIA
VIA := $E840 ; VIA base address
VIA_PB := VIA+$0 ; Port register B
VIA_PA1 := VIA+$1 ; Port register A
VIA_PRB := VIA+$0 ; *** Deprecated ***
VIA_PRA := VIA+$1 ; *** Deprecated ***
VIA_DDRB := VIA+$2 ; Data direction register B
VIA_DDRA := VIA+$3 ; Data direction register A
VIA_T1CL := VIA+$4 ; Timer 1, low byte
VIA_T1CH := VIA+$5 ; Timer 1, high byte
VIA_T1LL := VIA+$6 ; Timer 1 latch, low byte
VIA_T1LH := VIA+$7 ; Timer 1 latch, high byte
VIA_T2CL := VIA+$8 ; Timer 2, low byte
VIA_T2CH := VIA+$9 ; Timer 2, high byte
VIA_SR := VIA+$A ; Shift register
VIA_CR := VIA+$B ; Auxiliary control register
VIA_PCR := VIA+$C ; Peripheral control register
VIA_IFR := VIA+$D ; Interrupt flag register
VIA_IER := VIA+$E ; Interrupt enable register
VIA_PA2 := VIA+$F ; Port register A w/o handshake

86
asminc/plus4.inc Normal file
View file

@ -0,0 +1,86 @@
;
; Plus/4 generic definitions.
;
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
TMPPTR := $22 ; Temporary ptr used by BASIC
VARTAB := $2D ; Pointer to start of BASIC variables
MEMSIZE := $37 ; Pointer to highest BASIC RAM location (+1)
TXTPTR := $3B ; Pointer into BASIC source code
STATUS := $90 ; Kernal I/O completion status
TIME := $A3 ; 60HZ clock
FNAM_LEN := $AB ; Length of filename
LFN := $AC ; Logical file number
SECADR := $AD ; Secondary address
DEVNUM := $AE ; Device number
FNAM := $AF ; Pointer to filename for OPEN
KEY_COUNT := $EF ; Number of keys in input buffer
RVS := $C2 ; Reverse flag
CURS_X := $CA ; Cursor column
CURS_Y := $CD ; Cursor row
SCREEN_PTR := $C8 ; Pointer to current char in text screen
CRAM_PTR := $EA ; Pointer to current char in color RAM
BASIC_BUF := $200 ; Location of command-line
BASIC_BUF_LEN = 89 ; Maximum length of command-line
FNBUF := $25E ; Buffer for filename
FETCH := $494 ; lda (zp),y from RAM
CHARCOLOR := $53B
FKEY_COUNT := $55D ; Characters for function key
FKEY_SPACE := $55F ; Function key definitions
FKEY_ORIG := $F3D2 ; Original definitions
KBDREPEAT := $540
KBDREPEATRATE := $541
KBDREPEATDELAY := $542
; ---------------------------------------------------------------------------
; Vector and other locations
IRQVec := $0314
BRKVec := $0316
NMIVec := $0318
; ---------------------------------------------------------------------------
; Screen size
XSIZE = 40
YSIZE = 25
; ---------------------------------------------------------------------------
; I/O
TED_T1LO := $FF00
TED_T1HI := $FF01
TED_T2LO := $FF02
TED_T2HI := $FF03
TED_T3LO := $FF04
TED_T4HI := $FF05
TED_MULTI1 := $FF07
TED_KBD := $FF08
TED_CURSHI := $FF0C
TED_CURSLO := $FF0D
TED_V1FRQLO := $FF0E
TED_V2FRQLO := $FF0F
TED_V2FRQHI := $FF10
TED_CLK := $FF13
TED_BGCOLOR := $FF15
TED_COLOR1 := $FF16
TED_COLOR2 := $FF17
TED_COLOR3 := $FF18
TED_BORDERCOLOR := $FF19
TED_VLINEHI := $FF1C
TED_VLINELO := $FF1D
TED_HPOS := $FF1E
TED_ROMSEL := $FF3E
TED_RAMSEL := $FF3F
; ---------------------------------------------------------------------------
; RAM/ROM selection addresses
ENABLE_ROM := TED_ROMSEL
ENABLE_RAM := TED_RAMSEL

94
asminc/rp6502.inc Normal file
View file

@ -0,0 +1,94 @@
; Picocomputer 6502 general defines
; RIA UART
RIA_READY := $FFE0 ; TX=$80 RX=$40
RIA_TX := $FFE1
RIA_RX := $FFE2
; VSYNC from PIX VGA
RIA_VSYNC := $FFE3
; RIA XRAM portal 0
RIA_RW0 := $FFE4
RIA_STEP0 := $FFE5
RIA_ADDR0 := $FFE6
; RIA XRAM portal 1
RIA_RW1 := $FFE8
RIA_STEP1 := $FFE9
RIA_ADDR1 := $FFEA
; RIA OS fastcall
RIA_XSTACK := $FFEC
RIA_ERRNO := $FFED
RIA_OP := $FFEF
RIA_IRQ := $FFF0
RIA_SPIN := $FFF1
RIA_BUSY := $FFF2 ; Bit $80
RIA_A := $FFF4
RIA_X := $FFF6
RIA_SREG := $FFF8
; RIA OS operation numbers
RIA_OP_EXIT := $FF
RIA_OP_ZXSTACK := $00
RIA_OP_XREG := $01
RIA_OP_PHI2 := $02
RIA_OP_CODE_PAGE := $03
RIA_OP_LRAND := $04
RIA_OP_STDIN_OPT := $05
RIA_OP_ERRNO_OPT := $06
RIA_OP_CLOCK := $0F
RIA_OP_CLOCK_GETRES := $10
RIA_OP_CLOCK_GETTIME := $11
RIA_OP_CLOCK_SETTIME := $12
RIA_OP_CLOCK_GETTIMEZONE := $13
RIA_OP_OPEN := $14
RIA_OP_CLOSE := $15
RIA_OP_READ_XSTACK := $16
RIA_OP_READ_XRAM := $17
RIA_OP_WRITE_XSTACK := $18
RIA_OP_WRITE_XRAM := $19
RIA_OP_LSEEK := $1A
RIA_OP_LSEEK_CC65 := $1A
RIA_OP_UNLINK := $1B
RIA_OP_RENAME := $1C
RIA_OP_LSEEK_LLVM := $1D
RIA_OP_SYNCFS := $1E
RIA_OP_STAT := $1F
RIA_OP_OPENDIR := $20
RIA_OP_READDIR := $21
RIA_OP_CLOSEDIR := $22
RIA_OP_TELLDIR := $23
RIA_OP_SEEKDIR := $24
RIA_OP_REWINDDIR := $25
RIA_OP_CHMOD := $26
RIA_OP_UTIME := $27
RIA_OP_MKDIR := $28
RIA_OP_CHDIR := $29
RIA_OP_CHDRIVE := $2A
RIA_OP_GETCWD := $2B
RIA_OP_SETLABEL := $2C
RIA_OP_GETLABEL := $2D
RIA_OP_GETFREE := $2E
; 6522 VIA
VIA := $FFD0 ; VIA base address
VIA_PB := VIA+$0 ; Port register B
VIA_PA1 := VIA+$1 ; Port register A
VIA_PRB := VIA+$0 ; *** Deprecated ***
VIA_PRA := VIA+$1 ; *** Deprecated ***
VIA_DDRB := VIA+$2 ; Data direction register B
VIA_DDRA := VIA+$3 ; Data direction register A
VIA_T1CL := VIA+$4 ; Timer 1, low byte
VIA_T1CH := VIA+$5 ; Timer 1, high byte
VIA_T1LL := VIA+$6 ; Timer 1 latch, low byte
VIA_T1LH := VIA+$7 ; Timer 1 latch, high byte
VIA_T2CL := VIA+$8 ; Timer 2, low byte
VIA_T2CH := VIA+$9 ; Timer 2, high byte
VIA_SR := VIA+$A ; Shift register
VIA_CR := VIA+$B ; Auxiliary control register
VIA_PCR := VIA+$C ; Peripheral control register
VIA_IFR := VIA+$D ; Interrupt flag register
VIA_IER := VIA+$E ; Interrupt enable register
VIA_PA2 := VIA+$F ; Port register A w/o handshake

55
asminc/ser-error.inc Normal file
View file

@ -0,0 +1,55 @@
;****************************************************************************
;* *
;* ser-error.inc *
;* *
;* Serial communication API *
;* *
;* *
;* *
;* (C) 2003-2012, Ullrich von Bassewitz *
;* Roemerstrasse 52 *
;* D-70794 Filderstadt *
;* EMail: uz@cc65.org *
;* *
;* *
;*This software is provided 'as-is', without any expressed or implied *
;*warranty. In no event will the authors be held liable for any damages *
;*arising from the use of this software. *
;* *
;*Permission is granted to anyone to use this software for any purpose, *
;*including commercial applications, and to alter it and redistribute it *
;*freely, subject to the following restrictions: *
;* *
;*1. The origin of this software must not be misrepresented; you must not *
;* claim that you wrote the original software. If you use this software *
;* in a product, an acknowledgment in the product documentation would be *
;* appreciated but is not required. *
;*2. Altered source versions must be plainly marked as such, and must not *
;* be misrepresented as being the original software. *
;*3. This notice may not be removed or altered from any source *
;* distribution. *
;* *
;****************************************************************************
;------------------------------------------------------------------------------
; Error codes
.enum
SER_ERR_OK ; Not an error - relax
SER_ERR_NO_DRIVER ; No driver available
SER_ERR_CANNOT_LOAD ; Error loading driver
SER_ERR_INV_DRIVER ; Invalid driver
SER_ERR_NO_DEVICE ; Device (hardware) not found
SER_ERR_BAUD_UNAVAIL ; Baud rate not available
SER_ERR_NO_DATA ; Nothing to read
SER_ERR_OVERFLOW ; No room in send buffer
SER_ERR_INIT_FAILED ; Initialization failed
SER_ERR_INV_IOCTL ; IOCTL not supported
SER_ERR_INSTALLED ; A driver is already installed
SER_ERR_NOT_OPEN ; Driver not open
SER_ERR_COUNT ; Special: Number of error codes
.endenum

162
asminc/ser-kernel.inc Normal file
View file

@ -0,0 +1,162 @@
;****************************************************************************
;* *
;* ser-kernel.inc *
;* *
;* Serial communication API *
;* *
;* *
;* *
;*(C) 2003-2006, Ullrich von Bassewitz *
;* Roemerstrasse 52 *
;* D-70794 Filderstadt *
;*EMail: uz@cc65.org *
;* *
;* *
;*This software is provided 'as-is', without any expressed or implied *
;*warranty. In no event will the authors be held liable for any damages *
;*arising from the use of this software. *
;* *
;*Permission is granted to anyone to use this software for any purpose, *
;*including commercial applications, and to alter it and redistribute it *
;*freely, subject to the following restrictions: *
;* *
;*1. The origin of this software must not be misrepresented; you must not *
;* claim that you wrote the original software. If you use this software *
;* in a product, an acknowledgment in the product documentation would be *
;* appreciated but is not required. *
;*2. Altered source versions must be plainly marked as such, and must not *
;* be misrepresented as being the original software. *
;*3. This notice may not be removed or altered from any source *
;* distribution. *
;* *
;****************************************************************************
;------------------------------------------------------------------------------
; The driver header
.struct SER_HDR
ID .byte 3 ; Contains 0x73, 0x65, 0x72 ("ser")
VERSION .byte 1 ; Interface version
LIBREF .addr ; Library reference
JUMPTAB .struct
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
;------------------------------------------------------------------------------
; The SER API version, stored SER_HDR::VERSION
SER_API_VERSION = $02
;------------------------------------------------------------------------------
; ser_params
.struct SER_PARAMS
BAUDRATE .byte ; Baudrate
DATABITS .byte ; Number of data bits
STOPBITS .byte ; Number of stop bits
PARITY .byte ; Parity setting
HANDSHAKE .byte ; Type of handshake to use
.endstruct
;------------------------------------------------------------------------------
; Serial parameters
; Baudrate
SER_BAUD_45_5 = $00
SER_BAUD_50 = $01
SER_BAUD_75 = $02
SER_BAUD_110 = $03
SER_BAUD_134_5 = $04
SER_BAUD_150 = $05
SER_BAUD_300 = $06
SER_BAUD_600 = $07
SER_BAUD_1200 = $08
SER_BAUD_1800 = $09
SER_BAUD_2400 = $0A
SER_BAUD_3600 = $0B
SER_BAUD_4800 = $0C
SER_BAUD_7200 = $0D
SER_BAUD_9600 = $0E
SER_BAUD_19200 = $0F
SER_BAUD_38400 = $10
SER_BAUD_57600 = $11
SER_BAUD_115200 = $12
SER_BAUD_230400 = $13
SER_BAUD_31250 = $14
SER_BAUD_62500 = $15
SER_BAUD_56_875 = $16
; Data bit settings
SER_BITS_5 = $00
SER_BITS_6 = $01
SER_BITS_7 = $02
SER_BITS_8 = $03
; Stop bit settings
SER_STOP_1 = $00
SER_STOP_2 = $01
; Parity
SER_PAR_NONE = $00
SER_PAR_ODD = $01
SER_PAR_EVEN = $02
SER_PAR_MARK = $03
SER_PAR_SPACE = $04
; Handshake
SER_HS_NONE = $00 ; No handshake
SER_HS_HW = $01 ; Hardware (RTS/CTS) handshake
SER_HS_SW = $02 ; Software handshake
; Bit masks to mask out things from the status returned by ser_status
SER_STATUS_PE = $01 ; Parity error
SER_STATUS_FE = $02 ; Framing error
SER_STATUS_OE = $04 ; Overrun error
SER_STATUS_DCD = $20 ; NOT data carrier detect
SER_STATUS_DSR = $40 ; NOT data set ready
;------------------------------------------------------------------------------
; Variables
.global _ser_drv ; Pointer to driver
;------------------------------------------------------------------------------
; Driver entry points
.global ser_install
.global ser_uninstall
.global ser_open
.global ser_close
.global ser_get
.global ser_put
.global ser_status
.global ser_ioctl
.global ser_irq
;------------------------------------------------------------------------------
; C callable functions
.global _ser_load_driver
.global _ser_unload
.global _ser_install
.global _ser_uninstall
.global _ser_open
.global _ser_close
.global _ser_get
.global _ser_put
.global _ser_status
.global _ser_ioctl
.global _ser_clear_ptr

57
asminc/signal.inc Normal file
View file

@ -0,0 +1,57 @@
;/*****************************************************************************/
;/* */
;/* signal.inc */
;/* */
;/* Signal handling definitions */
;/* */
;/* */
;/* */
;/* (C) 2002 Ullrich von Bassewitz */
;/* Wacholderweg 14 */
;/* D-70597 Stuttgart */
;/* EMail: uz@musoftware.de */
;/* */
;/* */
;/* This software is provided 'as-is', without any expressed or implied */
;/* warranty. In no event will the authors be held liable for any damages */
;/* arising from the use of this software. */
;/* */
;/* Permission is granted to anyone to use this software for any purpose, */
;/* including commercial applications, and to alter it and redistribute it */
;/* freely, subject to the following restrictions: */
;/* */
;/* 1. The origin of this software must not be misrepresented; you must not */
;/* claim that you wrote the original software. If you use this software */
;/* in a product, an acknowledgment in the product documentation would be */
;/* appreciated but is not required. */
;/* 2. Altered source versions must be plainly marked as such, and must not */
;/* be misrepresented as being the original software. */
;/* 3. This notice may not be removed or altered from any source */
;/* distribution. */
;/* */
;/*****************************************************************************/
; Standard signal handling functions
SIG_ERR = $0000
; Signal numbers
SIGABRT = 0
SIGFPE = 1
SIGILL = 2
SIGINT = 3
SIGSEGV = 4
SIGTERM = 5
SIGCOUNT = 6 ; Number of signals
; Table with signal handlers (asm code only)
.global sigtable
; Function declarations
.global ___sig_ign
.global ___sig_dfl
.global _signal
.global _raise

75
asminc/sim65.inc Normal file
View file

@ -0,0 +1,75 @@
; *******************************************************************************
; ** **
; ** sim65.inc : assembler definitions for the sim6502 and sim65c02 targets. **
; ** **
; ** Sidney Cadot, January 2025 **
; ** **
; *******************************************************************************
; The '_peripherals' symbol is defined in the linker configuration
; file to correspond to the first address in the periperal memory
; aparture.
;
; We use it here as a base address for all peripheral addresses.
.import _peripherals
; **************************************************************
; ** **
; ** Define assembler symbols for the "counter" peripheral. **
; ** **
; **************************************************************
peripheral_counter_base := _peripherals + 0
peripheral_counter_latch := peripheral_counter_base + 0
peripheral_counter_select := peripheral_counter_base + 1
peripheral_counter_value := peripheral_counter_base + 2
; Values for the peripheral_counter_select register.
COUNTER_SELECT_CLOCKCYCLE_COUNTER = $00
COUNTER_SELECT_INSTRUCTION_COUNTER = $01
COUNTER_SELECT_IRQ_COUNTER = $02
COUNTER_SELECT_NMI_COUNTER = $03
COUNTER_SELECT_WALLCLOCK_TIME = $80
COUNTER_SELECT_WALLCLOCK_TIME_SPLIT = $81
; ********************************************************************
; ** **
; ** Define assembler symbols for the "sim65 control" peripheral. **
; ** **
; ********************************************************************
peripheral_sim65_base := _peripherals + 10
peripheral_sim65_cpu_mode := peripheral_sim65_base + 0
peripheral_sim65_trace_mode := peripheral_sim65_base + 1
; Values for the peripheral_sim65_cpu_mode register.
SIM65_CPU_MODE_6502 = $00
SIM65_CPU_MODE_65C02 = $01
SIM65_CPU_MODE_6502X = $02
; Bitfield values for the peripheral_sim65_trace_mode field.
SIM65_TRACE_MODE_FIELD_INSTR_COUNTER = $40
SIM65_TRACE_MODE_FIELD_CLOCK_COUNTER = $20
SIM65_TRACE_MODE_FIELD_PC = $10
SIM65_TRACE_MODE_FIELD_INSTR_BYTES = $08
SIM65_TRACE_MODE_FIELD_INSTR_ASSEMBLY = $04
SIM65_TRACE_MODE_FIELD_CPU_REGISTERS = $02
SIM65_TRACE_MODE_FIELD_CC65_SP = $01
; Values for the peripheral_sim65_trace_mode field that fully disable / enable tracing.
SIM65_TRACE_MODE_DISABLE = $00
SIM65_TRACE_MODE_ENABLE_FULL = $7F
; ************************
; ** **
; ** End of sim65.inc **
; ** **
; ************************

267
asminc/smc.inc Normal file
View file

@ -0,0 +1,267 @@
; smc.mac
; ca65 Macro-Pack for Self Modifying Code (SMC)
;
; (c) Christian Krüger, latest change: 17-Jul-2016
;
; This software is provided 'as-is', without any expressed or implied
; warranty. In no event will the authors be held liable for any damages
; arising from the use of this software.
;
; Permission is granted to anyone to use this software for any purpose,
; including commercial applications, and to alter it and redistribute it
; freely, subject to the following restrictions:
;
; 1. The origin of this software must not be misrepresented; you must not
; claim that you wrote the original software. If you use this software
; in a product, an acknowledgment in the product documentation would be
; appreciated but is not required.
; 2. Altered source versions must be plainly marked as such, and must not
; be misrepresented as being the original software.
; 3. This notice may not be removed or altered from any source
; distribution.
;
.define _SMCDesignator .mid(0, .tcount(label) - 1, label) .ident(.concat(.string(.right(1, label)), "_SMC"))
.define _SMCAlias .mid(0, .tcount(alias) - 1, alias) .ident(.concat(.string(.right(1, alias)), "_SMC"))
.define SMC_AbsAdr $FADE
.define SMC_ZpAdr $00
.define SMC_Opcode nop
.define SMC_Value $42
.macro SMC_OperateOnValue opcode, label
opcode _SMCDesignator+1
.endmacro
.macro SMC_OperateOnLowByte opcode, label
SMC_OperateOnValue opcode, label
.endmacro
.macro SMC_OperateOnHighByte opcode, label
opcode _SMCDesignator + 2
.endmacro
.macro SMC_Import alias
.import _SMCAlias
.endmacro
.macro SMC_Export alias, label
.export _SMCAlias := _SMCDesignator
.endmacro
.macro SMC label, statement
_SMCDesignator: statement
.endmacro
.macro SMC_TransferOpcode label, opcode, register
.if .paramcount = 2 .or .match ({register}, a) .or .match ({register}, )
lda #opcode
sta _SMCDesignator
.elseif .match ({register}, x)
ldx #opcode
stx _SMCDesignator
.elseif .match ({register}, y)
ldy #opcode
sty _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_TransferOpcode'"
.endif
.endmacro
.macro SMC_LoadOpcode label, register
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
lda _SMCDesignator
.elseif .match ({register}, x)
ldx _SMCDesignator
.elseif .match ({register}, y)
ldy _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_LoadOpcode'"
.endif
.endmacro
.macro SMC_StoreOpcode label, register
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
sta _SMCDesignator
.elseif .match ({register}, x)
stx _SMCDesignator
.elseif .match ({register}, y)
sty _SMCDesignator
.else
.error "Invalid usage of macro 'SMC_StoreOpcode'"
.endif
.endmacro
.macro SMC_ChangeBranch label, destination, register
.if .paramcount = 2 .or .match ({register}, a) .or .match ({register}, )
lda #(<(destination - _SMCDesignator -2))
sta _SMCDesignator+1
.elseif .match ({register}, x)
ldx #(<(destination - _SMCDesignator - 2))
stx _SMCDesignator+1
.elseif .match ({register}, y)
ldy #(<(destination - _SMCDesignator - 2))
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_ChangeBranch'"
.endif
.endmacro
.macro SMC_TransferValue label, value, register
.if .paramcount = 2 .or .match ({register}, a) .or .match ({register}, )
lda value
sta _SMCDesignator+1
.elseif .match ({register}, x)
ldx value
stx _SMCDesignator+1
.elseif .match ({register}, y)
ldy value
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_TransferValue'"
.endif
.endmacro
.macro SMC_LoadValue label, register
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
lda _SMCDesignator+1
.elseif .match ({register}, x)
ldx _SMCDesignator+1
.elseif .match ({register}, y)
ldy _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_LoadValue'"
.endif
.endmacro
.macro SMC_StoreValue label, register
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
sta _SMCDesignator+1
.elseif .match ({register}, x)
stx _SMCDesignator+1
.elseif .match ({register}, y)
sty _SMCDesignator+1
.else
.error "Invalid usage of macro 'SMC_StoreValue'"
.endif
.endmacro
.macro SMC_TransferLowByte label, value, register
SMC_TransferValue label, value, register
.endmacro
.macro SMC_LoadLowByte label, register
SMC_LoadValue label, register
.endmacro
.macro SMC_StoreLowByte label, register
SMC_StoreValue label, register
.endmacro
.macro SMC_TransferHighByte label, value, register
.if .paramcount = 2 .or .match ({register}, a) .or .match ({register}, )
lda value
sta _SMCDesignator+2
.elseif .match ({register}, x)
ldx value
stx _SMCDesignator+2
.elseif .match ({register}, y)
ldy value
sty _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_TransferHighByte'"
.endif
.endmacro
.macro SMC_LoadHighByte label, register
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
lda _SMCDesignator+2
.elseif .match ({register}, x)
ldx _SMCDesignator+2
.elseif .match ({register}, y)
ldy _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_LoadHighByte'"
.endif
.endmacro
.macro SMC_StoreHighByte label, register
.if .paramcount = 1 .or .match ({register}, a) .or .match ({register}, )
sta _SMCDesignator+2
.elseif .match ({register}, x)
stx _SMCDesignator+2
.elseif .match ({register}, y)
sty _SMCDesignator+2
.else
.error "Invalid usage of macro 'SMC_StoreHighByte'"
.endif
.endmacro
.macro SMC_TransferAddressSingle label, address, register
.if .paramcount = 2 .or .match ((register), a) .or .match ({register}, )
.if (.match (.left (1, {address}), #))
; immediate mode
lda #<(.right (.tcount ({address})-1, {address}))
sta _SMCDesignator+1
lda #>(.right (.tcount ({address})-1, {address}))
sta _SMCDesignator+2
.else
; assume absolute or zero page
lda address
sta _SMCDesignator+1
lda 1+(address)
sta _SMCDesignator+2
.endif
.elseif .match ((register), x)
.if (.match (.left (1, {address}), #))
; immediate mode
ldx #<(.right (.tcount ({address})-1, {address}))
stx _SMCDesignator+1
ldx #>(.right (.tcount ({address})-1, {address}))
stx _SMCDesignator+2
.else
; assume absolute or zero page
ldx address
stx _SMCDesignator+1
ldx 1+(address)
stx _SMCDesignator+2
.endif
.elseif .match ((register), y)
.if (.match (.left (1, {address}), #))
; immediate mode
ldy #<(.right (.tcount ({address})-1, {address}))
sty _SMCDesignator+1
ldy #>(.right (.tcount ({address})-1, {address}))
sty _SMCDesignator+2
.else
; assume absolute or zero page
ldy address
sty _SMCDesignator+1
ldy 1+(address)
sty _SMCDesignator+2
.endif
.else
.error "Invalid usage of macro 'SMC_TransferAddressSingle'"
.endif
.endmacro
.macro SMC_TransferAddress label, address
.if (.match (.left (1, {address}), #))
; immediate mode
lda #<(.right (.tcount ({address})-1, {address}))
sta _SMCDesignator+1
ldx #>(.right (.tcount ({address})-1, {address}))
stx _SMCDesignator+2
.else
; assume absolute or zero page
lda {address}
sta _SMCDesignator+1
ldx 1+{address}
stx _SMCDesignator)+2
.endif
.endmacro
.macro SMC_StoreAddress label
sta _SMCDesignator+1
stx _SMCDesignator+2
.endmacro

64
asminc/stat.inc Normal file
View file

@ -0,0 +1,64 @@
;****************************************************************************
;* *
;* stat.inc *
;* *
;* Stat struct *
;* *
;* *
;* *
;*(C) 2023 Colin Leroy-Mira <colin@colino.net> *
;* *
;* *
;*This software is provided 'as-is', without any expressed or implied *
;*warranty. In no event will the authors be held liable for any damages *
;*arising from the use of this software. *
;* *
;*Permission is granted to anyone to use this software for any purpose, *
;*including commercial applications, and to alter it and redistribute it *
;*freely, subject to the following restrictions: *
;* *
;*1. The origin of this software must not be misrepresented; you must not *
;* claim that you wrote the original software. If you use this software *
;* in a product, an acknowledgment in the product documentation would be *
;* appreciated but is not required. *
;*2. Altered source versions must be plainly marked as such, and must not *
;* be misrepresented as being the original software. *
;*3. This notice may not be removed or altered from any source *
;* distribution. *
;* *
;****************************************************************************
.include "time.inc"
;------------------------------------------------------------------------------
; st_mode values
S_IFDIR = $01
S_IFREG = $02
;------------------------------------------------------------------------------
; struct stat
.struct stat
st_dev .dword
st_ino .dword
st_mode .byte
st_nlink .dword
st_uid .byte
st_gid .byte
st_size .dword
st_atim .tag timespec
st_ctim .tag timespec
st_mtim .tag timespec
.ifdef __APPLE2__
st_access .byte
st_type .byte
st_auxtype .word
st_storagetype .byte
st_blocks .word
st_mod_date .word
st_mod_time .word
st_create_date .word
st_create_time .word
.endif
.endstruct

46
asminc/statvfs.inc Normal file
View file

@ -0,0 +1,46 @@
;****************************************************************************
;* *
;* statvfs.inc *
;* *
;* Statvfs struct *
;* *
;* *
;* *
;*(C) 2023 Colin Leroy-Mira <colin@colino.net> *
;* *
;* *
;*This software is provided 'as-is', without any expressed or implied *
;*warranty. In no event will the authors be held liable for any damages *
;*arising from the use of this software. *
;* *
;*Permission is granted to anyone to use this software for any purpose, *
;*including commercial applications, and to alter it and redistribute it *
;*freely, subject to the following restrictions: *
;* *
;*1. The origin of this software must not be misrepresented; you must not *
;* claim that you wrote the original software. If you use this software *
;* in a product, an acknowledgment in the product documentation would be *
;* appreciated but is not required. *
;*2. Altered source versions must be plainly marked as such, and must not *
;* be misrepresented as being the original software. *
;*3. This notice may not be removed or altered from any source *
;* distribution. *
;* *
;****************************************************************************
;------------------------------------------------------------------------------
; struct statvfs
.struct statvfs
f_bsize .dword
f_frsize .dword
f_blocks .dword
f_bfree .dword
f_bavail .dword
f_files .dword
f_ffree .dword
f_favail .dword
f_fsid .dword
f_flag .dword
f_namemax .dword
.endstruct

74
asminc/stdio.inc Normal file
View file

@ -0,0 +1,74 @@
;*****************************************************************************/
;* */
;* stdio.inc */
;* */
;* Mirror definitions for stdio.h */
;* */
;* */
;* */
;* (C) 2003-2005, Ullrich von Bassewitz */
;* Roemerstrasse 52 */
;* D-70794 Filderstadt */
;* EMail: uz@cc65.org */
;* */
;* */
;* This software is provided 'as-is', without any expressed or implied */
;* warranty. In no event will the authors be held liable for any damages */
;* arising from the use of this software. */
;* */
;* Permission is granted to anyone to use this software for any purpose, */
;* including commercial applications, and to alter it and redistribute it */
;* freely, subject to the following restrictions: */
;* */
;* 1. The origin of this software must not be misrepresented; you must not */
;* claim that you wrote the original software. If you use this software */
;* in a product, an acknowledgment in the product documentation would be */
;* appreciated but is not required. */
;* 2. Altered source versions must be plainly marked as such, and must not */
;* be misrepresented as being the original software. */
;* 3. This notice may not be removed or altered from any source */
;* distribution. */
;* */
;*****************************************************************************/
;----------------------------------------------------------------------------
; Constants
_IOFBF = 0
_IOLBF = 1
_IONBF = 2
BUFSIZ = 256
EOF = -1
.if .defined(__APPLE2__)
FILENAME_MAX = 64+1
.elseif .defined(__ATARI__)
FILENAME_MAX = 63+1
.elseif .defined(__CBM__)
FILENAME_MAX = 255
.elseif .defined(__LUNIX__)
FILENAME_MAX = 80+1
.elseif .defined(__TELESTRAT__)
FILENAME_MAX = 50+1
.else
FILENAME_MAX = 16+1
.endif
L_tmpnam = FILENAME_MAX
SEEK_CUR = 0
SEEK_END = 1
SEEK_SET = 2
TMP_MAX = 256
; Maximum number of open files (size of the file table)
FOPEN_MAX = 8
;----------------------------------------------------------------------------
; External variables
.global _stdin
.global _stdout
.global _stderr

75
asminc/supervision.inc Normal file
View file

@ -0,0 +1,75 @@
; supervision symbols
; supervision 65c02s
; in cc65 up to 2.9.1 65c02 means 65sc02
lcd_addr = $4000
LCD_LINESIZE = $30
LCD_WIDTH = 160
LCD_HEIGHT = 160
; 2 bit per pixel, packed
lcd_width = $2000
lcd_height = $2001
lcd_xpos = $2002 ; in pixel, bit 0+1 not used
lcd_ypos = $2003 ; weird
sv_port_r = $2021
sv_port_w = $2022
sv_timer_count = $2023
; read for quitting
sv_timer_quit = $2024
; bit 0 timer, bit 1 dma
sv_irq_source = $2027
SV_IRQ_REQUEST_TIMER = 1
SV_IRQ_REQUEST_DMA = 2
; bit 5,6,7 select bank at 0x8000
sv_bank = $2026
SV_NMI_ENABLE_ON = 1
SV_IRQ_ENABLE_TIMER = 2
SV_IRQ_ENABLE_DMA = 4
SV_LCD_ON = 8
SV_TIMER_MODE_240Hz = $10 ; else 15360
; low activ/pressed
sv_control = $2020
SV_RIGHT = 1
SV_LEFT = 2
SV_DOWN = 4
SV_UP = 8
SV_BUTTONB = $10
SV_BUTTONA = $20
SV_SELECT = $40
SV_START = $80
; frequency=125000/counter
sv_audio_right_counter = $2010 ;word
sv_audio_left_counter = $2014
SV_AUDIO_ON =$40
;bits 0..3 volume
; bit 4 ?
; bit 5 ?
sv_audio_right_control = $2012
sv_audio_left_control = $2016
; write activates tone for x/60 sec (0 means 256)
sv_audio_right_timer = $2013
sv_audio_left_timer = $2017
;read for irq quitting
sv_dma_quit = $2025
sv_dma_on = $201c
; bit 7 true start, false stop
sv_dma_start = $2018 ; word
sv_dma_size = $201a ; *32 samples
sv_dma_control = $201b
; bit 0,1 speed: 0 15360, 11 15360/4
; bit 2,3 volume: 0 silent, 11 loud
sv_noise_volume = $2028 ; and frequency
sv_noise_timer = $2029
sv_noise_control = $202a

186
asminc/sym1.inc Normal file
View file

@ -0,0 +1,186 @@
; ---------------------------------------------------------------------------
;
; SYM-1 definitions
;
; ---------------------------------------------------------------------------
RAMSTART := $0200 ; Entry point
; ---------------------------------------------------------------------------
; Monitor Functions
; ---------------------------------------------------------------------------
WARM := $8003 ; Monitor entry
SVNMI := $809B ; Save NMI entry
INBYTE := $81D9 ; Get two HEX characters and pack
ASCNIB := $8275 ; Test for carriage-return
INCCMP := $82B2 ; Increment pointer
CHKSAD := $82DD ; Compute checksum
OUTPC := $82EE ; Display program counter
OUTBYT := $82FA ; Print byte as two ASCII characters
OUTS2 := $8319 ; Print pointer
INSTAT := $8386 ; Determine if key is pressed
GETKEY := $88AF ; Get key (disregarding monitor login)
SCAND := $8906 ; Flash LED display (once)
KEYQ := $8923 ; Test for keypress
BEEP := $8972 ; Make a beep
CONFIG := $89A5 ; Configure I/O
OUTDSP := $89C1 ; Output to on-board LED display
INCHR := $8A1B ; Input character and convert to uppercase
OUTCHR := $8A47 ; Output character
INTCHR := $8A58 ; Input character without case conversion
DLYF := $8AE6 ; Delay 1 bit time
DLYH := $8AE9 ; Delay 1/2 bit time
RESET := $8B4A ; Hard reset
ACCESS := $8B86 ; Unlock lowest 4K memory
NACCES := $8B9C ; Lock lowest 4K memory
L8C78 := $8C78 ; Link to tape
DUMPT := $8E87 ; Dump memory to tape
LOADT := $8C78 ; Load memory from tape
TAPEMODE := $00FD ; Top bit on for high-speed
; ---------------------------------------------------------------------------
; System Memory
; ---------------------------------------------------------------------------
DISBUF := $A640 ; On-Board Display Buffer
DISBUF0 := $A640 ; Left-Most digit
DISBUF1 := $A641 ; Second digit
DISBUF2 := $A642 ; Third
DISBUF3 := $A643 ; Fourth
DISBUF4 := $A644 ; Fifth
DISBUF5 := $A645 ; Sixth and right-most digit
DISBUF6 := $A646 ; Not-used / right of display (shift buffer)
RDIG := $A645 ; Right-most digit (same as DISBUF5)
P3L := $A64A ; Parameter 3 (low-byte)
P3H := $A64B ; (high-byte)
P2L := $A64C ; Parameter 2
P2H := $A64D ;
P1L := $A64E ; Parameter 1
P1H := $A64F
PARNR := $A649 ; Number of Parameters Entered
PADBIT := $A650 ; Pad Bits for Carriage Return
SDBYT := $A651 ; Baud Rate for RS232 (01-4800,06-2400,10-1200,24-600,4C-300,D5-110)
ERCNT := $A652 ; Error Count (Max FF)
TECHO := $A653 ; Terminal Echo (bit-7=ECHO/NO, 6=CTL-O TOGGLE)
TOUTFL := $A654 ; Output Flags (bit-7=CRT IN, 6=TTY IN, 5=TTY OUT, 4=CRT OUT)
KSHFL := $A655 ; Keyboard Shift Flag
TV := $A656 ; Trace Velocity (0=Single Step)
LSTCOM := $A657 ; Last Monitor Command
MAXRC := $A658 ; Maximum Record Length for Memory Dump
; ---------------------------------------------------------------------------
; Register Followers
; ---------------------------------------------------------------------------
PCLR := $A659 ; Program Counter (low-byte)
PCHR := $A65A ; (high-byte)
SR := $A65B ; Stack Pointer
FR := $A65C ; Status Register Flags
AR := $A65D ; A Register
XR := $A65E ; X Register
YR := $A65F ; Y Register
; ---------------------------------------------------------------------------
; I/O Vectors (3 bytes each)
; ---------------------------------------------------------------------------
INVEC := $A660 ; Input Character
OUTVEC := $A663 ; Output Character
INSVEC := $A666 ; Input Status
URSVEC := $A669 ; Unrecognized Syntax
URCVEC := $A66C ; Unrecognized Command / Error
SCNVEC := $A66F ; Scan On-board Display
; ---------------------------------------------------------------------------
; Trace and Interrupt Vectors (2 bytes each)
; ---------------------------------------------------------------------------
EXEVEC := $A672 ; Exec and Alternate InVec
TRCVEC := $A674 ; Trace
UBRKVC := $A676 ; User Break after Monitor
UIRQVC := $A678 ; User non-break IRQ after Monitor
NMIVEC := $A67A ; Non-Maskable Interrupt
RSTVEC := $A67C ; Reset
IRQVEC := $A67E ; Interrupt Request
; ---------------------------------------------------------------------------
; I/O Registers
; ---------------------------------------------------------------------------
;
; 6532 (U27)
;
PADA := $A400 ; Keyboard / Display
P3DA := $A402 ; Serial I/O
DDPADA := $A401 ; Data-Direction Register for PADA
DDP3DA := $A403 ; Data-Direction Register for P3DA
WEDRTA := $A404 ; Write-Edge Detect Read Timer A
WEDRFA := $A405 ; Write-Edge Detect Read-Int Flags A
WEDRTB := $A406 ; Write-Edge Detect Read Timer B
WEDRFB := $A407 ; Write-Edge Detect Read-Int Flags B
TIM0001 := $A41C ; Timer / 1
TIM0008 := $A41D ; Timer / 8
TIM0064 := $A41E ; Timer / 64
TIM1024 := $A41F ; Timer / 1024
;
; 6522 (U25)
;
OR1A := $A001 ; Input / Output Register for 1A
DDR1A := $A003 ; Data-Direction Register for 1A
OR1B := $A000 ; Input / Output Register for 1B
DDR1B := $A002 ; Data-Direction Register for 1B
TIC1L := $A004 ;
TIC1H := $A005 ;
TIL1L := $A006 ;
TIL1H := $A007 ;
T2L1L := $A008 ;
T2C1L := $A008 ;
T2C1H := $A009 ;
SR1 := $A00A ;
ACR1 := $A00B ;
PCR1 := $A00C ;
IFR1 := $A00D ;
IER1 := $A00E ;
DR1A := $A00F ;
;
; 6522 (U28)
;
OR2A := $A801 ; Input / Output Register for 2A
DDR2A := $A803 ; Data-Direction Register for 2A
OR2B := $A800 ; Input / Output Register for 2B
DDR2B := $A802 ; Data-Direction Register for 2B
TIC2L := $A804 ;
TIC2H := $A805 ;
TIL2L := $A806 ;
TIL2H := $A807 ;
T2L2L := $A808 ;
T2C2L := $A808 ;
T2C2H := $A809 ;
SR2 := $A80A ;
ACR2 := $A80B ;
PCR2 := $A80C ;
IFR2 := $A80D ;
IER2 := $A80E ;
DR2A := $A80F ;
;
; 6522 (U29)
;
OR3A := $AC01 ; Write-Protect RAM, Debug On/Off, I/O-3A
DDR3A := $AC03 ; Data-Direction Register for 3A
OR3B := $AC00 ; Input / Output Register for 3B
DDR3B := $AC02 ; Data-Direction Register for 3B
TIC3L := $AC04 ;
TIC3H := $AC05 ;
TIL3L := $AC06 ;
TIL3H := $AC07 ;
T2L3L := $AC08 ;
T2C3L := $AC08 ;
T2C3H := $AC09 ;
SR3 := $AC0A ;
ACR3 := $AC0B ;
PCR3 := $AC0C ;
IFR3 := $AC0D ;
IER3 := $AC0E ;
DR3A := $AC0F ;

546
asminc/telestrat.inc Normal file
View file

@ -0,0 +1,546 @@
;
; Oric TELEMON definition
; TELEMON 2.4 & Orix
; For Orix check http://orix.oric.org
;
; ---------------------------------------------------------------------------
; Constants
SCREEN_XSIZE = 40 ; Screen columns
SCREEN_YSIZE = 28 ; Screen rows
FUNCTKEY = $A5
FNAME_LEN = 11 ; Maximum length of file-name
; ---------------------------------------------------------------------------
; I/O Identifier
; Theses identifers are used for channel management
;
XKBD = $80 ; Keyboard
XRSE = $83 ; RS232 in
XSCR = $88 ; Screen
XRSS = $90 ; RS232 out
; ---------------------------------------------------------------------------
; Zero page
; ---------------------------------------------------------------------------
; Page 00
RES := $00
RESB := $02
DECDEB := $04
DECFIN := $06
DECCIB := $08
DECTRV := $0A
TR0 := $0C
TR1 := $0D
TR2 := $0E
TR3 := $0F
TR4 := $10
TR5 := $11
TR6 := $12
TR7 := $13
DEFAFF := $14
IRQSVA := $21 ; Used to save A when a BRK call occurs
IRQSVX := $22 ; Used to save X when a BRK call occurs
IRQSVY := $23 ; Used to save Y when a BRK call occurs
IRQSVP := $24 ; Used to save P when a BRK call occurs
ADSCR := $26
SCRNB := $28 ; Id of the current window
ADKBD := $2A ; Address ASCII conversion table
PTR_READ_DEST := $2C ; Used for XFREAD and XWRITE only in Orix
ADCLK := $40 ; Address for clock display
TIMEUS := $42
TIMEUD := $44 ; Counter clock (1/10 of a second)
HRSX := $46
HRSY := $47
XLPRBI := $48 ; Printer flag (b7)
HRSX40 := $49
HRSX6 := $4A
ADHRS := $4B ; Hires screen address (word)
HRS1 := $4D
HRS2 := $4F
HRS3 := $51
HRS4 := $53
HRS5 := $55
HRSFB := $57
VABKP1 := $58
; RS232T
; b0-b3 : speed
; 1111 => 19200 bps (please note that telestrat can't handle this speed without stopping all IRQ except ACIA's one)
; 1100 => 9600 bps (default from TELEMON)
; 1110 => 4800 bps
; 1010 => 2400 bps
; 1000 => 1200 bps
; 0111 => 600 bps
; 0110 => 300 bps
; 0101 => 150 bps
; 0010 => 75 bps
; b4 : 0 external clock, 1 internal clock
; b6-b5 : 00 8 bits
; 01 7 bits
; 10 6 bits
; 11 5 bits
; b7 : 0 a stop
RS232T := $59
; RS232C
; b0-b3 : 0
; b4 : 1 if echo
; b5 : 1 if parity
; b7-b6 : 00 in/out parity odd
; : 01 on/out parity even
; : 10 parity sent, answer not tested
; : 11 SPACE SENT, reception not tested
RS232C := $5A
INDRS := $5B
; Float and integer management
ACC1E := $60
ACC1M := $61
ACC1S := $65
ACC1EX := $66
ACC1J := $67
ACC2E := $68
ACC2M := $69
ACC2S := $6D
ACCPS := $6E
ACC3 := $6F
ACC4E := $73
ACC4M := $74
FLDT0 := $74
FLDT1 := $75
FLDT2 := $76
FLSVY := $77
FLTR0 := $7D
FLTR1 := $7E
; Menu management
MENDDY := $62
MENDFY := $63
MENX := $64
MENDY := $66
FLGMEN := $68
ADMEN := $69
FLSGN := $8A
FLINT := $88
FLSVS := $89
FLERR := $8B
VARLNG := $8C
VARAPL := $D0
; ---------------------------------------------------------------------------
; Low memory
IRQVec := $02FB ; "fast" interrupt vector
; ---------------------------------------------------------------------------
; I/O locations
; 6522
.struct VIA ; Versatile Interface Adapter
.res $0300
PRB .byte ; Port Register B
PRA .byte ; Port Register A
DDRB .byte ; Data Direction Register B
DDRA .byte ; Data Direction Register A
T1 .word ; Timer 1
T1L .word ; Timer 1 Latch
T2 .word ; Timer 2
SR .byte ; Shift Register
ACR .byte ; Auxiliary Control Register
PCR .byte ; Peripheral Control Register
IFR .byte ; Interrupt Flags Register
IER .byte ; Interrupt Enable Register
PRA2 .byte ; Port Register A without handshaking
.endstruct
.struct VIA2 ; Versatile Interface Adapter
.res $0320
PRB .byte ; Port Register B
PRA .byte ; Port Register A
DDRB .byte ; Data Direction Register B
DDRA .byte ; Data Direction Register A
T1 .word ; Timer 1
T1L .word ; Timer 1 Latch
T2 .word ; Timer 2
SR .byte ; Shift Register
ACR .byte ; Auxiliary Control Register
PCR .byte ; Peripheral Control Register
IFR .byte ; Interrupt Flags Register
IER .byte ; Interrupt Enable Register
PRA2 .byte ; Port Register A without handshaking
.endstruct
; 6551
.struct ACIA ; Asynchronous Communications Interface Adapter
.res $031C
DATA .byte
STATUS .byte
CMD .byte ; Command register
CTRL .byte ; Control register
.endstruct
SCREEN := $BB80
; ---------------------------------------------------------------------------
; ROM entries
; TELEMON primitives (2.4 & 3.x)
; all values are used to call bank 7 of telestrat cardridge. It works with 'brk value'
XOP0 = $00 ; Open device on channel 0
XOP1 = $01 ; Open device on channel 1
XOP2 = $02 ; Open device on channel 2
XOP3 = $03 ; Open device on channel 3
XCL0 = $04 ; Close channel 0
XCL1 = $05 ; Close channel 1
XCL2 = $06 ; Close channel 2
XCL3 = $07 ; Close channel 3
XRD0 = $08
XRDW0 = $0C
XWR0 = $10 ; Write a char in channel 0
XWR1 = $11 ; Write a char in channel 1
XWR2 = $12 ; Write a char in channel 2
XWR3 = $13 ; Write a char in channel 3
XWSTR0 = $14 ; Write a string in text mode channel 0
XWSTR1 = $15 ; Write a string in text mode channel 1
XWSTR2 = $16 ; Write a string in text mode channel 2
XWSTR3 = $17 ; Write a string in text mode channel 3
XDECAL = $18
XTEXT = $19
XHIRES = $1A
XEFFHI = $1B ; Clear hires screen
XFILLM = $1C
XMINMA = $1F
XVARS = $24 ; Only in Orix, in TELEMON 2.4, it's XNOMFI ($24)
XCRLF = $25 ; Jump a line and return to the beginning of the line
XDECAY = $26
XFREAD = $27 ; Only in Orix
XBINDX = $28 ; Convert a number into hex and displays on channel 0
XDECIM = $29
XHEXA = $2A ; Convert a number into hex
XMAINARGS = $2C ; Only available for Orix
XEDT = $2D ; Launch editor
XINSER = $2E
XGETARGV = $2E ; Only available for Orix
XSCELG = $2F ; Search a line in editor mode
XOPEN = $30 ; Only in Orix
XECRPR = $33 ; Displays prompt
XCOSCR = $34 ; Switch off cursor
XCSSCR = $35 ; Switch on cursor
XSCRSE = $36
XSCROH = $37 ; Scroll up text screen
XSCROB = $38 ; Scroll down text screen
XSCRNE = $39 ; Load charset from rom to ram
XCLOSE = $3A ; Only in Orix close file
XFWRITE = $3B ; Only in Orix write file
; Clock primitive
XRECLK = $3C ; Reset clock
XCLCL = $3D ; Close clock
XWRCLK = $3E ; Displays clock in the address in A & Y registers
XFSEEK = $3F ; Only in Orix
; Sound primitives
XSONPS = $40 ; Send data to PSG register (14 values)
XOUPS = $42 ; Send Oups sound into PSG
XPLAY = $43 ; Play a sound
XSOUND = $44
XMUSIC = $45
XZAP = $46 ; Send Zap sound to PSG
XSHOOT = $47
; Path Management
XGETCWD = $48 ; Get current CWD
XPUTCWD = $49 ; Chdir
; File management
XMKDIR = $4B ; Create a folder. Only available in Orix
XHCHRS = $4C ; Hard copy hires
; File management
XRM = $4D ; Remove a folder or a file. Only available in Orix
XFWR = $4E ; Put a char on the first screen. Only available in Orix
; Keyboard primitives
XALLKB = $50 ; Read Keyboard, and populate KBDCOL
XKBDAS = $51 ; Ascii conversion
XGOKBD = $52 ; Swap keyboard type (Qwerty, French ...)
; Buffer management
XECRBU = $54 ; Write A or AY in the buffer
XLISBU = $55 ; Read A or AY in the buffer
XTSTBU = $56
XVIDBU = $57 ; Flush the buffer
XINIBU = $58 ; Initialize the buffer X
XDEFBU = $59 ; Reset all value of the buffer
XBUSY = $5A ; Test if the buffer is empty
XMALLOC = $5B ; Only in Orix
; RS232 primitives
XSDUMP = $5C ; RS232 input dump
XCONSO = $5D ; Swap screen into RS232 terminal
XSLOAD = $5E ; Read a file from RS232
XSSAVE = $5F ; Write a file to RS232
; Minitel primitives
XMLOAD = $60 ; Read a file from Minitel
XMSAVE = $61 ; Write a file to Minitel
XFREE = $62 ; Only in Orix
XEXEC = $63 ; Only in Orix
; Next Minitel primitives
XWCXFI = $63 ; Wait connection
XLIGNE = $64 ;
XDECON = $65 ; Minitel disconnection
XMOUT = $66 ; Send a byte to minitel (from A)
XSOUT = $67 ; Send accumulator value (A) to RS232, available in TELEMON 2.4 : if RS232 buffer is full, the Oric Telestrat freezes
XHRSSE = $8C ; Set hires position cursor
XDRAWA = $8D ; Draw a line absolute
XDRAWR = $8E ; Draw a line (relative)
XCIRCL = $8F ; Draw a circle
XCURSE = $90 ; Plot a pixel
XCURMO = $91 ; Move to x,y pos in Hires
XPAPER = $92
XINK = $93
XBOX = $94 ; Draw a box
XABOX = $95
XFILL = $96
XCHAR = $97 ; Display a char on the screen in Hires
XSCHAR = $98 ; Draw a string in hires
XEXPLO = $9C ; Send Explode sound to PSG
XPING = $9D ; Send Ping sound to PSG
; ---------------------------------------------------------------------------
; ROM entries variables
PWD_PTR = $00
; ---------------------------------------------------------------------------
;
BUFTRV := $100
; ---------------------------------------------------------------------------
; Page $200
BNKST := $200 ; Used to store signature of 8 bank (length : 8 bytes)
TABDRV := $208
DRVDEF := $20C
FLGTEL := $20D
KOROM := $20E ; Used to compute the size of all rom bank. The result is store here. The value is in KB
KORAM := $20F ; Used to compute the size of all ram bank. The result is store here. The value is in KB
; Time management
TIMED := $210 ; Clock (1/10 of seconds)
TIMES := $211
TIMEM := $212
TIMEH := $213
FLGCLK := $214
FLGCLK_FLAG := $215
FLGCUR := $216 ; Cursor management flag
; screens position managements
FLGCUR_STATE := $217 ; Cursor state flag
ADSCRL := $218
ADSCRH := $21C
SCRX := $220
SCRY := $224
SCRDX := $228
SCRFX := $22C
SCRDY := $230
SCRFY := $234
SCRBAL := $238
SCRBAH := $23C
SCRCT := $240
SCRCF := $244
FLGSCR := $248
CURSCR := $24C
HARD_COPY_HIRES := $250 ; Hard copy vector
SCRTXT := $256
SCRHIR := $25C
SCRTRA := $262 ; 6 bytes lenfth
; Keyboard management
KBDCOL := $268 ; 8 bytes length
KBDFLG_KEY := $270 ; 0 if no key pressed
KBDVRR := $272
KBDVRL := $273
FLGKBD := $275
KBDFCT := $276
KBDSHT := $278
KBDKEY := $279
KBDCTC := $27E
LPRX := $286
LPRY := $287
LPRFX := $288
LPRFY := $289
FLGLPR := $28A
; Joysticks management
FLGJCK := $28C
JCGVAL := $28D
JCDVAL := $28E
JCKTAB := $29D
HRSPAT := $2AA ; Hires pattern : it's used to draw pattern for a line or a circle
HRSERR := $2AB
IOTAB0 := $2AE
IOTAB1 := $2B2
IOTAB2 := $2B6
IOTAB3 := $2BA
ADIOB := $2BE ; 48 bytes length
FLGRST := $2EE
CSRND := $2EF
VNMI := $2F4
ADIODB_VECTOR := $2f7 ; 3 bytes length
IRQVECTOR := $2FA
VAPLIC := $2FD
; ---------------------------------------------------------------------------
; Page $400
EXBNK := $40C
VEXBNK := $414
BNKCIB := $417
; ---------------------------------------------------------------------------
; Page $500
DRIVE := $500
ERRNB := $512
SAVES := $513
BUFNOM := $517
VSALO0 := $528
VSALO1 := $529
FTYPE := $52C ; File type
DESALO := $52D
FISALO := $52F
EXSALO := $531
EXTDEF := $55D ; Default extension. At the start of telemon, it's set to ".COM"
BUFEDT := $590 ; Buffer edition
MAX_BUFEDT_LENGTH=110
; ---------------------------------------------------------------------------
; Hardware
CH376_DATA := $340
CH376_COMMAND := $341
; RAM overlays buffer
BUFBUF := $c080
; ---------------------------------------------------------------------------
; 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
.macro BRK_TELEMON value
.byte $00,value
.endmacro

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