[HELP ME] I'm having a weird jump when writing to the VDP Mode Register 1

Page 2/2
1 |

By tsMKG

Resident (43)

tsMKG's picture

11-02-2018, 19:54

Yeah, now that doesn't seem to be the problem, the problem is that I still can't enable the screen, what would be the cause of this? Question

By Grauw

Enlighted (7797)

Grauw's picture

11-02-2018, 20:48

And the interrupt occurred at that exact point because that’s where you (re-)enabled IE0, which must have been pending for a while and then fires immediately.

Can’t tell why the screen is not shown though. Could be because you made a mistake in the set-up earlier. Personally I tend to use the BIOS to do the screen select, and only change the bits I need to by taking the mirrored value from RAM and altering just that bit. Less that can go wrong that way.

Either way, I notice you set register 1 bit 7 when it’s documented to be set to 0. That’s a bit odd, maybe there are other mistakes like that? I would carefully go over the values you set and cross-reference them with the V9938 manual to see if they’re all alright. Then set things step by step, just focusing on one particular part. E.g. not disabling the screen in the first place, just focusing on the mode registers, then just disabling the screen without mode registers, etc.

Just in case you were thinking about it, generally there’s no weird VDP behaviour that you should expect. I’m mentioning this because I know others often start thinking in that direction. Though it’s easy to think you’ve perhaps hit some strange case, these type of things generally always tend to be code errors, not weird or buggy VDP behaviours, since the VDP behaves quite predictably Smile.

By tsMKG

Resident (43)

tsMKG's picture

12-02-2018, 04:50

Well, I think I solved most of the problems.
The solution: always rely on BIOS calls even if you don't like 'em.

but looks like right now I'm having another problem not related to this one though. I think i'll make a new thread for that one.

By TomH

Champion (295)

TomH's picture

13-02-2018, 16:22

tsMKG wrote:

Apparently, it kinda solved the situation but the screen is still blank and now jump when it gets to ei.

Following up on this — if your emulator jumps as soon as it has completed EI, you've found an emulator bug. Are you sure it's not jumping after performing the instruction straight after the EI?

Correct Z80 behaviour for interrupts: sample the line one cycle before the end of the instruction. Correct Z80 behaviour for EI: set the IFF1 and IFF2 flags during the last cycle of the instruction. Net effect if interrupts were disabled prior to the EI is that the instruction after the EI should be performed before servicing an interrupt even if one is signalled the entire time.

(EDIT: source)

Page 2/2
1 |
My MSX profile