]> Shamusworld >> Repos - virtualjaguar/commitdiff
Preliminary state support
authorShamus Hammons <jlhamm@acm.org>
Thu, 15 Jan 2009 19:17:28 +0000 (19:17 +0000)
committerShamus Hammons <jlhamm@acm.org>
Thu, 15 Jan 2009 19:17:28 +0000 (19:17 +0000)
Makefile
docs/INSTALL
docs/README
src/objectp.h
src/state.cpp [new file with mode: 0644]
src/state.h [new file with mode: 0644]
src/tom.cpp
vj.cfg

index d205e3bff054d08bce1a4efae05dbb8f5cf9f171..af2d38328ca1f893a1d57cd36a72c4997ccd7831 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -106,6 +106,7 @@ OBJS = \
        obj/sdlemu_config.o \
        obj/sdlemu_opengl.o \
        obj/settings.o      \
+       obj/state.o         \
        obj/tom.o           \
        obj/unzip.o         \
        obj/video.o         \
index 423d36cc59f6972be8a296d38d08e9b4bb1e330a..94c054cb398dec729e90cb4f118422076069f0d7 100644 (file)
@@ -6,18 +6,17 @@ Virtual Jaguar v1.1.0 GCC/SDL release INSTALL
 REQUIREMENTS:
 -------------
 
-To compile Virtual Jaguar you need to check if you have the minimum
-requirements for compiling the sources:
-
-- GCC v4.3.x or higher
-- SDL v1.2.13 or higher
-- ZLIB v1.2.3
-- libcdio v0.80 or higher
-- OpenGL libraries
-- supported OS (BeOS, Linux, FreeBSD and WIN32 through mingw, MacOS); other OSs
-  may work to but you may need to change some items in the Makefile.
-
-Optionally you need a Atari Jaguar boot ROM (and/or CD boot ROM) which is
+The minimum requirements for compiling Virtual Jaguar from source are:
+
+ o  GCC v4.3.x or higher
+ o  SDL v1.2.13 or higher
+ o  zlib v1.2.3
+ o  libcdio v0.80 or higher
+ o  OpenGL libraries
+ o  supported OS (BeOS, Linux, FreeBSD and WIN32 through mingw, MacOS); other
+    OSs may work to but you may need to change some items in the Makefile.
+
+Optionally you'll need an Atari Jaguar boot ROM (and/or CD boot ROM) which is
 available on the Internet. We can't include the boot ROM since it's still
 copyrighted.
 
@@ -25,7 +24,7 @@ copyrighted.
 COMPILING:
 ----------
 
-If you sure you have the minimum software requirements, you can compile
+Assuming that you meet the minimum software requirements, you can compile
 Virtual Jaguar by issuing the following command in the directory where you
 decompressed the source:
 
@@ -35,8 +34,8 @@ Optionally you can manually strip vj[.exe] to downsize the binary. If you have
 upx in your path somewhere, you can uncomment the line in the makefile that
 executes upx so that you'll end up with a somewhat smaller binary.
 
-That's it! You're done! You can now start the emulator with ./vj. See the
-output for more details or consult the README file for more info.
+That's it! You can now start the emulator with ./vj. See the output for more
+details (or stdout.txt on Win32) or consult the README file for more info.
 
 For even more info, go to http://sdlemu.ngemu.com or send use an e-mail to the
 following e-mail address: sdlemu AT ngemu DOT com.
index 81b890c87c73ffed30bddf08cdcdfea6fec0faf5..f109b8f220cce8e8bbe2d0216dd0ea6581fadfce 100644 (file)
@@ -13,10 +13,10 @@ original work by David Raingeard of Potato Emulation. For requirements please
 consult the INSTALL file for more information about supported OS's and
 software requirements.
 
-The use of this software is entirely at your own risk. We can't be held
-responsible for damage done to you hardware and/or software. While it won't
-rape your dog, it might do other nasty things. You have been warned. This
-software requires the use of the Atari Jaguar (CD) boot ROM and/or Commercial
+The use of this software is entirely at your own risk. While it won't rape
+your dog, it might do other nasty things. We can't be held responsible for
+damage done to you hardware and/or software. You have been warned! This
+software may require the use of the Atari Jaguar boot ROMs and/or Commercial
 ROM images. You may only use the ROM images if you own the cartridges itself.
 The use of Commercial ROMs without owning the original cartridge is illegal in
 most countries and could result in fines and/or legal actions.
@@ -27,8 +27,9 @@ may not commercially sell this software. If you make changes, release the
 source code to the public and send the changes you made to the original
 authors.
 
