Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion meka/compat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,7 @@
Super Battletank Ok
Super Columns Ok
Super Columns (JP) Ok
Super Gear 20 in 1 [Ninja Gaiden] *Ok
Super Golf (JP) Ok
Super Kick Off [SMS-GG] Ok
Superman - The Man of Steel Ok
Expand Down Expand Up @@ -1502,7 +1503,7 @@
Zoop (US) Ok
Zoop [Proto] (US) Ok
-----------------------------------------------------------------------------
517 games tested - 506 are "Ok" - Compatibility rate: 97.63%
518 games tested - 507 are "Ok" - Compatibility rate: 97.88%
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions meka/meka.nam
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@ GG b421c057 96BD12C62621B8D6 Striker/COUNTRY=EU/PRODUCT_NO=2551-50
GG 73d6745a 18CC99C9849C9901 Super Battletank/COUNTRY=US/PRODUCT_NO=1239
GG 8ba43af3 DAA4C785B7042952 Super Columns/COUNTRY=US,EU/PRODUCT_NO=2449,2449-50
GG 2a100717 E7260408CEC8EE63 Super Columns/COUNTRY=JP/PRODUCT_NO=G-3226
GG 696b1789 376AE3342E2149B0 Super Gear 20 in 1 [Ninja Gaiden]/EMU_MAPPER=31
GG 528cbbce FAE75543A7740E5E Super Golf/COUNTRY=JP/PRODUCT_NO=T-26017,T-26027
GG 73df5a15 43574420E8CF212A Superman - The Man of Steel/COUNTRY=EU/PRODUCT_NO=T-70068,70068-00
GG aa3f2172 0A5C6040EBCF152B Superman - The Man of Steel [Proto]/FLAGS=PROTO/COMMENT=Prototype version of the game.
Expand Down
41 changes: 41 additions & 0 deletions meka/srcs/machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "tvtype.h"
#include "sound/fmunit.h"
#include "sound/psg.h"
#include "app_game.h"

//-----------------------------------------------------------------------------
// Data
Expand Down Expand Up @@ -196,6 +197,9 @@ void Machine_Set_Handler_MemRW(void)
case MAPPER_SMS_Korean_MSX_32KB_2000:
WrZ80 = WrZ80_NoHook = Write_Mapper_SMS_Korean_MSX_32KB_2000;
break;
case MAPPER_GG_Gear_20_in_1_FFFF_FFFE_button:
WrZ80 = WrZ80_NoHook = Write_Mapper_GG_Gear_20_in_1_FFFF_FFFE_button;
break;
case MAPPER_SMS_Korean_MSX_SMS_8000:
WrZ80 = WrZ80_NoHook = Write_Mapper_SMS_Korean_MSX_SMS_8000;
break;
Expand Down Expand Up @@ -488,6 +492,43 @@ void Machine_Set_Mapping (void)
g_machine.mapper_regs[0] = 0;
break;

case MAPPER_GG_Gear_20_in_1_FFFF_FFFE_button:
g_machine.mapper_regs_count = 3;
for (int i = 0; i != MAPPER_REGS_MAX; i++)
g_machine.mapper_regs[i] = 0;
g_machine.mapper_regs[2] = 1;
if (SRAM[0x7FFF] != 0xAA) {
SRAM[0x7FFF] = 0xAA;
SRAM[0x7FFE] = 0x00;
} else {
// FIXME: don't know yet how the mapper decides which games are which sizes
if (SRAM[0x7FFE] <= 0x1F) {
SRAM[0x7FFE] += 0x08;
} else {
SRAM[0x7FFE] += 0x02;
}
SRAM[0x7FFE] = ((SRAM[0x7FFE] * 2) & tsms.Pages_Mask_8k) / 2;
}
g_machine.mapper_regs[0] = SRAM[0x7FFE];
Map_8k_ROM(0, ((g_machine.mapper_regs[0]) * 2) & tsms.Pages_Mask_8k);
Map_8k_ROM(1, ((g_machine.mapper_regs[0]) * 2 + 1) & tsms.Pages_Mask_8k);
Map_8k_ROM(2, ((g_machine.mapper_regs[0] + 1) * 2) & tsms.Pages_Mask_8k);
Map_8k_ROM(3, ((g_machine.mapper_regs[0] + 1) * 2 + 1) & tsms.Pages_Mask_8k);
Map_8k_ROM(4, ((g_machine.mapper_regs[0]) * 2) & tsms.Pages_Mask_8k);
Map_8k_ROM(5, ((g_machine.mapper_regs[0]) * 2 + 1) & tsms.Pages_Mask_8k);
Map_8k_RAM(6, 0);
Map_8k_RAM(7, 0);
// FIXME: don't know yet how the mapper decides which games need SMS-GG mode
if ((g_machine.mapper_regs[0] <= 0x1F) | ((g_machine.mapper_regs[0] >= 0x38) && (g_machine.mapper_regs[0] <= 0x3D))) {
drv_set(DRV_GG);
} else {
drv_set(DRV_SMS);
}
gamebox_resize_all();
VDP_UpdateLineLimits();
Video_GameMode_UpdateBounds();
break;

