Some final fixes for the new cartram debugger tab. In cases where

the RAM is always mapped into the same place in ROM, the ram grid
now shows addresses with the correct read port address, and
ram labels are properly accessed.  In cases where the RAM is hidden
from the 6507 or not mapped into the same place at the same time,
the addresses show actual real addresses of the RAM from the POV of
the cart itself (ie, RAM location zero is labeled 0, not as $1xxx).
This is necessary since quiescent RAM doesn't actually have a 6507
address.  Also, labels are disabled in this case.

Fixed bug with incorrect offsets when reading cart RAM labels;
it seems to be a copy/paste issue, since all such methods were
written as if the cart was SaraChip-based.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2936 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-06-29 18:37:55 +00:00
parent 2dccc2df15
commit 81d0dfdbdc
34 changed files with 448 additions and 503 deletions

View File

@ -169,47 +169,45 @@ string Cartridge3EWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Cartridge3EWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Cartridge3EWidget::internalRamSize()
{
return 32*1024;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Cartridge3EWidget::internalRamRPort(int start)
{
return 0x0000 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string Cartridge3EWidget::internalRamDescription()
{
ostringstream desc;
desc << "Accessible 1K at a time via:\n"
<< " F000-F3FF used for Read Access\n"
<< " F400-F7FF used for Write Access";
<< " $F000 - $F3FF used for Read Access\n"
<< " $F400 - $F7FF used for Write Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray Cartridge3EWidget::internalRamOld(int start, int count)
const ByteArray& Cartridge3EWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray Cartridge3EWidget::internalRamCurrent(int start, int count)
const ByteArray& Cartridge3EWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -223,10 +221,3 @@ uInt8 Cartridge3EWidget::internalRamGetValue(int addr)
{
return myCart.myRAM[addr];
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string Cartridge3EWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
}

View File

@ -41,14 +41,13 @@ class Cartridge3EWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
private:

View File

@ -52,46 +52,44 @@ void Cartridge4KSCWidget::saveOldState()
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Cartridge4KSCWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Cartridge4KSCWidget::internalRamSize()
{
return 128;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Cartridge4KSCWidget::internalRamRPort(int start)
{
return 0xF080 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string Cartridge4KSCWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F07F used for Write Access\n"
<< "F080-F0FF used for Read Access";
desc << "$F000 - $F07F used for Write Access\n"
<< "$F080 - $F0FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray Cartridge4KSCWidget::internalRamOld(int start, int count)
const ByteArray& Cartridge4KSCWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray Cartridge4KSCWidget::internalRamCurrent(int start, int count)
const ByteArray& Cartridge4KSCWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -110,5 +108,5 @@ uInt8 Cartridge4KSCWidget::internalRamGetValue(int addr)
string Cartridge4KSCWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF080, false);
}

View File

@ -39,17 +39,17 @@ class Cartridge4KSCWidget : public CartDebugWidget
void saveOldState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
private:
Cartridge4KSC& myCart;
struct CartState {
ByteArray internalram;

View File

@ -175,46 +175,44 @@ string CartridgeBFSCWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeBFSCWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeBFSCWidget::internalRamSize()
{
return 128;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeBFSCWidget::internalRamRPort(int start)
{
return 0xF080 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeBFSCWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F07F used for Write Access\n"
<< "F080-F0FF used for Read Access";
desc << "$F000 - $F07F used for Write Access\n"
<< "$F080 - $F0FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeBFSCWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeBFSCWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeBFSCWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeBFSCWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -233,5 +231,5 @@ uInt8 CartridgeBFSCWidget::internalRamGetValue(int addr)
string CartridgeBFSCWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF080, false);
}

View File

@ -41,15 +41,15 @@ class CartridgeBFSCWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
CartridgeBFSC& myCart;

View File

@ -232,46 +232,44 @@ string CartridgeCMWidget::bankState()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCMWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeCMWidget::internalRamSize()
{
return 2048;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeCMWidget::internalRamRPort(int start)
{
return 0xF800 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeCMWidget::internalRamDescription()
{
ostringstream desc;
desc << "F800-FFFF used for Exclusive Read\n"
<< " or Exclusive Write Access";
desc << "$F800 - $FFFF used for Exclusive Read\n"
<< " or Exclusive Write Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeCMWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeCMWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeCMWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeCMWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -290,5 +288,5 @@ uInt8 CartridgeCMWidget::internalRamGetValue(int addr)
string CartridgeCMWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF800, false);
}

View File

@ -46,11 +46,11 @@ class CartridgeCMWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);

View File

@ -101,46 +101,44 @@ string CartridgeCTYWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCTYWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeCTYWidget::internalRamSize()
{
return 64;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeCTYWidget::internalRamRPort(int start)
{
return 0xF040 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeCTYWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F03F used for Write Access\n"
<< "F040-F07F used for Read Access";
desc << "$F000 - $F03F used for Write Access\n"
<< "$F040 - $F07F used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeCTYWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeCTYWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeCTYWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeCTYWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -159,5 +157,5 @@ uInt8 CartridgeCTYWidget::internalRamGetValue(int addr)
string CartridgeCTYWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF040, false);
}

View File

@ -41,15 +41,15 @@ class CartridgeCTYWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
CartridgeCTY& myCart;

View File

@ -53,46 +53,44 @@ void CartridgeCVWidget::saveOldState()
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeCVWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeCVWidget::internalRamSize()
{
return 1024;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeCVWidget::internalRamRPort(int start)
{
return 0xF000 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeCVWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F3FF used for Read Access\n"
<< "F400-F7FF used for Write Access";
desc << "$F000 - $F3FF used for Read Access\n"
<< "$F400 - $F7FF used for Write Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeCVWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeCVWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeCVWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeCVWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -111,6 +109,6 @@ uInt8 CartridgeCVWidget::internalRamGetValue(int addr)
string CartridgeCVWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF000, false);
}

View File

@ -39,15 +39,15 @@ class CartridgeCVWidget : public CartDebugWidget
void saveOldState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
CartridgeCV& myCart;

View File

@ -139,46 +139,44 @@ string CartridgeDFSCWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeDFSCWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeDFSCWidget::internalRamSize()
{
return 128;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeDFSCWidget::internalRamRPort(int start)
{
return 0xF080 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeDFSCWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F07F used for Write Access\n"
<< "F080-F0FF used for Read Access";
desc << "$F000 - $F07F used for Write Access\n"
<< "$F080 - $F0FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeDFSCWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeDFSCWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeDFSCWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeDFSCWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -197,5 +195,5 @@ uInt8 CartridgeDFSCWidget::internalRamGetValue(int addr)
string CartridgeDFSCWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF080, false);
}

View File

@ -41,15 +41,15 @@ class CartridgeDFSCWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
CartridgeDFSC& myCart;

View File

@ -213,10 +213,8 @@ void CartridgeDPCPlusWidget::saveOldState()
myOldState.random = myCart.myRandomNumber;
for(uInt32 i = 0; i < this->internalRamSize();i++)
{
for(int i = 0; i < internalRamSize(); ++i)
myOldState.internalram.push_back(myCart.myDisplayImage[i]);
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -337,56 +335,54 @@ string CartridgeDPCPlusWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeDPCPlusWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeDPCPlusWidget::internalRamSize()
{
return 5*1024;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeDPCPlusWidget::internalRamRPort(int start)
{
return 0x0000 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeDPCPlusWidget::internalRamDescription()
{
ostringstream desc;
desc << "0000-0FFF - 4K display data\n"
<< " indirectly accessible to 6507\n"
<< " via DPC+'s Data Fetcher registers\n"
<< "1000-13FF - 1K frequency table,\n"
<< " C variables and C stack\n"
<< " not accessible to 6507";
desc << "$0000 - $0FFF - 4K display data\n"
<< " indirectly accessible to 6507\n"
<< " via DPC+'s Data Fetcher registers\n"
<< "$1000 - $13FF - 1K frequency table,\n"
<< " C variables and C stack\n"
<< " not accessible to 6507";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeDPCPlusWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeDPCPlusWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeDPCPlusWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeDPCPlusWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myDisplayImage[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myDisplayImage[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDPCPlusWidget::internalRamSetValue(int addr, uInt8 value)
{
myCart.myDisplayImage[addr] = value;
myCart.myDisplayImage[addr] = value;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -43,14 +43,15 @@ class CartridgeDPCPlusWidget : public CartDebugWidget
string bankState();
bool internalRam();
// start of functions for Cartridge RAM tab
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
//string internalRamLabel(int addr); not needed for DPC+
// end of functions for Cartridge RAM tab
private:
struct CartState {

View File

@ -112,19 +112,22 @@ class CartDebugWidget : public Widget, public CommandSender
// Query internal state of the cart (usually just bankswitching info)
virtual string bankState() { return "0 (non-bankswitched)"; }
// to make the Cartridge RAM show up in the debugger, implement
// the following 8 functions for cartridges with internal RAM
virtual bool internalRam() { return false; }
// To make the Cartridge RAM show up in the debugger, implement
// the following 8 functions for cartridges with internal RAM
virtual uInt32 internalRamSize() { return 0; }
virtual string internalRamDescription() { return ""; }
virtual ByteArray internalRamOld(int start, int count) { ByteArray ba; return ba; }
virtual ByteArray internalRamCurrent(int start, int count) { ByteArray ba; return ba; }
virtual uInt32 internalRamRPort(int start) { return 0; }
virtual string internalRamDescription() { return EmptyString; }
virtual const ByteArray& internalRamOld(int start, int count) { return myRamOld; }
virtual const ByteArray& internalRamCurrent(int start, int count) { return myRamCurrent; }
virtual void internalRamSetValue(int addr, uInt8 value) { };
virtual uInt8 internalRamGetValue(int addr) { return 0; };
virtual string internalRamLabel(int addr) { CartDebug& dbg = instance().debugger().cartDebug(); return dbg.getLabel(addr, false);}
virtual string internalRamLabel(int addr) { return "Not available/applicable"; }
protected:
// Arrays used to hold current and previous internal RAM values
ByteArray myRamOld, myRamCurrent;
// Font used for 'normal' text; _font is for 'label' text
const GUI::Font& _nfont;

View File

@ -135,50 +135,48 @@ string CartridgeE7Widget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeE7Widget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeE7Widget::internalRamSize()
{
return 2048;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeE7Widget::internalRamRPort(int start)
{
return 0x0000 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeE7Widget::internalRamDescription()
{
ostringstream desc;
desc << "First 1K accessible via:\n"
<< " F000-F3FF used for Write Access\n"
<< " F400-F7FF used for Read Access\n"
<< "256K of second 1K accessible via:\n"
<< " F800-F8FF used for Write Access\n"
<< " F900-F9FF used for Read Access" ;
<< " $F000 - $F3FF used for Write Access\n"
<< " $F400 - $F7FF used for Read Access\n"
<< "256K of second 1K accessible via:\n"
<< " $F800 - $F8FF used for Write Access\n"
<< " $F900 - $F9FF used for Read Access" ;
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeE7Widget::internalRamOld(int start, int count)
const ByteArray& CartridgeE7Widget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeE7Widget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeE7Widget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -192,10 +190,3 @@ uInt8 CartridgeE7Widget::internalRamGetValue(int addr)
{
return myCart.myRAM[addr];
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeE7Widget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
}

View File

@ -41,14 +41,13 @@ class CartridgeE7Widget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
private:

View File

@ -121,46 +121,44 @@ string CartridgeEFSCWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeEFSCWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeEFSCWidget::internalRamSize()
{
return 128;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeEFSCWidget::internalRamRPort(int start)
{
return 0xF080 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeEFSCWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F07F used for Write Access\n"
<< "F080-F0FF used for Read Access";
desc << "$F000 - $F07F used for Write Access\n"
<< "$F080 - $F0FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeEFSCWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeEFSCWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeEFSCWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeEFSCWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -179,5 +177,5 @@ uInt8 CartridgeEFSCWidget::internalRamGetValue(int addr)
string CartridgeEFSCWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF080, false);
}

View File

@ -41,15 +41,15 @@ class CartridgeEFSCWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
CartridgeEFSC& myCart;

View File

@ -111,46 +111,44 @@ string CartridgeF4SCWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeF4SCWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeF4SCWidget::internalRamSize()
{
return 128;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeF4SCWidget::internalRamRPort(int start)
{
return 0xF080 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeF4SCWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F07F used for Write Access\n"
<< "F080-F0FF used for Read Access";
desc << "$F000 - $F07F used for Write Access\n"
<< "$F080 - $F0FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeF4SCWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeF4SCWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeF4SCWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeF4SCWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -169,5 +167,5 @@ uInt8 CartridgeF4SCWidget::internalRamGetValue(int addr)
string CartridgeF4SCWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF080, false);
}

View File

@ -41,16 +41,15 @@ class CartridgeF4SCWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
CartridgeF4SC& myCart;

View File

@ -105,46 +105,44 @@ string CartridgeF6SCWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeF6SCWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeF6SCWidget::internalRamSize()
{
return 128;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeF6SCWidget::internalRamRPort(int start)
{
return 0xF080 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeF6SCWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F07F used for Write Access\n"
<< "F080-F0FF used for Read Access";
desc << "$F000 - $F07F used for Write Access\n"
<< "$F080 - $F0FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeF6SCWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeF6SCWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeF6SCWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeF6SCWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -163,6 +161,5 @@ uInt8 CartridgeF6SCWidget::internalRamGetValue(int addr)
string CartridgeF6SCWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF080, false);
}

View File

@ -41,16 +41,15 @@ class CartridgeF6SCWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
struct CartState {

View File

@ -103,46 +103,44 @@ string CartridgeF8SCWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeF8SCWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeF8SCWidget::internalRamSize()
{
return 128;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeF8SCWidget::internalRamRPort(int start)
{
return 0xF080 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeF8SCWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F07F used for Write Access\n"
<< "F080-F0FF used for Read Access";
desc << "$F000 - $F07F used for Write Access\n"
<< "$F080 - $F0FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeF8SCWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeF8SCWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeF8SCWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeF8SCWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -161,5 +159,5 @@ uInt8 CartridgeF8SCWidget::internalRamGetValue(int addr)
string CartridgeF8SCWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF080, false);
}

View File

@ -41,16 +41,15 @@ class CartridgeF8SCWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
CartridgeF8SC& myCart;

View File

@ -157,46 +157,44 @@ string CartridgeFA2Widget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeFA2Widget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeFA2Widget::internalRamSize()
{
return 256;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeFA2Widget::internalRamRPort(int start)
{
return 0xF100 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeFA2Widget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F0FF used for Write Access\n"
<< "F100-F1FF used for Read Access";
desc << "$F000 - $F0FF used for Write Access\n"
<< "$F100 - $F1FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeFA2Widget::internalRamOld(int start, int count)
const ByteArray& CartridgeFA2Widget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeFA2Widget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeFA2Widget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -215,5 +213,5 @@ uInt8 CartridgeFA2Widget::internalRamGetValue(int addr)
string CartridgeFA2Widget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF100, false);
}

View File

@ -42,11 +42,11 @@ class CartridgeFA2Widget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);

View File

@ -104,46 +104,44 @@ string CartridgeFAWidget::bankState()
return buf.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeFAWidget::internalRam()
{
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeFAWidget::internalRamSize()
{
return 256;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 CartridgeFAWidget::internalRamRPort(int start)
{
return 0xF100 + start;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeFAWidget::internalRamDescription()
{
ostringstream desc;
desc << "F000-F0FF used for Write Access\n"
<< "F100-F1FF used for Read Access";
desc << "$F000 - $F0FF used for Write Access\n"
<< "$F100 - $F1FF used for Read Access";
return desc.str();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeFAWidget::internalRamOld(int start, int count)
const ByteArray& CartridgeFAWidget::internalRamOld(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myOldState.internalram[start + i]);
return ram;
myRamOld.clear();
for(int i = 0; i < count; i++)
myRamOld.push_back(myOldState.internalram[start + i]);
return myRamOld;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ByteArray CartridgeFAWidget::internalRamCurrent(int start, int count)
const ByteArray& CartridgeFAWidget::internalRamCurrent(int start, int count)
{
ByteArray ram;
ram.clear();
for (int i = 0;i<count;i++)
ram.push_back(myCart.myRAM[start + i]);
return ram;
myRamCurrent.clear();
for(int i = 0; i < count; i++)
myRamCurrent.push_back(myCart.myRAM[start + i]);
return myRamCurrent;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -162,5 +160,5 @@ uInt8 CartridgeFAWidget::internalRamGetValue(int addr)
string CartridgeFAWidget::internalRamLabel(int addr)
{
CartDebug& dbg = instance().debugger().cartDebug();
return dbg.getLabel(addr + 0x1080, false);
return dbg.getLabel(addr + 0xF100, false);
}

View File

@ -41,15 +41,15 @@ class CartridgeFAWidget : public CartDebugWidget
string bankState();
// start of functions for Cartridge RAM tab
bool internalRam();
uInt32 internalRamSize();
uInt32 internalRamRPort(int start);
string internalRamDescription();
ByteArray internalRamOld(int start, int count);
ByteArray internalRamCurrent(int start, int count);
const ByteArray& internalRamOld(int start, int count);
const ByteArray& internalRamCurrent(int start, int count);
void internalRamSetValue(int addr, uInt8 value);
uInt8 internalRamGetValue(int addr);
string internalRamLabel(int addr);
// end of functions for Cartridge RAM tab
// end of functions for Cartridge RAM tab
private:
CartridgeFA& myCart;

View File

@ -79,11 +79,11 @@ CartRamWidget::CartRamWidget(
// Add RAM grid
xpos = _font.getStringWidth("xxxx");
int maxrow = myRamSize / 16;
if (maxrow > 16) maxrow = 16;
myPageSize = maxrow * 16;
myNumRows = myRamSize / 16;
if (myNumRows > 16) myNumRows = 16;
myPageSize = myNumRows * 16;
myRamGrid = new DataGridWidget(_boss, _nfont, xpos, ypos,
16, maxrow, 2, 8, Common::Base::F_16, true);
16, myNumRows, 2, 8, Common::Base::F_16, true);
myRamGrid->setTarget(this);
addFocusWidget(myRamGrid);
@ -123,28 +123,26 @@ CartRamWidget::CartRamWidget(
Common::Base::toString(col, Common::Base::F_16_1),
kTextAlignLeft);
}
// xpos = 02 + lwidth - _font.getStringWidth("xxxx ");
myRamStart =
new StaticTextWidget(_boss, _font, xpos - _font.getStringWidth("xxxx"), ypos - myLineHeight,
_font.getStringWidth("xxxx"), myFontHeight,
"00xx", kTextAlignLeft);
// xpos = 2 + lwidth - _font.getStringWidth("xxx ");
int row;
for(row = 0; row < maxrow; ++row)
"F0xx", kTextAlignLeft);
uInt32 row;
for(row = 0; row < myNumRows; ++row)
{
new StaticTextWidget(_boss, _font, xpos - _font.getStringWidth("x "), ypos + row*myLineHeight + 2,
3*myFontWidth, myFontHeight,
Common::Base::toString(row*16, Common::Base::F_16_1),
kTextAlignLeft);
myRamLabels[row] =
new StaticTextWidget(_boss, _font, xpos - _font.getStringWidth("x "),
ypos + row*myLineHeight + 2,
myFontWidth, myFontHeight, "", kTextAlignLeft);
}
// for smaller grids, make sure RAM cell detail fields are below the RESET button
if (maxrow < 8)
if (myNumRows < 8)
row = 8 + 1;
else
row = maxrow + 1;
row = myNumRows + 1;
ypos += myLineHeight * row;
// We need to define these widgets from right to left since the leftmost
@ -157,7 +155,7 @@ CartRamWidget::CartRamWidget(
myBinValue = new EditTextWidget(boss, nfont, xpos + 4*myFontWidth + 5,
ypos-2, 9*myFontWidth, myLineHeight, "");
myBinValue->setEditable(false);
// Add Decimal display of selected RAM cell
xpos -= 8*myFontWidth + 5 + 20;
new StaticTextWidget(boss, lfont, xpos, ypos, 4*myFontWidth, myFontHeight,
@ -165,7 +163,7 @@ CartRamWidget::CartRamWidget(
myDecValue = new EditTextWidget(boss, nfont, xpos + 4*myFontWidth + 5, ypos-2,
4*myFontWidth, myLineHeight, "");
myDecValue->setEditable(false);
// Add Label of selected RAM cell
int xpos_r = xpos - 20;
xpos = x + 10;
@ -200,22 +198,22 @@ void CartRamWidget::fillGrid(bool updateOld)
IntArray vlist;
BoolArray changed;
uInt32 start = myCurrentRamBank * myPageSize;
ByteArray oldRam = myCart.internalRamOld(start, myPageSize);
ByteArray currentRam = myCart.internalRamCurrent(start, myPageSize);
for(uInt32 i=0; i<myPageSize;i++)
const ByteArray& oldRam = myCart.internalRamOld(start, myPageSize);
const ByteArray& currentRam = myCart.internalRamCurrent(start, myPageSize);
for(uInt32 i = 0; i < myPageSize; i++)
{
alist.push_back(i+start);
vlist.push_back(currentRam[i]);
changed.push_back(currentRam[i] != oldRam[i]);
}
if(updateOld)
{
myOldValueList.clear();
myOldValueList = myCart.internalRamCurrent(start, myCart.internalRamSize());
}
myRamGrid->setNumRows(myRamSize / myPageSize);
myRamGrid->setList(alist, vlist, changed);
if(updateOld)
@ -223,12 +221,16 @@ void CartRamWidget::fillGrid(bool updateOld)
myRevertButton->setEnabled(false);
myUndoButton->setEnabled(false);
}
// Update RAM labels
uInt32 rport = myCart.internalRamRPort(start);
uInt32 page = rport & 0xf0;
char buf[5];
BSPF_snprintf(buf, 5, "%04X", start);
BSPF_snprintf(buf, 5, "%04X", rport);
buf[2] = buf[3] = 'x';
myRamStart->setLabel(buf);
myRamStart->setLabel(buf);
for(uInt32 row = 0; row < myNumRows; ++row, page += 0x10)
myRamLabels[row]->setLabel(Common::Base::toString(page, Common::Base::F_16_1));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -266,15 +268,14 @@ string CartRamWidget::doSearch(const string& str)
mySearchAddr.clear();
mySearchValue.clear();
mySearchState.clear();
// Now, search all memory locations for this value, and add it to the
// search array
bool hitfound = false;
// CartDebug& dbg = instance().debugger().cartDebug();
// const CartState& state = (CartState&) dbg.getState();
ByteArray currentRam = myCart.internalRamCurrent(0, myCart.internalRamSize());
const ByteArray& currentRam = myCart.internalRamCurrent(0, myCart.internalRamSize());
for(uInt32 addr = 0; addr < myCart.internalRamSize(); ++addr)
{
int value = currentRam[addr];
@ -290,8 +291,7 @@ string CartRamWidget::doSearch(const string& str)
hitfound = true;
}
}
// If we have some hits, enable the comparison methods
if(hitfound)
{
@ -303,7 +303,7 @@ string CartRamWidget::doSearch(const string& str)
// Finally, show the search results in the list
showSearchResults();
return "";
return EmptyString;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -343,14 +343,14 @@ string CartRamWidget::doCompare(const string& str)
// Now, search all memory locations previously 'found' for this value
bool hitfound = false;
ByteArray currentRam = myCart.internalRamCurrent(0, myCart.internalRamSize());
const ByteArray& currentRam = myCart.internalRamCurrent(0, myCart.internalRamSize());
IntArray tempAddrList, tempValueList;
mySearchState.clear();
for(uInt32 i = 0; i < myCart.internalRamSize(); ++i)
mySearchState.push_back(false);
for(unsigned int i = 0; i < mySearchAddr.size(); ++i)
for(uInt32 i = 0; i < mySearchAddr.size(); ++i)
{
if(comparitiveSearch)
{
@ -382,7 +382,7 @@ string CartRamWidget::doCompare(const string& str)
// Finally, show the search results in the list
showSearchResults();
return "";
return EmptyString;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -41,28 +41,21 @@ class CartRamWidget : public Widget, public CommandSender
{
public:
CartRamWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont,
const GUI::Font& nfont,
int x, int y, int w, int h, CartDebugWidget& cartDebug);
virtual ~CartRamWidget() { };
public:
// Inform the ROM Widget that the underlying cart has somehow changed
void invalidate()
{
sendCommand(RomWidget::kInvalidateListing, -1, -1);
}
void loadConfig();
private:
void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id);
void fillGrid(bool updateOld);
void fillGrid(bool updateOld);
void showInputBox(int cmd);
string doSearch(const string& str);
string doCompare(const string& str);
void doRestart();
void showSearchResults();
void showInputBox(int cmd);
string doSearch(const string& str);
string doCompare(const string& str);
void doRestart();
void showSearchResults();
protected:
// Font used for 'normal' text; _font is for 'label' text
@ -72,47 +65,47 @@ class CartRamWidget : public Widget, public CommandSender
// we may as well make them protected variables
int myFontWidth, myFontHeight, myLineHeight, myButtonHeight;
ostringstream& buffer() { myBuffer.str(""); return myBuffer; }
DataGridWidget* myRamGrid;
StaticTextWidget* myRamStart;
private:
enum {
kUndoCmd = 'RWud',
kRevertCmd = 'RWrv',
kSearchCmd = 'RWse',
kCmpCmd = 'RWcp',
kRestartCmd = 'RWrs',
kSValEntered = 'RWsv',
kCValEntered = 'RWcv'
};
int myUndoAddress;
int myUndoValue;
CartDebugWidget& myCart;
StringListWidget* myDesc;
ostringstream myBuffer;
EditTextWidget* myBinValue;
EditTextWidget* myDecValue;
EditTextWidget* myLabel;
int myCurrentRamBank;
uInt32 myRamSize;
uInt32 myPageSize;
ButtonWidget* myRevertButton;
ButtonWidget* myUndoButton;
ButtonWidget* mySearchButton;
ButtonWidget* myCompareButton;
ButtonWidget* myRestartButton;
InputTextDialog* myInputBox;
ByteArray myOldValueList;
IntArray mySearchAddr;
IntArray mySearchValue;
BoolArray mySearchState;
enum {
kUndoCmd = 'RWud',
kRevertCmd = 'RWrv',
kSearchCmd = 'RWse',
kCmpCmd = 'RWcp',
kRestartCmd = 'RWrs',
kSValEntered = 'RWsv',
kCValEntered = 'RWcv'
};
int myUndoAddress;
int myUndoValue;
CartDebugWidget& myCart;
StringListWidget* myDesc;
DataGridWidget* myRamGrid;
StaticTextWidget* myRamStart;
StaticTextWidget* myRamLabels[16];
EditTextWidget* myBinValue;
EditTextWidget* myDecValue;
EditTextWidget* myLabel;
uInt32 myCurrentRamBank;
uInt32 myRamSize;
uInt32 myPageSize;
uInt32 myNumRows;
ButtonWidget* myRevertButton;
ButtonWidget* myUndoButton;
ButtonWidget* mySearchButton;
ButtonWidget* myCompareButton;
ButtonWidget* myRestartButton;
InputTextDialog* myInputBox;
ByteArray myOldValueList;
IntArray mySearchAddr;
IntArray mySearchValue;
BoolArray mySearchState;
};
#endif

View File

@ -437,7 +437,7 @@ void DebuggerDialog::addRomArea()
addToFocusList(myCartDebug->getFocusList(), myRomTab, tabID);
// The cartridge RAM tab
if (myCartDebug->internalRam())
if (myCartDebug->internalRamSize() > 0)
{
tabID = myRomTab->addTab(" Cartridge RAM ");
myCartRam = new CartRamWidget(myRomTab, *myLFont, *myNFont, 2, 2, tabWidth - 1,