]> Shamusworld >> Repos - virtualjaguar/commitdiff
Extensive changes to remove gcc 4.x warnings, general code cleanup
authorShamus Hammons <jlhamm@acm.org>
Sun, 16 Dec 2007 23:11:40 +0000 (23:11 +0000)
committerShamus Hammons <jlhamm@acm.org>
Sun, 16 Dec 2007 23:11:40 +0000 (23:11 +0000)
32 files changed:
Makefile
src/blitter.cpp
src/cdintf.cpp
src/cdrom.cpp
src/clock.cpp
src/dac.cpp
src/dsp.cpp
src/dsp.h
src/eeprom.cpp
src/eeprom.h
src/gpu.cpp
src/gpu.h
src/gui.cpp
src/jagdasm.cpp
src/jagdasm.h
src/jaguar.cpp
src/jaguar.h
src/jerry.cpp
src/joystick.cpp
src/log.cpp
src/log.h
src/memory.cpp
src/memory.h
src/objectp.cpp
src/objectp.h
src/sdlemu_config.cpp
src/settings.cpp
src/tom.cpp
src/tom.h
src/unzip.h
src/video.cpp
src/vj.cpp

index 16010605ece9d6a933239a7854f744c0e653e144..eeb8989ed0aa6eb3c78767f84a69312bf43fa258 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -94,9 +94,6 @@ OBJS = \
        obj/video.o         \
        obj/vj.o            \
        $(ICON)
-#      obj/anajoy.o 
-#      obj/cdbios.o 
-#      obj/cdi.o 
 
 all: checkenv message obj $(TARGET)$(EXESUFFIX)
        @echo
index 66179d0c6f2529b83772ba9ff31a307ad192537f..c767e5b045c4a2f9ac30d32d0a4714d1ccb11630 100644 (file)
@@ -8,11 +8,17 @@
 // to Curt. ;-) Without that excellent documentation which shows *exactly*
 // what's going on inside the TOM chip, we'd all still be guessing as to how
 // the wily blitter and other pieces of the Jaguar puzzle actually work.
+// Now how about those JERRY ASIC nets gentlemen...? ;-)
 //
 
-#include "jaguar.h"
 #include "blitter.h"
 
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "jaguar.h"
+#include "log.h"
+
 // Various conditional compilation goodies...
 
 //#define USE_ORIGINAL_BLITTER
@@ -1724,7 +1730,7 @@ doGPUDis = true;
 
 void LogBlit(void)
 {
-       char * opStr[16] = { "LFU_CLEAR", "LFU_NSAND", "LFU_NSAD", "LFU_NOTS", "LFU_SAND", "LFU_NOTD", "LFU_N_SXORD", "LFU_NSORND",
+       const char * opStr[16] = { "LFU_CLEAR", "LFU_NSAND", "LFU_NSAD", "LFU_NOTS", "LFU_SAND", "LFU_NOTD", "LFU_N_SXORD", "LFU_NSORND",
                "LFU_SAD", "LFU_XOR", "LFU_D", "LFU_NSORD", "LFU_REPLACE", "LFU_SORND", "LFU_SORD", "LFU_ONE" };
        uint32 cmd = GET32(blitter_ram, 0x38);
        uint32 m = (REG(A1_FLAGS) >> 9) & 0x03, e = (REG(A1_FLAGS) >> 11) & 0x0F;
index 35ebf986b919add92999328b9722fa47ec8b195d..fbf227fef0f5f95d58a1fc56871f462a40c22063 100644 (file)
@@ -71,6 +71,8 @@ bool CDIntfInit(void)
                return false;
        }
 
+       WriteLog("CDINTF: Successfully opened CD-ROM interface.\n");
+
        return true;
 }
 
index 9e2d44a78744d187aedb5be928f4b433ab66d94e..1eb8445e3c51678c1961c3e621d47595246ad1b1 100644 (file)
@@ -6,10 +6,14 @@
 // Extensive rewrites/cleanups/fixes by James L. Hammons
 //
 
+#include "cdrom.h"
+
+#include <string.h>                                                                    // For memset, etc.
 #include "jaguar.h"                                                                    // For GET32/SET32 macros
 #include "m68k.h"
 #include "cdintf.h"                                                                    // System agnostic CD interface functions
-#include "cdrom.h"
+#include "log.h"
+#include "dac.h"
 
 //#define CDROM_LOG                                                                    // For CDROM logging, obviously
 
@@ -133,9 +137,9 @@ static uint16 CDROMBusRead(void);
 #define I2SDAT2                BUTCH + 0x28            // i2s FIFO data (old)
 #define UNKNOWN                BUTCH + 0x2C            // Seems to be some sort of I2S interface
 
-char * BReg[12] = { "BUTCH", "DSCNTRL", "DS_DATA", "???", "I2CNTRL", "SBCNTRL", "SUBDATA", "SUBDATB",
+const char * BReg[12] = { "BUTCH", "DSCNTRL", "DS_DATA", "???", "I2CNTRL", "SBCNTRL", "SUBDATA", "SUBDATB",
        "SB_TIME", "FIFO_DATA", "I2SDAT2", "UNKNOWN" };
-extern char * whoName[9];
+extern const char * whoName[9];
 
 
 static uint8 cdRam[0x100];
index f4ef41963c9a1fc8010c16667d3eedd1fac0b3b0..9353b1aa0d6c831e422d51c57de60705f241a295 100644 (file)
@@ -8,18 +8,10 @@
 // - Handling for an event that occurs NOW
 //
 
-//#include <SDL.h>
-//#include "SDL.h"
-//#include "SDL_opengl.h"
-//#include "jaguar.h"
-//#include "m68k.h"
-//#include "gpu.h"
-//#include "dsp.h"
-//#include "settings.h"
-//#include "video.h"
-#include "log.h"
 #include "clock.h"
 
+#include "log.h"
+
 #define EVENT_LIST_SIZE       512
 
 /*
index 0ad2b9f7114da3d59120bebe04edb06ea50cf477..4b4bfab2e8b2254dbd4a9fac852e902a530b5f7c 100644 (file)
 // work correctly...! Perhaps just need to set up SSI stuff so BUTCH doesn't get
 // confused...
 
+#include "dac.h"
+
 #include "SDL.h"
 #include "m68k.h"
 #include "jaguar.h"
 #include "settings.h"
-#include "dac.h"
+#include "log.h"
 
 //#define DEBUG_DAC
 
@@ -43,7 +45,7 @@ static bool SDLSoundInitialized = false;
 // We can get away with using native endian here because we can tell SDL to use the native
 // endian when looking at the sample buffer, i.e., no need to worry about it.
 
-static uint16 * DACBuffer;
+static uint16 DACBuffer[BUFFER_SIZE];
 static uint8 SCLKFrequencyDivider = 19;                                // Default is roughly 22 KHz (20774 Hz in NTSC mode)
 /*static*/ uint16 serialMode = 0;
 
@@ -57,7 +59,8 @@ int GetCalculatedFrequency(void);
 //
 void DACInit(void)
 {
-       memory_malloc_secure((void **)&DACBuffer, BUFFER_SIZE * sizeof(uint16), "DAC buffer");
+//     memory_malloc_secure((void **)&DACBuffer, BUFFER_SIZE * sizeof(uint16), "DAC buffer");
+//     DACBuffer = (uint16 *)memory_malloc(BUFFER_SIZE * sizeof(uint16), "DAC buffer");
 
        desired.freq = GetCalculatedFrequency();                // SDL will do conversion on the fly, if it can't get the exact rate. Nice!
        desired.format = AUDIO_S16SYS;                                  // This uses the native endian (for portability)...
@@ -96,7 +99,7 @@ void DACDone(void)
                SDL_CloseAudio();
        }
 
-       memory_free(DACBuffer);
+//     memory_free(DACBuffer);
        WriteLog("DAC: Done.\n");
 }
 
