How to detect VDP type
This page was last modified 13:43, 9 March 2011 by NYYRIKKI.

Only TMS99xx, V9938 and V9958 can be accidentally mixed with each other as they all use same I/O ports. Here is a proper method, how to detect wich one is connected to your MSX.

10 SCREEN1:V$(0)="V9938":V$(1)="TMS99xx":V$(2)="V9958"
20 FOR i=6to10:putspritei,(0,0):nexti:time=0:fori=0to2:i=time:nexti
30 ?"VDP: ";V$(USR(0)\2)
; Point DEFUSR= here
 
; Read status register 1
	di
	ld a,1
	out (#99),a
	ld a,#8F
	out (#99),a
	in a,(#99)
	push af
	xor a
	out (#99),a
	ld a,#8f
	out (#99),a
	pop af
 
; Return VDP number
	and %110
	LD (#f7f8),A	; VDP number in register A
	ret