mirror of https://github.com/stella-emu/stella.git
parent
4a09170877
commit
147db10732
|
@ -2267,23 +2267,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Go to parent directory (also in other file dialogs)</td>
|
<td>Go to parent directory (also in other file dialogs)</td>
|
||||||
<td>Backspace, Alt + Up arrow</td>
|
<td>Backspace</td>
|
||||||
<td>Backspace, Alt + Up arrow</td>
|
<td>Backspace</td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Go to home directory</td>
|
|
||||||
<td>Alt + Home</td>
|
|
||||||
<td>Alt + Home</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Go to previous directory in history</td>
|
|
||||||
<td>Alt + Left arrow</td>
|
|
||||||
<td>Alt + Left arrow</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Go to next directory in history</td>
|
|
||||||
<td>Alt + Right arrow</td>
|
|
||||||
<td>Alt + Right arrow</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Remove from 'Recently Played' or 'Most Popular' folder</td>
|
<td>Remove from 'Recently Played' or 'Most Popular' folder</td>
|
||||||
|
|
|
@ -67,9 +67,9 @@ CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size,
|
||||||
reinterpret_cast<uInt16*>(myImage.get()),
|
reinterpret_cast<uInt16*>(myImage.get()),
|
||||||
reinterpret_cast<uInt16*>(myRAM.data()),
|
reinterpret_cast<uInt16*>(myRAM.data()),
|
||||||
static_cast<uInt32>(32_KB),
|
static_cast<uInt32>(32_KB),
|
||||||
Thumbulator::rom_base + 0x0800,
|
0x00000800,
|
||||||
Thumbulator::rom_base + 0x0808,
|
0x00000808,
|
||||||
Thumbulator::ram_base + 0x1FDC,
|
0x40001FDC,
|
||||||
devSettings ? settings.getBool("dev.thumb.trapfatal") : false,
|
devSettings ? settings.getBool("dev.thumb.trapfatal") : false,
|
||||||
devSettings ? static_cast<double>(
|
devSettings ? static_cast<double>(
|
||||||
settings.getFloat("dev.thumb.cyclefactor")) : 1.0,
|
settings.getFloat("dev.thumb.cyclefactor")) : 1.0,
|
||||||
|
@ -256,8 +256,8 @@ uInt8 CartridgeBUS::peek(uInt16 address)
|
||||||
// get sample value from ROM or RAM
|
// get sample value from ROM or RAM
|
||||||
if (sampleaddress < 0x8000)
|
if (sampleaddress < 0x8000)
|
||||||
peekvalue = myImage[sampleaddress];
|
peekvalue = myImage[sampleaddress];
|
||||||
else if (sampleaddress >= Thumbulator::ram_base && sampleaddress < Thumbulator::ram_base + 0x2000) // check for RAM
|
else if (sampleaddress >= 0x40000000 && sampleaddress < 0x40002000) // check for RAM
|
||||||
peekvalue = myRAM[sampleaddress - Thumbulator::ram_base];
|
peekvalue = myRAM[sampleaddress - 0x40000000];
|
||||||
else
|
else
|
||||||
peekvalue = 0;
|
peekvalue = 0;
|
||||||
|
|
||||||
|
@ -707,7 +707,7 @@ uInt32 CartridgeBUS::getWaveform(uInt8 index) const
|
||||||
(myRAM[WAVEFORM + index*4 + 2] << 16) +
|
(myRAM[WAVEFORM + index*4 + 2] << 16) +
|
||||||
(myRAM[WAVEFORM + index*4 + 3] << 24); // high byte
|
(myRAM[WAVEFORM + index*4 + 3] << 24); // high byte
|
||||||
|
|
||||||
result -= Thumbulator::ram_base + 0x0800;
|
result -= 0x40000800;
|
||||||
|
|
||||||
if (result >= 4096)
|
if (result >= 4096)
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
|
@ -90,13 +90,13 @@ CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size,
|
||||||
// C addresses
|
// C addresses
|
||||||
uInt32 cBase, cStart, cStack;
|
uInt32 cBase, cStart, cStack;
|
||||||
if (isCDFJplus()) {
|
if (isCDFJplus()) {
|
||||||
cBase = Thumbulator::rom_base + getUInt32(myImage.get(), 0x17F8) & 0x0FFFFFFE; // C Base Address
|
cBase = getUInt32(myImage.get(), 0x17F8) & 0xFFFFFFFE; // C Base Address
|
||||||
cStart = cBase; // C Start Address
|
cStart = cBase; // C Start Address
|
||||||
cStack = Thumbulator::ram_base + (getUInt32(myImage.get(), 0x17F4) & 0x0FFFFFFF); // C Stack
|
cStack = getUInt32(myImage.get(), 0x17F4); // C Stack
|
||||||
} else {
|
} else {
|
||||||
cBase = Thumbulator::rom_base + 0x800; // C Base Address
|
cBase = 0x800; // C Base Address
|
||||||
cStart = Thumbulator::rom_base + 0x808; // C Start Address (skip ARM header)
|
cStart = 0x808; // C Start Address (skip ARM header)
|
||||||
cStack = Thumbulator::ram_base + 0x1FDC; // C Stack
|
cStack = 0x40001FDC; // C Stack
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Thumbulator ARM emulator
|
// Create Thumbulator ARM emulator
|
||||||
|
@ -296,8 +296,8 @@ uInt8 CartridgeCDF::peek(uInt16 address)
|
||||||
// get sample value from ROM or RAM
|
// get sample value from ROM or RAM
|
||||||
if (sampleaddress < 0x00080000)
|
if (sampleaddress < 0x00080000)
|
||||||
peekvalue = myImage[sampleaddress];
|
peekvalue = myImage[sampleaddress];
|
||||||
else if (sampleaddress >= Thumbulator::ram_base && sampleaddress < Thumbulator::ram_base + 0x8000) // check for RAM
|
else if (sampleaddress >= 0x40000000 && sampleaddress < 0x40008000) // check for RAM
|
||||||
peekvalue = myRAM[sampleaddress - Thumbulator::ram_base];
|
peekvalue = myRAM[sampleaddress - 0x40000000];
|
||||||
else
|
else
|
||||||
peekvalue = 0;
|
peekvalue = 0;
|
||||||
|
|
||||||
|
@ -677,7 +677,7 @@ uInt32 CartridgeCDF::getWaveform(uInt8 index) const
|
||||||
(myRAM[address + 2] << 16) +
|
(myRAM[address + 2] << 16) +
|
||||||
(myRAM[address + 3] << 24); // high byte
|
(myRAM[address + 3] << 24); // high byte
|
||||||
|
|
||||||
result -= (Thumbulator::ram_base + uInt32(2_KB));
|
result -= (0x40000000 + uInt32(2_KB));
|
||||||
|
|
||||||
if (!isCDFJplus()) {
|
if (!isCDFJplus()) {
|
||||||
if (result >= 4096) {
|
if (result >= 4096) {
|
||||||
|
|
|
@ -53,9 +53,9 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size,
|
||||||
(reinterpret_cast<uInt16*>(myImage.get()),
|
(reinterpret_cast<uInt16*>(myImage.get()),
|
||||||
reinterpret_cast<uInt16*>(myDPCRAM.data()),
|
reinterpret_cast<uInt16*>(myDPCRAM.data()),
|
||||||
static_cast<uInt32>(32_KB),
|
static_cast<uInt32>(32_KB),
|
||||||
Thumbulator::rom_base + 0x0C00,
|
0x00000C00,
|
||||||
Thumbulator::rom_base + 0x0C08,
|
0x00000C08,
|
||||||
Thumbulator::ram_base + 0x1FDC,
|
0x40001FDC,
|
||||||
devSettings ? settings.getBool("dev.thumb.trapfatal") : false,
|
devSettings ? settings.getBool("dev.thumb.trapfatal") : false,
|
||||||
devSettings ? static_cast<double>(
|
devSettings ? static_cast<double>(
|
||||||
settings.getFloat("dev.thumb.cyclefactor")) : 1.0,
|
settings.getFloat("dev.thumb.cyclefactor")) : 1.0,
|
||||||
|
|
|
@ -123,8 +123,6 @@ using Common::Base;
|
||||||
#define INC_ARM_CYCLES(m)
|
#define INC_ARM_CYCLES(m)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define UNSAFE_OPTIMIZATIONS
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
|
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
|
||||||
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
||||||
|
@ -327,7 +325,7 @@ uInt32 Thumbulator::fetch16(uInt32 addr)
|
||||||
|
|
||||||
switch(addr & 0xF0000000)
|
switch(addr & 0xF0000000)
|
||||||
{
|
{
|
||||||
case rom_base: //ROM
|
case 0x00000000: //ROM
|
||||||
addr &= ROMADDMASK;
|
addr &= ROMADDMASK;
|
||||||
if(addr < 0x50)
|
if(addr < 0x50)
|
||||||
fatalError("fetch16", addr, "abort");
|
fatalError("fetch16", addr, "abort");
|
||||||
|
@ -336,7 +334,7 @@ uInt32 Thumbulator::fetch16(uInt32 addr)
|
||||||
DO_DBUG(statusMsg << "fetch16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl);
|
DO_DBUG(statusMsg << "fetch16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl);
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
case ram_base: //RAM
|
case 0x40000000: //RAM
|
||||||
addr &= RAMADDMASK;
|
addr &= RAMADDMASK;
|
||||||
addr >>= 1;
|
addr >>= 1;
|
||||||
data = CONV_RAMROM(ram[addr]);
|
data = CONV_RAMROM(ram[addr]);
|
||||||
|
@ -355,7 +353,7 @@ uInt32 Thumbulator::fetch16(uInt32 addr)
|
||||||
void Thumbulator::write16(uInt32 addr, uInt32 data)
|
void Thumbulator::write16(uInt32 addr, uInt32 data)
|
||||||
{
|
{
|
||||||
#ifndef UNSAFE_OPTIMIZATIONS
|
#ifndef UNSAFE_OPTIMIZATIONS
|
||||||
if((addr > Thumbulator::ram_base + 0x7fff) && (addr < Thumbulator::ram_base + 0x10000000))
|
if((addr > 0x40007fff) && (addr < 0x50000000))
|
||||||
fatalError("write16", addr, "abort - out of range");
|
fatalError("write16", addr, "abort - out of range");
|
||||||
|
|
||||||
if (isProtected(addr)) fatalError("write16", addr, "to driver area");
|
if (isProtected(addr)) fatalError("write16", addr, "to driver area");
|
||||||
|
@ -371,7 +369,7 @@ void Thumbulator::write16(uInt32 addr, uInt32 data)
|
||||||
|
|
||||||
switch(addr & 0xF0000000)
|
switch(addr & 0xF0000000)
|
||||||
{
|
{
|
||||||
case ram_base: //RAM
|
case 0x40000000: //RAM
|
||||||
addr &= RAMADDMASK;
|
addr &= RAMADDMASK;
|
||||||
addr >>= 1;
|
addr >>= 1;
|
||||||
ram[addr] = CONV_DATA(data);
|
ram[addr] = CONV_DATA(data);
|
||||||
|
@ -533,7 +531,7 @@ void Thumbulator::write32(uInt32 addr, uInt32 data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef UNSAFE_OPTIMIZATIONS
|
#ifndef UNSAFE_OPTIMIZATIONS
|
||||||
case ram_base: //RAM
|
case 0x40000000: //RAM
|
||||||
#else
|
#else
|
||||||
default:
|
default:
|
||||||
#endif
|
#endif
|
||||||
|
@ -550,8 +548,8 @@ void Thumbulator::write32(uInt32 addr, uInt32 data)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool Thumbulator::isProtected(uInt32 addr)
|
bool Thumbulator::isProtected(uInt32 addr)
|
||||||
{
|
{
|
||||||
if (addr < ram_base) return false;
|
if (addr < 0x40000000) return false;
|
||||||
addr -= ram_base;
|
addr -= 0x40000000;
|
||||||
|
|
||||||
switch (configuration) {
|
switch (configuration) {
|
||||||
case ConfigureFor::DPCplus:
|
case ConfigureFor::DPCplus:
|
||||||
|
@ -580,9 +578,9 @@ uInt32 Thumbulator::read16(uInt32 addr)
|
||||||
{
|
{
|
||||||
uInt32 data;
|
uInt32 data;
|
||||||
#ifndef UNSAFE_OPTIMIZATIONS
|
#ifndef UNSAFE_OPTIMIZATIONS
|
||||||
if((addr > Thumbulator::ram_base + 0x7fff) && (addr < Thumbulator::ram_base + 0x10000000))
|
if((addr > 0x40007fff) && (addr < 0x50000000))
|
||||||
fatalError("read16", addr, "abort - out of range");
|
fatalError("read16", addr, "abort - out of range");
|
||||||
else if((addr > Thumbulator::rom_base + 0x0007ffff) && (addr < Thumbulator::rom_base + 0x10000000))
|
else if((addr > 0x0007ffff) && (addr < 0x10000000))
|
||||||
fatalError("read16", addr, "abort - out of range");
|
fatalError("read16", addr, "abort - out of range");
|
||||||
if(addr & 1)
|
if(addr & 1)
|
||||||
fatalError("read16", addr, "abort - misaligned");
|
fatalError("read16", addr, "abort - misaligned");
|
||||||
|
@ -593,16 +591,14 @@ uInt32 Thumbulator::read16(uInt32 addr)
|
||||||
|
|
||||||
switch(addr & 0xF0000000)
|
switch(addr & 0xF0000000)
|
||||||
{
|
{
|
||||||
//case 0x00000000: //ROM
|
case 0x00000000: //ROM
|
||||||
case rom_base: //ROM
|
|
||||||
addr &= ROMADDMASK;
|
addr &= ROMADDMASK;
|
||||||
addr >>= 1;
|
addr >>= 1;
|
||||||
data = CONV_RAMROM(rom[addr]);
|
data = CONV_RAMROM(rom[addr]);
|
||||||
DO_DBUG(statusMsg << "read16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl);
|
DO_DBUG(statusMsg << "read16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl);
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
//case 0x40000000: //RAM
|
case 0x40000000: //RAM
|
||||||
case ram_base: //RAM
|
|
||||||
addr &= RAMADDMASK;
|
addr &= RAMADDMASK;
|
||||||
addr >>= 1;
|
addr >>= 1;
|
||||||
data = CONV_RAMROM(ram[addr]);
|
data = CONV_RAMROM(ram[addr]);
|
||||||
|
@ -637,10 +633,8 @@ uInt32 Thumbulator::read32(uInt32 addr)
|
||||||
uInt32 data;
|
uInt32 data;
|
||||||
switch(addr & 0xF0000000)
|
switch(addr & 0xF0000000)
|
||||||
{
|
{
|
||||||
case rom_base: //ROM
|
case 0x00000000: //ROM
|
||||||
//case 0x00000000: //ROM
|
case 0x40000000: //RAM
|
||||||
case ram_base: //RAM
|
|
||||||
//case 0x40000000: //RAM
|
|
||||||
data = read16(addr+0);
|
data = read16(addr+0);
|
||||||
data |= (uInt32(read16(addr+2))) << 16;
|
data |= (uInt32(read16(addr+2))) << 16;
|
||||||
DO_DBUG(statusMsg << "read32(" << Base::HEX8 << addr << ")=" << Base::HEX8 << data << endl);
|
DO_DBUG(statusMsg << "read32(" << Base::HEX8 << addr << ")=" << Base::HEX8 << data << endl);
|
||||||
|
@ -1067,9 +1061,8 @@ int Thumbulator::execute()
|
||||||
|
|
||||||
Op decodedOp;
|
Op decodedOp;
|
||||||
#ifndef UNSAFE_OPTIMIZATIONS
|
#ifndef UNSAFE_OPTIMIZATIONS
|
||||||
if ((instructionPtr & 0xF0000000) == rom_base
|
if ((instructionPtr & 0xF0000000) == 0 && instructionPtr < romSize)
|
||||||
&& instructionPtr >= rom_base && instructionPtr < rom_base + romSize)
|
decodedOp = decodedRom[instructionPtr >> 1];
|
||||||
decodedOp = decodedRom[(instructionPtr - rom_base) >> 1];
|
|
||||||
else
|
else
|
||||||
decodedOp = decodeInstructionWord(inst);
|
decodedOp = decodeInstructionWord(inst);
|
||||||
#else
|
#else
|
||||||
|
@ -1572,10 +1565,10 @@ int Thumbulator::execute()
|
||||||
|
|
||||||
// address to test for is + 4 due to pipelining
|
// address to test for is + 4 due to pipelining
|
||||||
|
|
||||||
#define BUS_SetNote (rom_base + 0x06da + 4)
|
#define BUS_SetNote (0x000006da + 4)
|
||||||
#define BUS_ResetWave (rom_base + 0x06de + 4)
|
#define BUS_ResetWave (0x000006de + 4)
|
||||||
#define BUS_GetWavePtr (rom_base + 0x06e2 + 4)
|
#define BUS_GetWavePtr (0x000006e2 + 4)
|
||||||
#define BUS_SetWaveSize (rom_base + 0x06e6 + 4)
|
#define BUS_SetWaveSize (0x000006e6 + 4)
|
||||||
|
|
||||||
if (pc == BUS_SetNote)
|
if (pc == BUS_SetNote)
|
||||||
{
|
{
|
||||||
|
@ -1597,7 +1590,7 @@ int Thumbulator::execute()
|
||||||
myCartridge->thumbCallback(3, read_register(2), read_register(3));
|
myCartridge->thumbCallback(3, read_register(2), read_register(3));
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
else if (pc == Thumbulator::rom_base + 0x083a)
|
else if (pc == 0x0000083a)
|
||||||
{
|
{
|
||||||
// exiting Custom ARM code, returning to BUS Driver control
|
// exiting Custom ARM code, returning to BUS Driver control
|
||||||
}
|
}
|
||||||
|
@ -1633,10 +1626,10 @@ int Thumbulator::execute()
|
||||||
|
|
||||||
// address to test for is + 4 due to pipelining
|
// address to test for is + 4 due to pipelining
|
||||||
|
|
||||||
#define CDF_SetNote (rom_base + 0x06e2 + 4)
|
#define CDF_SetNote (0x000006e2 + 4)
|
||||||
#define CDF_ResetWave (rom_base + 0x06e6 + 4)
|
#define CDF_ResetWave (0x000006e6 + 4)
|
||||||
#define CDF_GetWavePtr (rom_base + 0x06ea + 4)
|
#define CDF_GetWavePtr (0x000006ea + 4)
|
||||||
#define CDF_SetWaveSize (rom_base + 0x06ee + 4)
|
#define CDF_SetWaveSize (0x000006ee + 4)
|
||||||
|
|
||||||
if (pc == CDF_SetNote)
|
if (pc == CDF_SetNote)
|
||||||
{
|
{
|
||||||
|
@ -1658,7 +1651,7 @@ int Thumbulator::execute()
|
||||||
myCartridge->thumbCallback(3, read_register(2), read_register(3));
|
myCartridge->thumbCallback(3, read_register(2), read_register(3));
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
else if (pc == Thumbulator::rom_base + 0x083a)
|
else if (pc == 0x0000083a)
|
||||||
{
|
{
|
||||||
// exiting Custom ARM code, returning to CDF Driver control
|
// exiting Custom ARM code, returning to CDF Driver control
|
||||||
}
|
}
|
||||||
|
@ -1696,10 +1689,10 @@ int Thumbulator::execute()
|
||||||
|
|
||||||
// address to test for is + 4 due to pipelining
|
// address to test for is + 4 due to pipelining
|
||||||
|
|
||||||
#define CDF1_SetNote (rom_base + 0x0752 + 4)
|
#define CDF1_SetNote (0x00000752 + 4)
|
||||||
#define CDF1_ResetWave (rom_base + 0x0756 + 4)
|
#define CDF1_ResetWave (0x00000756 + 4)
|
||||||
#define CDF1_GetWavePtr (rom_base + 0x075a + 4)
|
#define CDF1_GetWavePtr (0x0000075a + 4)
|
||||||
#define CDF1_SetWaveSize (rom_base + 0x075e + 4)
|
#define CDF1_SetWaveSize (0x0000075e + 4)
|
||||||
|
|
||||||
if (pc == CDF1_SetNote)
|
if (pc == CDF1_SetNote)
|
||||||
{
|
{
|
||||||
|
@ -1737,7 +1730,7 @@ int Thumbulator::execute()
|
||||||
INC_ARM_CYCLES(2 + _flashCycles + 2); // ARM code ReturnC
|
INC_ARM_CYCLES(2 + _flashCycles + 2); // ARM code ReturnC
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
else if (pc == Thumbulator::rom_base + 0x083a)
|
else if (pc == 0x0000083a)
|
||||||
{
|
{
|
||||||
// exiting Custom ARM code, returning to CDFJ Driver control
|
// exiting Custom ARM code, returning to CDFJ Driver control
|
||||||
}
|
}
|
||||||
|
@ -2905,9 +2898,9 @@ int Thumbulator::reset()
|
||||||
cpsr = 0;
|
cpsr = 0;
|
||||||
handler_mode = false;
|
handler_mode = false;
|
||||||
|
|
||||||
systick_ctrl = rom_base + 0x0004; // TODO: not 100% sure about rom_base here
|
systick_ctrl = 0x00000004;
|
||||||
systick_reload = rom_base;
|
systick_reload = 0x00000000;
|
||||||
systick_count = rom_base;
|
systick_count = 0x00000000;
|
||||||
systick_calibrate = 0x00ABCDEF;
|
systick_calibrate = 0x00ABCDEF;
|
||||||
|
|
||||||
// fxq: don't care about below so much (maybe to guess timing???)
|
// fxq: don't care about below so much (maybe to guess timing???)
|
||||||
|
|
|
@ -34,10 +34,6 @@ class Cartridge;
|
||||||
#define UNSAFE_OPTIMIZATIONS
|
#define UNSAFE_OPTIMIZATIONS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Note: This is still experimental, no guarantees!
|
|
||||||
// TODO: make selectable from command line
|
|
||||||
#define STM32F4 // compile for UnoCart/PlusCart using STM32F407xxx CPU
|
|
||||||
|
|
||||||
#define ROMADDMASK 0x7FFFF
|
#define ROMADDMASK 0x7FFFF
|
||||||
#define RAMADDMASK 0x7FFF
|
#define RAMADDMASK 0x7FFF
|
||||||
|
|
||||||
|
@ -99,15 +95,6 @@ class Thumbulator
|
||||||
uInt32 mamDataHits{0}, mamDataMisses{0};
|
uInt32 mamDataHits{0}, mamDataMisses{0};
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
#ifndef STM32F4
|
|
||||||
// Harmony/Encore base adresses
|
|
||||||
static constexpr uInt32 ram_base = 0x40000000;
|
|
||||||
static constexpr uInt32 rom_base = 0x00000000;
|
|
||||||
#else
|
|
||||||
// UnoCart/PlusCart base adresses (TODO!)
|
|
||||||
static constexpr uInt32 ram_base = 0x10000000;
|
|
||||||
static constexpr uInt32 rom_base = 0x20000000;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
|
Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
|
||||||
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
||||||
|
|
|
@ -58,9 +58,14 @@ void FileListWidget::setDirectory(const FilesystemNode& node,
|
||||||
_history.clear();
|
_history.clear();
|
||||||
while(tmp.hasParent())
|
while(tmp.hasParent())
|
||||||
{
|
{
|
||||||
_history.push_back(HistoryType(tmp, fixPath(name)));
|
if(name.back() == FilesystemNode::PATH_SEPARATOR)
|
||||||
|
name.pop_back();
|
||||||
|
_history.push_back(HistoryType(tmp, name));
|
||||||
|
|
||||||
name = tmp.getName();
|
name = tmp.getName();
|
||||||
|
if(name.back() == FilesystemNode::PATH_SEPARATOR)
|
||||||
|
name.pop_back();
|
||||||
|
|
||||||
tmp = tmp.getParent();
|
tmp = tmp.getParent();
|
||||||
}
|
}
|
||||||
// History is in reverse order; we need to fix that
|
// History is in reverse order; we need to fix that
|
||||||
|
@ -186,19 +191,14 @@ void FileListWidget::selectParent()
|
||||||
string name = _node.getName();
|
string name = _node.getName();
|
||||||
FilesystemNode parent(_node.getParent());
|
FilesystemNode parent(_node.getParent());
|
||||||
|
|
||||||
|
if(name.back() == FilesystemNode::PATH_SEPARATOR)
|
||||||
|
name.pop_back();
|
||||||
_currentHistory->selected = selected().getName();
|
_currentHistory->selected = selected().getName();
|
||||||
addHistory(parent);
|
addHistory(parent);
|
||||||
setLocation(parent, fixPath(name));
|
setLocation(parent, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
void FileListWidget::selectHomeDir()
|
|
||||||
{
|
|
||||||
while(hasPrevHistory())
|
|
||||||
selectPrevHistory();
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void FileListWidget::selectPrevHistory()
|
void FileListWidget::selectPrevHistory()
|
||||||
{
|
{
|
||||||
|
@ -233,17 +233,6 @@ bool FileListWidget::hasNextHistory()
|
||||||
return _currentHistory != std::prev(_history.end(), 1);
|
return _currentHistory != std::prev(_history.end(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
string& FileListWidget::fixPath(string& path)
|
|
||||||
{
|
|
||||||
if(path.back() == FilesystemNode::PATH_SEPARATOR)
|
|
||||||
{
|
|
||||||
path.pop_back();
|
|
||||||
if(path.length() == 2 && path.back() == ':')
|
|
||||||
path.pop_back();
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void FileListWidget::addHistory(const FilesystemNode& node)
|
void FileListWidget::addHistory(const FilesystemNode& node)
|
||||||
{
|
{
|
||||||
|
@ -252,9 +241,11 @@ void FileListWidget::addHistory(const FilesystemNode& node)
|
||||||
_history.pop_back();
|
_history.pop_back();
|
||||||
|
|
||||||
string select = selected().getName();
|
string select = selected().getName();
|
||||||
_currentHistory->selected = fixPath(select);
|
if(select.back() == FilesystemNode::PATH_SEPARATOR)
|
||||||
|
select.pop_back();
|
||||||
|
_currentHistory->selected = select;
|
||||||
|
|
||||||
_history.push_back(HistoryType(node, ".."));
|
_history.push_back(HistoryType(node, select));
|
||||||
_currentHistory = std::prev(_history.end(), 1);
|
_currentHistory = std::prev(_history.end(), 1);
|
||||||
//_historyIndex++;
|
//_historyIndex++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,10 +45,7 @@ class FileListWidget : public StringListWidget
|
||||||
public:
|
public:
|
||||||
enum {
|
enum {
|
||||||
ItemChanged = 'FLic', // Entry in the list is changed (single-click, etc)
|
ItemChanged = 'FLic', // Entry in the list is changed (single-click, etc)
|
||||||
ItemActivated = 'FLac', // Entry in the list is activated (double-click, etc)
|
ItemActivated = 'FLac' // Entry in the list is activated (double-click, etc)
|
||||||
kHomeDirCmd = 'homc', // go to Home directory
|
|
||||||
kPrevDirCmd = 'prvc', // go back in history to previous directory
|
|
||||||
kNextDirCmd = 'nxtc' // go back in history to next directory
|
|
||||||
};
|
};
|
||||||
using IconTypeFilter = std::function<bool(const FilesystemNode& node)>;
|
using IconTypeFilter = std::function<bool(const FilesystemNode& node)>;
|
||||||
|
|
||||||
|
@ -86,11 +83,9 @@ class FileListWidget : public StringListWidget
|
||||||
virtual void selectDirectory();
|
virtual void selectDirectory();
|
||||||
/** Select parent directory (if applicable) */
|
/** Select parent directory (if applicable) */
|
||||||
void selectParent();
|
void selectParent();
|
||||||
/** Select to home directory */
|
|
||||||
void selectHomeDir();
|
|
||||||
/** Select previous directory in history (if applicable) */
|
/** Select previous directory in history (if applicable) */
|
||||||
void selectPrevHistory();
|
void selectPrevHistory();
|
||||||
/** Select next directory in history (if applicable) */
|
/** Select next directory in history */
|
||||||
void selectNextHistory();
|
void selectNextHistory();
|
||||||
/** Check if the there is a previous directory in history */
|
/** Check if the there is a previous directory in history */
|
||||||
bool hasPrevHistory();
|
bool hasPrevHistory();
|
||||||
|
@ -152,7 +147,6 @@ class FileListWidget : public StringListWidget
|
||||||
virtual const Icon* getIcon(int i) const;
|
virtual const Icon* getIcon(int i) const;
|
||||||
int iconWidth() const;
|
int iconWidth() const;
|
||||||
virtual bool fullPathToolTip() const { return false; }
|
virtual bool fullPathToolTip() const { return false; }
|
||||||
string& fixPath(string& path);
|
|
||||||
void addHistory(const FilesystemNode& node);
|
void addHistory(const FilesystemNode& node);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -228,25 +228,25 @@ void LauncherDialog::addPathWidgets(int& ypos, WidgetArray& wid)
|
||||||
const GUI::Icon& upIcon = smallIcon ? GUI::icon_up_small : GUI::icon_up_large;
|
const GUI::Icon& upIcon = smallIcon ? GUI::icon_up_small : GUI::icon_up_large;
|
||||||
|
|
||||||
myHomeButton = new ButtonWidget(this, _font, xpos, ypos,
|
myHomeButton = new ButtonWidget(this, _font, xpos, ypos,
|
||||||
iconWidth + iconGap - 1, lineHeight + 2, homeIcon, FileListWidget::kHomeDirCmd);
|
iconWidth + iconGap - 1, lineHeight + 2, homeIcon, kHomeDirCmd);
|
||||||
myHomeButton->setToolTip("Go back to Stella's ROM directory.");
|
myHomeButton->setToolTip("Go back to Stella's ROM directory.");
|
||||||
wid.push_back(myHomeButton);
|
wid.push_back(myHomeButton);
|
||||||
xpos = myHomeButton->getRight() + BTN_GAP;
|
xpos = myHomeButton->getRight() + BTN_GAP;
|
||||||
|
|
||||||
myPrevButton = new ButtonWidget(this, _font, xpos, ypos,
|
myPrevButton = new ButtonWidget(this, _font, xpos, ypos,
|
||||||
iconWidth + iconGap - 1, lineHeight + 2, prevIcon, FileListWidget::kPrevDirCmd);
|
iconWidth + iconGap - 1, lineHeight + 2, prevIcon, kPrevDirCmd);
|
||||||
myPrevButton->setToolTip("Go back in directory history.");
|
myPrevButton->setToolTip("Go back in directory history.");
|
||||||
wid.push_back(myPrevButton);
|
wid.push_back(myPrevButton);
|
||||||
xpos = myPrevButton->getRight() + BTN_GAP;
|
xpos = myPrevButton->getRight() + BTN_GAP;
|
||||||
|
|
||||||
myNextButton = new ButtonWidget(this, _font, xpos, ypos,
|
myNextButton = new ButtonWidget(this, _font, xpos, ypos,
|
||||||
iconWidth + iconGap - 1, lineHeight + 2, nextIcon, FileListWidget::kNextDirCmd);
|
iconWidth + iconGap - 1, lineHeight + 2, nextIcon, kNextDirCmd);
|
||||||
myNextButton->setToolTip("Go forward in directory history.");
|
myNextButton->setToolTip("Go forward in directory history.");
|
||||||
wid.push_back(myNextButton);
|
wid.push_back(myNextButton);
|
||||||
xpos = myNextButton->getRight() + BTN_GAP;
|
xpos = myNextButton->getRight() + BTN_GAP;
|
||||||
|
|
||||||
myUpButton = new ButtonWidget(this, _font, xpos, ypos,
|
myUpButton = new ButtonWidget(this, _font, xpos, ypos,
|
||||||
iconWidth + iconGap - 1, lineHeight + 2, upIcon, ListWidget::kParentDirCmd);
|
iconWidth + iconGap - 1, lineHeight + 2, upIcon, kParentDirCmd);
|
||||||
myUpButton->setToolTip("Go Up");
|
myUpButton->setToolTip("Go Up");
|
||||||
wid.push_back(myUpButton);
|
wid.push_back(myUpButton);
|
||||||
xpos = myUpButton->getRight() + BTN_GAP;
|
xpos = myUpButton->getRight() + BTN_GAP;
|
||||||
|
@ -358,7 +358,7 @@ void LauncherDialog::addButtonWidgets(int& ypos, WidgetArray& wid)
|
||||||
|
|
||||||
xpos += (buttonWidth + 0) / 4 + BUTTON_GAP;
|
xpos += (buttonWidth + 0) / 4 + BUTTON_GAP;
|
||||||
myGoUpButton = new ButtonWidget(this, _font, xpos, ypos, (buttonWidth + 1) / 4, buttonHeight,
|
myGoUpButton = new ButtonWidget(this, _font, xpos, ypos, (buttonWidth + 1) / 4, buttonHeight,
|
||||||
"Go Up", ListWidget::kParentDirCmd);
|
"Go Up", kParentDirCmd);
|
||||||
wid.push_back(myGoUpButton);
|
wid.push_back(myGoUpButton);
|
||||||
|
|
||||||
xpos += (buttonWidth + 1) / 4 + BUTTON_GAP;
|
xpos += (buttonWidth + 1) / 4 + BUTTON_GAP;
|
||||||
|
@ -382,7 +382,7 @@ void LauncherDialog::addButtonWidgets(int& ypos, WidgetArray& wid)
|
||||||
|
|
||||||
xpos += (buttonWidth + 1) / 4 + BUTTON_GAP;
|
xpos += (buttonWidth + 1) / 4 + BUTTON_GAP;
|
||||||
myGoUpButton = new ButtonWidget(this, _font, xpos, ypos, (buttonWidth + 2) / 4, buttonHeight,
|
myGoUpButton = new ButtonWidget(this, _font, xpos, ypos, (buttonWidth + 2) / 4, buttonHeight,
|
||||||
"Go Up", ListWidget::kParentDirCmd);
|
"Go Up", kParentDirCmd);
|
||||||
wid.push_back(myGoUpButton);
|
wid.push_back(myGoUpButton);
|
||||||
|
|
||||||
xpos += (buttonWidth + 2) / 4 + BUTTON_GAP;
|
xpos += (buttonWidth + 2) / 4 + BUTTON_GAP;
|
||||||
|
@ -774,7 +774,7 @@ void LauncherDialog::handleContextMenu()
|
||||||
else if(cmd == "subdirs")
|
else if(cmd == "subdirs")
|
||||||
sendCommand(kSubDirsCmd, 0, 0);
|
sendCommand(kSubDirsCmd, 0, 0);
|
||||||
else if(cmd == "homedir")
|
else if(cmd == "homedir")
|
||||||
sendCommand(FileListWidget::kHomeDirCmd, 0, 0);
|
sendCommand(kHomeDirCmd, 0, 0);
|
||||||
else if(cmd == "highscores")
|
else if(cmd == "highscores")
|
||||||
openHighScores();
|
openHighScores();
|
||||||
else if(cmd == "reload")
|
else if(cmd == "reload")
|
||||||
|
@ -818,19 +818,19 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated)
|
||||||
switch(key)
|
switch(key)
|
||||||
{
|
{
|
||||||
case KBDK_HOME:
|
case KBDK_HOME:
|
||||||
sendCommand(FileListWidget::kHomeDirCmd, 0, 0);
|
sendCommand(kHomeDirCmd, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KBDK_LEFT:
|
case KBDK_LEFT:
|
||||||
sendCommand(FileListWidget::kPrevDirCmd, 0, 0);
|
sendCommand(kPrevDirCmd, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KBDK_RIGHT:
|
case KBDK_RIGHT:
|
||||||
sendCommand(FileListWidget::kNextDirCmd, 0, 0);
|
sendCommand(kNextDirCmd, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KBDK_UP:
|
case KBDK_UP:
|
||||||
sendCommand(ListWidget::kParentDirCmd, 0, 0);
|
sendCommand(kParentDirCmd, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KBDK_DOWN:
|
case KBDK_DOWN:
|
||||||
|
@ -1007,22 +1007,23 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
toggleSubDirs();
|
toggleSubDirs();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FileListWidget::kHomeDirCmd:
|
case kHomeDirCmd:
|
||||||
myList->selectHomeDir();
|
gotoHomeDir();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FileListWidget::kPrevDirCmd:
|
case kPrevDirCmd:
|
||||||
myList->selectPrevHistory();
|
myList->selectPrevHistory();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FileListWidget::kNextDirCmd:
|
case kNextDirCmd:
|
||||||
myList->selectNextHistory();
|
myList->selectNextHistory();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ListWidget::kParentDirCmd:
|
case kParentDirCmd:
|
||||||
myList->selectParent();
|
myList->selectParent();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case kLoadROMCmd:
|
case kLoadROMCmd:
|
||||||
if(myList->isDirectory(myList->selected()))
|
if(myList->isDirectory(myList->selected()))
|
||||||
{
|
{
|
||||||
|
@ -1313,6 +1314,13 @@ void LauncherDialog::openWhatsNew()
|
||||||
myDialog->open();
|
myDialog->open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void LauncherDialog::gotoHomeDir()
|
||||||
|
{
|
||||||
|
while(myList->hasPrevHistory())
|
||||||
|
myList->selectPrevHistory();
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void LauncherDialog::toggleShowAll(bool toggle)
|
void LauncherDialog::toggleShowAll(bool toggle)
|
||||||
{
|
{
|
||||||
|
|
|
@ -174,6 +174,7 @@ class LauncherDialog : public Dialog, CommandSender
|
||||||
void showOnlyROMs(bool state);
|
void showOnlyROMs(bool state);
|
||||||
void toggleShowAll(bool toggle = true);
|
void toggleShowAll(bool toggle = true);
|
||||||
void toggleSubDirs(bool toggle = true);
|
void toggleSubDirs(bool toggle = true);
|
||||||
|
void gotoHomeDir();
|
||||||
void handleContextMenu();
|
void handleContextMenu();
|
||||||
void handleQuit();
|
void handleQuit();
|
||||||
void toggleExtensions();
|
void toggleExtensions();
|
||||||
|
@ -233,8 +234,12 @@ class LauncherDialog : public Dialog, CommandSender
|
||||||
enum {
|
enum {
|
||||||
kAllfilesCmd = 'lalf', // show all files (or ROMs only)
|
kAllfilesCmd = 'lalf', // show all files (or ROMs only)
|
||||||
kSubDirsCmd = 'lred',
|
kSubDirsCmd = 'lred',
|
||||||
|
kParentDirCmd = 'PARD',
|
||||||
kOptionsCmd = 'OPTI',
|
kOptionsCmd = 'OPTI',
|
||||||
kQuitCmd = 'QUIT',
|
kQuitCmd = 'QUIT',
|
||||||
|
kHomeDirCmd = 'homc', // go to Home directory
|
||||||
|
kPrevDirCmd = 'prvc', // go back in history to previous directory
|
||||||
|
kNextDirCmd = 'nxtc', // go back in history to next directory
|
||||||
kReloadCmd = 'relc',
|
kReloadCmd = 'relc',
|
||||||
kRmAllFav = 'rmaf',
|
kRmAllFav = 'rmaf',
|
||||||
kRmAllPop = 'rmap',
|
kRmAllPop = 'rmap',
|
||||||
|
|
Loading…
Reference in New Issue