case MAPPER_SMS_Korean_MSX_SMS_8000:
Map_8k_ROM(0, 0x3c & tsms.Pages_Mask_8k);
Map_8k_ROM(1, 0x3c & tsms.Pages_Mask_8k);
Expand Down
41 changes: 41 additions & 0 deletions meka/srcs/mappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#include "shared.h"
#include "mappers.h"
#include "eeprom.h"
#include "vdp.h"
#include "video.h"
#include "app_game.h"

//-----------------------------------------------------------------------------
// Data
Expand Down Expand Up @@ -952,6 +955,44 @@ WRITE_FUNC (Write_Mapper_SMS_Korean_MSX_32KB_2000)
Write_Error (Addr, Value);
}

// Mapper #31
// Super Gear 20 in 1 [Ninja Gaiden]
WRITE_FUNC(Write_Mapper_GG_Gear_20_in_1_FFFF_FFFE_button)
{
// FIXME: don't know yet how the mapper decides which games need SMS-GG mode
if ((g_machine.mapper_regs[0] <= 0x1F) | ((g_machine.mapper_regs[0] >= 0x38) && (g_machine.mapper_regs[0] <= 0x3D))) {
drv_set(DRV_GG);
} else {
drv_set(DRV_SMS);
}
gamebox_resize_all();
VDP_UpdateLineLimits();
Video_GameMode_UpdateBounds();
if (Addr == 0xFFFF) // Configurable segment -----------------------------------------------
{
g_machine.mapper_regs[1] = Value;
Map_8k_ROM(4, ((g_machine.mapper_regs[0] + Value) * 2) & tsms.Pages_Mask_8k);
Map_8k_ROM(5, ((g_machine.mapper_regs[0] + Value) * 2 + 1) & tsms.Pages_Mask_8k);
//return;
}
if (Addr == 0xFFFE)
{
g_machine.mapper_regs[2] = Value;
Map_8k_ROM(2, ((g_machine.mapper_regs[0] + Value) * 2) & tsms.Pages_Mask_8k);
Map_8k_ROM(3, ((g_machine.mapper_regs[0] + Value) * 2 + 1) & tsms.Pages_Mask_8k);
//return;
}

switch (Addr >> 13)
{
// RAM [0xC000] = [0xE000] ------------------------------------------------
case 6: Mem_Pages[6][Addr] = Value; return;
case 7: Mem_Pages[7][Addr] = Value; return;
}

Write_Error(Addr, Value);
}

// Mapper #40
// Zemina Best 88 (KR)
// Zemina Best 25 (KR)
Expand Down
2 changes: 2 additions & 0 deletions meka/srcs/mappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#define MAPPER_SMS_Korean_MD_FFF5 (25) // Registers at 0xFFF5 and 0xFFFF (Jaemiissneun Game Mo-eumjip 42/65 Hap [SMS-MD], Pigu Wang Hap ~ Jaemiiss-neun Game Mo-eumjip [SMS-MD])
#define MAPPER_SMS_Korean_MD_FFFA (26) // Registers at 0xFFFA and 0xFFFF (Game Jiphap 30 Hap [SMS-MD])
#define MAPPER_SMS_Korean_MSX_32KB_2000 (27) // Register at 0x2000 (2 Hap in 1 (Moai-ui bomul, David-2))
#define MAPPER_GG_Gear_20_in_1_FFFF_FFFE_button (31) // Registers at 0xFFFF and 0xFFFE, reset or pushbutton cycles games (Super Gear 20 in 1 [Ninja Gaiden])
#define MAPPER_SMS_Korean_MSX_SMS_8000 (40) // Register at 0x8000 with 8KB granularity and both MSX and SMS game support (Zemina Best 88 [MISSING 64K])

