1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-25 13:29:41 +00:00
Commit Graph

276 Commits

Author SHA1 Message Date
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
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
silverdr
2bcdf32458 blackystardust pull request with post-review changes 2016-02-26 23:55:55 +01: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
mrdudz
4a49b0c8f8 reset screen editor at shutdown 2015-11-22 19:20:58 +01:00
mrdudz
54de8ac031 remove unneeded exports 2015-11-07 11:45:38 +01: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
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
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
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
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
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
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
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
03c6af3e15 rewrote color voodoo 2015-10-09 23:39:37 +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
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
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
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