Skip to content

Decomp libcd: CdStatus, CdMode, CdLastCom (+ Makefile commit-check fix)#17

Open
andreadellacorte wants to merge 2 commits into
ser-pounce:mainfrom
andreadellacorte:decomp-libcd-cdstatus-cdmode-cdlastcom
Open

Decomp libcd: CdStatus, CdMode, CdLastCom (+ Makefile commit-check fix)#17
andreadellacorte wants to merge 2 commits into
ser-pounce:mainfrom
andreadellacorte:decomp-libcd-cdstatus-cdmode-cdlastcom

Conversation

@andreadellacorte
Copy link
Copy Markdown
Contributor

@andreadellacorte andreadellacorte commented May 23, 2026

Summary

Two small commits:

  1. libcd: match CdStatus, CdMode, CdLastCom — ported from sotn-decomp's src/main/psxsdk/libcd/sys.c (same compiler, 2.7.2-psx). All three are simple state-getters around psyq's static _cd_status/_cd_mode/_cd_lastcom.
  2. Makefile: pass --no-print-directory explicitly to sub-makes — GNU Make 4.4+ (which is what flake.nix ships) parses long flags appended to target-specific MAKEFLAGS as targets in the sub-make, breaking make commit-check. Passing the flag directly to each $(MAKE) invocation works on all make versions.

Test plan

  • nix develop -c make commit-check runs end-to-end (was previously failing on --no-print-directory)
  • nix develop -c bash -lc 'make format && git diff --exit-code' clean
  • All target files match after a clean make -j
  • No edits outside src/SLUS_010.40/libcd/ and Makefile

GNU Make 4.4+ parses long flags in target-specific MAKEFLAGS as targets
when invoked via $(MAKE), breaking commit-check. Passing the flag
directly to each $(MAKE) invocation works on all make versions.
@andreadellacorte andreadellacorte force-pushed the decomp-libcd-cdstatus-cdmode-cdlastcom branch from 0ad68d1 to a9b545d Compare May 23, 2026 21:03
@andreadellacorte andreadellacorte changed the title Decomp libcd: CdStatus, CdMode, CdLastCom Decomp libcd: CdStatus, CdMode, CdLastCom (+ Makefile commit-check fix) May 23, 2026
#include "common.h"

INCLUDE_ASM("build/src/SLUS_010.40/nonmatchings/libcd/SYS", CdStatus);
typedef void (*CdlCB)(unsigned char, unsigned char*);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already defined in <libcd.h> so it should be enough to add an #include at the top.

Comment thread Makefile
remake: clean
$(MAKE)

commit-check remake: MAKEFLAGS += --no-print-directory
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suspicious change, are you sure it was breaking the build as per the commit comment? I compiled 4.4.1 from source to verify but it works fine on Ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants