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

3098 Commits

Author SHA1 Message Date
jede
8ec6d28f92 Revert read.s 2021-03-01 22:44:06 +01:00
jede
256b22f1c7 Add bordercolor and cvline 2021-03-01 22:36:09 +01:00
jede
02e52fe24d Fix many bugs 2021-03-01 22:33:12 +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
Greg King
98f8064b83 Made the directory functions compatible with the Commander X16's DOS.
It's directory listing's last line says, "mb free."
2021-02-15 08:56:31 -05:00
Oliver Schmidt
8551431233 Optimized based on https://github.com/cc65/cc65/pull/1393. 2021-02-05 11:54:07 +01:00
jede
a9dac3b1ef Fix X register for kbhit 2021-02-02 14:09:57 +01:00
jede
b52ee25385 Rollback read.s 2021-02-02 14:09:57 +01:00
jede
f622783ae1 kbhit added for telestrat target 2021-02-02 14:09:57 +01:00
jede
6c59a6254f Now getchar works 2021-02-02 14:09:57 +01:00
Greg King
d90cd11212 Fixed outdated comments. 2020-12-27 18:22:12 -05:00
Sven Michael Klose
9800555bbb Remove stale comments. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
9d62abb7ac Fix comment. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
db31204950 Remove stale comment. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
6201300816 Fold constant calculation. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
f59cb9af06 Use more compact loops. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
99c0815cdb Clear up comments a bit. 2020-12-27 17:54:49 -05:00
Sven Michael Klose
3957310950 Knock off two bytes from getcwd(), cbm_read() and cbm_write(). 2020-12-27 17:54:49 -05: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
Polluks
9563541870 crt0 clean-up 2020-11-29 18:08:33 +01:00
Greg King
a0d986faf8 Fixed the horizontal movement of the mouse pointer on platforms with the VIC-II display chip.
ca65's logical (Boolean) NOT operator was used where bitwise NOT should be used.  The effect was that all sprites were shifted to the left side of a screen when the mouse sprite was put on the left side.
2020-11-27 21:22:22 -05:00
Oliver Schmidt
79bdc2d51f Set correct prerequisite.
See https://github.com/cc65/cc65/issues/1318
2020-11-20 19:19:55 +01:00
Polluks
a0596eae6e Added waitvsync for PET 2020-11-18 10:28:19 +01:00
Oliver Schmidt
0cd8d37613
Fixed comment. 2020-11-17 08:53:48 +01:00
Greg King
5f65252fa6 Added the cputdirect entry point to the cputc() functions in the two Oric libraries.
It now is available in all libraries that have cputc().
2020-11-15 11:44:12 -05:00
Greg King
81edc3f582 Updated a comment about Kernal's STATUS variable. 2020-11-08 17:45:54 -05:00
Christian Groessler
39c0abed54 atarixl: fix compilation problem when CHARGEN_RELOC is defined 2020-10-30 15:01:47 +01:00
Greg King
aad17a6f05 Made two GEOS directory functions return NULL if they can't give a valid entry. 2020-10-29 18:06:01 -04:00
Oliver Schmidt
d8e6fa61bb Return NULL on error (or end of directory). 2020-10-29 17:44:19 +01:00
Christian Groessler
3537210674 add waitvsync() for atari and atari5200 2020-10-28 21:12:32 +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
jede
b8889bf37e Now getchar works 2020-10-23 23:47:30 +02:00
Greg King
0f66f7569e Updated the cx16 library to the upstream project's prerelease 38. 2020-10-17 14:48:01 -04:00
Greg King
a25b28a972 Added files to the pet library that support the overlay demo sample program.
cbm_load() is needed because the Pet/CBM Kernals don't have a LOAD function that can be used by machine code programs.
2020-10-15 21:22:04 -04:00
Greg King
e72e44d14f Shortenned the VIC-20's cputc() by 17 bytes.
Changed to a modified table look-up method to convert PetSCII to screen-codes.
2020-10-13 07:55:20 -04:00
Fabrizio Caruso
61ebe2c34b Indentation in vga.s for gamate 2020-09-24 19:42:34 +02:00
Fabrizio Caruso
6fdb356db7 Simplify Gamate tile redefinition (as already done for PCE) 2020-09-24 19:42:34 +02:00
Greg King
d906204e84 Allowed UPDCRAMPTR to be exported as a constuctor in the VIC-20 library. 2020-09-22 12:31:27 -04:00
Greg King
dc14751954 Exported the direct Kernal entries that were moved from target headers to "cbm_kernal.inc". 2020-09-22 00:04:24 -04:00
Jesse Rosenstock
0482e4d6e4 Fix CRLFs introduced by fe3f267 2020-09-18 08:57:28 +02:00
acqn
fe3f267233 Added new runtime sub bcasta/bcastax/bcasteax opposing to bnega/bnegax/bnegeax. 2020-09-11 13:33:54 +02:00
IrgendwerA8
f54e01781b Tiny optimizations for multiplication. 2020-08-29 16:34:20 +02:00
acqn
63fa9a5a42 Fixed usage of "lvalue-cast" in _scanf implementation. 2020-08-24 17:16:37 +02:00
compyx
81d3dedb41 Move comment block as requested 2020-07-24 15:24:28 -04:00
compyx
294b5d1cf1 C64 soft80 conio: shave off a few bytes and cycles 2020-07-24 15:24:28 -04:00
Oliver Schmidt
77674352f6
Minor style change. 2020-07-21 23:44:36 +02:00
Brad Smith
041f981960
rand() use XOR to break up unwanted pair correlation (#1107)
* rand() use XOR to break up unwanted pair correlation

This form of rand() cannot return the same value twice in a row.
Two additonal EOR instructions produce a more even distribution of successive pairs.
see comments on #951

* rand.s document purpose of XOR

* suggested srand() optimization: zero fill unnecessary

* test to validate implementation of rand()

* srand() improving behaviour and adding startup test

* srand() with a tail call to rand() for better initial shuffle

* srand() can fall through to rand() instead of tail call
2020-07-21 23:38:18 +02:00
Greg King
4296cbaf82 Added a 320x200x256 TGI driver to the Commander X16 library.
Made the mandelbrot sample program handle the X16's 256 colors.
2020-07-15 17:30:58 -04:00
Greg King
ba0ef5938d Moved the font into a separate module in the library.
The font can be replaced, at link-time, by a custom file.
2020-07-15 04:58:32 -04:00
Olli Savia
a02bec11e9 Another code style fix 2020-07-14 22:54:03 -04:00
Olli Savia
b3703de983 Code style fixes 2020-07-14 22:54:03 -04:00
Olli Savia
de5678af5d Added optimizations by dmsc 2020-07-14 22:54:03 -04:00
Olli Savia
e2ec517aae Save another 3 bytes 2020-07-14 22:54:03 -04:00
mrdudz
306f421aa9 Merge branch 'master' of https://github.com/cc65/cc65 2020-07-15 00:17:41 +02:00
mrdudz
6035f1cb75 added missing gotox/gotoy functions 2020-07-15 00:17:11 +02:00
Greg King
9023e975df Stopped the C128 mouse drivers from blocking certain keys such as '1', '2', and 'Q'.
This extra fix is needed because the C128 keyboard scanner works a little differently than the C64 scanner works.
Fixes #696. Fixes #853.
2020-07-14 16:06:21 -04:00
mrdudz
1f2fdbd9b1 implemented conio peek functions for PCE target 2020-07-14 14:23:58 +02:00
Olli Savia
a43cac580e Tiny optimization 2020-07-13 10:14:21 +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 f8c6c58373 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
compyx
381a32d9aa C64 soft80-conio cgetc: save 14 cycles in invertcursor
By 'inverting' the loop, we can save 16 cycles by removing the `cpy #8`,
saving 16 cycles. But we need an extra `ldy #7` at the start of the
loop, so the total cycles saved is 14. Code size doesn't increase due to
the addition of the `ldy #7` negating the removal of the `cpy #xx`.
2020-07-11 17:46:29 +02:00
compyx
2c4dd5decf Shorten comment as requested 2020-07-11 11:59:45 +02:00
compyx
e45e57d7ce C64 soft80 conio: save 4 bytes in firstinit
Also save 6 cycles as a very small bonus.
2020-07-11 11:59:45 +02:00
compyx
fb7996b0ce Revert "C64 soft80 conio: save 6 bytes in firstinit"
This reverts commit 943e68be6a.
2020-07-11 11:59:45 +02:00
compyx
695b1b01d8 C64 soft80 conio: save 6 bytes in firstinit
As a bonus, save 6 cycles.
2020-07-11 11:59:45 +02:00
Greg King
410e4502ee Added a 160x192x2 TGI (graphics) driver to the VIC-20 library.
The driver requires a special linker configuration: "vic20-tgi.cfg".
The VIC-20 computer needs at least 8K of expansion RAM!

"tgidemo.c" needed to be adjusted because the VIC-20's vertical (y) range is greater than its horizontal (x) range -- the opposite of most other platforms.  Also, the circle demo would jam on the VIC-20.
2020-07-08 05:55:30 -04:00
mrdudz
d1833cc441 Fix handling of charcodes 254 and 255, fixes issue #988 2020-07-08 00:48:39 +02:00
Dirk Jagdmann
aaecf3cfec replace JMP with BEQ to save 1 byte. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
070264acc4 remove tab characters. 2020-06-22 23:55:45 +02:00
Dirk Jagdmann
76091b96d4 C64 Kerberos extended memory driver 2020-06-22 23:55:45 +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
Greg King
14c62f1368 Allowed the TGI API to support 256 colors. 2020-06-04 12:58:05 -04:00
jede
6521930880 Fixed the name of the driver 2020-05-28 08:50:20 -04:00
jede
6c2d578c61 Fix eor bug 2020-05-28 08:50:20 -04:00
jede
50192fc65e Change name of the driver (telestrat-joy.s renamed to telestrat.s 2020-05-28 08:50:20 -04:00
jede
1d358a4734 Fix bug 2020-05-28 08:50:20 -04:00
jede
e8b1d51d28 Fix typo 2020-05-28 08:50:20 -04:00
jede
cd7abdb58d Fix typo 2020-05-28 08:50:20 -04:00
jede
532240a2db Telestrat joystick management 2020-05-28 08:50:20 -04:00
Oliver Schmidt
5b56c6e3a2 Disable potentially enabled double-width graphics. 2020-05-04 22:23:01 +02:00
Greg King
cbf0c1d1dd Updated the cx16 library to the Commander X16's ROM prerelease 37. 2020-05-02 13:46:06 -04:00
Stefan
4a224878d8 Preserve the accu 2020-04-06 18:13:54 +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
Jeremy Rand
62eb3137ab Update get_ostype.s
Do not check $fbbe when detecting the Apple //e card.  This byte is a version number for the Apple //e card according to misc technote #7 and it appears that the last version of the software that I am aware of has a 3 at this location.

Prior to this change, Apple //e cards which we not version 0 would be detected as an Apple //e enhanced.
2020-03-26 12:25:41 +01:00
Oliver Schmidt
b91ad02da1 Made use of 65C02 opcode (thx to polluks). 2020-03-05 14:38:36 +01:00
jede
0962a9f286 Fix 16 bits values 2020-02-13 05:46:46 -05:00
jede
026e57279d Fix bug in tgi_line : HRS(X) parameters are 16 bits. 2020-02-13 05:46:46 -05:00
IrgendwerA8
08705a3fdc Changes resulting from 2nd code review 2020-02-03 20:45:09 +01:00
IrgendwerA8
002d1801ec Changes resulting from code review. 2020-02-03 20:45:09 +01:00
IrgendwerA8
ce80624f62 ctype size optimization 2020-02-03 20:45:09 +01:00