1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-05 21:29:03 +00:00
Commit Graph

217 Commits

Author SHA1 Message Date
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
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
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
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
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
Marco van den Heuvel
2e2f19ba79 Finished adding c128 internal/external function ram emd's. 2015-11-30 20:14:45 -08:00
Marco van den Heuvel
7df35cac94 Started on making c128 function ram emd's. 2015-11-30 09:53:30 -08:00
Marco van den Heuvel
18208f4d2e Fixed the c128 ram (bank 1) emd. 2015-11-29 23:04:23 -08:00
Marco van den Heuvel
cf9e7856cf Removed an 'rts'. 2015-11-29 11:35:25 -08: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
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
031bd2ebf0 Fixed the random-seed generators for the Commodore targets.
They use a byte from the time counter; but, it is stored in big-endian order.
2015-09-11 10:03:07 -04:00
Greg King
74c2415795 Changed literal zeroes of the style "#>0" into the style "#>$0000". 2014-09-10 19:15:07 -04:00
Greg King
c7969a78b0 Refined the comments in the target start-up files.
Fixed typo errors.  Made the comments consistent across all those files.
2014-08-24 10:10:20 -04:00
Greg King
0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt
2c975d3642 Create static drivers directly from source files.
Up to now static drivers were created via co65 from dynamic drivers. However there was an issue with that approach:

The dynamic drivers are "o65 simple files" which obligates that they start with the 'code' segment. However dynamic drivers need to start with the module header - which is written to. For dynamic drivers this isn't more than a conceptual issue because they are always contain a 'data' segment and may therefore only be loaded into writable memory.

However when dynamic drivers are converted to static drivers using co65 then that issue becomes a real problem as then the 'code' segment may end up in non-writable memory - and thus writing to the module header fails.

Instead of changing the way dynamic drivers work I opted to rather make static driver creation totally independent from dynamic drivers. This allows to place the module header in the 'data' segment (see 'module.mac').
2014-06-04 23:50:18 +02:00
Oliver Schmidt
63b5f75a7f Merge pull request #114 from greg-king5/phantom
Added the phantom-key exorcism code to the other C128 mouse drivers.
2014-05-09 19:30:51 +02:00
Greg King
a27e7562fd Added comments that explain why some instructions are implied. 2014-05-05 13:55:14 -04:00
Greg King
7d512ca238 Back-migrated some phantom-key rejection optimizations. 2014-05-05 06:28:19 -04:00
Greg King
667f8229c0 Migrated the phantom-key exorcism code to the other C128 mouse drivers. 2014-05-05 05:30:31 -04:00
Greg King
047d9abc68 Added the long-missing driver-flags byte to the potentiometer (mouse) drivers. 2014-05-05 04:16:04 -04:00
Oliver Schmidt
d6c3bd29ac Renamed JUMPTABLE and cleaned up module.cfg.
This change was suppsed to fix the issue that the former JUMPTABLE is merked as 'ro' while it is actually written to in several scenarios. When drivers are converted using co65 and then compiled into ROMs the JUMPTABLE isn't copied to RAM and therefore the write operations in question fail.

However unfortunately I didn't succeed in changing that :-( Just setting the former JUMPTABLE to 'rw' broke the drivers. So I placed the DATA segment directly after the former JUMPTABLE segment. This made the drivers converted with co65 work again - obviously after changing libsrc/Makefile:235 from '--code-label' to '--data-label'. But the actual dynamic drivers still didn't work as the former JUMPTABLE wasn't placed as the beginning of the loaded file anymore. That effect could be changed by exchanging src/ld65/o65.c:1391 with src/ld65/o65.c:1394 but doing so broke the drivers again :-((
2014-05-01 21:44:39 +02:00
Christian Groessler
6307815ada Correctly map out ROM when needed in the "phantom keys" workaround. 2014-04-26 11:58:13 +02:00
Christian Groessler
54be6de9bc Workaround for "phantom" key presses in the C128 "1351" mouse driver. 2014-04-25 00:22:23 +02:00
Christian Groessler
4406307c2f Make the hooking and unhooking of the interrupt interrupt safe. 2014-04-24 00:28:33 +02:00
Christian Groessler
608dbc2cec Workaround for "phantom" key presses in the C128 "joystick" mouse driver. 2014-04-22 15:49:48 +02:00
Greg King
3ef184bdd6 Corrected the default upper limits of some mouse drivers' bounding box.
The upper limits need to be one less than the screen sizes because the minimum co-ordinate is zero instead of one.
2014-03-18 05:17:44 -04:00
Greg King
e335d2564d Added code that disables C128 BASIC's sprite-motion interrupt-handler.
That lets the mouse drivers control a sprite directly through the VIC's registers.
2014-03-15 16:41:03 -04:00
Oliver Schmidt
94eb2a2ed7 Some fine tuning of the mouse driver interface harmonization. 2014-01-17 21:09:15 +01:00
Oliver Schmidt
4065cb1983 Harmonized interface between mouse drivers and callbacks.
The Apple2 doesn't have sprites so the Apple2 mouse callbacks place a special character on the text screen to indicate the mouse position. In order to support the necessary character removing and redrawing the Apple2 mouse driver called the Apple2 mouse callbacks in an "unusual way". So far so (sort of) good.

