Skip to content

Commit 8fbde07

Browse files
committed
Work on RetroShell
1 parent 3bad565 commit 8fbde07

File tree

10 files changed

+49
-27
lines changed

10 files changed

+49
-27
lines changed

Core/Components/Amiga.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,9 +746,8 @@ Amiga::_dump(Category category, std::ostream &os) const
746746
(void)cpu.disassembleSR(sr);
747747

748748
os << std::setfill('0');
749-
os << " DMACON INTREQ / INTENA STATUS REGISTER IPL FCP" << std::endl;
749+
os << "DMACON INTREQ / INTENA STATUS REGISTER IPL FCP" << std::endl;
750750

751-
os << " ";
752751
os << ((dmacon & BPLEN) ? (dmaen ? 'B' : 'b') : empty);
753752
os << ((dmacon & COPEN) ? (dmaen ? 'C' : 'c') : empty);
754753
os << ((dmacon & BLTEN) ? (dmaen ? 'B' : 'b') : empty);
@@ -787,10 +786,14 @@ Amiga::_dump(Category category, std::ostream &os) const
787786
}
788787

789788
if (category == Category::Trace) {
790-
789+
790+
std::stringstream ss;
791+
string line;
792+
791793
cpu.dumpLogBuffer(os, 8);
792794
os << "\n";
793-
dump(Category::Current, os);
795+
dump(Category::Current, ss);
796+
while(std::getline(ss, line)) { os << " " << line << '\n'; }
794797
os << "\n";
795798
cpu.disassembleRange(os, cpu.getPC0(), 8);
796799
}

Core/FileSystems/FileSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ FileSystem::_dump(Category category, std::ostream &os) const noexcept
155155
case Category::Info:
156156

157157
if (!isFormatted()) {
158-
os << "Type Size Used Free" << std::endl;
158+
os << "Type Size Used Free Full" << std::endl;
159159
} else {
160160
os << "Type Size Used Free Full Name" << std::endl;
161161
}

Core/Headless.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,12 @@ Headless::smokeTestScript[] = {
273273
#endif
274274

275275
// Test console switching
276-
".",
277-
".",
278-
".",
279-
"..",
280-
"..",
281-
"..",
276+
// ".",
277+
// ".",
278+
// ".",
279+
// "..",
280+
// "..",
281+
// "..",
282282

283283
// Enter the commander console
284284
"commander",

Core/Misc/RetroShell/CommanderConsole.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ CommanderConsole::summary()
3737
{
3838
std::stringstream ss;
3939

40+
// ss << "RetroShell Commander" << std::endl << std::endl;
41+
4042
ss << "Model Chip Slow Fast Agnus Denise ROM" << std::endl;
4143
ss << std::setw(8) << std::left << BankMapEnum::key(BankMap(amiga.get(Opt::MEM_BANKMAP)));
4244
ss << std::setw(8) << std::left << (std::to_string(amiga.get(Opt::MEM_CHIP_RAM)) + " MB");
@@ -47,7 +49,9 @@ CommanderConsole::summary()
4749
ss << mem.getRomTraits().title << std::endl;
4850

4951
*this << vspace{1};
50-
*this << ss;
52+
string line;
53+
while(std::getline(ss, line)) { *this << " " << line << '\n'; }
54+
// *this << ss;
5155
*this << vspace{1};
5256
}
5357

@@ -72,6 +76,7 @@ CommanderConsole::initCommands(RSCommand &root)
7276
// Console management
7377
//
7478

79+
/*
7580
root.add({
7681
7782
.tokens = { "." },
@@ -95,8 +100,9 @@ CommanderConsole::initCommands(RSCommand &root)
95100
retroShell.enterNavigator();
96101
}
97102
});
103+
*/
98104

99-
105+
100106
//
101107
// Workspace management
102108
//

Core/Misc/RetroShell/Console.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Console::welcome()
163163

164164
// *this << " " << description() << " console" << "\n\n";
165165

166-
printHelp(4);
166+
printHelp(0);
167167
}
168168

169169
const char *
@@ -230,10 +230,9 @@ Console::printHelp(isize tab)
230230
{
231231
*this << vspace{1};
232232

233-
*this << "RetroShell " << description() << "\n\n";
234-
storage << string(tab, ' ') << "Type 'help' or press 'Tab' twice for help.\n";
235-
// storage << string(tab, ' ') << "Press 'PgUp', 'PgDown', or 'Shift+Tab' to switch consoles.";
236-
storage << string(tab, ' ') << "Press 'Shift+Tab' or type '.' to switch consoles.";
233+
*this << "RetroShell " << description() << " " << Amiga::version() << "\n\n";
234+
storage << string(tab + 4, ' ') << "Type 'help' or press 'Tab' twice for help.\n";
235+
storage << string(tab + 4, ' ') << "Press 'Shift+Tab' to switch consoles.";
237236

238237
remoteManager.rshServer << "Type 'help' for help.\n";
239238

@@ -975,7 +974,7 @@ Console::initCommands(RSCommand &root)
975974

976975
.func = [this] (std::ostream &os, const Arguments &args, const std::vector<isize> &values) {
977976

978-
printHelp(4);
977+
printHelp(0);
979978
}
980979
});
981980