#define READ_FUNC(_NAME) u8 _NAME(register u16 Addr)
Expand Down Expand Up @@ -97,6 +98,7 @@ WRITE_FUNC (Write_Mapper_SMS_Korean_MD_FFF0);
WRITE_FUNC (Write_Mapper_SMS_Korean_MD_FFF5);
WRITE_FUNC (Write_Mapper_SMS_Korean_MD_FFFA);
WRITE_FUNC (Write_Mapper_SMS_Korean_MSX_32KB_2000);
WRITE_FUNC (Write_Mapper_GG_Gear_20_in_1_FFFF_FFFE_button);
WRITE_FUNC (Write_Mapper_SMS_Korean_MSX_SMS_8000);
//-----------------------------------------------------------------------------
void Out_SC3000_SurvivorsMulticarts_DataWrite(u8 v);
Expand Down
31 changes: 28 additions & 3 deletions meka/srcs/saves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "vmachine.h"
#include "sound/fmunit.h"
#include "sound/psg.h"
#include "video.h"
#include "app_game.h"

//-----------------------------------------------------------------------------
// Functions
Expand All @@ -26,6 +28,7 @@ void Load_Game_Fixup(void)
{
int i;
u8 b;
bool sms_gg_mode_in_mapper = false;

// CPU
#ifdef MARAT_Z80
Expand Down Expand Up @@ -144,6 +147,24 @@ void Load_Game_Fixup(void)
case MAPPER_SMS_Korean_MSX_32KB_2000:
WrZ80_NoHook(0x2000, g_machine.mapper_regs[0]);
break;
case MAPPER_GG_Gear_20_in_1_FFFF_FFFE_button:
SRAM[0x7FFF] = 0xAA;
SRAM[0x7FFE] = g_machine.mapper_regs[0];
// FIXME: don't know yet how the mapper decides which games need SMS-GG mode
if ((g_machine.mapper_regs[0] <= 0x1F) | ((g_machine.mapper_regs[0] >= 0x38) && (g_machine.mapper_regs[0] <= 0x3E))) {
drv_set(DRV_GG);
} else {
drv_set(DRV_SMS);
}
gamebox_resize_all();
VDP_UpdateLineLimits();
Video_GameMode_UpdateBounds();
Map_8k_ROM(0, ((g_machine.mapper_regs[0]) * 2) & tsms.Pages_Mask_8k);
Map_8k_ROM(1, ((g_machine.mapper_regs[0]) * 2 + 1) & tsms.Pages_Mask_8k);
WrZ80_NoHook(0xFFFF, g_machine.mapper_regs[1]);
WrZ80_NoHook(0xFFFE, g_machine.mapper_regs[2]);
sms_gg_mode_in_mapper = true;
break;
case MAPPER_SMS_Korean_MSX_SMS_8000:
{
int mapper_page = g_machine.mapper_regs[0];
Expand All @@ -155,9 +176,11 @@ void Load_Game_Fixup(void)
}

// VDP/Graphic related
tsms.VDP_Video_Change |= VDP_VIDEO_CHANGE_ALL;
VDP_UpdateLineLimits();
// FALSE!!! // tsms.VDP_Line = 224;
if (!sms_gg_mode_in_mapper) {
tsms.VDP_Video_Change |= VDP_VIDEO_CHANGE_ALL;
VDP_UpdateLineLimits();
// FALSE!!! // tsms.VDP_Line = 224;
}

// Rewrite all VDP registers (we can do that since it has zero side-effect)
for (i = 0; i < 16; i ++)
Expand Down Expand Up @@ -346,6 +369,7 @@ int Save_Game_MSV(FILE *f)
case MAPPER_SMS_Korean_MD_FFF5:
case MAPPER_SMS_Korean_MD_FFFA:
case MAPPER_SMS_Korean_MSX_32KB_2000:
case MAPPER_GG_Gear_20_in_1_FFFF_FFFE_button:
case MAPPER_SMS_Korean_MSX_SMS_8000:
default:
fwrite (RAM, 0x2000, 1, f); // Do not use g_driver->ram because of g_driver video mode change
Expand Down Expand Up @@ -526,6 +550,7 @@ int Load_Game_MSV(FILE *f)
case MAPPER_SMS_Korean_MD_FFF5:
case MAPPER_SMS_Korean_MD_FFFA:
case MAPPER_SMS_Korean_MSX_32KB_2000:
case MAPPER_GG_Gear_20_in_1_FFFF_FFFE_button:
case MAPPER_SMS_Korean_MSX_SMS_8000:
default:
fread (RAM, 0x2000, 1, f); // Do not use g_driver->ram because of g_driver video mode change
Expand Down