-The products and brands used in these documents and/or sourcecode are owned by
-their respective companies and/or successors in interest.
+The products, trademarks and/or brands used in these documents and/or
+sourcecode are owned by their respective companies and/or successors in
+interest.
 
 ----------------------------------------------------------------
 - IMPORTANT NOTE ABOUT JAGUAR FILE FORMATS--READ THIS OR ELSE! -
@@ -86,14 +87,14 @@ 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 only a port of the MS Visual C++/SDL sourcecode
+Virtual Jaguar GCC/SDL 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 which uses the GCC compiler and that can make use
-of the Simple Directmedia Layer library (SDL).
+emulation on every platform that has a GCC compiler and a port of the Simple
+Directmedia Layer library (SDL).
 
 Currently Virtual Jaguar GCC/SDL compiles on WIN32 using mingw, and several
-UN*X based systems (BeOS, Linux and FreeBSD). It may run on other systems
-as well but we can not guarantee that.
+UN*X based systems (BeOS, Linux, FreeBSD and MacOS). It may run on other
+systems as well but we can not guarantee that.
 
 The port was done by the SDLEMU crew (http://sdlemu.ngemu.com) and especially
 by Niels Wagenaar and Carwin Jones. A major portion of the rewrite was done by
@@ -101,7 +102,8 @@ James L. Hammons. You may contact us by e-mail (sdlemu@ngemu.com) or leave a
 message on the SDLEMU Official Forum (see the website). Patches and bugfixes
 are particularly welcome! :)
 
-More information about SDL can be found at http://www.libsdl.org.
+More information about the incredible SDL libraries can be found at
+http://www.libsdl.org. Thanks Sam--you rock! :)
 
 --------------------------------
 - Using Virtual Jaguar GCC/SDL -
@@ -110,14 +112,15 @@ More information about SDL can be found at http://www.libsdl.org.
 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 ;-). To use these games
-on Virtual Jaguar GCC/SDL you need to get ROM images. Besides the ROM images
-from commercial games you must also obtain the Atari Jaguar (CD) boot ROM
-which you must copy to the BIOS directory. For legal issues concerning ROM
-images please consult the DISCLAIMER at the beginning of this file.
-
-After obtaining the Atari Jaguar (CD) boot ROM and several ROMs you can now
-use Virtual Jaguar using the following command:
+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.
+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
+at the beginning of this file.
+
+After obtaining the Atari Jaguar boot ROM (and/or CD boot ROM) and several game
+ROMs you can now use Virtual Jaguar using the following command:
 
 ./vj [romfile] [-switches]
 
index 130eb0fb6928ef764b25a5e00bb1ec3d45339d67..20e71902deed3270705e0f7a484666b95edaef57 100644 (file)
@@ -22,4 +22,8 @@ void OPSetCurrentObject(uint64 object);
 //void OPWriteByte(uint32, uint8, uint32 who = UNKNOWN);
 //void OPWriteWord(uint32, uint16, uint32 who = UNKNOWN);
 
+// Exported variables
+
+extern uint8 objectp_running;
+
 #endif // __OBJECTP_H__
diff --git a/src/state.cpp b/src/state.cpp
new file mode 100644 (file)
index 0000000..7b6f3d4
--- /dev/null
@@ -0,0 +1,16 @@
+//
+// state.cpp: VJ machine state save/load support
+//
+// by James L. Hammons
+//
+
+#include "state.h"
+
+bool SaveState(void)
+{
+}
+
+bool LoadState(void)
+{
+}
+
diff --git a/src/state.h b/src/state.h
new file mode 100644 (file)
index 0000000..7ff7597
--- /dev/null
@@ -0,0 +1,28 @@
+//
+// state.h: Machine state save/load support
+//
+// by James L. Hammons
+//
+
+#ifndef __STATE_H__
+#define __STATE_H__
+
+//#include <stdio.h>
+
+//#ifdef __cplusplus
+//extern "C" {
+//#endif
+
+//int LogInit(const char *);
+//FILE * LogGet(void);
+//void LogDone(void);
+//void WriteLog(const char * text, ...);
+
+//#ifdef __cplusplus
+//}
+//#endif
+
+bool SaveState(void);
+bool LoadState(void);
+
+#endif // __STATE_H__
index 03523bfafbb28bab75849f5d03fd2002b16c5a69..5c236a01d13740caa99a0cf1f7c34bb5716857bf 100644 (file)
 //(It's easier to do it here, though...)
 //#define TOM_DEBUG
 
-extern uint8 objectp_running;
-
 uint8 tomRam8[0x4000];
 uint32 tomWidth, tomHeight;
 static uint32 tom_timer_prescaler;
