50/60Hz switch for MSX-DOS that checks VDP version?

Page 5/7
1 | 2 | 3 | 4 | | 6 | 7

By Grauw

Ascended (10062)

Grauw's picture

09-07-2021, 13:17

sdsnatcher73 wrote:
gdx wrote:
NYYRIKKI wrote:

Seems to me you compiled the gdx version. My version should not have this problem.

My version doesn't have this problem. I tested it on several real machine and CX5MII-128 emulated except the CX11 because I don't have the ROMs. Anyway, it would be amazing if it works on the emulated CX5MII-128 but not on the CX11.

Maybe my change to 50hz.asm from your base was incorrect and caused it to not work as expected. The issue with the CX11 is of course it boots in 60HZ so I can’t really test if a 60HZ.COM works well, i needed the 50HZ.com to test.

The short answer is that the Yamaha CX5MII has a support ROM in slot 3-0 that initialises the MSX2 VDP mirrors, but the Yamaha CX11 does not.

By gdx

Enlighted (4694)

gdx's picture

09-07-2021, 14:07

As Grauw points out in the other thread, the issue occurs because the BIOS doesn't initialize the reserved variables. As a result, my routine and that of NYYRIKKI are not complete.
Sdsnatcher73 routine is better provided that it is only used immediately after starting up.

I think the only solution to fix it is to modify the Bios or to upgrade the MSX1s with V9938 to MSX2.

By NYYRIKKI

Enlighted (5874)

NYYRIKKI's picture

09-07-2021, 15:49

gdx wrote:

The FFE8h address should return 0 on MSX1.

To me "reserved" means do not touch... That means you should not try to write it or expect to read any meaningful value... Ok, we now know how it was later used, so my interpretation is maybe stupid strict, but anyway technically correct.

sdsnatcher73 wrote:

Maybe my change to 50hz.asm from your base was incorrect and caused it to not work as expected. The issue with the CX11 is of course it boots in 60HZ so I can’t really test if a 60HZ.COM works well, i needed the 50HZ.com to test.

Ok, here are now both versions with "Grauw fixes":


	output "60HZ.COM"

BDOS	equ	00005h
RDSLT	equ	0000Ch
RG9SAV	equ	0FFE8h
RG1SAV  equ     0F3E0h

	org	0100h

	ld	a,(0fcc1h)
	ld	hl,0007h
	call	RDSLT
	ld	c,a
	inc	c

	ld	a,(0fcc1h)
	ld	hl,002dh
	push    bc
	call	RDSLT
	pop     bc
	or	a
	jr	nz,NoMSX1

        di
        xor     a
        out     (c),a
	ld	a,89h
	out	(c),a
	ld      a,(RG1SAV)
        out     (c),a
        ld	a,081h
        out     (c),a
        ei
        ret

NoMSX1:

	ld	a,(RG9SAV)
	and	0fdh
	di
	out	(c),a
	ld	(RG9SAV),a
	ld	a,89h
	out	(c),a
	ei
	ret		; Back to the DOS

	output "50HZ.COM"

BDOS	equ	00005h
RDSLT	equ	0000Ch
RG9SAV	equ	0FFE8h
RG1SAV  equ     0F3E0h

	org	0100h

	ld	a,(0fcc1h)
	ld	hl,0007h
	call	RDSLT
	ld	c,a
	inc	c

	ld	a,(0fcc1h)
	ld	hl,002dh
	push    bc
	call	RDSLT
	pop     bc
	or	a
	jr	nz,NoMSX1

        di
        ld	a,2
        out     (c),a
	ld	a,89h
	out	(c),a
	ld      a,(RG1SAV)
        out     (c),a
        ld	a,081h
        out     (c),a
        ei
        ret

NoMSX1:

	ld	a,(RG9SAV)
	or	2
	di
	out	(c),a
	ld	(RG9SAV),a
	ld	a,89h
	out	(c),a
	ei
	ret		; Back to the DOS

By sdsnatcher73

Prophet (2234)

sdsnatcher73's picture

09-07-2021, 15:54

Well given the constraints MSX1 with V9938 or higher whilst using MSX-DOS it seems unlikely the value of the other bits would have to be anything else then 0 or 2, right?

I mean it’s a limited set of machines, none have super-impose or digitizer functionality if I am correct. Interlace mode is not used in text modes, maybe it is in kanji mode but I doubt kanji mode works on MSX1 (although I am not sure). The alternating page mode set with EO also won’t be useful on MSX1. So I think it is pretty safe.

By NYYRIKKI

Enlighted (5874)

NYYRIKKI's picture

09-07-2021, 16:10

sdsnatcher73 wrote:

Well given the constraints MSX1 with V9938 or higher whilst using MSX-DOS it seems unlikely the value of the other bits would have to be anything else then 0 or 2, right?

I mean it’s a limited set of machines, none have super-impose or digitizer functionality if I am correct. Interlace mode is not used in text modes, maybe it is in kanji mode but I doubt kanji mode works on MSX1 (although I am not sure). The alternating page mode set with EO also won’t be useful on MSX1. So I think it is pretty safe.

Right, this is safe assumption... power on default is 0 and ie. on SVI-738 that was made for PAL region wrote just 2 to VDP and rest was normal MSX1 BIOS... So all true at least when we talk about 80's technology only... I've seen few old LCD TVs that had huge problems rendering MSX incomplete timing picture and on those TVs turning on IL-bit fixed the problem. How ever this is very rarely needed trick that makes the picture a bit "jumpy" on CRT TVs.

By mars2000you

Enlighted (5984)

mars2000you's picture

09-07-2021, 16:12

Kanji modes use screen 5 or 7. Only screen 5 is partially usable on a MSX1 with MSX2 VDP (I think NYYRIKKI has written a program for that). Kanji mode is an additional layer, so it's probably impossible on MSX1.

By Grauw

Ascended (10062)

Grauw's picture

09-07-2021, 16:15

What I do in programs that I want to work on MSX1 with V9938 (Synthesix) or MSX2 with V9958 (Tile²), on start-up I detect if it’s a machine like that and if so I initialise the VDP register mirrors to their default values, and then in the rest of the program I can use the mirrors as usual.

As for use of the bitmap modes on MSX1’s with V9938, they have only 16K memory (if not expanded, possible on CX5MII) so that prevents use of the bitmap modes in a practical way. But you can still use screen 0 width 80 and screen 4 with enhanced sprites, and of course the palette and 212 lines.

By NYYRIKKI

Enlighted (5874)

NYYRIKKI's picture

09-07-2021, 16:18

mars2000you wrote:

Kanji modes use screen 5 or 7. Only screen 5 is partially usable on a MSX1 with MSX2 VDP (I think NYYRIKKI has written a program for that).

Yes, SCREEN 7 is practically useless with 16kB of VRAM. SCREEN modes 0-4 are ok, 5-6 can show half screen and at least on 738 half screen of SCREEN 8 is kind of usable, but it displays "stretched" 128x128 resolution.

By Grauw

Ascended (10062)

Grauw's picture

09-07-2021, 17:54

NYYRIKKI wrote:

To me "reserved" means do not touch... That means you should not try to write it or expect to read any meaningful value... Ok, we now know how it was later used, so my interpretation is maybe stupid strict, but anyway technically correct.

Yes I think that is a bit unnecessarily strict Smile. They are not used for anything else, so if it makes the code simpler I think it can be useful to initialise them on startup and then use them throughout your program, as I mentioned above.

That said, in a simple tool like this, if you’re not reading the value, not much point in writing it either. Though as mentioned on the CX5MII these memory locations are initialised by the support ROM, so you would be updating those properly. But I doubt any software makes use of it, and no other MSX1-with-V9938 does this as far as I’m aware so it’s not a usable standard to rely on for software either.

I think it’s very interesting though how the CX5MII is a machine that’s clearly on the cusp of the transition of MSX1 to MSX2. That Yamaha took effort to already start integrating MSX2 functions and hardware, and that you can see them progress in this endeavour with every new model they released. The driving motivation was probably to support 80 columns mode, which was somewhat of a big deal at the time. The CX5MII supports WIDTH 80 through the BASIC extension in the support ROM (via hooks). Only in BASIC though, I wasn’t able to get it to work in MSX-DOS unfortunately.

By sdsnatcher73

Prophet (2234)

sdsnatcher73's picture

09-07-2021, 17:36

This also explains why it worked on NYYRIKKI’s CX-5MII and not my CX-11

Page 5/7
1 | 2 | 3 | 4 | | 6 | 7