1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00
Commit Graph

120 Commits

Author SHA1 Message Date
mrdudz
eb96a90e5f initial import from old sources 2016-02-28 22:35:46 +01:00
mrdudz
85760e0c53 initial import from old sources 2016-02-28 22:13:05 +01: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
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
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
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
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
Oliver Schmidt
23650cb946 Added library reference joy_libref to JOY interface. 2013-06-01 00:36:08 +02:00
Oliver Schmidt
85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
Oliver Schmidt
81e467cdc2 Replaced whole bunch for Makefiles with a single generic Makefile.
- No complex shell logic.
- "Source file shadowing" for all targets via vpath.
- Dependency handling.
- True incremental build.
- Don't write into source directories.
- Easy cleanup by just removing 'wrk'.
2013-05-04 22:15:30 +02:00
Oliver Schmidt
008b4c4e1d Replaced whole bunch for Makefiles with a single generic Makefile.
- No complex shell logic.
- "Source file shadowing" for all targets via vpath.
- Dependency handling.
- True incremental build.
- Don't write into source directories.
- Easy cleanup by just removing 'wrk'.
2013-05-04 22:10:48 +02:00
ol.sc
2e5823d43d Save some bytes by sharing the code doing the actual vector setting. Note: Jumping from segemnt INIT to segment CODE is okay while the other way wouldn't be.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5989 b7a2c559-68d2-44c3-8de9-860c34a00d81
2013-02-14 16:48:05 +00:00
ol.sc
7c9171ee87 Moved IRQ hooking / unhooking from startup code to constructor / destructor to avoid linking in the hooking / unhooking code (and callirq) for the majority of cc65 prorams not linking in interruptors.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5985 b7a2c559-68d2-44c3-8de9-860c34a00d81
2013-02-12 22:39:38 +00:00
ol.sc
6860ac7dfd Introduced static standard drivers.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5891 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-11-01 19:53:47 +00:00
ol.sc
1bba8355da Fixed typo.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5889 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-10-31 23:39:58 +00:00
ol.sc
a3c940e315 Convert dynamically loadable drivers into statically linkable drivers and add them to the target libraries.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5887 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-10-29 20:26:26 +00:00
ol.sc
59e96ef740 Turned the 'ST' status byte into a symbol resolved by the linker in order to allow to use it from code living in the 'cbm' directory.
Moved getdevice.s from 'c64'/'c128' to 'cbm' making use of the new 'ST' setup.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5834 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-09-30 18:20:15 +00:00
uz
285aaf8933 Patch by Stefan Haubenthal: Remove __fastcall__ in comments and/or the
function description for functions that don't take any parameters.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5573 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-03-04 13:08:54 +00:00
uz
5b659547b8 Removed the jump to RESTOR on exit for all the CBM platforms.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5355 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-01 19:58:31 +00:00
uz
81cfbe06c6 Changed the startup module and the linker config for the Commodore VIC to use
the common loadaddr and exehdr modules.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4874 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-17 13:35:43 +00:00
uz
fa1b5047dd Fixed order of options in call to ld65, which became important after the
latest changes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4843 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-11-09 21:33:14 +00:00
ol.sc
d1f5b74f01 Now that we reduce the size of the RAM memory area by the stacksize in the linker configuration we need to add the stacksize to end of the RAM area when setting the initial stack pointer in the startup code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4822 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-10-02 10:37:20 +00:00
ol.sc
d1aad57b98 Initialize _curunit from the zeropage value DEVNUM (aka First Address) in a constructor with a very high priority to be called before DEVNUM gets overwritten by other constructors.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4588 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-02-14 23:12:54 +00:00
uz
7d03059240 Fixes for the ptvjoy drivers by Marco van den Heuvel.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4581 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-02-04 21:02:00 +00:00
uz
7e2a24176f Replaced $30 by literal '0' for better readability.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4513 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-10 22:12:24 +00:00
uz
13698871cb Removed the call to CLRCH in the startup code.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4512 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-10 21:22:17 +00:00
uz
60bc009991 * Moved the BASIC stub that calls the compiled program into it's own segment
named EXEHDR.
* Renamed BASICHDR to EXEHDR for the PET-II machines.
* Moved the call to CHRCH in front of the code that saves the zero page, since
  open files are sometimes remembered in the zero page, so we need to close
  them before we grab a copy.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4507 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-12-09 12:42:24 +00:00