@@ -939,6 +937,7 @@ void TOMExecScanline(uint16 scanline, bool render)
                if (inActiveDisplayArea)
                {
 //NOTE: The following doesn't put BORDER color on the sides... !!! FIX !!!
+#warning The following doesn't put BORDER color on the sides... !!! FIX !!!
                        if (vjs.renderType == RT_NORMAL)
                                scanline_render[TOMGetVideoMode()](TOMBackbuffer);
                        else//TV type render
@@ -959,21 +958,51 @@ void TOMExecScanline(uint16 scanline, bool render)
                                uint8 pwidth = ((GET16(tomRam8, VMODE) & PWIDTH) >> 9) + 1;
                                uint8 mode = ((GET16(tomRam8, VMODE) & MODE) >> 1);
                                bool varmod = GET16(tomRam8, VMODE) & VARMOD;
-//The video texture line buffer ranges from 0 to 1279, with its left edge starting at LEFT_VISIBLE_HC.
-//So, we need to start writing into the backbuffer at HDB1, using pwidth as our scaling factor. The
-//way it generates its image on a real TV!
+//The video texture line buffer ranges from 0 to 1279, with its left edge starting at
+//LEFT_VISIBLE_HC. So, we need to start writing into the backbuffer at HDB1, using pwidth
+//as our scaling factor. The way it generates its image on a real TV!
+
+//So, for example, if HDB1 is less than LEFT_VISIBLE_HC, then we have to figure out where
+//in the VTLB that we start writing pixels from the Jaguar line buffer (VTLB start=0,
+//JLB=something).
+#if 0
+//
+// 24 BPP mode rendering
+//
+void tom_render_24bpp_scanline(uint32 * backbuffer)
+{
+//CHANGED TO 32BPP RENDERING
+       uint16 width = tomWidth;
+       uint8 * current_line_buffer = (uint8 *)&tomRam8[0x1800];
+
+       //New stuff--restrict our drawing...
+       uint8 pwidth = ((GET16(tomRam8, VMODE) & PWIDTH) >> 9) + 1;
+       //NOTE: May have to check HDB2 as well!
+       int16 startPos = GET16(tomRam8, HDB1) - (vjs.hardwareTypeNTSC ? LEFT_VISIBLE_HC : LEFT_VISIBLE_HC_PAL); // Get start position in HC ticks
+       startPos /= pwidth;
+       if (startPos < 0)
+               current_line_buffer += 4 * -startPos;
+       else
+//This should likely be 4 instead of 2 (?--not sure)
+               backbuffer += 2 * startPos, width -= startPos;
 
-//So, for example, if HDB1 is less than LEFT_VISIBLE_HC, then we have to figure out where in the VTLB
-//that we start writing pixels from the Jaguar line buffer (VTLB start=0, JLB=something).
+       while (width)
+       {
+               uint32 g = *current_line_buffer++;
+               uint32 r = *current_line_buffer++;
+               current_line_buffer++;
+               uint32 b = *current_line_buffer++;
+               *backbuffer++ = 0xFF000000 | (b << 16) | (g << 8) | r;
+               width--;
+       }
+}
+#endif
 
                        }
                }
                else
                {
                        // If outside of VDB & VDE, then display the border color
-/*                     int16 * currentLineBuffer = TOMBackbuffer;
-                       uint8 g = tomRam8[BORD1], r = tomRam8[BORD1 + 1], b = tomRam8[BORD2 + 1];
-                       uint16 pixel = ((r & 0xF8) << 7) | ((g & 0xF8) << 2) | (b >> 3);//*/
                        uint32 * currentLineBuffer = TOMBackbuffer;
                        uint8 g = tomRam8[BORD1], r = tomRam8[BORD1 + 1], b = tomRam8[BORD2 + 1];
                        uint32 pixel = 0xFF000000 | (b << 16) | (g << 8) | r;
@@ -982,7 +1011,6 @@ void TOMExecScanline(uint16 scanline, bool render)
                                *currentLineBuffer++ = pixel;
                }
 
-//             TOMBackbuffer += GetSDLScreenPitch() / 2;       // Returns bytes, but we need words
                TOMBackbuffer += GetSDLScreenWidthInPixels();
        }
 }
diff --git a/vj.cfg b/vj.cfg
index cb4dc4cb2d6168cd1271834d7641439b556d9bc3..68deaf21161385b2b420613ae930f653365358ab 100644 (file)
--- a/vj.cfg
+++ b/vj.cfg
@@ -29,6 +29,10 @@ fullscreen = 0
 
 hardwareTypeNTSC = 1
 
+# Render type (experimental): 0 - regular/OpenGL, 1 - TV style
+
+renderType = 0
+
 # DSP options: 1 - use, 0 - don't use
 
 DSPEnabled = 0