Detecting VBL on 800 in 700-mode

Jo Even
Site Admin
Posts: 110
Joined: Wed Jan 17, 2018 9:28 pm

Re: Detecting VBL on 800 in 700-mode

Post by Jo Even » Mon Sep 16, 2019 5:49 am

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 :)

hlide
Posts: 285
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post by hlide » Mon Sep 16, 2019 11:46 am

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?).

hlide
Posts: 285
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post by hlide » Mon Sep 16, 2019 12:26 pm

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)?

Jo Even
Site Admin
Posts: 110
Joined: Wed Jan 17, 2018 9:28 pm

Re: Detecting VBL on 800 in 700-mode

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

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.

UncleBod
Posts: 17
Joined: Tue Sep 18, 2018 1:26 pm

Re: Detecting VBL on 800 in 700-mode

Post by UncleBod » Tue Sep 17, 2019 4:43 pm

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?

hlide
Posts: 285
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post by hlide » Tue Sep 17, 2019 5:39 pm

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...

Jo Even
Site Admin
Posts: 110
Joined: Wed Jan 17, 2018 9:28 pm

Re: Detecting VBL on 800 in 700-mode

Post by Jo Even » Wed Sep 18, 2019 9:12 am

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.

hlide
Posts: 285
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post by hlide » Wed Sep 18, 2019 12:10 pm

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?

hlide
Posts: 285
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post by hlide » Wed Sep 18, 2019 12:12 pm

Did you try with EmuZ-800?

Jo Even
Site Admin
Posts: 110
Joined: Wed Jan 17, 2018 9:28 pm

Re: Detecting VBL on 800 in 700-mode

Post by Jo Even » Wed Sep 18, 2019 12:29 pm

hlide wrote:
Wed Sep 18, 2019 12:10 pm
Is 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.

Post Reply