uz
bfbf94404b Squeezed bytes and cycles out of the kbhit functions for almost all platforms.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4480 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-24 18:31:16 +00:00
uz
c7a33334ba Don't hardcode the address of the SYS call for the startup code of the
Commodore machines.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4474 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-11-23 12:01:24 +00:00
uz
5c5d01d84a Moved most platform assembler includes into asminc, so they will be available
in the distribution. 
Added --forget-inc-paths to the command line of the assembler in the
Makefiles, because the assembler does now have builtin paths and will find
include files from an installation first.
Hopefully fixed any problems that arose from the two changes.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4223 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-09-24 17:44:22 +00:00
uz
8216bf1d6a Force an import of the special symbol __STARTUP__ in the C compiler when
main() is encountered. Define this symbol in the startup code. This will
automatically force linking of the startup code which can then reside inside
the standard library as any other object file.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3988 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-07-31 12:05:42 +00:00
uz
7e9b6e7311 Fixed problems with the startup code (Greg King): Interrupts must be hooked
before calling initlib because initlib calls contructors and may install
drivers, which enable hardware interrupts. Similar for donelib.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3897 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-31 18:22:51 +00:00
uz
4812feb44b git-svn-id: svn://svn.cc65.org/cc65/trunk@3863 b7a2c559-68d2-44c3-8de9-860c34a00d81 2008-08-02 22:02:54 +00:00
cuz
f257b2ee81 Moved the data that keeps a copy of the used zero page locations in its own
segment to reduce the executable size.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3849 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-07-03 19:39:14 +00:00
cuz
a92d2eb0b7 Driver for Protovision 4 Player Joystick by Stefan Haubenthal
git-svn-id: svn://svn.cc65.org/cc65/trunk@3595 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-08-28 21:01:59 +00:00
cuz
bec540da9e Fixed obsolete __IRQFUNC_COUNT__ symbol name
git-svn-id: svn://svn.cc65.org/cc65/trunk@3548 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-07-25 17:05:52 +00:00
cuz
d0bee35728 Move constructor code into the INIT segment
git-svn-id: svn://svn.cc65.org/cc65/trunk@3405 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-02-26 09:28:46 +00:00
cuz
dc781be7f9 Add the irq entry point
git-svn-id: svn://svn.cc65.org/cc65/trunk@3280 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-11-06 13:27:38 +00:00
cuz
463712217c Add interrupt handling code from Stefan Haubenthal
git-svn-id: svn://svn.cc65.org/cc65/trunk@3264 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-10-26 19:44:30 +00:00
cuz
7b13d79bde Use get_tv.inc
git-svn-id: svn://svn.cc65.org/cc65/trunk@3259 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-10-26 19:05:19 +00:00
cuz
75f7b6cf4e Add definitions for tools so the makefile is useful by itself.
Added the get_tv module.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3258 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-10-26 18:58:48 +00:00
cuz
dd6ce2fddd New get_tv function from Stefan Haubenthal
git-svn-id: svn://svn.cc65.org/cc65/trunk@3230 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-10-08 20:23:15 +00:00
cuz
25cf8a3d27 The VIC20 doesn't have PALFLAG (Stefan Haubenthal)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3229 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-10-08 20:21:33 +00:00
cuz
fd80d1e7c9 Added command line param evaluation
git-svn-id: svn://svn.cc65.org/cc65/trunk@3000 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-04-28 12:16:41 +00:00
cuz
7a5d4f3138 Fixed issues with the last change: The return code must be pulled from stack
before the stack pointer is reset.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2906 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-03-08 20:38:58 +00:00
cuz
220e5a3898 Place the return code into ST
git-svn-id: svn://svn.cc65.org/cc65/trunk@2884 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-03-02 17:08:07 +00:00
cuz
be5adac693 Use the assembler version as BASIC line number, so the version of the
assembler (and probably compiler) can be determined from a compiled
executable. Nice idea from Stefan Haubenthal.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2880 b7a2c559-68d2-44c3-8de9-860c34a00d81
2004-02-02 13:34:12 +00:00
cuz
b15e4106dc Use new joystick decls
git-svn-id: svn://svn.cc65.org/cc65/trunk@2777 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-16 22:38:12 +00:00
cuz
a3109620ab Changed rm -f to $(RM)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2385 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-20 11:59:27 +00:00
cuz
4e76d0155d New uname function
git-svn-id: svn://svn.cc65.org/cc65/trunk@2286 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-12 17:24:02 +00:00
cuz
3b3e1bec17 Removed the empty LOWCODE segments from the startup files. This is now
handled by the OPTIONAL segment attribute in the linker config.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2164 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-05-22 22:32:04 +00:00
cuz
37178d5141 Make screensize() fetch the values dynamically instead of using variables
that are set on startup. This is needed to support the C128, which can switch
the screen size at runtime.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2042 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-04-09 19:34:57 +00:00
cuz
467d8ad9c5 Added routines to handle command line params
git-svn-id: svn://svn.cc65.org/cc65/trunk@2012 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-03-10 21:21:46 +00:00
cuz
ee155a8553 Renamed the DEINSTALL vector to UNINSTALL.
Added a comment regarding usage of the driver when it is linked statically
to the application.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1952 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-02-10 22:19:53 +00:00
cuz
a8810a464d Make sure the zap target is available
git-svn-id: svn://svn.cc65.org/cc65/trunk@1932 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-02-06 15:35:30 +00:00
cuz
69ac0ce1fc Added joy_stddrv modules
git-svn-id: svn://svn.cc65.org/cc65/trunk@1821 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-12-21 09:32:14 +00:00
cuz
3771aaa558 Converted the VIC20 joystick to a loadable module
git-svn-id: svn://svn.cc65.org/cc65/trunk@1807 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-12-20 23:23:06 +00:00
cuz
36fe6284a8 For the CBM platforms, make revers() machine dependent and use the RVS flag
of the different machines instead of a separate one.
For the C128, make the textcolor() function work in 40 and 80 column mode.


