Detecting VDP type

Página 1/4
| 2 | 3 | 4

Por santiontanon

Paladin (834)

Imagen del santiontanon

05-08-2019, 12:21

I am interested in using some of the undocumented hybrid graphic modes on MSX1, and I know that they are not compatible with some VDP types. Is there anyway to detect automatically if the computer we are running on supports these modes? or if we are running a Toshiba or a TI VDP, etc.? If that were possible, I could code a default effect in case the computer does not support the hybrid mode, and thus, the game would run on all MSXs, even if it would only look fancy on those supporting the hybrid modes...

Login sesión o register para postear comentarios

Por Grauw

Ascended (8457)

Imagen del Grauw

05-08-2019, 15:30

I think there is differerence in behaviour addressing registers > 8, the Texas Instruments VDPs mirror but the Toshiba ones don’t. (Not sure about the Yamaha YM2220.) So you could perhaps exploit this to set something up which can be detected in the status register if it mirrors.

Por santiontanon

Paladin (834)

Imagen del santiontanon

06-08-2019, 00:08

Thanks!!! That's a good start! I'll create a couple of tests and will post results here Smile

Por santiontanon

Paladin (834)

Imagen del santiontanon

07-08-2019, 00:20

I tried a very simple approach, trying to exploit this idea of register mirroring, but I might be doing something wrong. What I tried is this:
- I set a custom interrupt routine that the only thing it does is to set some variable to 1
- I then deactivate VDP interrupts in a wrong way (by changing it in register 1+8, rather than register 1)
- I then wait longer than the time it should take to generate an interrupt and check the value of the variable the interrupt handler should have modified.

I expect the interrupt to be disabled on VDPs that do register mirroring, but not on VDPs that do not do register mirroring.

But no matter which computer I select in openMSX, the behavior is all the same (registers are mirrored, and thus the interrupt never executes). If I run it on a computer with a VDP 9938 or higher, of course the interrupt is indeed generated, since register 1+8 exists, and thus, there is no mirroring.

So, (other than having a bug on my code) it could be due to two things:
- Maybe all Both TI and Toshiba VDPs do mirroring
- Or Maybe openMSX is not emulating this

I'll keep investigating Smile

Por Manuel

Ascended (15763)

Imagen del Manuel

07-08-2019, 10:11

openMSX distinguishes the following differences in vdp's:

        // VdpVersion bitmasks
         static const unsigned VM_MSX1             =  1; // set-> MSX1,       unset-> MSX2 or MSX2+
         static const unsigned VM_PAL              =  2; // set-> fixed PAL,  unset-> fixed NTSC or switchable
         static const unsigned VM_NO_MIRRORING     =  4; // set-> no (screen2) mirroring
         static const unsigned VM_PALCOL_MIRRORING =  8; // set-> pattern/color-table mirroring
         static const unsigned VM_VRAM_REMAPPING   = 16; // set-> 4k,8/16k VRAM remapping
         static const unsigned VM_TOSHIBA_PALETTE  = 32; // set-> has Toshiba palette
         static const unsigned VM_YJK              = 64; // set-> has YJK (MSX2+)

Por ARTRAG

Enlighted (6251)

Imagen del ARTRAG

07-08-2019, 11:20

I do not think it is possible to auto detect if pattern mirroring in supported or not by current machine
Patterns do not affect the status register and sprite cloning is randomic and unrealiable.

Por santiontanon

Paladin (834)

Imagen del santiontanon

07-08-2019, 12:40

I see, what I was hoping based on Grauw's answer was that registers themselves were mirrored in some VDPs but not in others. So, writing to register "9" (which does not exist) would write to register "1" in those that do mirroring, but do nothing on those that do not do mirroring. But looking at Manuel's list, I don't think "register mirroring" is there. So, I might have to think of something else Smile

Por santiontanon

Paladin (834)

Imagen del santiontanon

07-08-2019, 12:41

Basically, what I wanted is to make use of hybrid modes, while still being compatible with all MSX models. But maybe an easier option is just to let the user select from the game menu whether to use the hybrid mode renderer, or a backup renderer for MSX models that do not support it

Por Grauw

Ascended (8457)

Imagen del Grauw

07-08-2019, 13:21

I think you should check on a real machine rather than an emulator. The simplest test I can imagine is to set register 15 to 0. If the registers mirror then the screen will turn black, otherwise nothing should happen. I only have a Sony HB-75P MSX1 (TMS9929A) myself so unfortunately I can’t test it for you.

p.s. I don’t think IDENT.BAS tests for register address mirroring? Otherwise you could look at previously reported results for that.

Por Parn

Champion (420)

Imagen del Parn

07-08-2019, 14:17

I think @santiontanon's idea is intriguing and I'm curious about what he'll do with it. It's a bit sad to think we would need a specific type of MSX1 to enjoy it, though. Tongue

Por gdx

Prophet (3043)

Imagen del gdx

07-08-2019, 15:28

santiontanon wrote:

I see, what I was hoping based on Grauw's answer was that registers themselves were mirrored in some VDPs but not in others. So, writing to register "9" (which does not exist) would write to register "1" in those that do mirroring, but do nothing on those that do not do mirroring.

I'm sure but I think not all MSX1 VDP have these mirrors. The HX-10DP seems not to have these reflects.

Página 1/4
| 2 | 3 | 4