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
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
Oliver Schmidt
250e4ed9e0 Added dummy clock_settime() for the Atari.
Allow to build ip65/date65.
2018-08-18 01:36:56 +02:00
Oliver Schmidt
fe5af26f9f Express assumption about struct timespec.
We basically cast a struct timespec pointer to a time_t pointer when we pass the clock_settime() paramter to localtime(). Explicitly express that in the source code.
2018-08-18 01:29:40 +02:00
Oliver Schmidt
eb9872c684 Added clock_settime() for some CBMs.
The CIA TOD only stores the time but not the date. Therefore the date set by clock_settime() ist just stored inside the C library for retrieval via clock_gettime().

The "very special" handling of 12AM/PM is based on https://groups.google.com/d/msg/comp.sys.cbm/ysVYSX4AMbc/vHrXCWEhCOUJ saying:

==========

24hr: Wr => Rd => Nx
--------------------
  0 : 92 => 12 => 01   <= Switch from 00 to 01 (24-hour notation)
  1 : 01 => 01 => 02
  2 : 02 => 02 => 03
 11 : 11 => 11 => 92
 12 : 12 => 92 => 81   <= Switch from 12 to 13 (24-hour notation)
 13 : 81 => 81 => 82
 14 : 82 => 82 => 83
 23 : 91 => 91 => 12

1. column ("24hr"): hour to be tested (decimal)
2. column ("Wr"):   hour written to TOD register (BCD)
3. column ("Rd"):   hour read from TOD register (BCD) immediately after writing the value in column 2 to see the conversion between AM/PM, if any
4. column ("Nx"):   next hour (BCD) after the hour switch

==========

Thanks Paul!
2018-08-18 01:29:40 +02:00
Oliver Schmidt
cb7ec508f6 Fixed 12 AM/PM handling.
Midnight is 12 AM and noon is 12 PM (see https://en.wikipedia.org/wiki/12-hour_clock). Therefore we need to subtract 12 hours in exactly those two hours.
2018-08-18 01:29:40 +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
f40dcb5883 Added clock_getres() / clock_settime() for the Apple II.
The situation on the Apple II is rather special: There are several types of RTCs. It's not desirable to have specific code for all of them. As the OS supports file timestamps RTC owners usually use OS drivers for their RTC. Those drivers read the RTC and write the result in a "date/time location" in RAM. The OS reads the date/time from the RAM location. If there's no RTC the RAM location keeps containing zeros. The OS uses those zeros as timestamps and the files show up in a directory as "<NO DATE>".

There's no common interface to set RTCs so if an RTC _IS_ present there's just nothing to do. However, if there's _NO_ RTC present the user might very well be interest to "manually" set the RAM location in order to have timestamps. But he surely doesn't want to manually set the RAM location over an over again. Rather he wants to set it just once after booting the OS.

From that perspective it makes most sense to not set both the date and the time but rather only set the date and have the time just stay zero. Then files show up in a directory as "DD-MON-YY  0:00".

So clock_settime() checks if the current time equals 0:00. If it does _NOT_ then an RTC is supposed to be active and clock_settime() fails with ERANGE. Otherwise clock_settime() ignores sets the date - and completely ignores the time provided as parameter.

clock_getres() too checks if the current time equals 0:00. If it does _NOT_ then an RTC is supposed to be active and clock_getres() returns a time resolution of one minute. Otherwise clock_getres() presumes that the only one who sets the RAM location is clock_settime() and therefore returns a time resolution of one day.
2018-08-15 21:34:35 +02:00
Oliver Schmidt
326ca263c9 Minor style fix. 2018-08-15 19:40:56 +02:00
Oliver Schmidt
59a8149556 Added clock_getres() for CBMs.
All CBMs have a clock (CIA TOD) resolution of 1/10 second.
2018-08-15 19:40:27 +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
Oliver Schmidt
55a07c1dcd Removed stray /t char. 2018-08-15 16:06:44 +02:00
Oliver Schmidt
bbed9fdb63 Fixed typo. 2018-08-15 16:06:44 +02:00
Oliver Schmidt
a9ce4dc76c "Inverted" time_t value handling.
So far time_t values were interpreted as local time values. However, usually time_t values are to be interpreted as "seconds since 1 Jan 1970 in UTC". Therefore all logic handling time_t values has to be changed.

- So far gmtime() called localtime() with an adjusted time_t, now localtime() calls gmtime() with an adjusted time_t.
- mktime() has to do "the opposite" of localtime(), to keep it that way mktime() does now the inverse adjustment made by localtime().
- All currently present time() implementations internally call mktime() so they don't require individual adjustments.
2018-08-02 17:12:12 +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
Greg King
e6fc904e3c Fixed some code, to adapt to register-use changes caused by pull request #652. 2018-07-27 09:21:31 -04:00
Oliver Schmidt
e86a7db18b Some minor cleanups. 2018-07-26 14:35:26 +02:00
Oliver Schmidt
e949a3e642 Fixed regression introduced by https://github.com/cc65/cc65/pull/652. 2018-07-26 14:31:17 +02:00
IrgendwerA8
c9869c1a26 Quick fix for missing _div() adaptation after 95223be. 2018-07-26 10:44:22 +02:00
Scott Hutter
1981af0bbd tgi driver for c128 VIC-II 2018-07-23 15:54:15 -05:00
Olli Savia
fdce8fb34d Added a blank line between .include statements and .import/.export statements 2018-07-04 17:40:28 +03:00
Olli Savia
f7636fe8f2 Removed .import for std kernal entries. Added .include "cbm.inc" 2018-07-03 22:47:42 +03:00
Olli Savia
032a3877e0 Added .import for std kernal entries 2018-07-03 22:44:59 +03:00
Olli Savia
3e94f7f55c Moved C128 specific definitions to cbm_kernal.inc 2018-07-01 09:58:39 +03:00
Olli Savia
820c0efcb3 Use common include file cbm_kernal.inc 2018-07-01 09:56:37 +03:00
Olli Savia
4c45de2c45 Updated comment 2018-07-01 09:54:39 +03:00
Olli Savia
635a99c083 TAB to space conversion 2018-06-30 16:25:43 +03:00
Olli Savia
d5bc751f54 Removed RAMTAS 2018-06-29 22:59:53 +03:00
Olli Savia
96e6a0a114 Common include file is now cbm_kernal.inc 2018-06-29 22:58:16 +03:00
Olli Savia
42e9b971c5 Merge remote-tracking branch 'upstream/master' into cbmkernal_stage2 2018-06-29 22:50:02 +03:00
Olli Savia
f7fbac4c6b Use common include file cbmkernal.inc 2018-06-27 21:39:24 +03:00
Oliver Schmidt
86945a1270
Merge pull request #687 from polluks/patch-12
Smaller driver code
2018-06-21 22:37:29 +02:00
Stefan
6a70d1dab1
Removed unused label 2018-06-21 20:30:14 +00:00
greg-king5
4980fade74
Made LINE plot single-point lines correctly. 2018-06-21 08:18:53 -04:00
Stefan
23534beaa6
Smaller driver code 2018-06-21 00:25:33 +00:00
Fabrizio Caruso
9af2d6b4a1 spaces instead of tab 2018-06-06 21:18:47 +02:00
Fabrizio Caruso
e626180b28 Fix joystick for the Supervision target 2018-06-06 21:11:17 +02:00
Greg King
6d87370881 Fixed strpbrk().
Added its prototype.  Documented it.
2018-05-29 14:29:50 -04:00
IrgendwerA8
465a651090 Free 2 bytes again. 2018-05-29 01:51:24 +02:00
IrgendwerA8
f55b564ca1 Save the three bytes for the plus4 too. 2018-05-27 00:10:58 +02:00
IrgendwerA8
30a679ba36 Saved 3 bytes for the C16 target. 2018-05-26 20:30:38 +02: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
95223be101
Merge pull request #663 from IrgendwerA8/more_popptr1_adaptations
Adapted div & mod for popptr1.
2018-05-26 13:01:27 +02:00
IrgendwerA8
8a5d1b9674 Reestablished entry state of signed operation and optimized that (again). 2018-05-25 23:52:42 +02:00
IrgendwerA8
ba5b580368 Fixed first letter of comments (should be upper case). 2018-05-25 16:10:16 +02:00
Oliver Schmidt
0b323f717b
Update symbols.txt 2018-05-25 14:48:20 +02:00
Oliver Schmidt
0138e110cc
Merge pull request #662 from Compyx/master
Add CBM kernal call SECOND to CBM library (see issue #525)
2018-05-25 14:00:36 +02:00
IrgendwerA8
71420223bc Changed the name of the file too. 2018-05-24 11:37:17 +02:00
IrgendwerA8
9c1cb0801c Changed naming absvaludiv -> absvaludiv16. 2018-05-24 11:31:43 +02:00
IrgendwerA8
dd411efd1c Adapted div & mod for popptr1. 2018-05-24 03:55:40 +02:00
compyx
8ffe623e74 Add CBM kernal call SECOND to CBM library (see issue #525) 2018-05-23 17:32:02 +02:00
Oliver Schmidt
9246b14f68
Merge pull request #658 from polluks/patch-9
Indicate a dummy outtext & some clean-up
2018-05-23 17:05:12 +02:00
Oliver Schmidt
746e3d1454
Merge pull request #656 from Compyx/master
Add CBM kernal call TKSA to CBM library (see issue #525)
2018-05-23 09:47:41 +02:00
Oliver Schmidt
f485be1b84
Merge pull request #657 from IrgendwerA8/VariousSpeedSizeOptimizations
Various speed size optimizations
2018-05-23 09:46:30 +02:00
Stefan
a4c06f2572
Clean-up because of tgidrv_line.inc 2018-05-22 22:32:50 +00:00
Stefan
b945beb6a7
Indicate a dummy outtext 2018-05-22 21:18:10 +00:00
IrgendwerA8
6175271651 Removed optimizations which break the compiler ones. 2018-05-22 19:10:07 +02:00
IrgendwerA8
808d3ab471 Fix for 8x16 multiplication if operants are swapped. 2018-05-22 18:35:05 +02:00
IrgendwerA8
ba2c6d9008 Further optimizations in common/conio. 2018-05-22 16:00:05 +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
IrgendwerA8
95b4a6f881 Beautified comment. 2018-05-22 11:25:26 +02:00
IrgendwerA8
99e13eeaa2 Fix typo for import. 2018-05-21 18:19:39 +02:00
IrgendwerA8
d7da827be8 Apply faster popptr1 to functions and/or use register instead of stack to save accu. 2018-05-21 18:18:01 +02:00
IrgendwerA8
c40ae4d774 Saved 6 bytes by using popptr1. 2018-05-21 16:21:45 +02:00
IrgendwerA8
d4081b43a6 Fixed comments. 2018-05-21 14:41:12 +02:00
IrgendwerA8
166425f807 Converted unintentionally introduced tabs to spaces. 2018-05-21 14:33:44 +02:00
Irgendwer
32bbacbb78
Merge branch 'master' into popptr1 2018-05-21 13:33:14 +02:00
IrgendwerA8
839aa93198 Resolved conflict and removed adaptation for strpbrk for time being. 2018-05-21 13:30:27 +02:00
IrgendwerA8
911b86de67 Fixed formatting and two import issues. 2018-05-21 13:02:56 +02:00
IrgendwerA8
c95ed4b8b5 Added "popptr1" which is of common use to save some bytes. 2018-05-20 15:30:18 +02:00
Oliver Schmidt
a795a27689
There's no 'closeallstreams' (anymore ?). 2018-05-17 11:11:40 +02:00
Stefan
472a107358
Make NMI ready 2018-05-14 23:22:09 +00:00
Stefan
b449ded176
Update c64-hi.s 2018-05-09 23:56:35 +00:00
Stefan
b81a04f157
Update c64-hi.s 2018-05-09 23:52:52 +00:00
Stefan
cdce753a09
NMI friendly c64-hi
Don't clear all vectors, see #639.
2018-05-09 23:31:42 +00:00
Marco van den Heuvel
cdebf6baa7 Harmonized the comments (as in added 1 space) ;) 2018-05-03 09:11:20 -07:00
Marco van den Heuvel
e88ac62d06 Optimized the code a bit, thanks to Greg for the suggestions/comments. 2018-05-01 14:46:57 -07:00
Marco van den Heuvel
ad7b339c44 Added C64 Turbo Master accelerator code and documentation. 2018-04-30 14:30:35 -07:00
Marco van den Heuvel
5b4929ef98 Removed obsolete bit opcode. 2018-04-29 12:13:52 -07:00
Marco van den Heuvel
d0088fbc0f Fixed a wrong branch. 2018-04-28 13:26:20 -07:00
Marco van den Heuvel
a012fab090 Added a comment to make the situation more clear. 2018-04-28 13:25:16 -07:00
Marco van den Heuvel
11629bcf99 Added C65/C64DX accelerator code and documentation. 2018-04-27 14:22:41 -07:00
Oliver Schmidt
47e4b36180
Merge pull request #631 from blackystardust/master
Added C64 Chameleon accelerator code and documentation.
2018-04-27 20:47:03 +02:00
Marco van den Heuvel
97e69952c4 Removed extern keyword from function prototypes. 2018-04-27 09:16:25 -07:00
Marco van den Heuvel
1428015158 Optimized the code a bit as suggested by Greg. 2018-04-26 09:18:54 -07:00
Greg King
c92a3c5bd5 Improved the accelerator code. Fixed an infinite loop.
Removed the execute permissions from some files.
2018-04-26 05:46:34 -04:00
Marco van den Heuvel
f2e46f0fdf Added C64 Chameleon accelerator code and documentation. 2018-04-25 12:53:29 -07:00
Oliver Schmidt
fc61bc79c5
Merge pull request #629 from blackystardust/master
Added C128 accelerator code and documentation for both C128 mode and C128 in C64 mode.
2018-04-25 15:08:11 +02: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
Oliver Schmidt
fe33a39d6c
Merge pull request #628 from ops/VIAFIX_PET
Pet: Add missing VIA register names
2018-04-23 15:58:13 +02:00
Marco van den Heuvel
28f26991ac Updated c128 accelerator code and documentation. 2018-04-21 09:52:50 -07:00
Marco van den Heuvel
3f5683b391 Added C128 in C64 mode accelerator code and documentation. 2018-04-20 12:08:28 -07:00
Olli Savia
c2adade8a8 Updated to use the new VIA register names 2018-04-20 21:25:43 +03:00
Oliver Schmidt
305c6e7ae4
Merge pull request #626 from blackystardust/master
Added c64dtv accelerator code and documentation.
2018-04-20 20:01:16 +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
Oliver Schmidt
d314a27e76
Merge pull request #627 from jedeoric/master
[Telestrat target] fix fwrite bug, cputc, chline, remove & mkdir added
2018-04-16 22:46:56 +02:00
jede
cc2b5af601 Fix comment 2018-04-16 21:51:15 +02:00
Marco van den Heuvel
ef73310cce Fixed more comments. 2018-04-16 11:05:52 -07:00
Marco van den Heuvel
0aa2735d4e Fixed another comment. 2018-04-15 12:15:19 -07:00
Marco van den Heuvel
c5f15fa1d5 Fixed some comment and documentation errors. 2018-04-15 11:55:58 -07:00
jede
626fed88b7 chline added 2018-04-14 22:05:03 +02:00
jede
e34ef0fc17 add cputc & remove 2018-04-14 21:52:11 +02:00
Marco van den Heuvel
cb04bc5465 Fixed an issue with the changing the d040 value while detecting. 2018-04-14 11:31:28 -07:00
Marco van den Heuvel
6076316f38 Added c64dtv accelerator code and documentation. 2018-04-14 10:40:13 -07:00
Oliver Schmidt
a10f36c837
Merge pull request #623 from blackystardust/master
Added C64/C128 SuperCPU accelerator functions and started on a generic framework for accelerators.
2018-04-13 21:43:34 +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
89c3ed6d7f Added C64/C128 SuperCPU accelerator functions and started on a generic framework for accelerators. 2018-04-09 19:36:53 -07:00
Marco van den Heuvel
61e5b9d218 Changed #10 to #-basha for clarity. 2018-04-01 13:14:44 -07:00
Marco van den Heuvel
9db6f059ac Fixed cpu detection. 2018-03-31 18:59:15 -07:00
Oliver Schmidt
8886e6f100
Merge pull request #620 from blackystardust/master
Added c16/plus4 fast(), isfast() and slow() functions, and updated the documentation accordingly.
2018-03-31 11:57:27 +02:00
Greg King
b844572159 Moved most of the tgi_colors.s files into the libsrc/common/ directory.
Only the Apple2 and Lynx platforms use different codes for the white color; they have their own files.
2018-03-27 07:28:46 -04:00
Greg King
155f3ade41 C64 TGI: LINE: Optimization: Don't check boundaries; LINE always is called by tgi_clippedline().
Submitted in Pull Request #611 by Sven Michael Klose.
2018-03-26 07:28:01 -04:00
Marco van den Heuvel
8424286a3e Add c16 files as well. 2018-03-23 14:31:53 -07: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
d34c93a464 Set X register to 0 so that 16bit promotion works as expected. 2018-03-20 14:05:55 -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
Oliver Schmidt
316d8e9d37
Merge pull request #609 from polluks/master
Added missing PCE conio functions.
2018-03-11 08:58:23 +00:00
Stefan
789ce59fb5 Added missing PCE conio functions. 2018-03-11 00:49:40 +01:00
Oliver Schmidt
be30c0bd70
Merge pull request #606 from pfusik/ldec
Optimize deceaxy
2018-03-10 11:28:46 +00:00
Piotr Fusik
18ada212e7 Fix coding style. 2018-03-09 18:48:24 +01:00
Piotr Fusik
970c5f6184 Add comments. 2018-03-08 22:10:11 +01:00
Bob Andrews
7e6942953c
Merge pull request #604 from blackystardust/master
Improved reu size detection.
2018-03-08 19:19:35 +01:00
Oliver Schmidt
d602105dd4
Merge pull request #605 from mrdudz/4playerfix
4playerfix
2018-03-08 08:09:24 +00:00
Oliver Schmidt
8e75906737 Switched Apple II output format to AppleSingle.
Although the primary target OS for the Apple II for sure isn't DOS 3.3 but ProDOS 8 the Apple II binary files contained a DOS 3.3 4-byte header. Recently I was made aware of the AppleSingle file format. That format is a much better way to transport Apple II meta data from the cc65 toolchain to the ProDOS 8 file system. Therefore I asked AppleCommander to support the AppleSingle file format. Now that there's an AppleCommander BETA with AppleSingle support it's the right time for this change.

I bumped version to 2.17 because of this from the perspective of Apple II users of course incompatible change.
2018-03-07 23:05:21 +01:00