gpgx: port some svp changes from old branch. that game sucked

This commit is contained in:
nattthebear 2017-06-22 17:31:31 -04:00
parent 23345eb7d3
commit e231cd5084
7 changed files with 3218 additions and 3185 deletions

View File

@ -48,7 +48,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx64
SbrkHeapSizeKB = 256,
SealedHeapSizeKB = 36 * 1024,
InvisibleHeapSizeKB = 4 * 1024,
PlainHeapSizeKB = 64
PlainHeapSizeKB = 64,
MmapHeapSizeKB = 512
});
using (_elf.EnterExit())

Binary file not shown.

BIN
output/dll/gpgx.wbx.gz Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,49 +1,83 @@
/*
basic, incomplete SSP160x (SSP1601?) interpreter
with SVP memory controller emu
(c) Copyright 2008, Grazvydas "notaz" Ignotas
Free for non-commercial use.
For commercial use, separate licencing terms must be obtained.
Modified for Genesis Plus GX (Eke-Eke): added BIG ENDIAN support, fixed addr/code inversion
*/
#include "shared.h"
svp_t *svp = NULL;
void svp_init(void)
{
svp = malloc(sizeof(svp_t));
memset(svp, 0, sizeof(*svp));
}
void svp_reset(void)
{
memcpy(svp->iram_rom + 0x800, cart.rom + 0x800, 0x20000 - 0x800);
ssp1601_reset(&svp->ssp1601);
}
void svp_write_dram(uint32 address, uint32 data)
{
*(uint16 *)(svp->dram + (address & 0x1fffe)) = data;
if ((address == 0x30fe06) && data) svp->ssp1601.emu_status &= ~SSP_WAIT_30FE06;
if ((address == 0x30fe08) && data) svp->ssp1601.emu_status &= ~SSP_WAIT_30FE08;
}
uint32 svp_read_cell_1(uint32 address)
{
address >>= 1;
address = (address & 0x7001) | ((address & 0x3e) << 6) | ((address & 0xfc0) >> 5);
return *(uint16 *)(svp->dram + (address & 0x1fffe));
}
uint32 svp_read_cell_2(uint32 address)
{
address >>= 1;
address = (address & 0x7801) | ((address & 0x1e) << 6) | ((address & 0x7e0) >> 4);
return *(uint16 *)(svp->dram + (address & 0x1fffe));
}
/*
basic, incomplete SSP160x (SSP1601?) interpreter
with SVP memory controller emu
(c) Copyright 2008, Grazvydas "notaz" Ignotas
Free for non-commercial use.
For commercial use, separate licencing terms must be obtained.
Modified for Genesis Plus GX (Eke-Eke): added BIG ENDIAN support, fixed addr/code inversion
*/
#include "shared.h"
svp_t *svp;
static void svp_write_dram(uint32 address, uint32 data)
{
*(uint16 *)(svp->dram + (address & 0x1fffe)) = data;
if (data)
{
if (address == 0x30fe06)
svp->ssp1601.emu_status &= ~SSP_WAIT_30FE06;
else if (address == 0x30fe08)
svp->ssp1601.emu_status &= ~SSP_WAIT_30FE08;
}
}
static uint32 svp_read_cell_1(uint32 address)
{
address = (address & 0xe002) | ((address & 0x7c) << 6) | ((address & 0x1f80) >> 5);
return *(uint16 *)(svp->dram + address);
}
static uint32 svp_read_cell_2(uint32 address)
{
address = (address & 0xf002) | ((address & 0x3c) << 6) | ((address & 0xfc0) >> 4);
return *(uint16 *)(svp->dram + address);
}
static uint32 svp_read_cell_byte(uint32 address)
{
uint16 data = m68k.memory_map[address >> 16].read16(address);
if (address & 0x01)
{
return (data & 0xff);
}
return (data >> 8);
}
void svp_init(void)
{
svp = malloc(sizeof(*svp));
memset(svp, 0, sizeof(*svp));
m68k.memory_map[0x30].base = svp->dram;
m68k.memory_map[0x30].read8 = NULL;
m68k.memory_map[0x30].read16 = NULL;
m68k.memory_map[0x30].write8 = NULL;
m68k.memory_map[0x30].write16 = svp_write_dram;
zbank_memory_map[0x30].read = NULL;
zbank_memory_map[0x30].write = NULL;
m68k.memory_map[0x31].base = svp->dram + 0x10000;
m68k.memory_map[0x31].read8 = NULL;
m68k.memory_map[0x31].read16 = NULL;
m68k.memory_map[0x31].write8 = NULL;
m68k.memory_map[0x31].write16 = NULL;
zbank_memory_map[0x31].read = NULL;
zbank_memory_map[0x31].write = NULL;
m68k.memory_map[0x39].read8 = svp_read_cell_byte;
m68k.memory_map[0x39].read16 = svp_read_cell_1;
zbank_memory_map[0x39].read = svp_read_cell_byte;
m68k.memory_map[0x3a].read8 = svp_read_cell_byte;
m68k.memory_map[0x3a].read16 = svp_read_cell_2;
zbank_memory_map[0x3a].read = svp_read_cell_byte;
}
void svp_reset(void)
{
memcpy(svp->iram_rom + 0x800, cart.rom + 0x800, 0x20000 - 0x800);
ssp1601_reset(&svp->ssp1601);
}

View File

@ -1,33 +1,30 @@
/*
basic, incomplete SSP160x (SSP1601?) interpreter
with SVP memory controller emu
(c) Copyright 2008, Grazvydas "notaz" Ignotas
Free for non-commercial use.
For commercial use, separate licencing terms must be obtained.
Modified for Genesis Plus GX (Eke-Eke): added BIG ENDIAN support, fixed addr/code inversion
*/
#ifndef _SVP_H_
#define _SVP_H_
#include "shared.h"
#include "ssp16.h"
typedef struct {
unsigned char iram_rom[0x20000]; /* IRAM (0-0x7ff) and program ROM (0x800-0x1ffff) */
unsigned char dram[0x20000];
ssp1601_t ssp1601;
} svp_t;
extern svp_t *svp;
extern void svp_init(void);
extern void svp_reset(void);
extern void svp_write_dram(uint32 address, uint32 data);
extern uint32 svp_read_cell_1(uint32 address);
extern uint32 svp_read_cell_2(uint32 address);
#endif
/*
basic, incomplete SSP160x (SSP1601?) interpreter
with SVP memory controller emu
(c) Copyright 2008, Grazvydas "notaz" Ignotas
Free for non-commercial use.
For commercial use, separate licencing terms must be obtained.
Modified for Genesis Plus GX (Eke-Eke): added BIG ENDIAN support, fixed addr/code inversion
*/
#ifndef _SVP_H_
#define _SVP_H_
#include "shared.h"
#include "ssp16.h"
typedef struct {
unsigned char iram_rom[0x20000]; /* IRAM (0-0x7ff) and program ROM (0x800-0x1ffff) */
unsigned char dram[0x20000];
ssp1601_t ssp1601;
} svp_t;
extern svp_t *svp;
extern void svp_init(void);
extern void svp_reset(void);
#endif

File diff suppressed because it is too large Load Diff