mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2025-02-28 00:43:35 +01:00
fixed backup memory support in Bill Walsh College Football (this game uses I2C EEPROM saves)
modified Action replay (Pro) memory map
This commit is contained in:
parent
8834abaa74
commit
f2e43c9f8f
@ -35,12 +35,14 @@ static struct
|
|||||||
uint32 addr[4];
|
uint32 addr[4];
|
||||||
} action_replay;
|
} action_replay;
|
||||||
|
|
||||||
static void ar_write_regs(uint32 address, uint32 data);
|
|
||||||
static void wram_write_byte(uint32 address, uint32 data);
|
static void wram_write_byte(uint32 address, uint32 data);
|
||||||
static void wram_write_word(uint32 address, uint32 data);
|
static void wram_write_word(uint32 address, uint32 data);
|
||||||
|
static void ar_write_regs(uint32 address, uint32 data);
|
||||||
|
static void ar_write_regs_pro2(uint32 address, uint32 data);
|
||||||
|
|
||||||
void datel_init(void)
|
void datel_init(void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
memset(&action_replay,0,sizeof(action_replay));
|
memset(&action_replay,0,sizeof(action_replay));
|
||||||
|
|
||||||
/* load Action Replay ROM program */
|
/* load Action Replay ROM program */
|
||||||
@ -61,22 +63,52 @@ void datel_init(void)
|
|||||||
switch (action_replay.enabled)
|
switch (action_replay.enabled)
|
||||||
{
|
{
|
||||||
case TYPE_AR:
|
case TYPE_AR:
|
||||||
|
{
|
||||||
|
/* internal registers mapped at $0000-$ffff */
|
||||||
|
m68k_memory_map[0x01].write16 = ar_write_regs;
|
||||||
|
|
||||||
/* $0000-$7fff mirrored into $8000-$ffff */
|
/* $0000-$7fff mirrored into $8000-$ffff */
|
||||||
memcpy(action_replay.rom+0x8000,action_replay.rom,0x8000);
|
memcpy(action_replay.rom+0x8000,action_replay.rom,0x8000);
|
||||||
m68k_memory_map[1].write16 = ar_write_regs;
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case TYPE_PRO1:
|
case TYPE_PRO1:
|
||||||
m68k_memory_map[1].write16 = ar_write_regs;
|
{
|
||||||
break;
|
/* internal registers mapped at $0000-$ffff */
|
||||||
|
m68k_memory_map[0x01].write16 = ar_write_regs;
|
||||||
|
|
||||||
case TYPE_PRO2: /* todo */
|
/* RAM (64k) mapped at $400000-$7fffff */
|
||||||
|
for (i=0x40; i<0x80; i++)
|
||||||
|
{
|
||||||
|
m68k_memory_map[i].base = action_replay.ram;
|
||||||
|
m68k_memory_map[i].read8 = NULL;
|
||||||
|
m68k_memory_map[i].read16 = NULL;
|
||||||
|
m68k_memory_map[i].write8 = NULL;
|
||||||
|
m68k_memory_map[i].write16 = NULL;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case TYPE_PRO2:
|
||||||
|
{
|
||||||
|
/* internal registers mapped at $100000-$10ffff */
|
||||||
|
m68k_memory_map[0x10].write16 = ar_write_regs_pro2;
|
||||||
|
|
||||||
|
/* RAM (64k) mapped at $400000-$7fffff */
|
||||||
|
for (i=0x40; i<0x80; i++)
|
||||||
|
{
|
||||||
|
m68k_memory_map[i].base = action_replay.ram;
|
||||||
|
m68k_memory_map[i].read8 = NULL;
|
||||||
|
m68k_memory_map[i].read16 = NULL;
|
||||||
|
m68k_memory_map[i].write8 = NULL;
|
||||||
|
m68k_memory_map[i].write16 = NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef LSB_FIRST
|
#ifdef LSB_FIRST
|
||||||
/* Byteswap ROM */
|
/* Byteswap ROM */
|
||||||
int i;
|
|
||||||
uint8 temp;
|
uint8 temp;
|
||||||
for(i = 0; i < 0x20000; i += 2)
|
for(i = 0; i < 0x20000; i += 2)
|
||||||
{
|
{
|
||||||
@ -100,33 +132,31 @@ void datel_reset(void)
|
|||||||
memset(action_replay.data,0,sizeof(action_replay.data));
|
memset(action_replay.data,0,sizeof(action_replay.data));
|
||||||
memset(action_replay.addr,0,sizeof(action_replay.addr));
|
memset(action_replay.addr,0,sizeof(action_replay.addr));
|
||||||
|
|
||||||
/* reset memory map */
|
/* ROM mapped at $000000-$3fffff */
|
||||||
|
int i;
|
||||||
switch (action_replay.enabled)
|
switch (action_replay.enabled)
|
||||||
{
|
{
|
||||||
case TYPE_AR:
|
case TYPE_AR: /* 32k ROM */
|
||||||
m68k_memory_map[0].base = action_replay.rom;
|
case TYPE_PRO2: /* 64k ROM */
|
||||||
|
{
|
||||||
|
for (i=0x00; i<0x40; i++)
|
||||||
|
{
|
||||||
|
m68k_memory_map[i].base = action_replay.rom;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case TYPE_PRO1:
|
case TYPE_PRO1: /* 128k ROM */
|
||||||
m68k_memory_map[0].base = action_replay.rom;
|
{
|
||||||
m68k_memory_map[1].base = action_replay.rom + 0x10000;
|
for (i=0x00; i<0x40; i+=2)
|
||||||
m68k_memory_map[0x42].base = action_replay.ram;
|
{
|
||||||
m68k_memory_map[0x42].read8 = NULL;
|
m68k_memory_map[i].base = action_replay.rom;
|
||||||
m68k_memory_map[0x42].read16 = NULL;
|
m68k_memory_map[i+1].base = action_replay.rom + 0x10000;
|
||||||
m68k_memory_map[0x42].write8 = NULL;
|
}
|
||||||
m68k_memory_map[0x42].write16 = NULL;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TYPE_PRO2:
|
|
||||||
m68k_memory_map[0].base = action_replay.rom;
|
|
||||||
m68k_memory_map[0x60].base = action_replay.ram;
|
|
||||||
m68k_memory_map[0x60].read8 = NULL;
|
|
||||||
m68k_memory_map[0x60].read16 = NULL;
|
|
||||||
m68k_memory_map[0x60].write8 = NULL;
|
|
||||||
m68k_memory_map[0x60].write16 = NULL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void datel_switch(uint8 enable)
|
void datel_switch(uint8 enable)
|
||||||
@ -250,8 +280,18 @@ static void ar_write_regs(uint32 address, uint32 data)
|
|||||||
action_replay.addr[2] = (action_replay.regs[8] | ((action_replay.regs[9] & 0x7f00) << 8)) << 1;
|
action_replay.addr[2] = (action_replay.regs[8] | ((action_replay.regs[9] & 0x7f00) << 8)) << 1;
|
||||||
action_replay.addr[3] = (action_replay.regs[11] | ((action_replay.regs[12] & 0x7f00) << 8)) << 1;
|
action_replay.addr[3] = (action_replay.regs[11] | ((action_replay.regs[12] & 0x7f00) << 8)) << 1;
|
||||||
|
|
||||||
/* reads are mapped to Cartridge ROM */
|
/* Cartridge ROM mapped to $000000-$3fffff */
|
||||||
/* NOTE: codes should be disabled on startup */
|
/* NOTE: codes should be disabled on startup */
|
||||||
m68k_memory_map[0].base = cart.rom;
|
int i;
|
||||||
|
for (i=0x00; i<0x40; i++)
|
||||||
|
{
|
||||||
|
m68k_memory_map[i].base = cart.rom + ((i<<16) & cart.mask);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void ar_write_regs_pro2(uint32 address, uint32 data)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
|
|
||||||
#define GAME_CNT 25
|
#define GAME_CNT 26
|
||||||
|
|
||||||
T_EEPROM eeprom;
|
T_EEPROM eeprom;
|
||||||
|
|
||||||
@ -49,8 +49,9 @@ static const T_GAME_ENTRY database[GAME_CNT] =
|
|||||||
{{"T-81476" }, 0, {16, 0x1FFF, 0x1FFF, 0x200001, 0x200001, 0x200000, 0, 0, 0}}, /* Frank Thomas Big Hurt Baseball */
|
{{"T-81476" }, 0, {16, 0x1FFF, 0x1FFF, 0x200001, 0x200001, 0x200000, 0, 0, 0}}, /* Frank Thomas Big Hurt Baseball */
|
||||||
|
|
||||||
/* EA mapper (24C01 only) */
|
/* EA mapper (24C01 only) */
|
||||||
{{"T-50396" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 7, 7, 6}}, /* NHLPA Hockey 93 (UE) */
|
|
||||||
{{"T-50176" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 7, 7, 6}}, /* Rings of Power */
|
{{"T-50176" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 7, 7, 6}}, /* Rings of Power */
|
||||||
|
{{"T-50396" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 7, 7, 6}}, /* NHLPA Hockey 93 */
|
||||||
|
{{"T-50606" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 7, 7, 6}}, /* Bill Walsh College Football */
|
||||||
|
|
||||||
/* SEGA mapper (24C01 only) */
|
/* SEGA mapper (24C01 only) */
|
||||||
{{"T-12046" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Megaman - The Wily Wars */
|
{{"T-12046" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Megaman - The Wily Wars */
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
*
|
*
|
||||||
* IPL FONT Engine, using GX hardware
|
* IPL FONT Engine, using GX hardware
|
||||||
*
|
*
|
||||||
* Softdev (2006)
|
* original font engine by Softdev (2006)
|
||||||
* Eke-Eke (2007,2008,2009)
|
* GX engine by Eke-Eke (2008,2009)
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -623,7 +623,7 @@ static INT32 m2,c1,c2; /* Phase Modulation input for operators 2,3,4 */
|
|||||||
static INT32 mem; /* one sample delay memory */
|
static INT32 mem; /* one sample delay memory */
|
||||||
static INT32 out_fm[8]; /* outputs of working channels */
|
static INT32 out_fm[8]; /* outputs of working channels */
|
||||||
|
|
||||||
/* limitter */
|
/* limiter */
|
||||||
#define Limit(val, max,min) { \
|
#define Limit(val, max,min) { \
|
||||||
if ( val > max ) val = max; \
|
if ( val > max ) val = max; \
|
||||||
else if ( val < min ) val = min; \
|
else if ( val < min ) val = min; \
|
||||||
@ -1021,8 +1021,8 @@ INLINE void advance_lfo()
|
|||||||
/* when LFO is disabled, current level is held (fix Spider-Man & Venom : Separation Anxiety) */
|
/* when LFO is disabled, current level is held (fix Spider-Man & Venom : Separation Anxiety) */
|
||||||
/*else
|
/*else
|
||||||
{
|
{
|
||||||
LFO_AM = 0;
|
ym2612.OPN.LFO_AM = 0;
|
||||||
LFO_PM = 0;
|
ym2612.OPN.LFO_PM = 0;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1490,6 +1490,8 @@ static int init_tables(void)
|
|||||||
n = n>>1;
|
n = n>>1;
|
||||||
/* 11 bits here (rounded) */
|
/* 11 bits here (rounded) */
|
||||||
n <<= 2; /* 13 bits here (as in real chip) */
|
n <<= 2; /* 13 bits here (as in real chip) */
|
||||||
|
|
||||||
|
/* 14 bits (with sign bit) */
|
||||||
tl_tab[ x*2 + 0 ] = n;
|
tl_tab[ x*2 + 0 ] = n;
|
||||||
tl_tab[ x*2 + 1 ] = -tl_tab[ x*2 + 0 ];
|
tl_tab[ x*2 + 1 ] = -tl_tab[ x*2 + 0 ];
|
||||||
|
|
||||||
|
@ -102,8 +102,8 @@ void audio_update (int size)
|
|||||||
if (filter & 1)
|
if (filter & 1)
|
||||||
{
|
{
|
||||||
/* single-pole low-pass filter (6 dB/octave) */
|
/* single-pole low-pass filter (6 dB/octave) */
|
||||||
ll = (ll>>16)*factorb + l*factora;
|
ll = (ll>>16)*factora + l*factorb;
|
||||||
rr = (rr>>16)*factorb + r*factora;
|
rr = (rr>>16)*factora + r*factorb;
|
||||||
l = ll >> 16;
|
l = ll >> 16;
|
||||||
r = rr >> 16;
|
r = rr >> 16;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,6 @@ extern uint32 count_z80;
|
|||||||
extern uint32 line_z80;
|
extern uint32 line_z80;
|
||||||
extern int32 current_z80;
|
extern int32 current_z80;
|
||||||
extern uint8 system_hw;
|
extern uint8 system_hw;
|
||||||
extern uint32 count_z80;
|
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
extern int audio_init (int rate);
|
extern int audio_init (int rate);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user