Some final changes for the 3.2 release, including documentation updates.

Added 'ramrandom' commmandline argument, used to toggle randomizing or
zeroing or all RAM in the system (both zero-page and SARA).

Disassembler now properly supports all test cases, including rewinding
within the debugger.

Added preliminary support for disassembling from zero-page RAM.

Bumped version # for final release.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2100 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2010-08-19 21:48:28 +00:00
parent 0a7726cb9f
commit b2ed949082
122 changed files with 507 additions and 287 deletions

View File

@ -12,7 +12,7 @@
Release History
===========================================================================
3.1.2 to 3.2: (August 16, 2010)
3.1.2 to 3.2: (August 20, 2010)
* NOTE: because of the many event-related changes in this release, all
event mapping should be reset to defaults after starting Stella for
@ -34,12 +34,21 @@
now works exactly like an axis in UI mode (holding down a direction
continues that direction until the hat is released/centered).
* Several improvements to the debugger:
- user labels are now supported again
- 'runto' debugger command is now case-insensitive, and shows a
progressbar while searching through the disassembly
* Several major improvements to the debugger:
- the disassembler can now process multiple entry points, and
caches entry points as they're encountered (ie, the disassembly
isn't 'reset' each time a bank change occurs or you exit and
re-enter the debugger)
- preliminary support for disassembling from zero-page RAM
- re-added ability to change banks with the 'bank' debugger
prompt command and within the ROM disassembly UI
- user labels in disassembly are now supported again
- 'runto' command is now case-insensitive, and shows a progressbar
while searching through the disassembly
- the debugger window can be resized between ROM loads (previously,
the app had to be restarted)
- fixed bug in Distella disassembler output, where it sometimes
generated addresses above $FFFF
- a vertical line separates the disassembly from the raw bytes
* Fixed behaviour of SWCHB and SWBCNT; pins set to output now remember
@ -48,15 +57,23 @@
and test ROMs in this area.
* Fixed bug when reading from illegal TIA addresses; a Space Invaders
hack was showing pink enemies instead of white ones.
hack was showing pink enemies instead of white ones. Again, special
thanks to to Omegamatrix of AtariAge for advice and test ROMs in this
area.
* Fixed bug in handling INPT4/INPT5 latches from VBLANK; a least one
ROM was working in Stella when it didn't on real hardware.
* Added 'ramrandom' commandline argument, which is used to randomize
all RAM in the system; otherwise, the RAM is zeroed. This defaults
to off, which is different than previous versions of Stella.
* Added 'finishing touches' to some of the UI descriptions, giving a
better explanation of the functions. Related to this, certain
options now show a message box explaining the option in further
detail (particularly the ROM Audit mode).
detail (particularly the ROM Audit mode). As well, when starting
Stella for the first time, a prompt appears to select a ROM
directory.
* Fixed bugs in the ROM launcher when viewing certain PNG images not
created by Stella. Related to this, the official PNG library is now
@ -64,9 +81,6 @@
snapshots for those ROMs which consist of several games. Thanks go
to Buzbard of AtariAge for these images.
* Fixed bug in Distella disassembler output, where it sometimes
generated addresses above $FFFF.
* Added several fixes for crashes on 'small' systems (those systems
where the maximum resolution is less than 640x480).

View File

@ -9,4 +9,4 @@ the Stella Website at:
Enjoy,
The Stella Team
August 16, 2010
August 20, 2010

View File

