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

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

Van sdsnatcher73

Prophet (2151)

afbeelding van sdsnatcher73

09-07-2021, 10:39

NYYRIKKI wrote:
sdsnatcher73 wrote:

Woohoo that seems to work great, on a CX11 (with V9938) it however still messes up the bottom 2 lines.

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

I tried your version (I created a 50hz.asm) as well but it seems to do nothing on MSX1 with V9938 (register 9 remains 0).

; 50HZ.COM

BDOS	equ	00005h
RDSLT	equ	0000Ch
RG9SAV	equ	0FFE8h
RG0SAV  equ 0F3DFh

	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

        xor     a
        ld      b,8
        ld      hl,RG0SAV
        di
        out     (c),a
	ld	a,80h+9
	out	(c),a
	ld      a,80h
.loop
        ld      d,(hl)
        out     (c),d
        inc     hl
        out     (c),a
        inc     a
        djnz    .loop
        ei
        ret

NoMSX1:

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

Van sdsnatcher73

Prophet (2151)

afbeelding van sdsnatcher73

09-07-2021, 10:30

gdx wrote:

Strange, the 26 lines mode seems selected. You have probably a wrong version of MSX-DOS. Check it. You can also try the following command (24LINES.COM).

https://www.msx.org/forum/msx-talk/general-discussion/using-msx-dos-in-a-higher-linesscreen-mode?page=0

The MSX-DOS version is fine, it is the last version released by ASCII/Microsoft (the one with that last fix in it, can't remember what that was right now).

The machine boots nicely into 24 lines mode before doing anything else:

I checked in openmsx and vdpreg 9 in console window gives output 191. If I set it to 2 in the console the screen is fine. So it's just like Grauw said. The program should check If it is on MSX1 and use 0 as start value of REG9SAV in that case.

Van gdx

Enlighted (4637)

afbeelding van gdx

09-07-2021, 10:47

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.

Van sdsnatcher73

Prophet (2151)

afbeelding van sdsnatcher73

09-07-2021, 10:56

So I have it working now, combining code from both versions (forgive me if the code is not optimal):

; 50HZ.COM

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		z,MSX1

MSX2:
	ld		a,(RG9SAV)
	jr		CONTINUE

MSX1:
	ld		a,0

CONTINUE:
	or		2
	di
	out		(c),a
	ld		(RG9SAV),a
	ld		a,80h+9		; Set the 50Hz mode (writing in the register 1 if MSX1 VDP)
	out		(c),a

	ld		a,(RG1SAV)
	out		(c),a
	ld		a,80h+1		; Restore the register 1 for the MSX1 VDP case
	ei
	out		(c),a
	ret					; Back to the DOS
; 60HZ.COM

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		z,MSX1

MSX2:
	ld		a,(RG9SAV)
	jr		CONTINUE

MSX1:
	ld		a,0

CONTINUE:
	and		0fdh
	di
	out		(c),a
	ld		(RG9SAV),a
	ld		a,80h+9		; Set the 60Hz mode (writing in the register 1 if MSX1 VDP)
	out		(c),a

	ld		a,(RG1SAV)
	out		(c),a
	ld		a,80h+1		; Restore the register 1 for the MSX1 VDP case
	ei
	out		(c),a
	ret					; Back to the DOS

Van gdx

Enlighted (4637)

afbeelding van gdx

09-07-2021, 11:12

sdsnatcher73, have you had also this issue on real machine ?
I suspect it is due to this bug:
https://www.msx.org/forum/msx-talk/openmsx/openmsx-bugs?page=12

The FFE8h address should return 0 on MSX1.

Van sdsnatcher73

Prophet (2151)

afbeelding van sdsnatcher73

09-07-2021, 12:09

The issue is the same on real CX11 on cold boot.

VIDEO

If I run my tool first, reboot and then run your tool it is working as well. I guess REG9SAV is not initialised like Grauw mentioned but obviously persists with reset (BIOS leaves it untouched).

I have created a repository for these so they don't get lost. Thanks for the help with these!!

Van mars2000you

Enlighted (5963)

afbeelding van mars2000you

09-07-2021, 12:35

Maybe the problem is the Yamaha X3527 MSX-System.... (it's the only machine with this 'experimental' chip).

Van Grauw

Ascended (10019)

afbeelding van Grauw

09-07-2021, 12:42

sdsnatcher73 wrote:

So I have it working now, combining code from both versions (forgive me if the code is not optimal):

We have a fine assembly programmer in the making! Big smile

About the VDP register > 7 mirrors being uninitialised, it’s the same on my Yamaha CX5MII. The MSX1 BIOS simply is not aware of them and thus they’re never initialised, so it can be anything. On a cold boot the initial value could be 0, 255 or something else depending on the type of RAM chips used.

Van Grauw

Ascended (10019)

afbeelding van Grauw

09-07-2021, 13:15

Though I just checked in the Yamaha CX5MII in openMSX, and the support ROM in slot 3-0 (called “sub-rom” on the wiki but that’s a little confusing) does not only initialise the VDP registers but also write their values to the MSX2 mirror register addresses. In MSX-BASIC, if you type ?PEEK(&HFFE8), it will return 2 as is appropriate for a PAL system. The initialisation code is at address 418EH in slot 3-0.

But I could swear I had seen issues with uninitialised VDP register mirrors on my CX5MII. I think I was probably accessing them in a ROM cartridge, which would then run before the support ROM does. (Using H.STKE to delay the execution would fix that.)

The Yamaha CX11 does not have this support ROM in slot 3-0 so logically it will not initialise the VDP or the mirrors. According to the wiki, neither does the Yamaha YIS-503II, YIS-503IIR and YIS-603.

Van sdsnatcher73

Prophet (2151)

afbeelding van sdsnatcher73

09-07-2021, 13:07

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.

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