ogoguel / nucleus-p8

Nucleus as a Prodos 8 application
5 stars 0 forks source link

Should set SHR linearization in $C029 before writing the initial screen #1

Closed rb6502 closed 3 years ago

rb6502 commented 3 years ago

Hi Gog!

This has garbled graphics on MAME's Apple IIGS emulation (and it should be broken on a real IIgs as well, but I don't have a Floppy Emu to test that). This is because MAME correctly emulates the effect of the SHR memory remapping bit in $C029 (KEGS and GSPlus/GSPort/ActiveGS don't). Store $41 to $C029 before writing anything to the SHR screen, the original self-booting releases of Nucleus do that in their boot loaders.

ogoguel commented 3 years ago

Thanks for the explanation : I saw that line in the boot loader, but I've interpreted it as "Text Mode" which is why I did not add it (and could not see the bug in Kegs). Not even sure I was aware of that effect back then!

Added in 1.0.2

rb6502 commented 3 years ago

I don't think anyone understood that effect back then, but it's pretty simple (thanks to John Brooks for figuring this out). When linearization is off ($C029 = $01) the even bytes of the SHR area are at $2000, but odd bytes are at $6000. So $2000 is stlll $2000, but the second byte that's usually at $2001 is at $6000. Setting bit 6 or 7 of $C029 enables the regular memory layout, so there's unfortunately no way to use this for cool demo tricks.

1.0.2 looks good, thanks!