mirror of https://github.com/stella-emu/stella.git
First pass at getting function parsing working again in the debugger.
Added latest DPC+ code from Spiceware. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1986 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
0d367461a4
commit
7bd307ebc8
|
@ -43,11 +43,23 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const RamAreaList& areas)
|
||||||
|
|
||||||
// We know the address for the startup bank right now
|
// We know the address for the startup bank right now
|
||||||
myStartAddresses[myConsole.cartridge().startBank()] = myDebugger.dpeek(0xfffc);
|
myStartAddresses[myConsole.cartridge().startBank()] = myDebugger.dpeek(0xfffc);
|
||||||
|
|
||||||
|
// Add system equates
|
||||||
|
for(uInt16 addr = 0x00; addr <= 0x0F; ++addr)
|
||||||
|
mySystemAddresses.insert(make_pair(ourTIAMnemonicR[addr], addr));
|
||||||
|
for(uInt16 addr = 0x00; addr <= 0x3F; ++addr)
|
||||||
|
mySystemAddresses.insert(make_pair(ourTIAMnemonicW[addr], addr));
|
||||||
|
for(uInt16 addr = 0x280; addr <= 0x297; ++addr)
|
||||||
|
mySystemAddresses.insert(make_pair(ourIOMnemonic[addr-0x280], addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
CartDebug::~CartDebug()
|
CartDebug::~CartDebug()
|
||||||
{
|
{
|
||||||
|
myUserLabels.clear();
|
||||||
|
myUserAddresses.clear();
|
||||||
|
mySystemAddresses.clear();
|
||||||
|
|
||||||
delete[] myStartAddresses;
|
delete[] myStartAddresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,15 +223,6 @@ bool CartDebug::disassemble(const string& autocode, bool force)
|
||||||
if(!(start & 0x1000))
|
if(!(start & 0x1000))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if 0
|
|
||||||
cerr << "start addresses: ";
|
|
||||||
for(int i = 0; i < myConsole.cartridge().bankCount(); ++i) cerr << " " << setw(4) << hex << myStartAddresses[i];
|
|
||||||
cerr << endl;
|
|
||||||
cerr << "current bank = " << getBank() << ", start bank = " << myConsole.cartridge().startBank() << endl
|
|
||||||
<< "reset = " << hex << 0xfffc << ", pc = " << hex << PC << endl
|
|
||||||
<< "start = " << hex << start << endl << endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check whether to use the 'autocode' functionality from Distella
|
// Check whether to use the 'autocode' functionality from Distella
|
||||||
if(autocode == "0") // 'never'
|
if(autocode == "0") // 'never'
|
||||||
fillDisassemblyList(start, false, PC);
|
fillDisassemblyList(start, false, PC);
|
||||||
|
@ -319,20 +322,20 @@ string CartDebug::getCartType()
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void CartDebug::addLabel(const string& label, uInt16 address)
|
bool CartDebug::addLabel(const string& label, uInt16 address)
|
||||||
{
|
{
|
||||||
// Only user-defined labels can be added
|
// Only user-defined labels can be added or redefined
|
||||||
switch(addressType(address))
|
switch(addressType(address))
|
||||||
{
|
{
|
||||||
case ADDR_TIA:
|
case ADDR_TIA:
|
||||||
case ADDR_RIOT:
|
case ADDR_RIOT:
|
||||||
return;
|
return false;
|
||||||
default:
|
default:
|
||||||
cerr << "addLabel: label = " << label << ", address = " << hex << address << endl;
|
cerr << "addLabel: label = " << label << ", address = " << hex << address << endl;
|
||||||
removeLabel(label);
|
removeLabel(label);
|
||||||
myUserAddresses.insert(make_pair(label, address));
|
myUserAddresses.insert(make_pair(label, address));
|
||||||
myUserLabels.insert(make_pair(address, label));
|
myUserLabels.insert(make_pair(address, label));
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,17 +398,14 @@ const string& CartDebug::getLabel(uInt16 addr, bool isRead, int places) const
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
int CartDebug::getAddress(const string& label) const
|
int CartDebug::getAddress(const string& label) const
|
||||||
{
|
{
|
||||||
/* FIXME
|
|
||||||
LabelToAddr::const_iterator iter;
|
LabelToAddr::const_iterator iter;
|
||||||
|
|
||||||
if((iter = mySystemAddresses.find(label)) != mySystemAddresses.end())
|
if((iter = mySystemAddresses.find(label)) != mySystemAddresses.end())
|
||||||
return iter->second.address;
|
return iter->second;
|
||||||
else if((iter = myUserAddresses.find(label)) != myUserAddresses.end())
|
else if((iter = myUserAddresses.find(label)) != myUserAddresses.end())
|
||||||
return iter->second.address;
|
return iter->second;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
*/
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -69,12 +69,12 @@ class CartDebug : public DebuggerSystem
|
||||||
// The following assume that the given addresses are using the
|
// The following assume that the given addresses are using the
|
||||||
// correct read/write port ranges; no checking will be done to
|
// correct read/write port ranges; no checking will be done to
|
||||||
// confirm this.
|
// confirm this.
|
||||||
uInt8 read(uInt16 addr);
|
uInt8 read(uInt16 address);
|
||||||
void write(uInt16 addr, uInt8 value);
|
void write(uInt16 address, uInt8 value);
|
||||||
|
|
||||||
// Indicate that a read from write port has occurred at the specified
|
// Indicate that a read from write port has occurred at the specified
|
||||||
// address.
|
// address.
|
||||||
void triggerReadFromWritePort(uInt16 addr);
|
void triggerReadFromWritePort(uInt16 address);
|
||||||
|
|
||||||
// Return the address at which an invalid read was performed in a
|
// Return the address at which an invalid read was performed in a
|
||||||
// write port area.
|
// write port area.
|
||||||
|
@ -114,20 +114,40 @@ class CartDebug : public DebuggerSystem
|
||||||
const DisassemblyList& disassemblyList() const { return myDisassembly; }
|
const DisassemblyList& disassemblyList() const { return myDisassembly; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Determine the line in the disassembly that corresponds to the given
|
Determine the line in the disassembly that corresponds to the given address.
|
||||||
address. A value of -1 indicates that no such address exists.
|
|
||||||
|
@param address The address to search for
|
||||||
|
|
||||||
|
@return Line number of the address, else -1 if no such address exists
|
||||||
*/
|
*/
|
||||||
int addressToLine(uInt16 address) const;
|
int addressToLine(uInt16 address) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Disassemble from the starting address the specified number of lines.
|
Disassemble from the starting address the specified number of lines.
|
||||||
Note that automatic code determination is turned off for this method;
|
Note that automatic code determination is turned off for this method;
|
||||||
it will treat all address contents as instructions.
|
|
||||||
|
@param start The start address for disassembly
|
||||||
|
@param lines The number of disassembled lines to generate
|
||||||
|
|
||||||
|
@return The disassembly represented as a string
|
||||||
*/
|
*/
|
||||||
string disassemble(uInt16 start, uInt16 lines) const;
|
string disassemble(uInt16 start, uInt16 lines) const;
|
||||||
|
|
||||||
|
// The following are convenience methods that query the cartridge object
|
||||||
|
// for the desired information.
|
||||||
|
/**
|
||||||
|
Get the current bank in use by the cartridge.
|
||||||
|
*/
|
||||||
int getBank();
|
int getBank();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get the total number of banks supported by the cartridge.
|
||||||
|
*/
|
||||||
int bankCount();
|
int bankCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get the name/type of the cartridge.
|
||||||
|
*/
|
||||||
string getCartType();
|
string getCartType();
|
||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
|
@ -135,7 +155,7 @@ class CartDebug : public DebuggerSystem
|
||||||
Add a label and associated address.
|
Add a label and associated address.
|
||||||
Labels that reference either TIA or RIOT spaces will not be processed.
|
Labels that reference either TIA or RIOT spaces will not be processed.
|
||||||
*/
|
*/
|
||||||
void addLabel(const string& label, uInt16 address);
|
bool addLabel(const string& label, uInt16 address);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Remove the given label and its associated address.
|
Remove the given label and its associated address.
|
||||||
|
@ -215,6 +235,13 @@ class CartDebug : public DebuggerSystem
|
||||||
AddrToLabel myUserLabels;
|
AddrToLabel myUserLabels;
|
||||||
LabelToAddr myUserAddresses;
|
LabelToAddr myUserAddresses;
|
||||||
|
|
||||||
|
// Mappings for labels to addresses for system-defined equates
|
||||||
|
// Because system equate addresses can have different names
|
||||||
|
// (depending on access in read vs. write mode), we can only create
|
||||||
|
// a mapping from labels to addresses; addresses to labels are
|
||||||
|
// handled differently
|
||||||
|
LabelToAddr mySystemAddresses;
|
||||||
|
|
||||||
string myCompletions;
|
string myCompletions;
|
||||||
string myCompPrefix;
|
string myCompPrefix;
|
||||||
|
|
||||||
|
|
|
@ -333,17 +333,18 @@ void Debugger::autoExec()
|
||||||
myPrompt->print("autoExec():\n" + myParser->exec(file) + "\n");
|
myPrompt->print("autoExec():\n" + myParser->exec(file) + "\n");
|
||||||
myPrompt->printPrompt();
|
myPrompt->printPrompt();
|
||||||
|
|
||||||
/* FIXME - get these working again
|
|
||||||
// Init builtins
|
// Init builtins
|
||||||
for(int i = 0; builtin_functions[i][0] != ""; i++)
|
for(int i = 0; builtin_functions[i][0] != ""; i++)
|
||||||
{
|
{
|
||||||
// TODO - check this for memory leaks
|
// TODO - check this for memory leaks
|
||||||
int res = YaccParser::parse(builtin_functions[i][1].c_str());
|
int res = YaccParser::parse(builtin_functions[i][1].c_str());
|
||||||
if(res != 0) cerr << "ERROR in builtin function!" << endl;
|
if(res != 0)
|
||||||
|
{
|
||||||
|
cerr << "ERROR in builtin function!" << endl;
|
||||||
Expression* exp = YaccParser::getResult();
|
Expression* exp = YaccParser::getResult();
|
||||||
addFunction(builtin_functions[i][0], builtin_functions[i][1], exp, true);
|
addFunction(builtin_functions[i][0], builtin_functions[i][1], exp, true);
|
||||||
}
|
}
|
||||||
*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -340,16 +340,12 @@ string Cartridge::autodetectType(const uInt8* image, uInt32 size)
|
||||||
else
|
else
|
||||||
type = "F8";
|
type = "F8";
|
||||||
}
|
}
|
||||||
else if((size == 10495) || (size == 10496) || (size == 10240)) // 10K - Pitfall2
|
else if(size >= 10240 && size <= 10496) // ~10K - Pitfall2
|
||||||
{
|
{
|
||||||
type = "DPC";
|
type = "DPC";
|
||||||
}
|
}
|
||||||
else if(size == 12*1024) // 12K
|
else if(size == 12*1024) // 12K
|
||||||
{
|
{
|
||||||
// TODO - this should really be in a method that checks the first
|
|
||||||
// 512 bytes of ROM and finds if either the lower 256 bytes or
|
|
||||||
// higher 256 bytes are all the same. For now, we assume that
|
|
||||||
// all carts of 12K are CBS RAM Plus/FA.
|
|
||||||
type = "FA";
|
type = "FA";
|
||||||
}
|
}
|
||||||
else if(size == 16*1024) // 16K
|
else if(size == 16*1024) // 16K
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size)
|
CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size)
|
||||||
: myFastFetch(false),
|
: myFastFetch(false),
|
||||||
|
myLDAimmediate(false),
|
||||||
|
mySelectByte(0),
|
||||||
mySystemCycles(0),
|
mySystemCycles(0),
|
||||||
myFractionalClocks(0.0)
|
myFractionalClocks(0.0)
|
||||||
{
|
{
|
||||||
|
@ -48,7 +50,10 @@ CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size)
|
||||||
myTops[i] = myBottoms[i] = myCounters[i] = myFlags[i] = myFractionalIncrements[i] = 0;
|
myTops[i] = myBottoms[i] = myCounters[i] = myFlags[i] = myFractionalIncrements[i] = 0;
|
||||||
|
|
||||||
// None of the data fetchers are in music mode
|
// None of the data fetchers are in music mode
|
||||||
myMusicMode[0] = myMusicMode[1] = myMusicMode[2] = false;
|
myMusicVolumes[0] = myMusicVolumes[1] = myMusicVolumes[2] = 0;
|
||||||
|
|
||||||
|
// Set waveforms to square waves
|
||||||
|
myMusicWaveforms[0] = myMusicWaveforms[1] = myMusicWaveforms[2] = 0xAAAAAAAA;
|
||||||
|
|
||||||
// Initialize the DPC's random number generator register (must be non-zero)
|
// Initialize the DPC's random number generator register (must be non-zero)
|
||||||
myRandomNumber = 0x2B435044; // "DPC+"
|
myRandomNumber = 0x2B435044; // "DPC+"
|
||||||
|
@ -140,9 +145,9 @@ inline void CartridgeDPCPlus::updateMusicModeDataFetchers()
|
||||||
for(int x = 5; x <= 7; ++x)
|
for(int x = 5; x <= 7; ++x)
|
||||||
{
|
{
|
||||||
// Update only if the data fetcher is in music mode
|
// Update only if the data fetcher is in music mode
|
||||||
if(myMusicMode[x - 5])
|
if(myMusicVolumes[x - 5])
|
||||||
{
|
{
|
||||||
myMusicCounter[x - 5] += myMusicFrequency[x - 5];
|
myMusicCounters[x - 5] += myMusicFrequencies[x - 5];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,9 +164,10 @@ uInt8 CartridgeDPCPlus::peek(uInt16 address)
|
||||||
if(bankLocked())
|
if(bankLocked())
|
||||||
return peekvalue;
|
return peekvalue;
|
||||||
|
|
||||||
|
// Check if we're in Fast Fetch mode and the prior byte was an A9 (LDA #value)
|
||||||
if(myFastFetch && myLDAimmediate)
|
if(myFastFetch && myLDAimmediate)
|
||||||
{
|
{
|
||||||
peekvalue = myProgramImage[(myCurrentBank << 12) + address];
|
// if #value is a read-register then we want to use that as the address
|
||||||
if(peekvalue < 0x0028)
|
if(peekvalue < 0x0028)
|
||||||
address = peekvalue;
|
address = peekvalue;
|
||||||
}
|
}
|
||||||
|
@ -223,15 +229,15 @@ uInt8 CartridgeDPCPlus::peek(uInt16 address)
|
||||||
updateMusicModeDataFetchers();
|
updateMusicModeDataFetchers();
|
||||||
|
|
||||||
uInt8 i = 0;
|
uInt8 i = 0;
|
||||||
if(myMusicMode[0] && (myMusicCounter[0]>>31))
|
if(myMusicVolumes[0] && (myMusicCounters[0]>>31))
|
||||||
{
|
{
|
||||||
i |= 0x01;
|
i |= 0x01;
|
||||||
}
|
}
|
||||||
if(myMusicMode[1] && (myMusicCounter[1]>>31))
|
if(myMusicVolumes[1] && (myMusicCounters[1]>>31))
|
||||||
{
|
{
|
||||||
i |= 0x02;
|
i |= 0x02;
|
||||||
}
|
}
|
||||||
if(myMusicMode[2] && (myMusicCounter[2]>>31))
|
if(myMusicVolumes[2] && (myMusicCounters[2]>>31))
|
||||||
{
|
{
|
||||||
i |= 0x04;
|
i |= 0x04;
|
||||||
}
|
}
|
||||||
|
@ -339,7 +345,6 @@ uInt8 CartridgeDPCPlus::peek(uInt16 address)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
peekvalue = myProgramImage[(myCurrentBank << 12) + address];
|
|
||||||
if(myFastFetch)
|
if(myFastFetch)
|
||||||
myLDAimmediate = (peekvalue == 0xA9);
|
myLDAimmediate = (peekvalue == 0xA9);
|
||||||
|
|
||||||
|
@ -374,6 +379,7 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//DFx Fraction Increment amount
|
||||||
case 0x02:
|
case 0x02:
|
||||||
{
|
{
|
||||||
myFractionalIncrements[index] = value;
|
myFractionalIncrements[index] = value;
|
||||||
|
@ -414,8 +420,80 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
|
||||||
myFastFetch = (value == 0);
|
myFastFetch = (value == 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x01: // reserved
|
// SelectByte
|
||||||
case 0x02: // reserved
|
case 0x01:
|
||||||
|
{
|
||||||
|
mySelectByte = value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Write Byte
|
||||||
|
case 0x02:
|
||||||
|
{
|
||||||
|
switch (mySelectByte)
|
||||||
|
{
|
||||||
|
case 0x00:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[0] = (myMusicWaveforms[0] & 0xFFFFFF00) | value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x01:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[0] = (myMusicWaveforms[0] & 0xFFFF00FF) | (value<<8);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x02:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[0] = (myMusicWaveforms[0] & 0xFF00FFFF) | (value<<16);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x03:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[0] = (myMusicWaveforms[0] & 0x00FFFFFF) | (value<<24);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x04:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[1] = (myMusicWaveforms[1] & 0xFFFFFF00) | value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x05:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[1] = (myMusicWaveforms[1] & 0xFFFF00FF) | (value<<8);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x06:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[1] = (myMusicWaveforms[1] & 0xFF00FFFF) | (value<<16);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x07:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[1] = (myMusicWaveforms[1] & 0x00FFFFFF) | (value<<24);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x08:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[2] = (myMusicWaveforms[2] & 0xFFFFFF00) | value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x09:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[2] = (myMusicWaveforms[2] & 0xFFFF00FF) | (value<<8);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x0A:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[2] = (myMusicWaveforms[2] & 0xFF00FFFF) | (value<<16);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x0B:
|
||||||
|
{
|
||||||
|
myMusicWaveforms[2] = (myMusicWaveforms[2] & 0x00FFFFFF) | (value<<24);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 0x03: // reserved
|
case 0x03: // reserved
|
||||||
case 0x04: // reserved
|
case 0x04: // reserved
|
||||||
break;
|
break;
|
||||||
|
@ -423,7 +501,7 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
|
||||||
case 0x06:
|
case 0x06:
|
||||||
case 0x07:
|
case 0x07:
|
||||||
{
|
{
|
||||||
myMusicMode[index - 5] = (value & 0x10);
|
myMusicVolumes[index - 5] = (value & 0x0F);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -480,7 +558,7 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
|
||||||
case 0x06:
|
case 0x06:
|
||||||
case 0x07:
|
case 0x07:
|
||||||
{
|
{
|
||||||
myMusicFrequency[index-5] = myFrequencyImage[(value<<2)] +
|
myMusicFrequencies[index-5] = myFrequencyImage[(value<<2)] +
|
||||||
(myFrequencyImage[(value<<2)+1]<<8) +
|
(myFrequencyImage[(value<<2)+1]<<8) +
|
||||||
(myFrequencyImage[(value<<2)+2]<<16) +
|
(myFrequencyImage[(value<<2)+2]<<16) +
|
||||||
(myFrequencyImage[(value<<2)+3]<<24);
|
(myFrequencyImage[(value<<2)+3]<<24);
|
||||||
|
@ -639,22 +717,32 @@ bool CartridgeDPCPlus::save(Serializer& out) const
|
||||||
|
|
||||||
// The Fast Fetcher Enabled flag
|
// The Fast Fetcher Enabled flag
|
||||||
out.putBool(myFastFetch);
|
out.putBool(myFastFetch);
|
||||||
|
|
||||||
|
// Last immediate byte peeked
|
||||||
out.putBool(myLDAimmediate);
|
out.putBool(myLDAimmediate);
|
||||||
|
|
||||||
// The music mode flags for the data fetchers
|
// Control byte
|
||||||
|
out.putByte((char)mySelectByte);
|
||||||
|
|
||||||
|
// The music volumes for the data fetchers
|
||||||
out.putInt(3);
|
out.putInt(3);
|
||||||
for(i = 0; i < 3; ++i)
|
for(i = 0; i < 3; ++i)
|
||||||
out.putBool(myMusicMode[i]);
|
out.putByte((char)myMusicVolumes[i]);
|
||||||
|
|
||||||
// The music mode counters for the data fetchers
|
// The music mode counters for the data fetchers
|
||||||
out.putInt(3);
|
out.putInt(3);
|
||||||
for(i = 0; i < 3; ++i)
|
for(i = 0; i < 3; ++i)
|
||||||
out.putInt(myMusicCounter[i]);
|
out.putInt(myMusicCounters[i]);
|
||||||
|
|
||||||
// The music mode frequency addends for the data fetchers
|
// The music mode frequency addends for the data fetchers
|
||||||
out.putInt(3);
|
out.putInt(3);
|
||||||
for(i = 0; i < 3; ++i)
|
for(i = 0; i < 3; ++i)
|
||||||
out.putInt(myMusicFrequency[i]);
|
out.putInt(myMusicFrequencies[i]);
|
||||||
|
|
||||||
|
// The music waveforms
|
||||||
|
out.putInt(3);
|
||||||
|
for(i = 0; i < 3; ++i)
|
||||||
|
out.putInt(myMusicWaveforms[i]);
|
||||||
|
|
||||||
// The random number generator register
|
// The random number generator register
|
||||||
out.putInt(myRandomNumber);
|
out.putInt(myRandomNumber);
|
||||||
|
@ -718,22 +806,32 @@ bool CartridgeDPCPlus::load(Serializer& in)
|
||||||
|
|
||||||
// The Fast Fetcher Enabled flag
|
// The Fast Fetcher Enabled flag
|
||||||
myFastFetch = in.getBool();
|
myFastFetch = in.getBool();
|
||||||
|
|
||||||
|
// Last immediate byte peeked
|
||||||
myLDAimmediate = in.getBool();
|
myLDAimmediate = in.getBool();
|
||||||
|
|
||||||
|
// Control byte
|
||||||
|
mySelectByte = (uInt8) in.getByte();
|
||||||
|
|
||||||
// The music mode flags for the data fetchers
|
// The music mode flags for the data fetchers
|
||||||
limit = (uInt32) in.getInt();
|
limit = (uInt32) in.getInt();
|
||||||
for(i = 0; i < limit; ++i)
|
for(i = 0; i < limit; ++i)
|
||||||
myMusicMode[i] = in.getBool();
|
myMusicVolumes[i] = (uInt8) in.getByte();
|
||||||
|
|
||||||
// The music mode counters for the data fetchers
|
// The music mode counters for the data fetchers
|
||||||
limit = (uInt32) in.getInt();
|
limit = (uInt32) in.getInt();
|
||||||
for(i = 0; i < limit; ++i)
|
for(i = 0; i < limit; ++i)
|
||||||
myMusicCounter[i] = (uInt32) in.getInt();
|
myMusicCounters[i] = (uInt32) in.getInt();
|
||||||
|
|
||||||
// The music mode frequency addends for the data fetchers
|
// The music mode frequency addends for the data fetchers
|
||||||
limit = (uInt32) in.getInt();
|
limit = (uInt32) in.getInt();
|
||||||
for(i = 0; i < limit; ++i)
|
for(i = 0; i < limit; ++i)
|
||||||
myMusicFrequency[i] = (uInt32) in.getInt();
|
myMusicFrequencies[i] = (uInt32) in.getInt();
|
||||||
|
|
||||||
|
// The music waveforms
|
||||||
|
limit = (uInt32) in.getInt();
|
||||||
|
for(i = 0; i < limit; ++i)
|
||||||
|
myMusicWaveforms[i] = (uInt32) in.getInt();
|
||||||
|
|
||||||
// The random number generator register
|
// The random number generator register
|
||||||
myRandomNumber = (uInt32) in.getInt();
|
myRandomNumber = (uInt32) in.getInt();
|
||||||
|
|
|
@ -195,16 +195,24 @@ class CartridgeDPCPlus : public Cartridge
|
||||||
|
|
||||||
// The Fast Fetcher Enabled flag
|
// The Fast Fetcher Enabled flag
|
||||||
bool myFastFetch;
|
bool myFastFetch;
|
||||||
|
|
||||||
|
// Flags that last byte peeked was A9 (LDA #)
|
||||||
bool myLDAimmediate;
|
bool myLDAimmediate;
|
||||||
|
|
||||||
// The music mode DF5, DF6, & DF7 enabled flags
|
// Control Byte to update
|
||||||
bool myMusicMode[3];
|
uInt8 mySelectByte;
|
||||||
|
|
||||||
|
// The music volumes
|
||||||
|
uInt8 myMusicVolumes[3];
|
||||||
|
|
||||||
// The music mode counters
|
// The music mode counters
|
||||||
uInt32 myMusicCounter[3];
|
uInt32 myMusicCounters[3];
|
||||||
|
|
||||||
// The music frequency addends
|
// The music frequency addends
|
||||||
uInt32 myMusicFrequency[3];
|
uInt32 myMusicFrequencies[3];
|
||||||
|
|
||||||
|
// The music waveforms
|
||||||
|
uInt32 myMusicWaveforms[3];
|
||||||
|
|
||||||
// The random number generator register
|
// The random number generator register
|
||||||
uInt32 myRandomNumber;
|
uInt32 myRandomNumber;
|
||||||
|
|
|
@ -1080,14 +1080,12 @@ uInt32 Console::ourUserSECAMPalette[256] = { 0 }; // filled from external file
|
||||||
Console::Console(const Console& console)
|
Console::Console(const Console& console)
|
||||||
: myOSystem(console.myOSystem)
|
: myOSystem(console.myOSystem)
|
||||||
{
|
{
|
||||||
// TODO: Write this method
|
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Console& Console::operator = (const Console&)
|
Console& Console::operator = (const Console&)
|
||||||
{
|
{
|
||||||
// TODO: Write this method
|
|
||||||
assert(false);
|
assert(false);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -192,7 +192,6 @@ class M6502 : public Serializable
|
||||||
*/
|
*/
|
||||||
void attach(Debugger& debugger);
|
void attach(Debugger& debugger);
|
||||||
|
|
||||||
// TODO - document these methods
|
|
||||||
void setBreakPoints(PackedBitArray* bp);
|
void setBreakPoints(PackedBitArray* bp);
|
||||||
void setTraps(PackedBitArray* read, PackedBitArray* write);
|
void setTraps(PackedBitArray* read, PackedBitArray* write);
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,12 @@ y.tab.c, y.tab.h - Generated parser. NOT BUILT AUTOMATICALLY!
|
||||||
I've only tested stella.y with GNU bison 1.35 and (once) with Berkeley
|
I've only tested stella.y with GNU bison 1.35 and (once) with Berkeley
|
||||||
Yacc 1.9. Hopefully your favorite version will work, too :)
|
Yacc 1.9. Hopefully your favorite version will work, too :)
|
||||||
|
|
||||||
Even though they're generated, y.tab.c and .h are in CVS. This is so that
|
Even though they're generated, y.tab.c and .h are in SVN. This is so that
|
||||||
people who don't have a local copy of bison or yacc can still compile
|
people who don't have a local copy of bison or yacc can still compile
|
||||||
Stella.
|
Stella.
|
||||||
|
|
||||||
If you modify stella.y, you MUST run "make -f Makefile.yacc" in this directory.
|
If you modify stella.y, you MUST run "make -f Makefile.yacc" in this directory.
|
||||||
This will regenerate y.tab.c and y.tab.h. Do this before "cvs commit".
|
This will regenerate y.tab.c and y.tab.h. Do this before "svn commit".
|
||||||
|
|
||||||
If you're hacking the parser, you can test it without the rest of Stella
|
If you're hacking the parser, you can test it without the rest of Stella
|
||||||
by running "make -f Makefile.yacc calctest" in this directory, then running
|
by running "make -f Makefile.yacc calctest" in this directory, then running
|
||||||
|
|
|
@ -41,16 +41,17 @@ yystype result;
|
||||||
string errMsg;
|
string errMsg;
|
||||||
#include "y.tab.c"
|
#include "y.tab.c"
|
||||||
|
|
||||||
const string& errorMessage() {
|
const string& errorMessage()
|
||||||
|
{
|
||||||
return errMsg;
|
return errMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression *getResult() {
|
Expression* getResult()
|
||||||
return result.exp;
|
{
|
||||||
lastExp = 0;
|
lastExp = 0;
|
||||||
|
return result.exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *input, *c;
|
const char *input, *c;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -64,15 +65,18 @@ int state = ST_DEFAULT;
|
||||||
|
|
||||||
//extern int yylval; // bison provides this
|
//extern int yylval; // bison provides this
|
||||||
|
|
||||||
void setInput(const char *in) {
|
void setInput(const char *in)
|
||||||
|
{
|
||||||
input = c = in;
|
input = c = in;
|
||||||
state = ST_DEFAULT;
|
state = ST_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
int parse(const char *in) {
|
int parse(const char *in)
|
||||||
|
{
|
||||||
lastExp = 0;
|
lastExp = 0;
|
||||||
errMsg = "(no error)";
|
errMsg = "(no error)";
|
||||||
setInput(in);
|
setInput(in);
|
||||||
|
cerr << "PARSE: " << in << endl;
|
||||||
return yyparse();
|
return yyparse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ Expression* lastExp = 0;
|
||||||
|
|
||||||
/* dump Expression stack during parsing? */
|
/* dump Expression stack during parsing? */
|
||||||
#define DEBUG_EXP 1
|
#define DEBUG_EXP 1
|
||||||
/* #define DEBUG_EXP 1 */
|
|
||||||
|
|
||||||
int yylex();
|
int yylex();
|
||||||
char *yytext;
|
char *yytext;
|
||||||
|
|
|
@ -78,7 +78,6 @@ Expression* lastExp = 0;
|
||||||
|
|
||||||
/* dump Expression stack during parsing? */
|
/* dump Expression stack during parsing? */
|
||||||
#define DEBUG_EXP 1
|
#define DEBUG_EXP 1
|
||||||
/* #define DEBUG_EXP 1 */
|
|
||||||
|
|
||||||
int yylex();
|
int yylex();
|
||||||
char *yytext;
|
char *yytext;
|
||||||
|
@ -98,7 +97,7 @@ void yyerror(const char *e) {
|
||||||
|
|
||||||
|
|
||||||
/* Line 189 of yacc.c */
|
/* Line 189 of yacc.c */
|
||||||
#line 102 "y.tab.c"
|
#line 101 "y.tab.c"
|
||||||
|
|
||||||
/* Enabling traces. */
|
/* Enabling traces. */
|
||||||
#ifndef YYDEBUG
|
#ifndef YYDEBUG
|
||||||
|
@ -173,7 +172,7 @@ typedef union YYSTYPE
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Line 214 of yacc.c */
|
/* Line 214 of yacc.c */
|
||||||
#line 29 "stella.y"
|
#line 28 "stella.y"
|
||||||
|
|
||||||
int val;
|
int val;
|
||||||
char *equate;
|
char *equate;
|
||||||
|
@ -186,7 +185,7 @@ typedef union YYSTYPE
|
||||||
|
|
||||||
|
|
||||||
/* Line 214 of yacc.c */
|
/* Line 214 of yacc.c */
|
||||||
#line 190 "y.tab.c"
|
#line 189 "y.tab.c"
|
||||||
} YYSTYPE;
|
} YYSTYPE;
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
|
@ -198,7 +197,7 @@ typedef union YYSTYPE
|
||||||
|
|
||||||
|
|
||||||
/* Line 264 of yacc.c */
|
/* Line 264 of yacc.c */
|
||||||
#line 202 "y.tab.c"
|
#line 201 "y.tab.c"
|
||||||
|
|
||||||
#ifdef short
|
#ifdef short
|
||||||
# undef short
|
# undef short
|
||||||
|
@ -496,10 +495,10 @@ static const yytype_int8 yyrhs[] =
|
||||||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||||||
static const yytype_uint8 yyrline[] =
|
static const yytype_uint8 yyrline[] =
|
||||||
{
|
{
|
||||||
0, 67, 67, 70, 71, 72, 73, 74, 75, 76,
|
0, 66, 66, 69, 70, 71, 72, 73, 74, 75,
|
||||||
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
|
76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
|
||||||
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
|
86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
|
||||||
97, 98, 99, 100, 101, 102, 103
|
96, 97, 98, 99, 100, 101, 102
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1469,252 +1468,252 @@ yyreduce:
|
||||||
case 2:
|
case 2:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 67 "stella.y"
|
#line 66 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, "\ndone\n"); result.exp = (yyvsp[(1) - (1)].exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, "\ndone\n"); result.exp = (yyvsp[(1) - (1)].exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 70 "stella.y"
|
#line 69 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " +"); (yyval.exp) = new PlusExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " +"); (yyval.exp) = new PlusExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 71 "stella.y"
|
#line 70 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " -"); (yyval.exp) = new MinusExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " -"); (yyval.exp) = new MinusExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 72 "stella.y"
|
#line 71 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " *"); (yyval.exp) = new MultExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " *"); (yyval.exp) = new MultExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 73 "stella.y"
|
#line 72 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " /"); (yyval.exp) = new DivExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " /"); (yyval.exp) = new DivExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 74 "stella.y"
|
#line 73 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " %%"); (yyval.exp) = new ModExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " %%"); (yyval.exp) = new ModExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 75 "stella.y"
|
#line 74 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " &"); (yyval.exp) = new BinAndExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " &"); (yyval.exp) = new BinAndExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 9:
|
case 9:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 76 "stella.y"
|
#line 75 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " |"); (yyval.exp) = new BinOrExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " |"); (yyval.exp) = new BinOrExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10:
|
case 10:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 77 "stella.y"
|
#line 76 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " ^"); (yyval.exp) = new BinXorExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " ^"); (yyval.exp) = new BinXorExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 11:
|
case 11:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 78 "stella.y"
|
#line 77 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " <"); (yyval.exp) = new LessExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " <"); (yyval.exp) = new LessExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 12:
|
case 12:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 79 "stella.y"
|
#line 78 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " >"); (yyval.exp) = new GreaterExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " >"); (yyval.exp) = new GreaterExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 13:
|
case 13:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 80 "stella.y"
|
#line 79 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " >="); (yyval.exp) = new GreaterEqualsExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " >="); (yyval.exp) = new GreaterEqualsExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 14:
|
case 14:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 81 "stella.y"
|
#line 80 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " <="); (yyval.exp) = new LessEqualsExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " <="); (yyval.exp) = new LessEqualsExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 15:
|
case 15:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 82 "stella.y"
|
#line 81 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " !="); (yyval.exp) = new NotEqualsExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " !="); (yyval.exp) = new NotEqualsExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 83 "stella.y"
|
#line 82 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " =="); (yyval.exp) = new EqualsExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " =="); (yyval.exp) = new EqualsExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 17:
|
case 17:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 84 "stella.y"
|
#line 83 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " >>"); (yyval.exp) = new ShiftRightExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " >>"); (yyval.exp) = new ShiftRightExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 18:
|
case 18:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 85 "stella.y"
|
#line 84 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " <<"); (yyval.exp) = new ShiftLeftExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " <<"); (yyval.exp) = new ShiftLeftExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 19:
|
case 19:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 86 "stella.y"
|
#line 85 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " ||"); (yyval.exp) = new LogOrExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " ||"); (yyval.exp) = new LogOrExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 20:
|
case 20:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 87 "stella.y"
|
#line 86 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " &&"); (yyval.exp) = new LogAndExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " &&"); (yyval.exp) = new LogAndExpression((yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 21:
|
case 21:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 88 "stella.y"
|
#line 87 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " U-"); (yyval.exp) = new UnaryMinusExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " U-"); (yyval.exp) = new UnaryMinusExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 22:
|
case 22:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 89 "stella.y"
|
#line 88 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " ~"); (yyval.exp) = new BinNotExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " ~"); (yyval.exp) = new BinNotExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 23:
|
case 23:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 90 "stella.y"
|
#line 89 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " !"); (yyval.exp) = new LogNotExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " !"); (yyval.exp) = new LogNotExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 24:
|
case 24:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 91 "stella.y"
|
#line 90 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " U*"); (yyval.exp) = new ByteDerefExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " U*"); (yyval.exp) = new ByteDerefExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 25:
|
case 25:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 92 "stella.y"
|
#line 91 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " U@"); (yyval.exp) = new WordDerefExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " U@"); (yyval.exp) = new WordDerefExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 26:
|
case 26:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 93 "stella.y"
|
#line 92 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " U<"); (yyval.exp) = new LoByteExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " U<"); (yyval.exp) = new LoByteExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 27:
|
case 27:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 94 "stella.y"
|
#line 93 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " U>"); (yyval.exp) = new HiByteExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " U>"); (yyval.exp) = new HiByteExpression((yyvsp[(2) - (2)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 28:
|
case 28:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 95 "stella.y"
|
#line 94 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " ()"); (yyval.exp) = (yyvsp[(2) - (3)].exp); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " ()"); (yyval.exp) = (yyvsp[(2) - (3)].exp); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 29:
|
case 29:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 96 "stella.y"
|
#line 95 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " []"); (yyval.exp) = new ByteDerefOffsetExpression((yyvsp[(1) - (4)].exp), (yyvsp[(3) - (4)].exp)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " []"); (yyval.exp) = new ByteDerefOffsetExpression((yyvsp[(1) - (4)].exp), (yyvsp[(3) - (4)].exp)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 30:
|
case 30:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 97 "stella.y"
|
#line 96 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " %d", (yyvsp[(1) - (1)].val)); (yyval.exp) = new ConstExpression((yyvsp[(1) - (1)].val)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " %d", (yyvsp[(1) - (1)].val)); (yyval.exp) = new ConstExpression((yyvsp[(1) - (1)].val)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 31:
|
case 31:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 98 "stella.y"
|
#line 97 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " %s", (yyvsp[(1) - (1)].equate)); (yyval.exp) = new EquateExpression((yyvsp[(1) - (1)].equate)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " %s", (yyvsp[(1) - (1)].equate)); (yyval.exp) = new EquateExpression((yyvsp[(1) - (1)].equate)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 99 "stella.y"
|
#line 98 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " (CpuMethod)"); (yyval.exp) = new CpuMethodExpression((yyvsp[(1) - (1)].cpuMethod)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " (CpuMethod)"); (yyval.exp) = new CpuMethodExpression((yyvsp[(1) - (1)].cpuMethod)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 33:
|
case 33:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 100 "stella.y"
|
#line 99 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " (CartMethod)"); (yyval.exp) = new CartMethodExpression((yyvsp[(1) - (1)].cartMethod)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " (CartMethod)"); (yyval.exp) = new CartMethodExpression((yyvsp[(1) - (1)].cartMethod)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 34:
|
case 34:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 101 "stella.y"
|
#line 100 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " (TiaMethod)"); (yyval.exp) = new TiaMethodExpression((yyvsp[(1) - (1)].tiaMethod)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " (TiaMethod)"); (yyval.exp) = new TiaMethodExpression((yyvsp[(1) - (1)].tiaMethod)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 35:
|
case 35:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 102 "stella.y"
|
#line 101 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " (function)"); (yyval.exp) = new FunctionExpression((yyvsp[(1) - (1)].function)); lastExp = (yyval.exp); }
|
{ if(DEBUG_EXP) fprintf(stderr, " (function)"); (yyval.exp) = new FunctionExpression((yyvsp[(1) - (1)].function)); lastExp = (yyval.exp); }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 36:
|
case 36:
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 103 "stella.y"
|
#line 102 "stella.y"
|
||||||
{ if(DEBUG_EXP) fprintf(stderr, " ERR: "); yyerror((char*)"Invalid label or constant"); return 1; }
|
{ if(DEBUG_EXP) fprintf(stderr, " ERR: "); yyerror((char*)"Invalid label or constant"); return 1; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Line 1455 of yacc.c */
|
/* Line 1455 of yacc.c */
|
||||||
#line 1718 "y.tab.c"
|
#line 1717 "y.tab.c"
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
||||||
|
@ -1926,6 +1925,6 @@ yyreturn:
|
||||||
|
|
||||||
|
|
||||||
/* Line 1675 of yacc.c */
|
/* Line 1675 of yacc.c */
|
||||||
#line 105 "stella.y"
|
#line 104 "stella.y"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ typedef union YYSTYPE
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Line 1676 of yacc.c */
|
/* Line 1676 of yacc.c */
|
||||||
#line 29 "stella.y"
|
#line 28 "stella.y"
|
||||||
|
|
||||||
int val;
|
int val;
|
||||||
char *equate;
|
char *equate;
|
||||||
|
|
Loading…
Reference in New Issue