Skip to content

Commit

Permalink
add support for dumping registers
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRainbowPhoenix committed Aug 18, 2024
1 parent 0b507f9 commit f44c614
Show file tree
Hide file tree
Showing 17 changed files with 1,779 additions and 936 deletions.
Binary file added ebuild/MyAddin-hh2.bin
Binary file not shown.
1,848 changes: 1,156 additions & 692 deletions ebuild/ruk.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ebuild/ruk.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ebuild/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 56 additions & 12 deletions ruk-ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import Buttons from './lib/emu/buttons.svelte';
import Calculator from './lib/emu/calculator.svelte';
import Emscripten from './lib/emu/emscripten.svelte';
import Toolbar from './lib/ui/toolbar.svelte';
import { autorun, copyScreenFeedback, debugging, loadedFilename, state, traceback } from './lib/stores/app';
import Toolbar from './lib/elements/toolbar.svelte';
import Tracing from './lib/elements/tracing.svelte';
import { autorun, copyScreenFeedback, debugging, lastDump, loadedFilename, state, traceback, tracing } from './lib/stores/app';
import { loadFileIntoFSPromise } from './lib/emu/fetchers';
import { get } from 'svelte/store';
import CalculatorSkin from './assets/calculatorSkin.svelte';
Expand Down Expand Up @@ -39,7 +40,7 @@
setTimeout(() => {
copyScreenFeedback.set(null);
}, 4000);
}).catch(() => {
})
Expand All @@ -58,9 +59,27 @@
}
const doDump = (e: CustomEvent) => {
if (!$tracing) {
// Show the UI
tracing.set(true);
// Call a one-time dump to show registers state
lastDump.set(null);
window.Module.ccall('dumpOneFrame', null, [], [])
}
// TODO
}
const doRefresh = (e: CustomEvent) => {
console.log("doRefresh !!");
if (!$tracing) {
// Show the UI
tracing.set(true);
}
lastDump.set(null);
window.Module.ccall('dumpOneFrame', null, [], []);
};
const doDebug = (e: CustomEvent) => {
debugging.set(true);
Expand Down Expand Up @@ -132,15 +151,21 @@
<Buttons />
</div>

<Toolbar
on:romChanged={doRomLoad}
on:doRun={doRun}
on:doDump={doDump}
on:doDebug={doDebug}
on:doFullscreen={doFullscreen}
on:doCopyScreen={doCopyScreen}
on:doSaveScreen={doSaveScreen}
/>
<div class="tools-container">
<Toolbar
on:romChanged={doRomLoad}
on:doRun={doRun}
on:doDump={doDump}
on:doDebug={doDebug}
on:doFullscreen={doFullscreen}
on:doCopyScreen={doCopyScreen}
on:doSaveScreen={doSaveScreen}
/>

<Tracing
on:doRefresh={doRefresh}
/>
</div>
<div style="display: none;">
<Emscripten />
</div>
Expand Down Expand Up @@ -190,5 +215,24 @@
#classpad {
width: 432px;
}
.tools-container {
display: flex;
flex-direction: row;
align-items: flex-start;
min-height: 960px;
gap: .75rem;
padding-left: 1.5rem;
flex-shrink: 1;
visibility: visible;
position: relative;
overflow: hidden;
font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
Consolas, "DejaVu Sans Mono", monospace;
font-weight: normal;
color: var(--cp-text);
min-height: 960px;
}
</style>
1 change: 1 addition & 0 deletions ruk-ui/src/assets/icons/close.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z" opacity="0.5"/><path stroke-linecap="round" d="m14.5 9.5l-5 5m0-5l5 5"/></g></svg>
11 changes: 11 additions & 0 deletions ruk-ui/src/assets/icons/filter.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
export let on: boolean = false;
</script>

<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
{#if on}
<path fill="currentColor" fill-rule="evenodd" d="M5 3h14L8.816 13.184a2.7 2.7 0 0 0-.778-1.086c-.228-.198-.547-.377-1.183-.736l-2.913-1.64c-.949-.533-1.423-.8-1.682-1.23C2 8.061 2 7.541 2 6.503v-.69c0-1.326 0-1.99.44-2.402C2.878 3 3.585 3 5 3" clip-rule="evenodd"/><path fill="currentColor" d="M22 6.504v-.69c0-1.326 0-1.99-.44-2.402C21.122 3 20.415 3 19 3L8.815 13.184q.075.193.121.403c.064.285.064.619.064 1.286v2.67c0 .909 0 1.364.252 1.718c.252.355.7.53 1.594.88c1.879.734 2.818 1.101 3.486.683S15 19.452 15 17.542v-2.67c0-.666 0-1 .063-1.285a2.68 2.68 0 0 1 .9-1.49c.227-.197.545-.376 1.182-.735l2.913-1.64c.948-.533 1.423-.8 1.682-1.23c.26-.43.26-.95.26-1.988" opacity="0.5"/>
{:else}
<g fill="none" stroke="currentColor" stroke-width="1.5"><path d="M22 5.814v.69c0 1.038 0 1.557-.26 1.987s-.733.697-1.682 1.231l-2.913 1.64c-.636.358-.955.538-1.182.735a2.68 2.68 0 0 0-.9 1.49c-.063.285-.063.619-.063 1.286v2.67c0 1.909 0 2.863-.668 3.281s-1.607.05-3.486-.684c-.895-.35-1.342-.524-1.594-.879C9 18.907 9 18.451 9 17.542v-2.67c0-.666 0-1-.064-1.285a2.68 2.68 0 0 0-.898-1.49c-.228-.197-.547-.377-1.183-.735l-2.913-1.64c-.949-.534-1.423-.8-1.682-1.23C2 8.06 2 7.541 2 6.503v-.69"/><path d="M22 5.815c0-1.327 0-1.99-.44-2.403C21.122 3 20.415 3 19 3H5c-1.414 0-2.121 0-2.56.412S2 4.488 2 5.815" opacity="0.5"/></g>
{/if}
</svg>
1 change: 1 addition & 0 deletions ruk-ui/src/assets/icons/refresh.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M3.464 3.464C2 4.93 2 7.286 2 12s0 7.071 1.464 8.535C4.93 22 7.286 22 12 22s7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536C19.072 2 16.714 2 12 2S4.929 2 3.464 3.464" opacity="0.5"/><path fill="currentColor" d="M12.01 5.25a6.59 6.59 0 0 0-6.55 5.833H5a.75.75 0 0 0-.53 1.281l1.168 1.167a.75.75 0 0 0 1.06 0l1.169-1.167a.75.75 0 0 0-.53-1.28h-.364A5.09 5.09 0 0 1 12.01 6.75a5.08 5.08 0 0 1 3.838 1.743a.75.75 0 1 0 1.13-.986A6.58 6.58 0 0 0 12.01 5.25m6.352 5.22a.75.75 0 0 0-1.06 0l-1.168 1.166a.75.75 0 0 0 .53 1.28h.363a5.09 5.09 0 0 1-5.036 4.334a5.08 5.08 0 0 1-3.839-1.743a.75.75 0 0 0-1.13.987a6.58 6.58 0 0 0 4.969 2.256a6.59 6.59 0 0 0 6.549-5.833H19a.75.75 0 0 0 .53-1.281z"/></svg>
1 change: 1 addition & 0 deletions ruk-ui/src/lib/components/popover.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
overflow: visible;
opacity: 1 !important;
display: none;
z-index: 800;
}
.popover.visible {
Expand Down
Loading

0 comments on commit f44c614

Please sign in to comment.