git-svn-id: svn://svn.cc65.org/cc65/trunk@1787 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-12-19 20:29:27 +00:00
cuz
9595d16ac0 Fixed the PLOT function
git-svn-id: svn://svn.cc65.org/cc65/trunk@1728 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-12-09 10:45:16 +00:00
cuz
bbbf2ac45a Move the startup code into its own segment
git-svn-id: svn://svn.cc65.org/cc65/trunk@1581 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-22 17:43:30 +00:00
cuz
6d498d8187 Use external symbols for the CBM kernal jump table functions. This allows
to emulate these functions on platforms where one or more of these functions
are not available (PET, CBM-II).


git-svn-id: svn://svn.cc65.org/cc65/trunk@1544 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-19 23:02:47 +00:00
cuz
751aaee63d Finally: Commodore file I/O
git-svn-id: svn://svn.cc65.org/cc65/trunk@1531 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-16 23:45:15 +00:00
cuz
163c421db0 Renamed randomize to _randomize
git-svn-id: svn://svn.cc65.org/cc65/trunk@1489 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-05 20:17:38 +00:00
cuz
3fae969b5b New randomize() function for nearly all platforms
git-svn-id: svn://svn.cc65.org/cc65/trunk@1487 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-05 10:48:20 +00:00
cuz
4b805447b6 Prepare VIC20 startup for different start addresses
git-svn-id: svn://svn.cc65.org/cc65/trunk@1390 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-08-11 15:11:31 +00:00
cuz
94ea416652 Optimization
git-svn-id: svn://svn.cc65.org/cc65/trunk@1384 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-08-09 05:07:06 +00:00
cuz
76ee9a1f66 New, shorter readjoy function
git-svn-id: svn://svn.cc65.org/cc65/trunk@1382 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-08-08 12:27:40 +00:00
cuz
93dbb62e9f Small optimizations
git-svn-id: svn://svn.cc65.org/cc65/trunk@1379 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-08-07 19:35:15 +00:00
cuz
8a4378e60c Remove unused code, port to new version
git-svn-id: svn://svn.cc65.org/cc65/trunk@1377 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-08-07 19:28:23 +00:00
cuz
f0d89e09bc Added VIC20 port changes from Steve Schmidtke
git-svn-id: svn://svn.cc65.org/cc65/trunk@1376 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-08-07 05:18:13 +00:00