gpgx: trim savestate size by moving some things to the sealed heap
This commit is contained in:
parent
9f173389a9
commit
06f9d78452
|
@ -26,13 +26,13 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
// vram pokes need to go through hook which invalidates cached tiles
|
||||
byte* p = (byte*)area;
|
||||
mm.Add(new MemoryDomain(name, size, MemoryDomain.Endian.Unknown,
|
||||
delegate (long addr)
|
||||
delegate(long addr)
|
||||
{
|
||||
if (addr < 0 || addr >= 65536)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
return p[addr ^ 1];
|
||||
},
|
||||
delegate (long addr, byte val)
|
||||
delegate(long addr, byte val)
|
||||
{
|
||||
if (addr < 0 || addr >= 65536)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
@ -44,7 +44,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
else
|
||||
{
|
||||
var byteSize = name.Contains("Z80") ? 1 : 2;
|
||||
mm.Add(MemoryDomain.FromIntPtrSwap16(name, size, MemoryDomain.Endian.Big, area, name != "MD CART" , byteSize));
|
||||
mm.Add(MemoryDomain.FromIntPtrSwap16(name, size,
|
||||
MemoryDomain.Endian.Big, area, name != "MD CART" && name != "CD BOOT ROM", byteSize));
|
||||
}
|
||||
}
|
||||
var m68Bus = new MemoryDomain("M68K BUS", 0x1000000, MemoryDomain.Endian.Big,
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "md_ntsc.h"
|
||||
#include "sms_ntsc.h"
|
||||
#include "eeprom_i2c.h"
|
||||
#include "vdp_render.h"
|
||||
|
||||
char GG_ROM[256] = "GG_ROM"; // game genie rom
|
||||
char AR_ROM[256] = "AR_ROM"; // actin replay rom
|
||||
|
@ -510,6 +511,14 @@ GPGX_EX int gpgx_init(const char *feromextension, ECL_ENTRY int (*feload_archive
|
|||
tempsram = alloc_invisible(24 * 1024);
|
||||
|
||||
ext.md_cart.rom = alloc_sealed(32 * 1024 * 1024);
|
||||
scd.bootrom = malloc(0x20000); // FIXME: this should be sealed, but that crashes. huh?
|
||||
SZHVC_add = alloc_sealed(131072);
|
||||
SZHVC_sub = alloc_sealed(131072);
|
||||
ym2612_lfo_pm_table = alloc_sealed(131072);
|
||||
vdp_bp_lut = alloc_sealed(262144);
|
||||
vdp_lut = alloc_sealed(6 * sizeof(*vdp_lut));
|
||||
for (int i = 0; i < 6; i++)
|
||||
vdp_lut[i] = alloc_sealed(65536);
|
||||
|
||||
/* sound options */
|
||||
config.psg_preamp = 150;
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
typedef struct
|
||||
{
|
||||
cd_cart_t cartridge; /* ROM/RAM Cartridge */
|
||||
uint8 bootrom[0x20000]; /* 128K internal BOOT ROM */
|
||||
uint8 *bootrom; /* 128K internal BOOT ROM */
|
||||
uint8 prg_ram[0x80000]; /* 512K PRG-RAM */
|
||||
uint8 word_ram[2][0x20000]; /* 2 x 128K Word RAM (1M mode) */
|
||||
uint8 word_ram_2M[0x40000]; /* 256K Word RAM (2M mode) */
|
||||
|
|
|
@ -404,13 +404,13 @@ int load_bios(void)
|
|||
switch (region_code)
|
||||
{
|
||||
case REGION_USA:
|
||||
size = load_archive(CD_BIOS_US, scd.bootrom, sizeof(scd.bootrom), 0);
|
||||
size = load_archive(CD_BIOS_US, scd.bootrom, 0x20000, 0);
|
||||
break;
|
||||
case REGION_EUROPE:
|
||||
size = load_archive(CD_BIOS_EU, scd.bootrom, sizeof(scd.bootrom), 0);
|
||||
size = load_archive(CD_BIOS_EU, scd.bootrom, 0x20000, 0);
|
||||
break;
|
||||
default:
|
||||
size = load_archive(CD_BIOS_JP, scd.bootrom, sizeof(scd.bootrom), 0);
|
||||
size = load_archive(CD_BIOS_JP, scd.bootrom, 0x20000, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -702,7 +702,7 @@ int load_rom(const char *filename)
|
|||
scd.cartridge.boot = 0x00;
|
||||
|
||||
/* copy ROM to BOOTROM area */
|
||||
memcpy(scd.bootrom, cart.rom, sizeof(scd.bootrom));
|
||||
memcpy(scd.bootrom, cart.rom, 0x20000);
|
||||
|
||||
/* mark CD BIOS as being loaded */
|
||||
system_bios = system_bios | 0x10;
|
||||
|
|
|
@ -463,7 +463,8 @@ static const UINT8 lfo_pm_output[7*8][8]={
|
|||
};
|
||||
|
||||
/* all 128 LFO PM waveforms */
|
||||
static INT32 lfo_pm_table[128*8*32]; /* 128 combinations of 7 bits meaningful (of F-NUMBER), 8 LFO depths, 32 LFO output levels per one depth */
|
||||
INT32 *ym2612_lfo_pm_table; /* 128 combinations of 7 bits meaningful (of F-NUMBER), 8 LFO depths, 32 LFO output levels per one depth */
|
||||
#define lfo_pm_table ym2612_lfo_pm_table
|
||||
|
||||
/* register number to channel number , slot offset */
|
||||
#define OPN_CHAN(N) (N&3)
|
||||
|
|
|
@ -25,4 +25,6 @@ extern unsigned int YM2612Read(void);
|
|||
extern int YM2612LoadContext(unsigned char *state);
|
||||
extern int YM2612SaveContext(unsigned char *state);
|
||||
|
||||
extern INT32 *ym2612_lfo_pm_table;
|
||||
|
||||
#endif /* _YM2612_ */
|
||||
|
|
|
@ -565,11 +565,15 @@ uint8 bg_pattern_cache[0x80000];
|
|||
/* Sprite pattern name offset look-up table (Mode 5) */
|
||||
static uint8 name_lut[0x400];
|
||||
|
||||
uint32 *vdp_bp_lut;
|
||||
|
||||
/* Bitplane to packed pixel look-up table (Mode 4) */
|
||||
static uint32 bp_lut[0x10000];
|
||||
#define bp_lut vdp_bp_lut
|
||||
|
||||
uint8 **vdp_lut;
|
||||
|
||||
/* Layer priority pixel look-up tables */
|
||||
static uint8 lut[LUT_MAX][LUT_SIZE];
|
||||
#define lut vdp_lut
|
||||
|
||||
/* Output pixel data look-up tables*/
|
||||
PIXEL_OUT_T pixel[0x100];
|
||||
|
|
|
@ -84,5 +84,8 @@ extern void (*render_obj)(int line);
|
|||
extern void (*parse_satb)(int line);
|
||||
extern void (*update_bg_pattern_cache)(int index);
|
||||
|
||||
extern uint32 *vdp_bp_lut;
|
||||
extern uint8 **vdp_lut;
|
||||
|
||||
#endif /* _RENDER_H_ */
|
||||
|
||||
|
|
|
@ -221,8 +221,8 @@ static UINT8 SZP[256]; /* zero, sign and parity flags */
|
|||
static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */
|
||||
static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */
|
||||
|
||||
static UINT8 SZHVC_add[2*256*256]; /* flags for ADD opcode */
|
||||
static UINT8 SZHVC_sub[2*256*256]; /* flags for SUB opcode */
|
||||
UINT8 *SZHVC_add; /* flags for ADD opcode */
|
||||
UINT8 *SZHVC_sub; /* flags for SUB opcode */
|
||||
|
||||
static const UINT16 cc_op[0x100] = {
|
||||
4*15,10*15, 7*15, 6*15, 4*15, 4*15, 7*15, 4*15, 4*15,11*15, 7*15, 6*15, 4*15, 4*15, 7*15, 4*15,
|
||||
|
|
|
@ -67,5 +67,8 @@ extern void z80_set_context (void *src);
|
|||
extern void z80_set_irq_line(unsigned int state);
|
||||
extern void z80_set_nmi_line(unsigned int state);
|
||||
|
||||
extern UINT8 *SZHVC_add;
|
||||
extern UINT8 *SZHVC_sub;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue