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
4 changes: 3 additions & 1 deletion meka/compat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@
-----------------------------------------------------------------------------
SEGA GAME GEAR (GG) COMPATIBILITY LIST
-----------------------------------------------------------------------------
18 in 1 - Super Games Collection [Columns] *Ok
5 in One Fun Pak Ok
Aa Harimanada (JP) Ok
Addams Family, The Ok
Expand Down Expand Up @@ -1409,6 +1410,7 @@
Street Hero [Proto 1] [SMS-GG] Ok
Strider Returns Ok
Striker Ok
Super 18 in 1 - 1993 New Game [Columns] *Ok
Super Battletank Ok
Super Columns Ok
Super Columns (JP) Ok
Expand Down Expand Up @@ -1502,7 +1504,7 @@
Zoop (US) Ok
Zoop [Proto] (US) Ok
-----------------------------------------------------------------------------
517 games tested - 506 are "Ok" - Compatibility rate: 97.63%
519 games tested - 508 are "Ok" - Compatibility rate: 97.88%
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions meka/meka.nam
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@ SMS 317f14da 642D4E5E1BB23ABC Ninja Gaiden/FLAGS=TRANS/TRANS=DE/VERSION=1.00/A
; DATA - SEGA GAME GEAR (GG)
;-----------------------------------------------------------------------------

GG 81818f55 6AAE6866CB4814F3 18 in 1 - Super Games Collection [Columns]/EMU_MAPPER=49/COMMENT=Identical to "Super 18 in 1 - 1993 New Game [Columns]" other than TMR SEGA header
GG f85a8ce8 5DB92D172BF43C4B 5 in One Fun Pak/COUNTRY=US/PRODUCT_NO=T-125028
GG 1d17d2a0 A5D21350B842022A Aa Harimanada/COUNTRY=JP/PRODUCT_NO=G-3327
GG 1d01f999 EE39E44E85E0C77B Addams Family, The/COUNTRY=US,EU,JP/PRODUCT_NO=T-81188,T-81188-50,T-81087
Expand Down Expand Up @@ -1293,6 +1294,7 @@ GG 0b618409 85CFE82DBD812633 Streets of Rage II/NAME_US=Streets of Rage 2/NAM
GG 6c395a69 BC45532F90B98FA5 Streets of Rage II [Proto]/NAME_US=Streets of Rage 2/NAME_JP=Bare Knuckle II/FLAGS=PROTO/COMMENT=Prototype version of the game.
GG 1ebfa5ca 24A227CBB87248D6 Strider Returns (Journey from Darkness)/COUNTRY=US,EU/PRODUCT_NO=T-79048,79048,79048-50
GG b421c057 96BD12C62621B8D6 Striker/COUNTRY=EU/PRODUCT_NO=2551-50
GG 54690a05 6BAD6667CB4815F3 Super 18 in 1 - 1993 New Game [Columns]/EMU_MAPPER=49/COMMENT=Identical to "18 in 1 - Super Games Collection [Columns]" other than TMR SEGA header
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
Expand Down
22 changes: 22 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 @@ -199,6 +200,9 @@ void Machine_Set_Handler_MemRW(void)
case MAPPER_SMS_Korean_MSX_SMS_8000:
WrZ80 = WrZ80_NoHook = Write_Mapper_SMS_Korean_MSX_SMS_8000;
break;
case MAPPER_GG_18_in_1_00xx:
WrZ80 = WrZ80_NoHook = Write_Mapper_GG_18_in_1_00xx;
break;
}
}

Expand Down Expand Up @@ -502,6 +506,24 @@ void Machine_Set_Mapping (void)
g_machine.mapper_regs[i] = 0;
break;

case MAPPER_GG_18_in_1_00xx:
Map_8k_ROM(0, 0 & tsms.Pages_Mask_8k);
Map_8k_ROM(1, 1 & tsms.Pages_Mask_8k);
Map_8k_ROM(2, 2 & tsms.Pages_Mask_8k);
Map_8k_ROM(3, 3 & tsms.Pages_Mask_8k);
Map_8k_ROM(4, 0 & tsms.Pages_Mask_8k);
Map_8k_ROM(5, 1 & tsms.Pages_Mask_8k);
Map_8k_RAM(6, 0);
Map_8k_RAM(7, 0);
g_machine.mapper_regs_count = 1;
for (int i = 0; i != MAPPER_REGS_MAX; i++)
g_machine.mapper_regs[i] = 0;
drv_set(DRV_GG);
gamebox_resize_all();
VDP_UpdateLineLimits();
Video_GameMode_UpdateBounds();
break;

