ekeeke / Genesis-Plus-GX

An enhanced port of Genesis Plus - accurate & portable Sega 8/16 bit emulator
Other
692 stars 197 forks source link

Knightmare (Taiwan) in a loop when using run-ahead feature in Retroarch #268

Closed FeRcHuLeS closed 5 years ago

FeRcHuLeS commented 5 years ago

This sg1000 game dont run normally and is in a loop as the latest build. crc32: 281D2888 md5: e0321cd713ec1b48ff88f7df13e3ce28

ekeeke commented 5 years ago

Seems to run fine for me, what is exactly your problem ? Do you have Retroarch run-ahead feature enabled ?

image image

FeRcHuLeS commented 5 years ago

Hi Eke, It is strange this is because of a optin called "Run ahead to reduce latency" set to on, where the white background intro is shown one after other in a loop, I always set this option on and is the first time with something like this.

ekeeke commented 5 years ago

It's probably related to the specific mapper used by this game not being correctly saved in savestate (should also happen with the games listed below)

'/ games requiring SG-1000 II 8K RAM extension adapters / {0xCE5648C3, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Bomberman Special [DahJee] (TW) / {0x223397A1, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / King's Valley (TW) / {0x281D2888, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Knightmare (TW) / {0x306D5F78, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Rally-X [DahJee] (TW) / {0x29E047CC, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Road Fighter (TW) / {0x5CBD1163, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Tank Battalion (TW) / {0x2E7166D5, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / The Legend of Kage (TW) / {0xC550B4F0, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / TwinBee (TW) / {0xFC87463C, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Yie Ar Kung-Fu II (TW) / {0xDF7CBFA5, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Pippols (TW) / {0xE0816BB7, 0, 0, 0, MAPPER_RAM_8K_EXT1, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Star Soldier (TW) / {0x69FC1494, 0, 0, 0, MAPPER_RAM_8K_EXT2, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Bomberman Special (TW) / {0xFFC4EE3F, 0, 0, 0, MAPPER_RAM_8K_EXT2, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Magical Kid Wiz (TW) / {0x2E366CCF, 0, 0, 0, MAPPER_RAM_8K_EXT2, SYSTEM_SGII, REGION_JAPAN_NTSC}, / The Castle (TW) / {0xAAAC12CF, 0, 0, 0, MAPPER_RAM_8K_EXT2, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Rally-X (TW) / {0xD2EDD329, 0, 0, 0, MAPPER_RAM_8K_EXT2, SYSTEM_SGII, REGION_JAPAN_NTSC}, / Road Fighter (TW) /'

ekeeke commented 5 years ago

Indeed, only up to 8KB of work RAM is saved in SG-1000 savestates but games above that are marked MAPPER_RAM_8K_EXT1 (and also "The Castle" which uses a different mapper) have extra 8KB of RAM (mapped above the first 8KB) which is actually not saved, hence potential issues when loading savestate if important game data was written there (or using runahead since it saves then loads states every frame).

ekeeke commented 5 years ago

Fixed in https://github.com/ekeeke/Genesis-Plus-GX/commit/aa9300d58107e497b31ba63b3517f6fe408afb44