Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

microui-based debugger #2

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
53d190d
basic disasm (no DD/FD prefix handling)
wermipls May 13, 2023
307dcbf
disasm: refactor & fix CB/ED prefix handling
wermipls May 13, 2023
53519b5
refactor op disasm to allow DD/FD prefix
wermipls May 13, 2023
da89726
remove redundant includes
wermipls May 13, 2023
c606f44
fix broken DD/FD CB behavior
wermipls May 13, 2023
bdf337a
fix segfault on no palette folder
wermipls May 14, 2023
678ffd3
disassemble_opcode -> disasm_opcode
wermipls May 14, 2023
532eeba
preliminary debugger window
wermipls May 14, 2023
f140e05
debugger improvements
wermipls May 15, 2023
dd73374
debugger improvements cont.
wermipls May 15, 2023
52dbfbd
fix some warnings & segfault on checkbox
wermipls May 15, 2023
1353781
static build on windoze
wermipls May 15, 2023
62ce80a
add a meson build file, wip
wermipls May 16, 2023
cf7d22d
fix possible crash in putc_zx
wermipls May 16, 2023
46fb2a8
meson: add git describe, style adjustments
wermipls May 16, 2023
228feda
copy executable to root after build
wermipls May 16, 2023
e19d2d1
update workflow
wermipls May 16, 2023
715fd0e
remove old build script
wermipls May 16, 2023
57274c1
improve disasm update behavior
wermipls May 16, 2023
7e09d82
actually add microui module
wermipls May 16, 2023
e02d43a
some disasm improvements, infinite scroll
wermipls May 17, 2023
6858ea5
meson -> mingw-w64-x86_64-meson
wermipls May 17, 2023
765f951
mingw-w64-x86_64-pkgconf
wermipls May 17, 2023
b19219e
did i seriously forget half of the packages
wermipls May 17, 2023
bef7e7a
infinite scrollbar
wermipls May 17, 2023
795b6a6
orz ... fix wraparound in update_dirty
wermipls May 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ jobs:
with:
submodules: recursive
- name: set up packages
run: sudo apt install gcc libsdl2-dev libxxhash-dev
run: sudo apt install meson ninja-build gcc libsdl2-dev libxxhash-dev
- name: build release
run: ./build.sh
run: |
meson setup build
meson compile -C build
- name: upload build
uses: actions/upload-artifact@v3
with:
Expand All @@ -37,14 +39,16 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
release: false
install: git mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 zlib mingw-w64-x86_64-xxhash
install: mingw-w64-x86_64-meson mingw-w64-x86_64-pkgconf git mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 zlib mingw-w64-x86_64-xxhash mingw-w64-x86_64-freetype
- run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build release
run: ./build.sh -p win32
run: |
meson setup build
meson compile -C build
- name: upload build
uses: actions/upload-artifact@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "ayumi"]
path = ayumi
url = https://github.com/wermipls/ayumi
[submodule "microui"]
path = microui
url = https://github.com/wermipls/microui
55 changes: 0 additions & 55 deletions build.sh

This file was deleted.

96 changes: 96 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
project('sleepdart', 'c', default_options: ['buildtype=release'])

release_args = ['-ffast-math', '-flto', '-fwhole-program']
if get_option('buildtype') == 'release'
add_project_arguments(release_args, language: 'c')
add_project_link_arguments(release_args, language: 'c')
endif

includes = include_directories('microui/src')

extra_src = []
extra_obj = []
static_libs = false

if target_machine.system() == 'windows'
windres = find_program('windres')
run_command(windres, 'src/win32/resource.rc', 'src/win32/resource.o')
extra_src = [
'src/win32/gui_windows.c',
]
extra_obj = [
'src/win32/resource.o',
]
add_project_arguments('-DPLATFORM_WIN32', language: 'c')
static_libs = true
endif

git = find_program('git', required: false)
if git.found()
gitargs = ['describe', '--tags', '--dirty', '--always']
describe = run_command(git, gitargs, check: false).stdout().strip()
if describe != ''
add_project_arguments('-DGIT_DESCRIBE="' + describe + '"', language: 'c')
endif
endif

deps = [
dependency('zlib', static: static_libs),
dependency('sdl2', static: static_libs),
dependency('libxxhash', static: static_libs),
dependency('freetype2', static: static_libs),
]

add_project_link_arguments('-lstdc++', language: 'c')

exe = executable(
'sleepdart',
'src/main.c',
'src/argparser.c',
'src/audio_sdl.c',
'src/ay.c',
'src/beeper.c',
'src/config.c',
'src/config_parser.c',
'src/debugger.c',
'src/disasm.c',
'src/dsp.c',
'src/file.c',
'src/hotkeys.c',
'src/input_sdl.c',
'src/io.c',
'src/keyboard.c',
'src/keyboard_macro.c',
'src/log.c',
'src/machine.c',
'src/machine_hooks.c',
'src/machine_test.c',
'src/memory.c',
'src/microui_render.c',
'src/palette.c',
'src/parser_helpers.c',
'src/szx_file.c',
'src/szx_state.c',
'src/tape.c',
'src/ula.c',
'src/video_sdl.c',
'src/z80.c',
'microui/src/microui.c',
'ayumi/ayumi.c',
extra_src,
include_directories: includes,
dependencies: deps,
objects: extra_obj,
win_subsystem: 'windows',
link_args: '-lm',
)

# a lil hacky...
dest = meson.project_source_root()
custom_target(
'finalize',
depends: exe,
input: exe,
output: 'fake',
command: ['cp', '@INPUT@', dest],
build_by_default : true)
1 change: 1 addition & 0 deletions microui
Submodule microui added at de1f35
2 changes: 1 addition & 1 deletion src/config_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ int config_get_float(CfgData_t *cfg, const char *key, float *dest)
return 0;
}

void config_set_str(CfgData_t *cfg, const char *key, char *value)
void config_set_str(CfgData_t *cfg, const char *key, const char *value)
{
if (value == NULL) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/config_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ int config_get_int(CfgData_t *cfg, const char *key, int *dest);
* config value gets copied to dest */
int config_get_float(CfgData_t *cfg, const char *key, float *dest);

void config_set_str(CfgData_t *cfg, const char *key, char *value);
void config_set_str(CfgData_t *cfg, const char *key, const char *value);
void config_set_int(CfgData_t *cfg, const char *key, int value);
void config_set_float(CfgData_t *cfg, const char *key, float value);
Loading