[z88dk-dev] 'newline = 0x0d ?

Bridge to the z88dk-developers mailing list
Post Reply
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

[z88dk-dev] 'newline = 0x0d ?

Post by stefano »

I was (again) trapped in an odd problem..
Compiling the othello demo (no matter if in txt only mode or w/graphics) on CP/M with the classic lib seems to generate a non working program.
The ZX Spectrum version works.
The woarkaround I found is to avoid using '/n' when examining the input characters and substitute such values with 13..
I suspect the reason is on the SCCZ80 compiler or some inner part of the libraries set to work with different encodings, am I right ?



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

I was (again) trapped in an odd problem..
Compiling the othello demo (no matter if in txt only mode or w/graphics) on CP/M with the classic lib seems to generate a non working program.
The ZX Spectrum version works.
The woarkaround I found is to avoid using '/n' when examining the input characters and substitute such values with 13..
I suspect the reason is on the SCCZ80 compiler or some inner part of the libraries set to work with different encodings, am I right ?
-standard-escape-characters was added to sccz80 so that it generates the correct ascii codes for \n and \r and that flag is now used in all classic compiles. Previously \n=13 and \r=10 to match what some of the targets were using as line endings (like the spectrum) but this is an incompatibility with sdcc which uses the correct character codes. In the new c lib the problem is solved by defining what a cr and lf is depending on which compiler is active.

The targets' putc and getc functions would need to be patched to correctly translate to/from the correct ascii codes.



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
Post Reply