Apple II FujiNet Platform Reference Guide - FujiNetWIFI/fujinet-firmware GitHub Wiki

About the Apple II

CC65

Oliver Schmidt: Just to be sure, there's no misunderstanding: A stock Apple ][+ displays only garbage, if you try to output lowercase. The only machine capable of lowercase output, but without a 65C02 is an unenhanced //e. That means: There's only a very small number of machines that benefit from the option of lowercase output without requiring a 65C02. In order to successfully do lowercase output without requiring a 65C02, one needs to detect at runtime if lowercase output is actually possible.

On most targets, cc65 comes with two distinct text output subsystems:

stdio: This is (usually) a thin wrapper around target ROM routines. The amount of control characters supported depends on the target. Scrolling works.

conio: This is (usually) writing directly into the video RAM. It's supposed to be as fast as possible and allows direct write location positioning, inverse text and color on targets which support text color. Scrolling does not work.

On the Apple II, both stdio and conio force uppercase for the 'apple2' target, because the Apple ][+ displays garbage when trying to output lowercase. Only the 'apple2enh' target allows for lowercase output because every machine with a 65C02 is known to also support lowercase. The netcat program is a typical scenario for stdio. It requires scrolling but doesn't make use of direct cursor control and alike. Therefore it was an option to replace the stdio thin wrapper around the ROM routines (which forces uppercase) with a custom thin wrapper around the ROM routines that does not force uppercase but detects at runtime if lowercase is supported. In contrast, the weather program uses conio. So in order to apply the lowercase approach for the netcat program to the weather program, one would need to modify it to use stdio instead of conio first.

Just my two cents: Given that the primary output of the weather program isn't text based in the first place (but chars "painted" on the graphics screen) and therefore does happily lowercase all the time, I just wouldn't bother and go with the uppercase text.

If you look at the generated code, you'll find that function pointers are pretty expensive. The fastest solution would be a boolean varaible to be checked on every character output. However, that would also require to be explicitly initialized, so I went for the simple solution. I would be very surprised if there would be a perceivable speed improvement with the boolean variable over the current "naive" solution.