case MAPPER_SC3000_Survivors_Multicart:
g_machine.mapper_regs_count = 1;
for (int i = 0; i != MAPPER_REGS_MAX; i++)
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 @@ -989,6 +992,44 @@ WRITE_FUNC (Write_Mapper_SMS_Korean_MSX_SMS_8000)
Write_Error (Addr, Value);
}

// Mapper #49
// 18 in 1 - Super Games Collection [Columns]
WRITE_FUNC (Write_Mapper_GG_18_in_1_00xx)
{
// FIXME: It is likely the actual hardware does not completely
// decode the address bits, but the effective mapper address
// decoding mask is not yet known
if ((Addr | 0x001F) == 0x001F) // Configurable segment -----------------------------------------------
{
g_machine.mapper_regs[0] = Addr & 0x1F;
if (Addr & 0x10) {
drv_set(DRV_SMS);
} else {
drv_set(DRV_GG);
}
gamebox_resize_all();
VDP_UpdateLineLimits();
Video_GameMode_UpdateBounds();
unsigned int base_page_8k = (Addr & 0x0F) * 4;
Map_8k_ROM(0, base_page_8k & tsms.Pages_Mask_8k);
Map_8k_ROM(1, (base_page_8k | 1) & tsms.Pages_Mask_8k);
Map_8k_ROM(2, (base_page_8k | 2) & tsms.Pages_Mask_8k);
Map_8k_ROM(3, (base_page_8k | 3) & tsms.Pages_Mask_8k);
Map_8k_ROM(4, base_page_8k & tsms.Pages_Mask_8k);
Map_8k_ROM(5, (base_page_8k | 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);
}

// Based on MSX ASCII 8KB mapper? http://bifi.msxnet.org/msxnet/tech/megaroms.html#ascii8
// - This mapper requires 4 registers to save bank switching state.
// However, all other mappers so far used only 3 registers, stored as 3 bytes.
Expand Down
4 changes: 3 additions & 1 deletion meka/srcs/mappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
#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_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 MAPPER_SMS_Korean_MSX_SMS_8000 (40) // Register at 0x8000 with 8KB granularity and both MSX and SMS game support (Zemina Best 88)
#define MAPPER_GG_18_in_1_00xx (49) // Registers at 0x0000..0x001F (18 in 1 - Super Games Collection [Columns])

#define READ_FUNC(_NAME) u8 _NAME(register u16 Addr)
#define WRITE_FUNC(_NAME) void _NAME(register u16 Addr, register u8 Value)
Expand Down Expand Up @@ -98,6 +99,7 @@ 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_SMS_Korean_MSX_SMS_8000);
WRITE_FUNC (Write_Mapper_GG_18_in_1_00xx);
//-----------------------------------------------------------------------------
void Out_SC3000_SurvivorsMulticarts_DataWrite(u8 v);

Expand Down
17 changes: 14 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 @@ -151,13 +154,19 @@ void Load_Game_Fixup(void)
WrZ80_NoHook(0x8000, mapper_page);
}
break;
case MAPPER_GG_18_in_1_00xx:
WrZ80_NoHook(0x0000 | g_machine.mapper_regs[0], 0x00);
sms_gg_mode_in_mapper = true;
break;
}
}

// 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 @@ -347,6 +356,7 @@ int Save_Game_MSV(FILE *f)
case MAPPER_SMS_Korean_MD_FFFA:
case MAPPER_SMS_Korean_MSX_32KB_2000:
case MAPPER_SMS_Korean_MSX_SMS_8000:
case MAPPER_GG_18_in_1_00xx:
default:
fwrite (RAM, 0x2000, 1, f); // Do not use g_driver->ram because of g_driver video mode change
break;
Expand Down Expand Up @@ -527,6 +537,7 @@ int Load_Game_MSV(FILE *f)
case MAPPER_SMS_Korean_MD_FFFA:
case MAPPER_SMS_Korean_MSX_32KB_2000:
case MAPPER_SMS_Korean_MSX_SMS_8000:
case MAPPER_GG_18_in_1_00xx:
default:
fread (RAM, 0x2000, 1, f); // Do not use g_driver->ram because of g_driver video mode change
break;
Expand Down