Migrating from ORCA/C to Clang for the IIgs.

This commit is contained in:
Scott Duensing 2026-06-25 03:23:34 -05:00
parent 2d447f3d95
commit c80610747a
8 changed files with 7 additions and 18 deletions

View file

@ -189,7 +189,7 @@ The user should pick which to prioritize.
The repo's auto-memory at The repo's auto-memory at
`~/.claude/projects/-home-scott-claude-joeylib/memory/` includes `~/.claude/projects/-home-scott-claude-joeylib/memory/` includes
JoeyLib-wide context (CMake quirks, ORCA-C gotchas, perf JoeyLib-wide context (CMake quirks, IIgs toolchain gotchas, perf
constraints) plus `project_joeylib_agi_plan.md` which describes the constraints) plus `project_joeylib_agi_plan.md` which describes the
overall AGI port plan. All persist into the next session overall AGI port plan. All persist into the next session
automatically; no need to reload. automatically; no need to reload.
@ -197,9 +197,8 @@ automatically; no need to reload.
Specifically relevant to the AGI port: Specifically relevant to the AGI port:
- `project_joeylib_agi_plan.md` — overall plan, 3-4 month estimate - `project_joeylib_agi_plan.md` — overall plan, 3-4 month estimate
- `feedback_orca_c_atoi_segment.md` — don't use atoi in AGI code - AGI code uses a manual `parseArgU8` instead of atoi to keep the
(it pushes the IIgs ORCA-C stdio cluster past 64 KB; we use a IIgs link budget small.
manual parseArgU8 instead)
- `project_perf_directive.md` — IIgs is the perf floor; every - `project_perf_directive.md` — IIgs is the perf floor; every
other target must match or beat it other target must match or beat it
- `feedback_iigs_speed.md` — IIgs must be absolute fastest - `feedback_iigs_speed.md` — IIgs must be absolute fastest
@ -213,6 +212,6 @@ Specifically relevant to the AGI port:
`feedback_git.md`). `feedback_git.md`).
- Always `source toolchains/env.sh` before any `make` -- the user - Always `source toolchains/env.sh` before any `make` -- the user
has added that to .claude/settings.local.json allow list. has added that to .claude/settings.local.json allow list.
- DJGPP / ORCA / vasm / m68k-atari-mint paths come from env.sh. - DJGPP / llvm-mos / vasm / m68k-atari-mint paths come from env.sh.
- The user does NOT need hand-holding -- they're an expert C dev. - The user does NOT need hand-holding -- they're an expert C dev.
Skip excessive explanation; describe what was done and move on. Skip excessive explanation; describe what was done and move on.

3
agi.c
View file

@ -307,7 +307,6 @@ static uint32_t gAgiV11SubTickAccum; // counts AGI ticks toward next
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "AGIMAIN";
#endif #endif
// ----- Internal helpers (alphabetical) ----- // ----- Internal helpers (alphabetical) -----
@ -1687,7 +1686,6 @@ static void updateEgoFromInput(void) {
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "";
#endif #endif
// ----- Entry point ----- // ----- Entry point -----
@ -1703,7 +1701,6 @@ int main(int argc, char **argv) {
bool vmReady; bool vmReady;
cfg.codegenBytes = 0u; // no sprites needed -- backdrop-restore path is direct memcpy cfg.codegenBytes = 0u; // no sprites needed -- backdrop-restore path is direct memcpy
cfg.maxSurfaces = 4u; // stage + backdrop (2 used)
// AGI sound is software-synthesized PSG squarewaves pushed // AGI sound is software-synthesized PSG squarewaves pushed
// through the Sound Blaster auto-init DMA path (see agiSynthFill // through the Sound Blaster auto-init DMA path (see agiSynthFill
// and src/port/dos/audio.c). The audio pool covers the 4 KB // and src/port/dos/audio.c). The audio pool covers the 4 KB

View file

@ -24,7 +24,6 @@
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "AGIOBJ";
#endif #endif

View file

@ -81,7 +81,6 @@ static void plot(AgiPicT *pic, const PicStateT *state, int16_t x, int16_t y)
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "AGIPIC";
#endif #endif
// ----- Internal helpers (alphabetical) ----- // ----- Internal helpers (alphabetical) -----
@ -122,7 +121,7 @@ static void drawCorner(AgiPicT *pic, const PicStateT *state, const uint8_t *data
// the minor axis is linearly interpolated with round-half-away-from- // the minor axis is linearly interpolated with round-half-away-from-
// zero. All math stays in 16-bit -- AGI coordinates are 8-bit so the // zero. All math stays in 16-bit -- AGI coordinates are 8-bit so the
// worst product (dy * i = 167 * 167 = 27889) fits in int16, and the // worst product (dy * i = 167 * 167 = 27889) fits in int16, and the
// 65816 build avoids ORCA-C's long-arithmetic helpers entirely. // 65816 build avoids long-arithmetic helpers entirely.
static void drawLine(AgiPicT *pic, const PicStateT *state, int16_t x0, int16_t y0, int16_t x1, int16_t y1) { static void drawLine(AgiPicT *pic, const PicStateT *state, int16_t x0, int16_t y0, int16_t x1, int16_t y1) {
int16_t dx; int16_t dx;
int16_t dy; int16_t dy;

View file

@ -48,9 +48,8 @@
// IIgs 64 KB code-bank rule: park this TU in its own load segment // IIgs 64 KB code-bank rule: park this TU in its own load segment
// so it doesn't pile onto _ROOT (which still holds main() and the // so it doesn't pile onto _ROOT (which still holds main() and the
// ORCA-C startup). Cross-platform builds ignore this pragma. // runtime startup). Cross-platform builds ignore this pragma.
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "AGIRES";
#endif #endif
@ -154,7 +153,7 @@ static bool loadDirectory(AgiGameT *game, AgiResTypeE type, const char *gameDir,
} }
volNibble = (uint8_t)(buf[0] >> 4); volNibble = (uint8_t)(buf[0] >> 4);
// 20-bit offset, cast to uint32_t before shift so ORCA-C's // 20-bit offset, cast to uint32_t before shift so a
// 16-bit int doesn't truncate the (& 0x0F) << 16 term. // 16-bit int doesn't truncate the (& 0x0F) << 16 term.
offset = ((uint32_t)(buf[0] & 0x0F) << 16) | ((uint32_t)buf[1] << 8) | (uint32_t)buf[2]; offset = ((uint32_t)(buf[0] & 0x0F) << 16) | ((uint32_t)buf[1] << 8) | (uint32_t)buf[2];

View file

@ -23,7 +23,6 @@
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "AGITXT";
#endif #endif

View file

@ -40,7 +40,6 @@
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "AGIVIEW";
#endif #endif
@ -143,7 +142,6 @@ uint8_t agiActorPriorityForY(int16_t y) {
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "AGIDRAW";
#endif #endif
void agiViewDraw(const AgiViewT *view, uint8_t loopIdx, uint8_t celIdx, void agiViewDraw(const AgiViewT *view, uint8_t loopIdx, uint8_t celIdx,

View file

@ -273,7 +273,6 @@
#ifdef JOEYLIB_PLATFORM_IIGS #ifdef JOEYLIB_PLATFORM_IIGS
segment "AGIVM";
#endif #endif