Skip to content

Introduce gas-sh4dsp-prizm target for fx-CG[10|20/50] calculators #175

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

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a19370c
[ADD/WIP] Minimal SH4 backend for CASIO Prizm
seija-amanojaku Jun 24, 2025
a988653
Merge branch 'main' of https://github.com/tsoding/b into sh4
seija-amanojaku Jun 24, 2025
d3e72e4
[FIX] Remove pointless spacing
seija-amanojaku Jun 24, 2025
9becfde
[FIX] Also add the test but under a specific name
seija-amanojaku Jun 24, 2025
da7ed63
[WIP] Start making libb work out
seija-amanojaku Jun 24, 2025
8022b6f
[ADD] Start some work on the local libb, fix compiler bugs
seija-amanojaku Jun 25, 2025
143ca6a
[FIX/ADD] More compiler bugs, add basic printf
seija-amanojaku Jun 25, 2025
7f67dbf
[FIX/WIP] Start fixing issues btest reports
seija-amanojaku Jun 25, 2025
79192c9
[FIX] Fix array indexing on SuperH
seija-amanojaku Jun 26, 2025
ba0babd
Merge branch 'main' of https://github.com/tsoding/b into sh4
seija-amanojaku Jun 26, 2025
ab0c429
[FIX] Introduce "trampolines" to SH4 litterals
seija-amanojaku Jun 26, 2025
d79c0a4
[FIX] Did I ever mention I hate delay slots?
seija-amanojaku Jun 26, 2025
24f4555
[ADD] Make exit work, bitshifts
seija-amanojaku Jun 27, 2025
6a032bc
[ADD] Make a barebones SH4 runner
seija-amanojaku Jun 28, 2025
5f16109
[FIX] Handle negative printing
seija-amanojaku Jun 29, 2025
d29150f
[FIX] Fix binary operators in the tester
seija-amanojaku Jul 1, 2025
2c268a0
[ADD] Allow custom PREFIXes for non fxSDK setups
seija-amanojaku Jul 1, 2025
494206f
Merge branch 'main' into sh4
rexim Jul 3, 2025
0be9658
[ADD] Put some test cases
seija-amanojaku Jul 3, 2025
0cc9183
Merge branch 'main' of https://github.com/tsoding/b into sh4
seija-amanojaku Jul 4, 2025
e26ae66
[ADD] Allow a larger amount of autovars
seija-amanojaku Jul 4, 2025
8776d07
[ADD] Also make the stack pointer be able to move freely
seija-amanojaku Jul 4, 2025
058af58
[MOD/WIP] Start CIwerk
seija-amanojaku Jul 4, 2025
e5d83da
[FIX/CI] Fix a fun CI typo
seija-amanojaku Jul 4, 2025
3313b2a
[FIX] WE'RE GETTING WORKING PRIZM CI WITH THIS ONE
seija-amanojaku Jul 4, 2025
c9bf24c
[FIX] Fix slight typo in linker script
seija-amanojaku Jul 4, 2025
0e90050
[FIX] Allow jumps to any absolute symbol without warns
seija-amanojaku Jul 5, 2025
36291ff
Merge branch 'main' into sh4
rexim Jul 11, 2025
b935a0c
Add missing expected results for gas-x86_64-darwin
rexim Jul 11, 2025
f77ff65
Merge branch 'main' into sh4
rexim Jul 11, 2025
5ab205b
[ADD] Implement Index
seija-amanojaku Jul 11, 2025
459bb6b
[ADD/WIP] Look, ma, no fxgxa!
seija-amanojaku Jul 11, 2025
71b5615
[ADD/WIP] Start working on an assembler
seija-amanojaku Jul 12, 2025
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
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -qq -y mono-devel clang make mingw-w64 wine64 gcc-aarch64-linux-gnu qemu-user
sudo apt-get install -qq -y build-essential clang make mono-devel mingw-w64 wine64 gcc-aarch64-linux-gnu qemu-user xxd cmake libpng-dev binutils-sh-elf python3 libusb-1.0-0-dev libsdl2-dev gcc-sh4-linux-gnu
sh4-linux-gnu-gcc -v
git clone https://git.planet-casio.com/Lephenixnoir/fxsdk
cd fxsdk
mkdir fxusr
cmake -B build -DCMAKE_INSTALL_PREFIX=fxusr -DFXLINK_DISABLE_UDISKS2=1
make -C build
make -C build install
cd ..

git clone https://git.sr.ht/~rabbits/uxn11
cd uxn11
make cli
make
- name: Build Toolchain
run: |
make -B
- name: Run Tests
run: |
PATH=$(realpath uxn11/bin):$PATH ./build/btest -xt *darwin
PREFIX=sh4-linux-gnu PATH=$(realpath uxn11/bin):$(realpath fxsdk/fxusr/bin):$PATH ./build/btest -xt *darwin
macos-aarch64:
runs-on: macos-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RSS=\
$(SRC)/targets.rs \
$(SRC)/jim.rs \
$(SRC)/jimp.rs \
$(SRC)/codegen/gas_sh4dsp_prizm.rs \
$(SRC)/codegen/gas_aarch64.rs \
$(SRC)/codegen/gas_x86_64.rs \
$(SRC)/codegen/mos6502.rs \
Expand All @@ -33,6 +34,7 @@ RSS=\
$(SRC)/runner/gas_x86_64_windows.rs \
$(SRC)/runner/gas_x86_64_darwin.rs \
$(SRC)/runner/gas_aarch64_linux.rs \
$(SRC)/runner/gas_sh4dsp_prizm.rs \
$(SRC)/runner/gas_aarch64_darwin.rs \
$(SRC)/runner/mod.rs \
$(SRC)/runner/mos6502.rs \
Expand Down
35 changes: 35 additions & 0 deletions examples/prizm-test.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// -*- mode: simpc -*-
y;
str[6];

main() {
extrn Bdisp_AllClr_VRAM;
extrn Bdisp_Fill_VRAM;
extrn Bdisp_PutDisp_DD;
extrn Bdisp_EnableColor;
extrn PrintPixXY;
extrn Bdisp_Rectangle;
auto color;
extrn exit;

color = 0;
y = 0;
str[0] = " Hello World from B!";

while (1) {
//Bdisp_AllClr_VRAM();
Bdisp_Fill_VRAM(7, 4);
Bdisp_Rectangle(16 + y, 16 + 2 * y, 64 + y, 64 + 2 * y, 7 - color);
PrintPixXY(1,y,str[0],color);
Bdisp_PutDisp_DD();
color = color + 1;
if (color > 7) {
color = 0;
}

y = y + 1;
if (y > 110) {
y = 0;
}
}
}
20 changes: 20 additions & 0 deletions examples/truth.b
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Written by LDA (seija-amanojaku)
// ---------------------------------
// Pretty much just a truth machine, as specified by https://esolangs.org/wiki/Truth-machine

main() {
extrn printf, getchar;
auto input;

while (1) {
printf("Input?\n");
input = getchar();
if (input == '0') {
printf("0\n");
return (0);
} else if (input == '1') {
while (1) printf("1\n");
}
}
return (1);
}
Binary file added libb/gas-sh4dsp-prizm-sel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added libb/gas-sh4dsp-prizm-uns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading