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

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

By gdx

Enlighted (4632)

gdx's picture

06-07-2021, 10:35

These models don't have TMS9918 but a TMS9928A, TMS9128 TMS9929A or TMS9129. (the frequency is not the same)

By sdsnatcher73

Prophet (2144)

sdsnatcher73's picture

06-07-2021, 11:20

Yeah but it does not matter for what we are trying to achieve.

By NYYRIKKI

Enlighted (5838)

NYYRIKKI's picture

06-07-2021, 12:27

How about not detecting at all but just fixing the possible damages... Something like:

; 60HZ.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)
	and	0fdh
	di
	out	(c),a
	ld	(RG9SAV),a
	ld	a,80h+9
	out	(c),a
	ei
	ret		; Back to the DOS

By Grauw

Ascended (10010)

Grauw's picture

06-07-2021, 12:43

That’s a good idea.

Though I would simplify it more by just restoring register 1 instead of all of 0-7.

By sdsnatcher73

Prophet (2144)

sdsnatcher73's picture

08-07-2021, 20:59

How do I compile such an asm? I tried creating 60hz.asm from above listing and ran sjasmplus 60hz.asm, it compiles but no 60hz.com Crying

By NYYRIKKI

Enlighted (5838)

NYYRIKKI's picture

08-07-2021, 22:42

Yeah, sjasmplus is a bit potato in a sense that you really need to put OUTPUT "60hz.com" as first line in order not to send all the rest to bit heaven.

By gdx

Enlighted (4632)

gdx's picture

09-07-2021, 02:06

Grauw wrote:

Though I would simplify it more by just restoring register 1 instead of all of 0-7.

Right, it is the most simple.

; 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,(RG9SAV)
	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
; 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,(RG9SAV)
	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

By sdsnatcher73

Prophet (2144)

sdsnatcher73's picture

09-07-2021, 08:12

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

Grauw wrote:

Ah, that is probably because on MSX1 the RG9SAV is uninitialised. It can be initialised to 0 if the BIOS version ID is 0.

By gdx

Enlighted (4632)

gdx's picture

09-07-2021, 09:26

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

By NYYRIKKI

Enlighted (5838)

NYYRIKKI's picture

09-07-2021, 10:05

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.

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