Detecting VBL on 800 in 700-mode
Re: Detecting VBL on 800 in 700-mode
I'm tempted to ask my friend to probe PC7 with a logic analyzer to see what's actually happening.
Re: Detecting VBL on 800 in 700-mode
You must add IPL.ROM (1Z-13A) and FONT.ROM in the same directory as EmuZ-700.exe. As you should know Japanese people are fearful of copyrighted ROM so they don't include them. I had the same issue as yours without those ROM files.
Re: Detecting VBL on 800 in 700-mode
Why did I write "700" and not "700 emulator"? Because when I finally managed to test this on a REAL 700 it shows exactly the same behaviour. So the problem *is* with the emulator, just not with the 800 emulatorJo Even wrote: ↑Mon Sep 16, 2019 1:29 pmThis is working on the 700 but always returns immediately on the 800 emulator in 700 mode.Code: Select all
while (*(unsigned char *)0xe002 & 0x80);
Re: Detecting VBL on 800 in 700-mode
This piece of code stolen from the monitor works.
Maybe the compiled C code isn't fast enough. VBL is low for less than 3ms, but it should take some pretty inefficient code to miss that.
Edit: Just replicated the functionality from the asm above in C, and can confirm that it does not work in the 800 emulator. The compiled code is almost certainly to slow, and I guess it only works in the 700 emulator due to inaccurate emulation.
Edit2: I can also confirm that this is working on both a real 800 and a real 700. So problem solved
Code: Select all
__asm
push af
wait1: ld a,(0e002h)
rlca
jr nc,wait1
wait2: ld a,(0e002h)
rlca
jr c,wait2
pop af
__endasm
Edit: Just replicated the functionality from the asm above in C, and can confirm that it does not work in the 800 emulator. The compiled code is almost certainly to slow, and I guess it only works in the 700 emulator due to inaccurate emulation.
Edit2: I can also confirm that this is working on both a real 800 and a real 700. So problem solved