Page 2 of 3

Re: Detecting VBL on 800 in 700-mode

Posted: Mon Sep 16, 2019 5:49 am
by Jo Even
It doesn't work on a real 800 either. Strange that keyboard is working but VBL not, when both is handled by the 8255. Oh well, I'll worry about this later :)

Re: Detecting VBL on 800 in 700-mode

Posted: Mon Sep 16, 2019 11:46 am
by hlide
Remember I told you /VBLN is connected to two pins: 8255 and PIO. I'm not sure why PIO needs it and in which direction it is (is that an input or output?).

Re: Detecting VBL on 800 in 700-mode

Posted: Mon Sep 16, 2019 12:26 pm
by hlide
sm800_1.png
sm800_2.png
sm800_3.png
sm800_4.png
sm800_5.png
- PIO.A5, is input, reading 1 when its source is not active.
- 8255.PC7, is input, reading 1 when its source its source is not active.
Could you post you snippet of source which doesn't work with MZ800 (I suppose you're in MZ700 mode)?

Re: Detecting VBL on 800 in 700-mode

Posted: Mon Sep 16, 2019 1:29 pm
by Jo Even

Code: Select all

while (*(unsigned char *)0xe002 & 0x80);
This is working on the 700 but always returns immediately on the 800 emulator in 700 mode.

Re: Detecting VBL on 800 in 700-mode

Posted: Tue Sep 17, 2019 4:43 pm
by UncleBod
Are you sure the computer is set up for the right memory banking? Maybe the emulator have RAM all the way when entering 700-mode?

Re: Detecting VBL on 800 in 700-mode

Posted: Tue Sep 17, 2019 5:39 pm
by hlide
Ok, it seems PIO of MZ-800 can issue an interrupt for /VBLN, I suppose when you execute the PIO interrupt, you must check PA5 to see if /VBLN is the interrupter. While in MZ700, I guess there is no such interrupt so you should rely on polling PC7 of 8255. But for an unknown reason it doesn't work...

Re: Detecting VBL on 800 in 700-mode

Posted: Wed Sep 18, 2019 9:12 am
by Jo Even
Yes, there is no VBL interrupt on the 700. I expected the 800 to work in the same way in 700 mode, but apparently not. Tested on both emulator and a real 800. Keyboard is working in both cases, which it wouldn't unless running in 700 mode with correct memory map.

Re: Detecting VBL on 800 in 700-mode

Posted: Wed Sep 18, 2019 12:10 pm
by hlide
Jo Even wrote: Mon Sep 16, 2019 5:49 am It doesn't work on a real 800 either.
Is that so? did you test it yourself and put the rear switch in the exact position for MZ700 mode?

Re: Detecting VBL on 800 in 700-mode

Posted: Wed Sep 18, 2019 12:12 pm
by hlide
Did you try with EmuZ-800?

Re: Detecting VBL on 800 in 700-mode

Posted: Wed Sep 18, 2019 12:29 pm
by Jo Even
hlide wrote: Wed Sep 18, 2019 12:10 pmIs that so? did you test it yourself and put the rear switch in the exact position for MZ700 mode?
I don't have a real 800 so no, I did not test it myself. But I'm quite sure that it was tested in 700-mode - keyboard polling (done in the program itself by reading the matrix directly via the 8255, not by calling the monitor routines) is working, which can only be possible in 700-mode. In 800-mode the 8255 is not memory mapped, but accessed via ports. Also, the 700 VRAM is not mapped in 800-mode, but screen output (again, accessing 700 hardware directly, no monitor routines involved) is working correctly.