Cartridge self-checking

From NeoGeo Development Wiki
Jump to: navigation, search

From Samurai Shodown IV - Amakusa's Revenge, done for all 4 banks in $200000~$2FFFFF:

	move	#$0FFF,d7		;Number of times to test until error
	move	#$0001,$2FFFF0		;Set P bank 1
	cmpi	#$0001,$2FFFF0		;Check if ($2FFFF0) = 1
	beq	LAB_0058		;Pass
	dbf	d7,LAB_0057		;Or loop
	move	#$0048,EXT_0574		;Fail
	move.b	#$FF,2066(a5)		;Set RAM
	jmp	EXT_01A0		;Write "WARNING BANK ERROR" and lock

Also see slot check security.