Detecting VBL on 800 in 700-mode

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

Re: Detecting VBL on 800 in 700-mode

Post 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 :)
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post 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?).
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post 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)?
Jo Even
Site Admin
Posts: 152
Joined: Wed Jan 17, 2018 9:28 pm

Re: Detecting VBL on 800 in 700-mode

Post 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.
UncleBod
Posts: 25
Joined: Tue Sep 18, 2018 1:26 pm

Re: Detecting VBL on 800 in 700-mode

Post 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?
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post 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...
Jo Even
Site Admin
Posts: 152
Joined: Wed Jan 17, 2018 9:28 pm

Re: Detecting VBL on 800 in 700-mode

Post 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.
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post 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?
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: Detecting VBL on 800 in 700-mode

Post by hlide »

Did you try with EmuZ-800?
Jo Even
Site Admin
Posts: 152
Joined: Wed Jan 17, 2018 9:28 pm

Re: Detecting VBL on 800 in 700-mode

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