Skip to content

Font configuration ist lost on reboot/power-up #31

@ThorstenBr

Description

@ThorstenBr

Currently the configured font is not restored when the machine is started. This is caused by the logic in render.c/switch_font, which always reloads and switches the font to something machine-specific, when the machine type has changed. When the machine is powered on, variable "current_machine" is initially always set to "MACHINE_AUTO". At some point after the system has started, this variable eventually switches to something machine-specific. This change triggers switch_font to reset the current font to a default for the specific machine.

However, when a user has selected a French or German font, for example, this font needs to remain active. Currently, the only way to use a font other than the machine default, is by using the config utility each time the machine was started.

This could be fixed in several ways - depending on what was intended.

Here's something I used locally to fix the font issue for me: I added a check "if (romx_textbank==0)" to render.c/switch_font. So only when the default font (font 0) was selected, then change the font once the machine type changes from MACHINE_AUTO to the machine specific value. Otherwise, if the user has configured a specific, non-default font - then keep the user-selected font. The user probably knows what he is doing:

@@ -31,10 +31,11 @@ static void DELAYED_COPY_CODE(switch_font)() {
     if(romx_changed) {
         memcpy32(character_rom, (void*)FLASH_FONT(romx_textbank), 4096);
     } else if(userfont) {
         return;
     } else if(current_machine != machinefont) {
+        if (romx_textbank==0)
         switch(current_machine) {
         default:
         case MACHINE_II:
             memcpy32(character_rom, (void*)FLASH_FONT_APPLE_II, 4096);
             break;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions