Commit Graph

537 Commits

Author SHA1 Message Date
mcrib884 50876e7968 tests: add encode and safety tests for bal_x86_emit_sub_r64_r64
Adds Encode_SubRegToReg_LowLow and Encode_SubRegToReg_HighHigh
byte-exact encode tests asserting every emitted byte, plus
NullContext, BadStatus, and InvalidRegister safety tests.

Signed-off-by: mcrib884 <farukkaya229@outlook.com>
2026-06-14 05:56:23 +00:00
mcrib884 40246aa4f0 assembler: add bal_x86_emit_sub_r64_r64
Emits the x86 sub r64, r64 instruction (opcode 0x2B, REX.W + ModRM,
3 bytes). Follows the 5-check guard pattern matching add_r64_r64.

Signed-off-by: mcrib884 <farukkaya229@outlook.com>
2026-06-14 05:56:23 +00:00
Ronald Caesar dd442e8a82 docs: add more immediate goals
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-12 04:57:24 -04:00
Ronald Caesar ac231fc159 dashboard/filedialog: move imgui rendering logic to lua
I want hot-reloading on the file dialog, so a moved
'dashboard_file_dialog_draw()' to Lua and named it
'dashboard_render_file_dialog()'. This requires adding the following
helper functions:

* dashboard_file_dialog_refresh()
* dashboard_file_dialog_append_path()
* dashboard_file_dialog_navigate_home()

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-12 04:57:24 -04:00
Ronald Caesar 8247ec9fe5 dashboard/filedialog: fix padding violation
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-12 04:57:24 -04:00
mcrib884 94cca0e48f assembler: fix branch encoding and add reset function
The B (unconditional branch) instruction encoding used integer
division (/) instead of bitwise OR (|) to combine the opcode with
the branch offset. This produced incorrect machine code for every
branch target other than zero.

Also add bal_assembler_reset() to match the reset API provided by
every other module in Ballistic (bal_x86_assembler, sliding window,
tier1 compiler). The function zeroes the instruction buffer and
resets offset and status.

Wrap the hot function in BAL_UNLIKELY.

Signed-off-by: mcrib884 <farukkaya229@outlook.com>
2026-06-12 04:25:47 +00:00
Ronald Caesar bf360f9bc8 tests/decoder: skip empty buckets
If a hash bucket is empty, the test still loops 2,097,152 times which
is crazy. An empty bucket means `bal_decode_arm64()` will always
return NULL, so I've added a `continue` statement to skip the massive
loop.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 22:44:22 -04:00
Ronald Caesar 661958714c tools/doctest: wrap global statements in a main() function
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 22:28:48 -04:00
Ronald Caesar 78107c66bb actions: add macos runner
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 22:11:21 -04:00
Ronald Caesar 396249858d actions: add windows runner
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 21:46:55 -04:00
Ronald Caesar 7085cefaad build: add precompiled headers and optimizations to msvc build times
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 21:46:55 -04:00
Ronald Caesar 43ba3d19bb actions: add ubuntu runner
The current build times for these runners are too slow. I'm changing
that now.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 20:25:32 -04:00
Ronald Caesar fdbbe0a9c6 Merge branch 'project-generator' 2026-06-11 18:42:11 -04:00
Ronald Caesar a3b60d184d extern/luajit-imgui: link opengl on macos properly
LuaJIT ImGui is passing GL as the library to link against which is
incorrect on macOS who relies on "-framework OpenGL" instead.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 18:27:44 -04:00
Ronald Caesar d345aa3cd7 extern/luajit: use .a libraries on macOS instead of .dylib
Looking at the macOS runner logs, its compiling LuaJIT libraries with
.a instead of .dylib.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 18:06:02 -04:00
Ronald Caesar 23bd559e19 build: add minimum macos deployment target
This to allow LuaJIT to compile on macOS.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 17:40:55 -04:00
Ronald Caesar a9f9783143 tests/doctest: configure visual studio env vars if using msvc and not visual studio 2026-06-11 17:18:24 -07:00
Ronald Caesar 6f557fbafe extern/luajit-imgui: add abs(float) function
MSVC only supports abs(long). I needed to include <cmath> to support
abs(float)

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 15:25:28 -04:00
Ronald Caesar fe2334276b external/luajit: add 'luajit_exe' executable target
The luajit executable was never managed by cmake which is bad for
doctest since it needs the executable to run.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 15:16:55 -04:00
Ronald Caesar bd9ea4a5a2 build: fix Ballistic not finding the luajit binary
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 14:58:20 -04:00
Ronald Caesar b1294d877e extern/luajit-imgui: add missing include
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 14:20:12 -04:00
Ronald Caesar 5f0791e8b1 extern/luajit-imgui: add source code properly
This adds luajit-imgui without submodules.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 14:12:55 -04:00
Ronald Caesar e06f6bd00e extern/luajit-imgui: remove git submodule
I'm re-adding this project without any git metadata to make my own
local changes.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 14:02:04 -04:00
Ronald Caesar 48dc2ccbaf extern/luajit: readd luajit to fix compiler errors
So apperently running clang-format causes LuaJIT to fail compiling. Took
a couple hours to figure that one out. I disable clang-format on the
`extern` folder and re-add it.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 11:41:48 -07:00
Ronald Caesar c4357f630c actions: change windows compiler to cl.exe
Signed-off-by: Ronald Caesar <github43132@proton.me>
2026-06-11 01:42:12 -04:00