diff --git a/Src/Memory/romMapperSg1000RamExpander.c b/Src/Memory/romMapperSg1000RamExpander.c index 1185f81..27900ca 100644 --- a/Src/Memory/romMapperSg1000RamExpander.c +++ b/Src/Memory/romMapperSg1000RamExpander.c @@ -35,7 +35,6 @@ #include #include - typedef struct { int deviceHandle; UInt8* romData; @@ -85,7 +84,7 @@ static UInt8 read(RomMapperSg1000RamExpander* rm, UInt16 address) static UInt8 read_ram1(RomMapperSg1000RamExpander* rm, UInt16 address) { - return rm->ram1[address - 0x2000]; + return rm->ram1[address & 0x1fff]; } static void write(RomMapperSg1000RamExpander* rm, UInt16 address, UInt8 value) @@ -95,7 +94,7 @@ static void write(RomMapperSg1000RamExpander* rm, UInt16 address, UInt8 value) static void write_ram1(RomMapperSg1000RamExpander* rm, UInt16 address, UInt8 value) { - rm->ram1[address-0x2000] = value; + rm->ram1[address & 0x1fff] = value; } int romMapperSg1000RamExpanderCreate(const char* filename, UInt8* romData, @@ -123,20 +122,17 @@ int romMapperSg1000RamExpanderCreate(const char* filename, UInt8* romData, rm->slot = slot; rm->sslot = sslot; rm->startPage = startPage; - rm->mask2 = ROM_SG1000_RAMEXPANDER_A ? 0x0400 : 0x2000; - + rm->mask2 = (type == ROM_SG1000_RAMEXPANDER_A) ? 0x3FF: 0x1FFF; + for (i = 0; i < pages; i++) { if (i + startPage >= 2) slot = 0; - if (type == ROM_SG1000_RAMEXPANDER_A && i + startPage == 1) { + if (type == ROM_SG1000_RAMEXPANDER_A && i + startPage == 1) slotRegister(slot, sslot, i + startPage, 1, read_ram1, read_ram1, write_ram1, destroy, rm); - } - else { + else slotMapPage(slot, sslot, i + startPage, rm->romData + 0x2000 * i, 1, 0); - } } - slotMapPage(0, 0, 6, rm->ram2, 1, 1); - slotMapPage(0, 0, 7, rm->ram2, 1, 1); + slotRegister(0, 0, 6, 2, read, read, write, destroy, rm); return 1; } diff --git a/system/bluemsx/Databases/segadb.xml b/system/bluemsx/Databases/segadb.xml index 4713c5e..d30fbb3 100644 --- a/system/bluemsx/Databases/segadb.xml +++ b/system/bluemsx/Databases/segadb.xml @@ -1718,20 +1718,6 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 - - King's Valley - Sega - Konami - 1985 - JP - - - - SG1000RamA - 922d23895c12707b2fc382ea5cb769c5cb9b5755 - - - Konami's Ping-Pong Sega @@ -3193,20 +3179,6 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 - - Magical Kid Wiz - Sega - Sony - 1986 - JP - - - - SC3000 - fd24b501046cf811b04386129be0362a1eabf6b3 - - - Super Boy I Sega @@ -3278,6 +3250,7 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 + Rally-X Sega @@ -3287,7 +3260,7 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 - sg1000ramA + sg1000ramB 0c1957a5faae5254c69f3331e79d87499dd7cf48 @@ -3328,7 +3301,7 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 - *Bomberman Special + Bomberman Special Sega DahJee 1986 @@ -3336,7 +3309,7 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 - sg1000ramA + sg1000ramB d1d56bcd996df94458f5901dc537a5e30021256b @@ -3349,7 +3322,7 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 - Legend of Kage + The Legend of Kage Sega DahJee 1986 @@ -3378,7 +3351,7 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 - sg1000ramA + sg1000ramB 2755f74019dc94559fd0c2248e2ecb7f48879b90 @@ -3411,4 +3384,74 @@ f0f128b25e5557e660d936995e6bf25c8ebd17e5 + + Star Soldier + Sega + DahJee + 19xx + TW + + + + sg1000ramA + c1984257809ec5bce80a65d22b9b32561e04922c + + + + + King's Valley + Sega + Jinzita + 198x + TW + + + + sg1000ramA + 922d23895c12707b2fc382ea5cb769c5cb9b5755 + + + + + Pippols + Sega + Jumbo + 198x + TW + + + + sg1000ramA + 4a95b98e127fb0c6428d6debcfc92152069ac531 + + + + + The Castle + Sega + DahJee + 1986 + TW + + + + sg1000ramB + 5a81d5103487695cabd811aabd9e71f48b9e7996 + + + + + Magical Kid Wiz + Sega + Sony + 1986 + JP + + + + sg1000ramB + fd24b501046cf811b04386129be0362a1eabf6b3 + + +