Application: Check if running on an MSX2.

To support Yamaha CX5MII, if it is an MSX1, check VDP type as well.
In that case it will work but the visualisation will be disabled.
3 files changed, 22 insertions(+), 0 deletions(-)

M src/Application.asm
M src/Player.asm
M src/Visualization.asm
M src/Application.asm +6 -0
@@ 130,6 130,9 @@ Application_Print:
 Application_Run: PROC
 	ld hl,Application_welcome
 	call Application_Print
+	call Player_Detect
+	ld hl,Application_msx2Required
+	call z,System_ThrowExceptionWithMessage
 	push ix
 	call Application_GetCLI
 	call CLI_HasFileInfoBlock

          
@@ 270,6 273,9 @@ Application_endPlayback:
 Application_playing:
 	db "Playing...",13,10,0
 
+Application_msx2Required:
+	db "MSX2 is required.",13,10,0
+
 Application_driverNotFound:
 	db "MSX-MUSIC not found.",13,10,0
 

          
M src/Player.asm +9 -0
@@ 41,6 41,9 @@ Player_Construct:
 	pop ix
 	ld (ix + Player.sequence),e
 	ld (ix + Player.sequence + 1),d
+	call Visualization_Detect
+	ret nz
+	ld (ix + Player.enableVisualization),0
 	ret
 
 ; ix = this

          
@@ 314,3 317,9 @@ Done:
 	pop ix
 	ret
 	ENDP
+
+; f <- nz: supported
+Player_Detect:
+	call Visualization_Detect
+	call z,VDP_IsTMS9918A
+	ret

          
M src/Visualization.asm +7 -0
@@ 124,6 124,13 @@ VRStartLoop:
 	ret
 	ENDP
 
+; f <- nz: supported
+Visualization_Detect:
+	ld hl,IDBYT2
+	call System_ReadBIOS
+	and a
+	ret
+
 ;
 Visualization_palette:
 	dw 000H, 000H, 000H, 070H, 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H