mirror of https://github.com/stella-emu/stella.git
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:
parent
68f739914f
commit
3ec9fe888d
|
@ -30,6 +30,9 @@
|
||||||
#include "Cart4A50.hxx"
|
#include "Cart4A50.hxx"
|
||||||
#include "Cart4K.hxx"
|
#include "Cart4K.hxx"
|
||||||
#include "CartAR.hxx"
|
#include "CartAR.hxx"
|
||||||
|
#include "CartCM.hxx"
|
||||||
|
#include "CartCTY.hxx"
|
||||||
|
#include "CartCV.hxx"
|
||||||
#include "CartDPC.hxx"
|
#include "CartDPC.hxx"
|
||||||
#include "CartDPCPlus.hxx"
|
#include "CartDPCPlus.hxx"
|
||||||
#include "CartE0.hxx"
|
#include "CartE0.hxx"
|
||||||
|
@ -47,10 +50,8 @@
|
||||||
#include "CartFA2.hxx"
|
#include "CartFA2.hxx"
|
||||||
#include "CartFE.hxx"
|
#include "CartFE.hxx"
|
||||||
#include "CartMC.hxx"
|
#include "CartMC.hxx"
|
||||||
#include "CartCV.hxx"
|
|
||||||
#include "CartCM.hxx"
|
|
||||||
#include "CartUA.hxx"
|
|
||||||
#include "CartSB.hxx"
|
#include "CartSB.hxx"
|
||||||
|
#include "CartUA.hxx"
|
||||||
#include "CartX07.hxx"
|
#include "CartX07.hxx"
|
||||||
#include "MD5.hxx"
|
#include "MD5.hxx"
|
||||||
#include "Props.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
|
// 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);
|
cartridge = new Cartridge2K(image, size, settings);
|
||||||
else if(type == "3E")
|
else if(type == "3E")
|
||||||
cartridge = new Cartridge3E(image, size, settings);
|
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);
|
cartridge = new Cartridge4K(image, size, settings);
|
||||||
else if(type == "AR")
|
else if(type == "AR")
|
||||||
cartridge = new CartridgeAR(image, size, settings);
|
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")
|
else if(type == "DPC")
|
||||||
cartridge = new CartridgeDPC(image, size, settings);
|
cartridge = new CartridgeDPC(image, size, settings);
|
||||||
else if(type == "DPC+")
|
else if(type == "DPC+")
|
||||||
|
@ -162,6 +171,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
|
||||||
cartridge = new CartridgeEF(image, size, settings);
|
cartridge = new CartridgeEF(image, size, settings);
|
||||||
else if(type == "EFSC")
|
else if(type == "EFSC")
|
||||||
cartridge = new CartridgeEFSC(image, size, settings);
|
cartridge = new CartridgeEFSC(image, size, settings);
|
||||||
|
else if(type == "F0" || type == "MB")
|
||||||
|
cartridge = new CartridgeF0(image, size, settings);
|
||||||
else if(type == "F4")
|
else if(type == "F4")
|
||||||
cartridge = new CartridgeF4(image, size, settings);
|
cartridge = new CartridgeF4(image, size, settings);
|
||||||
else if(type == "F4SC")
|
else if(type == "F4SC")
|
||||||
|
@ -182,16 +193,8 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
|
||||||
cartridge = new CartridgeFE(image, size, settings);
|
cartridge = new CartridgeFE(image, size, settings);
|
||||||
else if(type == "MC")
|
else if(type == "MC")
|
||||||
cartridge = new CartridgeMC(image, size, settings);
|
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")
|
else if(type == "UA")
|
||||||
cartridge = new CartridgeUA(image, size, settings);
|
cartridge = new CartridgeUA(image, size, settings);
|
||||||
else if(type == "0840")
|
|
||||||
cartridge = new Cartridge0840(image, size, settings);
|
|
||||||
else if(type == "SB")
|
else if(type == "SB")
|
||||||
cartridge = new CartridgeSB(image, size, settings);
|
cartridge = new CartridgeSB(image, size, settings);
|
||||||
else if(type == "X07")
|
else if(type == "X07")
|
||||||
|
@ -398,6 +401,8 @@ string Cartridge::autodetectType(const uInt8* image, uInt32 size)
|
||||||
type = "3F";
|
type = "3F";
|
||||||
else if(isProbablyDPCplus(image, size))
|
else if(isProbablyDPCplus(image, size))
|
||||||
type = "DPC+";
|
type = "DPC+";
|
||||||
|
else if(isProbablyCTY(image, size))
|
||||||
|
type = "CTY";
|
||||||
else
|
else
|
||||||
type = "F4";
|
type = "F4";
|
||||||
}
|
}
|
||||||
|
@ -561,6 +566,12 @@ bool Cartridge::isProbably4A50(const uInt8* image, uInt32 size)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
bool Cartridge::isProbablyCTY(const uInt8* image, uInt32 size)
|
||||||
|
{
|
||||||
|
return false; // TODO - add autodetection
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool Cartridge::isProbablyCV(const uInt8* image, uInt32 size)
|
bool Cartridge::isProbablyCV(const uInt8* image, uInt32 size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -291,6 +291,11 @@ class Cartridge : public Device
|
||||||
*/
|
*/
|
||||||
static bool isProbably4A50(const uInt8* image, uInt32 size);
|
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
|
Returns true if the image is probably a CV bankswitching cartridge
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -625,7 +625,7 @@ uInt8 CartridgeAR::ourDummyROMCode[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
uInt8 CartridgeAR::ourDefaultHeader[256] = {
|
const uInt8 CartridgeAR::ourDefaultHeader[256] = {
|
||||||
0xac, 0xfa, 0x0f, 0x18, 0x62, 0x00, 0x24, 0x02,
|
0xac, 0xfa, 0x0f, 0x18, 0x62, 0x00, 0x24, 0x02,
|
||||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||||
0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c,
|
0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c,
|
||||||
|
|
|
@ -219,7 +219,7 @@ class CartridgeAR : public Cartridge
|
||||||
|
|
||||||
// Default 256-byte header to use if one isn't included in the ROM
|
// Default 256-byte header to use if one isn't included in the ROM
|
||||||
// This data comes from z26
|
// This data comes from z26
|
||||||
static uInt8 ourDefaultHeader[256];
|
static const uInt8 ourDefaultHeader[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "System.hxx"
|
#include "System.hxx"
|
||||||
|
#include "CartCTYTunes.hxx"
|
||||||
#include "CartCTY.hxx"
|
#include "CartCTY.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -140,12 +140,15 @@ class CartridgeCTY : public Cartridge
|
||||||
// Indicates which bank is currently active
|
// Indicates which bank is currently active
|
||||||
uInt16 myCurrentBank;
|
uInt16 myCurrentBank;
|
||||||
|
|
||||||
// The 16K ROM image of the cartridge
|
// The 32K ROM image of the cartridge
|
||||||
uInt8 myImage[32768];
|
uInt8 myImage[32768];
|
||||||
|
|
||||||
// The 256 bytes of score-table RAM
|
// The 256 bytes of score-table RAM
|
||||||
uInt8 myScoreRAM[256];
|
uInt8 myScoreRAM[256];
|
||||||
uInt8* myScorePtr;
|
uInt8* myScorePtr;
|
||||||
|
|
||||||
|
// The 8K Harmony RAM (used for tune data)
|
||||||
|
uInt8 myTuneRAM[8192];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -141,7 +141,7 @@ class CartridgeF4 : public Cartridge
|
||||||
// Indicates which bank is currently active
|
// Indicates which bank is currently active
|
||||||
uInt16 myCurrentBank;
|
uInt16 myCurrentBank;
|
||||||
|
|
||||||
// The 16K ROM image of the cartridge
|
// The 32K ROM image of the cartridge
|
||||||
uInt8 myImage[32768];
|
uInt8 myImage[32768];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ class CartridgeF4SC : public Cartridge
|
||||||
// Indicates which bank is currently active
|
// Indicates which bank is currently active
|
||||||
uInt16 myCurrentBank;
|
uInt16 myCurrentBank;
|
||||||
|
|
||||||
// The 16K ROM image of the cartridge
|
// The 32K ROM image of the cartridge
|
||||||
uInt8 myImage[32768];
|
uInt8 myImage[32768];
|
||||||
|
|
||||||
// The 128 bytes of RAM
|
// The 128 bytes of RAM
|
||||||
|
|
|
@ -8,12 +8,26 @@
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int main(int ac, char* av[])
|
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;
|
ifstream in;
|
||||||
in.open("scrom.bin");
|
in.open(av[1]);
|
||||||
if(in.is_open())
|
if(in.is_open())
|
||||||
{
|
{
|
||||||
in.seekg(0, ios::end);
|
in.seekg(0, ios::end);
|
||||||
|
@ -24,15 +38,15 @@ int main(int ac, char* av[])
|
||||||
in.read((char*)data, len);
|
in.read((char*)data, len);
|
||||||
in.close();
|
in.close();
|
||||||
|
|
||||||
cout << "SIZE = " << (len - 2) << endl << " ";
|
cout << "SIZE = " << len << endl << " ";
|
||||||
|
|
||||||
// Skip first two bytes; they shouldn't be used
|
// Skip first 'offset' bytes; they shouldn't be used
|
||||||
for(int t = 2; t < len; ++t)
|
for(int t = offset; t < len; ++t)
|
||||||
{
|
{
|
||||||
cout << "0x" << setw(2) << setfill('0') << hex << (int)data[t];
|
cout << "0x" << setw(2) << setfill('0') << hex << (int)data[t];
|
||||||
if(t < len - 1)
|
if(t < len - 1)
|
||||||
cout << ", ";
|
cout << ", ";
|
||||||
if(((t-2) % 8) == 7)
|
if(((t-offset) % values_per_line) == (values_per_line-1))
|
||||||
cout << endl << " ";
|
cout << endl << " ";
|
||||||
}
|
}
|
||||||
cout << endl;
|
cout << endl;
|
||||||
|
|
Loading…
Reference in New Issue