1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-04 13:29:35 +00:00
Commit Graph

3427 Commits

Author SHA1 Message Date
Greg King
6ac4aa4e20 Made cbm_open() be more efficient.
The fastcall argument doesn't need to be put on a stack.  SETNAM can be called before SETLFS.
2021-12-24 00:10:04 -05:00
Greg King
884f72637b Put the alignment decrement code back into posix_memalign().
Without that code, the function returns a very broken pointer.
2021-12-19 21:08:46 -05:00
Oliver Schmidt
2235830e31 Don't rely on (actually changed) unspecified compiler behavior. 2021-12-19 16:55:32 +01:00
Bob Andrews
c0c89a81e4
Merge branch 'master' into rremd 2021-12-11 22:36:12 +01:00
Oliver Schmidt
8b0de8a931
Merge branch 'master' into master 2021-11-23 22:56:51 +01:00
Gabriele Gorla
6637e28831 saves 2 bytes in the standard c64 joystick driver
remove redundant code and add jmp to the common sequence
two more bytes could be saved at the expense of longer sequence with interrupts disabled by moving sei/cli
2021-11-23 21:34:49 +01:00
Wayne Parham
5f4605c4fc Remove trailing blank lines from read.s, write.s and tapeio.s 2021-06-16 17:28:19 -05:00
Wayne Parham
d6ef8326f9 Remove trailing blank line from libsrc/sym1/display.s 2021-06-16 17:24:18 -05:00
Wayne Parham
85d345088d Remove trailing two blank lines from libsrc/sym1/crt0.s 2021-06-16 17:21:57 -05:00
Wayne Parham
a93542e80c Added __fastcall__ to comments 2021-06-16 16:24:26 -05:00
Wayne Parham
faf6266cde typo in comment 2021-06-12 06:28:53 -05:00
Wayne Parham
c9bb1483ac Add BEL->beep functionality 2021-06-12 06:17:03 -05:00
Wayne Parham
9e6c1d1303 tapeio and symNotepad updates 2021-06-11 19:55:13 -05:00
Greg King
14d05c61b6 Made Creativision's joystick driver more efficient. 2021-06-11 07:43:25 -04:00
Greg King
af3d4581d3 Moved Creativision's playsound() into a separate file.
It won't waste space in a cartridge if it isn't used.
2021-06-11 07:43:25 -04:00
Greg King
f636d4e634 Fixed the Creativision library's bios_playsound().
It was disabling interrupts permanently.
2021-06-11 07:43:24 -04:00
Wayne Parham
24f5bac899 Added BEL -> beep() functionality 2021-06-10 16:07:39 -05:00
Wayne Parham
7d6541274d Changes to I/O access 2021-06-09 10:23:42 -05:00
Wayne Parham
886e9e83b2 Removed stdin->stdout echo from read.s 2021-06-07 12:33:29 -05:00
Wayne Parham
88ee45e9ef tapeio.s updates 2021-06-07 00:35:20 -05:00
Wayne Parham
dc9333a3bb tapeio.s updates 2021-06-07 00:18:26 -05:00
Wayne Parham
c961782192 Removed libref.s 2021-06-07 00:07:09 -05:00
Wayne Parham
0bbff54378 return val updates 2021-06-07 00:03:44 -05:00
Wayne Parham
9d509735a8 Makefile changes 2021-06-06 21:56:23 -05:00
Wayne Parham
64afb50d5a Makefile changes 2021-06-06 21:45:58 -05:00
Wayne Parham
6c4c959141 Sym-1 lib changes 2021-06-06 21:28:03 -05:00
Wayne Parham
69e2313a63 First round of requested code changes 2021-06-06 23:20:54 +01:00
Greg King
6bedade593 Fixed the creativision function prototypes.
Added const to a pointer parameter.
2021-05-29 08:37:38 -04:00
Greg King
663268dca9 Syncronize the Supervision crt0.s with its ld65 config files.
.segment "VECTOR" -> "VECTORS". Fixes #1506.
2021-05-21 03:32:43 -04:00
Christian Groessler
681c9594cc libsrc/atari5200/crt0.s: fix formatting 2021-05-21 01:45:55 +02:00
mrdudz
6d560f4236 change prototype for GraphicsString() to void __fastcall__ GraphicsString(const void *myGfxString); 2021-05-18 15:16:14 +02:00
mrdudz
5fc9d3f048 change driver _install calls from taking "void*" to "const void*" 2021-05-16 22:57:28 +02:00
WayneParham
e9fd87d07a
Merge branch 'master' into master 2021-05-16 10:02:37 -05:00
Christian Groessler
09e0e74124 (again) remove TABs 2021-05-13 18:12:12 +02:00
Andrea Odetti
05f545e189 More line number related changes. 2021-05-11 17:41:59 +02:00
Wayne Parham
044a0838a3 Changes to existing cc65 source to support Synertek Systems Sym-1 2021-05-09 16:52:48 -05:00
Wayne Parham
6e79379405 Synertek Systems Sym-1 machine-specific files 2021-05-09 16:34:53 -05:00
polluks2
b1f81d5e21 Optimised code 2021-05-08 19:48:31 +02:00
Polluks
4c37f12a4d Optimised strlen 2021-05-08 19:36:37 +02:00
Greg King
216bb22b20 Added a special version of a function which uses an absolute addressing mode to access the zero page.
The PCEngine needs such operands to be redirected to RAM page $20 explicitly.  Fixes #1482; fixes #1483.
2021-05-04 12:10:43 -04:00
Oliver Schmidt
5d84a4ba13 Removed non-ASCII chars. 2021-04-19 16:06:10 +02:00
Christian Groessler
200b420562 Export LMARGN_save to C. People might want to preserve this setting in their program.
In turn rearrange startup code in order that LMARGN can be set by a 'constructor' (Do
"initlib" later.)
2021-04-01 15:19:06 +02:00
acqn
31c1172a3a zlib: Use correct (un)signedness of char in prototypes and functions.
Also ensure we are using the same constness qualifiers.
2021-03-30 19:41:20 +02:00
Greg King
710c6c6f2f Fixed cbm_k_readst() to work around a VIC-20 Kernal bug.
It properly returns the RS-232 device's status.
2021-03-25 15:22:18 -04:00
jede
b9fd318985 fix space/column 2021-03-13 00:15:05 +01:00
jede
c0d638a26d add clock for Telestrat target and add some Telemon primitives 2021-03-13 00:15:05 +01:00
jedeoric
4f26650228
[Telestrat] chdir management (#1419)
* add syschdir

* revert read.s

* remove extra line

* Now we update __cwd

* Fix tab

* Fix another tab

* Fix tab

* Fix tab and jmp

* fix xgetcwd

* Fix comments
2021-03-11 09:42:14 +01:00
greg-king5
23fba6cc37
Merge pull request #1412 from jedeoric/master
[Telestrat] Fix many bugs in conio Telestrat target
2021-03-09 18:44:20 -05:00
jede
a05dddd0d6 Fix next column 2021-03-09 22:02:26 +01:00
jede
facc1b4914 Fix cputdirect 2021-03-08 21:16:44 +01:00
jede
df64fd859c Fix cvline bug 2021-03-07 23:00:15 +01:00
jede
48badc0816 Fix import return0 2021-03-06 21:40:26 +01:00
Oliver Schmidt
bc8cca9fc4 Revert "Now getchar works"
This reverts commit 1fc16cb9ed.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
f122837955 Revert "add syschdir"
This reverts commit d83e8a3f0e.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
d6f2fda575 Revert "revert read.s"
This reverts commit 65d5786da5.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
8ae5a4a134 Revert "remove extra line"
This reverts commit 973a5337ac.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
ab4ca51848 Revert "Now we update __cwd"
This reverts commit d417baf826.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
558dfa285e Revert "Fix tab"
This reverts commit 17ca09ba9a.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
24d63a96b1 Revert "Fix another tab"
This reverts commit 9b36565485.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
f9ca091bd0 Revert "Fix tab"
This reverts commit 2ae41e0a55.
2021-03-06 12:03:05 +01:00
Oliver Schmidt
1d8479b411 Revert "Fix tab and jmp"
This reverts commit bf9d4ac3bb.
2021-03-06 12:03:05 +01:00
jede
bf9d4ac3bb Fix tab and jmp 2021-03-04 18:02:26 +01:00
jede
2ae41e0a55 Fix tab 2021-03-04 18:02:26 +01:00
jede
9b36565485 Fix another tab 2021-03-04 18:02:26 +01:00
jede
17ca09ba9a Fix tab 2021-03-04 18:02:26 +01:00
jede
d417baf826 Now we update __cwd 2021-03-04 18:02:26 +01:00
jede
973a5337ac remove extra line 2021-03-04 18:02:26 +01:00
jede
65d5786da5 revert read.s 2021-03-04 18:02:26 +01:00
jede
d83e8a3f0e add syschdir 2021-03-04 18:02:26 +01:00
jede
1fc16cb9ed Now getchar works 2021-03-04 18:02:26 +01:00
Greg King
5f145542b0 Exported the Commodore CHRIN and CHROUT Kernal functions, in the CBM libraries.
This commit complements commit 98f8064b83.
2021-03-03 17:39:53 -05:00
jede
872739b5f4 Fix comments, return line and bordercolor return 2021-03-03 22:14:29 +01:00
jede
cdbe23c351 Fix missing new line in bordercolr 2021-03-01 23:21:58 +01:00
jede
3adddf5825 Merge branch 'master' of https://github.com/jedeoric/cc65 2021-03-01 23:20:37 +01:00
jede
185c451000 Fix cputdirect 2021-03-01 23:19:30 +01:00
jedeoric
ba4310f589
Merge branch 'master' into master 2021-03-01 23:03:34 +01:00
jede
abef6566e7 Add revers.s 2021-03-01 22:45:05 +01:00
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
mrdudz
a59402d5f5 store y first, then a. fix by willymanilly 2020-01-26 02:18:04 +01:00
Oliver Schmidt
0f08ae2c12 Minor cleanup. 2020-01-18 19:29:24 +01:00
Greg King
b66f7272af Updated the cx16 library to the ROM's prerelease 36. 2020-01-11 02:20:52 -05:00
mc78
244dc358e5 Changed the order in which lo/hi bytes of vdc addr are set according to willimanilys ((z64k) suggestions. Changed offset for vdc ramsize detection from 000 to 000. 2020-01-03 13:51:20 -05:00
mc78
390878e831 Added reservation of second byte for pagecount 2020-01-03 13:51:20 -05:00
mc78
2a42139674 Changes in INSTALL routine from emd/c128-vdc.s.
tmp1 was used at two places resulting in the bug that VDC_CSET was set to garbage on 16k VDC.
pagecount and curpage were not reset on INSTALL resulting in non-reentrant code on static linkage of emd driver.
2020-01-03 13:51:20 -05:00
Greg King
b56ba8f073 Added real-time clock functions to the cx16 library. 2019-12-27 18:07:37 -05:00
Greg King
f067c4530f Made the program-chaining exec() handle the X16 emulator's file-system. 2019-12-25 14:53:32 -05:00
Greg King
3fa253d31f Updated the cx16 library to the Commander X16 Kernal's prerelease 35. 2019-12-25 10:56:32 -05:00
Stefan
d1fd7ffc59 Update status.s 2019-11-20 12:54:47 +01:00
Stefan
9d4d00737e Update slow.s 2019-11-20 12:54:47 +01:00
Stefan
eeefd10f8f Update revers.s 2019-11-20 12:54:47 +01:00
Stefan
2c34723a97 Update isfast.s 2019-11-20 12:54:47 +01:00
Stefan
df752ff7a5 Update fast.s 2019-11-20 12:54:47 +01:00
Stefan
3f360fe3ee Update cputc.s 2019-11-20 12:54:47 +01:00
Stefan
06c98952fc Update conio.s 2019-11-20 12:54:47 +01:00
Stefan
4497998944 Update color.s 2019-11-20 12:54:47 +01:00
Stefan
d9a6fbac48 Fixed C16 #978 2019-11-20 12:54:47 +01:00
mc78
db971d8a65 Removed unnecessary #include <cc65.h> from convert.c
Adjusted block comments to predominant style
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
694dd9240f Added comment to debugger exit with error 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
ac4866c027 Made assert() send SIGABRT when an assertion fails.
A signal handler can catch it, and do anything needed to make stderr work.
2019-11-10 12:46:01 -05:00
Piotr Fusik
d38417b347 Optimize sign extension. 2019-11-07 21:45:19 +01:00
Piotr Fusik
985371433b Swap the positive/negative paths to save a branch. 2019-11-07 21:45:19 +01:00
Piotr Fusik
421c3f2b4f Don't set carry when already set. 2019-11-07 21:45:19 +01:00
Piotr Fusik
2bec637637 Optimize a negation in signed division. 2019-11-07 21:45:19 +01:00
Richard Halkyard
0d21a2b5a4 Reformat comments to style guide rules 2019-11-02 11:21:50 +01:00
Fabrizio Caruso
2bd798fa13 Optimizations 2019-10-30 18:00:27 -04:00
Fabrizio Caruso
78d660da55 kbhit checks KBEDG and getc resets KBEDG 2019-10-30 18:00:27 -04:00
Fabrizio Caruso
43f24afe29 stz 2019-10-30 18:00:27 -04:00
Fabrizio Caruso
609f63ac74 Second tentative fix 2019-10-30 18:00:27 -04:00
Curt J. Sampson
1d39863a60 vic20/cputc: Fix incorrect CRAM_PTR at startup when using conio
To do this we add a constructor call to UPDCRAMPTR, which is the ROM
routine that fixes up CRAM_PTR to match the screen location pointed to
by SCREEN_PTR.

This adds two additional bytes to programs using cputc() or other
routines that call it. These are in theory recoverable, but the VIC-20
does not yet free space used by constructors after the constructors
have been called.

Thanks to <greg.king5@verizon.net> (GitHub: greg-king5) for
investigating the difference in the VIC-20 KERNAL from the C64 and
proposing this solution to the problem.[1]

[1]: https://github.com/cc65/cc65/issues/946#issuecomment-538502820
2019-10-25 16:03:38 -04:00
Curt J. Sampson
128991d868 libsrc/*/kplot.s: Use cbm_kernal.inc symbols, not hardcoded addrs
On C64, VIC-20 and Plus/4, the conio library PLOT routine uses direct
calls into the Kernal, including the Kernal PLOT routine that we're
replacing. These were previously hardcoded addresses; we change these
to use the symbols for those routines defined in cbm_kernal.inc. (This
changes no functionality.)

To do this, we need to import cbm_kernal.inc in a namespace so we
don't have a collision between the PLOT that we're defining and the
Kernal definition.

We also add a UPDCRAMPTR symbol (used by kplot for VIC-20 and C64) to
the direct entry kernal routines in in cbm_kernal.inc, and expand the
comments describing what the "direct entry" Kernal routines are.

<greg.king5@verizon.net> (GitHub: greg-king5) came up with this idea
and did initial testing of it.

This has been tested on VICE xvic, x64 and xplus4 emulators with a
program that does a cputs() call (github.com/0cjs/vic20cc65) to
confirm that it works the same way after as it did before.
2019-10-25 16:03:38 -04: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
Fabrizio Caruso
1074d35a15 remove bra 2019-10-18 11:15:54 -04:00
Fabrizio Caruso
e4b60e1068 Remove useless tax 2019-10-18 11:15:54 -04:00
Fabrizio Caruso
da01286037 Tentative solution for cgetc in Lynx 2019-10-18 11:15:54 -04:00
Stephan Mühlstrasser
55444b8337 Removed redundant LDA
After the removal of the redundant AND in commit
704c8df04f also the
subsequent LDA became redundant.
2019-10-15 09:38:23 -04:00
Stephan Mühlstrasser
7547c4c77c Address review comments
- removed typo from comment
- removed redundant AND instruction
2019-10-15 09:38:23 -04:00
Stephan Mühlstrasser
eb2317d014 Restructured according to review
Restructured according to review in pull request #567.

The "inputc" function was moved in slightly modified form
to kbhit.s and replaces the old keyboard scanner.
cgetc() uses the new kbhit() to read a character.
2019-10-15 09:38:23 -04:00
Jeff Tranter
e2007d0743 New OSI input routine based on disassembly of ROM code. 2019-10-15 09:38:23 -04:00
Fabrizio Caruso
9a3e521358 small m and n fixed 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
bac6f94929 Fix 127 (second left arrow) 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
b91e233714 Fix left arrow (char 77=13+64) 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
d04f7935c3 M N fixed 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
0210d76694 Fix 4 2019-10-13 09:03:46 -04:00
Fabrizio Caruso
5eda1c256c Fix char 35 38 42 47 52 2019-10-13 09:03:46 -04:00
LRFLEW
e660a49347 [cx16] Update ROM banks to new mapping 2019-10-12 04:51:27 -04:00
Greg King
f3f15cfd25 Fixed problems with the Atari Lynx's TGI driver.
* The sprite-types for black and transparent backgrounds were swapped.
* A filler-byte for text output isn't printed.  (A hardware bug might not need that work-around in most cases.)
2019-10-12 04:01:03 -04:00
LRFLEW
216105f6df Update comments in rand.s 2019-10-09 17:09:05 +02:00
LRFLEW
3994fee595 Significantly faster rand() implementation 2019-10-09 17:09:05 +02:00
Fabrizio Caruso
fb260ef17f Init is no longer in crt0.s 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
40cf719068 Use decimal for lcd size initialization 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
915836b3ec Improve init code readability 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
cdb8035cf0 Move screen init into crt0.s 2019-10-09 17:01:02 +02:00
Fabrizio Caruso
9bd92178b6 Fix Gamate RVS 2019-10-04 10:22:25 +02:00
Greg King
9dfc8f84bc Fixed cgetc().
The GETIN function doesn't protect CPU registers.
2019-10-01 05:30:36 -04:00
Greg King
2546c6ba1c Put the C64 code into cx16/_scrsize.s.
(I forgot that SCREEN is an official jumptable function.
2019-09-28 01:38:16 -04:00
Greg King
6cae84a25d Updated the cx16 start-up to the emulator's release 32.
Made the Kernal ROM be visible when programs start.
2019-09-28 00:54:27 -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
Oliver Schmidt
3b128ba59f Use MACHID to check for realtime clock.
There's no need to do guesswork to know if a realtime clock is present/active.
2019-09-10 09:49:06 +02:00
jede
3d63a8bb62 Cleaning 2019-07-31 18:07:28 +02:00
jede
3b07b8b8e3 Add cclear and cclearxy 2019-07-31 18:07:28 +02:00
jede
cceffbdb8c Fix bug $FF 2019-07-21 14:11:51 -04:00
jede
e7bb0aad19 Fix comment and gotox force colour change 2019-07-21 14:11:51 -04:00
jede
996537282c Cleaning import variables 2019-07-21 14:11:51 -04:00
jede
848df36f6b Optimize Clrscr 2019-07-21 14:11:51 -04:00
jede
0fe98a7ca8 Fix bgcolor and textcolor must return last color, jmp remove. 2019-07-21 14:11:51 -04:00
jede
f9e13abc11 jmp instead of jsr 2019-07-21 14:11:51 -04:00
jede
ede64f68a9 Fix bug with bgcolor and textcolor 2019-07-21 14:11:51 -04:00
jede
6f7f6b5119 Fix label, optimize code 2019-07-21 14:11:51 -04:00
jede
a0a6537bda Fix typo and optimize 2019-07-21 14:11:51 -04:00
jede
28eba8bff9 fix import 2019-07-21 14:11:51 -04:00
jede
7767a0e88e fix typo 2019-07-21 14:11:51 -04:00
jede
3d5811d8f5 Fix gotoy changecolor 2019-07-21 14:11:51 -04:00
jede
7f9e73a1ce Add textcolor and bgcolor.s 2019-07-21 14:11:51 -04:00
jede
14ac1a7ff6 Fix bug : gotoxy does not working because Y does not update the adress on the screen 2019-07-21 14:11:51 -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
6efb71bea7 Rearranged paravirt function vector.
- exit right below 6502 vectors.
- keep exit addr stable as it may be called from asm.
2019-05-30 00:10:17 +02:00
Oliver Schmidt
c6bbea0bb0 Renamed program start label. 2019-05-30 00:06:31 +02:00
bbbradsmith
9fcd91ebe9 sim65 header comment fix 2019-05-29 22:56:51 +02:00
bbbradsmith
fb7d4acd5c versionable header for sim65
load and run address now configured from header
fix error codes not to conflict with test
fix test/misc/endless.c which is supposed to fail if an endless loop does not occur
2019-05-29 22:56:51 +02:00
bbbradsmith
2f3cae0d2e movable sp for sim65 2019-05-29 22:56:51 +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
03311e7268 atari5200: update docs for recent conio changes
also renames libsrc/atari5200/extra/conioscreen_20x12.s to
libsrc/atari5200/extra/conioscreen-20x12.s to be in line with
other optional link modules
2019-04-13 11:07:06 +02:00
Christian Groessler
78daf84f12 atari5200: name conio constructor 'initconio' 2019-04-12 12:49:38 +02:00
Christian Groessler
e1e6bec9ff atari5200: changes from discussions in #870
- rename screen_setup to initconio
- use Greg King's version of bgcolor()
2019-04-12 12:49:38 +02:00
Christian Groessler
d7eecb57f8 atari5200: get rid of conio_colors table
use system color variables instead; improve testcode/lib/atari5200/hello.c
test program
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
79b9a8d2df atari5200: add screensize function 2019-04-12 12:49:38 +02:00
Christian Groessler
db01036e2e atari5200: add alternative conio screen (20x12 resolution) 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
Oliver Schmidt
fc6a63a15e Avoid unintended file "shadowing".
3d8c3a4948 caused an unintended "shadowing" of files in /libsrc/runtime by files in /libsrc/common. Therefore the files in question are renamed (again) in /libsrc/common to make the files in /libsrc/runtime "visible" again.
2019-04-04 09:16:59 +02: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
Bas Wassink
96d0b00a76 Merge https://github.com/cc65/cc65
Pull to fix extra changes in PR #863
2019-03-24 20:49:53 +01:00
Bas Wassink
2eac69a943 Remove trailings spaces from CBM-related asm files 2019-03-22 22:54:05 +01:00
IrgendwerA8
e1a4910580 Code review changes and build fix. 2019-03-04 23:32:56 +01:00
IrgendwerA8
cc6559c3f6 Minor math optimizations 2019-02-28 19:48:29 +01:00
Daniel Serpell
258ba05660 Separate header and trailers of Atari system_check chunk.
This allows to omit the headers and trailers if needed.
2019-02-21 19:00:17 -03:00
Oliver Schmidt
b9ea77b185
Merge pull request #834 from jedeoric/master
Update telestrat target doc, add tgi_clear support for telestrat target, stratsed & telemon 2.4 vars added
2019-02-12 17:51:24 +01:00
Christian Groessler
58484449b4 remove TABs 2019-02-05 23:27:52 +01:00
Christian Groessler
055c294ac0 Use Timer2 for mouse polling.
This follows a suggestion by Sijmen Schouten in issue #818.
Platoterm64 now works with mouse at 1200 baud.

Bump MOUSE_API_VERSION in asminc/mouse-kernel.inc.

Fix typo in testcode/lib/mouse-test.c.
2019-01-29 22:00:55 +01:00
jedeoric
63e64f801a
Merge branch 'master' into master 2019-01-25 10:15:21 +01:00
Piotr Fusik
7a034f505b Comment the ATASCII to screen code conversion. 2019-01-23 19:02:26 +01:00
Piotr Fusik
1781a5cfe7 Optimize the conversions from Atari ASCII to screen codes. 2019-01-23 00:05:31 +01:00
Greg King
a6b04f6e97 Changed most "backticks" (grave accents) into apostrophes.
Quotations that are embraced by tick marks now look better, in most fonts.
2019-01-05 14:57:12 -05:00
Scott Hutter
a6725edb15 moved to better folder location 2018-12-30 18:57:46 +01:00
Scott Hutter
9160b8ddc2 Issue 814 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
1b46dfe820 change reference to $0200FF to $0200xx 2018-12-30 03:49:26 -05:00
Paul Gardner-Stephen
576d64da38 remove redundant line 2018-12-30 03:49:26 -05:00
Paul Gardner-Stephen
837b9b3c2c use pre-existing ZP storage. Make 32-bit pointer value loading more self-evident 2018-12-30 03:49:26 -05:00
Paul Gardner-Stephen
19ca1f6b48 add support for detecting 45GS02 2018-12-30 03:49:26 -05:00
jede
d707ef4c72 Now tgi_clear() works 2018-12-10 21:48:09 +01:00
Olli Savia
b6529225e9 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
b269b3f5b2 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
b9054ec9a7 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
4304f11549 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
7147e780e6 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
5901ea80a4 Added SER_ prefix. Whitespace cleanup 2018-11-26 22:14:31 +01:00
Olli Savia
ad0b0982d0 Added SER_ prefix 2018-11-26 22:14:31 +01:00
Olli Savia
7b4807a8f7 Changed prefix SWL_ to SER_ 2018-11-26 22:14:31 +01:00
Olli Savia
aeff90ca90 Updated to use cbm_kernal.inc. Whitespace cleanups 2018-11-26 22:14:31 +01:00
IrgendwerA8
923fa8fc93 Saved 2 bytes and fixed error in case of negative result. 2018-11-09 17:27:35 -05:00
Oliver Schmidt
40f42e977f Adjusted comments to match actual prototypes. 2018-11-06 11:13:23 +01:00
Greg King
c2568d804d Fixed the Plus4's serial driver's ACIA address. 2018-10-23 19:52:23 -04:00
jede
385260e453 Fix comments and TELEMON uppercase 2018-10-19 23:43:40 +02:00
jede
6a18ad5fbf Clean wherey.s 2018-10-19 23:43:40 +02:00
jede
ee7514fea2 Remove BASHEAD segment which is not useful 2018-10-19 23:43:40 +02:00
Christian Groessler
df3c43bede Atari: implement clock_getres() 2018-09-28 09:47:20 +02: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
9c7cccf3e5 Atari: clock_gettime() and clock_settime() implementations
They are using SpartaDOS-X interfaces and are therefore only working
in this environment.
2018-09-25 21:11:05 +02:00
Christian Groessler
118bc996fb libsrc/atari/getdefdev.s: small comment change 2018-09-20 23:58:23 +02:00
Christian Groessler
d52d986aca libsrc/atari/getdefdev.s: small optimization and fix a typo 2018-09-14 16:54:20 +02:00
Christian Groessler
4691974466 Atari: Make a good "default device" on AtariDOS (2.0 and 2.5) and MyDOS.
The default device will be the one the program was loaded from instead of
always D1:.
2018-09-13 22:33:54 +02:00
Christian Groessler
08d164a811 fix comment in last change 2018-09-12 01:20:12 +02:00
Christian Groessler
e4e3dbf756 atarixl: check at startup whether RAM beneath the ROM is in use
If detected, the program refuses to run, preventing a crash.
The check only works with SpartaDOS. I don't have an overview which
DOSes potentially use the RAM under the ROM. Or which other installed
programs might use it.

No additional runtime memory space is consumed, since the change
is in the "system check" load chunk which gets replaced by the
user program during loading.
2018-09-12 01:05:52 +02:00
Oliver Schmidt
a9a102b0e8 Protect random counter against ProDOS.
Although documented nowhere (!!!) ProDOS trashes the random counter locations $4E/$4F. Is discovered this because my TCP connections didn't have random local ports.

It's a really funny coincidence that David Finnigan discovered only 3 years ago the very same issue because of the very same reason: https://groups.google.com/forum/#!topic/comp.sys.apple2.programmer/1ciep_Oetvo
2018-09-08 23:29:59 +02:00
Oliver Schmidt
cddc4da3bb Just removed some trailing spaces. 2018-09-08 23:14:54 +02:00
Oliver Schmidt
73faf60fe0 Support randomize().
In order to have randomize() work as expected (and the Apple II random number generation in general) it is necessary to update the random counter during keypress wait just like the ROM function does.
2018-09-08 18:45:20 +02:00
Christian Groessler
b6ccd4d5d4 Atari: RealDOS adaptations
RealDOS is a SpartaDOS clone. Handle it the same way as SpartaDOS.
2018-09-06 15:55:07 +02:00
Christian Groessler
e9b8f5d814 Atari: Add detection of RealDOS (http://www.realdos.net/realdos.html). 2018-09-06 12:08:50 +02:00
Christian Groessler
1cc4fa9356 Atari: fix interrupt handling if extended memory is banked in
Extendend memory is mapped over the main memory in the 0x4000..0x7FFF
area. Many DOSes disable interrupts while extended memory is banked in,
but not all (e.g. SpartaDOS-X).
This change modifies the initial interrupt handler to map in main memory
before chaining to the "worker" handlers.
Since the initial interrupt handler uses a data segment to store the
trampoline to chain to the original handler, introduce a new "LOWBSS"
segment to hold this trampoline. Otherwise the trampoline may end up
inside the 0x4000..0x7FFF area.

Add a link time warning if "LOWCODE" segment lays within the extended
memory window.
2018-09-05 11:28:15 +02:00
Christian Groessler
d199ca1460 Atari, Atari5200: disable "attract mode" on mouse or joystick input
Fixes #736.
2018-09-05 11:23:12 +02:00
Oliver Schmidt
70a131e09a Just a minor comment improvement. 2018-09-02 23:07:26 +02:00
Greg King
39694d0aaa Fixed bugs; and, improved the efficiency of some pce library functions. 2018-08-30 11:48:46 +02:00
Greg King
959eff34a3 Fixed and improved some pce comments. 2018-08-30 11:48:46 +02:00
Greg King
2cc822b44e Fixed some mistakes (mostly in the documentation). 2018-08-30 11:48:46 +02:00
Greg King
b5d939c858 Style changes. 2018-08-30 11:48:46 +02:00
Greg King
203200e259 Used I/O mirror locations that avoid (redirected) zero-page accesses. 2018-08-30 11:48:46 +02:00
Greg King
f2d2f3c193 Moved the NES font into its own object module.
It can be replaced by a custom font when a program is built.
2018-08-29 12:13:58 -04: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
Christian Groessler
2d4210b309 Atari5200 joystick driver: enable POT input.
The "Atari800" emulator doesn't emulate this aspect, therefore the problem
wasn't noticed before.
2018-08-24 17:04:31 +02:00
Stefan
f3ef819b43 Update crt0.s 2018-08-21 12:21:56 +02:00
Stefan
3ae5161636 CMOS optimisation 3rd
"The decimal flag D is cleared" [...]
http://shu.emuunlim.com/download/pcedocs/pce_cpu.html
2018-08-21 12:21:56 +02:00
Stefan
199226d089 Update irq.s 2018-08-20 22:31:08 +02:00
Stefan
e335b50ed1 CMOS optimisation
The Lynx CPU always cleared the flag.
2018-08-20 22:30:41 +02:00
Patrick Pelletier
b37d0a444c lseek: Return EINVAL if new position is less than 0 or greater than 2^24 - 1.
Also, implemented @greg-king5's suggestion to save a byte on error paths.
2018-08-20 22:24:48 +02:00
Patrick Pelletier
59a4ab8778 lseek: Implement additional feedback from PR #723.
* Check CPU_ISET_65SC02 rather than APPLE2ENH.
* Set sreg and sreg+1 to $FF on error, to return -1 as a long.
2018-08-20 22:24:48 +02:00
Patrick Pelletier
8cb930b50e lseek: use STZ for APPLE2ENH
(As suggested in pull request.)
2018-08-20 22:24:48 +02:00
Patrick Pelletier
68a115cacf Fix ftell() on Apple II to return the correct value.
Fixes this issue:
https://github.com/cc65/cc65/issues/722

ftell() returns the value returned by lseek(), and lseek() for the
Apple II wasn't returning a value.
2018-08-20 22:24:48 +02:00
Oliver Schmidt
1644bcdf03 Implemented line wrap.
According to https://github.com/cc65/wiki/wiki/Direct-console-IO it is undefined what happens when the end of the sceen is reached. But it is _not_ undefined what happens when the end of the line is reached. So implement the usual thing - which was easy enough to do after all.
2018-08-20 00:30:17 +02: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
Greg King
7b8d4b28c7 Fixed the system banking in the cbm510 and the cbm610 targets' versions of clock_gettime() and clock_settime().
Their library function calls must run in the execution bank.
2018-08-19 17:12:54 -04:00
Oliver Schmidt
03a99569e3 Optimize for size. 2018-08-19 14:35:30 +02:00