@ -64,8 +64,8 @@ feature that no other 2600 debugger has; it's <b>completely</b> cross-platform.<
<li>Save CLI session to a text file.</li>
<li>Supports hex, decimal, and binary input and output almost everywhere.
(disassembly is still hex).</li>
<li>Support for bank switching. You can see how many banks a cart has, and the
currently selected bank.</li>
<li>Support for bank switching. You can see how many banks a cart has and the
currently selected bank, and manually change banks.</li>
<li>Registers/memory that get changed by the CPU during debugging are
highlighted when they're displayed.<li>
<li>Scanline advance (like frame advance, break at beginning
@ -598,6 +598,7 @@ can also get rid of all traps at once with the "cleartraps" command.</p>
<pre>
a - Set Accumulator to value xx
bank - Show # of banks, or switch to bank xx
base - Set default base (hex, dec, or bin)
break - Set/clear breakpoint at address xx (default=PC)
breakif - Set breakpoint on condition xx
@ -932,11 +933,10 @@ TIA/RIOT labels will still be present.</p>
<p>The top area contains two items:
<ul>
<li><b>Bank (current/total)</b>: Shows the current bank in use, and the
total number of banks. Note that bank numbers start at 0 (as in most
programming languages), so '0 / 1' actually means 'the first
bank of 1 possible bank(s)'. Due to the way the disassembler works,
you cannot change banks; the display is for reference only.
<li><b>Current bank (x total)</b>: Shows the current bank in use (number in textbox),
and the total number of banks (x). Note that bank numbers start at 0 (as in most
programming languages). If the cartridge contains multiple banks, the bank can
be changed in the bank textbox, and the ROM will be re-disassembled.
Note that certain ROMs are quite complex, and may only show has having one
'virtual' bank when their address space can be swapped in and out in many
different ways.</li>
@ -960,8 +960,9 @@ red circle in this area. These are the same breakpoints as used
by the "break" command, <b>not</b> the conditional "breakif" breakpoints
(which makes sense: cond-breaks can break on any condition, the Program
Counter isn't necessarily involved).</li>
<li><b>Labels</b>: For now, only those generated by Distella, not ones from a
DASM symbol file or any labels created by the user.</li>
<li><b>Labels</b>: Any labels assigned to the given address, either generated
automatically by Distella, read from a DASM symbol file or custom
labels created by the user.</li>
<li><b>Instruction</b>: This is a standard 6502 mnemonic (possibly with operand).
This field also contains the cycle count for the instruction (separated by a
semicolon).</li>
@ -973,7 +974,10 @@ bytes in this field.</li>
<p>The 6502 mnemonic will be UPPERCASE for all standard instructions,
or lowercase for "illegal" 6502 instructions (like "dcp"). If resolving
of data sections has been disabled for any reason, you'll likely see a lot
of illegal opcodes if you scroll to a data table in ROM.</p>
of illegal opcodes if you scroll to a data table in ROM. This can also
occur if the disassembler hasn't yet encountered addresses in the PC.
If you step/trace/scanline/frame advance into such an area, the disassembler
will make note of it, and disassemble it correctly from that point on.</p>
<!-- TODO - is this true any longer?
<p>Beware: the cycle counts don't take into account any penalty cycles
@ -1025,11 +1029,11 @@ matches the address of the disassembly line where the mouse was clicked.</li>
<ul>
<li>The ROM Widget only works on ROM. If your game runs code from zero-page
RAM, the code from RAM will not be shown, and the ROM Widget will not highlight
any instructions. Once your RAM routine returns, the ROM Widget will work
normally again. You can still disassemble RAM with the "disasm" command from
the Prompt.</li>
<li>The ROM Widget only works on ROM or zero-page RAM separately. If your game runs
code from zero-page RAM, the disassembly will show addresses $80 to $FF (zero-page
RAM address space) only. Once your RAM routine returns, the ROM Widget will switch
back to ROM space ($1000 - $1FFF and mirrors). The same is true of the "disasm"
command; it will show either ROM or RAM space, not both at the same time.</li>
<li>The standard VCS memory map has the cartridge port at locations
$F000-$FFFF. However, not all the address lines exist on a 6507, so

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -2027,7 +2027,13 @@
<tr>
<td><pre>-tiadriven &lt;1|0&gt;</pre></td>
<td>Set unused TIA pins to be randomly driven high or low on a read/peek.</td>
<td>Set unused TIA pins to be randomly driven high or low on a read/peek.
If disabled, use the last databus value for those pins instead.</td>
</tr>
<tr>
<td><pre>-ramrandom &lt;1|0&gt;</pre></td>
<td>On reset, either randomize all RAM content, or zero it out instead.</td>
</tr>
<tr>
@ -2152,7 +2158,7 @@
<tr><td>GL VSync</td><td>enable OpenGL vertical synchronization</td><td>-gl_vsync</td></tr>
<tr><td>Grab mouse</td><td>keep mouse in SDL window</td><td>-grabmouse</td></tr>
<tr><td>Show UI messages</td><td>overlay UI messages onscreen</td><td>-uimessages</td></tr>
<tr><td>Center window (*)</td><td>attempt to center SDL window (requires restart)</td><td>-center</td></tr>
<tr><td>Center window</td><td>attempt to center application window</td><td>-center</td></tr>
<tr><td>Fast SC/AR BIOS</td><td>Skip progress loading bars for SuperCharger ROMs</td><td>-fastscbios</td></tr>
</table>
</td>
@ -2315,15 +2321,26 @@
to the selected event. If nothing seems to happen, either Stella
can't see the input device, or the selected event doesn't support being
remapped to the input device.</li>
<li>Erase a mapping by clicking 'Erase', or cancel a remap in progress
by clicking 'Cancel'.</li>
<li>Reset default mappings by clicking 'Defaults'.</li>
<li>Cancel a remap in progress by clicking 'Cancel', erase a mapping by
clicking 'Erase', or reset to default mapping by clicking 'Reset'</li>
<li>Reset to default <b>all</b> mappings by clicking 'Defaults'.</li>
</ol>
<p>The following screenshots illustrate the event remapping process:<br><br>
<img src="graphics/eventmapping.png">
<img src="graphics/eventmapping_remap.png">
<p>There is also a 'Combo' button in the 'Emulation Events' tab, accessible
when a Combo event has been selected from the list of events on the left.
Clicking 'Combo' will show a dialog similar to the following:</p>
<img src="graphics/eventmapping_combo.png">
<p>In this dialog, you can assign various events to the selected combo event.
Note that this simply assigns multiple events to the combo; you still need
to map the combo event itself to some action, as described in the 'remap an
event' section above.</p>
</p>
<p>Virtual devices can be configured under the 'Virtual Devs' tab, shown below:</p>
<table border="5" cellpadding="2" frame="box" rules="none">
<tr>
@ -3199,8 +3216,8 @@ Ms Pac-Man (Stella extended codes):
<tr>
<td VALIGN="TOP">Mark&nbsp;Grebe<br>
(<a href="http://www.atarimac.com">http://www.atarimac.com</a>)</td>
<td>Author of the Macintosh OSX version of Stella starting with the
1.4 release until release 2.4. Helped with Stelladaptor support.</td>
<td>Author of the Macintosh OSX version of Stella from releases
1.4 to 2.4. Helped with Stelladaptor support.</td>
</tr>
<tr>
@ -3242,8 +3259,8 @@ Ms Pac-Man (Stella extended codes):
<tr>
<td VALIGN="TOP">Kostas&nbsp;Nakos</td>
<td>Author/maintainer of the WinCE version of Stella starting with the
2.0 release</td>
<td>Author/maintainer of the WinCE version of Stella from releases 2.0
to 2.3.5</td>
</tr>
<tr>
@ -3281,14 +3298,27 @@ Ms Pac-Man (Stella extended codes):
<td>Author of the OpenStep version of Stella</td>
</tr>
<tr>
<td VALIGN="TOP">Omegamatrix</td>
<td>Provided test ROMs which led to more accurate emulation for SWCHx/SWxCNT
and RIOT behaviour, and for 'illegal' TIA reads</td>
</tr>
<tr>
<td VALIGN="TOP">John&nbsp;Payson</td>
<td>Provided EEPROM emulation code for AtariVox and SaveKey support</td>
</tr>
<tr>
<td VALIGN="TOP">Wilbert&nbsp;Pol</td>
<td>Provided many ideas and some sample algorithms for greatly improving
'illegal HMOVE' emulation</td>
</tr>
<tr>
<td VALIGN="TOP">Manuel&nbsp;Polik</td>
<td>Author of the Windows version of Stella starting with the 1.2 release</td>
<td>Author of the Windows version of Stella (Cyberstella) starting with the 1.2
release until its retirement</td>
</tr>
<tr>
@ -3320,7 +3350,7 @@ Ms Pac-Man (Stella extended codes):
<tr>
<td VALIGN="TOP">Jason&nbsp;Scott</td>
<td>Organizer of the property file archive for early versions of
Stella; now he's helping with the web site</td>
Stella</td>
</tr>
<tr>
@ -3394,7 +3424,8 @@ Ms Pac-Man (Stella extended codes):
<tr>
<td VALIGN="TOP">David&nbsp;Voswinkel</td>
<td>Maintainer of the PSP version of Stella starting with the 2.0 release</td>
<td>Maintainer of the PSP version of Stella starting with the 2.0 release
until release 2.2</td>
</tr>
<tr>
@ -3424,7 +3455,7 @@ Ms Pac-Man (Stella extended codes):
<tr>
<td VALIGN="TOP">Alex&nbsp;Zaballa</td>
<td>Maintainer of the GP2X version of Stella starting with the 2.1 release</td>
<td>Maintainer of the GP2X version of Stella from releases 2.1 to 2.3.5</td>
</tr>
</table>

View File

@ -200,7 +200,7 @@ class Array
}
};
} // Namespace GUI
} // Namespace Common
typedef Common::Array<int> IntArray;
typedef Common::Array<bool> BoolArray;

View File

@ -28,6 +28,8 @@
/**
* Simple fixed size stack class.
*/
namespace Common {
template <class T, int MAX_SIZE = 10>
class FixedStack
{
@ -68,4 +70,6 @@ class FixedStack
int _size;
};
} // Namespace Common
#endif

View File

@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "3.2_test5"
#define STELLA_VERSION "3.2"
#define STELLA_BUILD atoi("$Rev$"+6)
#endif

View File

@ -37,8 +37,8 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const RamAreaList& areas)
for(RamAreaList::const_iterator i = areas.begin(); i != areas.end(); ++i)
addRamArea(i->start, i->size, i->roffset, i->woffset);
// Create an addresslist for each potential bank
for(int i = 0; i < myConsole.cartridge().bankCount(); ++i)
// Create an addresslist for each potential bank, and an extra one for ZP RAM
for(int i = 0; i < myConsole.cartridge().bankCount()+1; ++i)
{
AddressList l;
myEntryAddresses.push_back(l);
@ -46,6 +46,7 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const RamAreaList& areas)
// We know the address for the startup bank right now
myEntryAddresses[myConsole.cartridge().startBank()].push_back(myDebugger.dpeek(0xfffc));
addLabel("START", myDebugger.dpeek(0xfffc));
// Add system equates
for(uInt16 addr = 0x00; addr <= 0x0F; ++addr)
@ -193,55 +194,59 @@ bool CartDebug::disassemble(const string& resolvedata, bool force)
{
// Test current disassembly; don't re-disassemble if it hasn't changed
// Also check if the current PC is in the current list
// Note that for now, we don't re-disassemble if the PC isn't in cart
// address space, since Distella doesn't yet support disassembling from
// zero-page RAM and ROM at the same time
bool bankChanged = myConsole.cartridge().bankChanged();
uInt16 PC = myDebugger.cpuDebug().pc();
int pcline = addressToLine(PC);
bool changed = (force || myConsole.cartridge().bankChanged() ||
(pcline == -1) || mySystem.isPageDirty(0x1000, 0x1FFF));
bool pcfound = (pcline != -1) && ((uInt32)pcline < myDisassembly.list.size()) &&
(myDisassembly.list[pcline].disasm[0] != '.');
bool pagedirty = (PC & 0x1000) ? mySystem.isPageDirty(0x1000, 0x1FFF) :
mySystem.isPageDirty(0x80, 0xFF);
bool changed = (force || bankChanged || !pcfound || pagedirty);
if(changed)
{
AddressList& addresses = myEntryAddresses[getBank()];
// Are we disassembling from ROM or ZP RAM?
AddressList& addresses = (PC & 0x1000) ? myEntryAddresses[getBank()] :
myEntryAddresses[myEntryAddresses.size()-1];
// If the bank has changed, all old addresses must be 'converted'
// If the offset has changed, all old addresses must be 'converted'
// For example, if the list contains any $fxxx and the address space is now
// $bxxx, it must be changed
uInt16 offset = (PC - (PC % 0x1000));
for(uInt32 i = 0; i < addresses.size(); ++i)
addresses[i] = (addresses[i] & 0xFFF) + offset;
for(AddressList::iterator i = addresses.begin(); i != addresses.end(); ++i)
*i = (*i & 0xFFF) + offset;
addresses.push_back_unique(PC);
uInt16 start = addresses[0];
if(pcline == -1 && (PC & 0x1000))
start = PC;
// For now, DiStella can't handle address space below 0x1000
// However, we want to disassemble at least once, otherwise carts
// that run entirely from ZP RAM will have an empty disassembly
// TODO - this will be removed once Distella properly supports
// access below 0x1000
uInt16 search = PC;
if(!(PC & 0x1000))
// Only add addresses when absolutely necessary, to cut down on the
// work that Distella has to do
// Distella expects the addresses to be unique and in sorted order
if(bankChanged || !pcfound)
{
if(myDisassembly.list.size() == 0)
search = start;
else
return false;
AddressList::iterator i;
for(i = addresses.begin(); i != addresses.end(); ++i)
{
if(PC < *i)
{
addresses.insert(i, PC);
break;
}
else if(PC == *i) // already present
break;
}
// Otherwise, add the item at the end
if(i == addresses.end())
addresses.push_back(PC);
}
// Check whether to use the 'resolvedata' functionality from Distella
if(resolvedata == "never")
fillDisassemblyList(addresses, false, search);
fillDisassemblyList(addresses, false, PC);
else if(resolvedata == "always")
fillDisassemblyList(addresses, true, search);
fillDisassemblyList(addresses, true, PC);
else // 'auto'
{
// First try with resolvedata on, then turn off if PC isn't found
if(!fillDisassemblyList(addresses, true, search))
fillDisassemblyList(addresses, false, search);
if(!fillDisassemblyList(addresses, true, PC))
fillDisassemblyList(addresses, false, PC);
}
}
@ -249,14 +254,13 @@ bool CartDebug::disassemble(const string& resolvedata, bool force)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartDebug::fillDisassemblyList(const AddressList& addresses,
bool CartDebug::fillDisassemblyList(AddressList& addresses,
bool resolvedata, uInt16 search)
{
bool found = false;
myDisassembly.list.clear();
myDisassembly.fieldwidth = 10 + myLabelLength;
cerr << "start (" << getBank() << "): ";
DiStella distella(*this, myDisassembly.list, addresses, resolvedata);
// Parts of the disassembly will be accessed later in different ways
@ -556,7 +560,7 @@ CartDebug::AddrType CartDebug::addressType(uInt16 addr) const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartDebug::extractLabel(char *c) const
string CartDebug::extractLabel(const char *c) const
{
string l = "";
while(*c != ' ')
@ -566,7 +570,7 @@ string CartDebug::extractLabel(char *c) const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int CartDebug::extractValue(char *c) const
int CartDebug::extractValue(const char *c) const
{
while(*c != ' ')
{

View File

@ -23,6 +23,8 @@
class System;
#include <map>
#include <set>
#include <list>
#include "bspf.hxx"
#include "Array.hxx"
@ -31,7 +33,7 @@ class System;
#include "DebuggerSystem.hxx"
// Array of addresses
typedef Common::Array<uInt16> AddressList;
typedef list<uInt16> AddressList;
// pointer types for CartDebug instance methods
typedef int (CartDebug::*CARTDEBUG_INT_METHOD)();
@ -212,12 +214,12 @@ class CartDebug : public DebuggerSystem
// Actually call DiStella to fill the DisassemblyList structure
// Return whether the search address was actually in the list
bool fillDisassemblyList(const AddressList& addresses,
bool fillDisassemblyList(AddressList& addresses,
bool resolvedata, uInt16 search);
// Extract labels and values from the given character stream
string extractLabel(char *c) const;
int extractValue(char *c) const;
string extractLabel(const char* c) const;
int extractValue(const char* c) const;
private:
CartState myState;

View File

@ -23,19 +23,16 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
const AddressList& addresses, bool resolvedata)
AddressList& addresses, bool resolvedata)
: myDbg(dbg),
myList(list)
{
if(addresses.size() == 0)
return;
while(!myAddressQueue.empty())
myAddressQueue.pop();
myAppData.start = 0x0000;
myAppData.end = 0x0FFF;
myAppData.length = 4096;
memset(labels, 0, 0x1000);
/*============================================
The offset is the address where the code segment
starts. For a 4K game, it is usually 0xf000,
@ -53,17 +50,26 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
Offset to code = $D000
Code range = $D000-$DFFF
=============================================*/
if(addresses.size() == 0)
return;
uInt16 start = addresses[0];
AddressList::iterator it = addresses.begin();
uInt16 start = *it++;
if(start & 0x1000) // ROM space
{
myAppData.start = 0x0000;
myAppData.end = 0x0FFF;
myAppData.length = 4096;
}
else // ZP RAM
{
myAppData.start = 0x0080;
myAppData.end = 0x00FF;
myAppData.length = 128;
}
memset(labels, 0, 0x1000);
myOffset = (start - (start % 0x1000));
// Fill queue with start addresses (entry points into the ROM space)
for(uInt32 i = 0; i < addresses.size(); ++i)
{ cerr << hex << addresses[i] << " ";
myAddressQueue.push(addresses[i]);
} cerr << endl;
myAddressQueue.push(start);
if(resolvedata)
{
@ -75,8 +81,36 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
disasm(myPC, 1);
for (uInt32 k = myPCBeg; k <= myPCEnd; k++)
mark(k, REACHABLE);
// When we get to this point, all addresses have been processed
// starting from the initial one in the address list
// If so, process the next one in the list that hasn't already
// been marked as REACHABLE
// If it *has* been marked, it can be removed from consideration
// in all subsequent passes
//
// Note that we can't simply add all addresses right away, since
// the processing of a single address from the address list can
// cause others to be added in the ::disasm method
// All of these have to be exhausted before consulting the address
// list again
if(myAddressQueue.empty())
{
while(it != addresses.end())
{
uInt16 addr = *it;
if(!check_bit(labels[addr-myOffset], REACHABLE))
{
myAddressQueue.push(addr);
++it;
break;
}
else // remove this address, it is redundant
it = addresses.erase(it);
}
}
}
for (int k = 0; k <= myAppData.end; k++)
{
if (!check_bit(labels[k], REACHABLE))
@ -615,8 +649,6 @@ int DiStella::mark(uInt32 address, MarkType bit)
===========================================================
$00-$3d = system equates (WSYNC, etc...); mark the array's element
with the appropriate bit; return 2.
$0080-$00FF = zero-page RAM; mark the array's element
with the appropriate bit; return 5.
$0280-$0297 = system equates (INPT0, etc...); mark the array's element
with the appropriate bit; return 3.
$1000-$1FFF = CODE/DATA, mark the code/data array for the mirrored address
@ -648,12 +680,6 @@ int DiStella::mark(uInt32 address, MarkType bit)
{
return 2;
}
/* This isn't supported by the core code yet, so why waste time checking
else if (address >= 0x80 && address <= 0xff)
{
return 5;
}
*/
else if (address >= 0x280 && address <= 0x297)
{
return 3;
@ -700,13 +726,29 @@ void DiStella::addEntry()
else
myDisasmBuf >> setw(4) >> hex >> tag.address;
// Only include addresses within the requested range
if(tag.address < myAppData.start)
goto DONE_WITH_ADD;
// Label (a user-defined label always overrides any auto-generated one)
myDisasmBuf.seekg(5, ios::beg);
if(tag.address)
{
tag.label = myDbg.getLabel(tag.address, true);
if(tag.label == EmptyString && myDisasmBuf.peek() != ' ')
getline(myDisasmBuf, tag.label, '\'');
if(tag.label == EmptyString)
{
if(myDisasmBuf.peek() != ' ')
getline(myDisasmBuf, tag.label, '\'');
else
{
#if 0
// FIXME - optimize this, and add as an option
stringstream str;
str << setw(4) << hex << tag.address;
str >> tag.label;
#endif
}
}
}
// Disassembly
@ -729,6 +771,7 @@ void DiStella::addEntry()
}
myList.push_back(tag);
DONE_WITH_ADD:
myDisasmBuf.clear();
myDisasmBuf.str("");
}

View File

@ -52,7 +52,7 @@ class DiStella
@param resolvedata If enabled, try to determine code vs. data sections
*/
DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
const AddressList& addresses, bool resolvedata = true);
AddressList& addresses, bool resolvedata = true);
~DiStella();

View File

@ -137,59 +137,59 @@ Cartridge* Cartridge::create(const uInt8* image, uInt32 size, string& md5,
// We should know the cart's type by now so let's create it
if(type == "2K")
cartridge = new Cartridge2K(image, size);
cartridge = new Cartridge2K(image, size, settings);
else if(type == "3E")
cartridge = new Cartridge3E(image, size);
cartridge = new Cartridge3E(image, size, settings);
else if(type == "3F")
cartridge = new Cartridge3F(image, size);
cartridge = new Cartridge3F(image, size, settings);
else if(type == "4A50")
cartridge = new Cartridge4A50(image, size);
cartridge = new Cartridge4A50(image, size, settings);
else if(type == "4K")
cartridge = new Cartridge4K(image);
cartridge = new Cartridge4K(image, settings);
else if(type == "AR")
cartridge = new CartridgeAR(image, size, settings);
else if(type == "DPC")
cartridge = new CartridgeDPC(image, size);
cartridge = new CartridgeDPC(image, size, settings);
else if(type == "DPC+")
cartridge = new CartridgeDPCPlus(image, size);
cartridge = new CartridgeDPCPlus(image, size, settings);
else if(type == "E0")
cartridge = new CartridgeE0(image);
cartridge = new CartridgeE0(image, settings);
else if(type == "E7")
cartridge = new CartridgeE7(image);
cartridge = new CartridgeE7(image, settings);
else if(type == "EF")
cartridge = new CartridgeEF(image);
cartridge = new CartridgeEF(image, settings);
else if(type == "EFSC")
cartridge = new CartridgeEFSC(image);
cartridge = new CartridgeEFSC(image, settings);
else if(type == "F4")
cartridge = new CartridgeF4(image);
cartridge = new CartridgeF4(image, settings);
else if(type == "F4SC")
cartridge = new CartridgeF4SC(image);
cartridge = new CartridgeF4SC(image, settings);
else if(type == "F6")
cartridge = new CartridgeF6(image);
cartridge = new CartridgeF6(image, settings);
else if(type == "F6SC")
cartridge = new CartridgeF6SC(image);
cartridge = new CartridgeF6SC(image, settings);
else if(type == "F8")
cartridge = new CartridgeF8(image, md5);
cartridge = new CartridgeF8(image, md5, settings);
else if(type == "F8SC")
cartridge = new CartridgeF8SC(image);
cartridge = new CartridgeF8SC(image, settings);
else if(type == "FA" || type == "FASC")
cartridge = new CartridgeFA(image);
cartridge = new CartridgeFA(image, settings);
else if(type == "FE")
cartridge = new CartridgeFE(image);
cartridge = new CartridgeFE(image, settings);
else if(type == "MC")
cartridge = new CartridgeMC(image, size);
cartridge = new CartridgeMC(image, size, settings);
else if(type == "F0" || type == "MB")
cartridge = new CartridgeF0(image);
cartridge = new CartridgeF0(image, settings);
else if(type == "CV")
cartridge = new CartridgeCV(image, size);
cartridge = new CartridgeCV(image, size, settings);
else if(type == "UA")
cartridge = new CartridgeUA(image);
cartridge = new CartridgeUA(image, settings);
else if(type == "0840")
cartridge = new Cartridge0840(image);
cartridge = new Cartridge0840(image, settings);
else if(type == "SB")
cartridge = new CartridgeSB(image, size);
cartridge = new CartridgeSB(image, size, settings);
else if(type == "X07")
cartridge = new CartridgeX07(image);
cartridge = new CartridgeX07(image, settings);
else
cerr << "ERROR: Invalid cartridge type " << type << " ..." << endl;
@ -227,8 +227,9 @@ string Cartridge::createFromMultiCart(const uInt8*& image, uInt32& size,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge::Cartridge()
: myStartBank(0),
Cartridge::Cartridge(const Settings& settings)
: mySettings(settings),
myStartBank(0),
myBankChanged(true),
myBankLocked(false)
{
@ -694,7 +695,8 @@ bool Cartridge::isProbablyX07(const uInt8* image, uInt32 size)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge::Cartridge(const Cartridge&)
Cartridge::Cartridge(const Cartridge& cart)
: mySettings(cart.mySettings)
{
assert(false);
}

View File

@ -25,11 +25,11 @@
class Cartridge;
class Properties;
class Settings;
#include "bspf.hxx"
#include "Array.hxx"
#include "Device.hxx"
#include "Settings.hxx"
#ifdef DEBUGGER_SUPPORT
struct RamArea {
@ -69,8 +69,10 @@ class Cartridge : public Device
/**
Create a new cartridge
@param settings A reference to the various settings (read-only)
*/
Cartridge();
Cartridge(const Settings& settings);
/**
Destructor
@ -321,6 +323,9 @@ class Cartridge : public Device
static bool isProbablyX07(const uInt8* image, uInt32 size);
protected:
// Settings class for the application
const Settings& mySettings;
// The startup bank to use (where to look for the reset vector address)
uInt16 myStartBank;

View File

@ -24,7 +24,8 @@
#include "Cart0840.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge0840::Cartridge0840(const uInt8* image)
Cartridge0840::Cartridge0840(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 8192);

View File

@ -36,9 +36,10 @@ class Cartridge0840 : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
Cartridge0840(const uInt8* image);
Cartridge0840(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "Cart2K.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge2K::Cartridge2K(const uInt8* image, uInt32 size)
Cartridge2K::Cartridge2K(const uInt8* image, uInt32 size, const Settings& settings)
: Cartridge(settings)
{
// Size can be a maximum of 2K
if(size > 2048) size = 2048;

View File

@ -39,10 +39,11 @@ class Cartridge2K : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param size The size of the ROM image (<= 2048 bytes)
@param image Pointer to the ROM image
@param size The size of the ROM image (<= 2048 bytes)
@param settings A reference to the various settings (read-only)
*/
Cartridge2K(const uInt8* image, uInt32 size);
Cartridge2K(const uInt8* image, uInt32 size, const Settings& settings);
/**
Destructor

View File

@ -25,8 +25,10 @@
#include "Cart3E.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge3E::Cartridge3E(const uInt8* image, uInt32 size)
: mySize(size)
Cartridge3E::Cartridge3E(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
mySize(size)
{
// Allocate array for the ROM image
myImage = new uInt8[mySize];
@ -52,9 +54,12 @@ Cartridge3E::~Cartridge3E()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge3E::reset()
{
// Initialize RAM with random values
for(uInt32 i = 0; i < 32768; ++i)
myRam[i] = mySystem->randGenerator().next();
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 32768; ++i)
myRam[i] = mySystem->randGenerator().next();
else
memset(myRam, 0, 32768);
// We'll map the startup bank into the first segment upon reset
bank(myStartBank);

View File

@ -67,10 +67,11 @@ class Cartridge3E : public Cartridge
/**
Create a new cartridge using the specified image and size
@param image Pointer to the ROM image
@param size The size of the ROM image
@param image Pointer to the ROM image
@param size The size of the ROM image
@param settings A reference to the various settings (read-only)
*/
Cartridge3E(const uInt8* image, uInt32 size);
Cartridge3E(const uInt8* image, uInt32 size, const Settings& settings);
/**
Destructor

View File

@ -25,8 +25,10 @@
#include "Cart3F.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge3F::Cartridge3F(const uInt8* image, uInt32 size)
: mySize(size)
Cartridge3F::Cartridge3F(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
mySize(size)
{
// Allocate array for the ROM image
myImage = new uInt8[mySize];

View File

@ -44,10 +44,11 @@ class Cartridge3F : public Cartridge
/**
Create a new cartridge using the specified image and size
@param image Pointer to the ROM image
@param size The size of the ROM image
@param image Pointer to the ROM image
@param size The size of the ROM image
@param settings A reference to the various settings (read-only)
*/
Cartridge3F(const uInt8* image, uInt32 size);
Cartridge3F(const uInt8* image, uInt32 size, const Settings& settings);
/**
Destructor

View File

@ -26,7 +26,9 @@
#include "Cart4A50.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge4A50::Cartridge4A50(const uInt8* image, uInt32 size)
Cartridge4A50::Cartridge4A50(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
// Supported file sizes are 32/64/128K, which are duplicated if necessary
@ -45,9 +47,12 @@ Cartridge4A50::~Cartridge4A50()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge4A50::reset()
{
// Initialize RAM with random values
for(uInt32 i = 0; i < 32768; ++i)
myRAM[i] = mySystem->randGenerator().next();
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 32768; ++i)
myRAM[i] = mySystem->randGenerator().next();
else
memset(myRAM, 0, 32768);
mySliceLow = mySliceMiddle = mySliceHigh = 0;
myIsRomLow = myIsRomMiddle = myIsRomHigh = true;

View File

@ -52,10 +52,11 @@ class Cartridge4A50 : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param size The size of the ROM image
@param image Pointer to the ROM image
@param size The size of the ROM image
@param settings A reference to the various settings (read-only)
*/
Cartridge4A50(const uInt8* image, uInt32 size);
Cartridge4A50(const uInt8* image, uInt32 size, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "Cart4K.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cartridge4K::Cartridge4K(const uInt8* image)
Cartridge4K::Cartridge4K(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 4096);

View File

@ -38,9 +38,10 @@ class Cartridge4K : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
Cartridge4K(const uInt8* image);
Cartridge4K(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -27,8 +27,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeAR::CartridgeAR(const uInt8* image, uInt32 size,
const Settings& settings)
: my6502(0),
mySettings(settings)
: Cartridge(settings),
my6502(0)
{
// Minimum size supported internally is 8448 bytes
uInt32 minsize = BSPF_max(size, 8448u);
@ -52,9 +52,12 @@ CartridgeAR::~CartridgeAR()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeAR::reset()
{
// Initialize RAM with random values
for(uInt32 i = 0; i < 6 * 1024; ++i)
myImage[i] = mySystem->randGenerator().next();
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 6 * 1024; ++i)
myImage[i] = mySystem->randGenerator().next();
else
memset(myImage, 0, 6 * 1024);
// Initialize SC BIOS ROM
initializeROM();

View File

@ -47,7 +47,7 @@ class CartridgeAR : public Cartridge
@param image Pointer to the ROM image
@param size The size of the ROM image
@param settings Used to query 'fastscbios' option
@param settings A reference to the various settings (read-only)
*/
CartridgeAR(const uInt8* image, uInt32 size, const Settings& settings);
@ -168,9 +168,6 @@ class CartridgeAR : public Cartridge
// Pointer to the 6502 processor in the system
M6502* my6502;
// Reference to the settings object (needed for 'fastscbios'
const Settings& mySettings;
// Indicates the offest within the image for the corresponding bank
uInt32 myImageOffset[2];

View File

@ -24,8 +24,10 @@
#include "CartCV.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeCV::CartridgeCV(const uInt8* image, uInt32 size)
: myInitialRAM(0),
CartridgeCV::CartridgeCV(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
myInitialRAM(0),
mySize(size)
{
if(mySize == 2048)
@ -66,9 +68,12 @@ void CartridgeCV::reset()
}
else
{
// Initialize RAM with random values
for(uInt32 i = 0; i < 1024; ++i)
myRAM[i] = mySystem->randGenerator().next();
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 1024; ++i)
myRAM[i] = mySystem->randGenerator().next();
else
memset(myRAM, 0, 1024);
}
myBankChanged = true;

View File

@ -41,9 +41,11 @@ class CartridgeCV : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param size The size of the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeCV(const uInt8* image, uInt32 size);
CartridgeCV(const uInt8* image, uInt32 size, const Settings& settings);
/**
Destructor

View File

@ -24,8 +24,10 @@
#include "CartDPC.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDPC::CartridgeDPC(const uInt8* image, uInt32 size)
: mySystemCycles(0),
CartridgeDPC::CartridgeDPC(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
mySystemCycles(0),
myFractionalClocks(0.0)
{
// Make a copy of the entire image

View File

@ -39,9 +39,11 @@ class CartridgeDPC : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param size The size of the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeDPC(const uInt8* image, uInt32 size);
CartridgeDPC(const uInt8* image, uInt32 size, const Settings& settings);
/**
Destructor

View File

@ -24,8 +24,10 @@
#include "CartDPCPlus.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size)
: myFastFetch(false),
CartridgeDPCPlus::CartridgeDPCPlus(const uInt8* image, uInt32 size,
const Settings& settings)
: Cartridge(settings),
myFastFetch(false),
myLDAimmediate(false),
myParameter(0),
mySystemCycles(0),

View File

@ -39,9 +39,11 @@ class CartridgeDPCPlus : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param size The size of the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeDPCPlus(const uInt8* image, uInt32 size);
CartridgeDPCPlus(const uInt8* image, uInt32 size, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "CartE0.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeE0::CartridgeE0(const uInt8* image)
CartridgeE0::CartridgeE0(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 8192);

View File

@ -47,9 +47,10 @@ class CartridgeE0 : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeE0(const uInt8* image);
CartridgeE0(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "CartE7.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeE7::CartridgeE7(const uInt8* image)
CartridgeE7::CartridgeE7(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 16384);
@ -48,9 +49,12 @@ CartridgeE7::~CartridgeE7()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeE7::reset()
{
// Initialize RAM with random values
for(uInt32 i = 0; i < 2048; ++i)
myRAM[i] = mySystem->randGenerator().next();
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 2048; ++i)
myRAM[i] = mySystem->randGenerator().next();
else
memset(myRAM, 0, 2048);
// Install some default banks for the RAM and first segment
bankRAM(0);

View File

@ -64,9 +64,10 @@ class CartridgeE7 : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeE7(const uInt8* image);
CartridgeE7(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "CartEF.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeEF::CartridgeEF(const uInt8* image)
CartridgeEF::CartridgeEF(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 65536);

View File

@ -42,9 +42,10 @@ class CartridgeEF : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeEF(const uInt8* image);
CartridgeEF(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "CartEFSC.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeEFSC::CartridgeEFSC(const uInt8* image)
CartridgeEFSC::CartridgeEFSC(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 65536);
@ -44,9 +45,12 @@ CartridgeEFSC::~CartridgeEFSC()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEFSC::reset()
{
// Initialize RAM with random values
for(uInt32 i = 0; i < 128; ++i)
myRAM[i] = mySystem->randGenerator().next();
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 128; ++i)
myRAM[i] = mySystem->randGenerator().next();
else
memset(myRAM, 0, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);

View File

@ -42,9 +42,10 @@ class CartridgeEFSC : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeEFSC(const uInt8* image);
CartridgeEFSC(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "CartF0.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF0::CartridgeF0(const uInt8* image)
CartridgeF0::CartridgeF0(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 65536);

View File

@ -39,9 +39,10 @@ class CartridgeF0 : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeF0(const uInt8* image);
CartridgeF0(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -25,7 +25,8 @@
#include "CartF4.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF4::CartridgeF4(const uInt8* image)
CartridgeF4::CartridgeF4(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 32768);

View File

@ -38,9 +38,10 @@ class CartridgeF4 : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeF4(const uInt8* image);
CartridgeF4(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "CartF4SC.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF4SC::CartridgeF4SC(const uInt8* image)
CartridgeF4SC::CartridgeF4SC(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 32768);
@ -44,9 +45,12 @@ CartridgeF4SC::~CartridgeF4SC()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF4SC::reset()
{
// Initialize RAM with random values
for(uInt32 i = 0; i < 128; ++i)
myRAM[i] = mySystem->randGenerator().next();
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 128; ++i)
myRAM[i] = mySystem->randGenerator().next();
else
memset(myRAM, 0, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);

View File

@ -38,9 +38,10 @@ class CartridgeF4SC : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeF4SC(const uInt8* image);
CartridgeF4SC(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "CartF6.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF6::CartridgeF6(const uInt8* image)
CartridgeF6::CartridgeF6(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 16384);

View File

@ -38,9 +38,10 @@ class CartridgeF6 : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeF6(const uInt8* image);
CartridgeF6(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,8 @@
#include "CartF6SC.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF6SC::CartridgeF6SC(const uInt8* image)
CartridgeF6SC::CartridgeF6SC(const uInt8* image, const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 16384);
@ -44,9 +45,12 @@ CartridgeF6SC::~CartridgeF6SC()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF6SC::reset()
{
// Initialize RAM with random values
for(uInt32 i = 0; i < 128; ++i)
myRAM[i] = mySystem->randGenerator().next();
// Initialize RAM
if(mySettings.getBool("ramrandom"))
for(uInt32 i = 0; i < 128; ++i)
myRAM[i] = mySystem->randGenerator().next();
else
memset(myRAM, 0, 128);
// Upon reset we switch to the startup bank
bank(myStartBank);

View File

@ -38,9 +38,10 @@ class CartridgeF6SC : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param image Pointer to the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeF6SC(const uInt8* image);
CartridgeF6SC(const uInt8* image, const Settings& settings);
/**
Destructor

View File

@ -24,7 +24,9 @@
#include "CartF8.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartridgeF8::CartridgeF8(const uInt8* image, const string& md5)
CartridgeF8::CartridgeF8(const uInt8* image, const string& md5,
const Settings& settings)
: Cartridge(settings)
{
// Copy the ROM image into my buffer
memcpy(myImage, image, 8192);

View File

@ -38,10 +38,11 @@ class CartridgeF8 : public Cartridge
/**
Create a new cartridge using the specified image
@param image Pointer to the ROM image
@param md5 MD5sum of the ROM image
@param image Pointer to the ROM image
@param md5 MD5sum of the ROM image
@param settings A reference to the various settings (read-only)
*/
CartridgeF8(const uInt8* image, const string& md5);
CartridgeF8(const uInt8* image, const string& md5, const Settings& settings);
/**
Destructor

Some files were not shown because too many files have changed in this diff Show More