Sync push

This commit is contained in:
OmniaX-Dev 2026-03-05 21:46:57 +01:00
parent 119da0bb1e
commit 327d0dd108
15 changed files with 307 additions and 93 deletions

Binary file not shown.

View file

@ -29,6 +29,8 @@ _kernel0_main:
push 1
call $_print_string
## debug_break
_infinite_loop_0:
jmp $_infinite_loop_0
mov [$cursor_x], 0
@ -51,7 +53,7 @@ _infinite_loop:
hlt
## =========================================================================================================================
## =========================================================================================================================
@ -85,4 +87,4 @@ _key_pressed_enter:
_key_pressed_end:
ret
## =========================================================================================================================
## =========================================================================================================================

View file

@ -1,5 +1,5 @@
## --
## -- This file is automatically generated by the DragonAssembler (version 0.4.1637)
## -- This file is automatically generated by the DragonAssembler (version 0.4.1640)
## -- Please do not modify this file in any way.
## --

View file

@ -1 +1 @@
1639
1641

View file

@ -9,7 +9,6 @@
#include "../tools/GlobalData.hpp"
#include "../hardware/VirtualHardDrive.hpp"
#include "../hardware/CPUExtensions.hpp"
#include "../tools/Utils.hpp"
namespace dragon
{
@ -128,7 +127,7 @@ namespace dragon
}
if (m_symbolTable.size() > 0)
out.nl();
if (m_labelTable.size() > 0)
out.fg(ostd::ConsoleColors::Yellow).p("Labels:").nl();
for (auto& label : m_labelTable)
@ -138,7 +137,7 @@ namespace dragon
}
if (m_labelTable.size() > 0)
out.nl();
if (m_structDefs.size() > 0)
out.fg(ostd::ConsoleColors::Yellow).p("Structures:").nl();
for (auto& str : m_structDefs)
@ -165,7 +164,7 @@ namespace dragon
}
void Assembler::insertHeader(void)
{
if (m_code.size() == 0) return;
@ -255,7 +254,7 @@ namespace dragon
// }
// m_exportSpecifications[export_name].content.push_back({ "## -- ", lineEdit });
// continue;
// } else
// } else
if (tmpLineEdit.toLower().startsWith("@define "))
{
lineEdit.substr(8).trim();
@ -527,7 +526,7 @@ namespace dragon
// {
// std::cout << " " << d.first << " ";
// for (auto& b : d.second)
// std::cout << ostd::Utils::getHexStr(b) << " ";
// std::cout << ostd::Utils::getHexStr(b) << " ";
// }
// std::cout << "\n";
// }
@ -763,7 +762,7 @@ namespace dragon
for (auto[name, exportSpec] : m_exports)
{
std::ofstream outFile(exportSpec.fileName.c_str());
for (auto& line : exportSpec.lines)
for (auto& line : exportSpec.lines)
outFile << line << "\n";
outFile.close();
std::cout << "Created export file: " << exportSpec.fileName << " (" << name << ")\n";
@ -791,7 +790,7 @@ namespace dragon
{
if (lineEdit.len() < 8)
{
//TODO: Error
//TODO: Error
std::cout << "Invalid .fixed value: " << lineEdit << "\n";
return;
}
@ -799,7 +798,7 @@ namespace dragon
lineEdit.trim();
if (!lineEdit.contains(","))
{
//TODO: Error
//TODO: Error
std::cout << "Invalid .fixed value: " << lineEdit << "\n";
return;
}
@ -809,14 +808,14 @@ namespace dragon
lineEdit.trim();
if (!lineEdit.isNumeric())
{
//TODO: Error
//TODO: Error
std::cout << "Invalid .fixed size value: " << lineEdit << "\n";
return;
}
m_fixedFillValue = lineEdit.toInt();
if (!fixedSizeEdit.isNumeric())
{
//TODO: Error
//TODO: Error
std::cout << "Invalid .fixed fill value: " << lineEdit << "\n";
return;
}
@ -827,7 +826,7 @@ namespace dragon
{
if (lineEdit.len() < 8)
{
//TODO: Error
//TODO: Error
std::cout << "Invalid .entry value: " << lineEdit << "\n";
return;
}
@ -839,7 +838,7 @@ namespace dragon
{
if (lineEdit.len() < 9)
{
//TODO: Error
//TODO: Error
std::cout << "Invalid .header value: " << lineEdit << "\n";
return;
}
@ -851,7 +850,7 @@ namespace dragon
{
if (lineEdit.len() < 7)
{
//TODO: Error
//TODO: Error
std::cout << "Invalid .load value: " << lineEdit << "\n";
return;
}
@ -859,7 +858,7 @@ namespace dragon
lineEdit.trim();
if (!lineEdit.isNumeric())
{
//TODO: Error
//TODO: Error
std::cout << "Invalid .load value: " << lineEdit << "\n";
return;
}
@ -869,7 +868,7 @@ namespace dragon
}
else if (lineEdit.startsWith("."))
{
//TODO: Error
//TODO: Error
std::cout << "Invalid section: " << lineEdit << "\n";
return;
}
@ -881,7 +880,7 @@ namespace dragon
m_rawCodeSection.push_back(line);
else
{
//TODO: Error
//TODO: Error
std::cout << "Invalid section: " << lineEdit << "\n";
return;
}
@ -943,7 +942,7 @@ namespace dragon
std::cout << "Invalid data entry1: " << line << "\n";
continue;
}
if (array)
{
uint16_t array_size = lineEdit.toInt();
@ -1181,7 +1180,7 @@ namespace dragon
std::cout << "Invalid operand1 type; " << line << " (" << opEdit << ")\n";
exit(0);
}
return;
}
}
@ -2542,7 +2541,7 @@ namespace dragon
{
ostd::String lineEdit(line);
for (auto& symbol : m_symbolTable)
{
{
ostd::String regex = "\\" + symbol.first.new_regexReplace("\\.", "\\.") + "(?!\\.)(?!\\w)";
// std::cout << "SYMBOL: " << symbol.first << "\n";
@ -2683,4 +2682,4 @@ namespace dragon
return data::Registers::Last;
}
}
}
}

View file

@ -1,5 +1,4 @@
#include "Assembler.hpp"
#include "../tools/Utils.hpp"
#include <ostd/Random.hpp>
namespace dragon

View file

@ -8,6 +8,7 @@
#include <ostd/IOHandlers.hpp>
#include <ostd/Random.hpp>
#include <ostd/String.hpp>
#include <ostd/Utils.hpp>
#include "DisassemblyLoader.hpp"
#include "../runtime/DragonRuntime.hpp"
@ -337,6 +338,233 @@ namespace dragon
return DragonRuntime::RETURN_VAL_EXIT_SUCCESS;
}
ostd::String DebuggerNew::getCommandInput(void)
{
// ostd::String cmd;
// ostd::KeyboardController kbc;
// ostd::eKeys key = ostd::eKeys::NoKeyPressed;
// while ((key = kbc.getPressedKey()) != ostd::eKeys::Enter)
// {
// if (key == ostd::eKeys::Escape)
// return InputCommandQuit;
// }
// return kbc.getInputString();
return "";
}
int32_t DebuggerNew::executeRuntime(void)
{
int32_t rValue = 0;
bool userQuit = false;
output().clear().fg(ostd::ConsoleColors::Green).p("Program running...").nl();
if (!data().args.step_exec)
output().fg(ostd::ConsoleColors::Yellow).p("Press <Escape> to enter in step-execution mode...").reset().nl();
while (!userQuit)
{
ostd::SignalHandler::refresh();
// if (closeEventListener.hasHappened())
// userQuit = true;
data().command.clr();
if (!userQuit && data().args.step_exec)
rValue = step_execution(userQuit, true);
else if (!userQuit)
rValue = normal_runtime(userQuit);
data().currentAddress = DragonRuntime::cpu.readRegister(data::Registers::IP);
}
output().nl().fg(ostd::ConsoleColors::Yellow).p("Execution terminated.").nl().nl().reset();
return rValue;
}
int32_t DebuggerNew::step_execution(bool& outUserQuit, bool exec_first_step)
{
if (exec_first_step && !DragonRuntime::cpu.isHalted())
DragonRuntime::runStep(data().trackedAddresses);
// Display::printStep();
processErrors();
if (DragonRuntime::cpu.isInDebugBreakPoint())
output().fg(ostd::ConsoleColors::Red).p("Reached Debug Break Point.").reset().nl();
// Display::printPrompt();
data().command = getCommandInput();
data().command.trim().toLower();
while (data().command != "")
{
if (data().command == "q" || data().command == "quit" || data().command == InputCommandQuit)
{
output().nl();
outUserQuit = true;
data().command = "";
}
else if (data().command == "c" || data().command == "continue")
{
data().args.step_exec = false;
data().command = "";
output().clear().fg(ostd::ConsoleColors::Green).p("Program running...").nl();
output().fg(ostd::ConsoleColors::Yellow).p("Press <Escape> to enter in step-execution mode...").reset().nl();
}
else if (data().command.startsWith("p ") || data().command.startsWith("print "))
{
data().command.substr(data().command.indexOf(" ") + 1).trim();
const uint8_t TYPE_STRING = 0;
const uint8_t TYPE_BYTE = 1;
const uint8_t TYPE_WORD = 2;
const uint8_t TYPE_DWORD = 4;
const uint8_t TYPE_QWORD = 8;
uint8_t type = TYPE_WORD;
if (data().command.contains(" "))
{
ostd::String size_str = data().command.new_substr(0, data().command.indexOf(" ")).trim();
data().command.substr(data().command.indexOf(" ") + 1).trim();
if (size_str == "byte") type = TYPE_BYTE;
else if (size_str == "word") type = TYPE_WORD;
else if (size_str == "dword") type = TYPE_DWORD;
else if (size_str == "qword") type = TYPE_QWORD;
else if (size_str == "string") type = TYPE_STRING;
}
if (data().command.isNumeric())
{
if (type == TYPE_STRING)
type = TYPE_WORD;
uint16_t addr = data().command.toInt();
uint16_t end_addr = addr;
ostd::String tmp = "";
tmp.add("*(").add(ostd::Utils::getHexStr(addr, true, 2));
if (type != TYPE_BYTE)
{
end_addr = addr + type - 1;
if (end_addr < addr)
end_addr = addr;
else
tmp.add("-").add(ostd::Utils::getHexStr(end_addr, true, 2));
}
tmp.add(")");
ostd::RegexRichString rgx(tmp);
rgx.fg("\\(|\\)|-", "darkgray");
rgx.fg("\\*", "red");
rgx.fg("0x[0-9A-Fa-f]+|0b[0-1]+|(?<!\\w)[0-9]+(?!\\w)", "cyan"); //Number Constants
output().pStyled(rgx);
output().fg(ostd::ConsoleColors::White).p(" = ");
output().fg(ostd::ConsoleColors::Gray).p("[");
for (uint16_t a = addr; a <= end_addr; a++)
{
uint8_t value = DragonRuntime::memMap.read8(a);
output().fg(ostd::ConsoleColors::BrightRed).p(ostd::Utils::getHexStr(value, true, 1));
if (a < end_addr)
output().p(" ");
}
output().fg(ostd::ConsoleColors::Gray).p("]");
output().reset().nl();
}
else if (data().command.startsWith("$"))
{
uint16_t size = 0;
uint16_t addr = findSymbol(debugger.data, data().command, &size);
if (addr == 0)
addr = findSymbol(debugger.labels, data().command, &size);
if (addr == 0)
output().fg(ostd::ConsoleColors::Red).p("Unknown symbol for <print> command.").reset().nl();
else
{
ostd::String tmp = "";
tmp.add("*(").add(ostd::Utils::getHexStr(addr, true, 2));
if (size > 1)
tmp.add("-").add(ostd::Utils::getHexStr((uint16_t)(addr + size - 1), true, 2));
tmp.add(")");
ostd::RegexRichString rgx(tmp);
rgx.fg("\\(|\\)|-", "darkgray");
rgx.fg("\\*", "red");
rgx.fg("0x[0-9A-Fa-f]+|0b[0-1]+|(?<!\\w)[0-9]+(?!\\w)", "cyan"); //Number Constants
output().pStyled(rgx);
output().fg(ostd::ConsoleColors::White).p(" = ");
output().fg(ostd::ConsoleColors::Gray).p("[");
if (type == TYPE_STRING)
output().fg(ostd::ConsoleColors::BrightRed).p("\"");
for (uint16_t a = addr; a < addr + size; a++)
{
uint8_t value = DragonRuntime::memMap.read8(a);
if (type == TYPE_STRING)
{
output().fg(ostd::ConsoleColors::BrightRed).pChar((char)value);
continue;
}
output().fg(ostd::ConsoleColors::BrightRed).p(ostd::Utils::getHexStr(value, true, 1));
if (a < addr + size - 1)
output().p(" ");
}
if (type == TYPE_STRING)
output().fg(ostd::ConsoleColors::BrightRed).p("\"");
output().fg(ostd::ConsoleColors::Gray).p("]");
output().reset().nl();
}
}
else
{
output().fg(ostd::ConsoleColors::Red).p("Invalid value for <print> command.").reset().nl();
}
// Display::printPrompt();
data().command = getCommandInput();
}
else if (data().command.startsWith("b ") || data().command.startsWith("break "))
{//0x2C1D
data().command.substr(data().command.indexOf(" ") + 1).trim();
uint16_t addr = 0;
bool valid = false;
if (data().command.isNumeric())
{
addr = (uint16_t)data().command.toInt();
valid = true;
}
else if (data().command.startsWith("$"))
{
addr = findSymbol(debugger.labels, data().command);
if (addr == 0x0000 || addr == 0xFFFF)
output().fg(ostd::ConsoleColors::Red).p("Invalid symbol: ").p(data().command).reset().nl();
else
valid = true;
}
else
{
output().fg(ostd::ConsoleColors::Red).p("Invalid value for <break> command.").reset().nl();
}
if (valid)
{
if (isBreakPoint(addr))
{
removeBreakPoint(addr);
output().fg(ostd::ConsoleColors::Yellow).p("Breakpoint removed at address: ").p(ostd::Utils::getHexStr(addr, true, 2)).reset().nl();
}
else
{
addBreakPoint(addr);
output().fg(ostd::ConsoleColors::Yellow).p("Breakpoint set at address: ").p(ostd::Utils::getHexStr(addr, true, 2)).reset().nl();
}
}
// Display::printPrompt();
data().command = getCommandInput();
}
else
data().command = "";//Display::changeScreen();
}
return DragonRuntime::RETURN_VAL_EXIT_SUCCESS;
}
int32_t DebuggerNew::normal_runtime(bool& outUserQuit)
{
bool result = DragonRuntime::runStep(data().trackedAddresses);
if (isBreakPoint((uint16_t)DragonRuntime::cpu.readRegister(data::Registers::IP)))
{
data().args.step_exec = true;
return step_execution(outUserQuit, false);
}
bool hasError = DragonRuntime::hasError();
bool enableStepExec = !result || hasError || DragonRuntime::cpu.isInDebugBreakPoint();
data().args.step_exec = enableStepExec;
if (enableStepExec)
return step_execution(outUserQuit, false);
return DragonRuntime::RETURN_VAL_EXIT_SUCCESS;
}
@ -455,9 +683,9 @@ namespace dragon
m_gfx.init(*this);
m_gfx.setFont("res/Courier Prime.ttf");
float w = getWindowWidth();
float w = m_consolePosition.x - 12;
float h = 40.0f;
m_textInput.create({ 0.0f, (float)(getWindowHeight() - h) }, { w, h }, "MainInputTXT");
m_textInput.create({ 0.0f, (float)(getWindowHeight() - h) }, { w, h }, "CmdTxt");
m_textInput.setEventListener(m_sigHandler);
m_textInput.getTheme().extraPaddingTop = 3;
@ -472,6 +700,8 @@ namespace dragon
m_wout.setConsolePosition(m_consolePosition);
m_wout.setWrapMode(ogfx::WindowBaseOutputHandler::eWrapMode::TripleDots);
m_wout.setDefaultForegroundColor({ 180, 180, 180, 255 });
std::cout << STR_BOOL(ostd::Utils::loadByteStreamFromFile("./test.dds", m_test)) << "\n";
}
void DebuggerNew::handleSignal(ostd::tSignal& signal)
@ -517,24 +747,18 @@ namespace dragon
m_gfx.outlinedRect(m_wout.getConsoleBounds(), { 0, 0, 20, 255 }, { 255, 255, 255, 200 }, 2);
m_wout.beginFrame();
printStep();
// for (int32_t i = m_codeRandomIndex; i < m_codeRandomIndex + m_consoleSize.y; i++)
// {
// if (i >= m_codeTable.size()) break;
// auto code = m_codeTable[i];
// m_wout.tab().fg({ 100, 100, 100, 255 }).p(ostd::Utils::getHexStr(code.addr, true, 2));
// m_wout.clear().tab().tab();
// // colorCodeInstructions(code.code, m_wout);
// }
ostd::Utils::printByteStream(m_test, 0, 16, 16, m_wout, 8, 4, "HELLO");
// printStep();
// m_textInput.render(m_gfx);
m_textInput.render(m_gfx);
// m_testBtn.render(m_gfx);
}
void DebuggerNew::onFixedUpdate(void)
void DebuggerNew::onFixedUpdate(double frameTime_s)
{
m_textInput.fixedUpdate();
m_testBtn.fixedUpdate();
// std::cout << getFPS() << "\n";
}
void DebuggerNew::onUpdate(void)
@ -542,20 +766,4 @@ namespace dragon
m_textInput.update();
m_testBtn.update();
}
uint32_t __debugger_entry_point(void)
{
DebuggerNew window;
window.initialize(1600, 1000, "DragonVM Live Debugger");
window.setClearColor({ 0, 2 , 15 });
while (window.isRunning())
{
window.update();
}
return 0;
}
}

