From 4b629b399ccfba8ca942acbdb808938f0f1aabca Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Fri, 1 Jul 2011 02:03:14 +0000 Subject: [PATCH] Moved Jaguar core to library, fixes for Mac OSX compilation. --- Makefile | 14 ++++-- docs/README | 29 ++++++------ docs/TODO | 2 +- docs/WHATSNEW | 5 +- musashi.mak | 6 +-- src/filedb.cpp | 2 +- src/unzip.c | 10 ++-- virtualjaguar.pro | 116 ++++++++++++++++++++++------------------------ 8 files changed, 91 insertions(+), 93 deletions(-) diff --git a/Makefile b/Makefile index 54dcca6..4b6b4ea 100644 --- a/Makefile +++ b/Makefile @@ -29,27 +29,31 @@ prepare: @echo "#define VJ_RELEASE_SUBVERSION \"2.0.0 Prerelease\"" >> src/version.h virtualjaguar: sources libs makefile-qt - @echo -e "\033[01;33m***\033[00;32m Making Virtual Jaguar...\033[00m" + @echo -e "\033[01;33m***\033[00;32m Making Virtual Jaguar GUI...\033[00m" $(MAKE) -f makefile-qt makefile-qt: virtualjaguar.pro @echo -e "\033[01;33m***\033[00;32m Creating Qt makefile...\033[00m" qmake $(QMAKE_EXTRA) virtualjaguar.pro -o makefile-qt -libs: obj/libmusashi.a +libs: obj/libmusashi.a obj/libjaguarcore.a @echo -e "\033[01;33m***\033[00;32m Libraries successfully made.\033[00m" -obj/libmusashi.a: +obj/libmusashi.a: musashi.mak @echo -e "\033[01;33m***\033[00;32m Making Musashi...\033[00m" $(MAKE) -f musashi.mak +obj/libjaguarcore.a: jaguarcore.mak + @echo -e "\033[01;33m***\033[00;32m Making Virtual Jaguar core...\033[00m" + $(MAKE) -f jaguarcore.mak + sources: src/*.h src/*.cpp src/*.c clean: @echo -ne "\033[01;33m***\033[00;32m Cleaning out the garbage...\033[00m" @-rm -rf ./obj - @-rm makefile-qt - @-rm virtualjaguar + @-rm -rf makefile-qt + @-rm -rf virtualjaguar @-$(FIND) . -name "*~" -exec rm -f {} \; @echo "done!" diff --git a/docs/README b/docs/README index ae1e595..30c8477 100644 --- a/docs/README +++ b/docs/README @@ -1,6 +1,6 @@ --------------------------------------------- -Virtual Jaguar v2.0.0 GCC/SDL release README --------------------------------------------- +------------------------------------------- +Virtual Jaguar v2.0.0 GCC/Qt release README +------------------------------------------- -------------- - DISCLAIMER - @@ -78,21 +78,20 @@ There is a fifth type of file that is supported by Virtual Jaguar, the .j64 file, which is simply a 1, 2, or 4 Meg dump of a Jaguar cartridge ROM which loads at $800000 in the Jaguar memory space. ------------------------------------ -- What is Virtual Jaguar GCC/SDL? - ------------------------------------ +---------------------------------- +- What is Virtual Jaguar GCC/Qt? - +---------------------------------- Virtual Jaguar is software dedicated to emulating the Atari Jaguar hardware on a standard PC. The software was originally developed by David Raingeard of Potato Emulation [http://potato.emu-france.com] and was released under the GPL on 25 June 2003. -Virtual Jaguar GCC/SDL is not just a port of the MS Visual C++/SDL sourcecode +Virtual Jaguar GCC/Qt is not just a port of the MS Visual C++/SDL sourcecode but has also been extended and rewritten so that we can enjoy Atari Jaguar -emulation on every platform that has a GCC compiler and a port of the Simple -Directmedia Layer library (SDL). +emulation on every platform that has a GCC compiler and a port of Qt. -Currently Virtual Jaguar GCC/SDL compiles on WIN32 using mingw, and several +Currently Virtual Jaguar GCC/Qt compiles on WIN32 using mingw, and several UN*X based systems (BeOS, Linux, FreeBSD and MacOS). It may run on other systems as well but we can not guarantee that. @@ -105,15 +104,15 @@ are particularly welcome! :) More information about the incredible SDL libraries can be found at http://www.libsdl.org. Thanks Sam--you rock! :) --------------------------------- -- Using Virtual Jaguar GCC/SDL - --------------------------------- +------------------------------- +- Using Virtual Jaguar GCC/Qt - +------------------------------- After compiling the binary (see INSTALL) you can now run original Atari Jaguar games. These games are distributed on cartridges and can therefore cannot be used on a PC (we're still waiting for that Jaguar-on-a-PCI-card that you plug into your late model PC, complete with cartridge slot and controller connectors -;-). To use these games on Virtual Jaguar GCC/SDL you need to get ROM images. +;-). To use these games on Virtual Jaguar GCC/Qt you need to get ROM images. Besides the ROM images from commercial games, you may also need to obtain the Atari Jaguar boot ROM (and/or CD boot ROM) which you must copy to the BIOS directory. For legal issues concerning ROM images please consult the DISCLAIMER @@ -160,7 +159,7 @@ Atari RIGHT : RIGHT or joystick RIGHT Atari # : Keypad / Atari * : Keypad * -With ESC you can easily stop Virtual Jaguar GCC/SDL which will get you back to +With ESC you can easily stop Virtual Jaguar GCC/Qt which will get you back to the GUI (pressing ESC again will take you back to the game). To exit VJ, you can either select File|Quit or press the "Q" key on your keyboard. If you want to change the key layout, simply edit the vj.cfg file and change the keys. :) diff --git a/docs/TODO b/docs/TODO index d5491e6..04d0a4e 100644 --- a/docs/TODO +++ b/docs/TODO @@ -13,7 +13,7 @@ Stuff to add/fix for the next release of Virtual Jaguar - It would be nice to have "save states" for instant save/load capability. [Shamus] - Cycle accuracy for GPU/DSP/OP/Blitter. [Shamus] -- Need to propogate blitter fixes in the A1 <- A2 direction to the A1 -> A2 +- Need to propagate blitter fixes in the A1 <- A2 direction to the A1 -> A2 direction and the GPU fixes to various instructions to the DSP. [Shamus] - Need to fix PAL mode to work with the virtual screen code. [Shamus] - There are a few ROMs that use some "quasi-illegal" 68K instructions. Need diff --git a/docs/WHATSNEW b/docs/WHATSNEW index 080ab8b..e77cad0 100644 --- a/docs/WHATSNEW +++ b/docs/WHATSNEW @@ -1,10 +1,11 @@ -Virtual Jaguar v2.0.0 GCC/SDL ------------------------------ +Virtual Jaguar v2.0.0 GCC/Qt +---------------------------- * Switched GUI to Qt. And there was much rejoicing. ;-) [Shamus] * Added detection code to fish out files from inside ZIP archives. What this means is that now you can have other goodies inside of your ROM ZIP like labels, box art, and overlays. See README for details. [Shamus] +* Various usability improvements, too many to list here. ;-) [Shamus] Virtual Jaguar v1.1.0 GCC/SDL (r299 - Never officially released) diff --git a/musashi.mak b/musashi.mak index 7aaa771..1e0d3eb 100644 --- a/musashi.mak +++ b/musashi.mak @@ -4,7 +4,7 @@ # by James L. Hammons # # This software is licensed under the GPL v3 or any later version. See the -# file GPL.TXT for details. ;-) +# file GPLv3 for details. ;-) # CC := gcc @@ -23,12 +23,10 @@ OBJS := \ obj/m68kopnz.o \ obj/m68kdasm.o -TARGET := $(OBJS) - # Targets for convenience sake, not "real" targets .PHONY: clean -all: obj $(TARGET) obj/libmusashi.a +all: obj obj/libmusashi.a @echo "Done!" obj: diff --git a/src/filedb.cpp b/src/filedb.cpp index 8dc4fa2..47c31ef 100644 --- a/src/filedb.cpp +++ b/src/filedb.cpp @@ -105,7 +105,7 @@ RomIdentifier romList[] = { { 0xC654681B, "Total Carnage (World)", FF_ROM | FF_VERIFIED }, { 0xC6C7BA62, "Fight for Life (World) (alt)", FF_ROM | FF_BAD_DUMP }, { 0xC9608717, "Val d'Isere Skiing and Snowboarding (World)", FF_ROM | FF_VERIFIED }, - { 0xCBFD822A, "Air Cars (World) (alt)", FF_ROM }, + { 0xCBFD822A, "Air Cars (World) (alt)", FF_ROM | FF_BAD_DUMP }, { 0xCD5BF827, "Attack of the Mutant Penguins (World)", FF_ROM | FF_VERIFIED | FF_REQ_DSP }, { 0xD6C19E34, "Iron Soldier 2 (World)", FF_ROM | FF_VERIFIED }, { 0xD8696F23, "Breakout 2000 (alt)", FF_ALPINE }, diff --git a/src/unzip.c b/src/unzip.c index 509da18..0aa231f 100644 --- a/src/unzip.c +++ b/src/unzip.c @@ -13,21 +13,21 @@ // JLH 02/28/2010 Removed unnecessary cruft // +#include "unzip.h" + #include #include #include #include #include - -#include "unzip.h" #include "log.h" /* public globals */ int gUnzipQuiet = 0; /* flag controls error messages */ -#define ERROR_CORRUPT "The zipfile seems to be corrupt, please check it" -#define ERROR_FILESYSTEM "Your filesystem seems to be corrupt, please check it" +#define ERROR_CORRUPT "The zipfile seems to be corrupt, please check it" +#define ERROR_FILESYSTEM "Your filesystem seems to be corrupt, please check it" #define ERROR_UNSUPPORTED "The format of this zipfile is not supported, please recompress it" #define INFLATE_INPUT_BUFFER_MAX 16384 @@ -120,7 +120,7 @@ static int ecd_read(ZIP * zip) return -1; } - if (fread(buf, 1, buf_length, zip->fp) != buf_length) + if (fread(buf, 1, buf_length, zip->fp) != (unsigned int)buf_length) { free(buf); return -1; diff --git a/virtualjaguar.pro b/virtualjaguar.pro index ecaf4d4..15fc207 100644 --- a/virtualjaguar.pro +++ b/virtualjaguar.pro @@ -9,13 +9,13 @@ # NOTE: Musashi is built and linked in as a library, so there should be no more # problems with using the qmake build system as-is. :-) # Other than on the Mac, where it stupidly defaults to making XCode binaries. >:-( +# Well, we fixed it in the Makefile, by doing platfrom detection there. :-/ # TARGET = virtualjaguar CONFIG += qt warn_on release debug RESOURCES += virtualjaguar.qrc -#LIBS += `sdl-config --libs` -lz -Lobj -lmusashi -LIBS += -lz -Lobj -lmusashi +LIBS += -lz -Lobj -ljaguarcore -lmusashi QT += opengl # We stuff all the intermediate crap into obj/ so it won't confuse us mere mortals ;-) @@ -29,17 +29,13 @@ win32 { DEFINES += __GCCWIN32__ } macx { DEFINES += __GCCUNIX__ _OSX_ } unix { DEFINES += __GCCUNIX__ } -# SDL +# SDL (to link statically on Mac) macx { LIBS += `sdl-config --static-libs` } win32|unix { LIBS += `sdl-config --libs` } -#CFLAGS := -MMD -Wall -Wno-switch -O2 -D$(SYSTYPE) -ffast-math -fomit-frame-pointer `sdl-config --cflags` -#CPPFLAGS := -MMD -Wall -Wno-switch -Wno-non-virtual-dtor -O2 -D$(SYSTYPE) -Wno-trigraphs \ -# $(HAVECDIO) -ffast-math -fomit-frame-pointer `sdl-config --cflags` -g - # C/C++ flags... # NOTE: May have to put -Wall back in, but only on non-release cycles. It can -# cause problems if you're not careful. +# cause problems if you're not careful. (Can do this via command line in qmake) QMAKE_CFLAGS += `sdl-config --cflags` -O2 -ffast-math -fomit-frame-pointer QMAKE_CXXFLAGS += `sdl-config --cflags` -O2 -ffast-math -fomit-frame-pointer @@ -83,56 +79,56 @@ SOURCES = \ # The core (soon to be made into a library of its own) -HEADERS += \ - src/blitter.h \ - src/cdintf.h \ - src/cdrom.h \ - src/crc32.h \ - src/dac.h \ - src/dsp.h \ - src/eeprom.h \ - src/event.h \ - src/file.h \ - src/filedb.h \ - src/gpu.h \ - src/jagdasm.h \ - src/jaguar.h \ - src/jerry.h \ - src/joystick.h \ - src/log.h \ - src/memory.h \ - src/mmu.h \ - src/objectp.h \ - src/settings.h \ - src/state.h \ - src/tom.h \ - src/unzip.h \ - src/universalhdr.h \ - src/wavetable.h +#HEADERS += \ +# src/blitter.h \ +# src/cdintf.h \ +# src/cdrom.h \ +# src/crc32.h \ +# src/dac.h \ +# src/dsp.h \ +# src/eeprom.h \ +# src/event.h \ +# src/file.h \ +# src/filedb.h \ +# src/gpu.h \ +# src/jagdasm.h \ +# src/jaguar.h \ +# src/jerry.h \ +# src/joystick.h \ +# src/log.h \ +# src/memory.h \ +# src/mmu.h \ +# src/objectp.h \ +# src/settings.h \ +# src/state.h \ +# src/tom.h \ +# src/unzip.h \ +# src/universalhdr.h \ +# src/wavetable.h -SOURCES += \ - src/blitter.cpp \ - src/cdintf.cpp \ - src/cdrom.cpp \ - src/crc32.cpp \ - src/dac.cpp \ - src/dsp.cpp \ - src/eeprom.cpp \ - src/event.cpp \ - src/file.cpp \ - src/filedb.cpp \ - src/gpu.cpp \ - src/jagdasm.cpp \ - src/jaguar.cpp \ - src/jerry.cpp \ - src/joystick.cpp \ - src/log.cpp \ - src/memory.cpp \ - src/mmu.cpp \ - src/objectp.cpp \ - src/settings.cpp \ - src/state.cpp \ - src/tom.cpp \ - src/universalhdr.cpp \ - src/unzip.c \ - src/wavetable.cpp +#SOURCES += \ +# src/blitter.cpp \ +# src/cdintf.cpp \ +# src/cdrom.cpp \ +# src/crc32.cpp \ +# src/dac.cpp \ +# src/dsp.cpp \ +# src/eeprom.cpp \ +# src/event.cpp \ +# src/file.cpp \ +# src/filedb.cpp \ +# src/gpu.cpp \ +# src/jagdasm.cpp \ +# src/jaguar.cpp \ +# src/jerry.cpp \ +# src/joystick.cpp \ +# src/log.cpp \ +# src/memory.cpp \ +# src/mmu.cpp \ +# src/objectp.cpp \ +# src/settings.cpp \ +# src/state.cpp \ +# src/tom.cpp \ +# src/universalhdr.cpp \ +# src/unzip.c \ +# src/wavetable.cpp -- 2.37.2