mirror of
https://github.com/cc65/cc65.git
synced 2024-12-21 20:29:24 +00:00
ceac9f87ba
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. |
||
---|---|---|
.. | ||
apple2 | ||
atari | ||
atari2600 | ||
atari5200 | ||
atari7800 | ||
atmos | ||
c16 | ||
c64 | ||
c128 | ||
cbm | ||
cbm510 | ||
cbm610 | ||
common | ||
conio | ||
creativision | ||
cx16 | ||
dbg | ||
em | ||
gamate | ||
geos-apple | ||
geos-cbm | ||
geos-common | ||
joystick | ||
kim1 | ||
lynx | ||
mouse | ||
nes | ||
none | ||
osic1p | ||
pce | ||
pet | ||
plus4 | ||
rp6502 | ||
runtime | ||
serial | ||
sim6502 | ||
supervision | ||
sym1 | ||
telestrat | ||
tgi | ||
vic20 | ||
zlib | ||
Makefile | ||
NameClashes.md |