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

Página 1/7
| 2 | 3 | 4 | 5 | 6

Por sdsnatcher73

Prophet (2157)

Imagen del sdsnatcher73

03-07-2021, 08:15

I wonder if there is a version of 60HZ.COM (which I have in my autoexec.bat) that does not mess up the screen when ran on an MSX1? The current version does not check MSX version / VDP version so it just sets the register bit. On an MSX1 you end up with a garbled screen. It would be nice if a version existed that does nothing on MSX1 but switches on MSX2 and higher. Same goes for 50HZ.COM obviouslyWink

Login sesión o register para postear comentarios

Por lintweaker

Champion (415)

Imagen del lintweaker

03-07-2021, 09:24

If there is no such version, it will not be very hard to make one. Smile
I can whip one up if needed.

edit:
I had a simular program already laying around (enable VDPWAIT). 60Hz for MSX2/2+/TR:
https://github.com/lintweaker/msxstuff/tree/master/tools

Por gdx

Enlighted (4642)

Imagen del gdx

03-07-2021, 09:48

; 50HZ.COM

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

	org	0100h

	ld	a,(0fcc1h)
	ld	hl,002dh
	call	RDSLT
	or	a
	jr	nz,NoMSX1	; Back if MSX1

	ld	de,MSX1_TXT
	ld	c,9		; _STROUT routine
	jp	BDOS		; Print the message and back to the DOS

NoMSX1:
	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	
	out	(c),a	
	ei		
	ret		; Back to the DOS

MSX1_TXT:
	db	'No effect on MSX1!$'
; 60HZ.COM

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

	org	0100h

	ld	a,(0fcc1h)
	ld	hl,002dh
	call	RDSLT
	or	a
	jr	nz,NoMSX1	; Back if MSX1

	ld	de,MSX1_TXT
	ld	c,9		; _STROUT routine
	jp	BDOS		; Print the message and back to the DOS

NoMSX1:
	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
	out	(c),a
	ei		
	ret		; Back to the DOS

MSX1_TXT:
	db	'No effect on MSX1!$'

Por Grauw

Ascended (10025)

Imagen del Grauw

03-07-2021, 10:54

Don't forget machines like the Yamaha CX5MII though, MSX1 machines with a V9938 capable of switching frequency.

Por gdx

Enlighted (4642)

Imagen del gdx

03-07-2021, 11:04

We need a routine to detect the VDP type without using the Sprites to do it.

Por PingPong

Prophet (3756)

Imagen del PingPong

03-07-2021, 14:03

what does happen if on a msx1 machine one write '1' to unused bit 0f control register 0? (mean M4/M5)
to detect if msx1 vdp or msx2 one could try to
- set a screen 4 mode and align 5 sprites on a row checking the overflow flag...
- or set vram ptr to first byte in VRAM write a 0, then set a vram ptr to the last byte of 16K and then write two bytes at 255, then read back address = 0, if we read a 0 then it's a V9938 otherwise a wrap around occoured and vpeek(0) will be 255.
- any other idea?

Por gdx

Enlighted (4642)

Imagen del gdx

03-07-2021, 14:27

Quote:

- set a screen 4 mode and align 5 sprites on a row checking the overflow flag...

There is already a routine to detect the VDP type using the sprites in the wiki.

https://www.msx.org/wiki/How_to_detect_VDP_type

It works fine but the screen mode needs to be changed. Under MSX-DOS, it generally in SCREEN0. It would be better to do the test in the current screen mode.

Por Louthrax

Prophet (2406)

Imagen del Louthrax

03-07-2021, 14:39

What about Status Register 1 / ID ?

bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
R#1 FL LPS ID FH (MSX2/2+/Turbo R)
ID is the number to identify the VDP chip used

Por gdx

Enlighted (4642)

Imagen del gdx

03-07-2021, 14:49

Status Register 1 is used in the detection routine from the wiki but it needs using sprites because the register 15 does not exist on MSX1.

I'm wondering if we can put 26 lines in 40 mode.

Por Grauw

Ascended (10025)

Imagen del Grauw

03-07-2021, 15:22

Por PingPong

Prophet (3756)

Imagen del PingPong

03-07-2021, 15:44

i see, but i was relying in vram wrap around because the alternative methods i've found around relay on the polling of hr flag that on TMS (and maybe V9938) is not reliable because of the race condition, even if not so easy to hit this situation. Or i'm wrong?

Página 1/7
| 2 | 3 | 4 | 5 | 6