Added 'tunes.bin' data to Chetiry scheme, and updated romtohex

to correctly generate the data from a bin file.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2453 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-04-29 19:43:28 +00:00
parent 68f739914f
commit 3ec9fe888d
10 changed files with 1881 additions and 22 deletions

View File

@ -30,6 +30,9 @@
#include "Cart4A50.hxx"
#include "Cart4K.hxx"
#include "CartAR.hxx"
#include "CartCM.hxx"
#include "CartCTY.hxx"
#include "CartCV.hxx"
#include "CartDPC.hxx"
#include "CartDPCPlus.hxx"
#include "CartE0.hxx"
@ -47,10 +50,8 @@
#include "CartFA2.hxx"
#include "CartFE.hxx"
#include "CartMC.hxx"
#include "CartCV.hxx"
#include "CartCM.hxx"
#include "CartUA.hxx"
#include "CartSB.hxx"
#include "CartUA.hxx"
#include "CartX07.hxx"
#include "MD5.hxx"
#include "Props.hxx"
@ -138,7 +139,9 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
}
// We should know the cart's type by now so let's create it
if(type == "2K")
if(type == "0840")
cartridge = new Cartridge0840(image, size, settings);
else if(type == "2K")
cartridge = new Cartridge2K(image, size, settings);
else if(type == "3E")
cartridge = new Cartridge3E(image, size, settings);
@ -150,6 +153,12 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
cartridge = new Cartridge4K(image, size, settings);
else if(type == "AR")
cartridge = new CartridgeAR(image, size, settings);
else if(type == "CM")
cartridge = new CartridgeCM(image, size, settings);
else if(type == "CTY")
cartridge = new CartridgeCTY(image, size, settings);
else if(type == "CV")
cartridge = new CartridgeCV(image, size, settings);
else if(type == "DPC")
cartridge = new CartridgeDPC(image, size, settings);
else if(type == "DPC+")
@ -162,6 +171,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
cartridge = new CartridgeEF(image, size, settings);
else if(type == "EFSC")
cartridge = new CartridgeEFSC(image, size, settings);
else if(type == "F0" || type == "MB")
cartridge = new CartridgeF0(image, size, settings);
else if(type == "F4")
cartridge = new CartridgeF4(image, size, settings);
else if(type == "F4SC")
@ -182,16 +193,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
cartridge = new CartridgeFE(image, size, settings);
else if(type == "MC")
cartridge = new CartridgeMC(image, size, settings);
else if(type == "F0" || type == "MB")
cartridge = new CartridgeF0(image, size, settings);
else if(type == "CV")
cartridge = new CartridgeCV(image, size, settings);
else if(type == "CM")
cartridge = new CartridgeCM(image, size, settings);
else if(type == "UA")
cartridge = new CartridgeUA(image, size, settings);
else if(type == "0840")
cartridge = new Cartridge0840(image, size, settings);
else if(type == "SB")
cartridge = new CartridgeSB(image, size, settings);
else if(type == "X07")
@ -398,6 +401,8 @@ string Cartridge::autodetectType(const uInt8* image, uInt32 size)
type = "3F";
else if(isProbablyDPCplus(image, size))
type = "DPC+";
else if(isProbablyCTY(image, size))
type = "CTY";
else
type = "F4";
}
@ -561,6 +566,12 @@ bool Cartridge::isProbably4A50(const uInt8* image, uInt32 size)
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Cartridge::isProbablyCTY(const uInt8* image, uInt32 size)
{
return false; // TODO - add autodetection
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Cartridge::isProbablyCV(const uInt8* image, uInt32 size)
{

View File

@ -291,6 +291,11 @@ class Cartridge : public Device
*/
static bool isProbably4A50(const uInt8* image, uInt32 size);
/**
Returns true if the image is probably a CTY bankswitching cartridge
*/
static bool isProbablyCTY(const uInt8* image, uInt32 size);
/**
Returns true if the image is probably a CV bankswitching cartridge
*/

View File

@ -625,7 +625,7 @@ uInt8 CartridgeAR::ourDummyROMCode[] = {
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 CartridgeAR::ourDefaultHeader[256] = {
const uInt8 CartridgeAR::ourDefaultHeader[256] = {
0xac, 0xfa, 0x0f, 0x18, 0x62, 0x00, 0x24, 0x02,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c,

View File

@ -219,7 +219,7 @@ class CartridgeAR : public Cartridge
// Default 256-byte header to use if one isn't included in the ROM
// This data comes from z26
static uInt8 ourDefaultHeader[256];
static const uInt8 ourDefaultHeader[256];
};
#endif

View File

@ -21,6 +21,7 @@
#include <cstring>
#include "System.hxx"
#include "CartCTYTunes.hxx"
#include "CartCTY.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -140,12 +140,15 @@ class CartridgeCTY : public Cartridge
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 16K ROM image of the cartridge
// The 32K ROM image of the cartridge
uInt8 myImage[32768];
// The 256 bytes of score-table RAM
uInt8 myScoreRAM[256];
uInt8* myScorePtr;
// The 8K Harmony RAM (used for tune data)
uInt8 myTuneRAM[8192];
};
#endif

1825
src/emucore/CartCTYTunes.hxx Normal file

File diff suppressed because it is too large Load Diff

View File

@ -141,7 +141,7 @@ class CartridgeF4 : public Cartridge
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 16K ROM image of the cartridge
// The 32K ROM image of the cartridge
uInt8 myImage[32768];
};

View File

@ -141,7 +141,7 @@ class CartridgeF4SC : public Cartridge
// Indicates which bank is currently active
uInt16 myCurrentBank;
// The 16K ROM image of the cartridge
// The 32K ROM image of the cartridge
uInt8 myImage[32768];
// The 128 bytes of RAM

View File

@ -8,12 +8,26 @@
#include <iomanip>
#include <fstream>
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int ac, char* av[])
{
if(ac < 2)
{
cout << av[0] << " <INPUT_FILE> [values per line = 8] [startpos = 0]" << endl
<< endl
<< " Read data from INPUT_FILE, and convert to unsigned char" << endl
<< " (in hex format), writing to standard output." << endl
<< endl;
return 0;
}
int values_per_line = ac >= 3 ? atoi(av[2]) : 8;
int offset = ac >= 4 ? atoi(av[3]) : 0;
ifstream in;
in.open("scrom.bin");
in.open(av[1]);
if(in.is_open())
{
in.seekg(0, ios::end);
@ -24,15 +38,15 @@ int main(int ac, char* av[])
in.read((char*)data, len);
in.close();
cout << "SIZE = " << (len - 2) << endl << " ";
cout << "SIZE = " << len << endl << " ";
// Skip first two bytes; they shouldn't be used
for(int t = 2; t < len; ++t)
// Skip first 'offset' bytes; they shouldn't be used
for(int t = offset; t < len; ++t)
{
cout << "0x" << setw(2) << setfill('0') << hex << (int)data[t];
if(t < len - 1)
cout << ", ";
if(((t-2) % 8) == 7)
if(((t-offset) % values_per_line) == (values_per_line-1))
cout << endl << " ";
}
cout << endl;