It is currently Tue Nov 21, 2017 2:32 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: SMS/Z80 Zexall
PostPosted: Fri Nov 03, 2017 7:03 am 
Offline

Joined: Thu Jul 29, 2010 4:39 am
Posts: 24
Hi all,

I wondered if anyone else had worked on a Z80/SMS emulator that passes zexall sms?

I've managed to implement all the instructions and have a full pass on zexdoc (using the sdsc version as I do not currently implement the vdp).

Running zexall shows passes on all except this one:
Code:
bit n,<b,c,d,e,h,l,(hl),a>...   CRC:e283c214 expected:a937a161

I believe it has something to do with the bizarro bit n,(hl) undocumented flags, but from the documentation I can find online I think I've implemented MEMPTR in the instructions that affect it.

Looking at the source for the version of the test available at https://github.com/maxim-zhao/zexall-sms/blob/5b0e32f9d4b2a665f11f77a90e909652713ccd27/source/zexall.asm#L1301-L1306 it looks like the instruction immediately before the instruction under test is ld sp,(nn), which I believe places addr+1 into MEMPTR. StackPointerBeforeTest is set to $C07E so would place $C07F into MEMPTR, so if I'm understanding correctly bits 3 and 5 of the high byte would not be set anyway, so shouldn't affect the flags.

Anyone able to help?

Also, has anyone got any build instrcutions for zexall? The latest source in that repo doesn't correspond with the latest released version, and I've never done anything with wla-dx to know where to start building it.

Cheers


Top
 Profile  
 
 Post subject: Re: SMS/Z80 Zexall
PostPosted: Tue Nov 07, 2017 3:47 am 
Offline

Joined: Thu Jul 29, 2010 4:39 am
Posts: 24
Ok, self posting, but it does appear that I might have resolved this.

If what I've got is correct it wasn't in fact the MEMPTR but the flags on the non indirect BIT instruction.

My implementation followed the comments inside of the Undocumentd Z80 PDF which states:

SF flag Set if n = 7 and tested bit is set.
ZF flag Set if the tested bit is reset.
YF flag Set if n = 5 and tested bit is set.
HF flag Always set.
XF flag Set if n = 3 and tested bit is set.
PF flag Set just like ZF flag.
NF flag Always reset.
CF flag Unchanged.

Which I was doing, and failing. If I change my BIT instruction to take Bit 5/Bit 3 (YF/XF) from the value being tested, ignoring the bit being tested, it passes.

Is the documentation incorrect or have I missed something else?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group