View file

@ -2,6 +2,7 @@
#include <ostd/Color.hpp>
#include <ostd/Geometry.hpp>
#include <ostd/Types.hpp>
#include <ostd/Utils.hpp>
#include <ostd/IOHandlers.hpp>
#include <ogfx/WindowBase.hpp>
@ -195,6 +196,12 @@ namespace dragon
void processErrors(void);
int32_t loadArguments(int argc, char** argv);
int32_t initRuntime(void);
ostd::String getCommandInput(void);
inline tDebuggerData& data(void) { return debugger; }
inline ostd::ConsoleOutputHandler& output(void) { return out; }
int32_t executeRuntime(void);
int32_t step_execution(bool& outUserQuit, bool exec_first_step = true);
int32_t normal_runtime(bool& outUserQuit);
//Display
void colorizeInstructionBody(const ostd::String& instBody, bool currentLine, const DisassemblyList& labelList);
@ -206,7 +213,7 @@ namespace dragon
void onInitialize(void) override;
void handleSignal(ostd::tSignal& signal) override;
void onRender(void) override;
void onFixedUpdate(void) override;
void onFixedUpdate(double frameTime_s) override;
void onUpdate(void) override;
private:
@ -224,8 +231,9 @@ namespace dragon
ostd::Vec2 m_consolePosition { 650, 8 };
// std::vector<code::Assembler::tDisassemblyLine> m_codeTable;
// int32_t m_codeRandomIndex { 0 };
ostd::ByteStream m_test;
public:
inline static const ostd::String InputCommandQuit = "//quit//";
};
uint32_t __debugger_entry_point(void);
}