However the upcoming Atari mouse driver aims to support both "sprite-type" mouse callbacks as well as "text-char-type" mouse callbacks. Therefore the interface between mouse drivers and callbacks needs to be extended to allow the mouse callbacks to hide their different types from the mouse driver.

The nature of this change can be seen best by looking at the Apple2 file modifications. The CBM drivers and callbacks (at least the current ones) don't benefit from this change.
2014-01-15 22:47:59 +01:00
Oliver Schmidt
b1c8f8e714 Fixed recent "Minor comment harmonization". 2014-01-12 21:52:18 +01:00
Oliver Schmidt
8ae7ac73b3 Minor comment harmonization. 2014-01-11 23:35:21 +01:00
Greg King
0159358934 Cleaned 2 source files by removing commented-out lines that are active in other files. 2013-08-23 07:36:11 -04:00
Greg King
17333e4732 Fixed some line endings.
My Git and repositories are configured for POSIX; but sometimes, Windows line endings "sneak" into new files.
2013-07-25 13:53:15 -04:00
Greg King
3b544613d2 Moved the lightpen names from <mouse.h> to a new <pen.h>.
Renamed the adjuster pointer.
2013-07-25 13:32:40 -04:00
Greg King
078a1df2f6 Look for NULL pointer more efficiently. 2013-07-05 12:32:19 -04:00
Greg King
e63bf1cde1 Used a library-reference method to calibrate lightpen drivers.
The mouse reference is a pointer.  If it's NULL, the driver uses a default.  If it's non-NULL, then it points to a function that the driver can call.  That function will adjust the driver's calibration value.  It could ask the user to adjust the pen; or, it could read a file that holds a value from a previous calibration.

Application writers can choose how it's done: a function that's provided by the library, a custom function, or nothing.
2013-06-23 03:18:28 -04:00
Greg King
66ca781bb1 Added library reference address to lightpen driver header. 2013-06-03 06:09:22 -04:00
Oliver Schmidt
b0dd6c614f Added library reference tgi_libref to TGI interface. 2013-06-01 12:42:00 +02:00
Oliver Schmidt
ae409e4978 Added library reference ser_libref to SER interface. 2013-06-01 11:03:14 +02:00
Oliver Schmidt
744abda24f Added library reference mouse_libref to MOU interface. 2013-06-01 00:53:17 +02:00
Oliver Schmidt
23650cb946 Added library reference joy_libref to JOY interface. 2013-06-01 00:36:08 +02:00
Oliver Schmidt
619b215260 Added library reference em_libref to EMD interface.
Occasionally dynamically drivers suffer from not being to refer to
content in the C library. Therefore I added a mechanism to allow
a C library for a certian target to define a symbol that will be
handed over to dynamic drivers for that target. Then the drivers
can use their refernce to that symbol to access content in the C
library.
2013-06-01 00:11:31 +02:00
Greg King
051c21726b Added Inkwell lightpen drivers for the C64 and the C128.
They use the mouse driver programming interface.

Added a test program for lightpen drivers.  Now, it knows about only those two drivers; it will need updating when others are added.
2013-05-29 20:02:29 -04:00
Oliver Schmidt
85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00