Refactor to the new OmniaFramework structure
This commit is contained in:
parent
d0e8f5d43d
commit
2486e5e4c0
38 changed files with 190 additions and 139 deletions
|
|
@ -3,7 +3,7 @@ Bios = dragon/bios.bin
|
|||
CMOS = dragon/cmos.dr
|
||||
|
||||
cpuext = extmov, extalu
|
||||
fixed_clock = false
|
||||
fixed_clock = true
|
||||
clock_rate_sec = 5000
|
||||
memory_extension_pages = 16
|
||||
|
||||
|
|
@ -11,4 +11,4 @@ screen_redraw_rate_per_second = 10
|
|||
|
||||
SingleColor_foreground = #009900FF
|
||||
SingleColor_background = #111111FF
|
||||
16Color_Palette = 0
|
||||
16Color_Palette = 0
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -10,4 +10,4 @@ _init_keyboard_driver: ## _init_keyboard_driver(func_ptr* key_pressed_handler)
|
|||
mov R10, 0x00 ## int 0x20 param for set_interrupt_handler
|
||||
mov R8, 0xA0 ## 0xA0 is the hardware interrupt for KeyPressed
|
||||
int 0x20
|
||||
ret
|
||||
ret
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
.header KERNEL0_BOOT
|
||||
|
||||
@include <../../sdk/bios_api.dss>
|
||||
@include <../drivers/keyboard_driver.dss>
|
||||
@include <../drivers/display_driver.dss>
|
||||
@include <../drivers/keyboard_driver.dss>
|
||||
@include <memory.dss>
|
||||
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ _kernel0_main:
|
|||
call $_print_string
|
||||
## debug_break
|
||||
_infinite_loop_0:
|
||||
jmp $_infinite_loop_0
|
||||
## jmp $_infinite_loop_0
|
||||
|
||||
mov [$cursor_x], 0
|
||||
|
||||
|
|
@ -58,16 +58,18 @@ _infinite_loop:
|
|||
|
||||
## =========================================================================================================================
|
||||
_key_pressed:
|
||||
## debug_break
|
||||
debug_break
|
||||
mov R1, [Keyboard_Registers.KEYCODE]
|
||||
|
||||
mov ACC, KeyCodes.Return
|
||||
jeq $_key_pressed_enter, R1
|
||||
|
||||
mov ACC, KeyCodes.LowerCase_a
|
||||
jls $_key_pressed_end, R1
|
||||
mov ACC, KeyCodes.LowerCase_z
|
||||
jgr $_key_pressed_end, R1
|
||||
push R1
|
||||
push 1
|
||||
call $_is_char_printable
|
||||
|
||||
mov ACC, RV
|
||||
jne $_key_pressed_end, 1
|
||||
push R1
|
||||
mov R2, [$cursor_x]
|
||||
push R2
|
||||
|
|
@ -87,4 +89,17 @@ _key_pressed_enter:
|
|||
|
||||
_key_pressed_end:
|
||||
ret
|
||||
|
||||
|
||||
_is_char_printable:
|
||||
arg R9
|
||||
mov ACC, KeyCodes.Spacebar
|
||||
jls $_is_char_printable_false, R9
|
||||
mov ACC, KeyCodes.LowerCase_z
|
||||
jgr $_is_char_printable_false, R9
|
||||
mov RV, 1
|
||||
ret
|
||||
_is_char_printable_false:
|
||||
mov RV, 0
|
||||
ret
|
||||
## =========================================================================================================================
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## --
|
||||
## -- This file is automatically generated by the DragonAssembler (version 0.4.1641)
|
||||
## -- This file is automatically generated by the DragonAssembler (version 0.4.1642)
|
||||
## -- Please do not modify this file in any way.
|
||||
## --
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1642
|
||||
1643
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#include "Assembler.hpp"
|
||||
#include <ostd/File.hpp>
|
||||
#include <ostd/io/File.hpp>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/Serial.hpp>
|
||||
#include <ostd/IOHandlers.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include <ostd/io/Serial.hpp>
|
||||
#include <ostd/io/IOHandlers.hpp>
|
||||
|
||||
#include "../tools/GlobalData.hpp"
|
||||
#include "../hardware/VirtualHardDrive.hpp"
|
||||
|
|
@ -1143,6 +1143,11 @@ namespace dragon
|
|||
m_code.push_back(data::OpCodes::DEBUG_Break);
|
||||
return;
|
||||
}
|
||||
else if (ostd::String(line).toLower().startsWith("debug_ram_dump"))
|
||||
{
|
||||
m_code.push_back(data::OpCodes::DEBUG_DumpRAM);
|
||||
return;
|
||||
}
|
||||
else if (ostd::String(line).toLower().startsWith("debug_profile_stop"))
|
||||
{
|
||||
m_code.push_back(data::OpCodes::DEBUG_StopProfile);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/IOHandlers.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include <ostd/io/IOHandlers.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace dragon
|
||||
|
|
@ -26,7 +26,7 @@ namespace dragon
|
|||
inline static std::vector<ostd::String> m_lines;
|
||||
inline static std::vector<ostd::String> m_guards;
|
||||
inline static ostd::String m_directory { "" };
|
||||
};
|
||||
};
|
||||
|
||||
class Assembler
|
||||
{
|
||||
|
|
@ -170,7 +170,7 @@ namespace dragon
|
|||
inline static std::vector<tStructDefinition> m_structDefs;
|
||||
inline static std::vector<tDisassemblyLine> m_disassembly;
|
||||
|
||||
inline static std::unordered_map<ostd::String, tExportSpec> m_exports;
|
||||
inline static std::unordered_map<ostd::String, tExportSpec> m_exports;
|
||||
|
||||
inline static ostd::ConsoleOutputHandler out;
|
||||
|
||||
|
|
@ -180,4 +180,4 @@ namespace dragon
|
|||
inline static std::vector<ostd::String> cpuExtensions;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include "Assembler.hpp"
|
||||
#include <ostd/Random.hpp>
|
||||
#include <ostd/math/Random.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "Assembler.hpp"
|
||||
|
||||
#include <ostd/File.hpp>
|
||||
#include <ostd/io/File.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
@ -12,7 +12,7 @@ namespace dragon
|
|||
m_lines.clear();
|
||||
m_directory = "";
|
||||
m_lines = __load_file(filePath);
|
||||
|
||||
|
||||
if (m_lines.size() == 0) return { }; //TODO: Error
|
||||
if (filePath.contains("/"))
|
||||
m_directory = filePath.new_substr(0, filePath.lastIndexOf("/") + 1);
|
||||
|
|
@ -99,4 +99,4 @@ namespace dragon
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include <ostd/utils/Defines.hpp>
|
||||
#include "Assembler.hpp"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
@ -16,4 +17,4 @@ int main(int argc, char** argv)
|
|||
if (args.save_disassembly)
|
||||
dragon::code::Assembler::saveDisassemblyToFile(args.disassembly_file_path);
|
||||
return dragon::code::Assembler::Application::RETURN_VAL_EXIT_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
#include "Debugger.hpp"
|
||||
#include "../runtime/DragonRuntime.hpp"
|
||||
#include "DisassemblyLoader.hpp"
|
||||
#include <ostd/Defines.hpp>
|
||||
#include <ostd/Console.hpp>
|
||||
#include <ostd/io/Console.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
@ -1438,6 +1437,8 @@ namespace dragon
|
|||
processErrors();
|
||||
if (DragonRuntime::cpu.isInDebugBreakPoint())
|
||||
output().fg(ostd::ConsoleColors::Red).p("Reached Debug Break Point.").reset().nl();
|
||||
if (DragonRuntime::cpu.isRamDumped())
|
||||
output().fg(ostd::ConsoleColors::Red).p("RAM Dumped to <ram_dump.bin>.").reset().nl();
|
||||
Display::printPrompt();
|
||||
data().command = getCommandInput();
|
||||
data().command.trim().toLower();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/IOHandlers.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include <ostd/io/IOHandlers.hpp>
|
||||
#include "../assembler/Assembler.hpp"
|
||||
|
||||
namespace dragon
|
||||
|
|
@ -87,7 +87,7 @@ namespace dragon
|
|||
static inline ostd::ConsoleOutputHandler& output(void) { return out; }
|
||||
static int32_t topLevelPrompt(void);
|
||||
static int32_t executeRuntime(void);
|
||||
|
||||
|
||||
private:
|
||||
static int32_t step_execution(bool& outUserQuit, bool exec_first_step = true);
|
||||
static int32_t normal_runtime(bool& outUserQuit);
|
||||
|
|
@ -103,4 +103,4 @@ namespace dragon
|
|||
public:
|
||||
inline static const ostd::String InputCommandQuit = "//quit//";
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
#include <cstdint>
|
||||
#include <ogfx/BasicRenderer.hpp>
|
||||
#include <ogfx/WindowBase.hpp>
|
||||
#include <ostd/Defines.hpp>
|
||||
#include <ostd/Geometry.hpp>
|
||||
#include <ostd/IOHandlers.hpp>
|
||||
#include <ostd/Random.hpp>
|
||||
#include <ostd/String.hpp>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/math/Geometry.hpp>
|
||||
#include <ostd/io/IOHandlers.hpp>
|
||||
#include <ostd/math/Random.hpp>
|
||||
#include <ostd/string/String.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include "DisassemblyLoader.hpp"
|
||||
#include "../runtime/DragonRuntime.hpp"
|
||||
|
||||
|
|
@ -701,7 +700,7 @@ namespace dragon
|
|||
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";
|
||||
std::cout << STR_BOOL(ostd::Utils::loadByteStreamFromFile("./bios.bin", m_test)) << "\n";
|
||||
}
|
||||
|
||||
void DebuggerNew::handleSignal(ostd::tSignal& signal)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Color.hpp>
|
||||
#include <ostd/Geometry.hpp>
|
||||
#include <ostd/Types.hpp>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/IOHandlers.hpp>
|
||||
#include <ostd/data_types/Color.hpp>
|
||||
#include <ostd/math/Geometry.hpp>
|
||||
#include <ostd/data_types/Types.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include <ostd/io/IOHandlers.hpp>
|
||||
#include <ogfx/WindowBase.hpp>
|
||||
#include <ogfx/BasicRenderer.hpp>
|
||||
#include <ogfx/RawTextInput.hpp>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "DisassemblyLoader.hpp"
|
||||
|
||||
#include <ostd/File.hpp>
|
||||
#include <ostd/Serial.hpp>
|
||||
#include <ostd/io/File.hpp>
|
||||
#include <ostd/io/Serial.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "../assembler/Assembler.hpp"
|
||||
|
||||
#include <ostd/Types.hpp>
|
||||
#include <ostd/data_types/Types.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,54 +1,56 @@
|
|||
// #include "Debugger.hpp"
|
||||
#include <ostd/utils/Defines.hpp>
|
||||
#include "Debugger.hpp"
|
||||
#include "../runtime/DragonRuntime.hpp"
|
||||
#include "DebuggerNew.hpp"
|
||||
#include <ostd/Signals.hpp>
|
||||
// #include "DebuggerNew.hpp"
|
||||
#include <ostd/utils/Signals.hpp>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// //Loading commandline arguments
|
||||
// int32_t rValue = dragon::Debugger::loadArguments(argc, argv);
|
||||
// if (rValue == dragon::DragonRuntime::RETURN_VAL_CLOSE_DEBUGGER)
|
||||
// return 0;
|
||||
// if (rValue != 0) return rValue;
|
||||
|
||||
// //Initializing the runtime
|
||||
// rValue = dragon::Debugger::initRuntime();
|
||||
// if (rValue == dragon::DragonRuntime::RETURN_VAL_CLOSE_DEBUGGER)
|
||||
// return 0;
|
||||
// if (rValue != 0) return rValue;
|
||||
|
||||
// //Running top-level prompt
|
||||
// rValue = dragon::Debugger::topLevelPrompt();
|
||||
// if (rValue == dragon::DragonRuntime::RETURN_VAL_CLOSE_DEBUGGER)
|
||||
// return 0;
|
||||
// if (rValue != 0) return rValue;
|
||||
|
||||
// //Executing the runtime
|
||||
// return dragon::Debugger::executeRuntime();
|
||||
|
||||
|
||||
ostd::SignalHandler::init();
|
||||
|
||||
dragon::DebuggerNew debuggerInstance;
|
||||
debuggerInstance.initialize(2000, 1090, "DragonVM Live Debugger");
|
||||
debuggerInstance.setClearColor({ 5, 0, 0 });
|
||||
|
||||
//Loading commandline arguments
|
||||
int32_t rValue = debuggerInstance.loadArguments(argc, argv);
|
||||
int32_t rValue = dragon::Debugger::loadArguments(argc, argv);
|
||||
if (rValue == dragon::DragonRuntime::RETURN_VAL_CLOSE_DEBUGGER)
|
||||
return 0;
|
||||
if (rValue != 0) return rValue;
|
||||
|
||||
//Initializing the runtime
|
||||
rValue = debuggerInstance.initRuntime();
|
||||
rValue = dragon::Debugger::initRuntime();
|
||||
if (rValue == dragon::DragonRuntime::RETURN_VAL_CLOSE_DEBUGGER)
|
||||
return 0;
|
||||
if (rValue != 0) return rValue;
|
||||
|
||||
while (debuggerInstance.isRunning())
|
||||
{
|
||||
debuggerInstance.update();
|
||||
}
|
||||
//Running top-level prompt
|
||||
rValue = dragon::Debugger::topLevelPrompt();
|
||||
if (rValue == dragon::DragonRuntime::RETURN_VAL_CLOSE_DEBUGGER)
|
||||
return 0;
|
||||
if (rValue != 0) return rValue;
|
||||
|
||||
//Executing the runtime
|
||||
return dragon::Debugger::executeRuntime();
|
||||
|
||||
|
||||
|
||||
// dragon::DebuggerNew debuggerInstance;
|
||||
// debuggerInstance.initialize(2000, 1090, "DragonVM Live Debugger");
|
||||
// debuggerInstance.setClearColor({ 5, 0, 0 });
|
||||
|
||||
// //Loading commandline arguments
|
||||
// int32_t rValue = debuggerInstance.loadArguments(argc, argv);
|
||||
// if (rValue == dragon::DragonRuntime::RETURN_VAL_CLOSE_DEBUGGER)
|
||||
// return 0;
|
||||
// if (rValue != 0) return rValue;
|
||||
|
||||
// //Initializing the runtime
|
||||
// rValue = debuggerInstance.initRuntime();
|
||||
// if (rValue == dragon::DragonRuntime::RETURN_VAL_CLOSE_DEBUGGER)
|
||||
// return 0;
|
||||
// if (rValue != 0) return rValue;
|
||||
|
||||
// while (debuggerInstance.isRunning())
|
||||
// {
|
||||
// debuggerInstance.update();
|
||||
// }
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/BaseObject.hpp>
|
||||
#include <ostd/data_types/BaseObject.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
@ -16,4 +16,4 @@ namespace dragon
|
|||
virtual inline ostd::ByteStream* getByteStream(void) = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include "MemoryMapper.hpp"
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/io/Serial.hpp>
|
||||
#include <ostd/data_types/Types.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
|
||||
#include "../tools/GlobalData.hpp"
|
||||
|
||||
|
|
@ -71,4 +73,4 @@ namespace dragon
|
|||
return nullptr; //TODO: Error
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "IMemoryDevice.hpp"
|
||||
#include <ostd/String.hpp>
|
||||
#include <ostd/string/String.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace dragon
|
||||
|
|
@ -39,4 +39,4 @@ namespace dragon
|
|||
std::vector<tMemoryRegion> m_regions;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include "VirtualCPU.hpp"
|
||||
#include "../tools/GlobalData.hpp"
|
||||
|
||||
#include <ostd/Defines.hpp>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <iostream>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
|
||||
#include "../runtime/DragonRuntime.hpp"
|
||||
|
||||
|
|
@ -209,6 +209,7 @@ namespace dragon
|
|||
m_currentExtension = nullptr;
|
||||
m_currentExtInst = 0x00;
|
||||
m_isDebugBreakPoint = false;
|
||||
m_ramDumped = false;
|
||||
m_isOffsetAddressingEnabled = readFlag(data::Flags::OffsetModeEnabled);
|
||||
if (m_isOffsetAddressingEnabled)
|
||||
m_currentOffset = readRegister(data::Registers::OFFSET);
|
||||
|
|
@ -230,6 +231,13 @@ namespace dragon
|
|||
m_isDebugBreakPoint = true;
|
||||
}
|
||||
break;
|
||||
case data::OpCodes::DEBUG_DumpRAM:
|
||||
{
|
||||
ostd::Utils::saveByteStreamToFile(*DragonRuntime::ram.getByteStream(), "ram_dump.bin");
|
||||
m_isDebugBreakPoint = true;
|
||||
m_ramDumped = true;
|
||||
}
|
||||
break;
|
||||
case data::OpCodes::BIOSModeImm:
|
||||
{
|
||||
uint16_t tmpAddr = m_currentAddr;
|
||||
|
|
@ -796,9 +804,17 @@ namespace dragon
|
|||
break;
|
||||
case data::OpCodes::CallImm:
|
||||
{
|
||||
bool test = false;
|
||||
if (readRegister(data::Registers::IP) == 0x2CF1)
|
||||
test = true;
|
||||
uint16_t subroutineAddr = fetch16();
|
||||
pushStackFrame();
|
||||
writeRegister16(data::Registers::IP, subroutineAddr);
|
||||
if (test)
|
||||
{
|
||||
std::cout << ostd::Utils::getHexStr(subroutineAddr, true, 2) << "\n";
|
||||
std::cin.get();
|
||||
}
|
||||
m_subroutineCounter++;
|
||||
}
|
||||
break;
|
||||
|
|
@ -820,6 +836,11 @@ namespace dragon
|
|||
break;
|
||||
case data::OpCodes::ArgReg:
|
||||
{
|
||||
if (isInDebugBreakPoint())
|
||||
{
|
||||
std::cout << ostd::Utils::getHexStr(readRegister(data::Registers::IP));
|
||||
std::cin.get();
|
||||
}
|
||||
uint8_t regAddr = fetch8();
|
||||
if (!isInSubRoutine()) break;
|
||||
int16_t pp_val = readRegister(data::Registers::PP);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Types.hpp>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/Bitfields.hpp>
|
||||
#include <ostd/data_types/Types.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include <ostd/data_types/Bitfields.hpp>
|
||||
#include "IMemoryDevice.hpp"
|
||||
|
||||
#include "../debugger/Debugger.hpp"
|
||||
|
|
@ -43,6 +43,7 @@ namespace dragon
|
|||
inline bool isHalted(void) const { return m_halt; }
|
||||
inline uint8_t getCurrentInstruction(void) const { return m_currentInst; }
|
||||
inline bool isInDebugBreakPoint(void) const { return m_isDebugBreakPoint; }
|
||||
inline bool isRamDumped(void) const { return m_ramDumped; }
|
||||
inline bool isInBIOSMOde(void) const { return m_biosMode; }
|
||||
inline bool isInSubRoutine(void) const { return m_subroutineCounter > 0; }
|
||||
inline int32_t getSubRoutineCounter(void) const { return m_subroutineCounter; }
|
||||
|
|
@ -50,7 +51,7 @@ namespace dragon
|
|||
inline uint8_t getCurrentCPUExtensionInstruction(void) const { return m_currentExtInst; }
|
||||
inline bool isOffsetAddressingModeEnabled(void) const { return m_isOffsetAddressingEnabled; }
|
||||
inline uint16_t getCurrentOffset(void) const { return m_currentOffset; }
|
||||
|
||||
|
||||
private:
|
||||
void __debug_store_stack_frame_string_on_push(void);
|
||||
|
||||
|
|
@ -65,6 +66,7 @@ namespace dragon
|
|||
bool m_biosMode { true };
|
||||
int32_t m_interruptHandlerCount { 0 };
|
||||
bool m_isDebugBreakPoint { false };
|
||||
bool m_ramDumped { false };
|
||||
bool m_debugModeEnabled { false };
|
||||
int32_t m_subroutineCounter { 0 };
|
||||
bool m_debugProfilerStarted { false };
|
||||
|
|
@ -85,4 +87,4 @@ namespace dragon
|
|||
friend class dragon::Debugger;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <fstream>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
@ -20,7 +20,7 @@ namespace dragon
|
|||
bool writeBuffer(uint32_t addr);
|
||||
|
||||
void unmount(void);
|
||||
|
||||
|
||||
inline bool isInitialized(void) const { return m_initialized; }
|
||||
inline uint64_t getSize(void) const { return m_fileSize; };
|
||||
inline bool isSame(VirtualHardDrive& vhdd) { return m_diskID == vhdd.m_diskID; }
|
||||
|
|
@ -35,4 +35,4 @@ namespace dragon
|
|||
inline static uint32_t s_nextDiskID = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include "VirtualIODevices.hpp"
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
|
||||
#include "VirtualHardDrive.hpp"
|
||||
#include "MemoryMapper.hpp"
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
#include "IMemoryDevice.hpp"
|
||||
#include "../tools/GlobalData.hpp"
|
||||
#include <ostd/Serial.hpp>
|
||||
#include <ostd/io/Serial.hpp>
|
||||
#include <fstream>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
@ -429,4 +430,4 @@ namespace dragon
|
|||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Serial.hpp>
|
||||
#include <ostd/io/Serial.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
namespace hw
|
||||
{
|
||||
class VirtualMMU //TODO: Implement for later use
|
||||
class VirtualMMU //TODO: Implement for later use
|
||||
{
|
||||
public:
|
||||
inline VirtualMMU(void) { init(); }
|
||||
|
|
@ -20,4 +20,4 @@ namespace dragon
|
|||
inline static constexpr uint16_t PageSize = 512;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Serial.hpp>
|
||||
#include <ostd/io/Serial.hpp>
|
||||
#include "IMemoryDevice.hpp"
|
||||
|
||||
namespace dragon
|
||||
|
|
@ -22,4 +22,4 @@ namespace dragon
|
|||
ostd::serial::SerialIO m_memory;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "ConfigLoader.hpp"
|
||||
#include <ostd/File.hpp>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/io/File.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include "../hardware/CPUExtensions.hpp"
|
||||
|
||||
namespace dragon
|
||||
|
|
@ -95,8 +95,8 @@ namespace dragon
|
|||
lineEdit.trim().toLower();
|
||||
if (!lineEdit.isNumeric()) continue; //TODO: Error
|
||||
config.memory_extension_pages = lineEdit.toInt();
|
||||
|
||||
//TODO: Warnings
|
||||
|
||||
//TODO: Warnings
|
||||
if (config.memory_extension_pages < 0)
|
||||
config.memory_extension_pages = 0;
|
||||
if (config.memory_extension_pages > data::DefaultValues::MaxMemoryExtensionPages)
|
||||
|
|
@ -126,4 +126,4 @@ namespace dragon
|
|||
config.m_valid = true;
|
||||
return config;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Color.hpp>
|
||||
#include <ostd/data_types/Color.hpp>
|
||||
#include <map>
|
||||
#include "../tools/GlobalData.hpp"
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ namespace dragon
|
|||
ostd::Color singleColor_foreground;
|
||||
uint8_t text16_palette { 0 };
|
||||
uint8_t screen_redraw_rate_per_second { 10 };
|
||||
|
||||
|
||||
inline bool isValid(void) const { return m_valid; }
|
||||
inline void destroy(void) { for (auto& ptr : cpuext_list) delete ptr.second; }
|
||||
|
||||
|
|
@ -37,4 +37,4 @@ namespace dragon
|
|||
private:
|
||||
static const tMachineConfig& validate_machine_config(tMachineConfig& config);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "DragonRuntime.hpp"
|
||||
#include <ostd/Defines.hpp>
|
||||
#include <ogfx/PixelRenderer.hpp>
|
||||
|
||||
namespace dragon
|
||||
|
|
@ -386,7 +385,7 @@ namespace dragon
|
|||
// out.fg(ostd::ConsoleColors::Red).p(getAvgClockSpeed()).nl().reset();
|
||||
acc = 0;
|
||||
}
|
||||
if (acc2 == (1000 / screenRedrawRate))
|
||||
if (acc2 == (1000.0 / screenRedrawRate))
|
||||
{
|
||||
vDisplay.redrawScreen();
|
||||
acc2 = 0;
|
||||
|
|
@ -407,7 +406,7 @@ namespace dragon
|
|||
bool running = cpu.execute() && vDisplay.isRunning();
|
||||
uint8_t screenRedrawRate = vCMOS.read8(data::CMOSRegisters::ScreenRedrawRate);
|
||||
vDisplay.update();
|
||||
if (s_enableScreenRedrawDelay && s_stepAcc2 == (1000 / screenRedrawRate))
|
||||
if (s_enableScreenRedrawDelay && s_stepAcc2 == (1000.0 / screenRedrawRate))
|
||||
{
|
||||
vDisplay.redrawScreen();
|
||||
s_stepAcc2 = 0;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/utils/Defines.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include "DragonRuntime.hpp"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Types.hpp>
|
||||
#include <ostd/Color.hpp>
|
||||
#include <ostd/data_types/Types.hpp>
|
||||
#include <ostd/data_types/Color.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
@ -294,7 +294,8 @@ namespace dragon
|
|||
inline static constexpr uint8_t BIOSModeImm = 0x02;
|
||||
inline static constexpr uint8_t DEBUG_StartProfile = 0x03;
|
||||
inline static constexpr uint8_t DEBUG_StopProfile = 0x04;
|
||||
|
||||
inline static constexpr uint8_t DEBUG_DumpRAM = 0x05;
|
||||
|
||||
inline static constexpr uint8_t MovImmReg = 0x10;
|
||||
inline static constexpr uint8_t MovRegReg = 0x11;
|
||||
inline static constexpr uint8_t MovRegMem = 0x12;
|
||||
|
|
@ -352,7 +353,7 @@ namespace dragon
|
|||
inline static constexpr uint8_t NotReg = 0x6A;
|
||||
inline static constexpr uint8_t NegReg = 0x6B;
|
||||
inline static constexpr uint8_t NegByteReg = 0x6C;
|
||||
|
||||
|
||||
inline static constexpr uint8_t JmpNotEqImm = 0x70;
|
||||
inline static constexpr uint8_t JmpNotEqReg = 0x71;
|
||||
inline static constexpr uint8_t JmpEqImm = 0x72;
|
||||
|
|
@ -383,7 +384,7 @@ namespace dragon
|
|||
inline static constexpr uint8_t Ext14 = 0xED;
|
||||
inline static constexpr uint8_t Ext15 = 0xEE;
|
||||
inline static constexpr uint8_t Ext16 = 0xEF;
|
||||
|
||||
|
||||
inline static constexpr uint8_t ZeroFlag = 0xF0;
|
||||
inline static constexpr uint8_t SetFlag = 0xF1;
|
||||
inline static constexpr uint8_t ToggleFlag = 0xF2;
|
||||
|
|
@ -394,11 +395,11 @@ namespace dragon
|
|||
static ostd::String getOpCodeString(uint8_t opCode);
|
||||
static uint8_t getInstructionSIze(uint8_t opCode);
|
||||
};
|
||||
|
||||
|
||||
class DefaultValues
|
||||
{
|
||||
public:
|
||||
inline static constexpr uint8_t MaxMemoryExtensionPages = 255;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#include "Tools.hpp"
|
||||
|
||||
#include <ostd/Color.hpp>
|
||||
#include <ostd/IOHandlers.hpp>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/data_types/Color.hpp>
|
||||
#include <ostd/io/IOHandlers.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include <fstream>
|
||||
#include "../hardware/VirtualHardDrive.hpp"
|
||||
#include "GlobalData.hpp"
|
||||
#include "debugger/DisassemblyLoader.hpp"
|
||||
#include <ostd/Serial.hpp>
|
||||
#include <ostd/io/Serial.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/IOHandlers.hpp>
|
||||
#include <ostd/io/IOHandlers.hpp>
|
||||
#include "GlobalData.hpp"
|
||||
#include <unordered_map>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "Utils.hpp"
|
||||
#include <ostd/Serial.hpp>
|
||||
#include <ostd/Utils.hpp>
|
||||
#include <ostd/Random.hpp>
|
||||
#include <ostd/io/Serial.hpp>
|
||||
#include <ostd/utils/Utils.hpp>
|
||||
#include <ostd/math/Random.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
@ -17,4 +17,4 @@ namespace dragon
|
|||
name.addChar(rnd_char());
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <ostd/Types.hpp>
|
||||
#include <ostd/String.hpp>
|
||||
#include <ostd/data_types/Types.hpp>
|
||||
#include <ostd/string/String.hpp>
|
||||
|
||||
namespace dragon
|
||||
{
|
||||
|
|
@ -9,5 +9,5 @@ namespace dragon
|
|||
{
|
||||
public:
|
||||
static ostd::String genRandomName(uint8_t length);
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include <ostd/utils/Defines.hpp>
|
||||
#include "Tools.hpp"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return dragon::Tools::execute(argc, argv);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue