Skip to content

fix: add missing CS renderer struct members for Linux builds (#1596) - #1597

Open
luckyseoul wants to merge 1 commit into
FCare:extui-alignfrom
luckyseoul:fix/compute-shader-missing-struct-members
Open

fix: add missing CS renderer struct members for Linux builds (#1596)#1597
luckyseoul wants to merge 1 commit into
FCare:extui-alignfrom
luckyseoul:fix/compute-shader-missing-struct-members

Conversation

@luckyseoul

Copy link
Copy Markdown

Summary

Fixes #1596 (Debian 13 / source build failure in the OpenGL compute-shader path).

vidcs.c already assigns and reads fields that were never declared on the shared types, so compilers error with has no member named 'userclipMode', bitmap_base, bitmap_wrap_size, sprite_rgb_priority_per_line, and msb_shadow_enabled_per_line.

This PR adds the missing members (with init for userclipMode) and a small compile/run test that exercises those real header fields.

Hardware / docs grounding

Field Role Manual
Vdp1.userclipMode Latched CMDPMOD Cmod (bit 9) on user-clipping commands: 0 = inside drawing, 1 = outside drawing ST-013 VDP1 User's Manual §6.3 CMDPMOD (ST-013-R3-061694.pdf)
vdp2draw_struct.bitmap_base / bitmap_wrap_size Bitmap NBG VRAM window for wrapped cell fetch ST-058 VDP2 User's Manual (ST-058-R2-060194.pdf)
Ygl.sprite_rgb_priority_per_line When SPCLMD selects RGB sprites, priority from PRISA reg 0 ST-058 sprite control / priority
Ygl.msb_shadow_enabled_per_line MSB shadow when SPWINEN=0 and sprite type 2–7 ST-058 shadow / SPCTL

Local archive paths used while developing:

  • saturn-docs/files/ST-013-R3-061694.pdf
  • saturn-docs/files/ST-058-R2-060194.pdf

Test plan

  • Reproduced Fails to build from source on Debian 13 #1596 member-missing errors before the fix (compile of test against unfixed headers)
  • After fix: make -f Makefile.cs_struct_members in yabause/src/testsPASS (or compile cs_struct_members_test.c with the include flags in that Makefile)
  • Full Qt/SDL Kronos link build on a machine with SDL2/Qt5/GLFW deps
  • Optional: in-emulator check that user-clip outside mode still latches from CMDPMOD

Notes

  • userclipMode is software latched state alongside the existing userclipX/Y fields (same pattern as other command-derived VDP1 state).
  • Full-tree cmake on the contributor host was blocked by missing libsdl2-dev/glfw3; verification used the focused header test that hits the same symbols vidcs.c requires.

OpenGL compute-shader path (vidcs.c) already reads/writes fields that
were never declared on shared types, so source builds fail on Debian 13
and similar toolchains (see FCare#1596):

- Vdp1.userclipMode: CMDPMOD Cmod (bit 9) from ST-013 §6.3, latched on
  user-clipping commands (inside/outside drawing mode)
- vdp2draw_struct.bitmap_base / bitmap_wrap_size: bitmap NBG VRAM window
  for wrapped cell fetch
- Ygl.sprite_rgb_priority_per_line / msb_shadow_enabled_per_line: per-line
  sprite priority (SPCLMD/PRISA) and MSB shadow enable (ST-058)

Init userclipMode to 0 with other clip state. Add a small compile/run
test (yabause/src/tests/cs_struct_members_test.c) that exercises the
real header members used by vidcs.c.

Docs: local archive saturn-docs/files/ST-013-R3-061694.pdf,
saturn-docs/files/ST-058-R2-060194.pdf
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.

1 participant