View file

@ -1,7 +1,7 @@
#pragma once
#include <ostd/Color.hpp>
#include "../tools/SDLInclude.hpp"
#include "../tools/SDLInclude.hpp" // IWYU pragma: keep
namespace dragon
{
@ -18,7 +18,7 @@ namespace dragon
inline uint32_t* getScreenPixels(void) { return m_pixels; }
void clear(const ostd::Color& color);
private:
uint32_t* m_pixels { nullptr };
SDL_Texture* m_texture { nullptr };
@ -26,4 +26,4 @@ namespace dragon
int32_t m_windowWidth { 0 };
int32_t m_windowHeight { 0 };
};
}
}

View file

@ -1,13 +1,13 @@
#pragma once
#include "../tools/SDLInclude.hpp"
#include "../tools/SDLInclude.hpp" // IWYU pragma: keep
#include <ostd/Utils.hpp>
#include <ostd/Signals.hpp>
#include <ostd/IOHandlers.hpp>
namespace dragon
{
class Window : public ostd::BaseObject
class Window : public ostd::BaseObject
{
public:
inline Window(void) { }
@ -73,8 +73,8 @@ namespace dragon
{
setTypeName("dragon::WindowResizedData");
validate();
}
}
public:
int32_t new_width;
int32_t new_height;
@ -114,4 +114,4 @@ namespace dragon
eKeyEvent eventType;
Window& parentWindow;
};
}
}

