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

120 Commits

Author SHA1 Message Date
mrdudz
ffa83c32a4 clean-up of driver return codes 2023-02-26 20:03:41 +01:00
mrdudz
89c08dc6d4 extra underscores for _randomize and _swap 2022-08-29 20:52:35 +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
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
Polluks
9563541870 crt0 clean-up 2020-11-29 18:08:33 +01: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
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
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
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
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
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
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
Olli Savia
aeff90ca90 Updated to use cbm_kernal.inc. Whitespace cleanups 2018-11-26 22:14:31 +01:00
Oliver Schmidt
40f42e977f Adjusted comments to match actual prototypes. 2018-11-06 11:13:23 +01:00
Olli Savia
635a99c083 TAB to space conversion 2018-06-30 16:25:43 +03:00
Olli Savia
96e6a0a114 Common include file is now cbm_kernal.inc 2018-06-29 22:58:16 +03:00
Olli Savia
f7fbac4c6b Use common include file cbmkernal.inc 2018-06-27 21:39:24 +03:00
IrgendwerA8
49a9b88734 Saved even one more byte. 2018-05-26 19:53:44 +02:00
IrgendwerA8
e77ac8a230 1 byte donation for Fabrizio ;) 2018-05-26 16:37:03 +02:00
Oliver Schmidt
53df4da8e8
Merge pull request #625 from ops/VIAFIX
VIC-20: Add missing VIA register names
2018-04-18 17:09:35 +02:00
Olli Savia
79433ddb60 Updated to use the new VIA register names. 2018-04-11 22:40:46 +03:00
Stefan
a50d214ffb
Simpler get_tv
You don't have to count the beam, just check the KERNAL.
2018-04-10 18:37:10 +00: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
Oliver Schmidt
1976d6cd32 Removed IRQ support from joystick drivers.
All but one joystick drivers didn't use IRQs. Espsecially when the joystick driver kernel was the only .interruptor this meant quite some unnecessary overhead because it pulled in the whole IRQ infrastructure.

I was told that the one driver using IRQs (the DXS/HIT-4 Player joystick driver for the C64) can be reworked to not do it. Until this is done that driver is defunct.
2018-02-01 22:38:36 +01:00
Greg King
51765c6e5c Removed an unwanted button mask table from a VIC-20 joystick driver.
It had put the jump table at the wrong place.  Programs crashed as soon as they tried to initiate the driver.
2017-09-05 16:56:20 -04:00
Oliver Schmidt
4aa19494f5 Removed dysfunctional kbrepeatdelay() and kbrepeatrate().
As discussed in https://github.com/cc65/cc65/pull/452 after my premature merge the two functions in question don't work as expected.

Additionally I adjusted several style deviations in the pull request in question.
2017-08-30 16:37:59 +02:00
Oliver Schmidt
acf831658f Adjusted to recent driver interface change.
Please note that this change is absolutely untested!

Apart from the recent driver interface change:
- vic20-stdjoy.s was "slightly broken" because it didn't clear x on return from joy_read.
- vic20-ptvjoy.s was "heavily broken" because it returned a totally different set of bits of the first joystick.
2017-08-20 17:17:39 +02:00
Oliver Schmidt
b5a4e5667a Merge pull request #452 from mrdudz/kbrepeat
kbrepeatdelay and kbrepeatrate for cbm targets
2017-08-20 14:15:37 +02:00
Oliver Schmidt
7f52a770d9 Removed joy_masks array.
So far the joy_masks array allowed several joystick drivers for a single target to each have different joy_read return values. However this meant that every call to joy_read implied an additional joy_masks lookup to post-process the return value.

Given that almost all targets only come with a single joystick driver this seems an inappropriate overhead. Therefore now the target header files contain constants matching the return value of the joy_read of the joystick driver(s) on that target.

If there indeed are several joystick drivers for a single target they must agree on a common return value for joy_read. In some cases this was alredy the case as there's a "natural" return value for joy_read. However a few joystick drivers need to be adjusted. This may cause some overhead inside the driver. But that is for sure smaller than the overhead introduced by the joy_masks lookup before.

!!! ToDo !!!

The following three joystick drivers become broken with this commit and need to be adjusted:
- atrmj8.s
- c64-numpad.s
- vic20-stdjoy.s
2017-08-19 19:11:28 +02:00
Bob Andrews
5dcebbccb6 Merge branch 'master' into kbrepeat 2017-08-06 20:22:52 +02:00
Oliver Schmidt
6002e59c28 Merge pull request #453 from mrdudz/waitvsync
waitvblank for cbm targets
2017-07-18 15:38:27 +02:00
mrdudz
b6d3d32e88 wait for line 0 instead of last line 2017-07-18 01:06:20 +02:00
mrdudz
8eee51913a add headers/fix formatting 2017-07-18 01:04:53 +02:00
mrdudz
1abce3a2a1 rename all waitvblank() to waitvsync() 2017-07-17 23:15:05 +02:00
mrdudz
a42feca228 fixed some stuff, compiles again :) 2017-06-17 02:37:34 +02:00
mrdudz
035621aa95 fixed code a bit so it compiles again :) 2017-06-17 02:26:54 +02:00
Oliver Schmidt
13482984ca Introduced internal gotoxy that pops both parameters.
About all CONIO functions offering a <...>xy variant call
  popa
  _gotoxy

By providing an internal gotoxy variant that starts with a popa all those CONIO function can be shortened by 3 bytes. As soon as program calls more than one CONIO function this means an overall code size reduction.
2016-06-05 14:58:38 +02:00
OzHawk
1369bed881 Update kernal.s 2016-05-16 08:41:13 +09:30
OzHawk
8bd2628d1e Update the missing entries in the kernel jump table for the Vic20 with the actual function addresses.
The Vic20 does not have kernal table entries for the following functions.

;-----------------------------------------------------------------------------
; Functions which are not in the kernal jump table for VIC-20 but are for C64

CINT        := $E518
IOINIT      := $FDF9
RAMTAS      := $FD8D

All other kernal entries are the same as the C64, however, without this change, the startup code fails.

Without this change the vic20.lib builds incorrectly.
2016-05-11 19:24:16 +09:30
Oliver Schmidt
d8c31cf1d3 Renamed RAM to MAIN for all disk based targets.
The name RAM doesn't make much sense in general for a memeory area because i.e. the zero page is for sure RAM but is not part of the memory area named RAM.

For disk based targets it makes sense to put the disk file more into focus and here MAIN means the main part of the file - in contrast to some header.

Only for ROM based targets the name RAM is kept as it makes sense to focus on the difference between RAM and ROM.
2016-03-07 01:28:55 +01:00
Oliver Schmidt
419eb700b5 Renamed INITBSS to INIT and INIT to ONCE.
The way we want to use the INITBSS segment - and especially the fact that it won't have the type bss on all ROM based targets - means that the name INITBSS is misleading. After all INIT is the best name from my perspective as it serves several purposes and therefore needs a rather generic name.

Unfortunately this means that the current INIT segment needs to be renamed too. Looking for a short (ideally 4 letter) name I came up with ONCE as it contains all code (and data) accessed only once during initialization.
2016-03-06 21:27:19 +01:00