playch10: fixed crash at start

This commit is contained in:
Robbbert 2020-11-24 18:13:26 +11:00
parent 50c640b472
commit 96a78f81da

View File

@ -343,7 +343,11 @@ void playch10_state::pc10_set_videorom_bank( int first, int count, int bank, int
/* yeah, this is probably a horrible assumption to make.*/
/* but the driver is 100% consistant */
len = memregion("gfx2")->bytes();
if (memregion("gfx2")) // playch10 bios doesn't have gfx2
len = memregion("gfx2")->bytes();
else
len = memregion("gfx1")->bytes();
len /= 0x400; // convert to KB
len /= size; // convert to bank resolution
len--; // convert to mask