diff --git a/stella/src/common/FrameBufferGL.hxx b/stella/src/common/FrameBufferGL.hxx index b66d37b02..5e287e151 100644 --- a/stella/src/common/FrameBufferGL.hxx +++ b/stella/src/common/FrameBufferGL.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferGL.hxx,v 1.54 2008-06-19 12:01:30 stephena Exp $ +// $Id: FrameBufferGL.hxx,v 1.55 2008-08-01 12:15:57 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_GL_HXX @@ -35,7 +35,7 @@ class GUI::Font; This class implements an SDL OpenGL framebuffer. @author Stephen Anthony - @version $Id: FrameBufferGL.hxx,v 1.54 2008-06-19 12:01:30 stephena Exp $ + @version $Id: FrameBufferGL.hxx,v 1.55 2008-08-01 12:15:57 stephena Exp $ */ class FrameBufferGL : public FrameBuffer { @@ -210,7 +210,7 @@ class FrameBufferGL : public FrameBuffer A surface suitable for software rendering mode. @author Stephen Anthony - @version $Id: FrameBufferGL.hxx,v 1.54 2008-06-19 12:01:30 stephena Exp $ + @version $Id: FrameBufferGL.hxx,v 1.55 2008-08-01 12:15:57 stephena Exp $ */ class FBSurfaceGL : public FBSurface { @@ -227,6 +227,8 @@ class FBSurfaceGL : public FBSurface void addDirtyRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h); void getPos(uInt32& x, uInt32& y) const; void setPos(uInt32 x, uInt32 y); + uInt32 getWidth() const { return myWidth; } + uInt32 getHeight() const { return myHeight; } void setWidth(uInt32 w); void setHeight(uInt32 h); void translateCoords(Int32& x, Int32& y) const; diff --git a/stella/src/common/FrameBufferSoft.hxx b/stella/src/common/FrameBufferSoft.hxx index c40be716a..05ab91177 100644 --- a/stella/src/common/FrameBufferSoft.hxx +++ b/stella/src/common/FrameBufferSoft.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferSoft.hxx,v 1.52 2008-06-19 12:01:30 stephena Exp $ +// $Id: FrameBufferSoft.hxx,v 1.53 2008-08-01 12:15:57 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_SOFT_HXX @@ -33,7 +33,7 @@ class RectList; This class implements an SDL software framebuffer. @author Stephen Anthony - @version $Id: FrameBufferSoft.hxx,v 1.52 2008-06-19 12:01:30 stephena Exp $ + @version $Id: FrameBufferSoft.hxx,v 1.53 2008-08-01 12:15:57 stephena Exp $ */ class FrameBufferSoft : public FrameBuffer { @@ -162,7 +162,7 @@ class FrameBufferSoft : public FrameBuffer A surface suitable for software rendering mode. @author Stephen Anthony - @version $Id: FrameBufferSoft.hxx,v 1.52 2008-06-19 12:01:30 stephena Exp $ + @version $Id: FrameBufferSoft.hxx,v 1.53 2008-08-01 12:15:57 stephena Exp $ */ class FBSurfaceSoft : public FBSurface { @@ -179,6 +179,8 @@ class FBSurfaceSoft : public FBSurface void addDirtyRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h); void getPos(uInt32& x, uInt32& y) const; void setPos(uInt32 x, uInt32 y); + uInt32 getWidth() const { return myWidth; } + uInt32 getHeight() const { return myHeight; } void setWidth(uInt32 w); void setHeight(uInt32 h); void translateCoords(Int32& x, Int32& y) const; diff --git a/stella/src/emucore/Cart3E.cxx b/stella/src/emucore/Cart3E.cxx index e56ba8c53..23ef2e1dc 100644 --- a/stella/src/emucore/Cart3E.cxx +++ b/stella/src/emucore/Cart3E.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart3E.cxx,v 1.15 2008-03-28 23:29:13 stephena Exp $ +// $Id: Cart3E.cxx,v 1.16 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -31,17 +31,7 @@ Cartridge3E::Cartridge3E(const uInt8* image, uInt32 size) myImage = new uInt8[mySize]; // Copy the ROM image into my buffer - for(uInt32 addr = 0; addr < mySize; ++addr) - { - myImage[addr] = image[addr]; - } - - // Initialize RAM with random values - class Random random; - for(uInt32 i = 0; i < 32768; ++i) - { - myRam[i] = random.next(); - } + memcpy(myImage, image, mySize); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -53,6 +43,11 @@ Cartridge3E::~Cartridge3E() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Cartridge3E::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 32768; ++i) + myRam[i] = random.next(); + // We'll map bank 0 into the first segment upon reset bank(0); } diff --git a/stella/src/emucore/Cart4A50.cxx b/stella/src/emucore/Cart4A50.cxx index 13f8ef3ca..87883e7f0 100644 --- a/stella/src/emucore/Cart4A50.cxx +++ b/stella/src/emucore/Cart4A50.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Cart4A50.cxx,v 1.14 2008-03-28 23:29:13 stephena Exp $ +// $Id: Cart4A50.cxx,v 1.15 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -35,11 +35,6 @@ Cartridge4A50::Cartridge4A50(const uInt8* image, uInt32 size) else size = 131072; for(uInt32 slice = 0; slice < 131072 / size; ++slice) memcpy(myImage + (slice*size), image, size); - - // Initialize RAM with random values - class Random random; - for(uInt32 i = 0; i < 32768; ++i) - myRAM[i] = random.next(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -50,6 +45,11 @@ Cartridge4A50::~Cartridge4A50() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Cartridge4A50::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 32768; ++i) + myRAM[i] = random.next(); + mySliceLow = mySliceMiddle = mySliceHigh = 0; myIsRomLow = myIsRomMiddle = myIsRomHigh = true; diff --git a/stella/src/emucore/CartAR.cxx b/stella/src/emucore/CartAR.cxx index 3f4b985e3..0127d531e 100644 --- a/stella/src/emucore/CartAR.cxx +++ b/stella/src/emucore/CartAR.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartAR.cxx,v 1.22 2008-05-30 12:06:17 stephena Exp $ +// $Id: CartAR.cxx,v 1.23 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -28,20 +28,11 @@ CartridgeAR::CartridgeAR(const uInt8* image, uInt32 size, bool fastbios) : my6502(0) { - uInt32 i; - // Create a load image buffer and copy the given image myLoadImages = new uInt8[size]; myNumberOfLoadImages = size / 8448; memcpy(myLoadImages, image, size); - // Initialize RAM with random values - class Random random; - for(i = 0; i < 6 * 1024; ++i) - { - myImage[i] = random.next(); - } - // Initialize SC BIOS ROM initializeROM(fastbios); } @@ -55,6 +46,11 @@ CartridgeAR::~CartridgeAR() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeAR::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 6 * 1024; ++i) + myImage[i] = random.next(); + myPower = true; myPowerRomCycle = mySystem->cycles(); myWriteEnabled = false; diff --git a/stella/src/emucore/CartCV.cxx b/stella/src/emucore/CartCV.cxx index 7bcb62921..e272870db 100644 --- a/stella/src/emucore/CartCV.cxx +++ b/stella/src/emucore/CartCV.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCV.cxx,v 1.16 2008-02-06 13:45:21 stephena Exp $ +// $Id: CartCV.cxx,v 1.17 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -24,51 +24,45 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeCV::CartridgeCV(const uInt8* image, uInt32 size) + : myROM(0), + mySize(size) { - uInt32 addr; - if(size == 2048) - { - // Copy the ROM image into my buffer - for(uInt32 addr = 0; addr < 2048; ++addr) - { - myImage[addr] = image[addr]; - } + myROM = new uInt8[mySize]; + memcpy(myROM, image, mySize); - // Initialize RAM with random values - class Random random; - for(uInt32 i = 0; i < 1024; ++i) - { - myRAM[i] = random.next(); - } - } - else if(size == 4096) - { - // The game has something saved in the RAM - // Usefull for MagiCard program listings - - // Copy the ROM image into my buffer - for(addr = 0; addr < 2048; ++addr) - { - myImage[addr] = image[addr + 2048]; - } - - // Copy the RAM image into my buffer - for(addr = 0; addr < 1024; ++addr) - { - myRAM[addr] = image[addr]; - } - - } + reset(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeCV::~CartridgeCV() { + delete[] myROM; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeCV::reset() { + if(mySize == 2048) + { + // Copy the ROM data into my buffer + memcpy(myImage, myROM, 2048); + + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 1024; ++i) + myRAM[i] = random.next(); + } + else if(mySize == 4096) + { + // The game has something saved in the RAM + // Useful for MagiCard program listings + + // Copy the ROM data into my buffer + memcpy(myImage, myROM + 2048, 2048); + + // Copy the RAM image into my buffer + memcpy(myRAM, myROM, 1024); + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/emucore/CartCV.hxx b/stella/src/emucore/CartCV.hxx index 7d5cf824d..1977572cf 100644 --- a/stella/src/emucore/CartCV.hxx +++ b/stella/src/emucore/CartCV.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartCV.hxx,v 1.11 2008-02-06 13:45:21 stephena Exp $ +// $Id: CartCV.hxx,v 1.12 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #ifndef CARTRIDGECV_HXX @@ -32,7 +32,7 @@ class System; $F800-$FFFF ROM @author Eckhard Stolberg - @version $Id: CartCV.hxx,v 1.11 2008-02-06 13:45:21 stephena Exp $ + @version $Id: CartCV.hxx,v 1.12 2008-08-01 12:15:58 stephena Exp $ */ class CartridgeCV : public Cartridge { @@ -139,6 +139,12 @@ class CartridgeCV : public Cartridge virtual void poke(uInt16 address, uInt8 value); private: + // Pointer to the initial cart data + uInt8* myROM; + + // Initial size of the cart data + uInt32 mySize; + // The 2k ROM image for the cartridge uInt8 myImage[2048]; diff --git a/stella/src/emucore/CartE7.cxx b/stella/src/emucore/CartE7.cxx index 99e010f7c..6b29300f2 100644 --- a/stella/src/emucore/CartE7.cxx +++ b/stella/src/emucore/CartE7.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartE7.cxx,v 1.19 2008-03-28 23:29:13 stephena Exp $ +// $Id: CartE7.cxx,v 1.20 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -26,17 +26,7 @@ CartridgeE7::CartridgeE7(const uInt8* image) { // Copy the ROM image into my buffer - for(uInt32 addr = 0; addr < 16384; ++addr) - { - myImage[addr] = image[addr]; - } - - // Initialize RAM with random values - class Random random; - for(uInt32 i = 0; i < 2048; ++i) - { - myRAM[i] = random.next(); - } + memcpy(myImage, image, 16384); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -47,6 +37,11 @@ CartridgeE7::~CartridgeE7() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeE7::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 2048; ++i) + myRAM[i] = random.next(); + // Install some default banks for the RAM and first segment bankRAM(0); bank(0); diff --git a/stella/src/emucore/CartF4SC.cxx b/stella/src/emucore/CartF4SC.cxx index cb8bd1964..38f138369 100644 --- a/stella/src/emucore/CartF4SC.cxx +++ b/stella/src/emucore/CartF4SC.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF4SC.cxx,v 1.17 2008-03-28 23:29:13 stephena Exp $ +// $Id: CartF4SC.cxx,v 1.18 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -26,17 +26,7 @@ CartridgeF4SC::CartridgeF4SC(const uInt8* image) { // Copy the ROM image into my buffer - for(uInt32 addr = 0; addr < 32768; ++addr) - { - myImage[addr] = image[addr]; - } - - // Initialize RAM with random values - class Random random; - for(uInt32 i = 0; i < 128; ++i) - { - myRAM[i] = random.next(); - } + memcpy(myImage, image, 32768); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -47,6 +37,11 @@ CartridgeF4SC::~CartridgeF4SC() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeF4SC::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 128; ++i) + myRAM[i] = random.next(); + // Upon reset we switch to bank 0 bank(0); } diff --git a/stella/src/emucore/CartF6SC.cxx b/stella/src/emucore/CartF6SC.cxx index fcf0155c9..390cb556a 100644 --- a/stella/src/emucore/CartF6SC.cxx +++ b/stella/src/emucore/CartF6SC.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF6SC.cxx,v 1.16 2008-03-28 23:29:13 stephena Exp $ +// $Id: CartF6SC.cxx,v 1.17 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -26,17 +26,7 @@ CartridgeF6SC::CartridgeF6SC(const uInt8* image) { // Copy the ROM image into my buffer - for(uInt32 addr = 0; addr < 16384; ++addr) - { - myImage[addr] = image[addr]; - } - - // Initialize RAM with random values - class Random random; - for(uInt32 i = 0; i < 128; ++i) - { - myRAM[i] = random.next(); - } + memcpy(myImage, image, 16384); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -47,6 +37,11 @@ CartridgeF6SC::~CartridgeF6SC() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeF6SC::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 128; ++i) + myRAM[i] = random.next(); + // Upon reset we switch to bank 0 bank(0); } diff --git a/stella/src/emucore/CartF8SC.cxx b/stella/src/emucore/CartF8SC.cxx index 643f73e68..56964569a 100644 --- a/stella/src/emucore/CartF8SC.cxx +++ b/stella/src/emucore/CartF8SC.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartF8SC.cxx,v 1.16 2008-03-28 23:29:13 stephena Exp $ +// $Id: CartF8SC.cxx,v 1.17 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -26,17 +26,7 @@ CartridgeF8SC::CartridgeF8SC(const uInt8* image) { // Copy the ROM image into my buffer - for(uInt32 addr = 0; addr < 8192; ++addr) - { - myImage[addr] = image[addr]; - } - - // Initialize RAM with random values - class Random random; - for(uInt32 i = 0; i < 128; ++i) - { - myRAM[i] = random.next(); - } + memcpy(myImage, image, 8192); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -47,6 +37,11 @@ CartridgeF8SC::~CartridgeF8SC() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeF8SC::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 128; ++i) + myRAM[i] = random.next(); + // Upon reset we switch to bank 1 bank(1); } diff --git a/stella/src/emucore/CartFASC.cxx b/stella/src/emucore/CartFASC.cxx index 713d4fc8b..413c86764 100644 --- a/stella/src/emucore/CartFASC.cxx +++ b/stella/src/emucore/CartFASC.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartFASC.cxx,v 1.16 2008-03-28 23:29:13 stephena Exp $ +// $Id: CartFASC.cxx,v 1.17 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -26,17 +26,7 @@ CartridgeFASC::CartridgeFASC(const uInt8* image) { // Copy the ROM image into my buffer - for(uInt32 addr = 0; addr < 12288; ++addr) - { - myImage[addr] = image[addr]; - } - - // Initialize RAM with random values - class Random random; - for(uInt32 i = 0; i < 256; ++i) - { - myRAM[i] = random.next(); - } + memcpy(myImage, image, 12288); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -47,6 +37,11 @@ CartridgeFASC::~CartridgeFASC() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeFASC::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 256; ++i) + myRAM[i] = random.next(); + // Upon reset we switch to bank 2 bank(2); } diff --git a/stella/src/emucore/CartMC.cxx b/stella/src/emucore/CartMC.cxx index a7b969d71..f7ecf5dfd 100644 --- a/stella/src/emucore/CartMC.cxx +++ b/stella/src/emucore/CartMC.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartMC.cxx,v 1.14 2008-02-06 13:45:21 stephena Exp $ +// $Id: CartMC.cxx,v 1.15 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #include @@ -26,47 +26,28 @@ CartridgeMC::CartridgeMC(const uInt8* image, uInt32 size) : mySlot3Locked(false) { - uInt32 i; - // Make sure size is reasonable - assert(size <= 128 * 1024); - - // Allocate array for the cart's RAM - myRAM = new uInt8[32 * 1024]; - - // Initialize RAM with random values - class Random random; - for(i = 0; i < 32 * 1024; ++i) - { - myRAM[i] = random.next(); - } - - // Allocate array for the ROM image - myImage = new uInt8[128 * 1024]; + assert(size <= 131072); // Set the contents of the entire ROM to 0 - for(i = 0; i < 128 * 1024; ++i) - { - myImage[i] = 0; - } + memset(myImage, 0, 131072); // Copy the ROM image to the end of the ROM buffer - for(i = 0; i < size; ++i) - { - myImage[128 * 1024 - size + i] = image[i]; - } + memcpy(myImage + 131072 - size, image, size); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeMC::~CartridgeMC() { - delete[] myRAM; - delete[] myImage; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeMC::reset() { + // Initialize RAM with random values + class Random random; + for(uInt32 i = 0; i < 32768; ++i) + myRAM[i] = random.next(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/emucore/CartMC.hxx b/stella/src/emucore/CartMC.hxx index 029ed532e..c4d71b9e8 100644 --- a/stella/src/emucore/CartMC.hxx +++ b/stella/src/emucore/CartMC.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CartMC.hxx,v 1.10 2008-02-06 13:45:21 stephena Exp $ +// $Id: CartMC.hxx,v 1.11 2008-08-01 12:15:58 stephena Exp $ //============================================================================ #ifndef CARTRIDGEMC_HXX @@ -133,7 +133,7 @@ class System; @author Bradford W. Mott - @version $Id: CartMC.hxx,v 1.10 2008-02-06 13:45:21 stephena Exp $ + @version $Id: CartMC.hxx,v 1.11 2008-08-01 12:15:58 stephena Exp $ */ class CartridgeMC : public Cartridge { @@ -243,17 +243,17 @@ class CartridgeMC : public Cartridge virtual void poke(uInt16 address, uInt8 value); private: + // The 128K ROM image for the cartridge + uInt8 myImage[131072]; + + // The 32K of RAM for the cartridge + uInt8 myRAM[32768]; + // Indicates which block is currently active for the four segments uInt8 myCurrentBlock[4]; // Indicates if slot 3 is locked to block $FF or not bool mySlot3Locked; - - // Pointer to the 32K bytes of RAM for the cartridge - uInt8* myRAM; - - // Pointer to the 128K bytes of ROM for the cartridge - uInt8* myImage; }; #endif diff --git a/stella/src/emucore/DefProps.hxx b/stella/src/emucore/DefProps.hxx index 174ebe6e4..78f121b30 100644 --- a/stella/src/emucore/DefProps.hxx +++ b/stella/src/emucore/DefProps.hxx @@ -2957,7 +2957,7 @@ static const char* DefProps[DEF_PROPS_SIZE][21] = { { "fc6052438f339aea373bbc999433388a", "Atari, David Crane", "CX2653P", "Slot Machine (1979) (Atari) (PAL)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "fc668a2251dd79cbd903d4fa0e558f96", "", "", "Thrust (V1.1) (2000) (TJ) [a1]", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "fc92d74f073a44bc6e46a3b3fa8256a2", "", "", "Megademo (19xx) (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, - { "fc9c1652fe3a2cade6188f4d3692481f", "", "", "Andrew Davies early notBoulderDash demo (NTSC)", "", "", "", "", "", "", "", "", "", "", "", "NTSC", "", "", "YES", "", "" }, + { "fc9c1652fe3a2cade6188f4d3692481f", "", "", "Andrew Davies early notBoulderDash demo (NTSC)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "" }, { "fca4a5be1251927027f2c24774a02160", "Activision, John Van Ryzin", "AZ-036-04", "H.E.R.O. (1984) (Activision)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, { "fcea12625c071ddc49f4e409f4038c60", "Fabrizio Zavagli", "", "Balls! (16-09-2002) (Fabrizio Zavagli)", "", "Homebrew", "", "", "", "", "", "", "", "", "", "", "", "", "YES", "", "" }, { "fcf8e306f6615f74feba5cb25550038c", "", "", "Blue Dot Demo (PD)", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }, diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index c1b9a6b07..7358af6b1 100644 --- a/stella/src/emucore/FrameBuffer.cxx +++ b/stella/src/emucore/FrameBuffer.cxx @@ -1,4 +1,4 @@ -//============================================================================ + // // SSSS tt lll lll // SS SS tt ll ll @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.cxx,v 1.137 2008-07-25 12:41:41 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.138 2008-08-01 12:15:59 stephena Exp $ //============================================================================ #include @@ -629,6 +629,8 @@ const StringMap& FrameBuffer::supportedTIAFilters(const string& type) { uInt32 max_zoom = maxWindowSizeForScreen(320, 210, myOSystem->desktopWidth(), myOSystem->desktopHeight()); + uInt8 mask = (type == "soft" ? 0x1 : 0x2); + #ifdef SMALL_SCREEN uInt32 firstmode = 0; #else @@ -639,7 +641,7 @@ const StringMap& FrameBuffer::supportedTIAFilters(const string& type) { // For now, just include all filters // This will change once OpenGL-only filters are added - if(ourGraphicsModes[i].zoom <= max_zoom) + if((ourGraphicsModes[i].avail & mask) && ourGraphicsModes[i].zoom <= max_zoom) { myTIAFilters.push_back(ourGraphicsModes[i].description, ourGraphicsModes[i].name); diff --git a/stella/src/emucore/FrameBuffer.hxx b/stella/src/emucore/FrameBuffer.hxx index 2c5115cae..e33f1b53d 100644 --- a/stella/src/emucore/FrameBuffer.hxx +++ b/stella/src/emucore/FrameBuffer.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.hxx,v 1.102 2008-07-25 12:41:41 stephena Exp $ +// $Id: FrameBuffer.hxx,v 1.103 2008-08-01 12:16:00 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_HXX @@ -90,7 +90,7 @@ enum { turn drawn here as well. @author Stephen Anthony - @version $Id: FrameBuffer.hxx,v 1.102 2008-07-25 12:41:41 stephena Exp $ + @version $Id: FrameBuffer.hxx,v 1.103 2008-08-01 12:16:00 stephena Exp $ */ class FrameBuffer { @@ -511,7 +511,7 @@ class FrameBuffer FrameBuffer type. @author Stephen Anthony - @version $Id: FrameBuffer.hxx,v 1.102 2008-07-25 12:41:41 stephena Exp $ + @version $Id: FrameBuffer.hxx,v 1.103 2008-08-01 12:16:00 stephena Exp $ */ // Text alignment modes for drawString() enum TextAlignment { @@ -615,6 +615,12 @@ class FBSurface */ virtual void setPos(uInt32 x, uInt32 y) = 0; + /** + This method answers the current dimensions of the surface. + */ + virtual uInt32 getWidth() const = 0; + virtual uInt32 getHeight() const = 0; + /** This method sets the width of the drawable area of the surface. */ diff --git a/stella/src/emucore/M6532.cxx b/stella/src/emucore/M6532.cxx index db6c75434..1ef359088 100644 --- a/stella/src/emucore/M6532.cxx +++ b/stella/src/emucore/M6532.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: M6532.cxx,v 1.27 2008-05-22 17:54:54 stephena Exp $ +// $Id: M6532.cxx,v 1.28 2008-08-01 12:16:00 stephena Exp $ //============================================================================ #include @@ -30,15 +30,6 @@ M6532::M6532(const Console& console) : myConsole(console) { - // Randomize the 128 bytes of memory - class Random random; - - for(uInt32 t = 0; t < 128; ++t) - { - myRAM[t] = random.next(); - } - - // Initialize other data members reset(); } @@ -52,6 +43,10 @@ void M6532::reset() { class Random random; + // Randomize the 128 bytes of memory + for(uInt32 t = 0; t < 128; ++t) + myRAM[t] = random.next(); + // The timer absolutely cannot be initialized to zero; some games will // loop or hang (notably Solaris and H.E.R.O.) myTimer = (0xff - (random.next() % 0xfe)) << 10; diff --git a/stella/src/emucore/stella.pro b/stella/src/emucore/stella.pro index 71145ee75..7f2eb0ba6 100644 --- a/stella/src/emucore/stella.pro +++ b/stella/src/emucore/stella.pro @@ -17617,7 +17617,6 @@ "Cartridge.MD5" "fc9c1652fe3a2cade6188f4d3692481f" "Cartridge.Name" "Andrew Davies early notBoulderDash demo (NTSC)" -"Display.Format" "NTSC" "Display.Phosphor" "YES" "" diff --git a/stella/src/gui/BrowserDialog.cxx b/stella/src/gui/BrowserDialog.cxx index ddf27510d..cc153d9e3 100644 --- a/stella/src/gui/BrowserDialog.cxx +++ b/stella/src/gui/BrowserDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: BrowserDialog.cxx,v 1.31 2008-06-13 13:14:51 stephena Exp $ +// $Id: BrowserDialog.cxx,v 1.32 2008-08-01 12:16:00 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -180,9 +180,6 @@ void BrowserDialog::updateListing() // Only hilite the 'up' button if there's a parent directory _goUpButton->setEnabled(_node.hasParent()); - - // Finally, redraw - setDirty(); draw(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/Dialog.cxx b/stella/src/gui/Dialog.cxx index 421d3bda7..39bb5c1bf 100644 --- a/stella/src/gui/Dialog.cxx +++ b/stella/src/gui/Dialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Dialog.cxx,v 1.63 2008-06-19 19:15:44 stephena Exp $ +// $Id: Dialog.cxx,v 1.64 2008-08-01 12:16:00 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -79,6 +79,16 @@ void Dialog::open() // Instead, dirty rectangle updates should be performed if(_surface == NULL) _surface = instance().frameBuffer().createSurface(_w, _h, _isBase); + else if((uInt32)_w > _surface->getWidth() || (uInt32)_h > _surface->getHeight()) + { + delete _surface; + _surface = instance().frameBuffer().createSurface(_w, _h, _isBase); + } + else + { + _surface->setWidth(_w); + _surface->setHeight(_h); + } center(); diff --git a/stella/src/gui/FileSnapDialog.cxx b/stella/src/gui/FileSnapDialog.cxx index 383fdecc7..aa2dca732 100644 --- a/stella/src/gui/FileSnapDialog.cxx +++ b/stella/src/gui/FileSnapDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FileSnapDialog.cxx,v 1.19 2008-06-13 13:14:51 stephena Exp $ +// $Id: FileSnapDialog.cxx,v 1.20 2008-08-01 12:16:00 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -137,7 +137,8 @@ FileSnapDialog::FileSnapDialog( } // Create file browser dialog - myBrowser = new BrowserDialog(this, font, 60, 20, 200, 200); + // FIXME - let dialog determine its own size + myBrowser = new BrowserDialog(this, font, 0, 0, 300, 300); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -199,6 +200,7 @@ void FileSnapDialog::setDefaults() void FileSnapDialog::openBrowser(const string& title, const string& startpath, FilesystemNode::ListMode mode, int cmd) { +cerr << " ==> add browser: " << title << " -> " << startpath << endl; parent().addDialog(myBrowser); myBrowser->setTitle(title); diff --git a/stella/src/gui/GameInfoDialog.cxx b/stella/src/gui/GameInfoDialog.cxx index 8a2e9de5d..55803f7fc 100644 --- a/stella/src/gui/GameInfoDialog.cxx +++ b/stella/src/gui/GameInfoDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: GameInfoDialog.cxx,v 1.58 2008-07-25 12:41:41 stephena Exp $ +// $Id: GameInfoDialog.cxx,v 1.59 2008-08-01 12:16:00 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -452,7 +452,8 @@ void GameInfoDialog::saveConfig() // Controller properties myGameProperties.set(Controller_Left, myP0Controller->getSelectedTag()); myGameProperties.set(Controller_Right, myP1Controller->getSelectedTag()); - myGameProperties.set(Console_SwapPorts, myLeftPort->getSelectedTag()); + myGameProperties.set(Console_SwapPorts, + myLeftPort->getSelectedTag() == "L" ? "NO" : "YES"); myGameProperties.set(Controller_SwapPaddles, mySwapPaddles->getSelectedTag()); // Display properties diff --git a/stella/src/gui/OptionsDialog.cxx b/stella/src/gui/OptionsDialog.cxx index 149bca073..d29e0e2b6 100644 --- a/stella/src/gui/OptionsDialog.cxx +++ b/stella/src/gui/OptionsDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OptionsDialog.cxx,v 1.70 2008-06-13 13:14:51 stephena Exp $ +// $Id: OptionsDialog.cxx,v 1.71 2008-08-01 12:16:00 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -48,7 +48,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent, GuiObject* boss, bool global) - : Dialog(osystem, parent, 0, 0, 1, 1), + : Dialog(osystem, parent, 0, 0, 0, 0), myVideoDialog(NULL), myAudioDialog(NULL), myInputDialog(NULL), diff --git a/stella/src/gui/RomAuditDialog.cxx b/stella/src/gui/RomAuditDialog.cxx index 27ce05d40..3ea51f21b 100644 --- a/stella/src/gui/RomAuditDialog.cxx +++ b/stella/src/gui/RomAuditDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: RomAuditDialog.cxx,v 1.4 2008-06-13 13:14:51 stephena Exp $ +// $Id: RomAuditDialog.cxx,v 1.5 2008-08-01 12:16:00 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -99,7 +99,7 @@ RomAuditDialog::RomAuditDialog(OSystem* osystem, DialogContainer* parent, addToFocusList(wid); // Create file browser dialog - myBrowser = new BrowserDialog(this, font, 60, 20, 200, 200); + myBrowser = new BrowserDialog(this, font, 0, 0, 200, 200); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -