Merge pull request #776 from awjackson/mapper92

Reimplement mapper 92 correctly
This commit is contained in:
thor2016 2025-01-19 15:03:14 -05:00 committed by GitHub
commit 2b8f6e7627
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 29 additions and 34 deletions

View File

@ -16,6 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* The Moero!! Pro Yakyuu series have an ADPCM chip with internal ROM,
* used for voice samples (not dumped, so emulation isn't possible)
*/
#include "mapinc.h"

View File

@ -17,13 +17,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Moero!! Pro Tennis have ADPCM codec on-board, PROM isn't dumped, emulation isn't
* possible just now.
* Moero!! Pro Tennis and Moero!! Pro Yakyuu '88 Ketteiban have an ADPCM chip with
* internal ROM, used for voice samples (not dumped, so emulation isn't possible)
*/
#include "mapinc.h"
static uint8 preg, creg;
static void (*Sync)(void);
static SFORMAT StateRegs[] =
{
@ -32,13 +33,19 @@ static SFORMAT StateRegs[] =
{ 0 }
};
static void Sync(void) {
static void M72Sync(void) {
setprg16(0x8000, preg);
setprg16(0xC000, ~0);
setchr8(creg);
}
static DECLFW(M72Write) {
static void M92Sync(void) {
setprg16(0x8000, 0);
setprg16(0xC000, preg);
setchr8(creg);
}
static DECLFW(Write) {
if (V & 0x80)
preg = V & 0xF;
if (V & 0x40)
@ -46,10 +53,10 @@ static DECLFW(M72Write) {
Sync();
}
static void M72Power(void) {
static void Power(void) {
Sync();
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x6000, 0xFFFF, M72Write);
SetWriteHandler(0x8000, 0xFFFF, Write);
}
static void StateRestore(int version) {
@ -57,7 +64,16 @@ static void StateRestore(int version) {
}
void Mapper72_Init(CartInfo *info) {
info->Power = M72Power;
Sync = M72Sync;
info->Power = Power;
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}
void Mapper92_Init(CartInfo *info) {
Sync = M92Sync;
info->Power = Power;
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);

View File

@ -181,6 +181,7 @@ void Mapper59_Init(CartInfo *info) {
}
//------------------ Map 061 ---------------------------
static void M61Sync(void) {
if (((latche & 0x10) << 1) ^ (latche & 0x20)) {
setprg16(0x8000, ((latche & 0xF) << 1) | (((latche & 0x20) >> 4)));
@ -195,32 +196,6 @@ void Mapper61_Init(CartInfo *info) {
Latch_Init(info, M61Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
}
//------------------ Map 092 ---------------------------
// Another two-in-one mapper, two Jaleco carts uses similar
// hardware, but with different wiring.
// Original code provided by LULU
// Additionally, PCB contains DSP extra sound chip, used for voice samples (unemulated)
static void M92Sync(void) {
uint8 reg = latche & 0xF0;
setprg16(0x8000, 0);
if (latche >= 0x9000) {
switch (reg) {
case 0xD0: setprg16(0xc000, latche & 15); break;
case 0xE0: setchr8(latche & 15); break;
}
} else {
switch (reg) {
case 0xB0: setprg16(0xc000, latche & 15); break;
case 0x70: setchr8(latche & 15); break;
}
}
}
void Mapper92_Init(CartInfo *info) {
Latch_Init(info, M92Sync, NULL, 0x80B0, 0x8000, 0xFFFF, 0);
}
//------------------ Map 174 ---------------------------
static void M174Sync(void) {

View File

@ -309,7 +309,8 @@ void Mapper78_Init(CartInfo *info) {
}
//------------------ Map 86 ---------------------------
// Moero!! Pro Yakyuu has an ADPCM chip with internal ROM,
// used for voice samples (not dumped, so emulation isn't possible)
static void M86Sync(void) {
setprg32(0x8000, (latche >> 4) & 3);
setchr8((latche & 3) | ((latche >> 4) & 4));