View file

@ -1,6 +1,5 @@
#include "MemoryMapper.hpp"
#include <ostd/Utils.hpp>
#include <iostream>
#include "../tools/GlobalData.hpp"

View file

@ -3,7 +3,6 @@
#include <ostd/Defines.hpp>
#include <ostd/Utils.hpp>
#include <iostream>
#include "../runtime/DragonRuntime.hpp"
@ -223,7 +222,7 @@ namespace dragon
{
case data::OpCodes::NoOp:
{
}
break;
case data::OpCodes::DEBUG_Break:
@ -306,7 +305,7 @@ namespace dragon
uint8_t destRegAddr = fetch8();
uint8_t srcRegAddr = fetch8();
uint16_t addr = readRegister(srcRegAddr);
int16_t value = m_memory.read16(addr);
int16_t value = m_memory.read16(addr);
writeRegister16(destRegAddr, value);
}
break;
@ -377,7 +376,7 @@ namespace dragon
uint16_t destAddr = fetch16();
uint8_t srcRegAddr = fetch8();
uint16_t addr = readRegister(srcRegAddr);
int8_t value = m_memory.read8(addr);
int8_t value = m_memory.read8(addr);
m_memory.write8(destAddr, value);
}
break;
@ -827,7 +826,7 @@ namespace dragon
int16_t arg_data = m_memory.read16(pp_val);
writeRegister16(data::Registers::PP, pp_val - 2);
writeRegister16(regAddr, arg_data);
std::cout << ostd::Utils::getHexStr(readRegister(data::Registers::IP), true, 2) << "\n";
// std::cout << ostd::Utils::getHexStr(readRegister(data::Registers::IP), true, 2) << "\n";
}
break;
case data::OpCodes::RetInt:
@ -954,4 +953,4 @@ namespace dragon
m_debug_stackFrameStrings.push_back(stackFrameString);
}
}
}
}

