mirror of
https://github.com/imjasonh/nescript
synced 2026-07-08 08:55:38 +00:00
Move the six gate-marker label emissions (__mul_used, __div_used, __oam_used, __default_sprite_used, __p1_input_used, __p2_input_used) out of the inline IR-op lowering paths and into a new `emit_trailing_markers()` helper that runs once at the end of `generate()`. The IR walk now just flips a bool per marker; the label emit happens after every instruction has been lowered, so the marker never lands in the middle of a peephole-sensitive sequence. Fixes a real peephole interaction that surfaced after rebasing on main's `codegen: skip parameter-spill prologue for leaf functions` + `peephole: drop dead LDA #imm before mem-INC/DEC + JMP` improvements: an inline `__oam_used:` label inside `IrOp::DrawSprite` split the dead-load-elimination block, leaving the `STA $130 / LDA $130` redundant store+load pair that main's peephole would otherwise have collapsed to a plain `LDA #imm`. The stale bytes shifted the NMI handler by a few bytes, which shifted `on frame` execution enough that `examples/palette_and_background.ne` captured phase 1 (WarmReds) at frame 180 instead of phase 2 (CoolBlues). Regenerates every example ROM against the new codegen (all gate behaviour is unchanged — the linker still sees the same markers, just at the tail of the user stream instead of interleaved) and updates the goldens that shifted: seven audio-hash drifts (all audio-bearing programs, same cycle-accurate-APU-timing story as every prior NMI layout change) and two pixel goldens — the one- pixel sprite-position drift in `comparisons.png` that we already tolerate, plus the phase-capture flip in `palette_and_background.png`. https://claude.ai/code/session_016kM6P7PukktBDqTZexrrAN |
||
|---|---|---|
| .. | ||
| arrays_and_functions.audio.hash | ||
| arrays_and_functions.png | ||
| audio_demo.audio.hash | ||
| audio_demo.png | ||
| auto_chr_background.audio.hash | ||
| auto_chr_background.png | ||
| bitwise_ops.audio.hash | ||
| bitwise_ops.png | ||
| bouncing_ball.audio.hash | ||
| bouncing_ball.png | ||
| coin_cavern.audio.hash | ||
| coin_cavern.png | ||
| comparisons.audio.hash | ||
| comparisons.png | ||
| friendly_assets.audio.hash | ||
| friendly_assets.png | ||
| function_chain.audio.hash | ||
| function_chain.png | ||
| hello_sprite.audio.hash | ||
| hello_sprite.png | ||
| inline_asm_demo.audio.hash | ||
| inline_asm_demo.png | ||
| logic_ops.audio.hash | ||
| logic_ops.png | ||
| loop_break_continue.audio.hash | ||
| loop_break_continue.png | ||
| match_demo.audio.hash | ||
| match_demo.png | ||
| metasprite_demo.audio.hash | ||
| metasprite_demo.png | ||
| mmc1_banked.audio.hash | ||
| mmc1_banked.png | ||
| mmc3_per_state_split.audio.hash | ||
| mmc3_per_state_split.png | ||
| nested_structs.audio.hash | ||
| nested_structs.png | ||
| noise_triangle_sfx.audio.hash | ||
| noise_triangle_sfx.png | ||
| palette_and_background.audio.hash | ||
| palette_and_background.png | ||
| platformer.audio.hash | ||
| platformer.png | ||
| pong.audio.hash | ||
| pong.png | ||
| scanline_split.audio.hash | ||
| scanline_split.png | ||
| sfx_pitch_envelope.audio.hash | ||
| sfx_pitch_envelope.png | ||
| sha256.audio.hash | ||
| sha256.png | ||
| sprite_flicker_demo.audio.hash | ||
| sprite_flicker_demo.png | ||
| sprites_and_palettes.audio.hash | ||
| sprites_and_palettes.png | ||
| state_machine.audio.hash | ||
| state_machine.png | ||
| structs_enums_for.audio.hash | ||
| structs_enums_for.png | ||
| two_player.audio.hash | ||
| two_player.png | ||
| uxrom_banked.audio.hash | ||
| uxrom_banked.png | ||
| uxrom_banked_to_banked.audio.hash | ||
| uxrom_banked_to_banked.png | ||
| uxrom_user_banked.audio.hash | ||
| uxrom_user_banked.png | ||
| war.audio.hash | ||
| war.png | ||