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

760 Commits

Author SHA1 Message Date
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
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
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
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
Stefan
96547d1dd4 Fix colors for #948 2019-10-09 06:15:38 -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
18afc7c703 Created a target and a library for the Commander X16 prototype computer. 2019-09-27 03:38:51 -04: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
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
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
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
8590de5cf3 Revert "atari5200: fix COLOR defines' names"
This reverts commit 87e653f47b.
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
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
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
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
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
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
IrgendwerA8
8ead5f2f5a Access Atari OS variables by structure. 2019-03-03 22:50:57 +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
Oliver Schmidt
10a31d006b Add translation from PETSCII to screen codes. 2019-02-12 17:47:17 +01:00
Christian Groessler
58484449b4 remove TABs 2019-02-05 23:27:52 +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
Scott Hutter
59ab140dc9 fix for err blank line removal 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
2f6f468aad Added SetNewMode() to geoslib - #814 2018-12-30 18:57:46 +01: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
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
Christian Groessler
6dc7309e50 Atari: add support for BW-DOS. Initially contributed by Daniel Serpell. 2018-09-27 17:37:59 +02:00
Christian Groessler
e9b8f5d814 Atari: Add detection of RealDOS (http://www.realdos.net/realdos.html). 2018-09-06 12:08:50 +02:00
Greg King
b5d939c858 Style changes. 2018-08-30 11:48:46 +02: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
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
Oliver Schmidt
3598fb505d Fixed Visual C++ build (and some style adjustments). 2018-08-19 00:01: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
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
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
Greg King
5e67eee362 Made the VIC-IIe TGI driver put its bitmap behind the ROMs. 2018-07-29 23:46:03 -04:00
Oliver Schmidt
97be359d4a Updated comment. 2018-07-26 13:09:21 +02:00
Greg King
6d87370881 Fixed strpbrk().
Added its prototype.  Documented it.
2018-05-29 14:29:50 -04:00
compyx
dade099b9d CBM kernal call SECOND, update cbm.h 2018-05-23 17:37:48 +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
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
Oliver Schmidt
a482b54ed7
Removed extern keyword from function prototype. 2018-04-29 13:50:09 +02:00
Marco van den Heuvel
11629bcf99 Added C65/C64DX accelerator code and documentation. 2018-04-27 14:22:41 -07:00
Marco van den Heuvel
97e69952c4 Removed extern keyword from function prototypes. 2018-04-27 09:16:25 -07:00
Marco van den Heuvel
f2e46f0fdf Added C64 Chameleon accelerator code and documentation. 2018-04-25 12:53:29 -07: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
Marco van den Heuvel
3f5683b391 Added C128 in C64 mode accelerator code and documentation. 2018-04-20 12:08:28 -07:00
Marco van den Heuvel
6076316f38 Added c64dtv accelerator code and documentation. 2018-04-14 10:40:13 -07: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
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
03ba3f7473 Added c16/plus4 fast(), isfast() and slow() functions, and updated the documentation accordingly. 2018-03-23 14:27:15 -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
Marco van den Heuvel
2533cc8d75 Added the vic20 georam emd. 2018-03-19 11:34:41 -07:00
Marco van den Heuvel
0c7496f08b Added vic20 - ram emd. 2018-03-16 14:23:52 -07:00
Marco van den Heuvel
0eb1eb625f Undo my previous commit. 2018-03-09 10:46:02 -08:00
Marco van den Heuvel
22d4b0d497 Improved tv timing detection for the c64. 2018-03-08 16:06:33 -08:00
Marco van den Heuvel
5a9d908007 Added 2a03/2a07 and HuC6280 detection. 2018-03-01 14:57:42 -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
b0ef67d14c Added GEOS 1.3 and 1.5 detection. 2018-02-15 15:24:58 -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
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
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