X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fjaguar.cpp;h=d40d66c96c975508f7e67f2a7c5541d1c7c15f9b;hb=f3e5bb2807319c210d124d6150e019130c54867b;hp=494dacf1f0b3eb059502f8d74fbd37d77f29c5c4;hpb=2b34c51405d3a263e2701403d5e7944deccf225d;p=virtualjaguar diff --git a/src/jaguar.cpp b/src/jaguar.cpp index 494dacf..d40d66c 100644 --- a/src/jaguar.cpp +++ b/src/jaguar.cpp @@ -6,15 +6,26 @@ // Cleanups and endian wrongness amelioration by James L. Hammons // Note: Endian wrongness probably stems from the MAME origins of this emu and // the braindead way in which MAME handles memory. :-) -// +// #include "jaguar.h" + #include "video.h" #include "settings.h" //#include "m68kdasmAG.h" #include "clock.h" #include #include "SDL_opengl.h" +#include "m68k.h" +#include "log.h" +#include "tom.h" +#include "jerry.h" +#include "cdrom.h" +#include "dsp.h" +#include "gpu.h" +#include "memory.h" +#include "joystick.h" +#include "gui.h" #define CPU_DEBUG //Do this in makefile??? Yes! Could, but it's easier to define here... @@ -43,17 +54,19 @@ extern int effect_start2, effect_start3, effect_start4, effect_start5, effect_st // Memory debugging identifiers -char * whoName[9] = +const char * whoName[9] = { "Unknown", "Jaguar", "DSP", "GPU", "TOM", "JERRY", "M68K", "Blitter", "OP" }; uint32 jaguar_active_memory_dumps = 0; uint32 jaguar_mainRom_crc32, jaguarRomSize, jaguarRunAddress; -/*static*/ uint8 * jaguar_mainRam = NULL; -/*static*/ uint8 * jaguar_mainRom = NULL; -/*static*/ uint8 * jaguar_bootRom = NULL; -/*static*/ uint8 * jaguar_CDBootROM = NULL; +uint8 * jaguar_mainRam = NULL; +uint8 * jaguar_mainRom = NULL; +uint8 * jaguar_bootRom = NULL; +uint8 * jaguar_CDBootROM = NULL; +bool BIOSLoaded = false; +bool CDBIOSLoaded = false; #ifdef CPU_DEBUG_MEMORY uint8 writeMemMax[0x400000], writeMemMin[0x400000]; @@ -691,9 +704,9 @@ void jaguar_unknown_writebyte(unsigned address, unsigned data, uint32 who/*=UNKN WriteLog("Jaguar: Unknown byte %02X written at %08X by %s (M68K PC=%06X)\n", data, address, whoName[who], m68k_get_reg(NULL, M68K_REG_PC)); #endif #ifdef ABORT_ON_UNMAPPED_MEMORY_ACCESS - extern bool finished; +// extern bool finished; finished = true; - extern bool doDSPDis; +// extern bool doDSPDis; if (who == DSP) doDSPDis = true; #endif @@ -705,9 +718,9 @@ void jaguar_unknown_writeword(unsigned address, unsigned data, uint32 who/*=UNKN WriteLog("Jaguar: Unknown word %04X written at %08X by %s (M68K PC=%06X)\n", data, address, whoName[who], m68k_get_reg(NULL, M68K_REG_PC)); #endif #ifdef ABORT_ON_UNMAPPED_MEMORY_ACCESS - extern bool finished; +// extern bool finished; finished = true; - extern bool doDSPDis; +// extern bool doDSPDis; if (who == DSP) doDSPDis = true; #endif @@ -719,9 +732,9 @@ unsigned jaguar_unknown_readbyte(unsigned address, uint32 who/*=UNKNOWN*/) WriteLog("Jaguar: Unknown byte read at %08X by %s (M68K PC=%06X)\n", address, whoName[who], m68k_get_reg(NULL, M68K_REG_PC)); #endif #ifdef ABORT_ON_UNMAPPED_MEMORY_ACCESS - extern bool finished; +// extern bool finished; finished = true; - extern bool doDSPDis; +// extern bool doDSPDis; if (who == DSP) doDSPDis = true; #endif @@ -734,9 +747,9 @@ unsigned jaguar_unknown_readword(unsigned address, uint32 who/*=UNKNOWN*/) WriteLog("Jaguar: Unknown word read at %08X by %s (M68K PC=%06X)\n", address, whoName[who], m68k_get_reg(NULL, M68K_REG_PC)); #endif #ifdef ABORT_ON_UNMAPPED_MEMORY_ACCESS - extern bool finished; +// extern bool finished; finished = true; - extern bool doDSPDis; +// extern bool doDSPDis; if (who == DSP) doDSPDis = true; #endif @@ -859,7 +872,7 @@ void JaguarWriteByte(uint32 offset, uint8 data, uint32 who/*=UNKNOWN*/) JERRYWriteByte(offset, data, who); return; } - + jaguar_unknown_writebyte(offset, data, who); } @@ -1051,7 +1064,7 @@ void jaguar_init(void) //New timer based code stuffola... void ScanlineCallback(void); void RenderCallback(void); -extern uint32 * backbuffer; +//extern uint32 * backbuffer; void jaguar_reset(void) { //NOTE: This causes a (virtual) crash if this is set in the config but not found... !!! FIX !!! @@ -1439,7 +1452,7 @@ void ScanlineCallback(void) if (vc == 0) // if (vc == vbb) { - joystick_exec(); + JoystickExec(); RenderBackbuffer(); TOMResetBackbuffer(backbuffer); frameDone = true;