View file

@ -70,7 +70,7 @@ namespace dragon
m_refreshScreen = false;
}
}
m_redrawScreen = m_redrawScreen && !DragonRuntime::vGraphicsInterface.readFlag(hw::interface::Graphics::tFlags::ScreenRedrawDisabled);
if (m_redrawScreen)
{
@ -81,7 +81,7 @@ namespace dragon
// static char c = 'A';
void VirtualDisplay::onUpdate(void)
void VirtualDisplay::onUpdate(void)
{
auto& mem = DragonRuntime::memMap;
uint16_t vga_addr = data::MemoryMapAddresses::VideoCardInterface_Start;
@ -154,7 +154,7 @@ namespace dragon
// if (c > 'Z')
// c = 'A';
// }
DragonRuntime::vGraphicsInterface.writeVRAM_16Colors(static_cast<uint8_t>(x), static_cast<uint8_t>(y), textCell.character, textCell.backgroundColor, textCell.foregroundColor);
}
else if (signal == tSignalValues::ClearSCreen)
@ -209,7 +209,10 @@ namespace dragon
}
}
void VirtualDisplay::onSlowUpdate(void) { }
void VirtualDisplay::onSlowUpdate(void)
{
std::cout << (int)getFPS() << "\n";
}
void VirtualDisplay::__redraw_screen(void)
{
@ -243,7 +246,7 @@ namespace dragon
{
m_singleTextLines.push_back(ostd::String().addChar(c));
auto& line = m_singleTextLines[m_singleTextLines.size() - 1];
if (invert_colors == 0)
if (invert_colors == 0)
RawTextRenderer::drawString(ostd::String().addChar(c), line.len() - 1, m_singleTextLines.size() - 1, m_renderer.getScreenPixels(), getWindowWidth(), getWindowHeight(), m_fontPixels, config.singleColor_foreground, config.singleColor_background);
else
RawTextRenderer::drawString(ostd::String().addChar(c), line.len() - 1, m_singleTextLines.size() - 1, m_renderer.getScreenPixels(), getWindowWidth(), getWindowHeight(), m_fontPixels, config.singleColor_background, config.singleColor_foreground);
@ -316,6 +319,6 @@ namespace dragon
{
m_text16_palettes.push_back(new data::BiosVideoDefaultPalette); //TODO: Delete, Memory Leak
}
}
}
}

