Previous Thread
Next Thread
Print Thread
Fairlight Spectrum 128K and '0xFD' memory paging #99680 05/09/15 04:57 PM
Joined: Apr 2013
Posts: 71
G
geecab Offline OP
Member
OP Offline
Member
G
Joined: Apr 2013
Posts: 71
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 C000H
C000:E5 PUSH HL

Mess Trace
B70B:D3FD OUT A,13H
B70D:CD000C0 CALL C000H
C000: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/):

Quote:

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> different?
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 frown 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 smile

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!

Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: geecab] #99681 05/09/15 05:07 PM
Joined: Mar 2001
Posts: 16,303
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,303
I'm not a Speecy guy, but I just wanted to say that's the best bug report I've ever read. Great work smile

Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: R. Belmont] #99688 05/10/15 06:29 AM
Joined: Apr 2013
Posts: 71
G
geecab Offline OP
Member
OP Offline
Member
G
Joined: Apr 2013
Posts: 71
Cheers thanks! smile

Also just thought I'd mention the same quirk exists for FairlightII 128K version (which also runs fine using the pentagon bios).

Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: geecab] #99754 05/15/15 12:44 PM
Joined: Jul 2010
Posts: 24
M
MetalliC Offline
Member
Offline
Member
M
Joined: Jul 2010
Posts: 24
thnks for great report. fixed.

pentagon is not just "bios", its separate driver, and already have port decoding for such weird addressing, because a lot of ex-USSR software uses it that way.

didn't know original 128k and +2 have such simplified 7ffd port decoding too. and even worst in the case of reading this port )

Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: geecab] #99759 05/15/15 08:25 PM
Joined: Apr 2013
Posts: 71
G
geecab Offline OP
Member
OP Offline
Member
G
Joined: Apr 2013
Posts: 71
That's excellent news! Great to know its resulted in a fix!

By the way just wanted to say, thank you and everyone else for all your hard work on MESS, I really appreciate it smile

Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: geecab] #99767 05/16/15 10:54 PM
Joined: Mar 2013
Posts: 296
I
ICEknight Offline
Senior Member
Offline
Senior Member
I
Joined: Mar 2013
Posts: 296
Would this be the appropiate time for a general ZX Spectrum thread, or is it still a low priority compared to other systems?


LCD artwork scans and cleanups: https://mega.nz/#F!uFYSzK7S!U-lJon9jsqyoCX_3y7_KLA
Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: geecab] #99768 05/17/15 01:37 AM
Joined: Mar 2001
Posts: 16,303
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,303
Spectrum won't be a general thing until we get a cycle-by-cycle Z80.

Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: ICEknight] #99776 05/17/15 04:39 PM
Joined: Jul 2010
Posts: 24
M
MetalliC Offline
Member
Offline
Member
M
Joined: Jul 2010
Posts: 24
ICEknight, TBH can't say its "low priority", its more like "no one interested to bother with it" wink

in my personal TODO list is only task to figure out what kind of dark magic don't let BetaDiskInterface work 100% OK.
already spent quite many time debugging this, and more and more thinking its something wrong in FD17xx emulation code (both legacy and modern implementations)

but, feel free to post issues or wishes )

Last edited by MetalliC; 05/17/15 04:46 PM.
Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: geecab] #99781 05/18/15 01:05 AM
Joined: Aug 2010
Posts: 105
A
abelenki Offline
Senior Member
Offline
Senior Member
A
Joined: Aug 2010
Posts: 105
any plans to add support for .SCL TR-DOS disk images for Russian ZX Spectrum clones in MESS?

last time i checked, they didn't work...


MAME favorites
Re: Fairlight Spectrum 128K and '0xFD' memory paging [Re: geecab] #99782 05/18/15 01:32 AM
Joined: Mar 2001
Posts: 16,303
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,303
abelenki: nope, but you know where the git repo is ;-)


Who's Online Now
5 registered members (Dorando, Pernod, Stiletto, R. Belmont, 1 invisible), 164 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,684
Posts114,031
Members4,863
Most Online510
Aug 26th, 2019
Powered by UBB.threads™ PHP Forum Software 7.7.3