I'm not sure about your theory on the VDP version thingie, I would rather say the version bits reflect the version of the IO controller and if TMSS register ($A14000) exists or not, there is no clue this register would affect the VDP.
The reason why it checks for version before exit when no "SEGA" string is found in ROM header is probably to "reset" the TMSS register which was set upon initialization:
on init, setup TMSS register:
Code: Select all
;A1 = 00A11100 ;
MOVE.B -$10FF(A1), D0 ;
AND.B #$0F, D0 ;
BEQ.B SkipSequrity ;
MOVE.L #"SEGA", $2F00(A1)
SkipSequrity:
on exit, reset the TMSS register:
"bad" exit
Code: Select all
;A2 = 00A14000 ;
;A6 = 00A10001 ;
MOVE.B (A6), D0 ;
AND.B #$0F, D0 ;
BEQ.B GoAndHalt ;
MOVE.L #0,(A2) ;
GoAndHalt:
RTS
"good" exit (wondering why they used a different mask)
Code: Select all
;A2 = 00A14000 ;
;A6 = 00A10001 ;
MOVE.B (A6), D0 ;
AND.B #15, D0
BEQ.B SkipVDPblank
MOVE.L #0, (A2)
SkipVDPblank:
looks quite logical to me
The reason why the BIOS itself always checks version bits before writing to the register is probably because TMSS register do not exist on earlier machines and write would lockup the system. I admit this is a rather dummy verification since the BIOS has only been implemented on machines that should support that but this is common in software verification.