gpgx waterbox: fix a few misc bugs in elfrunner, and fix a few misc bugs in the core so that Virtua Racing now works

This commit is contained in:
nattthebear 2016-03-26 14:44:44 -04:00
parent 406b431280
commit b4735502a5
8 changed files with 19 additions and 8 deletions

View File

@ -68,7 +68,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
try
{
Elf = new ElfRunner(Path.Combine(comm.CoreFileProvider.DllPath(), "gpgx.elf"), 256 * 1024, 36 * 1024 * 1024, 4 * 1024 * 1024);
Elf = new ElfRunner(Path.Combine(comm.CoreFileProvider.DllPath(), "gpgx.elf"), 1024 * 1024, 36 * 1024 * 1024, 3 * 1024 * 1024);
if (Elf.ShouldMonitor)
Core = BizInvoker.GetInvoker<LibGPGX>(Elf, Elf);
else

View File

@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores
static MemoryBlock()
{
int p = PageSize = Environment.SystemPageSize;
while (p != 0)
while (p != 1)
{
p >>= 1;
PageShift++;
@ -253,6 +253,7 @@ namespace BizHawk.Emulation.Cores
Kernel32.MemoryProtection old;
if (!Kernel32.VirtualProtect(Z.UU(zstart), Z.UU(zend - zstart), p, out old))
throw new InvalidOperationException("VirtualProtect() returned FALSE!");
ps = i + 1;
}
}
}

View File

@ -12,7 +12,8 @@ ARCH = 64
CCFLAGS:=-Icore -Iutil -Icore/m68k -Icore/z80 -Icore/input_hw \
-Icore/cart_hw -Icore/cart_hw/svp -Icore/sound -Icore/ntsc -Icore/cd_hw \
-Wall -std=c99 -fomit-frame-pointer -fvisibility=hidden \
-Wall -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast \
-std=c99 -fomit-frame-pointer -fvisibility=hidden \
-DLSB_FIRST -DUSE_32BPP_RENDERING -DINLINE=static\ __inline__ \
-ffreestanding -nostdinc -nostdlib \
-I../libc/includes -I../libc/internals \

View File

@ -496,6 +496,7 @@ struct InitSettings
GPGX_EX int gpgx_init(const char *feromextension, ECL_ENTRY int (*feload_archive_cb)(const char *filename, unsigned char *buffer, int maxsize), int sixbutton, char system_a, char system_b, int region, struct InitSettings *settings)
{
_debug_puts("Initializing GPGX native...");
memset(&bitmap, 0, sizeof(bitmap));
strncpy(romextension, feromextension, 3);

View File

@ -219,7 +219,7 @@
#define IJind (((op>>6)&4)|(op&3))
#define GET_PC() (PC - (unsigned short *)svp->iram_rom)
#define GET_PPC_OFFS() ((unsigned int)PC - (unsigned int)svp->iram_rom - 2)
#define GET_PPC_OFFS() ((uintptr_t)PC - (uintptr_t)svp->iram_rom - 2)
#define SET_PC(d) PC = (unsigned short *)svp->iram_rom + d
#define REG_READ(r) (((r) <= 4) ? ssp->gr[r].byte.h : read_handlers[r]())
@ -559,7 +559,7 @@ static u32 pm_io(int reg, int write, u32 d)
ssp->pmac_read[reg] += 1<<16;*/
if ((signed int)(ssp->pmac[0][reg] & 0xffff) == -1) ssp->pmac[0][reg] += 1<<16;
ssp->pmac[0][reg] ++;
d = ((unsigned short *)cart.rom)[addr|((mode&0xf)<<16)];
}
else if ((mode & 0x47ff) == 0x0018) /* DRAM */
@ -1282,7 +1282,7 @@ void ssp1601_run(int cycles)
#endif
break;
case 0x3c:
OP_CMPA(op & 0xff);
OP_CMPA(op & 0xff);
#ifdef LOG_SVP
if (op&0x100) elprintf(EL_SVP|EL_ANOMALY, "FIXME: simm with upper bit set");
#endif
@ -1307,7 +1307,7 @@ void ssp1601_run(int cycles)
#endif
break;
case 0x7c:
OP_EORA(op & 0xff);
OP_EORA(op & 0xff);
#ifdef LOG_SVP
if (op&0x100) elprintf(EL_SVP|EL_ANOMALY, "FIXME: simm with upper bit set");
#endif

View File

@ -16,7 +16,7 @@ svp_t *svp = NULL;
void svp_init(void)
{
svp = (void *) ((char *)cart.rom + 0x200000);
svp = malloc(sizeof(svp_t));
memset(svp, 0, sizeof(*svp));
}

View File

@ -21,6 +21,11 @@ void *alloc_invisible(size_t size)
return _ecl_sbrk_invisible(size);
}
void _debug_puts(const char *s)
{
_ecl_debug_puts(s);
}
void *_PDCLIB_sbrk(size_t n)
{
void *ret = _ecl_sbrk(n);

View File

@ -19,4 +19,7 @@ void *alloc_sealed(size_t size);
// you are absolutely sure will not harm savestates
void *alloc_invisible(size_t size);
// send a debug string somewhere, bypassing stdio
void _debug_puts(const char *);
#endif