Core/Misc/RetroShell/DebuggerConsole.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ DebuggerConsole::summary()
4848
{
4949
std::stringstream ss;
5050

51+
// ss << "RetroShell Debugger" << std::endl << std::endl;
5152
amiga.dump(Category::Current, ss);
5253

5354
*this << vspace{1};
54-
*this << ss;
55+
string line;
56+
while(std::getline(ss, line)) { *this << " " << line << '\n'; }
57+
// *this << ss;
5558
*this << vspace{1};
5659
}
5760

Core/Misc/RetroShell/NavigatorConsole.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ NavigatorConsole::summary()
5454
{
5555
std::stringstream ss;
5656

57+
// ss << "RetroShell File System Navigator" << std::endl << std::endl;
5758
fs.dump(Category::Info, ss);
5859

5960
*this << vspace{1};
60-
*this << ss;
61+
62+
string line;
63+
while(std::getline(ss, line)) { *this << " " << line << '\n'; }
64+
// *this << ss;
6165
*this << vspace{1};
6266
}
6367

Core/Misc/RetroShell/RetroShell.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ RetroShell::press(RSKey key, bool shift)
336336

337337
case RSKey::TAB:
338338

339-
asyncExec(".");
339+
// asyncExec(".");
340+
if (current->objid == 0) current->input = "debugger";
341+
if (current->objid == 1) current->input = "navigator";
342+
if (current->objid == 2) current->input = "commander";
343+
current->pressReturn(false);
340344
return;
341345

342346
default:

Core/Misc/RetroShell/RetroShell.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class RetroShell final : public SubComponent, public Inspectable<RetroShellInfo>
6161

6262
// Consoles
6363
CommanderConsole commander = CommanderConsole(amiga, 0, s1);
64-
DebuggerConsole debugger = DebuggerConsole(amiga, 1, s2);
65-
NavigatorConsole navigator = NavigatorConsole(amiga, 2, s3);
64+
DebuggerConsole debugger = DebuggerConsole(amiga, 1, s1);
65+
NavigatorConsole navigator = NavigatorConsole(amiga, 2, s1);
6666

6767
// Indicates if one of the consoles has new contents
6868
bool isDirty = false;

GUI/Metal/Layers/Console.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,25 @@ class Console: Layer {
5151
let colorTable: [Int: (NSColor, NSColor)] = [
5252

5353
// Commander console
54-
0: (NSColor(r: 0xEF, g: 0xEF, b: 0xEF, a: 0xFF),
54+
0: (NSColor(r: 0xCF, g: 0xCF, b: 0xFF, a: 0xFF),
55+
// NSColor(r: 0xEF, g: 0xEF, b: 0xEF, a: 0xFF),
5556
NSColor(r: 0x60, g: 0x60, b: 0x60, a: 0xD0)),
5657
/*
5758
0: (NSColor(r: 0xCF, g: 0xFF, b: 0xCF, a: 0xFF),
5859
NSColor(r: 0x30, g: 0x90, b: 0x30, a: 0xD0)),
5960
*/
6061

6162
// Debugger console
62-
1: (NSColor(r: 0xEF, g: 0xEF, b: 0xEF, a: 0xFF),
63+
1: (NSColor(r: 0xFF, g: 0xDF, b: 0xDF, a: 0xFF),
64+
// NSColor(r: 0xEF, g: 0xEF, b: 0xEF, a: 0xFF),
6365
NSColor(r: 0x60, g: 0x60, b: 0x60, a: 0xD0)),
6466
/*
6567
1: (NSColor(r: 0xFF, g: 0xCF, b: 0xCF, a: 0xFF),
6668
NSColor(r: 0x90, g: 0x30, b: 0x30, a: 0xD0)),
6769
*/
6870
// Navigator console
69-
2: (NSColor(r: 0xEF, g: 0xEF, b: 0xEF, a: 0xFF),
71+
2: (NSColor(r: 0xDF, g: 0xFF, b: 0xDF, a: 0xFF),
72+
// NSColor(r: 0xEF, g: 0xEF, b: 0xEF, a: 0xFF),
7073
NSColor(r: 0x60, g: 0x60, b: 0x60, a: 0xD0)),
7174
/*
7275
2: (NSColor(r: 0xCF, g: 0xCF, b: 0xFF, a: 0xFF),

0 commit comments

Comments
 (0)