index 6f27dd86c57e332d0aec76d1cb7eca734f555184..812d1035b31297cb9c1c636f3adf8bbfa4f4f4be 100644 (file)
@@ -6,9 +6,17 @@
 // Extensive cleanups/rewrites by James L. Hammons
 //
 
+#include "dsp.h"
+
 #include <stdlib.h>
 #include <SDL.h>       // Used only for SDL_GetTicks...
-#include "dsp.h"
+#include "memory.h"
+#include "log.h"
+#include "jaguar.h"
+#include "jerry.h"
+#include "gpu.h"
+#include "jagdasm.h"
+#include "m68k.h"
 
 //#define DSP_DEBUG
 //#define DSP_DEBUG_IRQ
@@ -332,7 +340,7 @@ void (* dsp_opcode[64])() =
 
 uint32 dsp_opcode_use[65];
 
-char * dsp_opcode_str[65]=
+const char * dsp_opcode_str[65]=
 {      
        "add",                          "addc",                         "addq",                         "addqt",
        "sub",                          "subc",                         "subq",                         "subqt",
@@ -364,8 +372,8 @@ static uint32 dsp_data_organization;
 uint32 dsp_control;
 static uint32 dsp_div_control;
 static uint8 dsp_flag_z, dsp_flag_n, dsp_flag_c;    
-static uint32 * dsp_reg, * dsp_alternate_reg;
-static uint32 * dsp_reg_bank_0, * dsp_reg_bank_1;
+static uint32 * dsp_reg = NULL, * dsp_alternate_reg = NULL;
+static uint32 dsp_reg_bank_0[32], dsp_reg_bank_1[32];
 
 static uint32 dsp_opcode_first_parameter;
 static uint32 dsp_opcode_second_parameter;
@@ -393,7 +401,7 @@ static uint32 dsp_opcode_second_parameter;
 uint32 dsp_convert_zero[32] = { 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 };
 uint8 * dsp_branch_condition_table = NULL;
 static uint16 * mirror_table = NULL;
-static uint8 * dsp_ram_8 = NULL;
+static uint8 dsp_ram_8[0x2000];
 
 #define BRANCH_CONDITION(x)            dsp_branch_condition_table[(x) + ((jaguar_flags & 7) << 5)]
 
@@ -433,7 +441,7 @@ void dsp_build_branch_condition_table(void)
 {
        // Allocate the mirror table
        if (!mirror_table)
-               mirror_table = (uint16 *)malloc(65536 * sizeof(mirror_table[0]));
+               mirror_table = (uint16 *)memory_malloc(65536 * sizeof(uint16), "DSP mirror table");
 
        // Fill in the mirror table
        if (mirror_table)
@@ -449,7 +457,7 @@ void dsp_build_branch_condition_table(void)
 
        if (!dsp_branch_condition_table)
        {
-               dsp_branch_condition_table = (uint8 *)malloc(32 * 8 * sizeof(dsp_branch_condition_table[0]));
+               dsp_branch_condition_table = (uint8 *)memory_malloc(32 * 8 * sizeof(uint8), "DSP branch condition table");
 
                // Fill in the condition table
                if (dsp_branch_condition_table)
@@ -537,12 +545,12 @@ uint16 DSPReadWord(uint32 offset, uint32 who/*=UNKNOWN*/)
                if (offset==0xF1B2C2) return(0x0000);
        }
 */
-       // pour permettre à wolfenstein 3d de tourner sans le dsp
+       // pour permettre  wolfenstein 3d de tourner sans le dsp
 /*     if ((offset==0xF1B0D0)||(offset==0xF1B0D2))
                return(0);
 */
 
-               // pour permettre à nba jam de tourner sans le dsp
+               // pour permettre  nba jam de tourner sans le dsp
 /*     if (jaguar_mainRom_crc32==0x4faddb18)
        {
                if (offset==0xf1b2c0) return(0);
@@ -1226,9 +1234,9 @@ DSPHandleIRQsNP();
 
 void DSPInit(void)
 {
-       memory_malloc_secure((void **)&dsp_ram_8, 0x2000, "DSP work RAM");
-       memory_malloc_secure((void **)&dsp_reg_bank_0, 32 * sizeof(int32), "DSP bank 0 regs");
-       memory_malloc_secure((void **)&dsp_reg_bank_1, 32 * sizeof(int32), "DSP bank 1 regs");
+//     memory_malloc_secure((void **)&dsp_ram_8, 0x2000, "DSP work RAM");
+//     memory_malloc_secure((void **)&dsp_reg_bank_0, 32 * sizeof(int32), "DSP bank 0 regs");
+//     memory_malloc_secure((void **)&dsp_reg_bank_1, 32 * sizeof(int32), "DSP bank 1 regs");
 
        dsp_build_branch_condition_table();
        DSPReset();
@@ -1666,7 +1674,7 @@ if ((dsp_pc < 0xF1B000 || dsp_pc > 0xF1CFFE) && !tripwire)
 static void dsp_opcode_jump(void)
 {
 #ifdef DSP_DIS_JUMP
-char * condition[32] =
+const char * condition[32] =
 {      "T", "nz", "z", "???", "nc", "nc nz", "nc z", "???", "c", "c nz",
        "c z", "???", "???", "???", "???", "???", "???", "???", "???",
        "???", "nn", "nn nz", "nn z", "???", "n", "n nz", "n z", "???",
@@ -1701,7 +1709,7 @@ char * condition[32] =
 static void dsp_opcode_jr(void)
 {
 #ifdef DSP_DIS_JR
-char * condition[32] =
+const char * condition[32] =
 {      "T", "nz", "z", "???", "nc", "nc nz", "nc z", "???", "c", "c nz",
        "c z", "???", "???", "???", "???", "???", "???", "???", "???",
        "???", "nn", "nn nz", "nn z", "???", "n", "n nz", "n z", "???",
@@ -3683,7 +3691,7 @@ static void DSP_illegal(void)
 static void DSP_jr(void)
 {
 #ifdef DSP_DIS_JR
-char * condition[32] =
+const char * condition[32] =
 {      "T", "nz", "z", "???", "nc", "nc nz", "nc z", "???", "c", "c nz",
        "c z", "???", "???", "???", "???", "???", "???", "???", "???",
        "???", "nn", "nn nz", "nn z", "???", "n", "n nz", "n z", "???",
@@ -3793,7 +3801,7 @@ char * condition[32] =
 static void DSP_jump(void)
 {
 #ifdef DSP_DIS_JUMP
-char * condition[32] =
+const char * condition[32] =
 {      "T", "nz", "z", "???", "nc", "nc nz", "nc z", "???", "c", "c nz",
        "c z", "???", "???", "???", "???", "???", "???", "???", "???",
        "???", "nn", "nn nz", "nn z", "???", "n", "n nz", "n z", "???",
index cb1b0c27a6fda196742088b6dcc44b461b27308e..4dbb2f86e1980e543d3610dba15054ad43fc85dd 100644 (file)
--- a/src/dsp.h
+++ b/src/dsp.h
@@ -5,7 +5,8 @@
 #ifndef __DSP_H__
 #define __DSP_H__
 
-#include "jaguar.h"
+//#include "jaguar.h"
+#include "types.h"
 
 #define DSP_CONTROL_RAM_BASE    0x00F1A100
 #define DSP_WORK_RAM_BASE              0x00F1B000
index 517a2695b1c2167eb2d99c4f169cf35aa82d4883..6b2ef65d68f837ded862b17d59a5328d6dd23abe 100644 (file)
@@ -6,9 +6,13 @@
 // Cleanups/enhancements by James L. Hammons
 //
 
-#include <stdlib.h>
 #include "eeprom.h"
+
+#include <string.h>                                                            // For memset
+#include <stdlib.h>
 #include "settings.h"
+#include "log.h"
+#include "jaguar.h"
 
 #define eeprom_LOG
 
index 2a52638a4ea3daae2cb52935218f962e2b40c07a..776e651b03bd455afcd159f32b8035cef137d69c 100644 (file)
@@ -5,7 +5,8 @@
 #ifndef __EEPROM_H__
 #define __EEPROM_H__
 
-#include "jaguar.h"
+//#include "jaguar.h"
+#include "types.h"
 
 void eeprom_init(void);
 void eeprom_reset(void);
index 900c6c864ed44ce444efcbdcf74133c4fa00390d..10d337b45e1eb0abbf822a3bdd834d2a9c345bb7 100644 (file)
 // Same problem with ADDC...
 //
 
-#include <stdlib.h>
 #include "gpu.h"
 
+#include <string.h>                                                            // For memset
+#include <stdlib.h>
+#include "log.h"
+#include "jaguar.h"
+#include "m68k.h"
+#include "tom.h"
+#include "memory.h"
+#include "jagdasm.h"
+#include "dsp.h"
+
 //#define GPU_DEBUG
 
 // For GPU dissasembly...
@@ -283,7 +292,7 @@ void (*gpu_opcode[64])()=
        gpu_opcode_store_r14_ri,                gpu_opcode_store_r15_ri,                gpu_opcode_sat24,                               gpu_opcode_pack,
 };
 
-static uint8 * gpu_ram_8;
+static uint8 gpu_ram_8[0x1000];
 uint32 gpu_pc;
 static uint32 gpu_acc;
 static uint32 gpu_remain;
@@ -298,8 +307,8 @@ static uint32 gpu_div_control;
 // a bit before writing a result. I.e., if the result of an operation leaves a zero in
 // the carry flag, you don't have to zero gpu_flag_c before you can write that zero!
 static uint8 gpu_flag_z, gpu_flag_n, gpu_flag_c;
-static uint32 * gpu_reg_bank_0;
-static uint32 * gpu_reg_bank_1;
+static uint32 gpu_reg_bank_0[32];
+static uint32 gpu_reg_bank_1[32];
 static uint32 * gpu_reg;
 static uint32 * gpu_alternate_reg;
 
@@ -342,7 +351,7 @@ uint8 * branch_condition_table = 0;
 
 uint32 gpu_opcode_use[64];
 
-char * gpu_opcode_str[64]= 
+const char * gpu_opcode_str[64]= 
 {      
        "add",                          "addc",                         "addq",                         "addqt",
        "sub",                          "subc",                         "subq",                         "subqt",
@@ -968,9 +977,9 @@ void GPUSetIRQLine(int irqline, int state)
 
 void gpu_init(void)
 {
-       memory_malloc_secure((void **)&gpu_ram_8, 0x1000, "GPU work RAM");
-       memory_malloc_secure((void **)&gpu_reg_bank_0, 32 * sizeof(int32), "GPU bank 0 regs");
-       memory_malloc_secure((void **)&gpu_reg_bank_1, 32 * sizeof(int32), "GPU bank 1 regs");
+//     memory_malloc_secure((void **)&gpu_ram_8, 0x1000, "GPU work RAM");
+//     memory_malloc_secure((void **)&gpu_reg_bank_0, 32 * sizeof(int32), "GPU bank 0 regs");
+//     memory_malloc_secure((void **)&gpu_reg_bank_1, 32 * sizeof(int32), "GPU bank 1 regs");
 
        build_branch_condition_table();
 
@@ -1335,7 +1344,7 @@ GPU opcodes use (offset punch--vertically below bad guy):
 static void gpu_opcode_jump(void)
 {
 #ifdef GPU_DIS_JUMP
-char * condition[32] =
+const char * condition[32] =
 {      "T", "nz", "z", "???", "nc", "nc nz", "nc z", "???", "c", "c nz",
        "c z", "???", "???", "???", "???", "???", "???", "???", "???",
        "???", "nn", "nn nz", "nn z", "???", "n", "n nz", "n z", "???",
@@ -1378,7 +1387,7 @@ if (gpu_start_log)
 static void gpu_opcode_jr(void)
 {
 #ifdef GPU_DIS_JR
-char * condition[32] =
+const char * condition[32] =
 {      "T", "nz", "z", "???", "nc", "nc nz", "nc z", "???", "c", "c nz",
        "c z", "???", "???", "???", "???", "???", "???", "???", "???",
        "???", "nn", "nn nz", "nn z", "???", "n", "n nz", "n z", "???",
index 1b83d74c2e7eea137aa398731eb3c84531639812..1af1a3615149c115b756bb58a9dcee5759b011ae 100644 (file)
--- a/src/gpu.h
+++ b/src/gpu.h
@@ -5,7 +5,8 @@
 #ifndef __GPU_H__
 #define __GPU_H__
 
-#include "jaguar.h"
+//#include "jaguar.h"
+#include "types.h"
 
 #define GPU_CONTROL_RAM_BASE    0x00F02100
 #define GPU_WORK_RAM_BASE              0x00F03000
index 38fc12841d44b027a41acaa994319eeb1a6a91ba..0c0627d877567945c974e4dc081e1bb73925f8e0 100644 (file)
@@ -5,6 +5,8 @@
 // by James L. Hammons
 //
 
+#include "gui.h"
+
 #include <stdarg.h>
 #include <sys/types.h>                                                         // For MacOS <dirent.h> dependency
 #include <dirent.h>
@@ -24,7 +26,9 @@
 #include "zlib.h"
 #include "unzip.h"
 #include "sdlemu_opengl.h"
-#include "gui.h"
+#include "log.h"
+#include "jaguar.h"
+#include "eeprom.h"
 
 using namespace std;                                                           // For STL stuff
 
@@ -68,7 +72,7 @@ bool exitGUI = false;                                                         // GUI (emulator) done variable
 int mouseX = 0, mouseY = 0;
 uint32 background[1280 * 256];                                         // GUI background buffer
 
-char separator[] = "--------------------------------------------------------";
+const char separator[] = "--------------------------------------------------------";
 
 //
 // Case insensitive string compare function
@@ -80,7 +84,7 @@ int stringCmpi(const string &s1, const string &s2)
        // Select the first element of each string:
        string::const_iterator p1 = s1.begin(), p2 = s2.begin();
 
-       while (p1 != s1.end() && p2 != s2.end())                // Don\92t run past the end
+       while (p1 != s1.end() && p2 != s2.end())                // Dont run past the end
        {
                if (toupper(*p1) != toupper(*p2))                       // Compare upper-cased chars
                        return (toupper(*p1) < toupper(*p2) ? -1 : 1);// Report which was lexically greater
@@ -2070,7 +2074,7 @@ Window * RunEmu(void)
        else if (jaguar_mainRom_crc32 == 0x55A0669C)
                cartType = 3;
 
-       char * cartTypeName[5] = { "2M Cartridge", "4M Cartridge", "CD BIOS", "CD Dev BIOS", "Homebrew" };
+       const char * cartTypeName[5] = { "2M Cartridge", "4M Cartridge", "CD BIOS", "CD Dev BIOS", "Homebrew" };
        uint32 elapsedTicks = SDL_GetTicks(), frameCount = 0, framesPerSecond = 0;
 
        while (!finished)
index 2e449a76835449e15953dd74e45728420f07bed9..6fadae8a03694f755b2f81cea40718e202254f70 100644 (file)
@@ -1,3 +1,6 @@
+#include "jagdasm.h"
+
+#include <stdio.h>
 #include "jaguar.h"
 
 #define ROPCODE(a) JaguarReadWord(a)
@@ -5,7 +8,7 @@
 uint8 convert_zero[32] =
 { 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 };
 
-char * condition[32] =
+const char * condition[32] =
 {
        "",
        "nz,",
index 159189952037a9ebc0bd4b3d87e8d30a425ca647..0171f2bd515ac2962405398c4736c47808bb524a 100644 (file)
@@ -4,6 +4,6 @@
 #define JAGUAR_GPU 0
 #define JAGUAR_DSP 1
 
-unsigned dasmjag(int dsp_type, char *buffer, unsigned pc);
+unsigned dasmjag(int dsp_type, char * buffer, unsigned pc);
 
 #endif
index 494dacf1f0b3eb059502f8d74fbd37d77f29c5c4..82e9af8f6a176508a2c7370224a4534bc3057e67 100644 (file)
@@ -9,12 +9,22 @@
 // 
 
 #include "jaguar.h"
+
 #include "video.h"
 #include "settings.h"
 //#include "m68kdasmAG.h"
 #include "clock.h"
 #include <SDL.h>
 #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"
 
 #define CPU_DEBUG
 //Do this in makefile??? Yes! Could, but it's easier to define here...
@@ -43,7 +53,7 @@ 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;
index e1358b9c21bc03d7eb3a3860fd8a1d647da969b8..ecd7197939b0abfd4e142d748a5cac312200aa53 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef __JAGUAR_H__
 #define __JAGUAR_H__
 
+#include "types.h"
+
+#if 0
 #include <string.h>    // Why??? (for memset, etc... Lazy!) Dunno why, but this just strikes me as wrong...
 #include <stdlib.h>    // For exit()
 #include "types.h"
 #include "objectp.h"
 #include "blitter.h"
 #include "clock.h"
-//#include "anajoy.h"
 #include "joystick.h"
 #include "dac.h"
 #include "jagdasm.h"
 #include "cdrom.h"
 #include "eeprom.h"
-//#include "cdi.h"
-//#include "cdbios.h"
+#endif
 
 // Exports from JAGUAR.CPP
 
 extern int32 jaguar_cpu_in_exec;
 extern uint32 jaguar_mainRom_crc32, jaguarRomSize, jaguarRunAddress;
 extern char * jaguar_eeproms_path;
-extern char * whoName[9];
+extern const char * whoName[9];
 
 void jaguar_init(void);
 void jaguar_reset(void);
index bc1541f835c7bdf6a9b669e040b2a1df6d80bcd9..742cfb255cb5466fba345846b35f194e98d7b961 100644 (file)
 //     F1DE00          R     xxxxxxxx xxxxxxxx   ROM_NOISE - white noise
 //     ------------------------------------------------------------
 
+#include "jerry.h"
+
+#include <string.h>                                                            // For memcpy
 //#include <math.h>
 #include "jaguar.h"
 #include "wavetable.h"
-#include "jerry.h"
 #include "clock.h"
+#include "dsp.h"
+#include "dac.h"
+#include "joystick.h"
+#include "eeprom.h"
+#include "log.h"
+#include "cdrom.h"
 
 //Note that 44100 Hz requires samples every 22.675737 usec.
 #define NEW_TIMER_SYSTEM
 //#define JERRY_DEBUG
 
-/*static*/ uint8 * jerry_ram_8;
+/*static*/ uint8 jerry_ram_8[0x10000];
 
 //#define JERRY_CONFIG 0x4002                                          // ??? What's this ???
 
@@ -348,6 +356,7 @@ void JERRYI2SCallback(void)
 {
        // Why is it called this? Instead of SCLK? Shouldn't this be read from DAC.CPP???
 //Yes, it should. !!! FIX !!!
+#warning Yes, it should. !!! FIX !!!
        jerry_i2s_interrupt_divide &= 0xFF;
        // We don't have to divide the RISC clock rate by this--the reason is a bit
        // convoluted. Will put explanation here later...
@@ -410,7 +419,7 @@ void jerry_init(void)
        DACInit();
 //This should be handled with the cart initialization...
 //     eeprom_init();
-       memory_malloc_secure((void **)&jerry_ram_8, 0x10000, "JERRY RAM/ROM");
+//     memory_malloc_secure((void **)&jerry_ram_8, 0x10000, "JERRY RAM/ROM");
        memcpy(&jerry_ram_8[0xD000], wave_table, 0x1000);
 
        JERRYPIT1Prescaler = 0xFFFF;
@@ -440,7 +449,7 @@ void jerry_reset(void)
 void jerry_done(void)
 {
        WriteLog("JERRY: M68K Interrupt control ($F10020) = %04X\n", GET16(jerry_ram_8, 0x20));
-       memory_free(jerry_ram_8);
+//     memory_free(jerry_ram_8);
 //     clock_done();
 //     anajoy_done();
        joystick_done();
index 82057d9aa7d832abacfbafa137f34218dd9d6e85..cd1bdcae45bdaca208532e2324c10b8357936c2d 100644 (file)
@@ -6,11 +6,15 @@
 // Cleanups/fixes by James L. Hammons
 //
 
+#include "joystick.h"
+
 #include <time.h>
 #include <SDL.h>
 #include "jaguar.h"
 #include "video.h"
 #include "settings.h"
+#include "gpu.h"
+#include "log.h"
 
 #define BUTTON_U               0
 #define BUTTON_D               1
index 1f6b882e0bce96bfeab2235b49a4208f8fc8b74b..ce660e8a0cf742fdf189f05d0ddfa4308fc89030 100644 (file)
@@ -6,17 +6,18 @@
 // Cleanups/new stuff by James L. Hammons
 //
 
+#include "log.h"
+
 #include <stdlib.h>
 #include <stdarg.h>
 #include "types.h"
-#include "log.h"
 
 #define MAX_LOG_SIZE           10000000                                // Maximum size of log file (10 MB)
 
 static FILE * log_stream = NULL;
 static uint32 logSize = 0;
 
-int log_init(char * path)
+int log_init(const char * path)
 {
        log_stream = fopen(path, "wrt");
 
index 0804df91d0c38574872c56e0f6dfecdabec4d654..1c10e687799f0ee00b18e73cf15b15205531ee56 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -11,7 +11,7 @@
 extern "C" {
 #endif
 
-int log_init(char *);
+int log_init(const char *);
 FILE * log_get(void);
 void log_done(void);
 void WriteLog(const char * text, ...);
index d51fc38d41b9f1202dc61083f89e09a4b62b1a6c..fe7ac6b1f5d23047fc38bd1efa7ad2adb2c5d417 100644 (file)
@@ -6,17 +6,18 @@
 // Cleanups by James L. Hammons
 //
 
+#include "memory.h"
+
 #include <malloc.h>
 #include <stdlib.h>
 #include "log.h"
-#include "memory.h"
 
 // Useful structs (for doubly linked list in this case)
 
 typedef struct sMemBlockInfo
 {
        void * ptr;
-       char * info;
+       const char * info;
        uint32 size;
        sMemBlockInfo * next;
        sMemBlockInfo * prev;
@@ -30,7 +31,7 @@ static uint32 currentAllocatedMemory;
 static uint32 maximumAllocatedMemory;
 
 
-void memory_addMemInfo(void * ptr, uint32 size, char * info)
+void memory_addMemInfo(void * ptr, uint32 size, const char * info)
 {
        sMemBlockInfo * alias = &memoryInfo;
 
@@ -63,7 +64,7 @@ void MemoryDone(void)
 {
 }
 
-void * memory_malloc(uint32 size, char * info)
+void * memory_malloc(uint32 size, const char * info)
 {
        void * ptr = (void *)malloc(size);
 
@@ -79,7 +80,11 @@ void * memory_malloc(uint32 size, char * info)
        return ptr;
 }
 
-void memory_malloc_secure(void ** new_ptr, uint32 size, char * info)
+// OK, this sux, causes the compiler to complain about type punned pointers.
+// The only difference between this and the previous is that this one ABORTS
+// if it can't allocate the memory. BAD BAD BAD
+
+void memory_malloc_secure(void ** new_ptr, uint32 size, const char * info)
 {
        WriteLog("Memory: Allocating %i bytes of memory for <%s>...", size, (info == NULL ? "unknown" : info));
 
@@ -89,6 +94,11 @@ void memory_malloc_secure(void ** new_ptr, uint32 size, char * info)
        {
                WriteLog("Failed!\n");
                log_done();
+
+//BAD, BAD, BAD! Need to do better than this!!!
+//And since we ARE keeping track of all memory allocations, we should unwind the stack here as well...!
+// !!! FIX !!!
+
                exit(0);
        }
 
@@ -102,6 +112,36 @@ void memory_malloc_secure(void ** new_ptr, uint32 size, char * info)
        WriteLog("OK\n");
 }
 
+/*
+void * memory_malloc_secure2(uint32 size, const char * info)
+{
+       WriteLog("Memory: Allocating %i bytes of memory for <%s>...", size, (info == NULL ? "unknown" : info));
+
+       void * ptr = malloc(size);
+
+       if (ptr == NULL)
+       {
+               WriteLog("Failed!\n");
+               log_done();
+
+//BAD, BAD, BAD! Need to do better than this!!!
+//And since we ARE keeping track of all memory allocations, we should unwind the stack here as well...!
+// !!! FIX !!!
+
+               exit(0);
+       }
+
+       memory_addMemInfo(ptr, size, info);
+       currentAllocatedMemory += size;
+
+       if (currentAllocatedMemory > maximumAllocatedMemory)
+               maximumAllocatedMemory = currentAllocatedMemory;
+
+       new_ptr = ptr;
+       WriteLog("OK\n");
+}
+*/
+
 void memory_free(void * ptr)
 {
 //     sMemBlockInfo * alias= &memoryInfo;
index 5e922de99e05de2ab036119f22e5d8cdb4ca92b2..b1a8b5d9c6c2ff11cb7c4729f161ffd5770098b5 100644 (file)
@@ -5,16 +5,15 @@
 #ifndef __MEMORY_H__
 #define __MEMORY_H__
 
-#include <stdio.h>
-//#include <stdlib.h>
-//#include <malloc.h>
+//This module needs some serious cleanup. !!! FIX !!!
+#include <stdio.h>                                                             // For FILE struct
 #include "types.h"
-//#include "log.h"
 
 void InitMemory(void);
 void MemoryDone(void);
-void memory_malloc_secure(void ** new_ptr, uint32 size, char * info);
-void * memory_malloc(uint32 size, char * info);
+void memory_malloc_secure(void ** new_ptr, uint32 size, const char * info);
+//void * memory_malloc_secure2(uint32 size, const char * info);
+void * memory_malloc(uint32 size, const char * info);
 void memory_free(void * ptr);
 void memory_memoryUsage(FILE * fp);
 
index db643afd087838320b4bd1f2223bea5d01c8af5c..946714530a5c392a56d17882194ea63de423e971 100644 (file)
@@ -6,10 +6,15 @@
 // Extensive cleanups/fixes/rewrites by James L. Hammons
 //
 
-//#include <stdio.h>
+#include "objectp.h"
+
 #include <stdlib.h>
 #include <string.h>
+#include "tom.h"
 #include "jaguar.h"
+#include "log.h"
+#include "gpu.h"
+#include "m68k.h"
 
 //#define OP_DEBUG
 //#define OP_DEBUG_BMP
@@ -44,12 +49,14 @@ uint64 op_load_phrase(uint32 offset);
 
 // Local global variables
 
-static uint8 * op_blend_y;
-static uint8 * op_blend_cr;
+// Blend tables (64K each)
+static uint8 op_blend_y[0x10000];
+static uint8 op_blend_cr[0x10000];
 // There may be a problem with this "RAM" overlapping (and thus being independent of)
 // some of the regular TOM RAM...
-static uint8 objectp_ram[0x40];                        // This is based at $F00000
-uint8 objectp_running;
+//#warning objectp_ram is separated from TOM RAM--need to fix that!
+//static uint8 objectp_ram[0x40];                      // This is based at $F00000
+uint8 objectp_running = 0;
 //bool objectp_stop_reading_list;
 
 static uint8 op_bitmap_bit_depth[8] = { 1, 2, 4, 8, 16, 24, 32, 0 };
@@ -66,10 +73,6 @@ int32 phraseWidthToPixels[8] = { 64, 32, 16, 8, 4, 2, 0, 0 };
 //
 void op_init(void)
 {
-       // Blend tables (64K each)
-       memory_malloc_secure((void **)&op_blend_y, 0x10000, "Jaguar Object processor Y blend lookup table");
-       memory_malloc_secure((void **)&op_blend_cr, 0x10000, "Jaguar Object processor CR blend lookup table");
-
        // Here we calculate the saturating blend of a signed 4-bit value and an
        // existing Cyan/Red value as well as a signed 8-bit value and an existing intensity...
        // Note: CRY is 4 bits Cyan, 4 bits Red, 16 bits intensitY
@@ -116,15 +119,15 @@ void op_init(void)
 //
 void op_reset(void)
 {
-       memset(objectp_ram, 0x00, 0x40);
+//     memset(objectp_ram, 0x00, 0x40);
        objectp_running = 0;
 }
 
 void op_done(void)
 {
-       char * opType[8] =
+       const char * opType[8] =
        { "(BITMAP)", "(SCALED BITMAP)", "(GPU INT)", "(BRANCH)", "(STOP)", "???", "???", "???" };
-       char * ccType[8] =
+       const char * ccType[8] =
                { "\"==\"", "\"<\"", "\">\"", "(opflag set)", "(second half line)", "?", "?", "?" };
 
        uint32 olp = op_get_list_pointer();
@@ -149,8 +152,8 @@ void op_done(void)
        }
        WriteLog("\n");
 
-       memory_free(op_blend_y);
-       memory_free(op_blend_cr);
+//     memory_free(op_blend_y);
+//     memory_free(op_blend_cr);
 }
 
 //
@@ -162,6 +165,7 @@ void op_done(void)
 //     F00026            W   -------- -------x   OBF - object processor flag
 //
 
+#if 0
 uint8 OPReadByte(uint32 offset, uint32 who/*=UNKNOWN*/)
 {
        offset &= 0x3F;
@@ -190,33 +194,27 @@ WriteLog("OP: Setting lo list pointer: %04X\n", data);
 if (offset == 0x22)
 WriteLog("OP: Setting hi list pointer: %04X\n", data);//*/
 }
+#endif
 
 uint32 op_get_list_pointer(void)
 {
        // Note: This register is LO / HI WORD, hence the funky look of this...
-//     return (objectp_ram[0x22] << 24) | (objectp_ram[0x23] << 16) | (objectp_ram[0x20] << 8) | objectp_ram[0x21];
-       return GET16(objectp_ram, 0x20) | (GET16(objectp_ram, 0x22) << 16);
+       return GET16(tom_ram_8, 0x20) | (GET16(tom_ram_8, 0x22) << 16);
 }
 
 // This is WRONG, since the OBF is only 16 bits wide!!! [FIXED]
 
 uint32 op_get_status_register(void)
 {
-//     return (objectp_ram[0x26] << 24) | (objectp_ram[0x27] << 16) | (objectp_ram[0x28] << 8) | objectp_ram[0x29];
-//     return GET32(objectp_ram, 0x26);
-       return GET16(objectp_ram, 0x26);
+       return GET16(tom_ram_8, 0x26);
 }
 
 // This is WRONG, since the OBF is only 16 bits wide!!! [FIXED]
 
 void op_set_status_register(uint32 data)
 {
-/*     objectp_ram[0x26] = (data & 0xFF000000) >> 24;
-       objectp_ram[0x27] = (data & 0x00FF0000) >> 16;
-       objectp_ram[0x28] = (data & 0x0000FF00) >> 8;
-       objectp_ram[0x29] |= (data & 0xFE);*/
-       objectp_ram[0x26] = (data & 0x0000FF00) >> 8;
-       objectp_ram[0x27] |= (data & 0xFE);
+       tom_ram_8[0x26] = (data & 0x0000FF00) >> 8;
+       tom_ram_8[0x27] |= (data & 0xFE);
 }
 
 void op_set_current_object(uint64 object)
@@ -233,15 +231,15 @@ void op_set_current_object(uint64 object)
        objectp_ram[0x15] = object & 0xFF; object >>= 8;
        objectp_ram[0x14] = object & 0xFF;*/
 // Let's try regular good old big endian...
-       objectp_ram[0x17] = object & 0xFF; object >>= 8;
-       objectp_ram[0x16] = object & 0xFF; object >>= 8;
-       objectp_ram[0x15] = object & 0xFF; object >>= 8;
-       objectp_ram[0x14] = object & 0xFF; object >>= 8;
-
-       objectp_ram[0x13] = object & 0xFF; object >>= 8;
-       objectp_ram[0x12] = object & 0xFF; object >>= 8;
-       objectp_ram[0x11] = object & 0xFF; object >>= 8;
-       objectp_ram[0x10] = object & 0xFF;
+       tom_ram_8[0x17] = object & 0xFF; object >>= 8;
+       tom_ram_8[0x16] = object & 0xFF; object >>= 8;
+       tom_ram_8[0x15] = object & 0xFF; object >>= 8;
+       tom_ram_8[0x14] = object & 0xFF; object >>= 8;
+
+       tom_ram_8[0x13] = object & 0xFF; object >>= 8;
+       tom_ram_8[0x12] = object & 0xFF; object >>= 8;
+       tom_ram_8[0x11] = object & 0xFF; object >>= 8;
+       tom_ram_8[0x10] = object & 0xFF;
 }
 
 uint64 op_load_phrase(uint32 offset)
@@ -314,6 +312,7 @@ void DumpFixedObject(uint64 p0, uint64 p1)
 //
 //Need to fix this so that when an GPU object IRQ happens, we can pick up OP processing
 //where we left off. !!! FIX !!!
+#warning Need to fix this so that when an GPU object IRQ happens, we can pick up OP processing where we left off. !!! FIX !!!
 void OPProcessList(int scanline, bool render)
 {
 extern int op_start_log;
@@ -460,8 +459,8 @@ if (!inhibit)       // For OP testing only!
 //???Does this really happen??? Doesn't seem to work if you do this...!
 //Probably not. Must be a bug in the documentation...!
 //                             uint32 link = (p0 & 0x7FFFF000000) >> 21;
-//                             SET16(objectp_ram, 0x20, link & 0xFFFF);        // OLP
-//                             SET16(objectp_ram, 0x22, link >> 16);
+//                             SET16(tom_ram_8, 0x20, link & 0xFFFF);  // OLP
+//                             SET16(tom_ram_8, 0x22, link >> 16);
 /*                             uint32 height = (p0 & 0xFFC000) >> 14;
                                if (height - 1 > 0)
                                        height--;*/
index 9d2a6ccd2d88312120bb99d52a2b7ddc85c24983..82327d5d6c7173e8c5b2973cf2d7ba48ec3507b1 100644 (file)
@@ -17,9 +17,9 @@ void op_set_status_register(uint32 data);
 uint32 op_get_status_register(void);
 void op_set_current_object(uint64 object);
 
-uint8 OPReadByte(uint32, uint32 who = UNKNOWN);
-uint16 OPReadWord(uint32, uint32 who = UNKNOWN);
-void OPWriteByte(uint32, uint8, uint32 who = UNKNOWN);
-void OPWriteWord(uint32, uint16, uint32 who = UNKNOWN);
+//uint8 OPReadByte(uint32, uint32 who = UNKNOWN);
+//uint16 OPReadWord(uint32, uint32 who = UNKNOWN);
+//void OPWriteByte(uint32, uint8, uint32 who = UNKNOWN);
+//void OPWriteWord(uint32, uint16, uint32 who = UNKNOWN);
 
 #endif // __OBJECTP_H__
index 75d764430dd98880da08d3fd0725178fad24dfb5..539de4098c099f74b167120bd42a84a25f7e33a5 100644 (file)
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+
+#include "sdlemu_config.h"
+
 #include <stdio.h>
 #include <string>
 #include <list>
-#include "sdlemu_config.h"
 
 using namespace std;
 
index ac6483212f954dccdf91fa3db868d26621ee3cf1..40d417e3a7d276d4a66efb7127eb4ac4fec0e4a3 100644 (file)
@@ -4,12 +4,13 @@
 // by James L. Hammons
 //
 
+#include "settings.h"
+
 #include <stdlib.h>
 #include <string>
 #include "SDL.h"
 #include "sdlemu_config.h"
 #include "log.h"
-#include "settings.h"
 
 using namespace std;
 
index 7bd954e8dba8cb761ebbcc1665e7e5a5977642fb..44617b3daca40497901b2ba7fe70855e44ce748f 100644 (file)
 //     F02298            W   xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx   B_Z0 - Z0
 //     ------------------------------------------------------------
 
-//#include <SDL.h>
 #include "tom.h"
+
+#include <string.h>                                                            // For memset()
+#include <stdlib.h>                                                            // For rand()
 #include "video.h"
 #include "gpu.h"
 #include "objectp.h"
 #include "cry2rgb.h"
 #include "settings.h"
 #include "clock.h"
+#include "jaguar.h"
+#include "log.h"
+#include "blitter.h"
+#include "m68k.h"
 
 #define NEW_TIMER_SYSTEM
 
 
 extern uint8 objectp_running;
 
-static uint8 * tom_ram_8;
+uint8 tom_ram_8[0x4000];
 uint32 tom_width, tom_height;
 static uint32 tom_timer_prescaler;
 static uint32 tom_timer_divider;
@@ -323,7 +329,7 @@ uint16 tom_jerry_int_pending, tom_timer_int_pending, tom_object_int_pending,
 //int16 * TOMBackbuffer;
 uint32 * TOMBackbuffer;
 
-static char * videoMode_to_str[8] =
+static const char * videoMode_to_str[8] =
        { "16 BPP CRY", "24 BPP RGB", "16 BPP DIRECT", "16 BPP RGB",
          "Mixed mode", "24 BPP RGB", "16 BPP DIRECT", "16 BPP RGB" };
 
@@ -991,7 +997,7 @@ void tom_init(void)
        op_init();
        blitter_init();
 //This should be done by JERRY!        pcm_init();
-       memory_malloc_secure((void **)&tom_ram_8, 0x4000, "TOM RAM");
+//     memory_malloc_secure((void **)&tom_ram_8, 0x4000, "TOM RAM");
        tom_reset();
        // Setup the non-stretchy scanline rendering...
        memcpy(scanline_render, scanline_render_normal, sizeof(scanline_render));
@@ -1011,7 +1017,7 @@ void tom_done(void)
 //     WriteLog("tom: INT1=0x%.2x%.2x\n",TOMReadByte(0xf000e0),TOMReadByte(0xf000e1));
 //     gpu_done();
 //     dsp_done();
-       memory_free(tom_ram_8);
+//     memory_free(tom_ram_8);
 //     memory_free(tom_cry_rgb_mix_lut);
 }
 
@@ -1192,8 +1198,8 @@ uint8 TOMReadByte(uint32 offset, uint32 who/*=UNKNOWN*/)
                return GPUReadByte(offset, who);
        else if ((offset >= GPU_WORK_RAM_BASE) && (offset < GPU_WORK_RAM_BASE+0x1000))
                return GPUReadByte(offset, who);
-       else if ((offset >= 0xF00010) && (offset < 0xF00028))
-               return OPReadByte(offset, who);
+/*     else if ((offset >= 0xF00010) && (offset < 0xF00028))
+               return OPReadByte(offset, who);*/
        else if ((offset >= 0xF02200) && (offset < 0xF022A0))
                return BlitterReadByte(offset, who);
        else if (offset == 0xF00050)
@@ -1251,8 +1257,8 @@ if (offset >= 0xF02000 && offset <= 0xF020FF)
                return GPUReadWord(offset, who);
        else if ((offset >= GPU_WORK_RAM_BASE) && (offset < GPU_WORK_RAM_BASE + 0x1000))
                return GPUReadWord(offset, who);
-       else if ((offset >= 0xF00010) && (offset < 0xF00028))
-               return OPReadWord(offset, who);
+/*     else if ((offset >= 0xF00010) && (offset < 0xF00028))
+               return OPReadWord(offset, who);*/
        else if ((offset >= 0xF02200) && (offset < 0xF022A0))
                return BlitterReadWord(offset, who);
        else if (offset == 0xF00050)
@@ -1287,11 +1293,11 @@ void TOMWriteByte(uint32 offset, uint8 data, uint32 who/*=UNKNOWN*/)
                GPUWriteByte(offset, data, who);
                return;
        }
-       else if ((offset >= 0xF00010) && (offset < 0xF00028))
+/*     else if ((offset >= 0xF00010) && (offset < 0xF00028))
        {
                OPWriteByte(offset, data, who);
                return;
-       }
+       }*/
        else if ((offset >= 0xF02200) && (offset < 0xF022A0))
        {
                BlitterWriteByte(offset, data, who);
@@ -1365,11 +1371,11 @@ if (offset >= 0xF02000 && offset <= 0xF020FF)
                TOMWriteByte(offset, data >> 8);
                TOMWriteByte(offset+1, data & 0xFF);
        }*/
-       else if ((offset >= 0xF00010) && (offset < 0xF00028))
+/*     else if ((offset >= 0xF00010) && (offset < 0xF00028))
        {
                OPWriteWord(offset, data, who);
                return;
-       }
+       }*/
        else if (offset == 0xF00050)
        {
                tom_timer_prescaler = data;
@@ -1412,6 +1418,8 @@ if (offset >= 0xF02000 && offset <= 0xF020FF)
 
        offset &= 0x3FFF;
        if (offset == 0x28)                     // VMODE (Why? Why not OBF?)
+//Actually, we should check to see if the Enable bit of VMODE is set before doing this... !!! FIX !!!
+#warning Actually, we should check to see if the Enable bit of VMODE is set before doing this... !!! FIX !!!
                objectp_running = 1;
 
        if (offset >= 0x30 && offset <= 0x4E)
index faaf4f7c9ecf01ff2158b1e1a75e5edff4be0da3..091cd0cffa71bbecb1cd8a8f686582136a81c288 100644 (file)
--- a/src/tom.h
+++ b/src/tom.h
@@ -5,7 +5,8 @@
 #ifndef __TOM_H__
 #define __TOM_H__
 
-#include "jaguar.h"
+//#include "jaguar.h"
+#include "types.h"
 
 #define VIDEO_MODE_16BPP_CRY   0
 #define VIDEO_MODE_24BPP_RGB   1
@@ -54,5 +55,6 @@ void TOMResetBackbuffer(uint32 * backbuffer);
 
 extern uint32 tom_width;
 extern uint32 tom_height;
+extern uint8 tom_ram_8[];
 
 #endif // __TOM_H__
index 513719279d628333dbf25342c089c21b4bf076fe..d8ddb312c96c0c0482cce5721b70b9bb3d65743f 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __UNZIP_H__
 #define __UNZIP_H__
 
-//#include "types.h"
 #include <stdio.h>
 #include <stdint.h>
 
index cbf1ffe473b777ac075f0c58850af8912c6642ea..4507363cf99c23dd941d0d70a1c1e05d598c272a 100644 (file)
@@ -4,10 +4,12 @@
 // by James L. Hammons
 //
 
+#include "video.h"
+
 #include "tom.h"
 #include "sdlemu_opengl.h"
 #include "settings.h"
-#include "video.h"
+#include "log.h"
 
 // External global variables
 
index 309ec236ff0ce9295896270c5563a27dd92d806b..2e2480e5cb756222872c9a6c5e7861b4f1da7cbd 100644 (file)
@@ -7,7 +7,8 @@
 //
 
 #ifdef __GCCUNIX__
-#include <unistd.h>                                                                    // Is this necessary anymore?
+//#include <unistd.h>                                                                  // Is this necessary anymore?
+//Looks like the answer is no...
 #endif
 
 #include <time.h>
@@ -17,6 +18,9 @@
 #include "gui.h"
 #include "sdlemu_opengl.h"
 #include "settings.h"                                                          // Pull in "vjs" struct
+#include "log.h"
+#include "version.h"
+#include "memory.h"
 
 // Uncomment this to use built-in BIOS/CD-ROM BIOS
 // You'll need a copy of jagboot.h & jagcd.h for this to work...!
@@ -37,7 +41,7 @@ extern uint8 * jaguar_bootRom;
 extern uint8 * jaguar_CDBootROM;
 
 // Global variables (export capable)
-//should these even be here anymore?
+//should these even be here anymore? prolly not...
 
 bool finished = false;
 bool showGUI = false;
@@ -132,11 +136,11 @@ int main(int argc, char * argv[])
                if (!strcmp(argv[i], "-ntsc"))
                        vjs.hardwareTypeNTSC = true;
 
-               if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "-?"))
+               if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-?"))
                {
                    printf("Usage: \n\n");
                        printf("vj [romfile] [switches]\n");
-                       printf("  -? or -help     : Display usage and switches                \n");
+                       printf("  -? or --help    : Display usage and switches                \n");
                        printf("  -frameskip 1-10 : Enable frameskip 1 - 10 (default: none)   \n");
                        printf("  -joystick       : Enable joystick/gamepad                   \n");
                        printf("  -joyport 0-3    : Select desired joystick port              \n");
@@ -160,8 +164,6 @@ int main(int argc, char * argv[])
 
        // Set up SDL library
        if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_TIMER) < 0)
-//             | SDL_INIT_CDROM) < 0)
-//             | SDL_INIT_CDROM | SDL_INIT_NOPARACHUTE) < 0)
        {
                WriteLog("VJ: Could not initialize the SDL library: %s\n", SDL_GetError());
                return -1;
@@ -217,7 +219,6 @@ WriteLog("About to start GUI...\n");
        log_done();     
 
        // Free SDL components last...!
-//     SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_CDROM);
        SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_TIMER);
        SDL_Quit();