100 Commits
Author SHA1 Message Date
Oliver 759884ddd4 Allow to backspace with 'Delete' (and some optimization) 2025-11-02 20:52:50 +01:00
Oliver 24b7d1fec7 Make use of dynamic box drawing 2025-06-15 14:14:38 -04:00
Oliver Schmidt 1efe1227d6 Added apple2enh to the targets supporting waitvsync(). 2025-03-14 16:43:39 +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
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
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
Oliver Schmidt 3c864fc7d8 Minimal style adjustment 2023-10-15 17:00:15 +02: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
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
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
Oliver Schmidt 152241f26c Don't rely on (actually changed) unspecified compiler behavior. 2022-07-21 03:13:09 +02:00
Oliver Schmidt 919645f283 Updated URL and improved consistency. 2022-07-21 03:13:09 +02: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
Oliver Schmidt 2235830e31 Don't rely on (actually changed) unspecified compiler behavior. 2021-12-19 16:55:32 +01:00
Oliver Schmidt b35a9d97a6 Updated URL and improved consistency. 2021-12-12 23:59:22 +01: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
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
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
Oliver Schmidt 28b1687aaf Be explicit about hardware flow control (RTS/CTS) being the only supported option. 2021-09-26 12:09:50 +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
Oliver Schmidt b7856ddd4f Just some source formatting adjustments. 2021-05-11 10:40:44 +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
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
Oliver Schmidt a982f6a668 Removed obsolete file.
https://github.com/cc65/cc65/commit/c658acbf850e32508ea0e14f0f62d675a009c7d9 made this file unnecessary.
2021-04-18 21:14:49 +02:00
Oliver Schmidt 0ed41db478 Some minor clarifications. 2021-04-06 01:45:41 +02:00
Oliver Schmidt 1bd04e8462 Merge pull request #1439 from acqn/CConvFix
[cc65] Issue #1438 fix
2021-03-27 01:33:07 +01:00
Oliver Schmidt 203c4da15b Merge pull request #1434 from mrdudz/test1423
Test for pr #1423
2021-03-20 02:01:46 +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
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
Oliver Schmidt 8551431233 Optimized based on https://github.com/cc65/cc65/pull/1393. 2021-02-05 11:54:07 +01:00
Oliver Schmidt a861d84011 Fixed recent addition of __A__. 2021-01-06 16:09:55 +01: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
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 https://github.com/cc65/cc65/commit/555282497c3ecf8b313d87d5973093af19c35bd5. 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
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
Oliver Schmidt d8e6fa61bb Return NULL on error (or end of directory). 2020-10-29 17:44:19 +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
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
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
Oliver Schmidt 095de4ea52 Write o65 files as SEQ files. 2020-10-15 12:54:01 +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
Oliver Schmidt 4acdc9ced9 Fixed paramcount build. 2020-10-03 14:55:30 +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
Oliver Schmidt b0d3b19a6a The bug1209 test fails at link stage. 2020-08-26 21:01:02 +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
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
Oliver Schmidt e1043fac12 Adjusted to https://github.com/cc65/cc65/pull/1124. 2020-08-01 10:56:05 +02:00
Oliver Schmidt 8eab28012a Adjusted project name. 2020-07-28 23:29:16 +02:00
Oliver Schmidt cdd23edd37 Added building of samples. 2020-07-27 17:59:24 +02:00
Oliver Schmidt 4316242d7e Adjusted to https://github.com/cc65/cc65/commit/5df2de06290e9b7181c03eeb311f7687ef469b80 (and slightly simplified). 2020-07-27 17:47:14 +02:00
Oliver Schmidt 5df2de0629 Added test target. 2020-07-22 23:27:04 +02:00
Oliver Schmidt 77674352f6 Minor style change. 2020-07-21 23:44:36 +02: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
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 https://sourceforge.net/p/cc65/mailman/message/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 https://github.com/cc65/cc65/commit/f8c6c58373426551eed096dcfab4eab137fc0430 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
Oliver Schmidt 0f8b587bc2 Added directory for currently failing regression tests. 2020-07-01 00:13:55 +02:00
Oliver Schmidt 5277ea0b73 Add test license description. 2020-06-27 02:23:40 +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
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
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
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
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
Oliver Schmidt 5b56c6e3a2 Disable potentially enabled double-width graphics. 2020-05-04 22:23:01 +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
Oliver Schmidt a53bd345d8 Adjusted comments due to recent change. 2020-03-26 12:29:56 +01:00
Oliver Schmidt b91ad02da1 Made use of 65C02 opcode (thx to polluks). 2020-03-05 14:38:36 +01:00
Oliver Schmidt 857a566a2e Normalized Atari naming. 2020-02-17 11:07:52 +01:00
Oliver Schmidt 0f08ae2c12 Minor cleanup. 2020-01-18 19:29:24 +01:00
Oliver Schmidt d5c804f851 Expanded Sim65 zero page. 2019-11-26 22:18:12 +01: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