GetHardwareVer:		
	di
	ld de,&0000
		
	push de
		ld d,31
		call BankTest
	pop de
	ret nc
	inc e
	
	ret
	
;	D=CPCVer	(1=Plus)
;	E=Ram		(0=64k,1=128k,2=256k,3=512 (SAM) )
	
BankTest:
	ld a,Bank0
	call BankSwitch_SetCurrent

	ld a,&69
	ld (BankBase),a

	ld a,d
	call BankSwitch_SetCurrent
	ld hl,BankBase
	ld a,(hl)
	;ld e,a
	cpl 
	ld (hl),a
	cp (hl)
	jr nz,BankFail

	ld a,Bank0
	call BankSwitch_SetCurrent
	
	ld a,(BankBase)
	cp &69
	jr nz,BankFail
	
	;ld a,d
	;call BankSwitch_SetCurrent
	
;	ld a,e
	;ld (BankBase),a
	
	ld a,Bank0
	call BankSwitch_SetCurrent
	scf
	ret
BankFail:
	or a
	ret

