CHGCPU	equ	&0180 ;Turbo R ON

GetHardwareVer:	
	di
	ld a,(&002D)	;0=msx  1=MS2  2=MSX2+  3=TurboR	4=WSX
	ld d,a
	ld e,0
	
	cp 2
	ret nz
	ld a,8
	out (64),a
	in a,(64)
	
	cp 247
	ret nz
	ld d,4
	ret
	
	
	

EnableFastCPU:
	;Kick in the turbo-R 
	ld	A,(CHGCPU)
	cp	&0C3
	ld	a,&82              ; can be ld a,81h for R800 ROM if you wish
	jp	z,CHGCPU
	
	;IF PEEK(&H2D)=2 THEN OUT 64,8 IF INP(64)=247 THEN OUT 65,0

;Panasonic FS-A1WX PCB
	ld a,(&2D)
	cp 2
	ret nz
	ld a,8
	out (64),a
	in a,(64)
	cp 247
	ret nz
	xor a
	out (65),a
	
	ret
