As Fairlight (Spectrum 128K version) is one of my favorite games, I decided to try and figure out why it fails to run on Mess with the spec128 bios.
I have a z80 game image that loads in & runs fine using Emuzwin. If I load the same image with mess, the game immediately crashes.
I traced the address & opcodes for both Emuzwin and mess, capturing from when the image first loads to when the crash occurs.
Comparing the Emuzwin & mess traces, everything matched to begin with, but then the opcodes started to deviate (after the code calls/jumps to location 0xC000, mess shows opcode 0x49 when it should be 0xE5):Emuzwin Trace
B70B:D3FD OUT A,13H
B70D:CD000C0 CALL C000HC000:E5 PUSH HL Mess Trace
B70B:D3FD OUT A,13H
B70D:CD000C0 CALL C000HC000:49 LD
After a bit of reading, I made the assumption the crash was due to mess not paging the correct memory bank to address 0xC000. Google-ing things like "Port 0xFD" and "memory paging" I found this (copied from http://www.worldofspectrum.org/rusfaq/
JmK> OUT(#FD),A? On a normal Spectrum this would end up paging memory (like
JmK> in Fairlight 128), on a +3 this would access the FDC. So, a Pentagon is
JmK> (Since the value of A becomes the high byte of the OUT address).
thatz exactly right - Pentagon doesnt need full address access sometimes ( please, dont ask me why and how - i have no idea. something
to do with lame a$$ engineer who designed it i'll try to find some more info on this one though. as another hint - this lame addressation was stuffing up Scorpion ( halted the system/didnt do jack ) until i had cut one of MC's on motherboard )
So it seems the "B70B: D3FD OUT A,13H" (writing 0x13 to the 0xFD port) is a sort of undocumented/shorthand way of paging memory banks that Mess doesn't currently support?
I then had idea of just seeing what happened if I tried to load the z80 image with the 'pentagon' bios (a system I've never heard of until I read the above conversation), and bingo, it worked
I just thought it would be a good idea to mention my findings here, incase Mess-developers aren't aware of this spectrum 128K 0xFD memory paging quirk.
Hope it helps!