View file

@ -4,13 +4,12 @@
#include "VirtualHardDrive.hpp"
#include "MemoryMapper.hpp"
#include "VirtualCPU.hpp"
#include "VirtualRAM.hpp"
#include "../runtime/DragonRuntime.hpp"
#include "../gui/RawTextRenderer.hpp"
//TODO: Fix all access functions (reads and writes) ensuring the address is not out of bounds.
// Right now the check is done, but just to push an error if out of bounds; the address
// Right now the check is done, but just to push an error if out of bounds; the address
// gets still used even in that case, which is really dumb and will probably crash the
// runtime most of the time.
@ -63,7 +62,7 @@ namespace dragon
InterruptVector::InterruptVector(void)
{
uint32_t dataSize = data::MemoryMapAddresses::IntVector_End - data::MemoryMapAddresses::IntVector_Start;
@ -111,7 +110,7 @@ namespace dragon
void VirtualKeyboard::init(void)
{
uint32_t dataSize = data::MemoryMapAddresses::Keyboard_End - data::MemoryMapAddresses::Keyboard_Start;
@ -223,7 +222,7 @@ namespace dragon
m_data[addr + 1] = value & 0xFF;
return value;
}
int16_t VirtualKeyboard::__sdl_key_code_convert(int32_t keyCode)
{
switch (keyCode)
@ -355,7 +354,7 @@ namespace dragon
VirtualMouse::VirtualMouse(void)
{
@ -389,7 +388,7 @@ namespace dragon
VirtualBootloader::VirtualBootloader(void)
{
for (int32_t i = 0; i < 512; i++)
@ -751,7 +750,7 @@ namespace dragon
return false; //TODO: Error
outTextCell.foregroundColor = outVal;
return true;
}
}
bool Graphics::writeVRAM_16Colors(uint8_t x, uint8_t y, uint8_t character, uint8_t background, uint8_t foreground)
{
@ -967,4 +966,4 @@ namespace dragon
}
}
}
}
}

View file

@ -1,7 +1,5 @@
#pragma once
#include "../gui/Window.hpp"
#include "../hardware/VirtualCPU.hpp"
#include "../hardware/MemoryMapper.hpp"
#include "../hardware/VirtualRAM.hpp"
@ -90,7 +88,7 @@ namespace dragon
static int32_t loadArguments(int argc, char** argv, tCommandLineArgs& args);
static int32_t initMachine(const ostd::String& configFilePath,
bool verbose = false,
bool trackMachineInfoDiff = false,
bool trackMachineInfoDiff = false,
bool hideVirtualDisplay = false,
bool rackCallStack = false,
bool debugModeEnabled = false);
@ -154,4 +152,4 @@ namespace dragon
friend class SignalListener;
};
}
}