Skip to content

KC85/2: Debug UI for Z80 chips (CPU, PIO, CTC)#10

Open
gunterhager wants to merge 28 commits intofloooh:mainfrom
gunterhager:main
Open

KC85/2: Debug UI for Z80 chips (CPU, PIO, CTC)#10
gunterhager wants to merge 28 commits intofloooh:mainfrom
gunterhager:main

Conversation

@gunterhager
Copy link
Copy Markdown
Contributor

I started to implement debug UI similar to the C version of chips. As a first step I implemented the debug UI for the Z80 chips (CPU, PIO, CTC) that are used in the KC85/2.

Not sure if you want to pull this already in your main branch but I would be very happy with a code review. 😸
Let me know what you think.

@floooh
Copy link
Copy Markdown
Owner

floooh commented Mar 22, 2025

You are crazy, but in a good way ;)

I'm currently on different zig stuff (wrapping sokol-shdc in a zig package), but I have a week of vacation ahead, will hopefully find some time to have a look.

@floooh floooh moved this to Review in sokol todo Mar 22, 2025
@floooh
Copy link
Copy Markdown
Owner

floooh commented Jun 29, 2025

FYI with the Dear ImGui 1.92.0 update there will most likely be changes required in places where textures are rendered in the UI: https://github.com/floooh/sokol/blob/master/CHANGELOG.md#29-jun-2025

@floooh floooh moved this from Review to Parked in sokol todo Dec 6, 2025
gunterhager and others added 2 commits March 10, 2026 08:15
In Zig 0.14+, addIncludePath was moved from Build.Step.Compile to
Build.Module. Update the sokol/cimgui dependency hashes to latest.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gunterhager and others added 4 commits March 10, 2026 14:03
- src/chips/z80dasm.zig: stateless Z80 disassembler (port of z80dasm.h);
  callback-based memory access, handles all prefixes (CB/DD/ED/FD)
- src/ui/ui_dasm.zig: standalone scrollable disassembler window with
  navigation back-stack and jump-target buttons for CALL/JP/JR/RST/DJNZ
- src/ui/ui_dbg.zig: comptime-parameterized CPU debugger (bus+cpu types);
  step-into/over, breakpoints, execution history, F5/F6/F7/F9 hotkeys
- Integrated into KC85: per-tick execWithDebug() loop, Debug menu wired up

All UI is reusable for other emulators (Namco, Bombjack) via runtime
read_cb and comptime Type(.{.bus=..., .cpu=...}) instantiation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Parked

Development

Successfully merging this pull request may close these issues.

2 participants