1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-21 20:29:24 +00:00
cc65/libsrc
Sidney Cadot ceac9f87ba Temporary fix for fgets() not using target-specific newline.
This patch provides a temporary fix for the issue where the fgets()
function did not use the target-specific newline character to
decide if it has reached the end of the line. It defaulted to the
value $0a, which is the newline character on only some targets.
The Atari, for example, has newline character $9b instead.

This patch is ugly, because the ca65 assembler that is used for
fgets doesn't currently accept C-type character escape sequences
as values. Ideally we'd be able to write:

		cmp #'\n'

And this would end up being translated to a compare-immediate
to the target-specific newline character.

Since that is impossible, this patch substitutes the equivalent,
but ugly, code:

		.byte $c9, "\n"

This works because $c9 is the opcode for cmp #imm, and the "\n"
string /is/ translated to the platform-specific newline character,
at least when the 'string_escapes' feature is enabled.
2024-12-18 07:44:52 +01:00
..
apple2 Apple2: Don't forcefully re-enable IRQ 2024-12-09 19:01:00 +01:00
atari
atari2600
atari5200
atari7800 Add support for different joysticks 2024-07-20 13:14:22 +03:00
atmos oops 2024-09-07 18:51:20 +02:00
c16
c64
c128 Update waitvsync.s 2024-09-07 19:17:00 +02:00
cbm
cbm510
cbm610
common Temporary fix for fgets() not using target-specific newline. 2024-12-18 07:44:52 +01:00
conio
creativision
cx16 replaced constant 2024-06-19 23:52:25 -05:00
dbg
em
gamate
geos-apple
geos-cbm
geos-common
joystick
kim1
lynx Changed sta (ptr1,x) to sta (ptr1) 2024-02-11 23:12:27 +00:00
mouse
nes
none
osic1p
pce
pet Update waitvsync.s 2024-09-07 19:14:59 +02:00
plus4
rp6502 add rp6502 xregn 2024-02-17 16:02:57 -08:00
runtime
serial
sim6502 Merge pull request #2334 from carlo-bramini/fix-sim65-1 2024-03-10 00:37:18 +01:00
supervision
sym1
telestrat
tgi
vic20
zlib
Makefile
NameClashes.md Make document human-readable and split out name clashes section. 2024-07-18 10:00:16 +02:00