Skip to content

Commit

Permalink
wip of property rework
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Nov 13, 2024
1 parent 2a101a9 commit c20e1a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
23 changes: 17 additions & 6 deletions src/cadmium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
#include <stylemanager.hpp>
#include "configuration.hpp"

extern "C" {
#include <raymath.h>
};

#include <date/date.h>
#include <fmt/format.h>
Expand Down Expand Up @@ -504,7 +502,7 @@ class Cadmium : public emu::EmuHostEx
using ExecMode = emu::IChip8Emulator::ExecMode;
using CpuState = emu::IChip8Emulator::CpuState;
enum MemFlags { eNONE = 0, eBREAKPOINT = 1, eWATCHPOINT = 2 };
enum MainView { eVIDEO, eDEBUGGER, eEDITOR, eTRACELOG, eSETTINGS, eROM_SELECTOR, eROM_EXPORT };
enum MainView { eVIDEO, eDEBUGGER, eEDITOR, eTRACELOG, eSETTINGS, eROM_SELECTOR, eROM_EXPORT, eLIBRARY };
enum EmulationMode { eCOSMAC_VIP_CHIP8, eGENERIC_CHIP8 };
enum FileBrowserMode { eLOAD, eSAVE, eWEB_SAVE };
static constexpr int MIN_SCREEN_WIDTH = 512;
Expand Down Expand Up @@ -1648,6 +1646,11 @@ void main()
_librarian.fetchDir(_currentDirectory);
#endif
}
#ifndef PLATFORM_WEB
if (iconButton(ICON_NOTEBOOK, _mainView == eLIBRARY)) {
_mainView = eLIBRARY;
}
#endif
SetNextWidth(130);
SetStyle(TEXTBOX, BORDER_WIDTH, 1);
TextBox(_romName, 4095);
Expand Down Expand Up @@ -1704,7 +1707,7 @@ void main()
}
}
SetTooltip("RESTART");
int buttonsRight = 7;
int buttonsRight = 8;
++buttonsRight;
int avail = 202;
#ifdef RESIZABLE_GUI
Expand Down Expand Up @@ -1742,12 +1745,10 @@ void main()

static Vector2 versionSize = MeasureTextEx(GuiGetFont(), "v" CADMIUM_VERSION, 8, 0);
DrawTextEx(GuiGetFont(), "v" CADMIUM_VERSION, {spacePos.x + (spaceWidth - versionSize.x) / 2, spacePos.y + 6}, 8, 0, WHITE);
#ifndef RESIZABLE_GUI
Space(10);
if (iconButton(ICON_HIDPI, _scaleBy2))
_scaleBy2 = !_scaleBy2;
SetTooltip("TOGGLE ZOOM ");
#endif
}
EndColumns();

Expand Down Expand Up @@ -1875,6 +1876,16 @@ void main()
_mainView = _lastView;
break;
}
case eLIBRARY: {
_lastView = _mainView;
SetSpacing(0);
Begin();
BeginPanel("Library / Research");
Space(_screenHeight - GetCurrentPos().y - 20 - 1);
EndPanel();
End();
break;
}
}

if (_colorSelectOpen) {
Expand Down
6 changes: 3 additions & 3 deletions src/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ void Debugger::render(Font& font, std::function<void(Rectangle,int)> drawScreen)
auto area = GetContentAvailable();
pos.x += 0;
Space(area.height);
auto stack = _core->focussedExecutionUnit()->stack();
for (int i = 0; i < _core->focussedExecutionUnit()->stackSize(); ++i) {
auto element = formatStackElement(stack, i, _stackBackup[_activeInstructionsTab].data());
auto stack = _core->executionUnit(_visibleExecUnit)->stack();
for (int i = 0; i < _core->executionUnit(_visibleExecUnit)->stackSize(); ++i) {
auto element = formatStackElement(stack, i, _stackBackup[_visibleExecUnit].data());
DrawTextEx(font, TextFormat("%X:%s", i & 0xF, element.first), {pos.x, pos.y + i * lineSpacing}, 8, 0, element.second ? yellowCol : lightgrayCol);
}
}
Expand Down

0 comments on commit c20e1a9

Please sign in to comment.