From 4dfc7b9c1cd6f912fce7e521cc6da0a420eb547c Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 11 Sep 2026 23:49:20 -0700 Subject: [PATCH 01/52] Add guarded native-wide background polygon composites --- docs/WIDESCREEN.md | 27 +++++++ runtime/include/gpu.h | 10 +++ runtime/src/gpu.c | 42 ++++++++++ runtime/src/gpu_gl_renderer.c | 25 ++++-- .../test_gpu_textured_dot_nw_shift_exec.c | 79 ++++++++++++++++++- 5 files changed, 174 insertions(+), 9 deletions(-) diff --git a/docs/WIDESCREEN.md b/docs/WIDESCREEN.md index 17130b48..e37909a6 100644 --- a/docs/WIDESCREEN.md +++ b/docs/WIDESCREEN.md @@ -1,5 +1,32 @@ # Widescreen support (`feat/widescreen`) +## Explicit native-wide background polygons (September 2026) + +A title plugin can call `gpu_ws_tag_background_prim(prim)` for each opaque +background polygon in a verified composite, before submitting its ordering +table. The command starts at `prim + 4`; an embedded command can therefore use +`command_address - 4` even when that preceding word is not a DMA header. +The framework validates command type, RAM bounds, complete packet contents, +address and freshness. The title owns the proof that these are backgrounds +and that their union covers the authored viewport. No fixed game addresses or +background guesses belong in the shared API. + +OpenGL and software rendering stretch only those polygons about the display +center in the native-wide surface, preserving canonical VRAM and the default +4:3 path. Tag every part, including flat fills behind textured sky quads, so +the composite remains continuous. Tags expire after two frames and reject +reused packets whose words changed. This method performs no guest writes or +extra guest allocations. + +OpenGL preserves the tag across flat and textured batching. While an explicitly +tagged background is active, it renders the full wide composite instead of +copying the canonical center over it, which would create a scale seam. Other +scenes retain the center-copy optimization. Measure performance in the title +and validate the visible sky at the requested aspect before release. Vulkan's +native-wide compositor is not implemented; this API does not add one. + +## Earlier projection-and-stretch implementation + Status as of 2026-06-13. Branch `feat/widescreen` in **both** `psxrecomp` (framework) and `TombaRecomp` (game opt-in + config), pushed to remote. Experimental. Latest: the far-backdrop edge void is largely fixed (2D backdrop diff --git a/runtime/include/gpu.h b/runtime/include/gpu.h index 550f2e9d..c7b4f491 100644 --- a/runtime/include/gpu.h +++ b/runtime/include/gpu.h @@ -359,6 +359,16 @@ void gpu_ws_set_adaptive_backdrop_preload(int enabled); * `prim` is the address of the PsyQ P_TAG word; the drawn command starts at * prim+4. anchor: -1 = left, 0 = center, +1 = right. */ void gpu_ws_tag_hud_prim(uint32_t prim, int anchor); +/* Stretch a trusted authored background polygon about the display center in + * the native-wide output only (GL/SW). prim+4 is the command address, including + * for a command embedded inside a longer DMA packet. Only opaque polygons are + * accepted; address, full packet contents, and frame freshness are guarded. + * Tag the complete background composite before submitting its ordering table. + * The caller proves background identity/coverage; no guest data is modified. */ +void gpu_ws_tag_background_prim(uint32_t prim); +/* Renderer policy: tagged background scenes need their full wide composite; + * copying the canonical center over it would introduce a scale discontinuity. */ +int gpu_ws_background_stretch_active(void); /* Clear synthetic margins to black over an opaque 0x64/65 rectangle's Y band * immediately before it executes. Packet-guarded; canonical VRAM is untouched. */ void gpu_ws_tag_black_reveal_rect(uint32_t prim); diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index 7194b278..a997deab 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -180,6 +180,9 @@ static void ws_nw_sync_target(void); typedef struct { uint32_t key; uint32_t stamp; int32_t anchor_x; } WsTag; static WsTag ws_tags[WS_TAG_BUCKETS]; static WsHudAnchorTag ws_hud_anchor_tags[WS_HUD_ANCHOR_TABLE_SIZE]; +static WsHudAnchorTag ws_background_tags[WS_HUD_ANCHOR_TABLE_SIZE]; +static uint32_t ws_background_tag_frame; +static int ws_background_tags_used; static WsHudAnchorTag ws_reveal_clear_tags[WS_HUD_ANCHOR_TABLE_SIZE]; static WsRepeatRectTag ws_repeat_rect_tags[WS_REPEAT_RECT_TAG_TABLE_SIZE]; static uint32_t ws_last_tag_stamp = (uint32_t)-1000; /* frame of newest tag */ @@ -1942,6 +1945,39 @@ void gpu_ws_tag_hud_prim(uint32_t prim, int anchor) { (uint32_t)s_frame_count); } +void gpu_ws_tag_background_prim(uint32_t prim) { + if (!ws_native_wide_configured() || (prim & 3u) || + prim > UINT32_MAX - 4u) return; + uint32_t words[12], count = 0; + if (!ws_hud_command_words(prim + 4u, words, &count)) return; + uint32_t op = words[0] >> 24; + if (op < 0x20u || op > 0x3Fu || (op & 2u)) return; + WsPrepassPacketGuard guard = ws_prepass_packet_guard(words, count); + ws_hud_anchor_insert(ws_background_tags, WS_HUD_ANCHOR_TABLE_SIZE, + (prim + 4u) & 0x1FFFFCu, 0, &guard, + (uint32_t)s_frame_count); + ws_background_tags_used = 1; + ws_background_tag_frame = (uint32_t)s_frame_count; +} + +int gpu_ws_background_stretch_active(void) { + uint32_t frame = (uint32_t)s_frame_count; + return ws_background_tags_used && ws_native_wide_active() && + frame >= ws_background_tag_frame && + frame - ws_background_tag_frame <= WS_HUD_ANCHOR_FRESH_FRAMES; +} + +static int ws_nw_explicit_background(void) { + if (!gpu_ws_background_stretch_active() || + gp0_cmd_source_addr == 0xFFFFFFFFu || + gp0_words_needed <= 0 || gp0_words_needed > 12) return 0; + uint32_t addr = gp0_cmd_source_addr & 0x1FFFFFFFu; + if (addr >= 0x00200000u || (addr & 3u)) return 0; + return ws_hud_anchor_lookup(ws_background_tags, WS_HUD_ANCHOR_TABLE_SIZE, + addr, gp0_cmd_buf, (uint32_t)gp0_words_needed, + (uint32_t)s_frame_count, NULL); +} + void gpu_ws_tag_black_reveal_rect(uint32_t prim) { if (!ws_native_wide_configured()) return; if ((prim & 3u) != 0 || prim > UINT32_MAX - 4u) return; @@ -2110,6 +2146,8 @@ static int ws_bg_phase_over(void) { static int ws_tagged_world_primitive(void); int psx_ws_prim_in_backdrop(void) { + /* Explicit title proof is independent of heuristic draw-order phases. */ + if (ws_nw_explicit_background()) return 1; if (gp0_cmd_source_addr != 0xFFFFFFFFu) { uint32_t f = (uint32_t)s_frame_count; if (f != bdg_src_frame) { bdg_src_frame = f; g_bdg_src_lo = 0xFFFFFFFFu; g_bdg_src_hi = 0; } @@ -2887,6 +2925,8 @@ static void gpu_reset_state(int clear_vram) { gp0_next_source_addr = 0xFFFFFFFFu; gp0_cmd_source_addr = 0xFFFFFFFFu; ws_hud_anchor_clear(ws_hud_anchor_tags, WS_HUD_ANCHOR_TABLE_SIZE); + ws_hud_anchor_clear(ws_background_tags, WS_HUD_ANCHOR_TABLE_SIZE); + ws_background_tags_used = 0; ws_hud_anchor_clear(ws_reveal_clear_tags, WS_HUD_ANCHOR_TABLE_SIZE); ws_repeat_rect_tag_clear(ws_repeat_rect_tags); polyline_color = 0; @@ -6236,6 +6276,8 @@ int gpu_snapshot_read(const uint8_t *p, uint32_t len) { ws_reset_scene_history(); ws_scene_hold_reset(&s_ws_scene_hold); ws_hud_anchor_clear(ws_hud_anchor_tags, WS_HUD_ANCHOR_TABLE_SIZE); + ws_hud_anchor_clear(ws_background_tags, WS_HUD_ANCHOR_TABLE_SIZE); + ws_background_tags_used = 0; ws_hud_anchor_clear(ws_reveal_clear_tags, WS_HUD_ANCHOR_TABLE_SIZE); ws_repeat_rect_tag_clear(ws_repeat_rect_tags); /* Sync renderer clip/scissor to restored GP0(E3/E4); vars alone leave GL diff --git a/runtime/src/gpu_gl_renderer.c b/runtime/src/gpu_gl_renderer.c index 45f6c6ca..185596c0 100644 --- a/runtime/src/gpu_gl_renderer.c +++ b/runtime/src/gpu_gl_renderer.c @@ -1701,17 +1701,23 @@ static int bd_prim_gate(const int *xs, int n, int textured) { static int s_wide_fast = 1; void gl_renderer_set_wide_fast(int on) { s_wide_fast = on ? 1 : 0; } int gl_renderer_get_wide_fast(void) { return s_wide_fast; } +static int wide_fast_center_valid(void) { + /* An explicitly stretched sky differs inside the canonical viewport too. + * Keep the full composite for those scenes, including later foreground + * draws. Tags are installed before DMA, so no earlier center draws skip. */ + return s_wide_fast && !gpu_ws_background_stretch_active(); +} static void wide_blit_center(GLuint wide_fbo, int base_x, int disp_y, int disp_h); /* def below */ /* True if [lo,hi] (canonical draw-x) lies strictly inside the 4:3 frame, so the * prim adds nothing to either reveal margin and its mirror can be skipped. */ static int mirror_x_center_only(int lo, int hi) { - if (!s_wide_fast) return 0; + if (!wide_fast_center_valid()) return 0; int base = g_wide_cur_base, native_w = g_wide_w - 2 * g_wide_off; if (native_w <= 0) return 0; return (lo >= base) && (hi < base + native_w); } static int mirror_geo_center_only(const int *xs, int n) { - if (!s_wide_fast) return 0; + if (!wide_fast_center_valid()) return 0; int lo = xs[0], hi = xs[0]; for (int i = 1; i < n; i++) { if (xs[i] < lo) lo = xs[i]; if (xs[i] > hi) hi = xs[i]; } return mirror_x_center_only(lo, hi); @@ -1849,7 +1855,7 @@ static int s_cw_batches = 0, s_cw_wide_sets = 0, s_cw_wide_cfgs = 0, /* Textured-batch variant of mirror_x_center_only: scan the queued verts' x * (attr 0, stride TEXV). Defined here so s_tb / TEXV are in scope. */ static int mirror_batch_center_only(int nverts) { - if (!s_wide_fast || nverts <= 0) return 0; + if (!wide_fast_center_valid() || nverts <= 0) return 0; float flo = s_tb[0], fhi = s_tb[0]; for (int i = 1; i < nverts; i++) { float x = s_tb[i * TEXV]; @@ -1911,9 +1917,10 @@ static float s_fb[FLATBATCH_MAXV * 6]; static int s_fb_n = 0; static int s_fb_semi = -2; static int s_fb_mask = -1; +static int s_fb_gate = 0; static int mirror_flat_batch_center_only(int nverts) { - if (!s_wide_fast || nverts <= 0) return 0; + if (!wide_fast_center_valid() || nverts <= 0) return 0; float flo = s_fb[0], fhi = s_fb[0]; for (int i = 1; i < nverts; i++) { float x = s_fb[i * 6]; @@ -1941,8 +1948,7 @@ static void flush_flat_batch(void) { if (g_wide_cur && !s_wide_suppress && s_ws_ablate != 1 && !(!g_ws_bd_stretch_on && mirror_flat_batch_center_only(nverts))) { int dx = wide_dx(); - /* Batch may span many prims; use stretch gate off (flat dots/UI). */ - s_bd_gate = 0; + s_bd_gate = s_fb_gate; gl_perf_mirror_begin(); wide_target_begin(dx, s_geo_uXoff, s_geo_uXhalf); wide_set_bd_scale(s_geo_uXscale, s_geo_uXcenter); @@ -2003,12 +2009,15 @@ static void gpu_geometry(GLenum mode, const int *xs, const int *ys, return; } - if (s_fb_n > 0 && (s_fb_semi != semi || s_fb_mask != (int)s_mask_set)) + int gate = bd_prim_gate(xs, n, 0); + if (s_fb_n > 0 && (s_fb_semi != semi || s_fb_mask != (int)s_mask_set || + s_fb_gate != gate)) flush_flat_batch(); if (s_fb_n + n > FLATBATCH_MAXV) flush_flat_batch(); s_fb_semi = semi; s_fb_mask = (int)s_mask_set; + s_fb_gate = gate; float mask_a = s_mask_set ? 1.0f : 0.0f; for (int i = 0; i < n; i++) { @@ -4521,7 +4530,7 @@ void gl_renderer_present_vram(int disp_x, int disp_y, int w, int h, int linear, * x-translated by the reveal offset. No-op when s_wide_fast is off (then the * mirror drew the full surface, as before). Shared by both present paths. */ static void wide_blit_center(GLuint wide_fbo, int base_x, int disp_y, int disp_h) { - if (!s_wide_fast || g_wide_w <= 0) return; + if (!wide_fast_center_valid() || g_wide_w <= 0) return; int native_w = g_wide_w - 2 * g_wide_off; if (native_w <= 0) return; int S = s_scale; diff --git a/runtime/tests/test_gpu_textured_dot_nw_shift_exec.c b/runtime/tests/test_gpu_textured_dot_nw_shift_exec.c index 4986df9f..730b040e 100644 --- a/runtime/tests/test_gpu_textured_dot_nw_shift_exec.c +++ b/runtime/tests/test_gpu_textured_dot_nw_shift_exec.c @@ -33,6 +33,8 @@ static void reset_gpu_state_for_test(void) { memset(test_ram, 0, sizeof(test_ram)); memset(&last_textured_rect, 0, sizeof(last_textured_rect)); memset(ws_hud_anchor_tags, 0, sizeof(ws_hud_anchor_tags)); + memset(ws_background_tags, 0, sizeof(ws_background_tags)); + ws_background_tags_used = 0; memset(ws_tags, 0, sizeof(ws_tags)); s_frame_count = 100; @@ -98,6 +100,80 @@ static void configure_native_wide_16_9(void) { ws_full_2d = 1; } +static void test_background_packet_tags(void) { + /* The second F4 is embedded in a DMA node: its preceding word need not + * be a P_TAG. Only the command and its complete contents are authority. */ + const uint32_t addr = 0x1001Cu; + const uint32_t packet[] = {0x28020304u, 0, 320, 240u << 16, + (240u << 16) | 320u}; + reset_gpu_state_for_test(); + memcpy(&test_ram[addr / 4u], packet, sizeof(packet)); + gp0_cmd_source_addr = addr; + gp0_words_needed = 5; + memcpy(gp0_cmd_buf, packet, sizeof(packet)); + gpu_ws_tag_background_prim(addr - 4u); + assert(!gpu_ws_background_stretch_active()); + assert(!ws_nw_explicit_background()); + + configure_native_wide_16_9(); + gpu_ws_tag_background_prim(0x80000000u | (addr - 4u)); + assert(gpu_ws_background_stretch_active()); + assert(ws_nw_explicit_background()); + /* Explicit proof remains valid after a foreground phase has begun. */ + s_bg_phase_frame = (uint32_t)s_frame_count; + s_bg_phase_over = 1; + assert(psx_ws_prim_in_backdrop() == 1); + assert(memcmp(&test_ram[addr / 4u], packet, sizeof(packet)) == 0); + + for (unsigned i = 0; i < 5; ++i) { + gp0_cmd_buf[i] ^= 1u; + assert(!ws_nw_explicit_background()); + gp0_cmd_buf[i] ^= 1u; + } + gp0_cmd_source_addr += 4u; + assert(!ws_nw_explicit_background()); + gp0_cmd_source_addr -= 4u; + gp0_words_needed = 4; + assert(!ws_nw_explicit_background()); + gp0_words_needed = 5; + s_frame_count += 2; + assert(ws_nw_explicit_background()); + ++s_frame_count; + assert(!gpu_ws_background_stretch_active()); + assert(!ws_nw_explicit_background()); + s_frame_count = 99; + assert(!gpu_ws_background_stretch_active()); + s_frame_count = 100; + ws_mode = 0; + assert(!gpu_ws_background_stretch_active()); + + /* Reject semi-transparent polygons, rectangles, misalignment and RAM + * overflow; a rejected tag must not even enable the full-composite path. */ + const uint32_t bad_prim[] = {addr - 3u, 0xFFFFFFFCu, 0x801FFFFCu, + 0x1F800000u}; + reset_gpu_state_for_test(); + configure_native_wide_16_9(); + for (unsigned i = 0; i < sizeof(bad_prim) / sizeof(bad_prim[0]); ++i) + gpu_ws_tag_background_prim(bad_prim[i]); + assert(!gpu_ws_background_stretch_active()); + const uint32_t bad_op[] = {0x2Au, 0x2Eu, 0x3Eu, 0x64u, 0x40u}; + for (unsigned i = 0; i < sizeof(bad_op) / sizeof(bad_op[0]); ++i) { + test_ram[addr / 4u] = bad_op[i] << 24; + gpu_ws_tag_background_prim(addr - 4u); + assert(!gpu_ws_background_stretch_active()); + } + /* The GTE-produced textured quad also qualifies, with all nine words + * covered by its guard, including the last UV word. */ + test_ram[addr / 4u] = 0x2DFFFFFFu; + gpu_ws_tag_background_prim(addr - 4u); + gp0_cmd_source_addr = addr; + gp0_words_needed = 9; + memcpy(gp0_cmd_buf, &test_ram[addr / 4u], 9u * sizeof(uint32_t)); + assert(ws_nw_explicit_background()); + gp0_cmd_buf[8] ^= 0x10000u; + assert(!ws_nw_explicit_background()); +} + int main(void) { reset_gpu_state_for_test(); set_dot_packet(0x10004u, 137, 42); @@ -120,7 +196,8 @@ int main(void) { draw_offset_x = 2; exec_dot_and_expect(54, 42); - puts("gpu_textured_dot_nw_shift_exec_test: PASS"); + test_background_packet_tags(); + puts("gpu_textured_dot_nw_shift_exec_test: PASS (HUD and background tags)"); return 0; } From 7b2962efb58a21072dd516e7762c1c2e3d6db960 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sat, 12 Sep 2026 12:01:56 -0700 Subject: [PATCH 02/52] Preserve background composite lifetime and park visual validation --- docs/WIDESCREEN.md | 27 ++++++++++++++----- runtime/include/gpu.h | 7 +++-- runtime/src/gpu.c | 9 +++++++ runtime/src/gpu_gl_renderer.c | 2 +- .../test_gpu_textured_dot_nw_shift_exec.c | 11 ++++++++ 5 files changed, 47 insertions(+), 9 deletions(-) diff --git a/docs/WIDESCREEN.md b/docs/WIDESCREEN.md index e37909a6..ce0e22ec 100644 --- a/docs/WIDESCREEN.md +++ b/docs/WIDESCREEN.md @@ -18,12 +18,27 @@ the composite remains continuous. Tags expire after two frames and reject reused packets whose words changed. This method performs no guest writes or extra guest allocations. -OpenGL preserves the tag across flat and textured batching. While an explicitly -tagged background is active, it renders the full wide composite instead of -copying the canonical center over it, which would create a scale seam. Other -scenes retain the center-copy optimization. Measure performance in the title -and validate the visible sky at the requested aspect before release. Vulkan's -native-wide compositor is not implemented; this API does not add one. +OpenGL preserves the tag across flat and textured batching. Once a valid +background has been tagged, it renders the full wide composite instead of +copying the canonical center over it, which would create a scale seam. Packet +freshness and displayed-pixel lifetime are separate: a slow game or held display +can retain stretched pixels after the two-frame packet guard expires. The +full-composite requirement therefore remains latched until GPU reset or snapshot +restore; packet-address/content freshness is not relaxed. Sessions that have not +tagged a background retain the center-copy optimization. Measure performance in +the title and validate the visible sky at the requested aspect before release. +Vulkan's native-wide compositor is not implemented; this API does not add one. + +### Parked validation checkpoint (2026-09-12) + +The focused GPU packet/tag regression passes, including expired packets, +changed packet contents, disabled widescreen and retained composite lifetime. +The V8 Windows runtime builds and both game CTests pass. In the oil-field +21:9 playtest the owner reports that terrain looks fine and the background +flickers less badly, but still flickers. This is partial improvement, not visual +acceptance. State replay required the HLE scheduler; repeat the comparison with +matched scheduler settings before attributing the improvement solely to this +change. Work is parked in a draft; no release is approved. ## Earlier projection-and-stretch implementation diff --git a/runtime/include/gpu.h b/runtime/include/gpu.h index c7b4f491..e16f60d7 100644 --- a/runtime/include/gpu.h +++ b/runtime/include/gpu.h @@ -366,9 +366,12 @@ void gpu_ws_tag_hud_prim(uint32_t prim, int anchor); * Tag the complete background composite before submitting its ordering table. * The caller proves background identity/coverage; no guest data is modified. */ void gpu_ws_tag_background_prim(uint32_t prim); -/* Renderer policy: tagged background scenes need their full wide composite; - * copying the canonical center over it would introduce a scale discontinuity. */ +/* Fresh packet tags are eligible for background classification. */ int gpu_ws_background_stretch_active(void); +/* A tagged background can remain in a wide surface after its packet expires. + * Once used, retain full compositing until GPU reset or snapshot restoration. + * Packet freshness must never re-enable canonical-center overwrites. */ +int gpu_ws_background_requires_full_composite(void); /* Clear synthetic margins to black over an opaque 0x64/65 rectangle's Y band * immediately before it executes. Packet-guarded; canonical VRAM is untouched. */ void gpu_ws_tag_black_reveal_rect(uint32_t prim); diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index a997deab..1927ffa1 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -1967,6 +1967,15 @@ int gpu_ws_background_stretch_active(void) { frame - ws_background_tag_frame <= WS_HUD_ANCHOR_FRESH_FRAMES; } +int gpu_ws_background_requires_full_composite(void) { + /* Freshness governs reuse of a packet address, not the lifetime of the + * pixels it produced. A slow game frame or a held display buffer can keep + * those pixels on screen indefinitely. Conservatively keep full mirroring + * once a composite has been tagged; GPU reset/snapshot restore clears the + * latch together with the tags. Never modify the packet freshness guard. */ + return ws_background_tags_used && ws_native_wide_configured(); +} + static int ws_nw_explicit_background(void) { if (!gpu_ws_background_stretch_active() || gp0_cmd_source_addr == 0xFFFFFFFFu || diff --git a/runtime/src/gpu_gl_renderer.c b/runtime/src/gpu_gl_renderer.c index 185596c0..14815bfb 100644 --- a/runtime/src/gpu_gl_renderer.c +++ b/runtime/src/gpu_gl_renderer.c @@ -1705,7 +1705,7 @@ static int wide_fast_center_valid(void) { /* An explicitly stretched sky differs inside the canonical viewport too. * Keep the full composite for those scenes, including later foreground * draws. Tags are installed before DMA, so no earlier center draws skip. */ - return s_wide_fast && !gpu_ws_background_stretch_active(); + return s_wide_fast && !gpu_ws_background_requires_full_composite(); } static void wide_blit_center(GLuint wide_fbo, int base_x, int disp_y, int disp_h); /* def below */ /* True if [lo,hi] (canonical draw-x) lies strictly inside the 4:3 frame, so the diff --git a/runtime/tests/test_gpu_textured_dot_nw_shift_exec.c b/runtime/tests/test_gpu_textured_dot_nw_shift_exec.c index 730b040e..6f824eb2 100644 --- a/runtime/tests/test_gpu_textured_dot_nw_shift_exec.c +++ b/runtime/tests/test_gpu_textured_dot_nw_shift_exec.c @@ -113,11 +113,13 @@ static void test_background_packet_tags(void) { memcpy(gp0_cmd_buf, packet, sizeof(packet)); gpu_ws_tag_background_prim(addr - 4u); assert(!gpu_ws_background_stretch_active()); + assert(!gpu_ws_background_requires_full_composite()); assert(!ws_nw_explicit_background()); configure_native_wide_16_9(); gpu_ws_tag_background_prim(0x80000000u | (addr - 4u)); assert(gpu_ws_background_stretch_active()); + assert(gpu_ws_background_requires_full_composite()); assert(ws_nw_explicit_background()); /* Explicit proof remains valid after a foreground phase has begun. */ s_bg_phase_frame = (uint32_t)s_frame_count; @@ -141,11 +143,19 @@ static void test_background_packet_tags(void) { ++s_frame_count; assert(!gpu_ws_background_stretch_active()); assert(!ws_nw_explicit_background()); + /* A held display retains its stretched pixels after packet expiry. The + * compositor must not paste canonical 4:3 scenery over their center. */ + assert(gpu_ws_background_requires_full_composite()); + s_frame_count += 120; + assert(gpu_ws_background_requires_full_composite()); + assert(!ws_nw_explicit_background()); s_frame_count = 99; assert(!gpu_ws_background_stretch_active()); + assert(gpu_ws_background_requires_full_composite()); s_frame_count = 100; ws_mode = 0; assert(!gpu_ws_background_stretch_active()); + assert(!gpu_ws_background_requires_full_composite()); /* Reject semi-transparent polygons, rectangles, misalignment and RAM * overflow; a rejected tag must not even enable the full-composite path. */ @@ -153,6 +163,7 @@ static void test_background_packet_tags(void) { 0x1F800000u}; reset_gpu_state_for_test(); configure_native_wide_16_9(); + assert(!gpu_ws_background_requires_full_composite()); for (unsigned i = 0; i < sizeof(bad_prim) / sizeof(bad_prim[0]); ++i) gpu_ws_tag_background_prim(bad_prim[i]); assert(!gpu_ws_background_stretch_active()); From b2104464607b25d54b515b854f90979ca86e3b1a Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Tue, 29 Sep 2026 20:57:11 -0700 Subject: [PATCH 03/52] Support native-wide presentation diagnostics and verified external mod media Checkpoint exact NCLIP and cull-scale code generation, overlay ABI 25, draw-area clipping, timeline and presented-image rings, mod counters, hotkey matching and savestate messages. Add canonical external ROM/disc verification with immutable plugin-scoped snapshots. Focused recompiler/runtime validation: 16 tests passed. --- docs/MOD_PACKAGES.md | 51 +++ docs/internal/FAITHFUL_TIMING_PLAN.md | 10 + find_func.py | 11 + recompiler/CMakeLists.txt | 3 +- recompiler/include/code_generator.h | 1 + recompiler/src/code_generator.cpp | 65 +++- recompiler/src/config_loader.cpp | 46 +++ recompiler/src/config_loader.h | 15 + recompiler/src/main_psx.cpp | 4 + recompiler/tests/recompiler_patch_test.cpp | 66 +++- runtime/CMakeLists.txt | 15 + runtime/include/cpu_state.h | 10 +- runtime/include/debug_server.h | 4 + runtime/include/gpu.h | 29 ++ runtime/include/gpu_timeline.h | 52 ++++ runtime/include/gte_nclip_stats.h | 60 ++++ runtime/include/host_keymap.h | 1 + runtime/include/mod_media.h | 20 ++ runtime/include/mod_packages.h | 27 ++ runtime/include/mod_plugins.h | 18 ++ runtime/include/overlay_api.h | 17 +- .../include/overlay_dispatch_preamble.c.inc | 10 + runtime/include/present_image_ring.h | 55 ++++ runtime/include/savestate.h | 3 + runtime/include/ws_hud_anchor.h | 45 ++- runtime/runtime.cmake | 19 ++ runtime/src/debug_server.c | 294 +++++++++++++++++- runtime/src/dirty_ram_interp.c | 6 +- runtime/src/dma.c | 4 + runtime/src/gpu.c | 135 +++++++- runtime/src/gpu_gl_renderer.c | 137 +++++++- runtime/src/gpu_timeline.c | 45 +++ runtime/src/gpu_vk_renderer.c | 12 +- runtime/src/gte.cpp | 83 ++++- runtime/src/host_keymap.c | 18 +- runtime/src/main.cpp | 189 +++++++++-- runtime/src/mod_media.cpp | 118 +++++++ runtime/src/mod_packages.cpp | 82 ++++- runtime/src/mod_runtime.cpp | 71 +++++ runtime/src/overlay_loader.c | 8 + runtime/src/present_image_ring.c | 137 ++++++++ runtime/src/savestate.c | 14 +- runtime/tests/overlay_pair_dedup_harness.c | 7 + runtime/tests/test_gl_readback_region.c | 28 ++ runtime/tests/test_gte_register_access.cpp | 33 +- runtime/tests/test_host_keymap.c | 9 + runtime/tests/test_mod_media.cpp | 116 +++++++ runtime/tests/test_mod_packages.cpp | 80 +++++ runtime/tests/test_mod_runtime.cpp | 46 +++ .../tests/test_wide_overlay_band_scissor.py | 39 +++ 50 files changed, 2243 insertions(+), 125 deletions(-) create mode 100644 find_func.py create mode 100644 runtime/include/gpu_timeline.h create mode 100644 runtime/include/gte_nclip_stats.h create mode 100644 runtime/include/mod_media.h create mode 100644 runtime/include/present_image_ring.h create mode 100644 runtime/src/gpu_timeline.c create mode 100644 runtime/src/mod_media.cpp create mode 100644 runtime/src/present_image_ring.c create mode 100644 runtime/tests/test_mod_media.cpp create mode 100644 runtime/tests/test_wide_overlay_band_scissor.py diff --git a/docs/MOD_PACKAGES.md b/docs/MOD_PACKAGES.md index aeb33948..7d20f832 100644 --- a/docs/MOD_PACKAGES.md +++ b/docs/MOD_PACKAGES.md @@ -742,6 +742,57 @@ they are not copied into the package. Optional resources with no selected path are omitted from the committed plan. Required resources reject launch while the feature is enabled and unset. +Format 8 adds engine-verified donor media to the same picker and state format: + +```toml +[[resource]] +feature = "arena" +id = "donor-rom" +label = "Source ROM" +format = "n64-rom" +file_patterns = "*.z64,*.v64,*.n64" +required = true +size = 8388608 +sha256 = "<64 lowercase hexadecimal digits from the canonical image>" +``` + +`size` and `sha256` must both be present. Verification runs only for enabled +features. Missing required media, a removed selected file, an incorrect size, +or a hash mismatch rejects the launch plan before plugin activation. Disabling +the feature restores the stock launch; the selected path is preserved. + +Canonical identity domains: + +| `format` | Size and SHA-256 domain | +|---|---| +| `file` with identity fields | Exact file bytes, at most 512 MiB | +| `n64-rom` | Big-endian `.z64` bytes; `.v64` halfword swaps and `.n64` word swaps normalize first; 64 bytes to 64 MiB, word aligned | +| `psx-disc` | First data track's 2048-byte sector payloads, at most 512 MiB; CUE/BIN/ISO/CHD use the shared disc reader; audio tracks are excluded | + +For `psx-disc`, Mode 1 payloads start at raw-sector offset 16 and Mode 2 +payloads at 24. This domain retains the first 2048 bytes of Form 2 sectors; +it is intended for asset data, and is not a full XA/CD-audio identity. Mixed-mode +retail ISO headers can declare a volume size extending into audio tracks; the +reader uses the actual first-track boundary from the TOC or single-track image +length. An audio-first disc or a nonzero first-track start is rejected. Use a +CUE for a raw image containing multiple tracks. Declared volume metadata must +have matching byte orders and 2048-byte logical sectors. + +The resolved plan owns an immutable canonical snapshot. During its callbacks, +a trusted plugin calls `psx_mod_current_resource_bytes(id, &bytes, &size)` to +obtain a read-only view scoped to its own package and feature. Ordinary +unverified resources cannot supply bytes through this API. The pointer remains +valid until the committed plan is replaced or cleared. Decode into host or +enhancement memory and rebuild derived data when activation changes; never +reopen the owner path as a substitute for the verified snapshot. + +Verified resource fingerprints include format, canonical size and SHA-256, +rather than the selected path, so moving identical media or changing N64 byte +order does not change save compatibility. Donor bytes are never package files, +and donor executable code is not dispatched by this API. N64 ZIPs must be +extracted before selecting the ROM. Format 8 prevents older runtimes from +silently accepting manifests whose identity checks they cannot enforce. + `resolver = "builtin:"` selects a resolver statically registered by the game. Format-5 plugin ids likewise select only statically registered implementations. Packages cannot load arbitrary native code or select diff --git a/docs/internal/FAITHFUL_TIMING_PLAN.md b/docs/internal/FAITHFUL_TIMING_PLAN.md index 3a036f59..7fec9c14 100644 --- a/docs/internal/FAITHFUL_TIMING_PLAN.md +++ b/docs/internal/FAITHFUL_TIMING_PLAN.md @@ -213,6 +213,16 @@ on a fixed region -> next. ## 5. Status / Log (update every session) +- **2026-09-29 (Phase 5 enhancement media):** Added format-8 verified donor + resources (exact canonical size/SHA-256, immutable snapshots scoped to the + owning plugin). N64 byte orders normalize before hashing; PSX identity covers + the first data track using the existing disc reader. Mixed-mode retail volume + sizes include audio and are not data-track lengths. Framework media/package/ + runtime tests pass; V8's isolated headless importer validates Super Dreamland + 64 from owner media. No CPU execution or timing changes. Arena conversion and + gameplay integration remain open. Local uncommitted work tracked by + `beads-09ww` and `beads-ip30`; content epic `beads-eio.5.13` remains open. + - **2026-09-13 (SIO card hack removal — branch-only review checkpoint):** Reproduced fixed-Ape-RAM IRQ7/mask injection after an absent-card probe, plus SELECT-time ACK fabrication and INTC-pending ACK requeueing with the diff --git a/find_func.py b/find_func.py new file mode 100644 index 00000000..cbfcd53f --- /dev/null +++ b/find_func.py @@ -0,0 +1,11 @@ +import json,sys +d=json.load(open(sys.argv[1])) +addrs=[int(x,16) for x in sys.argv[2:]] +funcs=d['functions'] +funcs.sort(key=lambda f:f['addr']) +import bisect +starts=[f['addr'] for f in funcs] +for a in addrs: + i=bisect.bisect_right(starts,a)-1 + f=funcs[i] + print(hex(a), '->', f['name'], hex(f['addr']), hex(f['end']), f.get('confidence')) diff --git a/recompiler/CMakeLists.txt b/recompiler/CMakeLists.txt index b58a379d..5421147f 100644 --- a/recompiler/CMakeLists.txt +++ b/recompiler/CMakeLists.txt @@ -840,7 +840,8 @@ if(BUILD_TESTING) vk_mailbox_policy vk_present_timing vk_present_wait_stage - vk_staging_cache) + vk_staging_cache + wide_overlay_band_scissor) add_test( NAME ${_t} COMMAND ${Python3_EXECUTABLE} diff --git a/recompiler/include/code_generator.h b/recompiler/include/code_generator.h index cb2568a5..802aab7d 100644 --- a/recompiler/include/code_generator.h +++ b/recompiler/include/code_generator.h @@ -161,6 +161,7 @@ struct CodeGenConfig { // Exact, full-word-guarded comparison sites whose result is forced only // while widescreen reveals extra world. 4:3 evaluates the original compare. std::vector ws_cull_keep_sites; + std::vector ws_cull_scale_sites; // Exact `addi[u] rt,zero,imm` 12-bit angular half-extents. The runtime // scales tan(angle) by the current horizontal reveal factor. diff --git a/recompiler/src/code_generator.cpp b/recompiler/src/code_generator.cpp index 24e0e692..a6f845dc 100644 --- a/recompiler/src/code_generator.cpp +++ b/recompiler/src/code_generator.cpp @@ -771,6 +771,20 @@ std::string CodeGenerator::generate_branch_condition(uint32_t instr, uint32_t ad return fmt::format("psx_ws_x_margin() > 0 ? 0 : ({}) /* ws branch keep */", cond); }; + // NCLIP/backface sign branches (bltz/bgez/blez/bgtz on a MAC0 copy). + // nclip_keep: reject forced not-taken while wide. nclip_exact: test the + // exact tracked sign while wide. Every sign-test shape is supported: the + // title's emitter decides which one its backface reject uses. Returns "" + // when addr is not a configured NCLIP site. + auto nclip_sign_branch = [&](const char *cmp) -> std::string { + if (config_.ws_cull_nclip_keep_sites.count(addr)) + return fmt::format("psx_ws_x_margin() > 0 ? 0 : ((int32_t){} {} 0) /* ws nclip keep */", + reg_name(rs), cmp); + if (config_.ws_cull_nclip_exact_sites.count(addr)) + return fmt::format("psx_ws_x_margin() > 0 ? (gte_nclip_exact_sign((int32_t){}, 0x{:08X}u) {} 0) : ((int32_t){} {} 0) /* ws exact nclip */", + reg_name(rs), addr, cmp, reg_name(rs), cmp); + return ""; + }; // REGIMM branches. R3000A hardware decodes EVERY rt value here, not just // the four assembler mnemonics: the branch sense is rt bit 0 (0 = bltz, @@ -792,15 +806,17 @@ std::string CodeGenerator::generate_branch_condition(uint32_t instr, uint32_t ad (ws_cull_bltz_pcs_.count(addr) || config_.ws_cull_bltz_sites.count(addr))) return fmt::format("psx_ws_cull_bltz({}) /* ws cull (left edge) */", reg_name(rs)); - if (regimm_op == 0x00 && config_.ws_cull_nclip_keep_sites.count(addr)) - return fmt::format("psx_ws_x_margin() > 0 ? 0 : ((int32_t){} < 0) /* ws nclip keep */", - reg_name(rs)); - if (regimm_op == 0x00 && config_.ws_cull_nclip_exact_sites.count(addr)) - return fmt::format("psx_ws_x_margin() > 0 ? gte_nclip_precise_bltz((int32_t){}) : ((int32_t){} < 0) /* ws exact nclip */", - reg_name(rs), reg_name(rs)); + if (regimm_op == 0x00) { + const std::string n = nclip_sign_branch("<"); + if (!n.empty()) return n; + } return keep_branch_if_wide( fmt::format("(int32_t){} < 0", reg_name(rs))); } else { // bgez family (incl. bgezal + undefined mirrors) + if (regimm_op == 0x01) { + const std::string n = nclip_sign_branch(">="); + if (!n.empty()) return n; + } return keep_branch_if_wide( fmt::format("(int32_t){} >= 0", reg_name(rs))); } @@ -820,11 +836,15 @@ std::string CodeGenerator::generate_branch_condition(uint32_t instr, uint32_t ad case 0x06: // blez case 0x16: // blezl + if (const std::string n = nclip_sign_branch("<="); !n.empty()) + return n; return keep_branch_if_wide( fmt::format("(int32_t){} <= 0", reg_name(rs))); case 0x07: // bgtz case 0x17: // bgtzl + if (const std::string n = nclip_sign_branch(">"); !n.empty()) + return n; return keep_branch_if_wide( fmt::format("(int32_t){} > 0", reg_name(rs))); } @@ -1001,6 +1021,38 @@ std::string CodeGenerator::translate_instruction(uint32_t addr, uint32_t instr) reg_name(dst), vanilla, site.result, comment); } + // Register-register frustum-edge compares ([[widescreen.cull.scale]]): + // the configured operand is a +/-half_extent*z bound computed at runtime, + // so it is scaled by the live reveal instead of rewriting an immediate. + // psx_ws_cull_scale is identity at 4:3. Overlay variants with another + // instruction at the same VA are left untouched. + for (const auto& site : config_.ws_cull_scale_sites) { + if ((site.address & 0x1FFFFFFFu) != (addr & 0x1FFFFFFFu)) continue; + if (instr != site.expected) { + if (config_.overlay_mode) continue; + fmt::print(stderr, + "ERROR: cull scale expected 0x{:08X} at 0x{:08X}, found 0x{:08X}\n", + site.expected, addr, instr); + std::exit(1); + } + const uint32_t rs = get_rs(instr), rt = get_rt(instr), rd = get_rd(instr); + const std::string a = site.operand == 0 + ? fmt::format("(uint32_t)psx_ws_cull_scale((int32_t){}, {})", + reg_name(rs), site.half_extent) + : std::string(reg_name(rs)); + const std::string b = site.operand == 1 + ? fmt::format("(uint32_t)psx_ws_cull_scale((int32_t){}, {})", + reg_name(rt), site.half_extent) + : std::string(reg_name(rt)); + if (funct == 0x2A) + return fmt::format("{} = ((int32_t){} < (int32_t){}) ? 1u : 0u;" + " /* ws cull scale (bound x (half+margin)/half) */{}", + reg_name(rd), a, b, comment); + return fmt::format("{} = ({} < {}) ? 1u : 0u;" + " /* ws cull scale (bound x (half+margin)/half) */{}", + reg_name(rd), a, b, comment); + } + // Widescreen automatic far-backdrop column PRELOAD ([widescreen.cull] // auto_backdrop). At a detected window's START/END finalize, route the value // through psx_ws_backdrop_value(orig, is_end): identity at 4:3, but in @@ -3336,6 +3388,7 @@ void CodeGenerator::emit_runtime_externs(std::ostream& ss) const { ss << "extern int32_t psx_ws_plane_nx(int32_t nx); /* ws side-plane normal-X scale (gpu.c) */\n"; ss << "extern uint32_t psx_ws_xclip_bound(uint32_t vanilla); /* ws per-prim X reject bound load (gpu.c) */\n"; ss << "extern uint32_t psx_ws_cull_keep_result(uint32_t vanilla, uint32_t forced); /* ws guarded keep compare (gpu.c) */\n"; + ss << "extern int32_t psx_ws_cull_scale(int32_t bound, int32_t half_extent); /* ws frustum-edge bound scale (gpu.c) */\n"; ss << "extern uint32_t psx_ws_aspect_cone_result(uint32_t site, uint32_t vanilla, uint32_t object, int32_t x, int32_t z, int32_t y); /* aspect-aware participation cone */\n"; ss << "extern uint32_t psx_ws_angle_widen(uint32_t vanilla); /* aspect-scaled 12-bit terrain-frustum half-angle */\n"; ss << "extern int psx_ws_backdrop_x(int x); /* widescreen backdrop screenX squash (gpu.c) */\n"; diff --git a/recompiler/src/config_loader.cpp b/recompiler/src/config_loader.cpp index fac2b6c7..c1baf498 100644 --- a/recompiler/src/config_loader.cpp +++ b/recompiler/src/config_loader.cpp @@ -118,6 +118,18 @@ uint32_t overlay_codegen_config_hash(const GameConfig& c) { h.u32(site.result); } + std::vector scale_sites = c.ws_cull_scale_sites; + std::sort(scale_sites.begin(), scale_sites.end(), + [](const auto& a, const auto& b) { return a.address < b.address; }); + h.tag("cull_scale"); + h.u32((uint32_t)scale_sites.size()); + for (const auto& site : scale_sites) { + h.u32(site.address); + h.u32(site.expected); + h.u32(site.operand); + h.u32(site.half_extent); + } + std::vector angle_sites = c.ws_cull_angle_sites; std::sort(angle_sites.begin(), angle_sites.end(), [](const auto& a, const auto& b) { @@ -1723,6 +1735,7 @@ GameConfig load_game_config(const fs::path& config_path_in) { std::vector ws_cull_nclip_exact_sites; std::vector ws_cull_branch_keep_sites; std::vector ws_cull_keep_sites; + std::vector ws_cull_scale_sites; std::vector ws_cull_angle_sites; WidescreenAspectConeConfig ws_aspect_cone; int ws_cull_guard_pixels = 0; @@ -1789,6 +1802,38 @@ GameConfig load_game_config(const fs::path& config_path_in) { ws_cull_keep_sites.push_back(site); } } + if (cull.contains("scale")) { + std::set seen; + for (const auto& item : toml::find(cull, "scale")) { + WidescreenCullScaleSite site; + site.address = parse_hex(toml::find(item, "address"), + "widescreen.cull.scale.address"); + site.expected = parse_hex(toml::find(item, "expected"), + "widescreen.cull.scale.expected"); + const std::string operand = toml::find(item, "operand"); + if (operand == "rs") site.operand = 0; + else if (operand == "rt") site.operand = 1; + else throw std::runtime_error(fmt::format( + "{}: [[widescreen.cull.scale]] operand must be rs or rt", + config_path.string())); + const int half = toml::find(item, "half_extent"); + if (half <= 0 || half > 1024) throw std::runtime_error(fmt::format( + "{}: [[widescreen.cull.scale]] half_extent must be 1..1024", + config_path.string())); + site.half_extent = (uint32_t)half; + const uint32_t op = site.expected >> 26; + const uint32_t fn = site.expected & 0x3Fu; + if (!(op == 0u && (fn == 0x2Au || fn == 0x2Bu))) + throw std::runtime_error(fmt::format( + "{}: [[widescreen.cull.scale]] expected must be SLT/SLTU", + config_path.string())); + if (!seen.insert(site.address & 0x1FFFFFFFu).second) + throw std::runtime_error(fmt::format( + "{}: duplicate [[widescreen.cull.scale]] address 0x{:08X}", + config_path.string(), site.address)); + ws_cull_scale_sites.push_back(site); + } + } if (cull.contains("angle")) { std::set seen; for (const auto& item : @@ -2190,6 +2235,7 @@ GameConfig load_game_config(const fs::path& config_path_in) { /*ws_cull_nclip_exact_sites*/ ws_cull_nclip_exact_sites, /*ws_cull_branch_keep_sites*/ ws_cull_branch_keep_sites, /*ws_cull_keep_sites*/ ws_cull_keep_sites, + /*ws_cull_scale_sites*/ ws_cull_scale_sites, /*ws_cull_angle_sites*/ ws_cull_angle_sites, /*ws_aspect_cone*/ ws_aspect_cone, /*ws_cull_guard_pixels*/ ws_cull_guard_pixels, diff --git a/recompiler/src/config_loader.h b/recompiler/src/config_loader.h index a222ee0d..c9a95d14 100644 --- a/recompiler/src/config_loader.h +++ b/recompiler/src/config_loader.h @@ -103,6 +103,18 @@ struct WidescreenCullKeepSite { // constant with `addi[u] rt,zero,imm`; the runtime widens tan(angle) by the // live horizontal reveal factor. Full-word guards prevent overlay-address // aliases from changing unrelated immediates. +// One register-register view-bound compare whose bound operand is widened +// with the live reveal: `slt rd, rs, rt` where the configured operand holds +// +/-half_extent*z (a camera-space frustum edge computed at runtime, so there +// is no immediate to rewrite). The operand is scaled by +// (half_extent + margin) / half_extent; identity at 4:3. Full-word guarded. +struct WidescreenCullScaleSite { + uint32_t address = 0; + uint32_t expected = 0; // guarded SLT/SLTU instruction + uint32_t operand = 1; // 0 = scale rs, 1 = scale rt + uint32_t half_extent = 0; // authored screen half-extent (e.g. 160) +}; + struct WidescreenAngleSite { uint32_t address = 0; uint32_t expected = 0; // guarded ADDI/ADDIU with rs == zero @@ -956,6 +968,9 @@ struct GameConfig { // where maximal overdraw is preferable to range guessing. Each entry is // guarded by the complete MIPS word; 4:3 executes the vanilla comparison. std::vector ws_cull_keep_sites; + // Register-register frustum-edge compares whose bound operand scales + // with the live reveal ([[widescreen.cull.scale]]). + std::vector ws_cull_scale_sites; // Exact 12-bit angular half-extents used by terrain-cell frusta. std::vector ws_cull_angle_sites; // Full-word-guarded model-participation cosine compares widened only in diff --git a/recompiler/src/main_psx.cpp b/recompiler/src/main_psx.cpp index 25e7f72c..52685b77 100644 --- a/recompiler/src/main_psx.cpp +++ b/recompiler/src/main_psx.cpp @@ -213,6 +213,7 @@ int main(int argc, char** argv) { std::set ws_cull_nclip_exact; // [widescreen.cull] nclip_exact_sites std::set ws_cull_branch_keep; // [widescreen.cull] branch_keep_sites std::vector ws_cull_keep; + std::vector ws_cull_scale; std::vector ws_cull_angle; PSXRecompV4::WidescreenAspectConeConfig ws_aspect_cone; int ws_cull_activation_guard_pixels = 0; @@ -277,6 +278,7 @@ int main(int argc, char** argv) { ws_cull_nclip_exact.insert(cfg.ws_cull_nclip_exact_sites.begin(), cfg.ws_cull_nclip_exact_sites.end()); ws_cull_branch_keep.insert(cfg.ws_cull_branch_keep_sites.begin(), cfg.ws_cull_branch_keep_sites.end()); ws_cull_keep = cfg.ws_cull_keep_sites; + ws_cull_scale = cfg.ws_cull_scale_sites; ws_cull_angle = cfg.ws_cull_angle_sites; ws_aspect_cone = cfg.ws_aspect_cone; ws_cull_activation_guard_pixels = @@ -373,6 +375,7 @@ int main(int argc, char** argv) { ws_cull_nclip_exact.insert(wscfg.ws_cull_nclip_exact_sites.begin(), wscfg.ws_cull_nclip_exact_sites.end()); ws_cull_branch_keep.insert(wscfg.ws_cull_branch_keep_sites.begin(), wscfg.ws_cull_branch_keep_sites.end()); if (ws_cull_keep.empty()) ws_cull_keep = wscfg.ws_cull_keep_sites; + if (ws_cull_scale.empty()) ws_cull_scale = wscfg.ws_cull_scale_sites; if (ws_cull_angle.empty()) ws_cull_angle = wscfg.ws_cull_angle_sites; if (ws_aspect_cone.sites.empty()) ws_aspect_cone = wscfg.ws_aspect_cone; @@ -1245,6 +1248,7 @@ int main(int argc, char** argv) { codegen_config.ws_cull_nclip_exact_sites = ws_cull_nclip_exact; codegen_config.ws_cull_branch_keep_sites = ws_cull_branch_keep; codegen_config.ws_cull_keep_sites = ws_cull_keep; + codegen_config.ws_cull_scale_sites = ws_cull_scale; codegen_config.ws_cull_angle_sites = ws_cull_angle; codegen_config.ws_aspect_cone = ws_aspect_cone; codegen_config.ws_cull_w_imms = ws_cull_w_imms; diff --git a/recompiler/tests/recompiler_patch_test.cpp b/recompiler/tests/recompiler_patch_test.cpp index f88df7df..1ed8131b 100644 --- a/recompiler/tests/recompiler_patch_test.cpp +++ b/recompiler/tests/recompiler_patch_test.cpp @@ -311,6 +311,28 @@ result = 0 keep_config.ws_cull_keep_sites[1].result == 0u, "parser preserves full-word-guarded maximal-participation sites"); + const auto scale = write_config(root, "cull-scale", R"toml( +[[widescreen.cull.scale]] +address = "0x8002C734" +expected = "0x0062182A" +operand = "rt" +half_extent = 160 + +[[widescreen.cull.scale]] +address = "0x8002C758" +expected = "0x0043102A" +operand = "rs" +half_extent = 160 +)toml"); + const auto scale_config = PSXRecompV4::load_game_config(scale); + check(scale_config.ws_cull_scale_sites.size() == 2 && + scale_config.ws_cull_scale_sites[0].address == 0x8002C734u && + scale_config.ws_cull_scale_sites[0].expected == 0x0062182Au && + scale_config.ws_cull_scale_sites[0].operand == 1u && + scale_config.ws_cull_scale_sites[0].half_extent == 160u && + scale_config.ws_cull_scale_sites[1].operand == 0u, + "parser preserves register-register frustum-edge scale sites"); + const auto signed_bound = write_config(root, "signed-x-bound", R"toml( [[widescreen.signed_x_bound]] address = "0x8002D290" @@ -789,10 +811,31 @@ void codegen_tests() { const std::string nclip_exact = generate_first_instruction( 0x04400002u, {}, false, nclip_exact_config); // bltz v0,+2 check(nclip_exact.find( - "gte_nclip_precise_bltz((int32_t)cpu->gpr[2])") != + "gte_nclip_exact_sign((int32_t)cpu->gpr[2], 0x80010000u) < 0") != std::string::npos && nclip_exact.find("ws exact nclip") != std::string::npos, "codegen emits title-scoped exact NCLIP predicate"); + // Every sign-branch shape a backface reject can use. + const struct { uint32_t word; const char *cmp; const char *name; } nclip_shapes[] = { + {0x18400002u, "<= 0", "blez"}, {0x1C400002u, "> 0", "bgtz"}, + {0x04410002u, ">= 0", "bgez"}, + }; + for (const auto &shape : nclip_shapes) { + const std::string exact = generate_first_instruction( + shape.word, {}, false, nclip_exact_config); + check(exact.find(std::string("gte_nclip_exact_sign((int32_t)cpu->gpr[2], 0x80010000u) ") + + shape.cmp) != std::string::npos && + exact.find(std::string("((int32_t)cpu->gpr[2] ") + shape.cmp + ")") != + std::string::npos, + (std::string("codegen exact NCLIP covers ") + shape.name).c_str()); + } + PSXRecomp::CodeGenConfig nclip_keep_config; + nclip_keep_config.ws_cull_nclip_keep_sites.insert(0x80010000u); + const std::string nclip_keep_blez = generate_first_instruction( + 0x18400002u, {}, false, nclip_keep_config); + check(nclip_keep_blez.find("psx_ws_x_margin() > 0 ? 0 : ((int32_t)cpu->gpr[2] <= 0)") != + std::string::npos, + "codegen NCLIP keep covers blez"); PSXRecomp::CodeGenConfig plane_nx_config; plane_nx_config.ws_cull_plane_nx_sites.insert(0x80010000u); @@ -842,6 +885,27 @@ void codegen_tests() { std::string::npos, "overlay full-word mismatch leaves keep site unchanged"); + PSXRecomp::CodeGenConfig scale_config_gen; + scale_config_gen.ws_cull_scale_sites.push_back( + {0x80010000u, 0x0062182Au, 1u, 160u}); // slt v1,v1,v0: scale rt + const std::string scale_rt = generate_first_instruction( + 0x0062182Au, {}, false, scale_config_gen); + check(scale_rt.find("psx_ws_cull_scale((int32_t)") != std::string::npos && + scale_rt.find(", 160)") != std::string::npos && + scale_rt.find("(int32_t)cpu->gpr[3] < (int32_t)(uint32_t)psx_ws_cull_scale") != + std::string::npos, + "codegen scales the configured rt bound of a signed frustum edge"); + scale_config_gen.ws_cull_scale_sites[0] = {0x80010000u, 0x0043102Au, 0u, 160u}; + const std::string scale_rs = generate_first_instruction( + 0x0043102Au, {}, false, scale_config_gen); + check(scale_rs.find("(int32_t)(uint32_t)psx_ws_cull_scale((int32_t)cpu->gpr[2], 160) < (int32_t)cpu->gpr[3]") != + std::string::npos, + "codegen scales the configured rs bound of the opposite edge"); + const std::string scale_overlay_mismatch = generate_first_instruction( + 0x0043102Bu, {}, true, scale_config_gen); // sltu at same overlay VA + check(scale_overlay_mismatch.find("psx_ws_cull_scale") == std::string::npos, + "overlay full-word mismatch leaves scale site unchanged"); + PSXRecomp::CodeGenConfig angle_config; angle_config.ws_cull_angle_sites.push_back( {0x80010000u, 0x24020155u}); diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 2cbf7107..ec81d585 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -161,6 +161,7 @@ if(BUILD_TESTING) tests/psx_ram_runtime_map_stubs.c src/memory.c src/dma.c + src/gpu_timeline.c src/boot_state.c src/psx_ram_geometry.c) target_include_directories(psx_ram_runtime_map_test PRIVATE include src) @@ -444,25 +445,38 @@ if(BUILD_TESTING) add_executable(mod_packages_test tests/test_mod_packages.cpp src/mod_packages.cpp + src/mod_media.cpp src/iso_reader.cpp src/cue_sheet.cpp src/crc32.c src/psx_sha256.c) target_include_directories(mod_packages_test PRIVATE include + ../recompiler/include ../recompiler/lib/toml11) + target_link_libraries(mod_packages_test PRIVATE chdr-static) add_test(NAME mod_packages_test COMMAND mod_packages_test) add_executable(builtin_mod_manifests_test tests/test_builtin_mod_manifests.cpp src/mod_packages.cpp + src/mod_media.cpp src/iso_reader.cpp src/cue_sheet.cpp src/crc32.c src/psx_sha256.c) target_include_directories(builtin_mod_manifests_test PRIVATE include + ../recompiler/include ../recompiler/lib/toml11) + target_link_libraries(builtin_mod_manifests_test PRIVATE chdr-static) add_test(NAME builtin_mod_manifests_test COMMAND builtin_mod_manifests_test "${CMAKE_CURRENT_SOURCE_DIR}/../mods/builtin/packages") + add_executable(mod_media_test + tests/test_mod_media.cpp src/mod_media.cpp src/iso_reader.cpp + src/cue_sheet.cpp src/psx_sha256.c) + target_include_directories(mod_media_test PRIVATE include ../recompiler/include) + target_link_libraries(mod_media_test PRIVATE chdr-static) + add_test(NAME mod_media_test COMMAND mod_media_test) + add_executable(text_xlate_fix_only_test tests/test_text_xlate_fix_only.cpp src/text_xlate.cpp @@ -476,6 +490,7 @@ if(BUILD_TESTING) tests/test_mod_runtime.cpp src/mod_runtime.cpp src/mod_packages.cpp + src/mod_media.cpp src/disc_path.cpp src/cue_sheet.cpp src/iso_reader.cpp diff --git a/runtime/include/cpu_state.h b/runtime/include/cpu_state.h index 61645d6c..c1a40f5e 100644 --- a/runtime/include/cpu_state.h +++ b/runtime/include/cpu_state.h @@ -235,10 +235,12 @@ extern void gte_geometry_correction_stats(uint32_t *lookups, uint32_t *hits, * where sub-pixel and guest-visible integer signs differ. MAC0 stays native. */ extern void gte_nclip_precise_stats(uint64_t *hits, uint64_t *fallbacks, uint64_t *disagreements); -/* Title-scoped widescreen cull consumer. Returns the exact tracked NCLIP sign - * only when it belongs to the supplied native MAC0; otherwise preserves the - * native comparison. This does not change guest-visible GTE state. */ -extern int gte_nclip_precise_bltz(int32_t native_mac0); +/* Title-scoped widescreen cull consumer ([widescreen.cull] nclip_exact_sites). + * Returns the sign (-1/0/1) the branch at `pc` should test: the exact tracked + * NCLIP sign only when it belongs to the supplied native MAC0, otherwise the + * native sign. Counts per-site use (gte_nclip_stats.h). Does not change + * guest-visible GTE state. */ +extern int32_t gte_nclip_exact_sign(int32_t native_mac0, uint32_t pc); /* PGXP dataflow-shadowing hook macros (PGXP_LOAD/STORE/ALU/MULDIV/COP2). * The emitter writes them unconditionally; they expand to real calls only diff --git a/runtime/include/debug_server.h b/runtime/include/debug_server.h index c4b512f5..5d19ff4f 100644 --- a/runtime/include/debug_server.h +++ b/runtime/include/debug_server.h @@ -108,6 +108,10 @@ uint32_t debug_server_get_tcp_drops(void); /* Record the current frame's state into the ring buffer. * Call after vblank processing. */ void debug_server_record_frame(void); +/* Operator capture mark (hotkey, present thread): freeze the always-on display + * and GP0 rings at this instant and save the presented native-wide frame, so a + * transient glitch can be read back afterwards over TCP (capture_mark). */ +void debug_server_capture_mark(void); /* Block while paused, polling TCP + SDL events. * Call from vblank callback before frame processing. */ diff --git a/runtime/include/gpu.h b/runtime/include/gpu.h index e16f60d7..f1323934 100644 --- a/runtime/include/gpu.h +++ b/runtime/include/gpu.h @@ -256,6 +256,12 @@ void gpu_ws_set_cull_keep_sites(const uint32_t *addresses, const uint32_t *results, int nsites); void gpu_ws_set_angle_sites(const uint32_t *addresses, const uint32_t *expected, int nsites); +/* [[widescreen.cull.scale]]: full-word-guarded SLT/SLTU sites whose rs (0) or + * rt (1) operand is a runtime +/-half_extent*z frustum bound. */ +void gpu_ws_set_cull_scale_sites(const uint32_t *addresses, + const uint32_t *expected, + const uint32_t *operands, + const uint32_t *half_extents, int nsites); void gpu_ws_set_aspect_cone(const uint32_t *addresses, const uint32_t *expected, const uint32_t *cosine_thresholds, @@ -289,6 +295,12 @@ int psx_ws_cull_keep_site(uint32_t pc, uint32_t instr, uint32_t vanilla, uint32_t *out); uint32_t psx_ws_angle_widen(uint32_t vanilla); int psx_ws_angle_site(uint32_t pc, uint32_t instr, uint32_t *out); +/* bound * (half_extent + margin) / half_extent; identity at 4:3. */ +int32_t psx_ws_cull_scale(int32_t bound, int32_t half_extent); +/* Interpreter path for a configured scale site: returns 1 and the widened + * compare verdict in *out when (pc, instr) is a configured site. */ +int psx_ws_cull_scale_site(uint32_t pc, uint32_t instr, uint32_t rs_value, + uint32_t rt_value, uint32_t *out); uint32_t psx_ws_aspect_cone_result(uint32_t site, uint32_t vanilla, uint32_t object, int32_t x, int32_t z, int32_t y); @@ -366,6 +378,23 @@ void gpu_ws_tag_hud_prim(uint32_t prim, int anchor); * Tag the complete background composite before submitting its ordering table. * The caller proves background identity/coverage; no guest data is modified. */ void gpu_ws_tag_background_prim(uint32_t prim); +/* Always-on counters for the explicit HUD-anchor and background tag tables: + * how many tags a title plugin offered, how many were rejected at insert + * (native-wide not configured / unreadable or unsupported command), and why + * executing primitives that matched a tagged address were or were not + * honoured. TCP: {"cmd":"ws_tag_stats"}. */ +typedef struct GpuWsTagStats { + uint64_t tag_calls; + uint64_t tag_rejected; + uint64_t hit; + uint64_t stale; + uint64_t guard_mismatch; + uint32_t last_tag_frame; + uint32_t last_hit_frame; +} GpuWsTagStats; +void gpu_ws_get_tag_stats(GpuWsTagStats *hud, GpuWsTagStats *background); +/* Freeze/unfreeze the always-on GP0 command ring (capture mark). */ +void gpu_gp0_ring_set_frozen(int frozen); /* Fresh packet tags are eligible for background classification. */ int gpu_ws_background_stretch_active(void); /* A tagged background can remain in a wide surface after its packet expires. diff --git a/runtime/include/gpu_timeline.h b/runtime/include/gpu_timeline.h new file mode 100644 index 00000000..e18f1b5d --- /dev/null +++ b/runtime/include/gpu_timeline.h @@ -0,0 +1,52 @@ +#ifndef PSXRECOMP_GPU_TIMELINE_H +#define PSXRECOMP_GPU_TIMELINE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* GPU frame timeline: an always-on, guest-cycle-stamped record of the events + * that decide WHAT a present shows — vblank, display-start flips, draw-area + * changes, GPU linked-list DMA start/end, and each present (swapped or + * skipped). The GP0, display and presented-image rings are all tagged by + * frame number only, which cannot order a present against a draw inside the + * same frame; this ring can. Frozen by the capture mark. */ +#define GPU_TIMELINE_CAP 32768u /* power of two; ~40 s at typical rates */ + +typedef enum { + GTL_VBLANK = 1, /* a = lcf after toggle */ + GTL_DISP_START = 2, /* a = x, b = y (GP1 05h) */ + GTL_DRAW_AREA = 3, /* a = left, b = top (GP0 E3h) */ + GTL_LL_START = 4, /* a = OT start address */ + GTL_LL_END = 5, /* a = nodes, b = words */ + GTL_PRESENT = 6, /* a = path, b = disp_x | disp_y << 16 */ + GTL_PRESENT_SKIP = 7, /* a = path, b = disp_x | disp_y << 16 (no swap) */ + GTL_DISP_CAPTURE = 8, /* display-ring capture; b = disp_x | disp_y << 16 */ + GTL_FILL = 9, /* a = x | y << 16, b = w | h << 16 (GP0 02h) */ +} GpuTimelineKind; + +/* Present paths recorded in GTL_PRESENT/GTL_PRESENT_SKIP `a`. */ +enum { GTL_PATH_WIDE_FBO = 1, GTL_PATH_VRAM_FBO = 2, GTL_PATH_CPU = 3, + GTL_PATH_HOLD = 4 }; + +typedef struct { + uint64_t cyc; /* psx_cycle_count */ + uint32_t frame; /* s_frame_count */ + uint32_t a, b; + uint8_t kind; + uint8_t pad[3]; +} GpuTimelineEntry; + +void gpu_timeline_note(uint8_t kind, uint32_t a, uint32_t b); +void gpu_timeline_set_frozen(int frozen); +uint64_t gpu_timeline_total(void); +int gpu_timeline_get(uint64_t seq, GpuTimelineEntry *out); +const char *gpu_timeline_kind_name(uint8_t kind); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/runtime/include/gte_nclip_stats.h b/runtime/include/gte_nclip_stats.h new file mode 100644 index 00000000..2812f5b6 --- /dev/null +++ b/runtime/include/gte_nclip_stats.h @@ -0,0 +1,60 @@ +#ifndef PSXRECOMP_GTE_NCLIP_STATS_H +#define PSXRECOMP_GTE_NCLIP_STATS_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Precise-NCLIP observability (widescreen). While [widescreen] precise_nclip + * is active, every NCLIP also computes the backface sign from the UNCLAMPED + * projection (the PGXP sub-pixel shadow, validated against each SXY word; + * precise_nclip arms that transport by itself, independent of the visual + * corrections). Guest MAC0 stays native; only configured branch sites + * ([widescreen.cull] nclip_exact_sites) consume the precise sign. + * + * Always-on tables, keyed by the last guest store PC before each NCLIP (a + * producer locator inside the issuing emitter) and by branch PC (exact-site + * consumers), so a title can find which emitters + * lose triangles to the +/-1024 screen clamp before listing any site. */ + +typedef struct { + uint32_t func; /* locator: last guest store PC before the NCLIP */ + uint32_t nclips; /* NCLIPs with a precise sign available */ + uint32_t disagree; /* precise sign != native MAC0 sign */ + uint32_t saturated; /* any of the three SXY entries hit the clamp */ + uint32_t last_frame; +} GteNclipFuncStat; + +typedef struct { + uint32_t pc; /* configured exact-NCLIP branch PC */ + uint32_t evals; + uint32_t flips; /* branch decision changed by the precise sign */ + uint32_t fallbacks; /* no precise sign for this MAC0 -> native */ + uint32_t last_frame; +} GteNclipSiteStat; + +#define GTE_NCLIP_STAT_CAP 256 + +void gte_nclip_precise_stats(uint64_t *hits, uint64_t *fallbacks, + uint64_t *disagreements); +int gte_nclip_func_stats(GteNclipFuncStat *out, int max); +int gte_nclip_site_stats(GteNclipSiteStat *out, int max); +void gte_nclip_stats_reset(void); + +/* Branch consumer for exact-NCLIP sites: the sign (-1/0/1) the branch should + * test. The precise sign when it belongs to `native_mac0` (the value the + * guest just read from MAC0), else the native sign. */ +int32_t gte_nclip_exact_sign(int32_t native_mac0, uint32_t pc); + +/* Kill switch for the exact-site consumer (default on): off makes every exact + * site test the native sign, for same-build/same-state A/B and diagnosis. */ +void gte_nclip_exact_set_enabled(int on); +int gte_nclip_exact_enabled(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/runtime/include/host_keymap.h b/runtime/include/host_keymap.h index 32aa0b3a..0f17ac95 100644 --- a/runtime/include/host_keymap.h +++ b/runtime/include/host_keymap.h @@ -23,6 +23,7 @@ typedef enum HostKeymapAction { HOST_KEYMAP_SAVE_STATE_MENU, /* default F7 */ HOST_KEYMAP_SCANLINES, /* default F6 */ HOST_KEYMAP_TURBO_TOGGLE, /* default F9; latches Turbo until pressed again */ + HOST_KEYMAP_CAPTURE_MARK, /* default Ctrl+M; freezes the debug capture rings */ HOST_KEYMAP_ACTION_COUNT } HostKeymapAction; diff --git a/runtime/include/mod_media.h b/runtime/include/mod_media.h new file mode 100644 index 00000000..dc551898 --- /dev/null +++ b/runtime/include/mod_media.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace PSXRecompV4 { + +/* Canonical bytes are an immutable, engine-owned snapshot. Plugins never + * reopen the selected file after verification. The PSX domain contains the + * first data track's 2048-byte sector payloads, excluding CD audio. */ +bool load_mod_media(const std::filesystem::path& path, + const std::string& format, uint64_t expected_size, + const std::string& expected_sha256, + std::shared_ptr>& bytes, + std::string* error = nullptr); + +} // namespace PSXRecompV4 diff --git a/runtime/include/mod_packages.h b/runtime/include/mod_packages.h index 76ece89b..04be60ec 100644 --- a/runtime/include/mod_packages.h +++ b/runtime/include/mod_packages.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -224,6 +225,8 @@ struct ModResource { std::string file_description; std::string format = "file"; bool required = false; + uint64_t size = 0; + std::string sha256; }; struct ModDerivedDisc { @@ -352,6 +355,9 @@ struct ModResolution { std::string feature_id; std::string id; std::filesystem::path path; + std::string format; + std::string sha256; + std::shared_ptr> bytes; }; std::vector resources; struct Diagnostic { @@ -535,4 +541,25 @@ struct ModFunctionEntryHook { std::vector mod_function_entry_hooks(const std::string& id); void mod_clear_plugins_for_tests(); +/* Every id a trusted implementation registered (activation, vblank or + * function-entry), sorted. */ +std::vector mod_registered_plugin_ids(); + +/* Registered implementations that no manifest under `manifest_roots` declares + * as a [[plugin]] id. The resolved plan activates plugins by manifest id only, + * so such an implementation can never run: a hook registered under a sub-id + * ("x.widescreen.hud") is silently dead while its package ("x.widescreen") + * resolves cleanly. Roots are searched recursively for manifest.toml; pass the + * AUTHORED trees (title mods/preloaded, framework mods/builtin) so developer + * packages a release catalog strips still count as declarations. Manifests + * that fail to parse are reported through `errors`. */ +struct ModPluginAudit { + std::vector undeclared; /* registered, never declared */ + std::vector declared; /* every manifest [[plugin]] id */ + std::vector errors; + size_t manifests = 0; +}; +ModPluginAudit mod_audit_registered_plugins( + const std::vector& manifest_roots); + } // namespace PSXRecompV4 diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index c8f4efd1..90c18bc7 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -32,6 +32,13 @@ void psx_mod_function_entry(struct CPUState* cpu, uint32_t address); * call, so a run without an active hook pays one load per interpreted entry. */ extern uint32_t g_psx_mod_function_entry_hooks; +/* Always-on named event counters for trusted plugins (observability, not + * logging): e.g. how often each guard in a hook rejected. `name` should be a + * string literal of the form "."; up to 128 distinct names are + * kept, further names are counted in an overflow bucket. Emulation-thread only. + * TCP: {"cmd":"mod_counters"} lists every counter with its last frame. */ +void psx_mod_counter_add(const char* name, uint32_t delta); + /* Narrow guest services available to trusted plugin callbacks. */ int psx_mod_game_started(void); /* Read an original mounted-disc file without changing guest CD state/timing. @@ -194,6 +201,17 @@ int psx_mod_option_value(const char* package_id, const char* feature_id, */ int psx_mod_current_resource_path(const char* resource_id, char* out, uint32_t out_size); +/* Read-only canonical media verified by the engine for this plugin's owning + * package/feature. The pointer lives until the committed plan is replaced or + * cleared. Available only during that plugin's callbacks; returns 0 for an + * ordinary unverified resource, an inactive feature, or a different owner. */ +int psx_mod_current_resource_bytes(const char* resource_id, + const uint8_t** bytes, uint64_t* size); + +/* Display aspects have no framework ceiling: the native-wide surfaces size + * themselves from the live width, and each title caps its own view at what + * it has validated (fixed ratio, or the adaptive maximum below). Requests + * must be at least native 4:3, with numerator and denominator in 1..99. */ /* * Request a fixed host display aspect before renderer/window initialization. diff --git a/runtime/include/overlay_api.h b/runtime/include/overlay_api.h index d93f70c6..df04f133 100644 --- a/runtime/include/overlay_api.h +++ b/runtime/include/overlay_api.h @@ -106,7 +106,13 @@ * the version stays. The emit-content change (PGXP_*() macros in all * generated C) is covered by the codegen hash + CODEGEN_VER below. */ /* v23: native overlay forwarding for signed screen bounds and mod entry hooks. */ -#define PSX_OVERLAY_ABI_VERSION 23 +/* v24: ws_cull_scale forwarder for register-register frustum-edge compares + * whose runtime bound operand scales with the live reveal. Appended + * last; NULL preserves the vanilla bound. */ +/* v25: gte_nclip_exact_sign forwarder for [widescreen.cull] nclip_exact_sites + * in overlay code (all sign-branch shapes). Appended last; NULL keeps the + * native sign. */ +#define PSX_OVERLAY_ABI_VERSION 25 /* Process-lifetime overlay candidate capacity. Every accepted manifest F * record consumes one slot, even when another DLL carries an identical @@ -173,7 +179,10 @@ * so packaged pairs cannot be hidden by an older user cache on first boot. */ /* 13: merge adaptive backdrop v12: independent quotient consumers, proven * copied/biased camera inputs, and two biased bounds for terrain strips. */ -#define PSX_OVERLAY_CODEGEN_VER 13 +/* 14: + [[widescreen.cull.scale]] register-register frustum-edge emit. */ +/* 15: exact/keep NCLIP sites emit for every sign-branch shape through + * gte_nclip_exact_sign(mac0, pc). */ +#define PSX_OVERLAY_CODEGEN_VER 15 /* Auto codegen hash (generated by hash_codegen.cmake from the recompiler codegen * sources). Folded into the cache PATH next to cg (gcc//cg_/) @@ -342,6 +351,10 @@ typedef struct { const PGXPHooks *pgxp; int32_t (*ws_screen_x_bound)(int32_t vanilla); void (*mod_function_entry)(CPUState *cpu, uint32_t address); + /* Frustum-edge bound scale helper (ABI v24). */ + int32_t (*ws_cull_scale)(int32_t bound, int32_t half_extent); + /* Exact-NCLIP branch sign (ABI v25). */ + int32_t (*nclip_exact_sign)(int32_t native_mac0, uint32_t pc); } OverlayCallbacks; #ifdef __cplusplus diff --git a/runtime/include/overlay_dispatch_preamble.c.inc b/runtime/include/overlay_dispatch_preamble.c.inc index c062cf1f..a53ed82e 100644 --- a/runtime/include/overlay_dispatch_preamble.c.inc +++ b/runtime/include/overlay_dispatch_preamble.c.inc @@ -263,6 +263,16 @@ uint32_t psx_ws_angle_widen(uint32_t vanilla) { ? g_cbs.ws_angle_widen(vanilla) : vanilla; } +int32_t psx_ws_cull_scale(int32_t bound, int32_t half_extent) { + return g_cbs.ws_cull_scale + ? g_cbs.ws_cull_scale(bound, half_extent) + : bound; +} +int32_t gte_nclip_exact_sign(int32_t native_mac0, uint32_t pc) { + return g_cbs.nclip_exact_sign + ? g_cbs.nclip_exact_sign(native_mac0, pc) + : (native_mac0 < 0 ? -1 : (native_mac0 > 0 ? 1 : 0)); +} /* Sub-pixel GTE precision-store tracker (ABI v14). The emitter emits a direct * gte_precision_store_word() call for every swc2 (GTE store-word), including in * overlay-resident code, so the DLL must define it or the shard fails to link diff --git a/runtime/include/present_image_ring.h b/runtime/include/present_image_ring.h new file mode 100644 index 00000000..33746b48 --- /dev/null +++ b/runtime/include/present_image_ring.h @@ -0,0 +1,55 @@ +#ifndef PSXRECOMP_PRESENT_IMAGE_RING_H +#define PSXRECOMP_PRESENT_IMAGE_RING_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Presented-image ring: a small copy of EVERY frame actually shown in the + * window (after compositing, letterbox included, before host OSD), for about + * ten seconds. Complements the display ring (canonical VRAM, ~1 s) for + * glitches that live only in presentation — native-wide compositing, frame + * interpolation, held frames — and that last a frame or two, so a single + * screenshot cannot catch them. Always-on in debug-tools builds + * (PSX_PRESENT_IMAGE_RING=0 disables); frozen by the capture mark. + * + * Entries are RGB565, PRESENT_IMAGE_RING_H rows tall, width following the + * window aspect (capped at PRESENT_IMAGE_RING_MAX_W). */ +#define PRESENT_IMAGE_RING_CAP 600 +#define PRESENT_IMAGE_RING_H 120 +#define PRESENT_IMAGE_RING_MAX_W 720 + +/* Thumbnail width for a window of ww x wh pixels. */ +int present_image_ring_thumb_w(int ww, int wh); + +/* 1 while capture is enabled and not frozen (callers skip the downscale). */ +int present_image_ring_accepting(void); + +/* Record one presented frame. `rgba` is 8-bit R,G,B,(A) per pixel, `pitch` + * bytes per row; `bottom_up` = rows stored bottom-first (GL readback). The + * image must already be w x PRESENT_IMAGE_RING_H. */ +void present_image_ring_push(uint32_t frame, const uint8_t *rgba, int w, + int pitch, int bottom_up); + +/* Box-downscale an ARGB8888 CPU present buffer (0xAARRGGBB, sw x sh) into a + * thumbnail and record it. Software / CPU-present path. */ +void present_image_ring_push_argb(uint32_t frame, const uint32_t *argb, + int sw, int sh, int src_pitch_px); + +void present_image_ring_set_frozen(int frozen); +int present_image_ring_frozen(void); + +/* Oldest/newest recorded frame numbers and how many entries are valid. */ +void present_image_ring_span(uint32_t *oldest, uint32_t *newest, int *count); + +/* Copy entry for `frame` as RGB888 top-down into a malloc'd buffer the + * caller frees. Returns 0 if the frame is not in the ring. */ +int present_image_ring_get_rgb(uint32_t frame, uint8_t **rgb, int *w, int *h); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/runtime/include/savestate.h b/runtime/include/savestate.h index 48d58e03..0a4d9505 100644 --- a/runtime/include/savestate.h +++ b/runtime/include/savestate.h @@ -140,6 +140,9 @@ void psx_frontend_on_rb_snap_loaded(void); /* Frontend hook (main.cpp): host OSD toast after a user save/load settles. * is_load: 0 = save, 1 = load. slot is 0-based. ok: 1 on success. */ void psx_frontend_on_savestate_notify(int is_load, int slot, int ok); +/* Frontend hook (main.cpp): a user save/load was refused before it was staged + * (so no notify follows). `reason` is short, plain text for the OSD. */ +void psx_frontend_on_savestate_refused(int is_load, int slot, const char *reason); /* Called every block from psx_check_interrupts (in_exception == 0). If a save is * pending, serialize with cpu->pc = resume_pc; if a load is pending, restore and diff --git a/runtime/include/ws_hud_anchor.h b/runtime/include/ws_hud_anchor.h index fc02cedc..e3e2130e 100644 --- a/runtime/include/ws_hud_anchor.h +++ b/runtime/include/ws_hud_anchor.h @@ -76,14 +76,23 @@ static inline void ws_hud_anchor_insert(WsHudAnchorTag *tags, uint32_t count, tags[victim].guard = *guard; } -static inline int ws_hud_anchor_lookup(const WsHudAnchorTag *tags, - uint32_t count, - uint32_t command_addr, - const uint32_t *words, - uint32_t word_count, - uint32_t frame, - int *out_anchor) { - if (!tags || !count || !words) return 0; +/* Lookup outcome, so callers can keep always-on counters that say WHY a tagged + * primitive was or was not honoured (absent, expired, or packet rewritten). */ +enum { + WS_HUD_ANCHOR_HIT = 1, + WS_HUD_ANCHOR_ABSENT = 0, + WS_HUD_ANCHOR_STALE = -1, + WS_HUD_ANCHOR_GUARD_MISMATCH = -2 +}; + +static inline int ws_hud_anchor_lookup_result(const WsHudAnchorTag *tags, + uint32_t count, + uint32_t command_addr, + const uint32_t *words, + uint32_t word_count, + uint32_t frame, + int *out_anchor) { + if (!tags || !count || !words) return WS_HUD_ANCHOR_ABSENT; uint32_t idx = ws_hud_anchor_slot(command_addr) & (count - 1u); for (uint32_t i = 0; i < WS_HUD_ANCHOR_PROBES && i < count; i++) { const WsHudAnchorTag *tag = &tags[(idx + i) & (count - 1u)]; @@ -91,13 +100,25 @@ static inline int ws_hud_anchor_lookup(const WsHudAnchorTag *tags, continue; if (tag->frame > frame || frame - tag->frame > WS_HUD_ANCHOR_FRESH_FRAMES) - return 0; + return WS_HUD_ANCHOR_STALE; if (!ws_prepass_packet_matches(&tag->guard, words, word_count)) - return 0; + return WS_HUD_ANCHOR_GUARD_MISMATCH; if (out_anchor) *out_anchor = tag->anchor; - return 1; + return WS_HUD_ANCHOR_HIT; } - return 0; + return WS_HUD_ANCHOR_ABSENT; +} + +static inline int ws_hud_anchor_lookup(const WsHudAnchorTag *tags, + uint32_t count, + uint32_t command_addr, + const uint32_t *words, + uint32_t word_count, + uint32_t frame, + int *out_anchor) { + return ws_hud_anchor_lookup_result(tags, count, command_addr, words, + word_count, frame, out_anchor) == + WS_HUD_ANCHOR_HIT; } #ifdef __cplusplus diff --git a/runtime/runtime.cmake b/runtime/runtime.cmake index 1dda84e7..c78ed681 100644 --- a/runtime/runtime.cmake +++ b/runtime/runtime.cmake @@ -402,6 +402,8 @@ set(PSXRECOMP_RUNTIME_SOURCES ${PSXRECOMP_ROOT}/runtime/src/psx_icache.c ${PSXRECOMP_ROOT}/runtime/src/starvation_ring.c ${PSXRECOMP_ROOT}/runtime/src/latency_ring.c + ${PSXRECOMP_ROOT}/runtime/src/present_image_ring.c + ${PSXRECOMP_ROOT}/runtime/src/gpu_timeline.c ${PSXRECOMP_ROOT}/runtime/src/data_shards.c ${PSXRECOMP_ROOT}/runtime/src/load_accel.c ${PSXRECOMP_ROOT}/runtime/src/card_read_summary.c @@ -420,6 +422,7 @@ set(PSXRECOMP_RUNTIME_SOURCES ${PSXRECOMP_ROOT}/runtime/src/mod_builtin_bezel.c ${PSXRECOMP_ROOT}/runtime/src/mod_builtin_ram.c ${PSXRECOMP_ROOT}/runtime/src/mod_packages.cpp + ${PSXRECOMP_ROOT}/runtime/src/mod_media.cpp ${PSXRECOMP_ROOT}/runtime/src/mod_runtime.cpp ${PSXRECOMP_ROOT}/runtime/src/mod_texture_banks.c ${PSXRECOMP_ROOT}/runtime/src/psx_keybinds.c @@ -1249,6 +1252,22 @@ function(_psxrt_stage_mod_catalog target preloaded_dir) endforeach() _psxrt_write_if_changed("${_excluded_manifest}" "${_excluded_text}") + # Every trusted plugin the executable registers must be selectable by an + # authored manifest [[plugin]] id; the resolved plan activates plugins by + # manifest id only, so an undeclared id (typically a hook registered under + # a sub-id of its package's plugin) is dead code that fails silently. + # Audits the AUTHORED trees, so developer packages a release catalog + # strips still count as declarations. + if(BUILD_TESTING) + set(_audit_roots "${PSXRECOMP_ROOT}/mods/builtin") + if(NOT preloaded_dir STREQUAL "" AND NOT preloaded_dir STREQUAL "NONE" + AND IS_DIRECTORY "${preloaded_dir}") + list(APPEND _audit_roots "${preloaded_dir}") + endif() + add_test(NAME psx_mod_plugin_audit_${target} + COMMAND $ --audit-mod-plugins ${_audit_roots}) + endif() + set_property(GLOBAL APPEND PROPERTY PSXRECOMP_MOD_CATALOG_TARGETS "${target}") set_property(GLOBAL APPEND PROPERTY PSXRECOMP_MOD_CATALOG_MANIFESTS "${_manifest}") set_property(GLOBAL APPEND PROPERTY PSXRECOMP_MOD_CATALOG_EXCLUDED "${_excluded_manifest}") diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index 7db1203d..756b288e 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -31,6 +31,9 @@ #include "gpu.h" #include "gpu_render.h" /* gr_scale + gr_render_display_hires (screenshot_hires) */ #include "present_ring.h" +#include "gpu_timeline.h" +#include "gte_nclip_stats.h" +#include "present_image_ring.h" #include "load_transition_ring.h" #include "cdrom.h" #include "sio.h" @@ -7810,6 +7813,72 @@ static void handle_ws_hud_mode(int id, const char *json) send_fmt("{\"id\":%d,\"ok\":true,\"tag_rects\":%d}", id, v ? 1 : 0); } +/* Named plugin counters (psx_mod_counter_add), always on: + * {"cmd":"mod_counters"} + * -> counters: [{name, count, last_frame}], overflow. */ +static void handle_mod_counters(int id, const char *json) +{ + extern int psx_mod_counters_snapshot(const char **names, uint64_t *counts, + uint64_t *last_frames, int cap, + uint64_t *overflow); + (void)json; + enum { CAP = 128 }; + const char *names[CAP]; + uint64_t counts[CAP], last[CAP], overflow = 0; + int n = psx_mod_counters_snapshot(names, counts, last, CAP, &overflow); + if (n > CAP) n = CAP; + size_t cap = 256u + (size_t)n * 160u; + char *buf = (char *)malloc(cap); + if (!buf) { send_err(id, "alloc failed"); return; } + size_t off = 0; + off += (size_t)snprintf(buf + off, cap - off, + "{\"id\":%d,\"ok\":true,\"frame\":%llu,\"counters\":[", + id, (unsigned long long)s_frame_count); + for (int i = 0; i < n && off < cap; i++) { + char esc[96]; + size_t e = 0; + for (const char *p = names[i]; *p && e + 2 < sizeof esc; p++) + if (*p != '"' && *p != '\\' && (unsigned char)*p >= 0x20) esc[e++] = *p; + esc[e] = '\0'; + off += (size_t)snprintf(buf + off, cap - off, + "%s{\"name\":\"%s\",\"count\":%llu,\"last_frame\":%llu}", + i ? "," : "", esc, (unsigned long long)counts[i], + (unsigned long long)last[i]); + } + if (off < cap) + snprintf(buf + off, cap - off, "],\"overflow\":%llu}", + (unsigned long long)overflow); + debug_server_send_line(buf); + free(buf); +} + +/* Explicit HUD-anchor / background tag pipeline counters (always on): + * {"cmd":"ws_tag_stats"} + * -> hud / background: tag_calls, tag_rejected, hit, stale, guard_mismatch, + * last_tag_frame, last_hit_frame. A title plugin that tags but never hits + * is either tagging the wrong address or rewriting packets after tagging. */ +static void handle_ws_tag_stats(int id, const char *json) +{ + (void)json; + GpuWsTagStats hud, bg; + gpu_ws_get_tag_stats(&hud, &bg); + const GpuWsTagStats *s[2] = { &hud, &bg }; + char part[2][256]; + for (int i = 0; i < 2; i++) + snprintf(part[i], sizeof part[i], + "{\"tag_calls\":%llu,\"tag_rejected\":%llu,\"hit\":%llu," + "\"stale\":%llu,\"guard_mismatch\":%llu," + "\"last_tag_frame\":%u,\"last_hit_frame\":%u}", + (unsigned long long)s[i]->tag_calls, + (unsigned long long)s[i]->tag_rejected, + (unsigned long long)s[i]->hit, + (unsigned long long)s[i]->stale, + (unsigned long long)s[i]->guard_mismatch, + s[i]->last_tag_frame, s[i]->last_hit_frame); + send_fmt("{\"id\":%d,\"ok\":true,\"frame\":%llu,\"hud\":%s,\"background\":%s}", + id, (unsigned long long)s_frame_count, part[0], part[1]); +} + /* Kernel-image bless state: {"cmd":"kernel_bless"} -> * entries/clean/mismatch/native_hits/verifies/invalidations, plus the * declared kernel patch ranges and the segments they made the verifier @@ -7973,7 +8042,7 @@ static void handle_display_aspect(int id, const char *json) { int num=json_get_int(json,"num",-1), den=json_get_int(json,"den",-1); int adaptive=json_get_int(json,"adaptive",0); if (!psx_debug_display_aspect(num,den,adaptive)) { - send_err(id,"invalid display aspect (4:3 through 32:9)");return; + send_err(id,"invalid display aspect (4:3 or wider, terms 1..99)");return; } send_fmt("{\"id\":%d,\"ok\":true,\"num\":%d,\"den\":%d,\"adaptive\":%d}",id,num,den,adaptive!=0); } @@ -8689,6 +8758,12 @@ typedef struct { uint16_t *vram; /* full 1024x512 */ } DispRingEntry; static PSX_BSS DispRingEntry s_disp_ring[DISP_RING_CAP]; +/* Capture mark state (debug_server_capture_mark / capture_mark). */ +static int s_capture_frozen = 0; +static uint64_t s_capture_mark_frame = 0; +static uint64_t s_capture_mark_count = 0; +static char s_capture_wide_path[512]; +static int s_capture_wide_ok = 0; static uint16_t *s_disp_ring_px = NULL; /* one block for all entries */ static void disp_ring_capture(void) @@ -8702,7 +8777,7 @@ static void disp_ring_capture(void) const char *e = getenv("PSX_DISPLAY_RING"); enabled = (!e || !*e || *e != '0') ? 1 : 0; } - if (!enabled) return; + if (!enabled || s_capture_frozen) return; if (!s_disp_ring_px) { size_t per = (size_t)DISP_RING_MAX_W * DISP_RING_MAX_H; size_t vram = (size_t)1024 * 512; @@ -8720,6 +8795,7 @@ static void disp_ring_capture(void) GpuDisplayInfo di; gpu_get_display_info(&di); if (di.disabled || di.width == 0 || di.height == 0) return; + gpu_timeline_note(GTL_DISP_CAPTURE, 0, di.display_x | (di.display_y << 16)); uint32_t w = di.width, h = di.height; if (w > DISP_RING_MAX_W) w = DISP_RING_MAX_W; if (h > DISP_RING_MAX_H) h = DISP_RING_MAX_H; @@ -9055,7 +9131,10 @@ static void handle_dump_buffer(int id, const char *json) * present path uses (gr_render_wide_display into a scratch buffer), so the dump * reflects the composited wide frame 1:1, orientation included. Errors if the * active backend has no wide compositor or native-wide isn't engaged. */ -static void handle_wide_shot(int id, const char *json) +/* Write the presented native-wide frame to `path`. Returns NULL on success + * (and the pixel size), or a static error string. Shared by wide_shot and + * the capture mark. */ +static const char *write_wide_png(const char *path, int *out_w, int *out_h) { extern int gr_wide_supported(void); extern int gr_scale(void); @@ -9064,33 +9143,28 @@ static void handle_wide_shot(int id, const char *json) extern void gl_renderer_sync_cpu(void); gl_renderer_sync_cpu(); /* no-op on SW / when no GL frame pending */ - if (!gr_wide_supported()) { send_err(id, "active backend has no wide compositor"); return; } + if (!gr_wide_supported()) return "active backend has no wide compositor"; int extra = ws_nw_extra(); - if (extra <= 0) { send_err(id, "native-wide not engaged (extra=0; need a wide game frame)"); return; } + if (extra <= 0) return "native-wide not engaged (extra=0; need a wide game frame)"; GpuDisplayInfo di; gpu_get_display_info(&di); - if (di.disabled || di.width == 0 || di.height == 0) { send_err(id, "display disabled"); return; } + if (di.disabled || di.width == 0 || di.height == 0) return "display disabled"; int scale = gr_scale(); if (scale < 1) scale = 1; int present_w = (int)di.width + extra; int W = present_w * scale, H = (int)di.height * scale; - char path[512]; - if (!json_get_str(json, "path", path, sizeof(path))) - strncpy(path, "psx_wide.png", sizeof(path) - 1); - path[sizeof(path) - 1] = '\0'; - uint32_t *buf = (uint32_t *)malloc((size_t)W * H * sizeof(uint32_t)); - if (!buf) { send_err(id, "alloc failed"); return; } + if (!buf) return "alloc failed"; int n = gr_render_wide_display(buf, W * (int)sizeof(uint32_t), (int)di.display_x, (int)di.display_y, (int)di.height); - if (n <= 0) { free(buf); send_err(id, "no wide surface for displayed buffer"); return; } + if (n <= 0) { free(buf); return "no wide surface for displayed buffer"; } /* ARGB8888 (0xAARRGGBB) -> RGB, written in the buffer's row order (so the * PNG shows exactly the present orientation — the point of this probe). */ uint8_t *rgb = (uint8_t *)malloc((size_t)W * H * 3); - if (!rgb) { free(buf); send_err(id, "alloc failed"); return; } + if (!rgb) { free(buf); return "alloc failed"; } for (int y = 0; y < H; y++) { for (int x = 0; x < W; x++) { uint32_t px = buf[(size_t)y * W + x]; @@ -9102,14 +9176,114 @@ static void handle_wide_shot(int id, const char *json) } free(buf); FILE *f = fopen(path, "wb"); - if (!f) { free(rgb); send_err(id, "cannot open file"); return; } + if (!f) { free(rgb); return "cannot open file"; } int ok = png_write_rgb(f, rgb, (uint32_t)W, (uint32_t)H); free(rgb); fclose(f); - if (!ok) { send_err(id, "png encode failed"); return; } + if (!ok) return "png encode failed"; + if (out_w) *out_w = W; + if (out_h) *out_h = H; + return NULL; +} + +static void handle_wide_shot(int id, const char *json) +{ + char path[512]; + if (!json_get_str(json, "path", path, sizeof(path))) + strncpy(path, "psx_wide.png", sizeof(path) - 1); + path[sizeof(path) - 1] = '\0'; + int W = 0, H = 0; + const char *err = write_wide_png(path, &W, &H); + if (err) { send_err(id, err); return; } send_fmt("{\"id\":%d,\"ok\":true,\"path\":\"%s\",\"width\":%d,\"height\":%d}", id, path, W, H); } +/* Operator capture mark. Runs on the present thread (hotkey handler), where + * the renderer's context is current. Freezes the display and GP0 rings so the + * frames and draw lists leading up to the mark survive until read, and saves + * the presented native-wide frame (the only record of the compositor output). + * A second mark while frozen is ignored; release with capture_mark op=release. */ +void debug_server_capture_mark(void) +{ + if (s_capture_frozen) return; + s_capture_mark_frame = s_frame_count; + s_capture_mark_count++; + snprintf(s_capture_wide_path, sizeof s_capture_wide_path, + "capture_mark_%llu_wide.png", (unsigned long long)s_frame_count); + s_capture_wide_ok = write_wide_png(s_capture_wide_path, NULL, NULL) == NULL; + s_capture_frozen = 1; + gpu_gp0_ring_set_frozen(1); + present_image_ring_set_frozen(1); + gpu_timeline_set_frozen(1); +} + +/* Presented-image ring (see present_image_ring.h): + * {"cmd":"present_image_ring_stats"} -> oldest, newest, count, frozen + * {"cmd":"present_image_ring_get","frame":N,"path":"x.png"} */ +static void handle_present_image_ring_stats(int id, const char *json) +{ + (void)json; + uint32_t lo = 0, hi = 0; int n = 0; + present_image_ring_span(&lo, &hi, &n); + send_fmt("{\"id\":%d,\"ok\":true,\"oldest\":%u,\"newest\":%u,\"count\":%d," + "\"frozen\":%d,\"capacity\":%d,\"height\":%d}", + id, lo, hi, n, present_image_ring_frozen(), + PRESENT_IMAGE_RING_CAP, PRESENT_IMAGE_RING_H); +} +static void handle_present_image_ring_get(int id, const char *json) +{ + int f = json_get_int(json, "frame", -1); + char path[512]; + if (f < 0 || !json_get_str(json, "path", path, sizeof path)) { + send_err(id, "need frame and path"); return; + } + uint8_t *rgb = NULL; int w = 0, h = 0; + if (!present_image_ring_get_rgb((uint32_t)f, &rgb, &w, &h)) { + send_err(id, "frame not in presented-image ring"); return; + } + FILE *fp = fopen(path, "wb"); + int ok = fp && png_write_rgb(fp, rgb, (uint32_t)w, (uint32_t)h); + if (fp) fclose(fp); + free(rgb); + if (!ok) { send_err(id, "png write failed"); return; } + send_fmt("{\"id\":%d,\"ok\":true,\"frame\":%d,\"width\":%d,\"height\":%d}", + id, f, w, h); +} + +/* {"cmd":"capture_mark","op":"status"|"mark"|"release"} + * status -> frozen, mark_frame, count, wide_path/wide_ok, and the frozen + * display-ring / GP0-ring frame spans to query. + * mark -> same as the hotkey (use only when nobody is at the window). + * release -> resume continuous capture. */ +static void handle_capture_mark(int id, const char *json) +{ + char op[16] = "status"; + (void)json_get_str(json, "op", op, sizeof op); + if (!strcmp(op, "mark")) debug_server_capture_mark(); + else if (!strcmp(op, "release")) { + s_capture_frozen = 0; + gpu_gp0_ring_set_frozen(0); + present_image_ring_set_frozen(0); + gpu_timeline_set_frozen(0); + } else if (strcmp(op, "status")) { send_err(id, "op must be status|mark|release"); return; } + uint32_t oldest = 0, newest = 0; + gpu_gp0_ring_frame_span(&oldest, &newest); + uint32_t d_old = UINT32_MAX, d_new = 0; + for (int i = 0; i < DISP_RING_CAP; i++) { + if (!s_disp_ring[i].valid) continue; + if (s_disp_ring[i].frame < d_old) d_old = s_disp_ring[i].frame; + if (s_disp_ring[i].frame > d_new) d_new = s_disp_ring[i].frame; + } + if (d_old == UINT32_MAX) d_old = 0; + send_fmt("{\"id\":%d,\"ok\":true,\"frozen\":%d,\"mark_frame\":%llu," + "\"count\":%llu,\"wide_path\":\"%s\",\"wide_ok\":%d," + "\"display_ring\":[%u,%u],\"gp0_ring\":[%u,%u],\"frame\":%llu}", + id, s_capture_frozen, (unsigned long long)s_capture_mark_frame, + (unsigned long long)s_capture_mark_count, s_capture_wide_path, + s_capture_wide_ok, d_old, d_new, oldest, newest, + (unsigned long long)s_frame_count); +} + /* screenshot: capture what the player is actually being shown. Native-wide * presentation is wider than the canonical PSX display rectangle, so routing * this command unconditionally through handle_screenshot_file silently omits @@ -9392,6 +9566,87 @@ static void handle_present_ring(int id, const char *json) free(buf); } +/* Precise-NCLIP attribution (gte_nclip_stats.h). + * {"cmd":"nclip_stats"} totals + per-function + per-site tables + * {"cmd":"nclip_stats","reset":1} clear the tables after reading + * {"cmd":"nclip_stats","exact":0|1} switch exact-site consumers off/on + * funcs: [near_store_pc, nclips, disagree, saturated, last_frame] (1 = unknown) + * sites: [pc, evals, flips, fallbacks, last_frame] */ +static void handle_nclip_stats(int id, const char *json) +{ + extern int gpu_ws_precise_nclip_enabled(void); + static GteNclipFuncStat funcs[GTE_NCLIP_STAT_CAP]; + static GteNclipSiteStat sites[GTE_NCLIP_STAT_CAP]; + uint64_t hits = 0, fallbacks = 0, disagree = 0; + gte_nclip_precise_stats(&hits, &fallbacks, &disagree); + const int nf = gte_nclip_func_stats(funcs, GTE_NCLIP_STAT_CAP); + const int ns = gte_nclip_site_stats(sites, GTE_NCLIP_STAT_CAP); + const int bufsz = 256 + (nf + ns) * 72; + char *buf = (char *)malloc((size_t)bufsz); + if (!buf) { send_err(id, "alloc failed"); return; } + int pos = snprintf(buf, bufsz, + "{\"id\":%d,\"ok\":true,\"enabled\":%d,\"exact\":%d,\"hits\":%llu,\"fallbacks\":%llu," + "\"disagreements\":%llu,\"funcs\":[", + id, gpu_ws_precise_nclip_enabled(), gte_nclip_exact_enabled(), + (unsigned long long)hits, + (unsigned long long)fallbacks, (unsigned long long)disagree); + for (int i = 0; i < nf; i++) + pos += snprintf(buf + pos, bufsz - pos, "%s[\"0x%08X\",%u,%u,%u,%u]", + i ? "," : "", funcs[i].func, funcs[i].nclips, + funcs[i].disagree, funcs[i].saturated, funcs[i].last_frame); + pos += snprintf(buf + pos, bufsz - pos, "],\"sites\":["); + for (int i = 0; i < ns; i++) + pos += snprintf(buf + pos, bufsz - pos, "%s[\"0x%08X\",%u,%u,%u,%u]", + i ? "," : "", sites[i].pc, sites[i].evals, + sites[i].flips, sites[i].fallbacks, sites[i].last_frame); + snprintf(buf + pos, bufsz - pos, "]}"); + if (json_get_int(json, "reset", 0)) gte_nclip_stats_reset(); + { + const int exact = json_get_int(json, "exact", -1); + if (exact >= 0) gte_nclip_exact_set_enabled(exact); + } + send_fmt("%s", buf); + free(buf); +} + +/* GPU frame timeline (gpu_timeline.h): cycle-ordered vblank / flip / + * draw-area / linked-list DMA / present events. + * {"cmd":"gpu_timeline","from":F,"to":T} frames [F,T] (default: last 8) + * events: [seq, cycle, frame, kind, a, b] */ +static void handle_gpu_timeline(int id, const char *json) +{ + uint64_t total = gpu_timeline_total(); + uint64_t oldest = total > GPU_TIMELINE_CAP ? total - GPU_TIMELINE_CAP : 0; + GpuTimelineEntry last; + uint32_t newest_frame = (total && gpu_timeline_get(total - 1, &last)) ? last.frame : 0; + int to = json_get_int(json, "to", (int)newest_frame); + int from = json_get_int(json, "from", to - 7); + if (from < 0) from = 0; + if (to < from) { send_err(id, "to < from"); return; } + int bufsz = 256 + 4096 * 80; + char *buf = (char *)malloc((size_t)bufsz); + if (!buf) { send_err(id, "alloc failed"); return; } + GpuTimelineEntry first_e; + uint32_t oldest_frame = (total && gpu_timeline_get(oldest, &first_e)) ? first_e.frame : 0; + int pos = snprintf(buf, bufsz, + "{\"id\":%d,\"ok\":true,\"total\":%llu,\"frames\":[%u,%u],\"events\":[", + id, (unsigned long long)total, oldest_frame, newest_frame); + int first = 1, n = 0; + for (uint64_t s = oldest; s < total && pos < bufsz - 128 && n < 4096; s++) { + GpuTimelineEntry e; + if (!gpu_timeline_get(s, &e)) continue; + if ((int)e.frame < from || (int)e.frame > to) continue; + pos += snprintf(buf + pos, bufsz - pos, "%s[%llu,%llu,%u,\"%s\",%u,%u]", + first ? "" : ",", (unsigned long long)s, + (unsigned long long)e.cyc, e.frame, + gpu_timeline_kind_name(e.kind), e.a, e.b); + first = 0; n++; + } + pos += snprintf(buf + pos, bufsz - pos, "],\"truncated\":%s}", n >= 4096 ? "true" : "false"); + send_fmt("%s", buf); + free(buf); +} + /* ---- Write trace: hook + handlers (Tier 1 reverse debugger) ---- */ extern CPUState *debug_cpu_ptr; @@ -13831,6 +14086,11 @@ static const CmdEntry s_commands[] = { { "ws_aspect_cone_site", handle_ws_aspect_cone_site }, { "ws_margin", handle_ws_margin }, { "ws_hud_mode", handle_ws_hud_mode }, + { "ws_tag_stats", handle_ws_tag_stats }, + { "mod_counters", handle_mod_counters }, + { "capture_mark", handle_capture_mark }, + { "present_image_ring_stats", handle_present_image_ring_stats }, + { "present_image_ring_get", handle_present_image_ring_get }, { "kernel_bless", handle_kernel_bless }, { "ws_aspect", handle_ws_aspect }, { "display_aspect", handle_display_aspect }, @@ -13851,6 +14111,8 @@ static const CmdEntry s_commands[] = { { "gl_coh_ring", handle_gl_coh_ring }, { "gl_present_ring", handle_gl_present_ring }, { "present_ring", handle_present_ring }, + { "gpu_timeline", handle_gpu_timeline }, + { "nclip_stats", handle_nclip_stats }, { "frame_perf", handle_frame_perf }, { "gl_ws_ablate", handle_gl_ws_ablate }, { "gl_interp", handle_gl_interp }, diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index 79aaa721..2bffda6d 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -1848,7 +1848,8 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, uint32_t vanilla = ((int32_t)cpu->gpr[rs] < (int32_t)cpu->gpr[rt]) ? 1u : 0u; uint32_t kept = vanilla; - if (!psx_ws_aspect_cone_site(cpu, pc, insn, vanilla, &kept)) + if (!psx_ws_cull_scale_site(pc, insn, cpu->gpr[rs], cpu->gpr[rt], &kept) && + !psx_ws_aspect_cone_site(cpu, pc, insn, vanilla, &kept)) (void)psx_ws_cull_keep_site(pc, insn, vanilla, &kept); cpu->gpr[rd] = kept; cpu->gpr[0] = 0; @@ -1858,7 +1859,8 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, { uint32_t vanilla = (cpu->gpr[rs] < cpu->gpr[rt]) ? 1u : 0u; uint32_t kept = vanilla; - (void)psx_ws_cull_keep_site(pc, insn, vanilla, &kept); + if (!psx_ws_cull_scale_site(pc, insn, cpu->gpr[rs], cpu->gpr[rt], &kept)) + (void)psx_ws_cull_keep_site(pc, insn, vanilla, &kept); cpu->gpr[rd] = kept; cpu->gpr[0] = 0; return 0; diff --git a/runtime/src/dma.c b/runtime/src/dma.c index 85ea2e05..7547708f 100644 --- a/runtime/src/dma.c +++ b/runtime/src/dma.c @@ -30,6 +30,7 @@ #include #include #include +#include "gpu_timeline.h" /* Word-aligned main-RAM offset of a DMA address (MADR / stepped cursor) * through the live geometry: retail folds to 2 MiB exactly as the DMAC's @@ -727,6 +728,8 @@ static void gpu_ll_complete(void *opaque, int hit_limit) { (void)opaque; gpu_ot_stats.completes++; gpu_ot_record_walk_stats(psx_cycle_count - gpu_ot_start_cycle); + gpu_timeline_note(GTL_LL_END, gpu_linked_list.nodes_processed, + gpu_linked_list.total_words); channels[2].madr = hit_limit ? gpu_linked_list.current_addr : 0x00FFFFFFu; gpu_ws_end_linked_list(); @@ -754,6 +757,7 @@ static void start_async_gpu_linked_list(void) { * header and payload read at its consumption boundary. */ gpu_ws_prepass_linked_list(start_addr); dma_gpu_ll_start(&gpu_linked_list, start_addr, 0x40000u); + gpu_timeline_note(GTL_LL_START, start_addr, 0); event_ring_record_aux(EV_DMA_SCHED, 2u, channels[2].chcr); gpu_ot_stats.starts++; gpu_ot_start_cycle = psx_cycle_count; diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index 1927ffa1..b4c87741 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -45,6 +45,7 @@ #include #include #include +#include "gpu_timeline.h" /* Word-aligned main-RAM key for a primitive/OT address through the live * geometry (retail: the DMAC's 0x1FFFFC fold). */ @@ -262,7 +263,12 @@ void gpu_ws_set_precise_nclip(int on) { * PGXP correction is disabled. Re-derive the internal transport arm. */ gpu_pgxp_rederive_enable(); } -int gpu_ws_precise_nclip_enabled(void) { return ws_precise_nclip_cfg && ws_active(); } +/* Same "reveals extra world" test the exact-NCLIP branch consumers use + * (psx_ws_x_margin() > 0): squash AND native-wide. ws_active() alone is the + * squash factor, which native-wide never sets, so the producer was dead there. */ +int gpu_ws_precise_nclip_enabled(void) { + return ws_precise_nclip_cfg && psx_ws_x_margin() > 0; +} void gpu_ws_set_gameplay_state_gate(uint32_t addr, const uint32_t *values, int nvalues) { if (nvalues < 0) nvalues = 0; @@ -742,6 +748,59 @@ int psx_ws_cull_keep_site(uint32_t pc, uint32_t instr, uint32_t vanilla, return 0; } +typedef struct { + uint32_t address; + uint32_t expected; + uint32_t operand; /* 0 = rs, 1 = rt */ + int32_t half_extent; +} WsCullScaleSite; +static WsCullScaleSite ws_cull_scale_sites[WS_EXPLICIT_CULL_SITES_MAX]; +static int ws_cull_scale_n = 0; +void gpu_ws_set_cull_scale_sites(const uint32_t *addresses, + const uint32_t *expected, + const uint32_t *operands, + const uint32_t *half_extents, int nsites) { + if (nsites < 0) nsites = 0; + if (nsites > WS_EXPLICIT_CULL_SITES_MAX) nsites = WS_EXPLICIT_CULL_SITES_MAX; + ws_cull_scale_n = nsites; + for (int i = 0; i < nsites; i++) { + ws_cull_scale_sites[i].address = addresses[i] & 0x1FFFFFFFu; + ws_cull_scale_sites[i].expected = expected[i]; + ws_cull_scale_sites[i].operand = operands[i] ? 1u : 0u; + ws_cull_scale_sites[i].half_extent = (int32_t)half_extents[i]; + } +} +/* A camera-space frustum edge authored for a half_extent-pixel half-screen + * (x < half*z/H) widens to the live view by scaling the bound by + * (half + margin) / half. 64-bit intermediate; saturates to int32. */ +int32_t psx_ws_cull_scale(int32_t bound, int32_t half_extent) { + const int32_t margin = psx_ws_x_margin(); + if (margin <= 0 || half_extent <= 0) return bound; + int64_t v = (int64_t)bound * (int64_t)(half_extent + margin) / half_extent; + if (v > INT32_MAX) v = INT32_MAX; + if (v < INT32_MIN) v = INT32_MIN; + return (int32_t)v; +} +int psx_ws_cull_scale_site(uint32_t pc, uint32_t instr, uint32_t rs_value, + uint32_t rt_value, uint32_t *out) { + const uint32_t phys = pc & 0x1FFFFFFFu; + for (int i = 0; i < ws_cull_scale_n; i++) { + const WsCullScaleSite *site = &ws_cull_scale_sites[i]; + if (site->address != phys || site->expected != instr) continue; + if (site->operand == 0) + rs_value = (uint32_t)psx_ws_cull_scale((int32_t)rs_value, site->half_extent); + else + rt_value = (uint32_t)psx_ws_cull_scale((int32_t)rt_value, site->half_extent); + const uint32_t funct = instr & 0x3Fu; + if (out) + *out = funct == 0x2Au + ? (((int32_t)rs_value < (int32_t)rt_value) ? 1u : 0u) + : ((rs_value < rt_value) ? 1u : 0u); + return 1; + } + return 0; +} + typedef struct { uint32_t address; uint32_t expected; @@ -1929,35 +1988,67 @@ static int ws_hud_command_words(uint32_t command_addr, uint32_t *words, return 1; } +static GpuWsTagStats ws_hud_tag_stats; +static GpuWsTagStats ws_background_tag_stats; + +void gpu_ws_get_tag_stats(GpuWsTagStats *hud, GpuWsTagStats *background) { + if (hud) *hud = ws_hud_tag_stats; + if (background) *background = ws_background_tag_stats; +} + +static void ws_tag_stats_note_lookup(GpuWsTagStats *stats, int result) { + switch (result) { + case WS_HUD_ANCHOR_HIT: + stats->hit++; + stats->last_hit_frame = (uint32_t)s_frame_count; + break; + case WS_HUD_ANCHOR_STALE: stats->stale++; break; + case WS_HUD_ANCHOR_GUARD_MISMATCH: stats->guard_mismatch++; break; + default: break; + } +} + void gpu_ws_tag_hud_prim(uint32_t prim, int anchor) { - if (!ws_native_wide_configured()) return; - if ((prim & 3u) != 0 || prim > UINT32_MAX - 4u) return; + ws_hud_tag_stats.tag_calls++; uint32_t command_addr = prim + 4u; uint32_t words[12]; uint32_t word_count = 0; - if (!ws_hud_command_words(command_addr, words, &word_count)) + if (!ws_native_wide_configured() || + (prim & 3u) != 0 || prim > UINT32_MAX - 4u || + !ws_hud_command_words(command_addr, words, &word_count)) { + ws_hud_tag_stats.tag_rejected++; return; + } WsPrepassPacketGuard guard = ws_prepass_packet_guard(words, word_count); ws_hud_anchor_insert(ws_hud_anchor_tags, WS_HUD_ANCHOR_TABLE_SIZE, GPU_RAM_KEY(command_addr), anchor, &guard, (uint32_t)s_frame_count); + ws_hud_tag_stats.last_tag_frame = (uint32_t)s_frame_count; } void gpu_ws_tag_background_prim(uint32_t prim) { - if (!ws_native_wide_configured() || (prim & 3u) || - prim > UINT32_MAX - 4u) return; + ws_background_tag_stats.tag_calls++; uint32_t words[12], count = 0; - if (!ws_hud_command_words(prim + 4u, words, &count)) return; + if (!ws_native_wide_configured() || (prim & 3u) || + prim > UINT32_MAX - 4u || + !ws_hud_command_words(prim + 4u, words, &count)) { + ws_background_tag_stats.tag_rejected++; + return; + } uint32_t op = words[0] >> 24; - if (op < 0x20u || op > 0x3Fu || (op & 2u)) return; + if (op < 0x20u || op > 0x3Fu || (op & 2u)) { + ws_background_tag_stats.tag_rejected++; + return; + } WsPrepassPacketGuard guard = ws_prepass_packet_guard(words, count); ws_hud_anchor_insert(ws_background_tags, WS_HUD_ANCHOR_TABLE_SIZE, (prim + 4u) & 0x1FFFFCu, 0, &guard, (uint32_t)s_frame_count); ws_background_tags_used = 1; ws_background_tag_frame = (uint32_t)s_frame_count; + ws_background_tag_stats.last_tag_frame = (uint32_t)s_frame_count; } int gpu_ws_background_stretch_active(void) { @@ -1982,9 +2073,11 @@ static int ws_nw_explicit_background(void) { gp0_words_needed <= 0 || gp0_words_needed > 12) return 0; uint32_t addr = gp0_cmd_source_addr & 0x1FFFFFFFu; if (addr >= 0x00200000u || (addr & 3u)) return 0; - return ws_hud_anchor_lookup(ws_background_tags, WS_HUD_ANCHOR_TABLE_SIZE, - addr, gp0_cmd_buf, (uint32_t)gp0_words_needed, - (uint32_t)s_frame_count, NULL); + int result = ws_hud_anchor_lookup_result( + ws_background_tags, WS_HUD_ANCHOR_TABLE_SIZE, addr, gp0_cmd_buf, + (uint32_t)gp0_words_needed, (uint32_t)s_frame_count, NULL); + ws_tag_stats_note_lookup(&ws_background_tag_stats, result); + return result == WS_HUD_ANCHOR_HIT; } void gpu_ws_tag_black_reveal_rect(uint32_t prim) { @@ -2024,10 +2117,12 @@ static int ws_nw_explicit_hud_delta(int32_t *out_delta) { uint32_t command_addr = gp0_cmd_source_addr & 0x1FFFFFFFu; if (command_addr >= psx_ram_live_bytes() || (command_addr & 3u)) return 0; int anchor = 0; - if (!ws_hud_anchor_lookup(ws_hud_anchor_tags, WS_HUD_ANCHOR_TABLE_SIZE, - command_addr, gp0_cmd_buf, - (uint32_t)gp0_words_needed, - (uint32_t)s_frame_count, &anchor)) + int result = ws_hud_anchor_lookup_result( + ws_hud_anchor_tags, WS_HUD_ANCHOR_TABLE_SIZE, command_addr, + gp0_cmd_buf, (uint32_t)gp0_words_needed, (uint32_t)s_frame_count, + &anchor); + ws_tag_stats_note_lookup(&ws_hud_tag_stats, result); + if (result != WS_HUD_ANCHOR_HIT) return 0; int32_t off = ws_nw_offset(); if (out_delta) @@ -3257,6 +3352,7 @@ void gpu_vblank_flush_present(void) { void gpu_vblank_tick(void) { lcf ^= 1; + gpu_timeline_note(GTL_VBLANK, lcf, 0); /* GPUSTAT.13 (interlace FIELD): on real hardware this alternates per * field while GP1(08h) vertical interlace is on, in antiphase with the * even/odd-lines bit 31 during active display. Modeled here at vblank @@ -4652,6 +4748,7 @@ static void gp0_exec_fill_rect(void) { * VRAM. Routed through the renderer so it also fills the hi-res * supersampling mirror (no-op cost when supersampling is off). */ gr_fill_rect((int)dst_x, (int)dst_y, (int)width, (int)height, color16); + gpu_timeline_note(GTL_FILL, dst_x | (dst_y << 16), width | (height << 16)); /* Native-wide: when the game clears a display buffer, clear the full width * of that buffer's wide surface over the same rows — refreshing the centred @@ -4706,6 +4803,7 @@ static void gp0_exec_draw_area_tl(void) { gr_set_draw_area((int)draw_area_left, (int)draw_area_top, (int)draw_area_right, (int)draw_area_bottom); ws_nw_sync_target(); /* back buffer (draw_area_left) → wide mirror surface */ + gpu_timeline_note(GTL_DRAW_AREA, draw_area_left, draw_area_top); } static void gp0_exec_draw_area_br(void) { @@ -5331,7 +5429,13 @@ static GpuGp0RingEntry *gp0_ring = NULL; /* lazy-alloc on first record */ static uint64_t gp0_ring_seq = 0; /* total commands recorded */ static uint32_t gp0_ring_head = 0; /* next write slot */ +/* Capture mark (debug_server_capture_mark): stop overwriting so the window + * that led up to an operator-reported glitch survives until it is read. */ +static int gp0_ring_frozen = 0; +void gpu_gp0_ring_set_frozen(int frozen) { gp0_ring_frozen = frozen ? 1 : 0; } + static void gp0_ring_record(const uint32_t *words, int n) { + if (gp0_ring_frozen) return; if (!gp0_ring) { gp0_ring = (GpuGp0RingEntry *)calloc(GP0_RING_CAP, sizeof(*gp0_ring)); if (!gp0_ring) return; /* OOM — capture disabled, no other effect */ @@ -5996,6 +6100,7 @@ static void gp1_display_area_start(uint32_t val) { display_area_x = val & 0x3FF; display_area_y = (val >> 10) & 0x1FF; ws_note_display_base(display_area_x); /* learn the display buffer set (native-wide) */ + gpu_timeline_note(GTL_DISP_START, display_area_x, display_area_y); } static void gp1_h_display_range(uint32_t val) { diff --git a/runtime/src/gpu_gl_renderer.c b/runtime/src/gpu_gl_renderer.c index 14815bfb..010b88d8 100644 --- a/runtime/src/gpu_gl_renderer.c +++ b/runtime/src/gpu_gl_renderer.c @@ -73,6 +73,7 @@ #include "psx_savestate_menu.h" #include "host_time.h" #include "latency_ring.h" +#include "gpu_timeline.h" #include "frame_pacing.h" #include "psx_rewind.h" @@ -182,6 +183,9 @@ typedef void (APIENTRY *PFN_glEndQuery)(GLenum); typedef void (APIENTRY *PFN_glGetQueryObjectui64v)(GLuint, GLenum, GLuint64 *); typedef void (APIENTRY *PFN_glGetQueryObjectiv)(GLuint, GLenum, GLint *); typedef void (APIENTRY *PFN_glQueryCounter)(GLuint, GLenum); +/* Buffer mapping for asynchronous pixel-pack readback (presented-image ring). */ +typedef void * (APIENTRY *PFN_glMapBuffer)(GLenum, GLenum); +typedef GLboolean (APIENTRY *PFN_glUnmapBuffer)(GLenum); #ifndef GL_TIME_ELAPSED #define GL_TIME_ELAPSED 0x88BF #endif @@ -195,6 +199,8 @@ typedef void (APIENTRY *PFN_glQueryCounter)(GLuint, GLenum); #define GL_QUERY_RESULT_AVAILABLE 0x8867 #endif +static PFN_glMapBuffer p_glMapBuffer; +static PFN_glUnmapBuffer p_glUnmapBuffer; static PFN_glCreateShader p_glCreateShader; static PFN_glShaderSource p_glShaderSource; static PFN_glCompileShader p_glCompileShader; @@ -297,6 +303,9 @@ static int load_modern_gl(void) { p_glGetQueryObjectui64v = (void *)SDL_GL_GetProcAddress("glGetQueryObjectui64v"); p_glGetQueryObjectiv = (void *)SDL_GL_GetProcAddress("glGetQueryObjectiv"); p_glQueryCounter = (void *)SDL_GL_GetProcAddress("glQueryCounter"); + /* Optional: only the debug presented-image ring maps pack buffers. */ + p_glMapBuffer = (void *)SDL_GL_GetProcAddress("glMapBuffer"); + p_glUnmapBuffer = (void *)SDL_GL_GetProcAddress("glUnmapBuffer"); #undef LOAD return ok; } @@ -1635,18 +1644,21 @@ static void mark_prim_dirty(const int *xs, const int *ys, int n, int textured) { * boundary (MMX6: draw area alternates y=0/y=240, both bands in ONE wide * surface) bleed into the OTHER band's rows — presented one frame later as * top/bottom edge flicker (16:9 GL only). */ +/* Wide-surface scissor: full wide width, draw-area rows (see above). Every + * draw into a wide surface uses it, including the full-screen-overlay pass. */ +static void wide_band_scissor(void) { + int sy = s_area_y1, sh = s_area_y2 - s_area_y1 + 1; + if (sy < 0) { sh += sy; sy = 0; } + if (sy + sh > VRAM_H) sh = VRAM_H - sy; + if (sh < 0) sh = 0; + glEnable(GL_SCISSOR_TEST); + glScissor(0, sy * s_scale, g_wide_w * s_scale, sh * s_scale); +} static void wide_target_begin(int dx, GLint uXoff, GLint uXhalf) { if (s_ws_ablate != 3) /* ablate 3: no FBO rebind (draws land in hr — perf probe) */ p_glBindFramebuffer(PSXGL_FRAMEBUFFER, g_wide_cur); glViewport(0, 0, g_wide_w * s_scale, VRAM_H * s_scale); - glEnable(GL_SCISSOR_TEST); - { - int sy = s_area_y1, sh = s_area_y2 - s_area_y1 + 1; - if (sy < 0) { sh += sy; sy = 0; } - if (sy + sh > VRAM_H) sh = VRAM_H - sy; - if (sh < 0) sh = 0; - glScissor(0, sy * s_scale, g_wide_w * s_scale, sh * s_scale); - } + wide_band_scissor(); p_glUniform1f(uXoff, (float)dx); p_glUniform1f(uXhalf, (float)g_wide_w / 2.0f); } @@ -2159,7 +2171,8 @@ static void gpu_textured_triangle(const int *xs, const int *ys, /* Draw a flat-colored rect (GEO program) DIRECTLY into the active wide surface * at wide-space coords [wx, wx+ww) × [y, y+h). Used only by the full-screen- * overlay path; positions are already in wide space so u_xoff stays 0. Mirrors - * raster_flat_rect(&wt, ...) in sw_draw_flat_rect. Caller stays inside + * raster_flat_rect(&wt, ...) in sw_draw_flat_rect, including its draw-area row + * clip. Caller stays inside * hr_begin/hr_end. */ static void wide_flat_rect_direct(int wx, int y, int ww, int h, uint16_t c, int semi) { if (ww <= 0 || h <= 0) return; @@ -2172,12 +2185,13 @@ static void wide_flat_rect_direct(int wx, int y, int ww, int h, uint16_t c, int fx0,fy0,r,g,b,a, fx1,fy0,r,g,b,a, fx0,fy1,r,g,b,a, fx1,fy0,r,g,b,a, fx0,fy1,r,g,b,a, fx1,fy1,r,g,b,a, }; - /* Wide target: positions already wide-space so u_xoff = 0; full-width - * scissor; u_xhalf = g_wide_w/2. */ + /* Wide target: positions already wide-space so u_xoff = 0; full-width, + * draw-area-rows scissor like rt_wide() — a full-height scissor let an + * overlay-width rect that canonically clips at a vertical double-buffer + * band boundary paint the OTHER band's rows; u_xhalf = g_wide_w/2. */ p_glBindFramebuffer(PSXGL_FRAMEBUFFER, g_wide_cur); glViewport(0, 0, g_wide_w * s_scale, VRAM_H * s_scale); - glEnable(GL_SCISSOR_TEST); - glScissor(0, 0, g_wide_w * s_scale, VRAM_H * s_scale); /* full surface (rt_wide) */ + wide_band_scissor(); if (semi >= 0) apply_psx_blend(semi); else glDisable(GL_BLEND); mask_stencil(s_mask_set); p_glUseProgram(s_geo_prog); @@ -4227,7 +4241,95 @@ static void gl_draw_osd_image(const uint32_t *px, int ow, int oh, } /* Composite host toast + volume bar into the default framebuffer, then swap. */ +/* ---- presented-image ring feed (debug tools) ------------------------------ + * Every present, before the host OSD is drawn: blit the composed default + * framebuffer (what the window shows, letterbox included) down to a + * PRESENT_IMAGE_RING_H-tall thumbnail FBO, and read it back through a pair of + * pixel-pack buffers so the GPU->CPU copy of frame N completes while frame + * N+1 is presented (no pipeline stall). Tagged with the frame number at issue + * time. Absent buffer-mapping entry points disable only this feed. */ +#ifndef PSX_NO_DEBUG_TOOLS +#include "present_image_ring.h" +extern uint64_t s_frame_count; +#define PSXGL_PIXEL_PACK_BUFFER 0x88EB +#define PSXGL_STREAM_READ 0x88E1 +#define PSXGL_READ_ONLY 0x88B8 +static GLuint s_pir_fbo, s_pir_tex, s_pir_pbo[2]; +static int s_pir_w, s_pir_pending[2], s_pir_pending_w[2], s_pir_idx; +static uint32_t s_pir_frame[2]; +static int s_pir_disabled; + +static void present_image_ring_capture_gl(void) { + if (s_pir_disabled || !p_glMapBuffer || !p_glUnmapBuffer) return; + if (!present_image_ring_accepting()) return; + int ww = 0, wh = 0; + SDL_GL_GetDrawableSize(s_win, &ww, &wh); + const int tw = present_image_ring_thumb_w(ww, wh); + const int th = PRESENT_IMAGE_RING_H; + if (tw <= 0) return; + if (!s_pir_fbo) { + glGenTextures(1, &s_pir_tex); + glBindTexture(GL_TEXTURE_2D, s_pir_tex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, PRESENT_IMAGE_RING_MAX_W, th, 0, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glBindTexture(GL_TEXTURE_2D, 0); + p_glGenFramebuffers(1, &s_pir_fbo); + p_glBindFramebuffer(PSXGL_FRAMEBUFFER, s_pir_fbo); + p_glFramebufferTexture2D(PSXGL_FRAMEBUFFER, PSXGL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, s_pir_tex, 0); + const GLenum st = p_glCheckFramebufferStatus(PSXGL_FRAMEBUFFER); + p_glBindFramebuffer(PSXGL_FRAMEBUFFER, 0); + if (st != PSXGL_FRAMEBUFFER_COMPLETE) { s_pir_disabled = 1; return; } + p_glGenBuffers(2, s_pir_pbo); + for (int i = 0; i < 2; i++) { + p_glBindBuffer(PSXGL_PIXEL_PACK_BUFFER, s_pir_pbo[i]); + p_glBufferData(PSXGL_PIXEL_PACK_BUFFER, + (ptrdiff_t)PRESENT_IMAGE_RING_MAX_W * th * 4, NULL, + PSXGL_STREAM_READ); + } + p_glBindBuffer(PSXGL_PIXEL_PACK_BUFFER, 0); + } + /* Downscale the presented image (default framebuffer back buffer). */ + glDisable(GL_SCISSOR_TEST); + p_glBindFramebuffer(PSXGL_READ_FRAMEBUFFER, 0); + p_glBindFramebuffer(PSXGL_DRAW_FRAMEBUFFER, s_pir_fbo); + p_glBlitFramebuffer(0, 0, ww, wh, 0, 0, tw, th, GL_COLOR_BUFFER_BIT, GL_LINEAR); + /* Queue this frame's readback into the current pack buffer. */ + const int cur = s_pir_idx; + p_glBindFramebuffer(PSXGL_READ_FRAMEBUFFER, s_pir_fbo); + p_glBindBuffer(PSXGL_PIXEL_PACK_BUFFER, s_pir_pbo[cur]); + glPixelStorei(GL_PACK_ALIGNMENT, 4); + glReadPixels(0, 0, tw, th, GL_RGBA, GL_UNSIGNED_BYTE, (void *)0); + s_pir_pending[cur] = 1; + s_pir_pending_w[cur] = tw; + s_pir_frame[cur] = (uint32_t)s_frame_count; + /* Harvest the previous frame's buffer (its copy finished during this one). */ + const int prev = cur ^ 1; + if (s_pir_pending[prev]) { + p_glBindBuffer(PSXGL_PIXEL_PACK_BUFFER, s_pir_pbo[prev]); + const uint8_t *px = (const uint8_t *)p_glMapBuffer(PSXGL_PIXEL_PACK_BUFFER, + PSXGL_READ_ONLY); + if (px) { + present_image_ring_push(s_pir_frame[prev], px, s_pir_pending_w[prev], + s_pir_pending_w[prev] * 4, 1 /* GL rows bottom-up */); + p_glUnmapBuffer(PSXGL_PIXEL_PACK_BUFFER); + } + s_pir_pending[prev] = 0; + } + p_glBindBuffer(PSXGL_PIXEL_PACK_BUFFER, 0); + p_glBindFramebuffer(PSXGL_READ_FRAMEBUFFER, 0); + p_glBindFramebuffer(PSXGL_DRAW_FRAMEBUFFER, 0); + s_pir_idx = prev; + s_pir_w = tw; +} +#endif + static void gl_swap_with_osd(void) { +#ifndef PSX_NO_DEBUG_TOOLS + if (s_ctx) present_image_ring_capture_gl(); +#endif if (s_present_prog && s_ctx) { int ww = 0, wh = 0; SDL_GL_GetDrawableSize(s_win, &ww, &wh); @@ -4448,6 +4550,7 @@ int gl_renderer_present_hold_last(void) { * full-window image (GL without interp). */ hold_capture_drawable(); } + gpu_timeline_note(GTL_PRESENT, GTL_PATH_HOLD, 0); latency_ring_mark(LAT_SWAP_BEGIN); gl_swap_with_osd(); latency_ring_mark(LAT_SWAP_END); @@ -4470,6 +4573,8 @@ void gl_renderer_present_vram(int disp_x, int disp_y, int w, int h, int linear, !psx_present_vsync_owns_cadence() && !gl_renderer_interpolation_owns_cadence()) { s_probe_skip++; + gpu_timeline_note(GTL_PRESENT_SKIP, GTL_PATH_VRAM_FBO, + (uint32_t)disp_x | ((uint32_t)disp_y << 16)); gl_perf_present_enter(); gl_perf_present_exit(0); return; @@ -4509,6 +4614,8 @@ void gl_renderer_present_vram(int disp_x, int disp_y, int w, int h, int linear, present_target_quad(s_hr_tex, VRAM_W, VRAM_H, disp_x, disp_y, w, h, linear, lx, ly, lw, lh, 1, 1); pres_record(GL_PRES_VRAM, disp_x, disp_y, w, h, lx, ly, lw, lh); + gpu_timeline_note(GTL_PRESENT, GTL_PATH_VRAM_FBO, + (uint32_t)disp_x | ((uint32_t)disp_y << 16)); hold_capture_drawable(); latency_ring_mark(LAT_SWAP_BEGIN); gl_swap_with_osd(); @@ -4581,6 +4688,8 @@ int gl_renderer_present_wide_fbo(int disp_x, int disp_y, int disp_h, int linear) !psx_present_vsync_owns_cadence() && !gl_renderer_interpolation_owns_cadence()) { s_probe_skip++; + gpu_timeline_note(GTL_PRESENT_SKIP, GTL_PATH_WIDE_FBO, + (uint32_t)disp_x | ((uint32_t)disp_y << 16)); gl_perf_present_enter(); gl_perf_present_exit(1); return 1; @@ -4613,6 +4722,8 @@ int gl_renderer_present_wide_fbo(int disp_x, int disp_y, int disp_h, int linear) present_target_quad(tex, g_wide_w, VRAM_H, 0, disp_y, g_wide_w, disp_h, linear, lx, ly, lw, lh, 1, 1); pres_record(GL_PRES_WIDE, disp_x, disp_y, g_wide_w, disp_h, lx, ly, lw, lh); + gpu_timeline_note(GTL_PRESENT, GTL_PATH_WIDE_FBO, + (uint32_t)disp_x | ((uint32_t)disp_y << 16)); hold_capture_drawable(); latency_ring_mark(LAT_SWAP_BEGIN); gl_swap_with_osd(); diff --git a/runtime/src/gpu_timeline.c b/runtime/src/gpu_timeline.c new file mode 100644 index 00000000..e52eee2a --- /dev/null +++ b/runtime/src/gpu_timeline.c @@ -0,0 +1,45 @@ +/* GPU frame timeline ring — see gpu_timeline.h. */ +#include "gpu_timeline.h" +#include "psx_cycles.h" + +extern uint64_t s_frame_count; /* debug_server.c */ + +static GpuTimelineEntry s_ring[GPU_TIMELINE_CAP]; +static uint64_t s_total = 0; +static int s_frozen = 0; + +void gpu_timeline_note(uint8_t kind, uint32_t a, uint32_t b) { + if (s_frozen) return; + GpuTimelineEntry *e = &s_ring[s_total & (GPU_TIMELINE_CAP - 1u)]; + e->cyc = psx_cycle_count; + e->frame = (uint32_t)s_frame_count; + e->a = a; + e->b = b; + e->kind = kind; + s_total++; +} + +void gpu_timeline_set_frozen(int frozen) { s_frozen = frozen ? 1 : 0; } + +uint64_t gpu_timeline_total(void) { return s_total; } + +int gpu_timeline_get(uint64_t seq, GpuTimelineEntry *out) { + if (seq >= s_total || s_total - seq > GPU_TIMELINE_CAP) return 0; + *out = s_ring[seq & (GPU_TIMELINE_CAP - 1u)]; + return 1; +} + +const char *gpu_timeline_kind_name(uint8_t kind) { + switch (kind) { + case GTL_VBLANK: return "vblank"; + case GTL_DISP_START: return "disp_start"; + case GTL_DRAW_AREA: return "draw_area"; + case GTL_LL_START: return "ll_start"; + case GTL_LL_END: return "ll_end"; + case GTL_PRESENT: return "present"; + case GTL_PRESENT_SKIP: return "present_skip"; + case GTL_DISP_CAPTURE: return "disp_capture"; + case GTL_FILL: return "fill"; + default: return "?"; + } +} diff --git a/runtime/src/gpu_vk_renderer.c b/runtime/src/gpu_vk_renderer.c index adc90521..6328eb8a 100644 --- a/runtime/src/gpu_vk_renderer.c +++ b/runtime/src/gpu_vk_renderer.c @@ -2800,8 +2800,10 @@ static void vkb_draw_gouraud_triangle(int x0,int y0,uint16_t c0,int x1,int y1,ui /* Full-screen-overlay wide pass (pause gray-filter / load fade): draw a flat * rect covering the FULL wide width [0, wide_w) x [y, y+h) directly into the * active wide surface (positions already wide-space, u_xoff = 0). Mirrors GL's - * wide_flat_rect_direct: full-surface scissor (the overlay must dim the - * revealed margins too). The 6 verts are consumed privately (s_vbase bumped) + * wide_flat_rect_direct: full wide width (the overlay must dim the revealed + * margins too) but only the draw-area rows, like SW rt_wide() — a full-height + * scissor let a rect that canonically clips at a vertical double-buffer band + * boundary paint the OTHER band's rows. The 6 verts are consumed privately (s_vbase bumped) * so they never join a canonical batch. */ static void wide_overlay_rect(int y, int h, uint16_t c, int semi) { if (s_wide_cur < 0 || !s_ready) return; @@ -2813,12 +2815,8 @@ static void wide_overlay_rect(int y, int h, uint16_t c, int semi) { push_vert(x0, fy0, col); push_vert(x1, fy1, col); push_vert(x0, fy1, col); s_vbase += s_vcount; s_vcount = 0; /* consume privately */ int blend = (semi < 0) ? 0 : (semi + 1); - int S = s_scale; VkCommandBuffer cb = begin_oneshot(); - wide_pass_begin(cb); - /* Overlay covers the whole surface: override the band scissor. */ - VkRect2D sc = { { 0, 0 }, { (uint32_t)(s_wide_w * S), (uint32_t)(VRAM_H * S) } }; - p_vkCmdSetScissor(cb, 0, 1, &sc); + wide_pass_begin(cb); /* band scissor: full wide width, draw-area rows */ bind_masked(cb, 0, 0, blend, s_mask_check, s_mask_set); GeoPush gp = { px_shift(), 0.0f, (float)s_wide_w / 2.0f }; p_vkCmdPushConstants(cb, s_pl_geo, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof gp, &gp); diff --git a/runtime/src/gte.cpp b/runtime/src/gte.cpp index eddf2c32..e586d8d8 100644 --- a/runtime/src/gte.cpp +++ b/runtime/src/gte.cpp @@ -2,6 +2,7 @@ #include "cpu_state.h" #include "nd_intro_ot.h" #include "pgxp.h" +#include "gte_nclip_stats.h" #include #include #include @@ -9,6 +10,8 @@ extern "C" uint32_t psx_read_word(uint32_t addr); extern "C" int gpu_ws_precise_nclip_enabled(void); +extern "C" uint64_t s_frame_count; /* debug_server.c */ +extern "C" uint32_t g_debug_last_store_pc; /* debug_server.c */ namespace PSXRecomp { namespace GTE { @@ -946,10 +949,63 @@ extern "C" void gte_nclip_precise_stats(uint64_t *hits, uint64_t *fallbacks, if (fallbacks) *fallbacks = s_nclip_fallbacks; if (disagreements) *disagreements = s_nclip_disagreements; } -extern "C" int gte_nclip_precise_bltz(int32_t native_mac0) { - if (!s_nclip_last_precise_valid || native_mac0 != s_nclip_last_native) - return native_mac0 < 0; - return s_nclip_last_precise_sign < 0; +/* Always-on attribution tables (gte_nclip_stats.h): producers by guest + * function, consumers by branch PC. Open addressing; a full table drops new + * keys (counted in s_nclip_*_dropped) rather than evicting. */ +static GteNclipFuncStat s_nclip_func[GTE_NCLIP_STAT_CAP]; /* key 1 = unknown */ +static GteNclipSiteStat s_nclip_site[GTE_NCLIP_STAT_CAP]; +static uint32_t s_nclip_func_dropped = 0, s_nclip_site_dropped = 0; +static inline uint32_t nclip_slot(uint32_t key) { + return (key * 2654435761u) >> 24; /* GTE_NCLIP_STAT_CAP == 256 */ +} +template +static T *nclip_find(T *table, uint32_t key, uint32_t T::*field, + uint32_t *dropped) { + for (uint32_t i = 0, s = nclip_slot(key); i < GTE_NCLIP_STAT_CAP; + ++i, s = (s + 1) & (GTE_NCLIP_STAT_CAP - 1)) { + T *e = &table[s]; + if (e->*field == key) return e; + if (e->*field == 0) { e->*field = key; return e; } + } + ++*dropped; + return nullptr; +} +extern "C" int gte_nclip_func_stats(GteNclipFuncStat *out, int max) { + int n = 0; + for (int i = 0; i < GTE_NCLIP_STAT_CAP && n < max; ++i) + if (s_nclip_func[i].func) out[n++] = s_nclip_func[i]; + return n; +} +extern "C" int gte_nclip_site_stats(GteNclipSiteStat *out, int max) { + int n = 0; + for (int i = 0; i < GTE_NCLIP_STAT_CAP && n < max; ++i) + if (s_nclip_site[i].pc) out[n++] = s_nclip_site[i]; + return n; +} +extern "C" void gte_nclip_stats_reset(void) { + memset(s_nclip_func, 0, sizeof s_nclip_func); + memset(s_nclip_site, 0, sizeof s_nclip_site); + s_nclip_func_dropped = s_nclip_site_dropped = 0; +} +static int s_nclip_exact_enabled = 1; +extern "C" void gte_nclip_exact_set_enabled(int on) { s_nclip_exact_enabled = on ? 1 : 0; } +extern "C" int gte_nclip_exact_enabled(void) { return s_nclip_exact_enabled; } +extern "C" int32_t gte_nclip_exact_sign(int32_t native_mac0, uint32_t pc) { + const int32_t native = native_mac0 < 0 ? -1 : (native_mac0 > 0 ? 1 : 0); + const bool usable = s_nclip_exact_enabled && s_nclip_last_precise_valid && + native_mac0 == s_nclip_last_native; + const int32_t sign = usable ? s_nclip_last_precise_sign : native; + if (!s_gte_replay_sandbox && s_speculative_depth == 0) { + if (GteNclipSiteStat *e = nclip_find(s_nclip_site, pc, + &GteNclipSiteStat::pc, + &s_nclip_site_dropped)) { + e->evals++; + if (!usable) e->fallbacks++; + else if (sign != native) e->flips++; + e->last_frame = (uint32_t)s_frame_count; + } + } + return sign; } void gte_nclip(GTEState* gte, uint32_t instr) { @@ -983,8 +1039,25 @@ void gte_nclip(GTEState* gte, uint32_t instr) { const int64_t cross = dx10 * dy20 - dy10 * dx20; s_nclip_last_precise_sign = cross < 0 ? -1 : (cross > 0 ? 1 : 0); s_nclip_last_precise_valid = true; - if ((cross > 0 && out <= 0) || (cross < 0 && out >= 0)) + const int32_t native_sign = out < 0 ? -1 : (out > 0 ? 1 : 0); + const bool disagree = native_sign != s_nclip_last_precise_sign; + if (disagree) s_nclip_disagreements++; + /* Last guest store before this NCLIP: codegen stamps it on every + * store, so it lands inside the emitter that issued the NCLIP (the + * function stamp is not maintained for static code). */ + const uint32_t key = g_debug_last_store_pc ? g_debug_last_store_pc : 1u; + if (GteNclipFuncStat *e = nclip_find(s_nclip_func, key, + &GteNclipFuncStat::func, + &s_nclip_func_dropped)) { + e->nclips++; + if (disagree) e->disagree++; + if (sx0 == -0x400 || sx0 == 0x3FF || sy0 == -0x400 || sy0 == 0x3FF || + sx1 == -0x400 || sx1 == 0x3FF || sy1 == -0x400 || sy1 == 0x3FF || + sx2 == -0x400 || sx2 == 0x3FF || sy2 == -0x400 || sy2 == 0x3FF) + e->saturated++; + e->last_frame = (uint32_t)s_frame_count; + } } else if (gpu_ws_precise_nclip_enabled() && !s_gte_replay_sandbox && s_speculative_depth == 0) { s_nclip_fallbacks++; diff --git a/runtime/src/host_keymap.c b/runtime/src/host_keymap.c index b23a8386..39afb3d0 100644 --- a/runtime/src/host_keymap.c +++ b/runtime/src/host_keymap.c @@ -110,6 +110,8 @@ static void apply_defaults(void) { add_bind(HOST_KEYMAP_SCANLINES, (int)SDLK_F6, (int)SDL_SCANCODE_F6, 0); if (want_default(HOST_KEYMAP_TURBO_TOGGLE)) add_bind(HOST_KEYMAP_TURBO_TOGGLE, (int)SDLK_F9, (int)SDL_SCANCODE_F9, 0); + if (want_default(HOST_KEYMAP_CAPTURE_MARK)) + add_bind(HOST_KEYMAP_CAPTURE_MARK, (int)SDLK_m, (int)SDL_SCANCODE_M, KMOD_CTRL); } /* Parse one "Ctrl+Alt+PageUp" token into key+mods. */ @@ -169,6 +171,7 @@ static HostKeymapAction action_for_key(const char *name) { if (ieq(name, "SaveStateMenu")) return HOST_KEYMAP_SAVE_STATE_MENU; if (ieq(name, "Scanlines")) return HOST_KEYMAP_SCANLINES; if (ieq(name, "TurboToggle")) return HOST_KEYMAP_TURBO_TOGGLE; + if (ieq(name, "CaptureMark")) return HOST_KEYMAP_CAPTURE_MARK; return HOST_KEYMAP_ACTION_COUNT; } @@ -223,6 +226,17 @@ void host_keymap_load(const char *config_ini_path) { apply_defaults(); } +/* A physical key event reports which side's modifier is down (KMOD_LCTRL or + * KMOD_RCTRL), while a binding means "either Ctrl". Compare on the side-less + * Ctrl/Alt/Shift set so Ctrl+X binds match a real left- or right-Ctrl press. */ +static int canonical_mods(int mod) { + int m = 0; + if (mod & KMOD_CTRL) m |= KMOD_CTRL; + if (mod & KMOD_ALT) m |= KMOD_ALT; + if (mod & KMOD_SHIFT) m |= KMOD_SHIFT; + return m; +} + int host_keymap_match_event(HostKeymapAction action, int keycode, int scancode, int mod) { const HostKeyAction *a; @@ -234,7 +248,7 @@ int host_keymap_match_event(HostKeymapAction action, int keycode, if (a->binds[i].keycode != keycode && (scancode <= 0 || a->binds[i].scancode != scancode)) continue; - if ((mod & relevant) == a->binds[i].mods) return 1; + if (canonical_mods(mod & relevant) == canonical_mods(a->binds[i].mods)) return 1; } return 0; } @@ -253,7 +267,7 @@ int host_keymap_down(HostKeymapAction action, const uint8_t *keys, int mod) { const int sc = a->binds[i].scancode; if (sc <= 0 || sc >= SDL_NUM_SCANCODES) continue; if (!keys[sc]) continue; - if ((mod & relevant) == a->binds[i].mods) return 1; + if (canonical_mods(mod & relevant) == canonical_mods(a->binds[i].mods)) return 1; } return 0; } diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 18eb5c97..8e15d26f 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -85,6 +85,9 @@ extern "C" void psx_event_step_conservative_env_init(void); #include "game_options.h" #include "mod_plugins.h" #include "mod_runtime.h" +#include "mod_packages.h" +#include "present_image_ring.h" +#include "gpu_timeline.h" #include "crc32.h" #include "disc_identity.h" #include "sbi_setup.h" @@ -1012,6 +1015,12 @@ extern "C" void psx_frontend_on_savestate_notify(int is_load, int slot, int ok) host_osd_push(buf, 2000); } +extern "C" void psx_frontend_on_savestate_refused(int is_load, int slot, + const char *reason) { + (void)is_load; (void)slot; + host_osd_push(reason, 3000); +} + extern "C" void psx_frontend_on_savestate_loaded(void) { mod_runtime_on_savestate_loaded(); s_disabled_frame_presented = false; @@ -1354,8 +1363,7 @@ extern "C" int psx_mod_set_fixed_display_aspect( uint32_t numerator, uint32_t denominator) { if (numerator == 0 || denominator == 0 || numerator > 99 || denominator > 99 || - 3u * numerator < 4u * denominator || - 9u * numerator > 32u * denominator) { + 3u * numerator < 4u * denominator) { std::fprintf(stderr, "psxrecomp: mod rejected invalid display aspect %u:%u\n", (unsigned)numerator, (unsigned)denominator); @@ -1374,8 +1382,7 @@ extern "C" int psx_mod_set_adaptive_display_aspect( const bool uncapped = max_numerator == 0 && max_denominator == 0; if (!uncapped && (max_numerator == 0 || max_denominator == 0 || max_numerator > 99 || max_denominator > 99 || - 3u * max_numerator < 4u * max_denominator || - 9u * max_numerator > 32u * max_denominator)) { + 3u * max_numerator < 4u * max_denominator)) { std::fprintf(stderr, "psxrecomp: mod rejected invalid adaptive display aspect %u:%u\n", (unsigned)max_numerator, (unsigned)max_denominator); @@ -6534,6 +6541,47 @@ struct NetplayVblankEpilogue { }; /* Called from gpu_vblank_tick() at each simulated vblank. */ +#ifndef PSX_NO_DEBUG_TOOLS +/* Headless has no present surface, but automated A/B runs still need the + * frame-indexed record of what a windowed build would show: the displayed + * band of the native-wide surface on a wide game frame, otherwise the 4:3 + * display area. Same classification as the windowed present below. */ +static void headless_present_image_ring_capture(void) { + if (!present_image_ring_accepting()) return; + GpuDisplayInfo di; + gpu_get_display_info(&di); + if (di.disabled || di.width == 0 || di.height == 0 || di.depth24) return; + const bool fmv_frame = !g_ws_engaged || gpu_ws_present_native_43() != 0; + static std::vector buf; + int w = 0, h = 0; + if (!fmv_frame && ws_native_wide_active() && gr_wide_supported()) { + buf.resize((size_t)1024 * 4 * 512 * 4); + if (gr_wide_dump_full(buf.data(), (int)buf.size(), &w, &h, + (int)di.display_x) > 0 && h >= 512) { + const int s = h / 512; + const int y0 = (int)di.display_y * s, rows = (int)di.height * s; + if (y0 + rows <= h) { + present_image_ring_push_argb((uint32_t)s_frame_count, + buf.data() + (size_t)y0 * w, + w, rows, w); + return; + } + } + } + w = (int)di.width; h = (int)di.height; + buf.resize((size_t)w * h); + for (int y = 0; y < h; y++) + for (int x = 0; x < w; x++) { + const uint16_t p = gpu_vram_peek((int)(di.display_x + x), + (int)(di.display_y + y)); + buf[(size_t)y * w + x] = 0xFF000000u | ((uint32_t)(p & 31) << 19) | + ((uint32_t)((p >> 5) & 31) << 11) | + ((uint32_t)((p >> 10) & 31) << 3); + } + present_image_ring_push_argb((uint32_t)s_frame_count, buf.data(), w, h, w); +} +#endif + static NetplayVblankEpilogue sdl_vblank_present_body(void) { NetplayVblankEpilogue ep{}; /* Guest quantum for this vblank is complete. Drop top-level-resume armed @@ -6753,6 +6801,17 @@ static NetplayVblankEpilogue sdl_vblank_present_body(void) { (int)mod)) { fast_forward_toggle_flip(); } + else if (!key_repeat && + host_keymap_match_event(HOST_KEYMAP_CAPTURE_MARK, + (int)key, (int)scancode, + (int)mod)) { +#ifndef PSX_NO_DEBUG_TOOLS + debug_server_capture_mark(); + host_osd_push("Capture marked (debug rings frozen)", 2000); +#else + host_osd_push("Capture mark needs a debug-tools build", 2000); +#endif + } else if (!key_repeat && host_keymap_match_event(HOST_KEYMAP_DISPLAY_PERF, (int)key, (int)scancode, @@ -6981,7 +7040,34 @@ static NetplayVblankEpilogue sdl_vblank_present_body(void) { } #endif + /* Guest-affecting per-frame services run on EVERY guest frame, before any + * presentation early-out (headless, TCP turbo, load/FMV present skips). + * Widescreen engagement changes GTE projection and cull margins, and mod + * frame hooks may touch guest state, so neither may depend on whether this + * frame is presented — otherwise headless validation runs a different game + * than the windowed build. Hooks still run after all normal input sampling. */ + mod_call_frame_hooks(); + + /* Resize-driven mode updates the pending aspect during BIOS boot too, but + * the actual wide compositor remains disengaged until game entry. No-op + * without a window. */ + update_adaptive_widescreen(); + + /* Engage widescreen at game entry: BIOS boot stays authentic 4:3. */ + if (!g_ws_engaged) { + if (fntrace_is_game_started()) { + g_ws_engaged = true; + g_ws_projection_mode = -1; + refresh_widescreen_projection(); + } + } else { + refresh_widescreen_projection(); + } + if (g_headless) { +#ifndef PSX_NO_DEBUG_TOOLS + headless_present_image_ring_capture(); +#endif ep.skip_pace = 1; return ep; } @@ -7150,13 +7236,6 @@ static NetplayVblankEpilogue sdl_vblank_present_body(void) { } } - /* Mod hooks. Run after all normal input sampling. */ - mod_call_frame_hooks(); - - /* Resize-driven mode updates the pending aspect during BIOS boot too, but - * the actual wide compositor remains disengaged until game entry. */ - update_adaptive_widescreen(); - /* Depth24 GP1(07h) retarget (MotK intro→crawl): keep the prior Swap for a * few vblanks so stale trailing VRAM never flashes on the right edge. * Must tick every present — gpu.c arms s_d24_present_hold and also @@ -7164,16 +7243,6 @@ static NetplayVblankEpilogue sdl_vblank_present_body(void) { * sticks and depth24_fix_trailing_margin blanks the whole FMV forever. */ if (gpu_depth24_present_hold_tick()) return ep; - /* Engage widescreen at game entry: BIOS boot stays authentic 4:3. */ - if (!g_ws_engaged) { - if (fntrace_is_game_started()) { - g_ws_engaged = true; - g_ws_projection_mode = -1; - refresh_widescreen_projection(); - } - } else { - refresh_widescreen_projection(); - } /* Rollback resim (§33/§47): short catch-up keeps hold-last; long catch-up * periodically presents live Replay VRAM so the display shows progress @@ -7539,6 +7608,17 @@ static NetplayVblankEpilogue sdl_vblank_present_body(void) { SDL_Rect src = { 0, 0, src_w, src_h }; SDL_UpdateTexture(sdl_texture, &src, sdl_pixel_buf, (int)(src_w * sizeof(uint32_t))); +#ifndef PSX_NO_DEBUG_TOOLS + /* Presented-image ring (software/CPU present): the frame being shown. */ + present_image_ring_push_argb((uint32_t)s_frame_count, sdl_pixel_buf, + (int)src_w, (int)src_h, (int)src_w); +#endif + { + GpuDisplayInfo tdi; + gpu_get_display_info(&tdi); + gpu_timeline_note(GTL_PRESENT, GTL_PATH_CPU, + tdi.display_x | ((uint32_t)tdi.display_y << 16)); + } /* Short FMV bands only update [0..src_h). Linear sampling at the bottom * edge blends with uninitialized texels below (X11 SDL backends often * show that as a thin white strip; Wayland may not). Pad one black row @@ -12445,6 +12525,32 @@ int main(int argc, char** argv) { launcher_boot_timing_mark("host:main_enter"); #endif + /* --audit-mod-plugins ...: build-time check, no emulation. + * Every trusted implementation this executable registered must be named + * by some authored manifest [[plugin]] id, or the plan can never activate + * it. Exit 0 when all are declared, 1 otherwise (ctest per title). */ + for (int i = 1; i < argc; i++) { + if (std::strcmp(argv[i], "--audit-mod-plugins") != 0) continue; + std::vector roots; + for (int j = i + 1; j < argc && std::strncmp(argv[j], "--", 2) != 0; j++) + roots.emplace_back(argv[j]); + const PSXRecompV4::ModPluginAudit audit = + PSXRecompV4::mod_audit_registered_plugins(roots); + const std::vector registered = + PSXRecompV4::mod_registered_plugin_ids(); + std::fprintf(stdout, "mod plugin audit: %zu manifest(s), %zu declared id(s), " + "%zu registered id(s)\n", audit.manifests, + audit.declared.size(), registered.size()); + for (const std::string& e : audit.errors) + std::fprintf(stdout, " manifest error: %s\n", e.c_str()); + for (const std::string& id : audit.undeclared) + std::fprintf(stdout, " UNDECLARED (can never run): %s\n", id.c_str()); + const bool ok = roots.size() > 0 && audit.errors.empty() && + audit.undeclared.empty(); + std::fprintf(stdout, "mod plugin audit: %s\n", ok ? "PASS" : "FAIL"); + return ok ? 0 : 1; + } + /* Setup-host zip-root exe: after Generate & rebuild, hand off to the * product binary under build-release/ (bios/, mods/, assets/, settings). */ #if defined(PSX_HAS_CODEGEN_SETUP_HOST) @@ -12938,6 +13044,18 @@ int main(int argc, char** argv) { addresses.data(), expected.data(), results.data(), (int)addresses.size()); } + { + std::vector addresses, expected, operands, halves; + for (const auto& site : gc.ws_cull_scale_sites) { + addresses.push_back(site.address); + expected.push_back(site.expected); + operands.push_back(site.operand); + halves.push_back(site.half_extent); + } + gpu_ws_set_cull_scale_sites( + addresses.data(), expected.data(), operands.data(), + halves.data(), (int)addresses.size()); + } { std::vector addresses, expected; addresses.reserve(gc.ws_cull_angle_sites.size()); @@ -14824,13 +14942,20 @@ session_reboot: } else { /* Select the renderer backend BEFORE gpu_init() (which runs gr_init -> * the backend's init on the VRAM buffer). Software is the default and - * the fallback; an unavailable OpenGL backend reverts to software. */ - gr_set_backend(g_video_renderer == 2 ? GR_BACKEND_VULKAN : - g_video_renderer == 1 ? GR_BACKEND_OPENGL : - GR_BACKEND_SOFTWARE); - std::fprintf(stdout, "psxrecomp: renderer backend requested: %s\n", - g_video_renderer == 2 ? "vulkan" : - g_video_renderer == 1 ? "opengl" : "software"); + * the fallback; an unavailable OpenGL backend reverts to software. + * Headless never creates a window or GPU context, so a GPU backend + * would only rasterize through its software fallback while refusing + * the context-bound services (native-wide compositing, hi-res + * readback). Select the software backend it would really run, so + * headless validation exercises the same wide compositor as a window. */ + const int backend_renderer = g_headless ? 0 : g_video_renderer; + gr_set_backend(backend_renderer == 2 ? GR_BACKEND_VULKAN : + backend_renderer == 1 ? GR_BACKEND_OPENGL : + GR_BACKEND_SOFTWARE); + std::fprintf(stdout, "psxrecomp: renderer backend requested: %s%s\n", + backend_renderer == 2 ? "vulkan" : + backend_renderer == 1 ? "opengl" : "software", + g_headless && g_video_renderer != 0 ? " (headless)" : ""); } gpu_init(); /* Internal-resolution supersampling (SSAA). Must follow gpu_init. @@ -14921,10 +15046,12 @@ session_reboot: /* Present-time screen-colour model (verified-enhancement LUT). Default raw * is byte-identical; PSX_SCREEN env overrides this at scanout. */ gpu_set_screen_kind(g_video_screen); - if (g_video_scale > 1 || g_video_texfilter) + /* Report the REQUESTED scale: the GL backend's effective scale is only + * known once its context exists (it logs "internal scale Nx" then). */ + if (requested_scale > 1 || g_video_texfilter) std::fprintf(stdout, - "psxrecomp: supersampling %dx (antialiasing %s, texture filter %s)\n", - g_video_scale, g_video_aa ? "on" : "off", + "psxrecomp: supersampling %dx requested (antialiasing %s, texture filter %s)\n", + requested_scale, g_video_aa ? "on" : "off", g_video_texfilter ? "bilinear" : "nearest"); if (g_video_screen != 0) std::fprintf(stdout, "psxrecomp: screen-colour model %s\n", diff --git a/runtime/src/mod_media.cpp b/runtime/src/mod_media.cpp new file mode 100644 index 00000000..b5793afd --- /dev/null +++ b/runtime/src/mod_media.cpp @@ -0,0 +1,118 @@ +#include "mod_media.h" +#include "iso_reader.h" +#include "psx_sha256.h" + +#include +#include +#include +#include +#include + +namespace PSXRecompV4 { +namespace { +constexpr uint64_t kMaxMediaBytes = 512ull * 1024 * 1024; + +uint32_t le32(const uint8_t* p) { + return uint32_t(p[0]) | (uint32_t(p[1]) << 8) | + (uint32_t(p[2]) << 16) | (uint32_t(p[3]) << 24); +} +uint32_t be32(const uint8_t* p) { + return uint32_t(p[3]) | (uint32_t(p[2]) << 8) | + (uint32_t(p[1]) << 16) | (uint32_t(p[0]) << 24); +} + +void read_disc_sector(PS1::ISOReader& reader, uint32_t lba, uint8_t* out) { + std::array raw{}; + if (reader.ReadRawSector(lba, raw.data())) { + if (raw[15] != 1 && raw[15] != 2) + throw std::runtime_error("donor volume contains a non-data sector"); + std::memcpy(out, raw.data() + (raw[15] == 1 ? 16 : 24), 2048); + } else if (!reader.ReadSector(lba, out)) { + throw std::runtime_error("cannot read donor volume sector"); + } +} +} // namespace + +bool load_mod_media(const std::filesystem::path& path, + const std::string& format, uint64_t expected_size, + const std::string& expected_sha256, + std::shared_ptr>& bytes, + std::string* error) { + bytes.reset(); + if (error) error->clear(); + try { + if (!expected_size || expected_size > kMaxMediaBytes || + expected_sha256.size() != 64 || + !std::all_of(expected_sha256.begin(), expected_sha256.end(), + [](char c) { return (c >= '0' && c <= '9') || + (c >= 'a' && c <= 'f'); })) + throw std::runtime_error("invalid donor size or SHA-256"); + auto data = std::make_shared>(); + if (format == "psx-disc") { + PS1::ISOReader reader; + if (!reader.Open(path.string())) + throw std::runtime_error("cannot open donor disc"); + std::array pvd{}; + read_disc_sector(reader, 16, pvd.data()); + if (pvd[0] != 1 || std::memcmp(pvd.data() + 1, "CD001", 5) || + pvd[6] != 1 || pvd[128] != 0 || pvd[129] != 8 || + pvd[130] != 8 || pvd[131] != 0) + throw std::runtime_error("donor disc is not a 2048-byte ISO9660 volume"); + const uint32_t declared_count = le32(pvd.data() + 80); + /* Retail mixed-mode discs may declare the whole disc, including + * audio, as their ISO volume size. The actual data-track boundary + * comes from the TOC or the single-file image length. */ + const uint32_t count = reader.TrackCount() > 1 + ? reader.TrackPregapLBA(2) : reader.GetSectorCount(); + if (reader.TrackIsAudio(1) || reader.TrackStartLBA(1) != 0 || + declared_count != be32(pvd.data() + 84) || declared_count < count || + count <= 16 || uint64_t(count) * 2048 != expected_size) + throw std::runtime_error("donor data-track size does not match"); + data->resize(static_cast(expected_size)); + for (uint32_t i = 0; i < count; ++i) + read_disc_sector(reader, i, data->data() + size_t(i) * 2048); + } else if (format == "file" || format == "n64-rom") { + if (std::filesystem::file_size(path) != expected_size) + throw std::runtime_error("donor file size does not match"); + if (format == "n64-rom" && + (expected_size < 64 || expected_size % 4 || expected_size > 64ull * 1024 * 1024)) + throw std::runtime_error("invalid N64 ROM size"); + std::ifstream input(path, std::ios::binary); + data->resize(static_cast(expected_size)); + if (!input.read(reinterpret_cast(data->data()), + static_cast(expected_size)) || + input.peek() != std::char_traits::eof()) + throw std::runtime_error("cannot read complete donor file"); + if (format == "n64-rom") { + const uint32_t magic = be32(data->data()); + if (magic == 0x37804012) { + for (size_t i = 0; i < data->size(); i += 2) + std::swap((*data)[i], (*data)[i + 1]); + } else if (magic == 0x40123780) { + for (size_t i = 0; i < data->size(); i += 4) + std::reverse(data->begin() + i, data->begin() + i + 4); + } else if (magic != 0x80371240) { + throw std::runtime_error("unrecognized N64 ROM byte order"); + } + } + } else { + throw std::runtime_error("unsupported donor media format"); + } + uint8_t digest[32]; + psx_sha256_compute(data->data(), data->size(), digest); + static const char hex[] = "0123456789abcdef"; + std::string actual(64, '0'); + for (size_t i = 0; i < 32; ++i) { + actual[i * 2] = hex[digest[i] >> 4]; + actual[i * 2 + 1] = hex[digest[i] & 15]; + } + if (actual != expected_sha256) + throw std::runtime_error("donor SHA-256 does not match"); + bytes = std::move(data); + return true; + } catch (const std::exception& e) { + if (error) *error = e.what(); + return false; + } +} +} // namespace PSXRecompV4 diff --git a/runtime/src/mod_packages.cpp b/runtime/src/mod_packages.cpp index d6196dab..c417135f 100644 --- a/runtime/src/mod_packages.cpp +++ b/runtime/src/mod_packages.cpp @@ -2,6 +2,7 @@ #include "crc32.h" #include "mod_plugins.h" +#include "mod_media.h" #include "psx_sha256.h" #include "toml.hpp" @@ -23,7 +24,7 @@ namespace PSXRecompV4 { namespace { constexpr uint32_t kMinFormatVersion = 1; -constexpr uint32_t kMaxFormatVersion = 7; +constexpr uint32_t kMaxFormatVersion = 8; constexpr uint64_t kMaxArchiveBytes = 256ull * 1024ull * 1024ull; constexpr uint32_t kMaxArchiveFiles = 4096; @@ -760,7 +761,13 @@ std::string canonical_resolution(const std::vector& ordered, } for (const ModResolution::Resource& resource : resources) { out << "resource:" << resource.package_id << ':' << resource.feature_id - << ':' << resource.id << '=' << resource.path.string() << '\n'; + << ':' << resource.id << '='; + if (resource.bytes) + out << resource.format << ':' << resource.bytes->size() << ':' + << resource.sha256; + else + out << resource.path.string(); + out << '\n'; } return out.str(); } @@ -1496,6 +1503,47 @@ void mod_clear_plugins_for_tests() { registered_plugins().clear(); } +std::vector mod_registered_plugin_ids() { + std::vector ids; + for (const auto& entry : registered_plugins()) + if (entry.second.activation || entry.second.vblank || + !entry.second.function_entries.empty()) + ids.push_back(entry.first); + return ids; /* std::map keeps them sorted */ +} + +ModPluginAudit mod_audit_registered_plugins( + const std::vector& manifest_roots) { + ModPluginAudit audit; + std::set declared; + for (const fs::path& root : manifest_roots) { + std::error_code ec; + if (!fs::is_directory(root, ec)) { + audit.errors.push_back(root.string() + ": not a directory"); + continue; + } + for (fs::recursive_directory_iterator it(root, ec), end; + !ec && it != end; it.increment(ec)) { + if (!it->is_regular_file(ec) || it->path().filename() != "manifest.toml") + continue; + ModPackage package; + std::string error; + if (!ModPackageManager::read_manifest(it->path(), package, &error)) { + audit.errors.push_back(it->path().string() + ": " + error); + continue; + } + ++audit.manifests; + for (const ModPlugin& plugin : package.plugins) + declared.insert(plugin.id); + } + if (ec) audit.errors.push_back(root.string() + ": " + ec.message()); + } + audit.declared.assign(declared.begin(), declared.end()); + for (const std::string& id : mod_registered_plugin_ids()) + if (!declared.count(id)) audit.undeclared.push_back(id); + return audit; +} + const char* mod_channel_name(ModChannel channel) { switch (channel) { case ModChannel::Experimental: return "experimental"; @@ -1795,6 +1843,19 @@ bool ModPackageManager::read_manifest(const fs::path& path, ModPackage& out, toml::find_or(v, "format", "file"); resource.required = toml::find_or(v, "required", false); + if (v.contains("size") || v.contains("sha256") || + resource.format == "n64-rom" || resource.format == "psx-disc") { + if (out.format_version < 8) + throw std::runtime_error("verified media requires format_version 8"); + const int64_t size = toml::find(v, "size"); + resource.sha256 = toml::find(v, "sha256"); + if (size <= 0 || size > 512ll * 1024 * 1024 || + !valid_sha256(resource.sha256) || + (resource.format != "file" && resource.format != "n64-rom" && + resource.format != "psx-disc")) + throw std::runtime_error("invalid verified media identity or format"); + resource.size = static_cast(size); + } if (!find_feature(out, resource.feature_id)) throw std::runtime_error( "resource references unknown feature"); @@ -1807,9 +1868,11 @@ bool ModPackageManager::read_manifest(const fs::path& path, ModPackage& out, throw std::runtime_error("resource label is empty"); if (resource.format != "file" && resource.format != "directory" && - resource.format != "folder") + resource.format != "folder" && + resource.format != "n64-rom" && + resource.format != "psx-disc") throw std::runtime_error( - "resource format must be file or directory"); + "unsupported resource format"); out.resources.push_back(std::move(resource)); } } @@ -3692,6 +3755,17 @@ ModResolution ModPackageManager::resolve(const std::string& game_id, resolved.feature_id = resource.feature_id; resolved.id = resource.id; resolved.path = path; + resolved.format = resource.format; + resolved.sha256 = resource.sha256; + if (!resource.sha256.empty()) { + std::string media_error; + if (!load_mod_media(path, resource.format, resource.size, + resource.sha256, resolved.bytes, &media_error)) { + result.errors.push_back(package->id + "/" + resource.feature_id + + ": " + resource.id + ": " + media_error); + continue; + } + } result.resources.push_back(std::move(resolved)); } } diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index d5600377..fb1a8149 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -53,6 +53,8 @@ extern "C" int fntrace_is_game_started(void); /* Declared in mod_plugins.h; see active_function_entry_hooks() below. */ uint32_t g_psx_mod_function_entry_hooks = 0; +/* Guest vblanks seen by the mod runtime: the plugin counters' time base. */ +static uint64_t g_mod_vblanks = 0; namespace PSXRecompV4 { namespace { @@ -1422,6 +1424,7 @@ extern "C" void mod_runtime_activate_plugins(void) { extern "C" void mod_runtime_on_vblank(void) { using namespace PSXRecompV4; + ++g_mod_vblanks; RuntimeMods& s = state(); if (!s.initialized || !s.plan.ok) return; for (const ModResolution::Plugin& plugin : s.plan.plugins) { @@ -1484,6 +1487,27 @@ extern "C" uint8_t psx_mod_read_byte(uint32_t address) { return psx_read_byte(address); } +extern "C" int psx_mod_current_resource_bytes(const char* resource_id, + const uint8_t** bytes, + uint64_t* size) { + using namespace PSXRecompV4; + if (bytes) *bytes = nullptr; + if (size) *size = 0; + if (!resource_id || !*resource_id || !bytes || !size) return 0; + const auto& s = state(); + if (!s.initialized || !s.plan.ok || !s.current_plugin) return 0; + for (const auto& resource : s.plan.resources) { + if (resource.package_id == s.current_plugin->package_id && + resource.feature_id == s.current_plugin->feature_id && + resource.id == resource_id && resource.bytes) { + *bytes = resource.bytes->data(); + *size = resource.bytes->size(); + return 1; + } + } + return 0; +} + extern "C" void psx_mod_write_byte(uint32_t address, uint8_t value) { psx_write_byte(address, value); } @@ -1519,6 +1543,53 @@ extern "C" uint32_t psx_mod_alloc_gpu_dma_memory(uint32_t size, return psx_mod_gpu_dma_memory_alloc(size, alignment); } +namespace { +struct ModCounter { + const char* name = nullptr; /* caller literal; compared by content */ + uint64_t count = 0; + uint64_t last_frame = 0; +}; +constexpr size_t kModCounterCap = 128; +ModCounter g_mod_counters[kModCounterCap]; +size_t g_mod_counter_count = 0; +uint64_t g_mod_counter_overflow = 0; +} // namespace + +extern "C" void psx_mod_counter_add(const char* name, uint32_t delta) { + if (!name || !name[0]) return; + for (size_t i = 0; i < g_mod_counter_count; i++) { + ModCounter& c = g_mod_counters[i]; + if (c.name == name || std::strcmp(c.name, name) == 0) { + c.count += delta; + c.last_frame = g_mod_vblanks; + return; + } + } + if (g_mod_counter_count == kModCounterCap) { + g_mod_counter_overflow += delta; + return; + } + ModCounter& c = g_mod_counters[g_mod_counter_count++]; + c.name = name; + c.count = delta; + c.last_frame = g_mod_vblanks; +} + +/* Debug-server accessor: copies up to `cap` entries; returns the total count + * of distinct counters and writes the overflow bucket. */ +extern "C" int psx_mod_counters_snapshot(const char** names, uint64_t* counts, + uint64_t* last_frames, int cap, + uint64_t* overflow) { + const int n = (int)g_mod_counter_count; + for (int i = 0; i < n && i < cap; i++) { + names[i] = g_mod_counters[i].name; + counts[i] = g_mod_counters[i].count; + last_frames[i] = g_mod_counters[i].last_frame; + } + if (overflow) *overflow = g_mod_counter_overflow; + return n; +} + extern "C" int32_t psx_mod_widescreen_x_margin(void) { return (int32_t)psx_ws_x_margin(); } diff --git a/runtime/src/overlay_loader.c b/runtime/src/overlay_loader.c index cac04bb4..d3deebc7 100644 --- a/runtime/src/overlay_loader.c +++ b/runtime/src/overlay_loader.c @@ -2511,6 +2511,14 @@ static void init_callbacks(void) { extern uint32_t psx_ws_angle_widen(uint32_t vanilla); s_callbacks.ws_angle_widen = psx_ws_angle_widen; } + { + extern int32_t psx_ws_cull_scale(int32_t bound, int32_t half_extent); + s_callbacks.ws_cull_scale = psx_ws_cull_scale; + } + { + extern int32_t gte_nclip_exact_sign(int32_t native_mac0, uint32_t pc); + s_callbacks.nclip_exact_sign = gte_nclip_exact_sign; + } /* PGXP dataflow-shadowing hook table (pgxp_hooks.h, appended last). * Referenced only by pgxp-flavour shards; the flavor half of the ABI * tag already rejects any host/DLL flavor mix, and a NULL table on an diff --git a/runtime/src/present_image_ring.c b/runtime/src/present_image_ring.c new file mode 100644 index 00000000..8ed55839 --- /dev/null +++ b/runtime/src/present_image_ring.c @@ -0,0 +1,137 @@ +#include "present_image_ring.h" + +#include +#include + +typedef struct { + uint32_t frame; + uint16_t w; + uint8_t valid; + uint16_t *px; /* PRESENT_IMAGE_RING_MAX_W * PRESENT_IMAGE_RING_H, RGB565 */ +} PresentImage; + +static PresentImage s_ring[PRESENT_IMAGE_RING_CAP]; +static uint16_t *s_pixels = NULL; +static uint32_t s_head = 0; +static int s_enabled = -1; +static int s_frozen = 0; + +static int ring_ready(void) { + if (s_enabled < 0) { + const char *e = getenv("PSX_PRESENT_IMAGE_RING"); + s_enabled = (!e || !*e || *e != '0') ? 1 : 0; + } + if (!s_enabled) return 0; + if (!s_pixels) { + const size_t per = (size_t)PRESENT_IMAGE_RING_MAX_W * PRESENT_IMAGE_RING_H; + s_pixels = (uint16_t *)calloc((size_t)PRESENT_IMAGE_RING_CAP * per, sizeof(uint16_t)); + if (!s_pixels) { s_enabled = 0; return 0; } + for (int i = 0; i < PRESENT_IMAGE_RING_CAP; i++) + s_ring[i].px = s_pixels + (size_t)i * per; + } + return 1; +} + +int present_image_ring_thumb_w(int ww, int wh) { + if (ww <= 0 || wh <= 0) return 0; + long w = ((long)ww * PRESENT_IMAGE_RING_H + wh / 2) / wh; + if (w < 1) w = 1; + if (w > PRESENT_IMAGE_RING_MAX_W) w = PRESENT_IMAGE_RING_MAX_W; + return (int)w; +} + +int present_image_ring_accepting(void) { + return !s_frozen && ring_ready(); +} + +static PresentImage *next_slot(uint32_t frame, int w) { + PresentImage *e = &s_ring[s_head]; + s_head = (s_head + 1) % PRESENT_IMAGE_RING_CAP; + e->frame = frame; + e->w = (uint16_t)w; + e->valid = 1; + return e; +} + +static uint16_t pack565(unsigned r, unsigned g, unsigned b) { + return (uint16_t)(((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3)); +} + +void present_image_ring_push(uint32_t frame, const uint8_t *rgba, int w, + int pitch, int bottom_up) { + if (!rgba || w <= 0 || w > PRESENT_IMAGE_RING_MAX_W) return; + if (!present_image_ring_accepting()) return; + PresentImage *e = next_slot(frame, w); + for (int y = 0; y < PRESENT_IMAGE_RING_H; y++) { + const int sy = bottom_up ? (PRESENT_IMAGE_RING_H - 1 - y) : y; + const uint8_t *src = rgba + (size_t)sy * pitch; + uint16_t *dst = e->px + (size_t)y * w; + for (int x = 0; x < w; x++) + dst[x] = pack565(src[4 * x], src[4 * x + 1], src[4 * x + 2]); + } +} + +void present_image_ring_push_argb(uint32_t frame, const uint32_t *argb, + int sw, int sh, int src_pitch_px) { + if (!argb || sw <= 0 || sh <= 0) return; + if (!present_image_ring_accepting()) return; + const int w = present_image_ring_thumb_w(sw, sh); + PresentImage *e = next_slot(frame, w); + for (int y = 0; y < PRESENT_IMAGE_RING_H; y++) { + const int y0 = (int)((long)y * sh / PRESENT_IMAGE_RING_H); + int y1 = (int)((long)(y + 1) * sh / PRESENT_IMAGE_RING_H); + if (y1 <= y0) y1 = y0 + 1; + for (int x = 0; x < w; x++) { + const int x0 = (int)((long)x * sw / w); + int x1 = (int)((long)(x + 1) * sw / w); + if (x1 <= x0) x1 = x0 + 1; + unsigned r = 0, g = 0, b = 0, n = 0; + for (int yy = y0; yy < y1 && yy < sh; yy++) + for (int xx = x0; xx < x1 && xx < sw; xx++) { + const uint32_t p = argb[(size_t)yy * src_pitch_px + xx]; + r += (p >> 16) & 0xFF; g += (p >> 8) & 0xFF; b += p & 0xFF; n++; + } + if (!n) n = 1; + e->px[(size_t)y * w + x] = pack565(r / n, g / n, b / n); + } + } +} + +void present_image_ring_set_frozen(int frozen) { s_frozen = frozen ? 1 : 0; } +int present_image_ring_frozen(void) { return s_frozen; } + +void present_image_ring_span(uint32_t *oldest, uint32_t *newest, int *count) { + uint32_t lo = UINT32_MAX, hi = 0; + int n = 0; + for (int i = 0; i < PRESENT_IMAGE_RING_CAP; i++) { + if (!s_ring[i].valid) continue; + n++; + if (s_ring[i].frame < lo) lo = s_ring[i].frame; + if (s_ring[i].frame > hi) hi = s_ring[i].frame; + } + if (oldest) *oldest = n ? lo : 0; + if (newest) *newest = hi; + if (count) *count = n; +} + +int present_image_ring_get_rgb(uint32_t frame, uint8_t **rgb, int *w, int *h) { + if (!rgb || !s_pixels) return 0; + for (int i = 0; i < PRESENT_IMAGE_RING_CAP; i++) { + const PresentImage *e = &s_ring[i]; + if (!e->valid || e->frame != frame) continue; + const size_t n = (size_t)e->w * PRESENT_IMAGE_RING_H; + uint8_t *out = (uint8_t *)malloc(n * 3); + if (!out) return 0; + for (size_t k = 0; k < n; k++) { + const uint16_t p = e->px[k]; + out[3 * k] = (uint8_t)(((p >> 11) & 31) << 3); + out[3 * k + 1] = (uint8_t)(((p >> 5) & 63) << 2); + out[3 * k + 2] = (uint8_t)((p & 31) << 3); + } + *rgb = out; + if (w) *w = e->w; + if (h) *h = PRESENT_IMAGE_RING_H; + return 1; + } + return 0; +} diff --git a/runtime/src/savestate.c b/runtime/src/savestate.c index c9b42d53..4ad83d21 100644 --- a/runtime/src/savestate.c +++ b/runtime/src/savestate.c @@ -649,7 +649,11 @@ static int netplay_user_blocked(void) { } static int request_save_inner(int slot) { - if (!s_configured) { fprintf(stderr, "savestate: not configured\n"); return 0; } + if (!s_configured) { + fprintf(stderr, "savestate: not configured\n"); + psx_frontend_on_savestate_refused(0, slot, "Save states are not available yet"); + return 0; + } if (slot < 0 || slot >= SAVESTATE_SLOTS) return 0; s_save_failed = 0; s_last_save_pc = 0; /* block netplay transfer until this write stamps a PC */ @@ -662,13 +666,19 @@ static int request_save_inner(int slot) { } static int request_load_inner(int slot) { - if (!s_configured) { fprintf(stderr, "savestate: not configured\n"); return 0; } + if (!s_configured) { + fprintf(stderr, "savestate: not configured\n"); + psx_frontend_on_savestate_refused(1, slot, "Save states are not available yet"); + return 0; + } if (slot < 0 || slot >= SAVESTATE_SLOTS) return 0; if (!psx_hle_scheduler_enabled()) { /* LLE (host-fiber) mode: the restore longjmp target lives on the * scheduler fiber; cross-fiber unwind is unsafe. HLE is the default. */ fprintf(stderr, "savestate: load requires the HLE scheduler (default); " "PSX_HLE_SCHEDULER=0 run cannot load states.\n"); + psx_frontend_on_savestate_refused(1, slot, + "Cannot load: this run uses the legacy thread scheduler"); return 0; } s_load_failed = 0; diff --git a/runtime/tests/overlay_pair_dedup_harness.c b/runtime/tests/overlay_pair_dedup_harness.c index 4fc6e554..334cb2ba 100644 --- a/runtime/tests/overlay_pair_dedup_harness.c +++ b/runtime/tests/overlay_pair_dedup_harness.c @@ -181,6 +181,13 @@ void psx_mod_function_entry(CPUState *cpu, uint32_t address) { int psx_netplay_is_resimulating(void) { return 0; } int psx_game_text_native_ok(uint32_t address) { (void)address; return 1; } uint32_t psx_ws_angle_widen(uint32_t vanilla) { return vanilla; } +int32_t psx_ws_cull_scale(int32_t bound, int32_t half_extent) { + (void)half_extent; return bound; +} +int32_t gte_nclip_exact_sign(int32_t native_mac0, uint32_t pc) { + (void)pc; + return native_mac0 < 0 ? -1 : (native_mac0 > 0 ? 1 : 0); +} uint32_t psx_ws_cull_keep_result(uint32_t vanilla, uint32_t forced) { (void)forced; return vanilla; } diff --git a/runtime/tests/test_gl_readback_region.c b/runtime/tests/test_gl_readback_region.c index 9d9f733a..9355cc77 100644 --- a/runtime/tests/test_gl_readback_region.c +++ b/runtime/tests/test_gl_readback_region.c @@ -1,6 +1,10 @@ /* Original source-owned GL readback-coherence regression. No retail payload. */ #include "gpu_gl_renderer.c" #include "mod_texture_banks.c" +#include "gpu_timeline.c" +uint64_t psx_cycle_count=0; +static int test_full_composite; +int gpu_ws_background_requires_full_composite(void){return test_full_composite;} uint32_t psx_mod_gpu_dma_memory_alloc(uint32_t n,uint32_t a){(void)n;(void)a;return 0;} uint32_t psx_mod_read_word(uint32_t a){(void)a;return 0;} static uint16_t image[1024*512], oracle[1024*512]; @@ -60,6 +64,28 @@ static void verify_bank_batching(void) { psx_mod_set_texture_bank_batching(0);s_tex_filter=0; glb_set_mask_bits(0,0);glb_set_semi_transparency(0,0); } +/* Native-wide, vertically double-buffered (both bands in ONE wide surface): + * a full-width flat rect takes the full-screen-overlay wide pass. It spans + * above its draw area; canonical VRAM clips it at the band top, and the wide + * surface must clip it there too instead of painting the other band. */ +static void verify_wide_overlay_band(void) { + const int S=s_scale,W=426*S,H=512*S; + uint32_t *wide=(uint32_t*)malloc((size_t)W*H*sizeof(uint32_t)); + int ow=0,oh=0; + check(wide!=NULL,"wide dump alloc");if(!wide)return; + glb_set_draw_area(0,0,1023,511); + glb_wide_configure(426,53);glb_wide_set_target(0); + glb_wide_clear(0,0,512,0x0421); + glb_set_draw_area(0,240,319,479); + glb_draw_flat_rect(0,158,320,322,0x001f);flush_flat_batch(); + check(glb_wide_dump_full(wide,W*H,&ow,&oh,0)>0&&ow==W&&oh==H,"wide surface dump"); + const uint32_t other=wide[(200*S)*W+5*S],edge=wide[(239*S+S-1)*W+420*S],drawn=wide[(240*S)*W+5*S]; + check(((other>>16)&0xff)<0x20,"overlay rect leaves the other band's margin"); + check(((edge>>16)&0xff)<0x20,"overlay rect stops at the draw-area top row"); + check(((drawn>>16)&0xff)>=0xf0,"overlay rect covers its own band's margin"); + free(wide); + glb_set_draw_area(0,0,1023,511);glb_wide_disable_target();glb_wide_configure(0,0); +} int main(int argc,char **argv){ int scale=argc>1?atoi(argv[1]):1; if(SDL_Init(SDL_INIT_VIDEO)!=0)return 2; @@ -127,6 +153,8 @@ int main(int argc,char **argv){ check(glb_vram_read(302,252)==0x001f,"retained 16-bit texel"); verify("retained banks and original VRAM ordered together"); verify_bank_batching(); + for(test_full_composite=0;test_full_composite<2;test_full_composite++)verify_wide_overlay_band(); + test_full_composite=0; printf("checks=%d failures=%d\n",checks,failures); gl_renderer_shutdown();SDL_DestroyWindow(win);SDL_Quit();return failures?1:0; } diff --git a/runtime/tests/test_gte_register_access.cpp b/runtime/tests/test_gte_register_access.cpp index 0d6415d7..b365797c 100644 --- a/runtime/tests/test_gte_register_access.cpp +++ b/runtime/tests/test_gte_register_access.cpp @@ -1,5 +1,6 @@ #include "cpu_state.h" #include "gte.h" +#include "gte_nclip_stats.h" #include #include @@ -52,6 +53,7 @@ extern "C" void gpu_pgxp_rederive_enable(void) {} extern "C" void psx_ws_note_gte_project(int) {} extern "C" { uint64_t s_frame_count = 0; +uint32_t g_debug_last_store_pc = 0; } uint64_t g_test_cycle = 0; @@ -596,6 +598,8 @@ int test_precise_nclip_is_title_scoped() { cpu.gte_data[12 + i] = packed[i]; gte_test_seed_precise_projection(i, packed[i], x16[i], y16[i], 100); } + gte_nclip_stats_reset(); + g_debug_last_store_pc = 0x80012340u; uint64_t hit0 = 0, fallback0 = 0, disagree0 = 0; gte_nclip_precise_stats(&hit0, &fallback0, &disagree0); gte_execute(&cpu, 0x06u); @@ -605,9 +609,34 @@ int test_precise_nclip_is_title_scoped() { fallback1 != fallback0 || disagree1 != disagree0 + 1u) return fail_value("precise NCLIP preserves guest MAC0", 0, 0x06u, 0, 1u, cpu.gte_data[24]); - if (!gte_nclip_precise_bltz(1) || gte_nclip_precise_bltz(2)) + /* The branch consumer sees the precise (negative) sign only for the MAC0 + * the NCLIP produced; any other value keeps its native sign. Every branch + * shape tests this one sign. */ + if (gte_nclip_exact_sign(1, 0x80011000u) != -1 || + gte_nclip_exact_sign(2, 0x80011000u) != 1 || + gte_nclip_exact_sign(0, 0x80011004u) != 0) return fail_value("title-scoped precise NCLIP predicate", 0, 0x06u, 0, 1u, 0u); + { + GteNclipSiteStat sites[GTE_NCLIP_STAT_CAP]; + const int n = gte_nclip_site_stats(sites, GTE_NCLIP_STAT_CAP); + uint32_t evals = 0, flips = 0, falls = 0; + for (int i = 0; i < n; ++i) + if (sites[i].pc == 0x80011000u) { + evals = sites[i].evals; flips = sites[i].flips; + falls = sites[i].fallbacks; + } + if (evals != 2u || flips != 1u || falls != 1u) + return fail_value("exact NCLIP site attribution", 0, 0x06u, + 0, 2u, evals); + GteNclipFuncStat funcs[GTE_NCLIP_STAT_CAP]; + const int nf = gte_nclip_func_stats(funcs, GTE_NCLIP_STAT_CAP); + uint32_t fn = 0, fd = 0; + for (int i = 0; i < nf; ++i) + if (funcs[i].func == 0x80012340u) { fn = funcs[i].nclips; fd = funcs[i].disagree; } + if (fn != 1u || fd != 1u) + return fail_value("NCLIP producer attribution", 0, 0x06u, 0, 1u, fn); + } /* A stale packed-word shadow must fail closed to the native sign and count * as a fallback, never as a precise hit. */ @@ -619,7 +648,7 @@ int test_precise_nclip_is_title_scoped() { g_test_precise_nclip_enabled = 0; if (cpu.gte_data[24] != 1u || hit2 != hit1 || fallback2 != fallback1 + 1u || disagree2 != disagree1 || - gte_nclip_precise_bltz(1)) + gte_nclip_exact_sign(1, 0x80011000u) != 1) return fail_value("stale precise NCLIP falls back natively", 0, 0x06u, 0, 1u, cpu.gte_data[24]); return 0; diff --git a/runtime/tests/test_host_keymap.c b/runtime/tests/test_host_keymap.c index 4a3afe52..d1839e81 100644 --- a/runtime/tests/test_host_keymap.c +++ b/runtime/tests/test_host_keymap.c @@ -30,6 +30,15 @@ int main(int argc, char **argv) { "default fullscreen includes Alt+Return"); check(host_keymap_match(HOST_KEYMAP_FULLSCREEN, (int)SDLK_f, mod_ctrl()), "default fullscreen includes Ctrl+F"); + /* A real key event carries only one side's modifier bit. */ + check(host_keymap_match(HOST_KEYMAP_FULLSCREEN, (int)SDLK_f, (int)KMOD_LCTRL), + "Ctrl+F matches a left-Ctrl-only press"); + check(host_keymap_match(HOST_KEYMAP_FULLSCREEN, (int)SDLK_RETURN, (int)KMOD_RALT), + "Alt+Return matches a right-Alt-only press"); + check(host_keymap_match(HOST_KEYMAP_CAPTURE_MARK, (int)SDLK_m, (int)KMOD_LCTRL), + "default capture mark is Ctrl+M"); + check(!host_keymap_match(HOST_KEYMAP_CAPTURE_MARK, (int)SDLK_m, 0), + "plain M does not trigger the capture mark"); keys[SDL_SCANCODE_TAB] = 1; check(host_keymap_down(HOST_KEYMAP_TURBO, keys, 0), "default turbo is held by Tab"); diff --git a/runtime/tests/test_mod_media.cpp b/runtime/tests/test_mod_media.cpp new file mode 100644 index 00000000..bb574b0a --- /dev/null +++ b/runtime/tests/test_mod_media.cpp @@ -0,0 +1,116 @@ +#include "mod_media.h" +#include "psx_sha256.h" +#include +#include +#include +#include +#include + +namespace fs = std::filesystem; +using namespace PSXRecompV4; +static int failures; +static void check(bool ok, const char* text) { + if (!ok) { std::cerr << "FAIL: " << text << '\n'; ++failures; } +} +static void write(const fs::path& path, const std::vector& bytes) { + std::ofstream out(path, std::ios::binary); + out.write(reinterpret_cast(bytes.data()), bytes.size()); +} +static std::string hash(const std::vector& bytes) { + uint8_t digest[32]; + psx_sha256_compute(bytes.data(), bytes.size(), digest); + std::string result; + for (uint8_t byte : digest) { + result += "0123456789abcdef"[byte >> 4]; + result += "0123456789abcdef"[byte & 15]; + } + return result; +} +int main(int argc, char** argv) { + std::shared_ptr> bytes; + std::string error; + if (argc == 5) { + const bool ok = load_mod_media(argv[1], argv[2], std::stoull(argv[3]), argv[4], bytes, &error); + if (!ok) { std::cerr << error << '\n'; return 1; } + std::cout << "verified bytes=" << bytes->size() << " sha256=" << hash(*bytes) << '\n'; + return 0; + } + const fs::path root = fs::temp_directory_path() / "psxrecomp-mod-media-test"; + fs::create_directories(root); + std::vector rom(64); + for (size_t i = 0; i < rom.size(); ++i) rom[i] = static_cast(i); + rom[0] = 0x80; rom[1] = 0x37; rom[2] = 0x12; rom[3] = 0x40; + const auto rom_hash = hash(rom); + const auto path = root / "rom.z64"; + write(path, rom); + check(load_mod_media(path, "n64-rom", rom.size(), rom_hash, bytes, &error) && *bytes == rom, + "canonical N64 bytes"); + auto snapshot = bytes; + auto swapped = rom; + for (size_t i = 0; i < swapped.size(); i += 2) std::swap(swapped[i], swapped[i + 1]); + write(path, swapped); + check(load_mod_media(path, "n64-rom", rom.size(), rom_hash, bytes, &error) && *bytes == rom, + "halfword swapped N64 identity"); + swapped = rom; + for (size_t i = 0; i < swapped.size(); i += 4) + std::reverse(swapped.begin() + i, swapped.begin() + i + 4); + write(path, swapped); + check(load_mod_media(path, "n64-rom", rom.size(), rom_hash, bytes, &error) && *bytes == rom, + "word swapped N64 identity"); + swapped[32] ^= 1; + write(path, swapped); + check(!load_mod_media(path, "n64-rom", rom.size(), rom_hash, bytes, &error) && !bytes, + "same-size wrong media rejected without exposing bytes"); + check(*snapshot == rom, "snapshot survives on-disk changes"); + check(!load_mod_media(path, "n64-rom", rom.size() + 4, rom_hash, bytes, &error), "size guard"); + check(!load_mod_media(path, "n64-rom", rom.size(), std::string(64, 'z'), bytes, &error), "hash syntax"); + check(!load_mod_media(root / "absent", "n64-rom", 64, rom_hash, bytes, &error), "missing file"); + check(!load_mod_media(path, "file", 513ull * 1024 * 1024, rom_hash, bytes, &error), "bounded allocation"); + + std::vector iso(24 * 2048); + size_t pvd = 16 * 2048; + iso[pvd] = 1; + std::copy_n("CD001", 5, iso.begin() + pvd + 1); + iso[pvd + 6] = 1; iso[pvd + 80] = 24; iso[pvd + 87] = 24; + iso[pvd + 129] = 8; iso[pvd + 130] = 8; + const auto iso_hash = hash(iso); + const auto disc = root / "disc.iso"; + write(disc, iso); + check(load_mod_media(disc, "psx-disc", iso.size(), iso_hash, bytes, &error) && *bytes == iso, + "cooked ISO volume"); + for (unsigned mode : {1u, 2u}) { + std::vector raw(24 * 2352); + for (unsigned i = 0; i < 24; ++i) { + std::fill(raw.begin() + i * 2352 + 1, raw.begin() + i * 2352 + 11, 0xff); + raw[i * 2352 + 15] = static_cast(mode); + std::copy_n(iso.begin() + i * 2048, 2048, + raw.begin() + i * 2352 + (mode == 1 ? 16 : 24)); + } + write(root / "disc.bin", raw); + check(load_mod_media(root / "disc.bin", "psx-disc", iso.size(), iso_hash, bytes, &error) && *bytes == iso, + "Mode 1/2 raw BIN canonical identity"); + write(root / "audio.bin", std::vector(2352, 0x5a)); + const auto cue = root / "disc.cue"; + { + std::ofstream out(cue); + out << "FILE \"disc.bin\" BINARY\n TRACK 01 MODE" << mode << "/2352\n INDEX 01 00:00:00\n" + "FILE \"audio.bin\" BINARY\n TRACK 02 AUDIO\n INDEX 01 00:00:00\n"; + } + check(load_mod_media(cue, "psx-disc", iso.size(), iso_hash, bytes, &error) && *bytes == iso, + "CUE identity excludes audio tracks"); + } + iso[pvd + 87] = 23; + write(disc, iso); + check(!load_mod_media(disc, "psx-disc", iso.size(), hash(iso), bytes, &error), "ISO endian count guard"); + iso[pvd + 87] = 24; iso[pvd + 1] = 'X'; + write(disc, iso); + check(!load_mod_media(disc, "psx-disc", iso.size(), hash(iso), bytes, &error), "ISO PVD guard"); + iso[pvd + 1] = 'C'; iso[pvd + 80] = 40; iso[pvd + 87] = 40; + write(disc, iso); + check(load_mod_media(disc, "psx-disc", iso.size(), hash(iso), bytes, &error) && *bytes == iso, + "mixed-mode volume size may extend beyond data track"); + for (const char* file : {"rom.z64", "disc.iso", "disc.bin", "disc.cue", "audio.bin"}) + fs::remove(root / file); + fs::remove(root); + return failures ? 1 : 0; +} diff --git a/runtime/tests/test_mod_packages.cpp b/runtime/tests/test_mod_packages.cpp index 73a79f3c..ff9df1aa 100644 --- a/runtime/tests/test_mod_packages.cpp +++ b/runtime/tests/test_mod_packages.cpp @@ -410,6 +410,37 @@ int main() { "an implementation exposes exactly the hooks it registered"); check(mod_function_entry_hooks("test.missing").empty(), "an unregistered implementation exposes no hooks"); + /* Audit: a hook registered under a sub-id of the package's declared + * plugin can never be activated by a plan and must be reported. */ + check(mod_register_function_entry_plugin("test.entry.hud", 0x80020000u, entry_hook), + "sub-id function-entry plugin must register"); + { + const fs::path audit_root = root / "audit-authored"; + write_text(audit_root / "entry.mod/1.0.0/manifest.toml", + "format_version = 5\n" + "id = \"entry.mod\"\n" + "version = \"1.0.0\"\n" + "name = \"Entry Mod\"\n" + "resolver = \"declarative\"\n" + "[[target]]\n" + "game_id = \"SLUS-TEST\"\n" + "[[feature]]\n" + "id = \"entry\"\n" + "name = \"Entry Plugin\"\n" + "[[plugin]]\n" + "feature = \"entry\"\n" + "id = \"test.entry\"\n"); + const ModPluginAudit audit = mod_audit_registered_plugins({audit_root}); + check(audit.errors.empty() && audit.manifests == 1, + "audit must read every authored manifest"); + check(std::find(audit.declared.begin(), audit.declared.end(), + "test.entry") != audit.declared.end(), + "audit must collect declared [[plugin]] ids"); + check(audit.undeclared.size() == 1 && audit.undeclared[0] == "test.entry.hud", + "audit must report exactly the registered-but-undeclared id"); + const ModPluginAudit missing = mod_audit_registered_plugins({root / "absent"}); + check(!missing.errors.empty(), "audit must report an unreadable root"); + } mod_clear_plugins_for_tests(); ModResolution entry_unavailable = reload.resolve("SLUS-TEST"); check(!entry_unavailable.ok, @@ -2109,6 +2140,55 @@ int main() { mod_clear_plugins_for_tests(); } + { + const auto media_root = root / "media-catalog"; + const auto manifest_path = media_root / "packages/media.mod/1.0.0/manifest.toml"; + std::vector rom(64); + rom[0] = 0x80; rom[1] = 0x37; rom[2] = 0x12; rom[3] = 0x40; + const auto owner = media_root / "owner.z64"; + const auto moved = media_root / "moved.v64"; + write_bytes(owner, rom); + const std::string declaration = + "id = \"media.mod\"\nversion = \"1.0.0\"\nname = \"Media\"\n" + "[[target]]\ngame_id = \"SLUS-TEST\"\n" + "[[feature]]\nid = \"arena\"\nname = \"Arena\"\n" + "[[resource]]\nfeature = \"arena\"\nid = \"rom\"\nlabel = \"ROM\"\n" + "format = \"n64-rom\"\nrequired = true\nsize = 64\nsha256 = \"" + sha256_hex(rom) + "\"\n"; + write_text(manifest_path, "format_version = 8\n" + declaration); + ModPackageManager media(media_root); + check(media.scan(&error) && media.scan_errors().empty(), "verified-media manifest parses"); + const auto stock_plan = media.resolve("SLUS-TEST"); + check(stock_plan.ok && stock_plan.resources.empty(), "disabled donor mod needs no media"); + check(media.set_feature_enabled("media.mod", "arena", true, &error), error.c_str()); + check(!media.resolve("SLUS-TEST").ok, "enabled donor mod without media cannot launch"); + check(media.set_feature_resource_path("media.mod", "arena", "rom", owner, &error), error.c_str()); + auto pinned = media.resolve("SLUS-TEST"); + check(pinned.ok && pinned.resources.size() == 1 && pinned.resources[0].bytes && + *pinned.resources[0].bytes == rom, "plan contains verified canonical bytes"); + auto swapped = rom; + for (size_t i = 0; i < swapped.size(); i += 2) std::swap(swapped[i], swapped[i + 1]); + write_bytes(moved, swapped); + check(media.set_feature_resource_path("media.mod", "arena", "rom", moved, &error), error.c_str()); + check(media.resolve("SLUS-TEST").fingerprint == pinned.fingerprint, + "donor fingerprint depends on canonical identity rather than path or byte order"); + swapped[24] ^= 1; + write_bytes(moved, swapped); + check(!media.resolve("SLUS-TEST").ok, "wrong same-size media blocks plan"); + fs::remove(moved); + check(!media.resolve("SLUS-TEST").ok, "removed media blocks a new plan"); + check(media.set_feature_enabled("media.mod", "arena", false, &error), error.c_str()); + const auto restored = media.resolve("SLUS-TEST"); + check(restored.ok && restored.resources.empty() && restored.fingerprint == stock_plan.fingerprint, + "disabling donor mod restores the exact stock plan"); + write_text(manifest_path, "format_version = 7\n" + declaration); + ModPackage invalid; + check(!ModPackageManager::read_manifest(manifest_path, invalid, &error), + "old manifest version cannot silently ignore donor verification"); + auto negative_size = declaration; + negative_size.replace(negative_size.find("size = 64"), 9, "size = -1"); + write_text(manifest_path, "format_version = 8\n" + negative_size); + check(!ModPackageManager::read_manifest(manifest_path, invalid, &error), "negative media size rejected"); + } fs::remove_all(root, ec); if (failures) { std::cerr << failures << " mod package test(s) failed\n"; diff --git a/runtime/tests/test_mod_runtime.cpp b/runtime/tests/test_mod_runtime.cpp index 07498cce..801d2475 100644 --- a/runtime/tests/test_mod_runtime.cpp +++ b/runtime/tests/test_mod_runtime.cpp @@ -102,6 +102,16 @@ static void test_activation_plugin(void) { activation_calls++; } +static const uint8_t* media_snapshot; +static uint64_t media_size; +static int media_access, foreign_media_access; +static void test_media_plugin(void) { + media_access = psx_mod_current_resource_bytes("rom", &media_snapshot, &media_size); + const uint8_t* foreign = nullptr; + uint64_t size = 0; + foreign_media_access = psx_mod_current_resource_bytes("private", &foreign, &size); +} + static int big_ram_activations; static void test_big_ram_activation(void) { big_ram_activations++; @@ -720,6 +730,42 @@ int main() { check(PSXRecompV4::mod_runtime_commit(raw_path,&error),"reader mount raw disc"); check(psx_mod_read_disc_file("S0/LEVEL.NSF",result.data(),(uint32_t)result.size(),&bytes) && std::equal(result.begin(),result.end(),iso.begin()+22*2048),"raw and ISO reads identical"); + /* Verified bytes are scoped to the committed feature, and do not depend + * on reopening an owner file after launch. No launcher is needed here. */ + const auto media_root = root / "verified-media"; + std::vector rom(64, 0); + rom[0] = 0x80; rom[1] = 0x37; rom[2] = 0x12; rom[3] = 0x40; + rom[32] = 0x5a; + const auto rom_path = media_root / "owner.z64"; + write_bytes(rom_path, rom); + write_text(media_root / "packages/media.test/1.0.0/manifest.toml", + "format_version = 8\nid = \"media.test\"\nversion = \"1.0.0\"\nname = \"Media Test\"\n" + "[[target]]\ngame_id = \"READER\"\n" + "[[feature]]\nid = \"active\"\nname = \"Active\"\ndefault_enabled = true\n" + "[[feature]]\nid = \"private\"\nname = \"Private\"\n" + "[[resource]]\nfeature = \"active\"\nid = \"rom\"\nlabel = \"ROM\"\n" + "format = \"n64-rom\"\nrequired = true\nsize = 64\nsha256 = \"" + sha256_hex(rom) + "\"\n" + "[[resource]]\nfeature = \"private\"\nid = \"private\"\nlabel = \"Private\"\n" + "format = \"n64-rom\"\nrequired = true\nsize = 64\nsha256 = \"" + sha256_hex(rom) + "\"\n" + "[[plugin]]\nfeature = \"active\"\nid = \"media.test.plugin\"\n"); + write_text(media_root / "state.toml", + "format_version = 2\n[[feature]]\npackage_id = \"media.test\"\nid = \"active\"\nenabled = true\n" + "[feature.resources]\nrom = \"" + rom_path.generic_string() + "\"\n"); + check(psx_mod_register_activation_plugin("media.test.plugin", test_media_plugin), "register media consumer"); + check(PSXRecompV4::mod_runtime_initialize(media_root, "READER", 0, {}, &error), "media initialize"); + check(PSXRecompV4::mod_runtime_commit({}, &error), "verify and commit owner media"); + const uint8_t* unavailable = nullptr; + uint64_t unavailable_size = 0; + check(!psx_mod_current_resource_bytes("rom", &unavailable, &unavailable_size), "bytes unavailable outside plugin callback"); + mod_runtime_activate_plugins(); + check(media_access && media_size == rom.size() && + std::equal(rom.begin(), rom.end(), media_snapshot), "plugin receives exact verified bytes"); + check(!foreign_media_access, "inactive feature cannot supply bytes to another feature"); + rom[32] ^= 1; + write_bytes(rom_path, rom); + check(media_snapshot && media_snapshot[32] == 0x5a, "committed bytes survive owner file changes"); + check(!PSXRecompV4::mod_runtime_commit({}, &error), "new commit rejects modified media"); + check(PSXRecompV4::mod_runtime_clear_for_netplay(&error), "netplay clears donor plan"); fs::remove_all(root, ec); if (failures) return 1; std::cout << "mod runtime tests passed\n"; diff --git a/runtime/tests/test_wide_overlay_band_scissor.py b/runtime/tests/test_wide_overlay_band_scissor.py new file mode 100644 index 00000000..484147ad --- /dev/null +++ b/runtime/tests/test_wide_overlay_band_scissor.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +"""The full-screen-overlay native-wide pass must clip to the draw-area rows. + +Vertically double-buffered titles keep both display bands in ONE wide surface. +A full-width rect that extends above its draw area is clipped at the band top +in canonical VRAM; the wide pass has to clip it there too (the software +reference rt_wide() does), or it paints the other band's rows and the next +present shows a flat band over that buffer. The GL pixel check lives in +test_gl_readback_region.c; this guard covers both GPU backends' source. +""" +from pathlib import Path +import re + +src = Path(__file__).parents[1] / "src" + + +def body(text, signature): + m = re.search(re.escape(signature) + r".*?\n\}", text, flags=re.DOTALL) + assert m, f"{signature} not found" + return m.group(0) + + +gl = (src / "gpu_gl_renderer.c").read_text(encoding="utf-8") +band = body(gl, "static void wide_band_scissor(void) {") +assert "s_area_y1" in band and "s_area_y2" in band, "GL band scissor ignores the draw area" +flat = body(gl, "static void wide_flat_rect_direct(") +assert "wide_band_scissor();" in flat, "GL overlay pass does not use the band scissor" +assert "VRAM_H * s_scale); /* full surface" not in flat, "GL overlay pass uses a full-height scissor" +target = body(gl, "static void wide_target_begin(") +assert "wide_band_scissor();" in target, "GL wide mirror does not use the band scissor" + +vk = (src / "gpu_vk_renderer.c").read_text(encoding="utf-8") +begin = body(vk, "static void wide_pass_begin(VkCommandBuffer cb) {") +assert "s_da_y1" in begin and "s_da_y2" in begin, "Vulkan wide pass ignores the draw area" +overlay = body(vk, "static void wide_overlay_rect(") +assert "wide_pass_begin(cb);" in overlay, "Vulkan overlay pass does not open a wide pass" +assert "vkCmdSetScissor" not in overlay, "Vulkan overlay pass overrides the band scissor" + +print("wide overlay band scissor test passed") From 071847abf847c0204869c9bc500a519e86b81a5e Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Wed, 30 Sep 2026 09:39:30 -0700 Subject: [PATCH 04/52] Preserve mod completion context across nested native calls and vblank --- docs/internal/FAITHFUL_TIMING_PLAN.md | 19 ++++++ recompiler/src/code_generator.cpp | 4 +- recompiler/tests/recompiler_patch_test.cpp | 14 +++++ runtime/include/mod_plugins.h | 7 ++- runtime/include/overlay_api.h | 7 ++- .../include/overlay_dispatch_preamble.c.inc | 4 +- runtime/src/dirty_ram_interp.c | 14 +++-- runtime/src/mod_runtime.cpp | 58 ++++++++++++++++--- runtime/src/overlay_loader.c | 2 +- runtime/tests/overlay_pair_dedup_harness.c | 4 +- runtime/tests/test_interp_mod_entry_guards.py | 15 +++-- runtime/tests/test_mod_runtime.cpp | 48 ++++++++++++++- .../test_overlay_widescreen_callbacks.py | 9 ++- 13 files changed, 170 insertions(+), 35 deletions(-) diff --git a/docs/internal/FAITHFUL_TIMING_PLAN.md b/docs/internal/FAITHFUL_TIMING_PLAN.md index 7fec9c14..1e8ee91f 100644 --- a/docs/internal/FAITHFUL_TIMING_PLAN.md +++ b/docs/internal/FAITHFUL_TIMING_PLAN.md @@ -213,6 +213,25 @@ on a fixed region -> next. ## 5. Status / Log (update every session) +- **2026-09-30 (Phase 5 callback reentrancy):** Plugin activation, VBlank and + function-entry callbacks now use the same scoped resource/completion context. + A native call inside an entry hook can deliver VBlank; previously those + callbacks cleared its plugin, making explicit completion fail and executing + the original function again. A regression fails before the fix and passes + after it, also refusing VBlank completion of the interrupted function. The + runtime test and seven V8 checks pass; isolated six-contact construction now + produces one chassis and survives drive/save/load. Tracked by `beads-i3ow`. + +- **2026-09-29 (Phase 5 mod function completion):** Trusted entry callbacks + may explicitly complete the current guest function through + `psx_mod_finish_function`. Static codegen, native overlay forwarding and both + dirty-RAM entry paths honor the callback result; nested callback completion + remains scoped to its CPU and invocation. ABI 26 / codegen 16 reject old + caches and states. Five focused framework checks pass. V8's independent + sequel-bank integration is being exercised separately under `beads-jogl`; + the generic mechanism is tracked by `beads-i3ow`. No title address or content + behavior is embedded in the framework. + - **2026-09-29 (Phase 5 enhancement media):** Added format-8 verified donor resources (exact canonical size/SHA-256, immutable snapshots scoped to the owning plugin). N64 byte orders normalize before hashing; PSX identity covers diff --git a/recompiler/src/code_generator.cpp b/recompiler/src/code_generator.cpp index a6f845dc..d243cce2 100644 --- a/recompiler/src/code_generator.cpp +++ b/recompiler/src/code_generator.cpp @@ -2863,7 +2863,7 @@ GeneratedFunction CodeGenerator::generate_function( if (config_.mod_function_entry_funcs.count(func.start_addr)) { body_ss << config_.indent << fmt::format( - "psx_mod_function_entry(cpu, 0x{:08X}u);" + "if (psx_mod_function_entry(cpu, 0x{:08X}u)) return;" " /* trusted opt-in game-mod hook */\n", func.start_addr); } @@ -3371,7 +3371,7 @@ void CodeGenerator::emit_runtime_externs(std::ostream& ss) const { ss << "#endif\n"; ss << "extern int psx_game_text_native_ok(uint32_t addr); /* stale-static guard (dispatch shard) */\n"; ss << "extern int psx_datashard_enter(CPUState* cpu, uint32_t key); /* data-shard replay/capture (data_shards.c) */\n"; - ss << "extern void psx_mod_function_entry(CPUState* cpu, uint32_t address); /* trusted opt-in game-mod hook */\n"; + ss << "extern int psx_mod_function_entry(CPUState* cpu, uint32_t address); /* trusted opt-in game-mod hook */\n"; ss << "extern void psx_datashard_ret(CPUState* cpu); /* data-shard capture finalize */\n"; ss << "extern int psx_vsync_query_hle_enter(CPUState* cpu, uint32_t func, uint32_t counter_addr, uint32_t gpustat_ptr_addr, uint32_t timer1_ptr_addr, uint32_t timer1_cache_addr); /* load_accel.c */\n"; ss << "extern void psx_ws_sprite_tag(CPUState* cpu); /* widescreen prim tag (gpu.c) */\n"; diff --git a/recompiler/tests/recompiler_patch_test.cpp b/recompiler/tests/recompiler_patch_test.cpp index 1ed8131b..cf992ea3 100644 --- a/recompiler/tests/recompiler_patch_test.cpp +++ b/recompiler/tests/recompiler_patch_test.cpp @@ -1189,6 +1189,19 @@ void cfg_codegen_load_delay_test() { "CFG codegen preserves MIPS-I dependent load-delay value semantics"); } +void mod_function_completion_codegen_test() { + PSXRecomp::CodeGenConfig config{}; + config.mod_function_entry_funcs.insert(0x80010000u); + for (bool overlay : {false, true}) { + const auto code = generate_first_instruction(0x2402002Au, {}, overlay, config); + check(code.find("if (psx_mod_function_entry(cpu, 0x80010000u)) return;") != std::string::npos, + overlay ? "overlay body honors trusted mod completion" : "main body honors trusted mod completion"); + } + const auto stock = generate_first_instruction(0x2402002Au, {}, false); + check(stock.find("psx_mod_function_entry(cpu,") == std::string::npos, + "unconfigured functions retain the stock entry path"); +} + void cfg_fallthrough_reachability_test() { constexpr uint32_t base = 0x80010000u; PSXRecomp::PS1Executable exe{}; @@ -1238,6 +1251,7 @@ int main() { gte_codegen_classification_tests(); jump_table_producer_codegen_test(); cfg_codegen_load_delay_test(); + mod_function_completion_codegen_test(); cfg_fallthrough_reachability_test(); } catch (const std::exception& e) { fmt::print(stderr, "FAIL unexpected exception: {}\n", e.what()); diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 90c18bc7..04685b1e 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -27,7 +27,12 @@ int psx_mod_register_function_entry_plugin( * interpreted entry, so the hook contract does not depend on the backend. * Hooks match by code address (segment bits ignored) and run only for plugins * the active plan resolved; the table is rebuilt at plugin activation. */ -void psx_mod_function_entry(struct CPUState* cpu, uint32_t address); +int psx_mod_function_entry(struct CPUState* cpu, uint32_t address); +/* Complete a guest function from its trusted entry callback after supplying + * its full result. Valid only for that callback's CPU. Publishes pc=$ra and + * prevents the original body from executing. Nested callbacks have separate + * completion scopes; requests outside an entry callback return zero. */ +int psx_mod_finish_function(struct CPUState* cpu); /* Active function-entry hook count (0 = none). Hot callers test it before the * call, so a run without an active hook pays one load per interpreted entry. */ extern uint32_t g_psx_mod_function_entry_hooks; diff --git a/runtime/include/overlay_api.h b/runtime/include/overlay_api.h index df04f133..f610d39e 100644 --- a/runtime/include/overlay_api.h +++ b/runtime/include/overlay_api.h @@ -112,7 +112,8 @@ /* v25: gte_nclip_exact_sign forwarder for [widescreen.cull] nclip_exact_sites * in overlay code (all sign-branch shapes). Appended last; NULL keeps the * native sign. */ -#define PSX_OVERLAY_ABI_VERSION 25 +/* v26: trusted entry hooks return whether they completed the guest function. */ +#define PSX_OVERLAY_ABI_VERSION 26 /* Process-lifetime overlay candidate capacity. Every accepted manifest F * record consumes one slot, even when another DLL carries an identical @@ -182,7 +183,7 @@ /* 14: + [[widescreen.cull.scale]] register-register frustum-edge emit. */ /* 15: exact/keep NCLIP sites emit for every sign-branch shape through * gte_nclip_exact_sign(mac0, pc). */ -#define PSX_OVERLAY_CODEGEN_VER 15 +#define PSX_OVERLAY_CODEGEN_VER 16 /* Auto codegen hash (generated by hash_codegen.cmake from the recompiler codegen * sources). Folded into the cache PATH next to cg (gcc//cg_/) @@ -350,7 +351,7 @@ typedef struct { * emitter change (Phase 2 of docs/ENHANCEMENTS.md G1 value propagation). */ const PGXPHooks *pgxp; int32_t (*ws_screen_x_bound)(int32_t vanilla); - void (*mod_function_entry)(CPUState *cpu, uint32_t address); + int (*mod_function_entry)(CPUState *cpu, uint32_t address); /* Frustum-edge bound scale helper (ABI v24). */ int32_t (*ws_cull_scale)(int32_t bound, int32_t half_extent); /* Exact-NCLIP branch sign (ABI v25). */ diff --git a/runtime/include/overlay_dispatch_preamble.c.inc b/runtime/include/overlay_dispatch_preamble.c.inc index a53ed82e..c0a58ada 100644 --- a/runtime/include/overlay_dispatch_preamble.c.inc +++ b/runtime/include/overlay_dispatch_preamble.c.inc @@ -233,9 +233,9 @@ int32_t psx_ws_player_x_bound(int32_t vanilla) { int32_t psx_ws_screen_x_bound(int32_t vanilla) { return g_cbs.ws_screen_x_bound ? g_cbs.ws_screen_x_bound(vanilla) : vanilla; } -void psx_mod_function_entry(CPUState *cpu, uint32_t address) { +int psx_mod_function_entry(CPUState *cpu, uint32_t address) { overlay_flush_cycles(); - if (g_cbs.mod_function_entry) g_cbs.mod_function_entry(cpu, address); + return g_cbs.mod_function_entry ? g_cbs.mod_function_entry(cpu, address) : 0; } int32_t psx_ws_depth_bound(int32_t imm) { return g_cbs.ws_depth_bound ? g_cbs.ws_depth_bound(imm) : imm; diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index 2bffda6d..8d723d2c 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -2917,8 +2917,8 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ * to one load per interpreted entry. */ { extern uint32_t g_psx_mod_function_entry_hooks; - extern void psx_mod_function_entry(CPUState *cpu, uint32_t address); - if (g_psx_mod_function_entry_hooks) psx_mod_function_entry(cpu, addr); + extern int psx_mod_function_entry(CPUState *cpu, uint32_t address); + if (g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, addr)) return 1; } /* Per-PC entry counter (visible via dirty_ram_stats). */ @@ -3307,9 +3307,13 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ * function-entry hooks as a surfaced interpreter entry. */ { extern uint32_t g_psx_mod_function_entry_hooks; - extern void psx_mod_function_entry(CPUState *, uint32_t); - if (g_psx_mod_function_entry_hooks) - psx_mod_function_entry(cpu, target); + extern int psx_mod_function_entry(CPUState *, uint32_t); + if (g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, target)) { + g_dirty_ram_blocks_run++; + if (pc_entry) pc_entry->insns += (uint64_t)insns_executed; + g_dirty_interp_chain_target = cpu->pc; + OV_FPLOG_RET1(); + } } pc = target; current_page = target_phys >> 12; diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index fb1a8149..ea867683 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -7,6 +7,7 @@ #include "gpu.h" #include "psx_memory.h" #include "psx_sha256.h" +#include "cpu_state.h" #if defined(RECOMP_LAUNCHER) #include "recomp_launcher.h" @@ -79,6 +80,8 @@ struct RuntimeMods { bool disc_enabled = false; bool disc_guard_failed = false; const ModResolution::Plugin* current_plugin = nullptr; + CPUState* current_function_cpu = nullptr; + bool current_function_finished = false; }; RuntimeMods& state() { @@ -86,6 +89,33 @@ RuntimeMods& state() { return value; } +/* Guest calls made from an entry hook can deliver VBlank callbacks before + * returning. Every callback owns its resource/completion context; restoring + * only entry hooks would let VBlank erase the interrupted plugin or complete + * a function that belongs to another callback. */ +class PluginCallbackScope { + RuntimeMods& runtime; + const ModResolution::Plugin* previous_plugin; + CPUState* previous_cpu; + bool previous_finished; +public: + PluginCallbackScope(RuntimeMods& s, const ModResolution::Plugin* plugin, + CPUState* cpu = nullptr) + : runtime(s), previous_plugin(s.current_plugin), + previous_cpu(s.current_function_cpu), previous_finished(s.current_function_finished) { + s.current_plugin = plugin; + s.current_function_cpu = cpu; + s.current_function_finished = false; + } + ~PluginCallbackScope() { + runtime.current_plugin = previous_plugin; + runtime.current_function_cpu = previous_cpu; + runtime.current_function_finished = previous_finished; + } + PluginCallbackScope(const PluginCallbackScope&) = delete; + PluginCallbackScope& operator=(const PluginCallbackScope&) = delete; +}; + /* Function-entry hooks of the ACTIVE plan, flattened at plugin activation into * one table sorted by code key (address with the segment bits stripped, so a * KUSEG or KSEG1 PC reaches the same hook as KSEG0). The interpreter consults @@ -1415,9 +1445,8 @@ extern "C" void mod_runtime_activate_plugins(void) { psx_ram_reset_size_request(); if (!s.initialized || !s.plan.ok) return; for (const ModResolution::Plugin& plugin : s.plan.plugins) { - s.current_plugin = &plugin; + PluginCallbackScope scope(s, &plugin); mod_invoke_activation_plugin(plugin.id); - s.current_plugin = nullptr; } build_function_entry_hooks(s); } @@ -1428,9 +1457,8 @@ extern "C" void mod_runtime_on_vblank(void) { RuntimeMods& s = state(); if (!s.initialized || !s.plan.ok) return; for (const ModResolution::Plugin& plugin : s.plan.plugins) { - s.current_plugin = &plugin; + PluginCallbackScope scope(s, &plugin); mod_invoke_vblank_plugin(plugin.id); - s.current_plugin = nullptr; } } @@ -1634,9 +1662,17 @@ extern "C" int psx_mod_register_function_entry_plugin( return mod_register_function_entry_plugin(id, address, callback) ? 1 : 0; } -extern "C" void psx_mod_function_entry(CPUState* cpu, uint32_t address) { +extern "C" int psx_mod_finish_function(CPUState* cpu) { using namespace PSXRecompV4; - if (!g_psx_mod_function_entry_hooks || !cpu) return; + RuntimeMods& s = state(); + if (!cpu || s.current_function_cpu != cpu || !s.current_plugin) return 0; + s.current_function_finished = true; + return 1; +} + +extern "C" int psx_mod_function_entry(CPUState* cpu, uint32_t address) { + using namespace PSXRecompV4; + if (!g_psx_mod_function_entry_hooks || !cpu) return 0; RuntimeMods& s = state(); const auto& table = active_function_entry_hooks(); const uint32_t key = function_entry_key(address); @@ -1644,11 +1680,15 @@ extern "C" void psx_mod_function_entry(CPUState* cpu, uint32_t address) { table.begin(), table.end(), key, [](const ActiveFunctionEntryHook& hook, uint32_t k) { return hook.key < k; }); for (; it != table.end() && it->key == key; ++it) { - const ModResolution::Plugin* previous = s.current_plugin; - s.current_plugin = it->plugin; + PluginCallbackScope scope(s, it->plugin, cpu); it->callback(cpu, address); - s.current_plugin = previous; + const bool finished = s.current_function_finished; + if (finished) { + cpu->pc = cpu->gpr[31]; + return 1; + } } + return 0; } extern "C" void mod_runtime_patch_disc_sector(uint32_t lba, int raw_sector, diff --git a/runtime/src/overlay_loader.c b/runtime/src/overlay_loader.c index d3deebc7..be9a4419 100644 --- a/runtime/src/overlay_loader.c +++ b/runtime/src/overlay_loader.c @@ -2471,7 +2471,7 @@ static void init_callbacks(void) { } { extern int32_t psx_ws_screen_x_bound(int32_t vanilla); - extern void psx_mod_function_entry(CPUState *cpu, uint32_t address); + extern int psx_mod_function_entry(CPUState *cpu, uint32_t address); s_callbacks.ws_screen_x_bound = psx_ws_screen_x_bound; s_callbacks.mod_function_entry = psx_mod_function_entry; } diff --git a/runtime/tests/overlay_pair_dedup_harness.c b/runtime/tests/overlay_pair_dedup_harness.c index 334cb2ba..549000ba 100644 --- a/runtime/tests/overlay_pair_dedup_harness.c +++ b/runtime/tests/overlay_pair_dedup_harness.c @@ -175,8 +175,8 @@ uint32_t psx_ws_backdrop_value(uint32_t orig, int end, int cols) { int32_t psx_ws_depth_bound(int32_t imm) { return imm; } int32_t psx_ws_player_x_bound(int32_t vanilla) { return vanilla; } int32_t psx_ws_screen_x_bound(int32_t vanilla) { return vanilla; } -void psx_mod_function_entry(CPUState *cpu, uint32_t address) { - (void)cpu; (void)address; +int psx_mod_function_entry(CPUState *cpu, uint32_t address) { + (void)cpu; (void)address; return 0; } int psx_netplay_is_resimulating(void) { return 0; } int psx_game_text_native_ok(uint32_t address) { (void)address; return 1; } diff --git a/runtime/tests/test_interp_mod_entry_guards.py b/runtime/tests/test_interp_mod_entry_guards.py index 3a757245..f8c3c2a6 100644 --- a/runtime/tests/test_interp_mod_entry_guards.py +++ b/runtime/tests/test_interp_mod_entry_guards.py @@ -13,12 +13,11 @@ def main(): assert static_dispatch.index('g_exec_phase = 3;') < static_dispatch.index( 'psx_overlay_dispatch(cpu, addr);') < static_dispatch.index( 'g_exec_phase = previous_phase;') < static_dispatch.index('if (handled) return 1;') - assert source.count('psx_mod_function_entry(cpu, addr);') == 1 + assert source.count('psx_mod_function_entry(cpu, addr)') == 1 # Every interpreted entry reaches these calls: without an active hook they # must cost one load, never a call into the plugin table. - assert 'if (g_psx_mod_function_entry_hooks) psx_mod_function_entry(cpu, addr);' in source - assert ('if (g_psx_mod_function_entry_hooks)\n' - ' psx_mod_function_entry(cpu, target);') in source + assert 'if (g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, addr)) return 1;' in source + assert 'if (g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, target)) {' in source local_start = source.index('if (allow_local_dirty_flow && target != 0 &&') local_end = source.index('current_page = target_phys >> 12;', local_start) local = source[local_start:local_end] @@ -28,9 +27,13 @@ def main(): assert 'g_dirty_interp_chain_target = target;' in probe assert 'OV_FPLOG_RET1();' in probe assert 'psx_overlay_dispatch(cpu' not in probe - assert local.count('psx_mod_function_entry(cpu, target);') == 1 + assert local.count('psx_mod_function_entry(cpu, target)') == 1 assert local.index('overlay_loader_dispatch(cpu, target)') < local.index( - 'psx_mod_function_entry(cpu, target);') < local.index('pc = target;') + 'psx_mod_function_entry(cpu, target)') < local.index('pc = target;') + completion = local[local.index('if (g_psx_mod_function_entry_hooks &&'):] + completion = completion[:completion.index('pc = target;')] + assert 'g_dirty_interp_chain_target = cpu->pc;' in completion + assert 'OV_FPLOG_RET1();' in completion print('interpreter mod entry guards: PASS') diff --git a/runtime/tests/test_mod_runtime.cpp b/runtime/tests/test_mod_runtime.cpp index 801d2475..4b39481a 100644 --- a/runtime/tests/test_mod_runtime.cpp +++ b/runtime/tests/test_mod_runtime.cpp @@ -81,8 +81,10 @@ extern "C" void gpu_ws_tag_hud_primitive(uint32_t, int) {} extern "C" void gpu_ws_tag_world_primitive(uint32_t, int) {} extern "C" void gpu_ws_set_adaptive_backdrop_preload(int) {} +static CPUState* interrupted_entry_cpu; static void test_vblank_plugin(void) { plugin_calls++; + if (interrupted_entry_cpu && psx_mod_finish_function(interrupted_entry_cpu)) failures++; } /* Function-entry hooks: one owned by the plan's active plugin, one by a @@ -91,9 +93,32 @@ static int active_entry_hits; static int disabled_entry_hits; static int unselected_entry_hits; static uint32_t active_entry_last; -static void test_active_entry(CPUState*, uint32_t address) { +static int entry_test_mode, nested_result; +static uint32_t nested_pc; +static void test_active_entry(CPUState* cpu, uint32_t address) { active_entry_hits++; active_entry_last = address; + if (entry_test_mode == 1) { + CPUState unrelated{}; + if (psx_mod_finish_function(&unrelated) || !psx_mod_finish_function(cpu)) failures++; + cpu->gpr[2] = 0x12345678u; + } else if (entry_test_mode == 2 || entry_test_mode == 3) { + const int mode = entry_test_mode; + if (mode == 3 && !psx_mod_finish_function(cpu)) failures++; + CPUState nested{}; nested.gpr[31] = 0x80004000u; + entry_test_mode = mode == 2 ? 1 : 0; + nested_result = psx_mod_function_entry(&nested, address); + nested_pc = nested.pc; + entry_test_mode = mode; + } else if (entry_test_mode == 4) { + /* A native call made by a hook can cross a guest VBlank. Its + * callbacks must neither inherit nor discard the interrupted hook. */ + interrupted_entry_cpu = cpu; + mod_runtime_on_vblank(); + interrupted_entry_cpu = nullptr; + if (!psx_mod_finish_function(cpu)) failures++; + cpu->gpr[2] = 0x87654321u; + } } static void test_disabled_entry(CPUState*, uint32_t) { disabled_entry_hits++; } static void test_unselected_entry(CPUState*, uint32_t) { unselected_entry_hits++; } @@ -404,6 +429,27 @@ int main() { unselected_entry_hits == 0, "re-activation restores exactly the active plan's hooks"); + entry_cpu.gpr[31] = 0x80005000u; + check(!psx_mod_finish_function(&entry_cpu) && !psx_mod_function_entry(nullptr, 0x80003000u), + "completion outside an entry callback or with no CPU is refused"); + entry_test_mode = 1; + check(psx_mod_function_entry(&entry_cpu, 0x80003000u) == 1 && + entry_cpu.pc == 0x80005000u && entry_cpu.gpr[2] == 0x12345678u, + "explicit completion returns handled and publishes guest return PC/results"); + entry_test_mode = 2; entry_cpu.pc = 0; + check(!psx_mod_function_entry(&entry_cpu, 0x80003000u) && entry_cpu.pc == 0 && + nested_result == 1 && nested_pc == 0x80004000u, + "inner completion cannot finish an ordinary outer callback"); + entry_test_mode = 3; + check(psx_mod_function_entry(&entry_cpu, 0x80003000u) == 1 && + entry_cpu.pc == 0x80005000u && nested_result == 0, + "outer completion survives a nested ordinary callback"); + entry_test_mode = 4; + check(psx_mod_function_entry(&entry_cpu, 0x80003000u) == 1 && + entry_cpu.pc == 0x80005000u && entry_cpu.gpr[2] == 0x87654321u, + "entry completion survives VBlank callbacks during a native call"); + entry_test_mode = 0; + ram[0x1000] = 1; ram[0x1001] = 2; ram[0x1002] = 3; ram[0x1003] = 4; ram[0x1100] = 0; ram[0x1101] = 0; ram[0x1102] = 1; ram[0x1103] = 0; diff --git a/tools/tests/test_overlay_widescreen_callbacks.py b/tools/tests/test_overlay_widescreen_callbacks.py index b68aabae..263a7b7b 100644 --- a/tools/tests/test_overlay_widescreen_callbacks.py +++ b/tools/tests/test_overlay_widescreen_callbacks.py @@ -21,8 +21,9 @@ static CPUState *seen_cpu; static uint32_t seen_address, cycles; static int32_t bound(int32_t x) { return x * 2; } static void advance(uint32_t n) { cycles += n; } -static void entry(CPUState *cpu, uint32_t address) { +static int entry(CPUState *cpu, uint32_t address) { assert(cycles == 17); seen_cpu = cpu; seen_address = address; + cpu->pc = cpu->gpr[31]; return 1; } int main(void) { CPUState cpu = {0}; @@ -35,12 +36,14 @@ int main(void) { assert(psx_ws_screen_x_bound(-256) == -512); assert(psx_ws_screen_x_bound(256) == 512); psx_advance_cycles(17); - psx_mod_function_entry(&cpu, 0x80045770); + cpu.gpr[31] = 0x80010000; + assert(psx_mod_function_entry(&cpu, 0x80045770) == 1); + assert(cpu.pc == 0x80010000); assert(seen_cpu == &cpu && seen_address == 0x80045770); callbacks.ws_screen_x_bound = 0; callbacks.mod_function_entry = 0; overlay_init(&callbacks); assert(psx_ws_screen_x_bound(-256) == -256); - psx_mod_function_entry(&cpu, 0); + assert(psx_mod_function_entry(&cpu, 0) == 0); assert(seen_address == 0x80045770); return 0; } From b9f9ba230fac9b24024ac6797e009231e7de538d Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Wed, 30 Sep 2026 22:51:23 -0700 Subject: [PATCH 05/52] Support guarded mod callbacks and verified disc extents for combined content --- docs/MOD_PACKAGES.md | 30 ++++ docs/internal/FAITHFUL_TIMING_PLAN.md | 51 ++++++ recompiler/include/code_generator.h | 3 + recompiler/src/code_generator.cpp | 12 ++ recompiler/src/config_loader.cpp | 10 ++ recompiler/src/config_loader.h | 2 + recompiler/src/full_function_emitter.cpp | 6 +- recompiler/src/main_psx.cpp | 4 + .../tests/full_function_emitter_test.cpp | 14 ++ recompiler/tests/recompiler_patch_test.cpp | 29 ++++ runtime/CMakeLists.txt | 1 + runtime/include/mod_packages.h | 10 ++ runtime/include/mod_plugins.h | 29 ++++ runtime/include/mod_runtime.h | 4 + runtime/include/overlay_api.h | 4 +- .../include/overlay_dispatch_preamble.c.inc | 4 + runtime/src/dirty_ram_interp.c | 4 + runtime/src/iso_reader_c.cpp | 36 ++++- runtime/src/mod_packages.cpp | 44 ++++- runtime/src/mod_runtime.cpp | 151 ++++++++++++++++++ runtime/src/overlay_loader.c | 2 + runtime/tests/test_interp_mod_entry_guards.py | 5 + runtime/tests/test_mod_runtime.cpp | 132 ++++++++++++++- 23 files changed, 573 insertions(+), 14 deletions(-) diff --git a/docs/MOD_PACKAGES.md b/docs/MOD_PACKAGES.md index 7d20f832..e5653590 100644 --- a/docs/MOD_PACKAGES.md +++ b/docs/MOD_PACKAGES.md @@ -786,6 +786,19 @@ valid until the committed plan is replaced or cleared. Decode into host or enhancement memory and rebuild derived data when activation changes; never reopen the owner path as a substitute for the verified snapshot. +An activation callback can mount a slice of its verified resource for native CD +streaming with `psx_mod_append_disc_extent(id, byte_offset, sector_count, &lba)`. +The slice contains 2336-byte Mode-2 sectors beginning at the duplicated XA +subheader. The runtime appends extents after the mounted disc, synthesizes raw +sector headers and a data-track TOC/subchannel entry, and retains the original +CD-ROM/XA decoder, interrupts and timing. The returned LBAs are deterministic +for the same activation order. Registration rejects missing/unowned resources, +invalid ranges/subheaders, late calls and addresses beyond the CD MSF limit. +Plan replacement or netplay clearing removes the extents; base sectors remain +unchanged. The game plugin supplies its own file lookup, names and stream +selection. Donor bytes remain external and are covered by the resource fingerprint. + + Verified resource fingerprints include format, canonical size and SHA-256, rather than the selected path, so moving identical media or changing N64 byte order does not change save compatibility. Donor bytes are never package files, @@ -803,6 +816,23 @@ rejects encrypted entries and unsafe or absolute paths, limits archives to 4096 files and 256 MiB expanded size, stages extraction, validates the manifest, and publishes the version atomically. +### Guarded instruction callbacks + +Trusted plugins can register +`psx_mod_register_instruction_plugin(id, address, expected_word, callback)`. +List native code locations in `[recompiler] mod_instruction_sites` and regenerate. +Callbacks run immediately before the instruction; the registered full word, +executing word and current RAM word must agree. Segment aliases share a site. +Only active resolved plugins run, with their feature's resource context. +The dirty-RAM backend uses the same checks, including nested delay slots. +Overlay ABI v27 carries the forwarder; site metadata changes the codegen hash. + +Callbacks may change registers and data. They must preserve PC and must not +re-enter guest execution, because pending branch/load state is live. +`psx_mod_finish_function` is unavailable in this callback scope. Inactive plans +do not change guest behavior. Function entry replacement remains the separate +`psx_mod_register_function_entry_plugin` interface. + ### Presentation bezel packages The framework registers `psx.bezel`, a trusted presentation plugin for OpenGL diff --git a/docs/internal/FAITHFUL_TIMING_PLAN.md b/docs/internal/FAITHFUL_TIMING_PLAN.md index 1e8ee91f..a3b7b9bf 100644 --- a/docs/internal/FAITHFUL_TIMING_PLAN.md +++ b/docs/internal/FAITHFUL_TIMING_PLAN.md @@ -213,6 +213,57 @@ on a fixed region -> next. ## 5. Status / Log (update every session) +- **2026-09-30 (Phase 5 owner-requested source checkpoint):** Preserve the + existing V8:2 combined-content title and generic callback/disc-extent support + on local `checkpoint/v82-combined-20260930` branches. Source, tests and + attribution only; donor media, generated outputs and playtest evidence stay + external. Owner explicitly paused further implementation, including + widescreen, original music and netplay, pending a check-in. No publication. + +- **2026-09-30 (Phase 5 Dreamland mushroom freeze):** `beads-eio.12.5` + identified an imported projectile flag write altering its callback, followed + by a skipped prologue and invalid return into the BIOS exception loop. The + title converter now tracks the local projectile factory and target pointers. + Added 4163 relocation/flag property cases and an opt-in native mushroom-event + stress driver; the old overlay fails and the repaired overlay completes both + families. All 16 title checks pass. No framework behavior changes. + +- **2026-09-30 (Phase 5 Dreamland effect cleanup):** `beads-eio.12.2` traced + the owner's frozen V8:2 match to an imported projectile effect writing its + matrix over the native child link. The title's input-overlay converter now + recognizes both effect-factory object returns. Five corrected field accesses, + owner-media regression checks, complete overlay code generation and a live + explosion allocation/free check validate the repair. No framework execution, + timing or generated-source changes; owner handoff remains at 1x rendering. + +- **2026-09-30 (Phase 5 instruction callbacks):** `beads-kbj0` adds plan-owned, + exact-word-guarded callbacks before opt-in game instructions, including branch + and delay slots. Native/overlay metadata participates in the codegen hash; + dirty-RAM execution routes through the same guard after load retirement. + Overlay ABI v27 forwards the callback. Runtime, parser/emitter and interpreter + routing checks pass. V8:2 uses seven seams for independent vehicle stats, + upgrades, transformation parts and special dependencies. Chassey's live match, + input/pause and savestate roundtrip were observed after correcting the title + allocator to retain shrinking allocations, matching its source implementation. + +- **2026-09-30 (Phase 5 mod-defined callbacks):** `beads-eio.3.212` adds + trusted mod-defined guest functions in an unused address range, separate + from original function-entry hooks. Active plans own availability and + callback resource context. Generated BIOS dispatch handles these through + its normal return/stack contract, with no synthetic guest instructions. + Runtime tests cover aliases, collisions, activation/clearing and nested + callback scopes; emitter tests cover routing before hardware dispatch. + OpenBIOS/SCPH1001 regenerated; V8:2 title rebuilt. Imported content still + needs its title-side runtime/selection adapters (`beads-eio.12.1`). + +- **2026-09-30 (Phase 5 combined V8 project):** Owner selected USA 2nd Offense + as the game-code base while retaining psxrecomp as the runtime/recompiler. + New local `Vigilante82PSXRecomp` builds against `071847ab`, reaches a stock + match, responds to driving input and reloads a savestate in an isolated run. + The reference's thirteen original-car conversions roundtrip successfully; + imported runtime/selector adapters remain title work (`beads-eio.12.1`). + No generic execution or hardware change was needed for this bring-up. + - **2026-09-30 (Phase 5 callback reentrancy):** Plugin activation, VBlank and function-entry callbacks now use the same scoped resource/completion context. A native call inside an entry hook can deliver VBlank; previously those diff --git a/recompiler/include/code_generator.h b/recompiler/include/code_generator.h index 802aab7d..f8952672 100644 --- a/recompiler/include/code_generator.h +++ b/recompiler/include/code_generator.h @@ -66,6 +66,7 @@ struct CodeGenConfig { // Trusted game-mod entry hooks ([recompiler] mod_function_entry_funcs). // Only explicitly listed guest functions call the runtime dispatcher. std::set mod_function_entry_funcs; + std::set mod_instruction_sites; // [recompiler] hot_funcs: emit __attribute__((hot)) on these guest // addresses (MotK VLC leaves, etc.). Host locality hint only. @@ -426,6 +427,8 @@ private: // Instruction translation std::string translate_instruction(uint32_t addr, uint32_t instr); + std::string translate_instruction_body(uint32_t addr, uint32_t instr); + std::string mod_instruction_call(uint32_t addr, uint32_t instr) const; // Register name mapping static std::string reg_name(int reg_num); diff --git a/recompiler/src/code_generator.cpp b/recompiler/src/code_generator.cpp index d243cce2..332bc733 100644 --- a/recompiler/src/code_generator.cpp +++ b/recompiler/src/code_generator.cpp @@ -852,7 +852,17 @@ std::string CodeGenerator::generate_branch_condition(uint32_t instr, uint32_t ad return keep_branch_if_wide("0 /* unknown branch condition: defaults to not-taken */"); } +std::string CodeGenerator::mod_instruction_call(uint32_t addr, uint32_t instr) const { + const bool selected = std::any_of(config_.mod_instruction_sites.begin(), + config_.mod_instruction_sites.end(), [=](uint32_t site) { + return (site & 0x1FFFFFFFu) == (addr & 0x1FFFFFFFu); + }); + return selected ? fmt::format("psx_mod_instruction(cpu, 0x{:08X}u, 0x{:08X}u);\n", addr, instr) : ""; +} std::string CodeGenerator::translate_instruction(uint32_t addr, uint32_t instr) { + return mod_instruction_call(addr, instr) + translate_instruction_body(addr, instr); +} +std::string CodeGenerator::translate_instruction_body(uint32_t addr, uint32_t instr) { uint32_t opcode = (instr >> 26) & 0x3F; uint32_t funct = instr & 0x3F; @@ -2078,6 +2088,7 @@ std::string CodeGenerator::translate_basic_block( } else { // Control flow is handled at block exit if (addr == exit_branch_addr) { + ss << config_.indent << mod_instruction_call(addr, instr); std::string delay_saved_cond; // branch condition captured before delay std::string delay_saved_target; // JR/JALR target captured before delay @@ -3371,6 +3382,7 @@ void CodeGenerator::emit_runtime_externs(std::ostream& ss) const { ss << "#endif\n"; ss << "extern int psx_game_text_native_ok(uint32_t addr); /* stale-static guard (dispatch shard) */\n"; ss << "extern int psx_datashard_enter(CPUState* cpu, uint32_t key); /* data-shard replay/capture (data_shards.c) */\n"; + ss << "extern void psx_mod_instruction(CPUState*, uint32_t, uint32_t);\n"; ss << "extern int psx_mod_function_entry(CPUState* cpu, uint32_t address); /* trusted opt-in game-mod hook */\n"; ss << "extern void psx_datashard_ret(CPUState* cpu); /* data-shard capture finalize */\n"; ss << "extern int psx_vsync_query_hle_enter(CPUState* cpu, uint32_t func, uint32_t counter_addr, uint32_t gpustat_ptr_addr, uint32_t timer1_ptr_addr, uint32_t timer1_cache_addr); /* load_accel.c */\n"; diff --git a/recompiler/src/config_loader.cpp b/recompiler/src/config_loader.cpp index c1baf498..45a95d5d 100644 --- a/recompiler/src/config_loader.cpp +++ b/recompiler/src/config_loader.cpp @@ -62,6 +62,7 @@ uint32_t overlay_codegen_config_hash(const GameConfig& c) { h.words("sprite_tag_funcs", c.ws_sprite_tag_funcs); h.words("mod_function_entry_funcs", c.mod_function_entry_funcs); + h.words("mod_instruction_sites", c.mod_instruction_sites); h.words("cull_bias", c.ws_cull_bias_sites); h.words("cull_range", c.ws_cull_range_sites); h.words("cull_a1", c.ws_cull_a1_sites); @@ -1497,6 +1498,14 @@ GameConfig load_game_config(const fs::path& config_path_in) { } // Optional [recompiler] hot_funcs — __attribute__((hot)) on emitted C. // Optional trusted, statically linked game-mod entry hooks. + std::vector mod_instruction_sites; + if (recomp.contains("mod_instruction_sites")) + for (const auto& a : toml::find>(recomp, "mod_instruction_sites")) { + const auto pc = parse_hex(a, "recompiler.mod_instruction_sites"); + if ((pc & 3u) || pc >= 0xC0000000u || (pc & 0x1FFFFFFFu) >= 0x00800000u) + throw std::runtime_error("mod instruction site must be aligned main RAM"); + mod_instruction_sites.push_back(pc); + } std::vector mod_function_entry_funcs; if (recomp.contains("mod_function_entry_funcs")) { const auto& arr = toml::find>( @@ -2208,6 +2217,7 @@ GameConfig load_game_config(const fs::path& config_path_in) { /*ws_auto_ui_squash*/ ws_auto_ui_squash, /*data_shard_funcs*/ data_shard_funcs, /*mod_function_entry_funcs*/ mod_function_entry_funcs, + /*mod_instruction_sites*/ mod_instruction_sites, /*hot_funcs*/ hot_funcs, /*load_charge_batch*/ load_charge_batch, /*load_charge_batch_funcs*/ load_charge_batch_funcs, diff --git a/recompiler/src/config_loader.h b/recompiler/src/config_loader.h index c9a95d14..b0d305bf 100644 --- a/recompiler/src/config_loader.h +++ b/recompiler/src/config_loader.h @@ -868,6 +868,8 @@ struct GameConfig { // entries that dispatch trusted, statically linked mod callbacks. Empty by // default, so projects that do not opt in emit no callback overhead. std::vector mod_function_entry_funcs; + // Opt-in pre-instruction callbacks; plugins supply exact-word guards. + std::vector mod_instruction_sites; // [recompiler] hot_funcs: guest addresses that get __attribute__((hot)) // on their generated C bodies (profile/host locality; no guest semantics). diff --git a/recompiler/src/full_function_emitter.cpp b/recompiler/src/full_function_emitter.cpp index b6bf9d26..6b299e5c 100644 --- a/recompiler/src/full_function_emitter.cpp +++ b/recompiler/src/full_function_emitter.cpp @@ -1792,6 +1792,8 @@ void FullFunctionEmitter::emit_dispatch( out += " * NULL (the default) = pure LLE, dispatch identical to a build without\n"; out += " * the tier. */\n"; out += "extern int (*g_psx_bios_hle_hook)(CPUState* cpu, uint32_t phys);\n\n"; + out += "extern uint32_t g_psx_mod_guest_functions;\n"; + out += "extern int psx_mod_dispatch_guest_function(CPUState*, uint32_t);\n\n"; out += "#ifdef PSX_HAS_GAME_DISPATCH\n"; out += "extern int psx_game_address_in_text(uint32_t addr);\n"; out += "#endif\n\n"; @@ -2168,6 +2170,8 @@ void FullFunctionEmitter::emit_dispatch( out += " cpu->pc = 0;\n"; out += fmt::format(" int lo = 0, hi = {} - 1;\n", total_entries); out += " int found = 0;\n"; + out += " if (g_psx_mod_guest_functions)\n"; + out += " found = psx_mod_dispatch_guest_function(cpu, addr);\n"; out += " /* BIOS HLE tier: consult the hook FIRST, on the pre-normalize\n"; out += " * physical address. It must see (a) the A0/B0/C0 service vectors\n"; out += " * (game thunks jr there with the function number in $t1) and (b)\n"; @@ -2176,7 +2180,7 @@ void FullFunctionEmitter::emit_dispatch( out += " * backends. Handled (rc 1) \xE2\x87\x92 the service completed against guest\n"; out += " * state and the guest resumes at $ra via the trampoline's normal\n"; out += " * return/tail contract below. rc 0 \xE2\x87\x92 pure LLE fall-through. */\n"; - out += " if (g_psx_bios_hle_hook &&\n"; + out += " if (!found && g_psx_bios_hle_hook &&\n"; out += " g_psx_bios_hle_hook(cpu, addr & 0x1FFFFFFFu)) {\n"; out += " cpu->pc = cpu->gpr[31];\n"; out += " found = 1;\n"; diff --git a/recompiler/src/main_psx.cpp b/recompiler/src/main_psx.cpp index 52685b77..7bc21d64 100644 --- a/recompiler/src/main_psx.cpp +++ b/recompiler/src/main_psx.cpp @@ -195,6 +195,7 @@ int main(int argc, char** argv) { bool reachable_discovery = false; std::set ws_tag_funcs; // [widescreen] sprite_tag_funcs std::set ds_funcs; // [data_shards] funcs + std::set mod_instruction_sites; std::set mod_entry_funcs; // trusted game-mod entry hooks std::set hot_funcs; // [recompiler] hot_funcs std::set load_charge_batch_funcs; // [recompiler] load_charge_batch* @@ -252,6 +253,7 @@ int main(int argc, char** argv) { ds_funcs.insert(cfg.data_shard_funcs.begin(), cfg.data_shard_funcs.end()); mod_entry_funcs.insert(cfg.mod_function_entry_funcs.begin(), cfg.mod_function_entry_funcs.end()); + mod_instruction_sites.insert(cfg.mod_instruction_sites.begin(), cfg.mod_instruction_sites.end()); hot_funcs.insert(cfg.hot_funcs.begin(), cfg.hot_funcs.end()); if (cfg.load_charge_batch) { load_charge_batch_funcs.insert(cfg.load_charge_batch_funcs.begin(), @@ -358,6 +360,7 @@ int main(int argc, char** argv) { ws_tag_funcs.insert(wscfg.ws_sprite_tag_funcs.begin(), wscfg.ws_sprite_tag_funcs.end()); mod_entry_funcs.insert(wscfg.mod_function_entry_funcs.begin(), wscfg.mod_function_entry_funcs.end()); + mod_instruction_sites.insert(wscfg.mod_instruction_sites.begin(), wscfg.mod_instruction_sites.end()); ws_cull_bias.insert(wscfg.ws_cull_bias_sites.begin(), wscfg.ws_cull_bias_sites.end()); ws_cull_range.insert(wscfg.ws_cull_range_sites.begin(), wscfg.ws_cull_range_sites.end()); ws_cull_a1.insert(wscfg.ws_cull_a1_sites.begin(), wscfg.ws_cull_a1_sites.end()); @@ -1226,6 +1229,7 @@ int main(int argc, char** argv) { codegen_config.ws_sprite_tag_funcs = ws_tag_funcs; codegen_config.data_shard_funcs = ds_funcs; codegen_config.mod_function_entry_funcs = mod_entry_funcs; + codegen_config.mod_instruction_sites = mod_instruction_sites; codegen_config.hot_funcs = hot_funcs; codegen_config.load_charge_batch_funcs = load_charge_batch_funcs; codegen_config.vsync_query_hle_funcs = vsync_query_hle_funcs; diff --git a/recompiler/tests/full_function_emitter_test.cpp b/recompiler/tests/full_function_emitter_test.cpp index f30f49af..64ea8556 100644 --- a/recompiler/tests/full_function_emitter_test.cpp +++ b/recompiler/tests/full_function_emitter_test.cpp @@ -260,6 +260,19 @@ void patch_range_delay_boundaries(BiosConfig config) { } } +void mod_guest_dispatch_precedes_hardware_routes() { + const auto result = run_case("mod-guest-dispatch", {0x03E00008u, 0u}, + {function_at(kBase, kBase + 4u, {kBase})}); + const auto dispatch = result.dispatch.find("static void psx_dispatch_impl("); + const auto hook = result.dispatch.find("found = psx_mod_dispatch_guest_function(cpu, addr)", dispatch); + const auto hle = result.dispatch.find("if (!found && g_psx_bios_hle_hook", dispatch); + const auto hardware = result.dispatch.find("if (!found && psx_bios_try_native_call_stub", dispatch); + expect(dispatch != std::string::npos && hook > dispatch && hook < hle && hle < hardware, + "mod-defined guest calls are handled before address normalization and hardware dispatch"); + expect(result.dispatch.find("if (g_psx_mod_guest_functions)", dispatch) < hook, + "no active mod guest functions keeps the dispatch path dormant"); +} + int main() { BiosConfig config{}; config.config_path = "test://full-function-emitter"; @@ -282,6 +295,7 @@ int main() { fragment_split_load_falls_back(); noncomplementary_lwl_falls_back(); complementary_lwl_lwr_stays_native(); + mod_guest_dispatch_precedes_hardware_routes(); patch_range_guards(config); patch_range_delay_boundaries(config); diff --git a/recompiler/tests/recompiler_patch_test.cpp b/recompiler/tests/recompiler_patch_test.cpp index cf992ea3..294081a0 100644 --- a/recompiler/tests/recompiler_patch_test.cpp +++ b/recompiler/tests/recompiler_patch_test.cpp @@ -1202,6 +1202,34 @@ void mod_function_completion_codegen_test() { "unconfigured functions retain the stock entry path"); } +void mod_instruction_codegen_test(const fs::path& root) { + const auto path = write_config(root, "instruction-hooks", + "mod_instruction_sites = [\"0x80010000\", \"0x80010004\"]\n"); + const auto parsed = PSXRecompV4::load_game_config(path); + check(parsed.mod_instruction_sites.size() == 2, "instruction sites parse"); + auto changed = parsed; + changed.mod_instruction_sites.clear(); + check(PSXRecompV4::overlay_codegen_config_hash(parsed) != + PSXRecompV4::overlay_codegen_config_hash(changed), "instruction sites invalidate cached code"); + const auto invalid = write_config(root, "instruction-unaligned", + "mod_instruction_sites = [\"0x80010001\"]\n"); + check_throws([&] { PSXRecompV4::load_game_config(invalid); }, "aligned main RAM", + "instruction sites reject invalid addresses"); + PSXRecomp::CodeGenConfig config{}; + config.mod_instruction_sites = {0x80010000u, 0x80010004u}; + for (bool overlay : {false, true}) { + for (uint32_t word : {0x2402002Au, 0x10400002u}) { + const auto code = generate_first_instruction(word, {}, overlay, config); + check(code.find(fmt::format("psx_mod_instruction(cpu, 0x80010000u, 0x{:08X}u);", word)) != std::string::npos, + "native/overlay emits instruction guard for ALU and branch"); + check(code.find("psx_mod_instruction(cpu, 0x80010004u, 0x00000000u);") != std::string::npos, + "native/overlay includes sequential and branch delay-slot hooks"); + } + } + check(generate_first_instruction(0x2402002Au, {}, false).find("psx_mod_instruction(cpu,") == std::string::npos, + "unconfigured code emits no instruction callbacks"); +} + void cfg_fallthrough_reachability_test() { constexpr uint32_t base = 0x80010000u; PSXRecomp::PS1Executable exe{}; @@ -1252,6 +1280,7 @@ int main() { jump_table_producer_codegen_test(); cfg_codegen_load_delay_test(); mod_function_completion_codegen_test(); + mod_instruction_codegen_test(root); cfg_fallthrough_reachability_test(); } catch (const std::exception& e) { fmt::print(stderr, "FAIL unexpected exception: {}\n", e.what()); diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index ec81d585..06b16eb9 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -488,6 +488,7 @@ if(BUILD_TESTING) add_executable(mod_runtime_test tests/test_mod_runtime.cpp + src/iso_reader_c.cpp src/mod_runtime.cpp src/mod_packages.cpp src/mod_media.cpp diff --git a/runtime/include/mod_packages.h b/runtime/include/mod_packages.h index 04be60ec..c067c255 100644 --- a/runtime/include/mod_packages.h +++ b/runtime/include/mod_packages.h @@ -529,6 +529,8 @@ bool mod_register_vblank_plugin(const std::string& id, void (*callback)(void)); * select it by id, and it runs only while a resolved plan activates that id. */ bool mod_register_function_entry_plugin(const std::string& id, uint32_t address, PSXModFunctionEntryCallback callback); +bool mod_register_guest_function_plugin(const std::string& id, uint32_t address, + PSXModFunctionEntryCallback callback); bool mod_plugin_registered(const std::string& id); void mod_invoke_activation_plugin(const std::string& id); void mod_invoke_vblank_plugin(const std::string& id); @@ -539,6 +541,14 @@ struct ModFunctionEntryHook { /* Hooks one implementation registered, in registration order. mod_runtime * flattens these into an address table when the plan's plugins activate. */ std::vector mod_function_entry_hooks(const std::string& id); +std::vector mod_guest_functions(const std::string& id); +struct ModInstructionHook { + uint32_t address, expected; + PSXModFunctionEntryCallback callback; +}; +bool mod_register_instruction_plugin(const std::string& id, uint32_t address, + uint32_t expected, PSXModFunctionEntryCallback callback); +std::vector mod_instruction_hooks(const std::string& id); void mod_clear_plugins_for_tests(); /* Every id a trusted implementation registered (activation, vblank or diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 04685b1e..5a1d3409 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -23,6 +23,26 @@ int psx_mod_register_vblank_plugin(const char* id, PSXModVBlankCallback callback); int psx_mod_register_function_entry_plugin( const char* id, uint32_t address, PSXModFunctionEntryCallback callback); +/* Mod-defined guest functions have no original machine-code body. Addresses + * must be aligned and in physical 0x0F000000..0x0FFFFFFF (an unused bus range), + * never hardware/BIOS/game text. Only statically linked code can register one; + * the active package plan owns its availability and resource context. Address + * aliases share one globally unique registration. The callback supplies the + * full function behavior; return publishes $ra through normal dispatch. */ +int psx_mod_register_guest_function_plugin( + const char* id, uint32_t address, PSXModFunctionEntryCallback callback); +int psx_mod_dispatch_guest_function(struct CPUState* cpu, uint32_t address); +extern uint32_t g_psx_mod_guest_functions; +/* Run immediately before a configured instruction, including delay slots. + * The complete instruction word must match both registration and live RAM. + * Callbacks may update registers/data but cannot redirect PC, finish a guest + * function, or re-enter guest execution (pending load/branch state is live). + * Native emits opt in with [recompiler] mod_instruction_sites; dirty-RAM + * execution uses the same guarded table. Inactive plans are inert. */ +int psx_mod_register_instruction_plugin(const char* id, uint32_t address, + uint32_t expected, PSXModFunctionEntryCallback callback); +void psx_mod_instruction(struct CPUState* cpu, uint32_t address, uint32_t instruction); +extern uint32_t g_psx_mod_instruction_hooks; /* Called from generated functions listed by the game config and from every * interpreted entry, so the hook contract does not depend on the backend. * Hooks match by code address (segment bits ignored) and run only for plugins @@ -213,6 +233,15 @@ int psx_mod_current_resource_path(const char* resource_id, int psx_mod_current_resource_bytes(const char* resource_id, const uint8_t** bytes, uint64_t* size); +/* Append raw Mode-2 sectors (2336 bytes, starting with the XA subheader) + * from a verified resource owned by this activation callback. Returns their + * native CD LBA in first_lba. Registration is deterministic, append-only and + * rejected outside activation, for invalid ranges or beyond 99:59:74. + * The immutable committed snapshot remains mounted until the plan changes; + * no host path or donor data is saved into guest RAM/savestates. */ +int psx_mod_append_disc_extent(const char* resource_id, uint64_t byte_offset, + uint32_t sector_count, uint32_t* first_lba); + /* Display aspects have no framework ceiling: the native-wide surfaces size * themselves from the live width, and each title caps its own view at what * it has validated (fixed ratio, or the adaptive maximum below). Requests diff --git a/runtime/include/mod_runtime.h b/runtime/include/mod_runtime.h index 1a448876..4d6672dd 100644 --- a/runtime/include/mod_runtime.h +++ b/runtime/include/mod_runtime.h @@ -53,6 +53,10 @@ void mod_runtime_on_vblank(void); void mod_runtime_patch_disc_sector(uint32_t lba, int raw_sector, uint8_t* bytes, uint32_t size); void mod_runtime_enable_disc_patches(void); +int mod_runtime_read_disc_extent(uint32_t lba, int raw_sector, + uint8_t* bytes, uint32_t size); +uint32_t mod_runtime_disc_extent_start(void); +uint32_t mod_runtime_disc_sector_count(uint32_t base_count); #ifdef __cplusplus } diff --git a/runtime/include/overlay_api.h b/runtime/include/overlay_api.h index f610d39e..c381a556 100644 --- a/runtime/include/overlay_api.h +++ b/runtime/include/overlay_api.h @@ -113,7 +113,7 @@ * in overlay code (all sign-branch shapes). Appended last; NULL keeps the * native sign. */ /* v26: trusted entry hooks return whether they completed the guest function. */ -#define PSX_OVERLAY_ABI_VERSION 26 +#define PSX_OVERLAY_ABI_VERSION 27 /* Process-lifetime overlay candidate capacity. Every accepted manifest F * record consumes one slot, even when another DLL carries an identical @@ -356,6 +356,8 @@ typedef struct { int32_t (*ws_cull_scale)(int32_t bound, int32_t half_extent); /* Exact-NCLIP branch sign (ABI v25). */ int32_t (*nclip_exact_sign)(int32_t native_mac0, uint32_t pc); + /* Guarded pre-instruction mod callback (ABI v27). */ + void (*mod_instruction)(CPUState*, uint32_t, uint32_t); } OverlayCallbacks; #ifdef __cplusplus diff --git a/runtime/include/overlay_dispatch_preamble.c.inc b/runtime/include/overlay_dispatch_preamble.c.inc index c0a58ada..0929c090 100644 --- a/runtime/include/overlay_dispatch_preamble.c.inc +++ b/runtime/include/overlay_dispatch_preamble.c.inc @@ -233,6 +233,10 @@ int32_t psx_ws_player_x_bound(int32_t vanilla) { int32_t psx_ws_screen_x_bound(int32_t vanilla) { return g_cbs.ws_screen_x_bound ? g_cbs.ws_screen_x_bound(vanilla) : vanilla; } +void psx_mod_instruction(CPUState *cpu, uint32_t address, uint32_t word) { + overlay_flush_cycles(); + if (g_cbs.mod_instruction) g_cbs.mod_instruction(cpu, address, word); +} int psx_mod_function_entry(CPUState *cpu, uint32_t address) { overlay_flush_cycles(); return g_cbs.mod_function_entry ? g_cbs.mod_function_entry(cpu, address) : 0; diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index 8d723d2c..e39f5b0b 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -1460,6 +1460,10 @@ static int exec_one_fetched(CPUState *cpu, uint32_t pc, uint32_t insn, } } + extern uint32_t g_psx_mod_instruction_hooks; + extern void psx_mod_instruction(CPUState*, uint32_t, uint32_t); + if (g_psx_mod_instruction_hooks) psx_mod_instruction(cpu, pc, insn); + /* op 0x20..0x26 = LB/LH/LWL/LW/LBU/LHU/LWR. LWC2 (GTE, 0x32) targets a COP2 * register, not a GPR, so it needs no deferral here. */ const uint32_t ld_op = op_field(insn); diff --git a/runtime/src/iso_reader_c.cpp b/runtime/src/iso_reader_c.cpp index 0dc8e173..e77638ae 100644 --- a/runtime/src/iso_reader_c.cpp +++ b/runtime/src/iso_reader_c.cpp @@ -7,6 +7,7 @@ #include "iso_reader.h" #include "mod_runtime.h" #include +#include extern "C" { @@ -20,18 +21,17 @@ void* iso_open(const char* path) { } int iso_read_sector(void* handle, uint32_t lba, uint8_t* buffer, int size) { - if (!handle) return 0; + if (!handle || !buffer || size < 2048) return 0; auto* reader = static_cast(handle); - (void)size; /* ReadSector always reads 2048 bytes */ - if (!reader->ReadSector(lba, buffer)) return 0; + if (!mod_runtime_read_disc_extent(lba, 0, buffer, size) && !reader->ReadSector(lba, buffer)) return 0; mod_runtime_patch_disc_sector(lba, 0, buffer, 2048); return 1; } int iso_read_raw_sector(void* handle, uint32_t lba, uint8_t* buffer, int size) { - if (!handle || size < 2352) return 0; + if (!handle || !buffer || size < 2352) return 0; auto* reader = static_cast(handle); - if (!reader->ReadRawSector(lba, buffer)) return 0; + if (!mod_runtime_read_disc_extent(lba, 1, buffer, size) && !reader->ReadRawSector(lba, buffer)) return 0; mod_runtime_patch_disc_sector(lba, 1, buffer, 2352); return 1; } @@ -39,6 +39,23 @@ int iso_read_raw_sector(void* handle, uint32_t lba, uint8_t* buffer, int size) { int iso_read_subq(void* handle, uint32_t lba, uint8_t* buffer, int size, int* valid) { if (!handle || !buffer || size < 12 || !valid) return 0; + const auto* reader=static_cast(handle); + const uint32_t start=mod_runtime_disc_extent_start(); + if (start && lba>=start && lbaTrackCount()+1);buffer[2]=1; + const uint32_t rel=lba-start,abs=lba+150; + buffer[3]=bcd(rel/4500);buffer[4]=bcd(rel/75%60);buffer[5]=bcd(rel%75); + buffer[6]=bcd(abs/4500);buffer[7]=bcd(abs/75%60);buffer[8]=bcd(abs%75); + uint16_t crc=0; + for(unsigned i=0;i<10;++i) { + crc^=uint16_t(buffer[i])<<8; + for(unsigned j=0;j<8;++j)crc=uint16_t((crc<<1)^((crc&0x8000)?0x1021:0)); + } + crc=uint16_t(~crc);buffer[10]=uint8_t(crc);buffer[11]=uint8_t(crc>>8); + *valid=1;return 1; + } bool crc_valid = false; if (!static_cast(handle)->ReadSubChannelQ( lba, buffer, &crc_valid)) return 0; @@ -53,22 +70,25 @@ int iso_has_subq_replacements(void* handle) { uint32_t iso_sector_count(void* handle) { if (!handle) return 0; auto* reader = static_cast(handle); - return reader->GetSectorCount(); + return mod_runtime_disc_sector_count(reader->GetSectorCount()); } /* CD-track TOC accessors (multi-track / CD-DA support). track is 1-based. */ int iso_track_count(void* handle) { if (!handle) return 1; - return static_cast(handle)->TrackCount(); + return static_cast(handle)->TrackCount() + (mod_runtime_disc_extent_start()?1:0); } uint32_t iso_track_start_lba(void* handle, int track) { if (!handle) return 0; - return static_cast(handle)->TrackStartLBA(track); + auto* reader=static_cast(handle); + if (track==reader->TrackCount()+1 && mod_runtime_disc_extent_start()) return mod_runtime_disc_extent_start(); + return reader->TrackStartLBA(track); } uint32_t iso_track_pregap_lba(void* handle, int track) { auto* reader = static_cast(handle); + if (reader && track==reader->TrackCount()+1 && mod_runtime_disc_extent_start()) return mod_runtime_disc_extent_start(); return reader ? reader->TrackPregapLBA(track) : 0; } diff --git a/runtime/src/mod_packages.cpp b/runtime/src/mod_packages.cpp index c417135f..45097c3d 100644 --- a/runtime/src/mod_packages.cpp +++ b/runtime/src/mod_packages.cpp @@ -39,6 +39,8 @@ struct RegisteredPlugin { /* Generated-function entry hooks, keyed by guest address. One id may * observe several functions. */ std::vector> function_entries; + std::vector guest_functions; + std::vector instructions; }; std::map& registered_plugins() { @@ -1475,7 +1477,45 @@ bool mod_plugin_registered(const std::string& id) { const auto found = registered_plugins().find(id); return found != registered_plugins().end() && (found->second.activation || found->second.vblank || - !found->second.function_entries.empty()); + !found->second.function_entries.empty() || !found->second.guest_functions.empty() || + !found->second.instructions.empty()); +} + +bool mod_register_guest_function_plugin(const std::string& id, uint32_t address, + PSXModFunctionEntryCallback callback) { + const uint32_t key = address & 0x1FFFFFFFu; + if (!valid_id(id) || !callback || (address & 3u) || + key < 0x0F000000u || key >= 0x10000000u || address >= 0xC0000000u) + return false; + for (const auto& plugin : registered_plugins()) + for (const auto& function : plugin.second.guest_functions) + if (function.address == key) return false; + registered_plugins()[id].guest_functions.push_back({key, callback}); + return true; +} + +std::vector mod_guest_functions(const std::string& id) { + const auto found = registered_plugins().find(id); + return found == registered_plugins().end() + ? std::vector{} : found->second.guest_functions; +} + +bool mod_register_instruction_plugin(const std::string& id, uint32_t address, + uint32_t expected, PSXModFunctionEntryCallback callback) { + if (!valid_id(id) || !callback || (address & 3u) || address >= 0xC0000000u || + (address & 0x1FFFFFFFu) >= 0x00800000u) return false; + auto& hooks = registered_plugins()[id].instructions; + const uint32_t key = address & 0x1FFFFFFFu; + for (const auto& hook : hooks) + if (hook.address == key) return false; + hooks.push_back({key, expected, callback}); + return true; +} + +std::vector mod_instruction_hooks(const std::string& id) { + const auto found = registered_plugins().find(id); + return found == registered_plugins().end() + ? std::vector{} : found->second.instructions; } void mod_invoke_activation_plugin(const std::string& id) { @@ -1507,7 +1547,7 @@ std::vector mod_registered_plugin_ids() { std::vector ids; for (const auto& entry : registered_plugins()) if (entry.second.activation || entry.second.vblank || - !entry.second.function_entries.empty()) + !entry.second.function_entries.empty() || !entry.second.guest_functions.empty()) ids.push_back(entry.first); return ids; /* std::map keeps them sorted */ } diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index ea867683..962d2e95 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -54,6 +54,8 @@ extern "C" int fntrace_is_game_started(void); /* Declared in mod_plugins.h; see active_function_entry_hooks() below. */ uint32_t g_psx_mod_function_entry_hooks = 0; +uint32_t g_psx_mod_guest_functions = 0; +uint32_t g_psx_mod_instruction_hooks = 0; /* Guest vblanks seen by the mod runtime: the plugin counters' time base. */ static uint64_t g_mod_vblanks = 0; @@ -61,6 +63,10 @@ namespace PSXRecompV4 { namespace { struct RuntimeMods { + struct DiscExtent { uint32_t lba, count; const uint8_t* data; }; + std::vector disc_extents; + uint32_t extent_start = 0; + bool activating = false; ModPackageManager manager; ModResolution plan; ModResolution validation; @@ -134,6 +140,21 @@ std::vector& active_function_entry_hooks() { return value; } +std::vector& active_guest_functions() { + static std::vector value; + return value; +} + +struct ActiveInstructionHook { + uint32_t key, expected; + PSXModFunctionEntryCallback callback; + const ModResolution::Plugin* plugin; +}; +std::vector& active_instruction_hooks() { + static std::vector value; + return value; +} + inline uint32_t function_entry_key(uint32_t address) { return address & 0x1FFFFFFFu; } @@ -141,6 +162,10 @@ inline uint32_t function_entry_key(uint32_t address) { void clear_function_entry_hooks() { active_function_entry_hooks().clear(); g_psx_mod_function_entry_hooks = 0; + active_guest_functions().clear(); + g_psx_mod_guest_functions = 0; + active_instruction_hooks().clear(); + g_psx_mod_instruction_hooks = 0; } void build_function_entry_hooks(const RuntimeMods& s) { @@ -155,6 +180,20 @@ void build_function_entry_hooks(const RuntimeMods& s) { [](const ActiveFunctionEntryHook& a, const ActiveFunctionEntryHook& b) { return a.key < b.key; }); g_psx_mod_function_entry_hooks = (uint32_t)table.size(); + auto& functions = active_guest_functions(); + for (const auto& plugin : s.plan.plugins) + for (const auto& function : mod_guest_functions(plugin.id)) + functions.push_back({function.address, function.callback, &plugin}); + std::sort(functions.begin(), functions.end(), + [](const auto& a, const auto& b) { return a.key < b.key; }); + g_psx_mod_guest_functions = (uint32_t)functions.size(); + auto& instructions = active_instruction_hooks(); + for (const auto& plugin : s.plan.plugins) + for (const auto& hook : mod_instruction_hooks(plugin.id)) + instructions.push_back({hook.address, hook.expected, hook.callback, &plugin}); + std::stable_sort(instructions.begin(), instructions.end(), + [](const auto& a, const auto& b) { return a.key < b.key; }); + g_psx_mod_instruction_hooks = (uint32_t)instructions.size(); } const ModPackage* selected_package(const std::string& id) { @@ -1183,6 +1222,8 @@ bool mod_runtime_initialize(const std::filesystem::path& root, RuntimeMods& s = state(); s.manager.set_root({}); clear_function_entry_hooks(); + s.disc_extents.clear(); + s.extent_start = 0; s.plan = {}; s.validation = {}; s.raw_disc_index.clear(); @@ -1237,6 +1278,8 @@ bool mod_runtime_clear_for_netplay(std::string* error) { return true; } clear_function_entry_hooks(); + s.disc_extents.clear(); + s.extent_start = 0; s.plan = {}; s.validation = {}; s.raw_disc_index.clear(); @@ -1310,6 +1353,8 @@ bool mod_runtime_commit(const std::filesystem::path& disc_path, std::string* err /* Hooks follow activation, never a bare commit: a new plan runs none of * its function-entry hooks until mod_runtime_activate_plugins(). */ clear_function_entry_hooks(); + s.disc_extents.clear(); + s.extent_start = 0; s.plan = std::move(plan); build_disc_index(s); s.effective_disc_path = std::move(effective_disc); @@ -1402,6 +1447,67 @@ extern "C" void mod_runtime_enable_disc_patches(void) { PSXRecompV4::state().disc_enabled = true; } +extern "C" int psx_mod_append_disc_extent(const char* resource_id, + uint64_t byte_offset, uint32_t sector_count, uint32_t* first_lba) { + using namespace PSXRecompV4; + if (first_lba) *first_lba = 0; + auto& s = state(); + const uint8_t* data = nullptr; + uint64_t size = 0; + if (!s.activating || !first_lba || !sector_count || + !psx_mod_current_resource_bytes(resource_id, &data, &size) || + byte_offset > size || uint64_t(sector_count)*2336 > size-byte_offset) return 0; + try { + uint32_t start = s.extent_start; + if (s.disc_extents.empty()) { + PS1::ISOReader reader; + const auto& mount = s.effective_disc_path.empty() ? s.disc_path : s.effective_disc_path; + if (mount.empty() || !reader.Open(mount.string()) || reader.TrackCount() >= 99) return 0; + start = reader.GetSectorCount(); + if (!start) return 0; + } + const uint32_t lba = s.disc_extents.empty() ? start : + s.disc_extents.back().lba + s.disc_extents.back().count; + if (uint64_t(lba)+sector_count+150 > 450000) return 0; + // Mode-2's duplicated subheader is part of the format contract. + for (uint32_t i=0; i=e.lba && lba-e.lba= 0xC0000000u) return 0; + const auto& functions = active_guest_functions(); + const uint32_t key = function_entry_key(address); + auto it = std::lower_bound(functions.begin(), functions.end(), key, + [](const auto& function, uint32_t k) { return function.key < k; }); + if (it == functions.end() || it->key != key) return 0; + PluginCallbackScope scope(state(), it->plugin, cpu); + it->callback(cpu, address); + cpu->pc = cpu->gpr[31]; + return 1; +} + +extern "C" int psx_mod_register_instruction_plugin(const char* id, uint32_t address, + uint32_t expected, PSXModFunctionEntryCallback callback) { + return id && PSXRecompV4::mod_register_instruction_plugin(id, address, expected, callback); +} + +extern "C" void psx_mod_instruction(CPUState* cpu, uint32_t address, uint32_t instruction) { + using namespace PSXRecompV4; + if (!g_psx_mod_instruction_hooks || !cpu || address >= 0xC0000000u) return; + const auto& hooks = active_instruction_hooks(); + const auto key = function_entry_key(address); + auto it = std::lower_bound(hooks.begin(), hooks.end(), key, + [](const auto& h, uint32_t k) { return h.key < k; }); + for (; it != hooks.end() && it->key == key; ++it) { + if (it->expected != instruction || psx_mod_read_word(address) != instruction) continue; + PluginCallbackScope scope(state(), it->plugin, nullptr); + const uint32_t pc = cpu->pc; + it->callback(cpu, address); + if (cpu->pc != pc) std::abort(); + cpu->gpr[0] = 0; + } +} + extern "C" int psx_mod_function_entry(CPUState* cpu, uint32_t address) { using namespace PSXRecompV4; if (!g_psx_mod_function_entry_hooks || !cpu) return 0; diff --git a/runtime/src/overlay_loader.c b/runtime/src/overlay_loader.c index be9a4419..ec7b0c85 100644 --- a/runtime/src/overlay_loader.c +++ b/runtime/src/overlay_loader.c @@ -2474,6 +2474,8 @@ static void init_callbacks(void) { extern int psx_mod_function_entry(CPUState *cpu, uint32_t address); s_callbacks.ws_screen_x_bound = psx_ws_screen_x_bound; s_callbacks.mod_function_entry = psx_mod_function_entry; + extern void psx_mod_instruction(CPUState*, uint32_t, uint32_t); + s_callbacks.mod_instruction = psx_mod_instruction; } /* ABI v14: GTE precision-store tracker — the emitter emits a direct * gte_precision_store_word() call for every swc2 (GTE store-word), diff --git a/runtime/tests/test_interp_mod_entry_guards.py b/runtime/tests/test_interp_mod_entry_guards.py index f8c3c2a6..e2a12204 100644 --- a/runtime/tests/test_interp_mod_entry_guards.py +++ b/runtime/tests/test_interp_mod_entry_guards.py @@ -6,6 +6,11 @@ from pathlib import Path def main(): source = (Path(__file__).resolve().parents[1] / 'src/dirty_ram_interp.c').read_text(encoding='utf-8') + fetched = source[source.index('static int exec_one_fetched(CPUState *cpu, uint32_t pc, uint32_t insn,\n uint32_t *next_pc_out) {'):] + fetched = fetched[:fetched.index('const uint32_t ld_op')] + assert fetched.count('psx_mod_instruction(cpu, pc, insn)') == 1 + assert fetched.index('if (s_ld_pend_armed') < fetched.index('psx_mod_instruction(cpu, pc, insn)') + assert 'if (g_psx_mod_instruction_hooks) psx_mod_instruction(cpu, pc, insn);' in fetched start = source.index('static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_addr) {') source = source[start:] static_dispatch = source[source.index('/* B-2: statically-compiled'):] diff --git a/runtime/tests/test_mod_runtime.cpp b/runtime/tests/test_mod_runtime.cpp index 4b39481a..e80ab96b 100644 --- a/runtime/tests/test_mod_runtime.cpp +++ b/runtime/tests/test_mod_runtime.cpp @@ -123,6 +123,30 @@ static void test_active_entry(CPUState* cpu, uint32_t address) { static void test_disabled_entry(CPUState*, uint32_t) { disabled_entry_hits++; } static void test_unselected_entry(CPUState*, uint32_t) { unselected_entry_hits++; } +static int guest_function_hits; +static int instruction_hits; +static void test_instruction(CPUState* cpu, uint32_t) { + instruction_hits++; + cpu->gpr[5] = 0x80301008u; + if (psx_mod_finish_function(cpu)) failures++; +} +static void test_guest_function(CPUState* cpu, uint32_t) { + guest_function_hits++; + const uint32_t ra = cpu->gpr[31]; + CPUState nested{}; + nested.gpr[31] = 0x80007000u; + const int mode = entry_test_mode; + entry_test_mode = 1; + if (!psx_mod_function_entry(&nested, 0x80003000u) || nested.pc != nested.gpr[31]) failures++; + entry_test_mode = mode; + interrupted_entry_cpu = cpu; + mod_runtime_on_vblank(); + interrupted_entry_cpu = nullptr; + if (!psx_mod_finish_function(cpu)) failures++; + cpu->gpr[2] = cpu->gpr[4] + 7u; + if (cpu->gpr[31] != ra) failures++; +} + static void test_activation_plugin(void) { activation_calls++; } @@ -130,11 +154,29 @@ static void test_activation_plugin(void) { static const uint8_t* media_snapshot; static uint64_t media_size; static int media_access, foreign_media_access; +static uint32_t mounted_lba; +static int extent_ok, invalid_extent, foreign_extent; static void test_media_plugin(void) { media_access = psx_mod_current_resource_bytes("rom", &media_snapshot, &media_size); const uint8_t* foreign = nullptr; uint64_t size = 0; foreign_media_access = psx_mod_current_resource_bytes("private", &foreign, &size); + extent_ok=psx_mod_append_disc_extent("xa",0,2,&mounted_lba); + uint32_t bad=99; + invalid_extent=psx_mod_append_disc_extent("xa",1,2,&bad); + foreign_extent=psx_mod_append_disc_extent("private",0,1,&bad); +} + +extern "C" { +void* iso_open(const char*); +void iso_close(void*); +int iso_read_raw_sector(void*,uint32_t,uint8_t*,int); +int iso_read_sector(void*,uint32_t,uint8_t*,int); +int iso_read_subq(void*,uint32_t,uint8_t*,int,int*); +uint32_t iso_sector_count(void*); +int iso_track_count(void*); +uint32_t iso_track_start_lba(void*,int); +int iso_track_is_audio(void*,int); } static int big_ram_activations; @@ -384,18 +426,52 @@ int main() { "runtime.unselected-entry", 0x80003000u, test_unselected_entry) == 1, "unselected function-entry hook must register"); CPUState entry_cpu{}; + check(psx_mod_register_instruction_plugin("runtime.test-vblank", 0x80003004u, + 0x90A30014u, test_instruction), "register guarded instruction callback"); + check(!psx_mod_register_instruction_plugin("runtime.test-vblank", 0xA0003004u, + 0x90A30014u, test_instruction) && + !psx_mod_register_instruction_plugin("runtime.other", 0x80003005u, + 0x90A30014u, test_instruction), "reject aliased duplicate and unaligned sites"); + psx_mod_write_word(0x80003004u, 0x90A30014u); + check(psx_mod_register_guest_function_plugin( + "runtime.test-vblank", 0x8FFF0000u, test_guest_function), + "trusted callback registers outside the hardware map"); + check(!psx_mod_register_guest_function_plugin( + "runtime.other", 0xAFFF0000u, test_guest_function) && + !psx_mod_register_guest_function_plugin("runtime.other", 0x80003000u, test_guest_function) && + !psx_mod_register_guest_function_plugin("runtime.other", 0x8FFF0001u, test_guest_function) && + !psx_mod_register_guest_function_plugin("runtime.other", 0xCFFF0000u, test_guest_function), + "guest callbacks refuse alias collisions, game addresses, misalignment and KSEG2"); + check(psx_mod_register_guest_function_plugin( + "runtime.unselected-entry", 0x8FFF0004u, test_unselected_entry), + "unselected callback implementation can register"); check(PSXRecompV4::mod_runtime_initialize( root, "SLUS-RUNTIME", 0x80002000, {}, &error), error.c_str()); check(PSXRecompV4::mod_runtime_commit(cue_path, &error), "CUE and its data-track BIN must have the same mod target identity"); /* Committed but not yet activated: no hook may run. */ + psx_mod_instruction(&entry_cpu, 0x80003004u, 0x90A30014u); + check(instruction_hits == 0 && !g_psx_mod_instruction_hooks, "instruction hooks await activation"); + check(!psx_mod_dispatch_guest_function(&entry_cpu, 0x8FFF0000u) && + g_psx_mod_guest_functions == 0, + "committed guest functions remain unavailable until activation"); psx_mod_function_entry(&entry_cpu, 0x80003000u); check(g_psx_mod_function_entry_hooks == 0 && active_entry_hits == 0, "function-entry hooks must not run before plugin activation"); mod_runtime_activate_plugins(); check(activation_calls == 1, "resolved trusted plugin must activate before runtime startup"); + entry_cpu.pc = 0x80004000u; + psx_mod_instruction(&entry_cpu, 0x80003004u, 0x90A30014u); + psx_mod_instruction(&entry_cpu, 0xA0003004u, 0x90A30014u); + check(instruction_hits == 2 && entry_cpu.gpr[5] == 0x80301008u && + entry_cpu.pc == 0x80004000u, "instruction aliases preserve control flow and edit registers"); + psx_mod_instruction(&entry_cpu, 0x80003004u, 0x90A30015u); + psx_mod_write_word(0x80003004u, 0x90A30015u); + psx_mod_instruction(&entry_cpu, 0x80003004u, 0x90A30014u); + check(instruction_hits == 2, "fetched and live instruction guards reject changed code"); + psx_mod_write_word(0x80003004u, 0x90A30014u); mod_runtime_on_vblank(); check(plugin_calls == 1, "resolved trusted plugin must run on guest VBlank"); @@ -416,6 +492,11 @@ int main() { "hooks of plugins the plan does not activate must never run"); /* A replaced plan drops every hook until its own activation. */ check(PSXRecompV4::mod_runtime_clear_for_netplay(&error), error.c_str()); + psx_mod_instruction(&entry_cpu, 0x80003004u, 0x90A30014u); + check(instruction_hits == 2 && !g_psx_mod_instruction_hooks, "clearing removes instruction hooks"); + check(!psx_mod_dispatch_guest_function(&entry_cpu, 0x8FFF0000u) && + g_psx_mod_guest_functions == 0, + "clearing the plan drops guest callback availability"); psx_mod_function_entry(&entry_cpu, 0x80003000u); check(g_psx_mod_function_entry_hooks == 0 && active_entry_hits == 3, "clearing the plan must drop its function-entry hooks"); @@ -450,6 +531,24 @@ int main() { "entry completion survives VBlank callbacks during a native call"); entry_test_mode = 0; + entry_cpu.gpr[4] = 35u; + const uint32_t guest_sp = entry_cpu.gpr[29]; + check(g_psx_mod_guest_functions == 1 && + psx_mod_dispatch_guest_function(&entry_cpu, 0x8FFF0000u) && + entry_cpu.gpr[2] == 42u && entry_cpu.pc == 0x80005000u && + entry_cpu.gpr[29] == guest_sp, + "active callback returns its result through normal guest PC/stack state"); + check(psx_mod_dispatch_guest_function(&entry_cpu, 0x0FFF0000u) && + psx_mod_dispatch_guest_function(&entry_cpu, 0xAFFF0000u) && + guest_function_hits == 3, + "guest callback aliases retain nested entry and VBlank scope"); + check(!psx_mod_dispatch_guest_function(&entry_cpu, 0x8FFF0004u) && + !psx_mod_dispatch_guest_function(&entry_cpu, 0x8FFF0001u) && + !psx_mod_dispatch_guest_function(&entry_cpu, 0xCFFF0000u) && + !psx_mod_dispatch_guest_function(nullptr, 0x8FFF0000u) && + unselected_entry_hits == 0, + "unselected, unknown, misaligned and invalid callback requests fall through"); + ram[0x1000] = 1; ram[0x1001] = 2; ram[0x1002] = 3; ram[0x1003] = 4; ram[0x1100] = 0; ram[0x1101] = 0; ram[0x1102] = 1; ram[0x1103] = 0; @@ -784,6 +883,10 @@ int main() { rom[32] = 0x5a; const auto rom_path = media_root / "owner.z64"; write_bytes(rom_path, rom); + std::vector xa(2336*2); + xa[2]=xa[6]=0x64;xa[8]=0x52; + xa[2336+2]=xa[2336+6]=0xE4;xa[2336+8]=0x63; + const auto xa_path=media_root/"owner.xa";write_bytes(xa_path,xa); write_text(media_root / "packages/media.test/1.0.0/manifest.toml", "format_version = 8\nid = \"media.test\"\nversion = \"1.0.0\"\nname = \"Media Test\"\n" "[[target]]\ngame_id = \"READER\"\n" @@ -791,15 +894,17 @@ int main() { "[[feature]]\nid = \"private\"\nname = \"Private\"\n" "[[resource]]\nfeature = \"active\"\nid = \"rom\"\nlabel = \"ROM\"\n" "format = \"n64-rom\"\nrequired = true\nsize = 64\nsha256 = \"" + sha256_hex(rom) + "\"\n" + "[[resource]]\nfeature = \"active\"\nid = \"xa\"\nlabel = \"XA\"\n" + "format = \"file\"\nrequired = true\nsize = 4672\nsha256 = \"" + sha256_hex(xa) + "\"\n" "[[resource]]\nfeature = \"private\"\nid = \"private\"\nlabel = \"Private\"\n" "format = \"n64-rom\"\nrequired = true\nsize = 64\nsha256 = \"" + sha256_hex(rom) + "\"\n" "[[plugin]]\nfeature = \"active\"\nid = \"media.test.plugin\"\n"); write_text(media_root / "state.toml", "format_version = 2\n[[feature]]\npackage_id = \"media.test\"\nid = \"active\"\nenabled = true\n" - "[feature.resources]\nrom = \"" + rom_path.generic_string() + "\"\n"); + "[feature.resources]\nrom = \"" + rom_path.generic_string() + "\"\nxa = \"" + xa_path.generic_string() + "\"\n"); check(psx_mod_register_activation_plugin("media.test.plugin", test_media_plugin), "register media consumer"); check(PSXRecompV4::mod_runtime_initialize(media_root, "READER", 0, {}, &error), "media initialize"); - check(PSXRecompV4::mod_runtime_commit({}, &error), "verify and commit owner media"); + check(PSXRecompV4::mod_runtime_commit(iso_path, &error), "verify and commit owner media"); const uint8_t* unavailable = nullptr; uint64_t unavailable_size = 0; check(!psx_mod_current_resource_bytes("rom", &unavailable, &unavailable_size), "bytes unavailable outside plugin callback"); @@ -807,11 +912,34 @@ int main() { check(media_access && media_size == rom.size() && std::equal(rom.begin(), rom.end(), media_snapshot), "plugin receives exact verified bytes"); check(!foreign_media_access, "inactive feature cannot supply bytes to another feature"); + check(extent_ok && mounted_lba==24 && !invalid_extent && !foreign_extent,"activation mounts only owned bounded resource extents"); + uint32_t bad_lba=1; + check(!psx_mod_append_disc_extent("xa",0,1,&bad_lba)&&!bad_lba,"late mounting refused"); + void* mounted=iso_open(iso_path.string().c_str()); + check(mounted&&iso_sector_count(mounted)==24,"BIOS sees original disc before activation is enabled"); + mod_runtime_enable_disc_patches(); + std::array subq{};int valid=0; + check(iso_sector_count(mounted)==26&&iso_track_count(mounted)==2&& + iso_track_start_lba(mounted,2)==24&&!iso_track_is_audio(mounted,2),"appended extents expose one data track and leadout"); + check(iso_read_raw_sector(mounted,24,sector.data(),sector.size())&§or[12]==0&§or[13]==2&§or[14]==0x24&§or[15]==2&& + std::equal(xa.begin(),xa.begin()+2336,sector.begin()+16),"native raw sector header and exact XA subheader/audio bytes"); + check(iso_read_sector(mounted,25,sector.data(),sector.size())&§or[0]==0x63,"cooked access resolves the same extent"); + check(!iso_read_sector(mounted,26,sector.data(),sector.size())&& + !iso_read_raw_sector(mounted,24,sector.data(),2351),"extent end and short raw buffers rejected"); + check(iso_read_subq(mounted,24,subq.data(),subq.size(),&valid)&&valid&&subq[0]==0x41&&subq[1]==2&&subq[5]==0,"appended data track has native subchannel position"); + check(iso_read_sector(mounted,22,sector.data(),sector.size())&§or[1]==7,"base sectors unchanged"); + xa[8]=0xff;write_bytes(xa_path,xa); + check(iso_read_raw_sector(mounted,24,sector.data(),sector.size())&§or[24]==0x52,"streaming uses verified snapshot after external file changes"); + mod_runtime_activate_plugins(); + check(mounted_lba==24&&iso_sector_count(mounted)==26,"reactivation has stable LBAs and no duplicate extents"); rom[32] ^= 1; write_bytes(rom_path, rom); check(media_snapshot && media_snapshot[32] == 0x5a, "committed bytes survive owner file changes"); check(!PSXRecompV4::mod_runtime_commit({}, &error), "new commit rejects modified media"); check(PSXRecompV4::mod_runtime_clear_for_netplay(&error), "netplay clears donor plan"); + check(iso_sector_count(mounted)==24&&iso_track_count(mounted)==1&& + !iso_read_raw_sector(mounted,24,sector.data(),sector.size()),"clearing plan removes all donor sectors and restores TOC"); + iso_close(mounted); fs::remove_all(root, ec); if (failures) return 1; std::cout << "mod runtime tests passed\n"; From 6b27a1a952f21e053f3887eab5934e470c7fbfe3 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 08:44:21 -0700 Subject: [PATCH 06/52] Merge fix: guest-function hooks carry the filter slot --- generated/OpenBIOS.emitter.sha | 2 +- generated/OpenBIOS_dispatch.c | 7 ++++++- generated/SCPH1001.emitter.sha | 2 +- generated/SCPH1001_dispatch.c | 7 ++++++- runtime/src/mod_runtime.cpp | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/generated/OpenBIOS.emitter.sha b/generated/OpenBIOS.emitter.sha index 150fa94d..eb8b1ed1 100644 --- a/generated/OpenBIOS.emitter.sha +++ b/generated/OpenBIOS.emitter.sha @@ -1 +1 @@ -012434af40660484f2a6990dd9f6b2acb35d00bc514c3e85ba0a49ca211f3d33 +8fdced1ab1e5ddec820658cbfa01e434eca73a0a2af8185e4d73699b00627619 diff --git a/generated/OpenBIOS_dispatch.c b/generated/OpenBIOS_dispatch.c index 0c21063d..53da932f 100644 --- a/generated/OpenBIOS_dispatch.c +++ b/generated/OpenBIOS_dispatch.c @@ -33,6 +33,9 @@ extern void debug_server_trace_dispatch(uint32_t func_addr); * the tier. */ extern int (*g_psx_bios_hle_hook)(CPUState* cpu, uint32_t phys); +extern uint32_t g_psx_mod_guest_functions; +extern int psx_mod_dispatch_guest_function(CPUState*, uint32_t); + #ifdef PSX_HAS_GAME_DISPATCH extern int psx_game_address_in_text(uint32_t addr); #endif @@ -9090,6 +9093,8 @@ static void psx_dispatch_impl(CPUState* cpu, uint32_t addr, uint32_t stop_addr) cpu->pc = 0; int lo = 0, hi = 3990 - 1; int found = 0; + if (g_psx_mod_guest_functions) + found = psx_mod_dispatch_guest_function(cpu, addr); /* BIOS HLE tier: consult the hook FIRST, on the pre-normalize * physical address. It must see (a) the A0/B0/C0 service vectors * (game thunks jr there with the function number in $t1) and (b) @@ -9098,7 +9103,7 @@ static void psx_dispatch_impl(CPUState* cpu, uint32_t addr, uint32_t stop_addr) * backends. Handled (rc 1) ⇒ the service completed against guest * state and the guest resumes at $ra via the trampoline's normal * return/tail contract below. rc 0 ⇒ pure LLE fall-through. */ - if (g_psx_bios_hle_hook && + if (!found && g_psx_bios_hle_hook && g_psx_bios_hle_hook(cpu, addr & 0x1FFFFFFFu)) { cpu->pc = cpu->gpr[31]; found = 1; diff --git a/generated/SCPH1001.emitter.sha b/generated/SCPH1001.emitter.sha index 07b17342..e62bf8ba 100644 --- a/generated/SCPH1001.emitter.sha +++ b/generated/SCPH1001.emitter.sha @@ -1 +1 @@ -aa351622ddd9c496b61bd0982e58230cb4fc3aac6e2a5a1e4899ccd51fc6dbe9 +dbbd49315c65cc68b62698b435380b4c00abaf2c77b6ee8a3ed0342597bf9f64 diff --git a/generated/SCPH1001_dispatch.c b/generated/SCPH1001_dispatch.c index e86cccbc..f420ba67 100644 --- a/generated/SCPH1001_dispatch.c +++ b/generated/SCPH1001_dispatch.c @@ -33,6 +33,9 @@ extern void debug_server_trace_dispatch(uint32_t func_addr); * the tier. */ extern int (*g_psx_bios_hle_hook)(CPUState* cpu, uint32_t phys); +extern uint32_t g_psx_mod_guest_functions; +extern int psx_mod_dispatch_guest_function(CPUState*, uint32_t); + #ifdef PSX_HAS_GAME_DISPATCH extern int psx_game_address_in_text(uint32_t addr); #endif @@ -27537,6 +27540,8 @@ static void psx_dispatch_impl(CPUState* cpu, uint32_t addr, uint32_t stop_addr) cpu->pc = 0; int lo = 0, hi = 13012 - 1; int found = 0; + if (g_psx_mod_guest_functions) + found = psx_mod_dispatch_guest_function(cpu, addr); /* BIOS HLE tier: consult the hook FIRST, on the pre-normalize * physical address. It must see (a) the A0/B0/C0 service vectors * (game thunks jr there with the function number in $t1) and (b) @@ -27545,7 +27550,7 @@ static void psx_dispatch_impl(CPUState* cpu, uint32_t addr, uint32_t stop_addr) * backends. Handled (rc 1) ⇒ the service completed against guest * state and the guest resumes at $ra via the trampoline's normal * return/tail contract below. rc 0 ⇒ pure LLE fall-through. */ - if (g_psx_bios_hle_hook && + if (!found && g_psx_bios_hle_hook && g_psx_bios_hle_hook(cpu, addr & 0x1FFFFFFFu)) { cpu->pc = cpu->gpr[31]; found = 1; diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index 9ef0cd69..2ad10627 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -187,7 +187,7 @@ void build_function_entry_hooks(const RuntimeMods& s) { auto& functions = active_guest_functions(); for (const auto& plugin : s.plan.plugins) for (const auto& function : mod_guest_functions(plugin.id)) - functions.push_back({function.address, function.callback, &plugin}); + functions.push_back({function.address, function.callback, nullptr, &plugin}); std::sort(functions.begin(), functions.end(), [](const auto& a, const auto& b) { return a.key < b.key; }); g_psx_mod_guest_functions = (uint32_t)functions.size(); From 1c86297e3b817ffc629406189d46a1c620dd5288 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 08:56:48 -0700 Subject: [PATCH 07/52] Render passes: replay a span of a compiled guest function (psx_mod_run_guest_span) Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/dirty_ram_interp.h | 18 +++++++ runtime/include/mod_plugins.h | 17 ++++++ runtime/include/render_pass.h | 2 + runtime/src/debug_server.c | 5 +- runtime/src/dirty_ram_interp.c | 69 ++++++++++++++++++++---- runtime/src/render_pass.c | 17 +++++- runtime/tests/test_render_pass_abort.c | 53 +++++++++++++++++- runtime/tests/test_render_pass_sandbox.c | 7 +++ 8 files changed, 173 insertions(+), 15 deletions(-) diff --git a/runtime/include/dirty_ram_interp.h b/runtime/include/dirty_ram_interp.h index 98ad41dc..18cc4ee8 100644 --- a/runtime/include/dirty_ram_interp.h +++ b/runtime/include/dirty_ram_interp.h @@ -42,6 +42,24 @@ extern "C" { * corruption, 2026-06-10). */ int dirty_ram_dispatch(CPUState* cpu, uint32_t addr, uint32_t stop_addr); +/* Replay [start_pc, stop_pc) of already-loaded guest code from the CPU state + * given: every PC in the range is interpreted from its live RAM bytes, even + * where a compiled body or a compiled resume point (the return address of a + * call) begins, so a span can start in the middle of a compiled function. + * Calls the span makes run on their normal backend and return into it. + * Returns 1 when control reaches stop_pc, 0 when it leaves the range any other + * way (a return, a jump out, a nested span) or runs past max_insns + * interpreted instructions. The range is half-open, CODE identity, one span + * at a time. A span is a replay, not a function entry: it fires no + * function-entry hooks at its own PCs and stays out of capture, alias seeding + * and per-PC entry statistics. Instruction hooks fire as in compiled code. + * Mods reach it through psx_mod_run_guest_span (render passes only). */ +int dirty_ram_run_span(CPUState* cpu, uint32_t start_pc, uint32_t stop_pc, + uint64_t max_insns); +/* The open span (0,0 = none), for landings that longjmp past its exit. */ +void dirty_ram_span_get(uint32_t *lo, uint32_t *hi); +void dirty_ram_span_set(uint32_t lo, uint32_t hi); + /* Retire a deferred R3000A load-delay writeback (see dirty_ram_interp.c). The * interpreter defers a load's destination-register write past the delay-slot * instruction, as hardware does; call this anywhere control leaves the diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index d735af1f..3dfb2584 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -400,6 +400,23 @@ enum { PSX_MOD_RENDER_PASS_BUSY = 6 }; uint32_t psx_mod_render_pass_status(void); + +/* + * Replay part of an already-loaded guest function inside a render pass: + * run from start_pc with the CPU state given until control reaches stop_pc. + * Every PC in [start_pc, stop_pc) is interpreted from its RAM bytes, so the + * span may start anywhere in a compiled function, including just after one + * of its calls; calls the span makes run normally and return into it. + * A plugin uses this to redraw with the game's own frame code, branches and + * all, from registers it captured at start_pc during the real frame (an + * instruction hook), instead of re-implementing that code's call sequence. + * Returns 1 when stop_pc is reached; 0 when control leaves the range another + * way (a return or jump out, a nested span), after 1M interpreted + * instructions, or outside a pass. The pass restores the machine either way. + * Both PCs are 4-aligned, in one segment, start_pc < stop_pc. + */ +int psx_mod_run_guest_span(struct CPUState* cpu, uint32_t start_pc, + uint32_t stop_pc); int psx_mod_set_auto_skip_fmv(int enabled); /* * Draw still artwork behind the game image in OpenGL letterbox/pillarbox diff --git a/runtime/include/render_pass.h b/runtime/include/render_pass.h index d1b9a84c..87736a2c 100644 --- a/runtime/include/render_pass.h +++ b/runtime/include/render_pass.h @@ -38,6 +38,8 @@ typedef struct RenderPassStats { uint64_t nesting_repairs; /* aborts whose skipped exits the restore undid */ uint64_t verify_checks; /* PSX_RENDER_PASS_VERIFY comparisons */ uint64_t verify_mismatch; /* ... that found a difference */ + uint64_t spans; /* psx_mod_run_guest_span calls that reached stop */ + uint64_t span_failures; /* ... that left the span or overran */ uint64_t dropped[RENDER_PASS_DROP_CLASSES]; double last_pass_ms; /* host time of the last pass (sandbox + draw) */ double avg_pass_ms; /* smoothed */ diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index 6c519b34..ca0d51cd 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -8046,7 +8046,7 @@ static void handle_render_pass_stats(int id, const char *json) "\"cost_us\":%llu,\"cost_rewarms\":%llu,\"frame_images\":%llu," "\"journaled\":%llu," "\"image_textures\":%u,\"image_bytes\":%llu,\"status\":%u," - "\"backups_reused\":%llu}", + "\"backups_reused\":%llu,\"spans\":%llu,\"span_failures\":%llu}", id, (unsigned long long)st.plans, (unsigned long long)st.planned, (unsigned long long)st.wanted, (unsigned long long)st.refused, (unsigned long long)st.passes, (unsigned long long)st.aborted, @@ -8072,7 +8072,8 @@ static void handle_render_pass_stats(int id, const char *json) (unsigned long long)gl_renderer_pass_journaled(), (unsigned)image_textures, (unsigned long long)image_bytes, (unsigned)psx_mod_render_pass_status(), - (unsigned long long)gl_renderer_pass_backups_reused()); + (unsigned long long)gl_renderer_pass_backups_reused(), + (unsigned long long)st.spans, (unsigned long long)st.span_failures); } /* render_pass_refuse on=<0|1>: make the OpenGL backend decline render passes diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index 81db1a19..76348772 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -2420,6 +2420,17 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_addr); +/* Guest span replay (dirty_ram_run_span, psx_mod_run_guest_span): while a span + * is open, every PC in [s_span_lo, s_span_hi) (CODE identity) is interpreted + * from the live RAM bytes, even where a compiled body or one of its resume + * points starts there. Calls the span makes leave the range and run on their + * normal backend. A span is a replay, not an entry: it stays out of capture, + * seeding and entry statistics. */ +static uint32_t s_span_lo, s_span_hi; +static inline int span_forced(uint32_t phys) { + return phys >= s_span_lo && phys < s_span_hi; +} + /* Public entry point. Caller (psx_dispatch) has translated `addr` to a * KSEG-stripped form already in some cases, so accept any address and * mask. Returns 1 if interpretation handled the basic block; 0 if the @@ -2559,6 +2570,40 @@ int dirty_ram_dispatch(CPUState* cpu, uint32_t addr, uint32_t stop_addr) { return r; } +void dirty_ram_span_get(uint32_t *lo, uint32_t *hi) { + if (lo) *lo = s_span_lo; + if (hi) *hi = s_span_hi; +} + +void dirty_ram_span_set(uint32_t lo, uint32_t hi) { + s_span_lo = lo; + s_span_hi = hi; +} + +int dirty_ram_run_span(CPUState* cpu, uint32_t start_pc, uint32_t stop_pc, + uint64_t max_insns) { + const uint32_t lo = start_pc & 0x1FFFFFFFu, hi = stop_pc & 0x1FFFFFFFu; + if (!cpu || s_span_hi || ((start_pc | stop_pc) & 3u) || lo >= hi || + (start_pc ^ stop_pc) & 0xE0000000u) + return 0; + const uint64_t first = g_dirty_ram_insns_run; + int reached = 0; + s_span_lo = lo; + s_span_hi = hi; + cpu->pc = start_pc; + for (;;) { + const uint32_t pc = cpu->pc; + if (pc == stop_pc) { reached = 1; break; } + if (!pc || !span_forced(pc & 0x1FFFFFFFu) || g_psx_call_bail || + g_dirty_ram_insns_run - first > max_insns) + break; + if (!dirty_ram_dispatch(cpu, pc, stop_pc)) break; + } + s_span_lo = s_span_hi = 0; + dirty_ram_ld_delay_flush(cpu); + return reached; +} + /* ===== Cycle-budgeted precise event slicing (PRECISE_IRQ_SLICE.md) ===== */ /* Is a hardware interrupt deliverable to the guest at this exact instruction @@ -2826,7 +2871,8 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ * They differ only for a PC in a retail RAM mirror. */ uint32_t phys = addr & 0x1FFFFFFFu; const uint32_t ram_phys = psx_ram_map_read(phys); - int clean_game_text_miss = 0; + const int forced = span_forced(phys); + int clean_game_text_miss = forced; if (addr == 0x80000048u) { g_sentinel_reach_dirty++; @@ -2854,7 +2900,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ /* Run the statically-compiled game function only while the target is still * native-safe. Dirty overlay pages and pages whose text bytes diverged from * the original EXE image fall through to interpret the live RAM bytes. */ - if (psx_game_text_native_ok(addr)) { + if (!forced && psx_game_text_native_ok(addr)) { g_mixed_depth++; { ls_func_enter(addr, cpu); @@ -2867,7 +2913,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ if (_gc) return 1; } clean_game_text_miss = psx_game_address_in_text(addr) ? 1 : 0; - } else if (psx_game_address_in_text(addr)) { + } else if (!forced && psx_game_address_in_text(addr)) { /* RAM at a game-text address diverged from the static EXE image * (runtime-relocated / overlaid / self-modified code the compiled * static function no longer reflects). The live RAM is the truth: @@ -2885,7 +2931,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ * another segment misses above and is interpreted here like any clean * text miss, never run through the other segment's body. Record it with * the full PC; the fix is a segment-qualified seed and regeneration. */ - if (clean_game_text_miss) + if (clean_game_text_miss && !forced) (void)psx_segment_miss_note(addr, psx_game_is_function_entry, cpu->gpr[31], cpu->gpr[29], (uint32_t)s_frame_count); @@ -2898,7 +2944,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ extern int psx_overlay_dispatch(CPUState *cpu, uint32_t addr); int previous_phase = g_exec_phase; g_exec_phase = 3; - int handled = psx_overlay_dispatch(cpu, addr); + int handled = !forced && psx_overlay_dispatch(cpu, addr); g_exec_phase = previous_phase; if (handled) return 1; } @@ -2915,7 +2961,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ extern void overlay_regs_snap(uint32_t out[34], const CPUState *cpu); extern void overlay_fp_log(uint32_t addr, const uint32_t *in_regs, const CPUState *cpu, int native); - int _ovfp = overlay_fp_enabled() && + int _ovfp = !forced && overlay_fp_enabled() && overlay_cache_window_contains(phys) && overlay_loader_is_candidate(phys); uint32_t _in_regs[34]; @@ -2930,7 +2976,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ { extern int overlay_loader_dispatch(CPUState *cpu, uint32_t addr); - if (overlay_loader_dispatch(cpu, addr)) { + if (!forced && overlay_loader_dispatch(cpu, addr)) { if (_ovfp) overlay_fp_log(addr, _in_regs, cpu, 1); return 1; } @@ -2965,7 +3011,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ * counts dispatches the interpreter actually handles inside a capture * window. The autocapture tick reads-and-resets this to decide whether * an unseen region variant is being interp-executed right now. */ - if (overlay_cache_window_contains(phys)) g_dirty_window_dispatches++; + if (!forced && overlay_cache_window_contains(phys)) g_dirty_window_dispatches++; /* Reset soft-fail state at block entry. */ g_unsupported_seen = 0; @@ -2983,13 +3029,14 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ { extern uint32_t g_psx_mod_function_entry_hooks; extern int psx_mod_function_entry(CPUState *cpu, uint32_t address); - if (g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, addr)) return 1; + if (!forced && g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, addr)) + return 1; } /* Per-PC entry counter (visible via dirty_ram_stats). */ - DirtyRamPcEntry *pc_entry = pc_table_get_or_insert(phys); + DirtyRamPcEntry *pc_entry = forced ? NULL : pc_table_get_or_insert(phys); if (pc_entry) pc_entry->hits++; - { + if (!forced) { uint32_t word = phys >> 2; g_dirty_ram_dispatch_pc_bitmap[word >> 5] |= 1u << (word & 31u); /* ...and the segment it entered through, from the full PC diff --git a/runtime/src/render_pass.c b/runtime/src/render_pass.c index 6f849051..44165ce9 100644 --- a/runtime/src/render_pass.c +++ b/runtime/src/render_pass.c @@ -108,6 +108,7 @@ typedef struct RenderPassNesting { int ov_active_depth; uint32_t ov_inprogress; void (*ov_flush)(void); + uint32_t span_lo, span_hi; /* open guest span (dirty_ram_run_span) */ } RenderPassNesting; static void nesting_save(RenderPassNesting *n) { @@ -125,6 +126,7 @@ static void nesting_save(RenderPassNesting *n) { dirty_ram_ld_delay_save(&n->ld_delay); overlay_loader_native_nesting(&n->ov_active_depth, &n->ov_inprogress); n->ov_flush = g_overlay_flush_pending_cycles; + dirty_ram_span_get(&n->span_lo, &n->span_hi); } static void nesting_restore(const RenderPassNesting *n) { @@ -142,6 +144,7 @@ static void nesting_restore(const RenderPassNesting *n) { dirty_ram_ld_delay_restore(&n->ld_delay); overlay_loader_set_native_nesting(n->ov_active_depth, n->ov_inprogress); g_overlay_flush_pending_cycles = n->ov_flush; + dirty_ram_span_set(n->span_lo, n->span_hi); } /* PSX_RENDER_PASS_VERIFY: a pass that returned normally must leave the @@ -158,7 +161,8 @@ static int nesting_balanced(const RenderPassNesting *n) { now.exec_phase == n->exec_phase && now.precise_mode == n->precise_mode && now.ov_active_depth == n->ov_active_depth && - now.ov_flush == n->ov_flush; + now.ov_flush == n->ov_flush && + now.span_lo == n->span_lo && now.span_hi == n->span_hi; } /* After a watchdog abort, before the restore: which exits the longjmp @@ -193,6 +197,7 @@ static int nesting_describe(const RenderPassNesting *n, int bb_defer_ck, RP_NOTE(now.exec_phase != n->exec_phase, "exec phase %d->%d", now.exec_phase, n->exec_phase); RP_NOTE(now.ld_delay.armed != n->ld_delay.armed, "pending load"); + RP_NOTE(now.span_hi != n->span_hi, "guest span"); #undef RP_NOTE return count; } @@ -298,6 +303,16 @@ uint32_t psx_mod_render_pass_status(void) { return pass_status(); } +int psx_mod_run_guest_span(CPUState *cpu, uint32_t start_pc, uint32_t stop_pc) { + if (!g_psx_render_pass_active || !cpu) return 0; + if (dirty_ram_run_span(cpu, start_pc, stop_pc, 1000000u)) { + s_stats.spans++; + return 1; + } + s_stats.span_failures++; + return 0; +} + uint32_t psx_mod_render_pass_plan(uint32_t period_vblanks, uint32_t shown_after_vblanks, uint32_t *alpha_q16, uint32_t max) { diff --git a/runtime/tests/test_render_pass_abort.c b/runtime/tests/test_render_pass_abort.c index 55668e07..25638b2c 100644 --- a/runtime/tests/test_render_pass_abort.c +++ b/runtime/tests/test_render_pass_abort.c @@ -236,6 +236,29 @@ static void guest_frame(CPUState *cpu, const Frames *f, int level) { g_call_unit_depth = prev_unit; } +/* The interpreter's guest-span state (dirty_ram_run_span): a span replays + * guest frames like any other code, so a runaway inside one leaves it open + * when the watchdog longjmps out. */ +static uint32_t s_span_lo, s_span_hi; +static const Frames *s_span_frames; +void dirty_ram_span_get(uint32_t *lo, uint32_t *hi) { *lo = s_span_lo; *hi = s_span_hi; } +void dirty_ram_span_set(uint32_t lo, uint32_t hi) { s_span_lo = lo; s_span_hi = hi; } +int dirty_ram_run_span(CPUState *cpu, uint32_t start, uint32_t stop, uint64_t max) { + (void)max; + if (s_span_hi) return 0; + s_span_lo = start & 0x1FFFFFFFu; + s_span_hi = stop & 0x1FFFFFFFu; + guest_frame(cpu, s_span_frames, 0); + s_span_lo = s_span_hi = 0; + return 1; +} + +static int span_pass_fn(struct CPUState *cpu, void *user, uint32_t alpha_q16) { + (void)alpha_q16; + s_span_frames = (const Frames *)user; + return psx_mod_run_guest_span(cpu, 0x800143FCu, 0x8001473Cu); +} + static int pass_fn(struct CPUState *cpu, void *user, uint32_t alpha_q16) { (void)alpha_q16; guest_frame(cpu, (const Frames *)user, 0); @@ -251,7 +274,7 @@ static int leaky_pass_fn(struct CPUState *cpu, void *user, uint32_t alpha_q16) { typedef struct Live { int bb_defer, unit, dma, host, dma_ch, active, phase, precise, dispatch; int ov_depth; - uint32_t ov_ip, batch, resume; + uint32_t ov_ip, batch, resume, span_lo, span_hi; void (*flush)(void); DirtyRamLoadDelay ld; uint64_t cycles, next_service, dev_cycles; @@ -273,6 +296,8 @@ static void snap(Live *l) { l->batch = g_psx_cyc_batch; l->resume = g_dirty_safe_resume_pc; l->flush = g_overlay_flush_pending_cycles; + l->span_lo = s_span_lo; + l->span_hi = s_span_hi; l->ld = s_ld; l->cycles = psx_cycle_count; l->next_service = psx_next_service_cycle; @@ -300,6 +325,8 @@ static void check_live(const Live *a, const char *when) { SAME(batch, "pending cycle batch"); SAME(resume, "interpreter resume latch"); SAME(flush, "shard cycle-flush hook"); + SAME(span_lo, "guest span start"); + SAME(span_hi, "guest span end"); SAME(ld.armed, "pending load (armed)"); SAME(ld.val, "pending load (value)"); SAME(cycles, "guest clock"); @@ -383,6 +410,30 @@ int main(void) { CHECK(st.verify_mismatch == 1, "an unbalanced pass is reported in verify mode"); check_live(&live, "after an unbalanced pass"); + /* 4. A guest span runs only inside a pass. */ + CHECK(psx_mod_run_guest_span(&cpu, 0x800143FCu, 0x8001473Cu) == 0, + "a guest span outside a pass is refused"); + render_pass_get_stats(&st); + CHECK(st.spans == 0 && st.span_failures == 0, "a refused span counts nothing"); + + /* 5. A span that completes inside a pass is counted and closed. */ + snap(&live); + CHECK(psx_mod_render_pass(&cpu, &pass, span_pass_fn, &clean) == 1, + "a pass that replays a span is presented"); + render_pass_get_stats(&st); + CHECK(st.spans == 1, "the span reached its stop"); + check_live(&live, "after a pass with a span"); + + /* 6. A span that runs away: the watchdog's landing closes it, so later + * dispatches of those PCs take their compiled bodies again. */ + snap(&live); + CHECK(psx_mod_render_pass(&cpu, &pass, span_pass_fn, &runaway) == 0, + "a runaway span is rolled back"); + render_pass_get_stats(&st); + CHECK(st.watchdog == 2, "the watchdog cut the span off"); + CHECK(s_span_hi == 0 && s_span_lo == 0, "the abort closed the open span"); + check_live(&live, "after a span watchdog abort"); + printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); return failures ? 1 : 0; } diff --git a/runtime/tests/test_render_pass_sandbox.c b/runtime/tests/test_render_pass_sandbox.c index e5f80bba..26908c2a 100644 --- a/runtime/tests/test_render_pass_sandbox.c +++ b/runtime/tests/test_render_pass_sandbox.c @@ -176,6 +176,13 @@ static DirtyRamLoadDelay s_ld; void dirty_ram_ld_delay_discard(void) { memset(&s_ld, 0, sizeof s_ld); } void dirty_ram_ld_delay_save(DirtyRamLoadDelay *o) { *o = s_ld; } void dirty_ram_ld_delay_restore(const DirtyRamLoadDelay *i) { s_ld = *i; } +static uint32_t s_span_lo, s_span_hi; +void dirty_ram_span_get(uint32_t *lo, uint32_t *hi) { *lo = s_span_lo; *hi = s_span_hi; } +void dirty_ram_span_set(uint32_t lo, uint32_t hi) { s_span_lo = lo; s_span_hi = hi; } +int dirty_ram_run_span(CPUState *cpu, uint32_t start, uint32_t stop, uint64_t max) { + (void)cpu; (void)start; (void)stop; (void)max; + return 0; +} void overlay_loader_native_nesting(int *d, uint32_t *ip) { *d = 0; *ip = 0; } void overlay_loader_set_native_nesting(int d, uint32_t ip) { (void)d; (void)ip; } From 7d1ad2ec194615c975e76d2517134a95824e32d6 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 09:00:38 -0700 Subject: [PATCH 08/52] Frontend: --hidden-window runs the full presenter in a never-shown window --- runtime/src/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index c1e042a6..f09da2d1 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -1312,6 +1312,11 @@ static int g_hotkey_pad_fast_forward_toggle = 0; /* unbound: latch fas static uint32_t g_savestate_input_guard_min_until = 0; static uint32_t g_savestate_input_guard_max_until = 0; static int g_headless = 0; /* debug/CI frontend: no SDL window/audio */ +/* Test frontend: the full windowed runtime (presenter, frame interpolation, + * render passes) in a window that is never shown. For automated checks of + * presentation features without putting a window on the desktop; drive it + * over TCP like --headless. */ +static int g_hidden_window = 0; /* FMV instant-skip via the game's OWN end-of-movie path. Tomba's MDEC player * (FUN_8001efe8) tears a movie down when the streamed frame number reaches that @@ -13396,6 +13401,8 @@ int main(int argc, char** argv) { * --launcher force the GUI launcher (overrides skip_launcher) * --no-launcher skip the GUI launcher (boot straight in) * --headless skip SDL window/audio; use TCP screenshots/state + * --hidden-window full presenter in a never-shown window (TCP-driven + * tests of interpolation / render passes) * --netplay enable delay-sync LAN (also PSX_NETPLAY=1) * --net-slot N local player slot (0|1) * --net-input-player N host device to sample (0=P1, 1=P2; default auto) @@ -13437,6 +13444,9 @@ int main(int argc, char** argv) { } else if (std::strcmp(argv[i], "--headless") == 0) { g_headless = 1; force_no_launcher = true; + } else if (std::strcmp(argv[i], "--hidden-window") == 0) { + g_hidden_window = 1; + force_no_launcher = true; } else if (std::strcmp(argv[i], "--netplay") == 0) { net_cfg.enabled = 1; } else if (std::strcmp(argv[i], "--net-slot") == 0 && i + 1 < argc) { @@ -16301,6 +16311,11 @@ session_reboot: win_flags |= PSX_SDL_WINDOW_HIGH_DENSITY; } if (g_video_renderer == 2) win_flags |= SDL_WINDOW_VULKAN; + if (g_hidden_window) { + win_flags &= ~(Uint32)SDL_WINDOW_SHOWN; + win_flags |= SDL_WINDOW_HIDDEN; + g_fullscreen = 0; + } /* Fullscreen on launch (launcher's tri-state Fullscreen control): 1 = * borderless desktop fullscreen (keeps the desktop resolution, letterboxes * the image), 2 = exclusive fullscreen (real display-mode change), 0 = From 8b1bcfe43a9b12f396362ef8f4fc65685839d3e7 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 09:03:05 -0700 Subject: [PATCH 09/52] Frontend: --hidden-window never blocks on a modal or file picker --- runtime/src/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index f09da2d1..9ec7ba8a 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -2479,18 +2479,21 @@ static void write_cached_path(const char* argv0, const char* filename, if (f.is_open()) f << path.string() << "\n"; } +/* Nobody is at the screen: never block on a modal dialog or a file picker. */ +static bool frontend_unattended() { return g_headless || g_hidden_window; } + static void launcher_warning(const char* title, const std::string& msg) { std::fprintf(stderr, "%s: %s\n", title, msg.c_str()); - // Headless (--headless / PSX_HEADLESS): NEVER pop a blocking modal — it would + // Unattended (--headless / PSX_HEADLESS / --hidden-window): NEVER pop a blocking modal — it would // hang an unattended/CI/scripted run forever waiting for a click. // SDL_ShowSimpleMessageBox is cross-platform; the Win32-only MessageBoxA left // macOS and Linux users with a silent exit (v0.4.0 macOS report, 2026-09-15). - if (!g_headless) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, title, msg.c_str(), NULL); + if (!frontend_unattended()) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, title, msg.c_str(), NULL); } static void launcher_info(const char* title, const std::string& msg) { std::fprintf(stderr, "%s: %s\n", title, msg.c_str()); - if (!g_headless) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, title, msg.c_str(), NULL); + if (!frontend_unattended()) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, title, msg.c_str(), NULL); } /* Game display name for picker dialogs ("Tomba!"); set after the game @@ -2501,7 +2504,8 @@ static bool pick_runtime_file(const char* title, const char* filter, std::filesystem::path& out, const char* cli_flag) { // Headless: never open an interactive file dialog (it blocks). Fail the // resolve so boot aborts cleanly with the stderr message the caller printed. - if (g_headless) { + // Also when unattended in a hidden window (--hidden-window). + if (frontend_unattended()) { std::fprintf(stderr, "psxrecomp: headless — cannot prompt for '%s'.\n" " Supply it on the command line: %s (or set it in game.toml).\n", From a6c3728c229ee26e153784a3a86d3d847710eed9 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 09:11:43 -0700 Subject: [PATCH 10/52] Render passes: FLIP_SHOWN mode for games that flip each frame as soon as it is drawn --- runtime/include/gpu_gl_renderer.h | 3 +++ runtime/include/mod_plugins.h | 18 ++++++++++++++++++ runtime/include/render_pass_plan.h | 12 ++++++++++++ runtime/src/gpu_gl_renderer.c | 14 ++++++++++---- runtime/src/render_pass.c | 9 +++++++++ runtime/src/render_pass_plan.c | 10 ++++++++++ runtime/tests/test_render_pass_abort.c | 1 + runtime/tests/test_render_pass_plan.c | 21 +++++++++++++++++++++ runtime/tests/test_render_pass_sandbox.c | 1 + 9 files changed, 85 insertions(+), 4 deletions(-) diff --git a/runtime/include/gpu_gl_renderer.h b/runtime/include/gpu_gl_renderer.h index ba2f4a7f..9e3bcfe0 100644 --- a/runtime/include/gpu_gl_renderer.h +++ b/runtime/include/gpu_gl_renderer.h @@ -66,6 +66,9 @@ uint32_t gl_renderer_pass_plan(uint32_t period_vblanks, * rect at the same scale. Returns 0 when refused (nothing changed). */ int gl_renderer_pass_begin(int x, int y, int w, int h, int open_gen, uint32_t period_vblanks, int reuse_backup); +/* Generations opened from now on are for a frame already on screen (1) or + * for the next flip (0, default); render_pass_gen_flip_matches. */ +void gl_renderer_pass_set_flip_shown(int shown); /* Capture the drawn rect at alpha_q16 (keep) and roll the rect back. */ void gl_renderer_pass_end(uint32_t alpha_q16, int keep); uint32_t gl_renderer_pass_leaks(void); diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 3dfb2584..6e434ae0 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -401,6 +401,24 @@ enum { }; uint32_t psx_mod_render_pass_status(void); +/* + * When the game flips relative to the pass point. PENDING (default, reset at + * every session start): the pass rect is the one the next flip will show -- + * the PsyQ VSync(0)-then-PutDispEnv loop, whose frame N is drawn and waits. + * SHOWN: the game flips each frame as soon as it is drawn (for example + * PutDispEnv in a VBlank callback armed by the DrawSync callback), so by the + * time frame N+1's logic is done frame N is already on screen. The pass rect + * is then that on-screen rect, and frame N's own image and its in-between + * images are shown from the game's next flip on: one game frame later than + * the game shows them, as a host interpolator with one frame of history + * would. Set it from activation, before the first plan. + */ +enum { + PSX_MOD_RENDER_PASS_FLIP_PENDING = 0, + PSX_MOD_RENDER_PASS_FLIP_SHOWN = 1 +}; +int psx_mod_set_render_pass_flip(uint32_t mode); + /* * Replay part of an already-loaded guest function inside a render pass: * run from start_pc with the CPU state given until control reaches stop_pc. diff --git a/runtime/include/render_pass_plan.h b/runtime/include/render_pass_plan.h index 294efee6..e4e519f2 100644 --- a/runtime/include/render_pass_plan.h +++ b/runtime/include/render_pass_plan.h @@ -65,6 +65,18 @@ int render_pass_select(const uint32_t *phases, uint32_t n, double p, int render_pass_gen_select(const uint32_t *phases, uint32_t n, double p, uint32_t *lo, uint32_t *hi, float *t); +/* Is the flip the FLIP source just saw the one a pending generation waits + * for? A generation built for the next flip (`shown` 0, the canonical PsyQ + * VSync-then-PutDispEnv point) waits for the display to flip to its own rect. + * One built for a frame already on screen (`shown` 1: the game flips each + * frame as soon as it is drawn) waits for the next flip, to any other rect; + * its images then show one game frame late. Either way the presented + * geometry must still be the one the generation was captured at. */ +int render_pass_gen_flip_matches(int shown, int gen_x, int gen_y, + int gen_source, int gen_w, int gen_h, + int flip_x, int flip_y, int flip_source, + int flip_w, int flip_h); + /* Exponential moving average used for the per-pass host cost. */ double render_pass_ema(double current, double sample); diff --git a/runtime/src/gpu_gl_renderer.c b/runtime/src/gpu_gl_renderer.c index de5c2765..3f3b38d9 100644 --- a/runtime/src/gpu_gl_renderer.c +++ b/runtime/src/gpu_gl_renderer.c @@ -5804,8 +5804,10 @@ typedef struct PassGen { uint32_t n; /* images: [0] = the game's own */ uint32_t phase[PASS_SLOTS]; /* Q16, ascending */ uint32_t period; /* guest VBlanks the frame stays on screen */ + int shown; /* built for a frame already on screen */ double t_start, t_len; /* host ticks, set on promotion */ } PassGen; +static int s_pass_flip_shown = 0; static PassGen s_pgen[2]; /* Slot textures are made as slots fill: [0, s_pgen_alloc_n) exist, all at * s_pgen_alloc_w x h. A generation never fills past pass_slot_cap, so two @@ -6218,6 +6220,7 @@ int gl_renderer_pass_begin(int x, int y, int w, int h, int open_gen, g->tex_w = tw; g->tex_h = th; g->source_path = wide ? GL_PRES_WIDE : GL_PRES_VRAM; g->period = period_vblanks ? period_vblanks : 1u; + g->shown = s_pass_flip_shown; pass_capture_into(s_pgen_tex[gi][0], g); /* the game's own image */ g->phase[0] = 0; g->n = 1; @@ -6443,14 +6446,17 @@ static uint64_t s_present_ticks_accum_fwd(uint64_t add) { return s_present_ticks_accum; } +void gl_renderer_pass_set_flip_shown(int shown) { s_pass_flip_shown = shown ? 1 : 0; } + /* FLIP source saw a new frame: it is the flip a pending generation was built - * for (same rect, same presented geometry) or a frame without passes. */ + * for (render_pass_gen_flip_matches) or a frame without passes. */ static void pass_note_new_frame(int origin_x, int origin_y, int source_path, int pw, int ph) { PassGen *pend = &s_pgen[1 - s_pgen_cur]; - if (pend->valid && !pend->promoted && pend->x == origin_x && - pend->y == origin_y && pend->source_path == source_path && - pend->tex_w == pw && pend->tex_h == ph) { + if (pend->valid && !pend->promoted && + render_pass_gen_flip_matches(pend->shown, pend->x, pend->y, + pend->source_path, pend->tex_w, pend->tex_h, + origin_x, origin_y, source_path, pw, ph)) { s_pgen_promote = 1; } else { s_pgen_promote = 0; diff --git a/runtime/src/render_pass.c b/runtime/src/render_pass.c index 44165ce9..c287993b 100644 --- a/runtime/src/render_pass.c +++ b/runtime/src/render_pass.c @@ -275,6 +275,15 @@ void render_pass_reset_session(void) { memset(g_render_pass_dropped_writes, 0, sizeof g_render_pass_dropped_writes); s_open_generation = 0; s_restored_valid = 0; + gl_renderer_pass_set_flip_shown(0); +} + +int psx_mod_set_render_pass_flip(uint32_t mode) { + if (mode != PSX_MOD_RENDER_PASS_FLIP_PENDING && + mode != PSX_MOD_RENDER_PASS_FLIP_SHOWN) + return 0; + gl_renderer_pass_set_flip_shown(mode == PSX_MOD_RENDER_PASS_FLIP_SHOWN); + return 1; } /* Everything that must hold before guest code may run frozen, as a diff --git a/runtime/src/render_pass_plan.c b/runtime/src/render_pass_plan.c index b04ef525..21e17fd5 100644 --- a/runtime/src/render_pass_plan.c +++ b/runtime/src/render_pass_plan.c @@ -111,6 +111,16 @@ int render_pass_select(const uint32_t *phases, uint32_t n, double p, return 1; } +int render_pass_gen_flip_matches(int shown, int gen_x, int gen_y, + int gen_source, int gen_w, int gen_h, + int flip_x, int flip_y, int flip_source, + int flip_w, int flip_h) { + const int same_rect = gen_x == flip_x && gen_y == flip_y; + if (gen_source != flip_source || gen_w != flip_w || gen_h != flip_h) + return 0; + return shown ? !same_rect : same_rect; +} + int render_pass_gen_select(const uint32_t *phases, uint32_t n, double p, uint32_t *lo, uint32_t *hi, float *t) { if (!(p <= RENDER_PASS_GEN_HOLD_MAX)) return 0; diff --git a/runtime/tests/test_render_pass_abort.c b/runtime/tests/test_render_pass_abort.c index 25638b2c..36673d48 100644 --- a/runtime/tests/test_render_pass_abort.c +++ b/runtime/tests/test_render_pass_abort.c @@ -152,6 +152,7 @@ uint32_t gl_renderer_pass_plan(uint32_t p, uint32_t s, uint32_t *a, return 0; } static int s_open_passes, s_kept; +void gl_renderer_pass_set_flip_shown(int shown) { (void)shown; } int gl_renderer_pass_begin(int x, int y, int w, int h, int open_gen, uint32_t period, int reuse_backup) { (void)x; (void)y; (void)w; (void)h; (void)open_gen; (void)period; diff --git a/runtime/tests/test_render_pass_plan.c b/runtime/tests/test_render_pass_plan.c index e514618f..65a12fcd 100644 --- a/runtime/tests/test_render_pass_plan.c +++ b/runtime/tests/test_render_pass_plan.c @@ -149,6 +149,26 @@ static void test_gen_select_late(void) { CHECK(!render_pass_gen_select(ph, 0, 0.5, &lo, &hi, &t), "no items, no pick"); } +/* Promotion: a generation for the next flip waits for its own rect; one for + * a frame already on screen waits for the flip after it, to another rect. */ +static void test_gen_flip_matches(void) { + /* PsyQ VSync-then-PutDispEnv: built for the rect the flip shows. */ + CHECK(render_pass_gen_flip_matches(0, 0, 240, 1, 320, 240, 0, 240, 1, 320, 240), + "pending: the flip to the generation's rect promotes it"); + CHECK(!render_pass_gen_flip_matches(0, 0, 240, 1, 320, 240, 0, 0, 1, 320, 240), + "pending: a flip to the other buffer does not"); + /* Flip-when-drawn (V8:2): built for the rect already on screen. */ + CHECK(render_pass_gen_flip_matches(1, 0, 240, 1, 320, 240, 0, 0, 1, 320, 240), + "shown: the next flip, to the other buffer, promotes it"); + CHECK(!render_pass_gen_flip_matches(1, 0, 240, 1, 320, 240, 0, 240, 1, 320, 240), + "shown: a redraw of the rect on screen is not the next flip"); + /* Geometry the images were captured at must still be presented. */ + CHECK(!render_pass_gen_flip_matches(1, 0, 240, 1, 320, 240, 0, 0, 0, 320, 240), + "a different presented source never promotes"); + CHECK(!render_pass_gen_flip_matches(0, 0, 0, 1, 320, 240, 0, 0, 1, 640, 480), + "a different presented size never promotes"); +} + static void test_budget_and_ema(void) { CHECK(fabs(render_pass_budget(0, 0, 100.0, 0.5) - 50.0) < 1e-9, "no history spends the share of the frame"); @@ -301,6 +321,7 @@ int main(void) { test_shedding(); test_select(); test_gen_select_late(); + test_gen_flip_matches(); test_budget_and_ema(); printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); return failures ? 1 : 0; diff --git a/runtime/tests/test_render_pass_sandbox.c b/runtime/tests/test_render_pass_sandbox.c index 26908c2a..ceb99fca 100644 --- a/runtime/tests/test_render_pass_sandbox.c +++ b/runtime/tests/test_render_pass_sandbox.c @@ -202,6 +202,7 @@ uint32_t gl_renderer_pass_plan(uint32_t p, uint32_t s, uint32_t *a, return 0; } static int s_open_passes, s_kept; +void gl_renderer_pass_set_flip_shown(int shown) { (void)shown; } int gl_renderer_pass_begin(int x, int y, int w, int h, int open_gen, uint32_t period, int reuse_backup) { (void)x; (void)y; (void)w; (void)h; (void)open_gen; (void)period; From 9c0c98bd963c1a91f80018d425ffb3e903313626 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 09:31:14 -0700 Subject: [PATCH 11/52] Render passes: spans run their calls with the full trampoline; phase 0 is the flipped image Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/dirty_ram_interp.h | 10 ++++ runtime/src/debug_server.c | 12 ++++- runtime/src/dirty_ram_interp.c | 79 ++++++++++++++++++++++-------- runtime/src/gpu_gl_renderer.c | 13 +++++ 4 files changed, 92 insertions(+), 22 deletions(-) diff --git a/runtime/include/dirty_ram_interp.h b/runtime/include/dirty_ram_interp.h index 18cc4ee8..e9a9620f 100644 --- a/runtime/include/dirty_ram_interp.h +++ b/runtime/include/dirty_ram_interp.h @@ -56,6 +56,16 @@ int dirty_ram_dispatch(CPUState* cpu, uint32_t addr, uint32_t stop_addr); * Mods reach it through psx_mod_run_guest_span (render passes only). */ int dirty_ram_run_span(CPUState* cpu, uint32_t start_pc, uint32_t stop_pc, uint64_t max_insns); +/* Why the last span that failed stopped: 1 returned (pc 0), 2 left the range, + * 3 call-bail unwind, 4 instruction budget, 5 the interpreter declined the PC, + * 6 bad arguments or a span already open, 7 a call did not return to the + * span (`after`). `pc` is where control was. */ +typedef struct DirtyRamSpanFailure { + uint32_t reason, pc, start_pc, stop_pc; + uint32_t ra, after; /* $ra at the exit; pc after a call that did not return */ + uint64_t insns; +} DirtyRamSpanFailure; +void dirty_ram_span_last_failure(DirtyRamSpanFailure *out); /* The open span (0,0 = none), for landings that longjmp past its exit. */ void dirty_ram_span_get(uint32_t *lo, uint32_t *hi); void dirty_ram_span_set(uint32_t lo, uint32_t hi); diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index ca0d51cd..5ee1d7c7 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -8026,7 +8026,9 @@ static void handle_render_pass_stats(int id, const char *json) RenderPassStats st; uint64_t gd[10], image_bytes = 0; uint32_t image_textures; + DirtyRamSpanFailure sf; render_pass_get_stats(&st); + dirty_ram_span_last_failure(&sf); gl_renderer_pass_diag(gd); image_textures = gl_renderer_pass_image_textures(&image_bytes); send_fmt("{\"id\":%d,\"ok\":true,\"plans\":%llu,\"planned\":%llu," @@ -8046,7 +8048,10 @@ static void handle_render_pass_stats(int id, const char *json) "\"cost_us\":%llu,\"cost_rewarms\":%llu,\"frame_images\":%llu," "\"journaled\":%llu," "\"image_textures\":%u,\"image_bytes\":%llu,\"status\":%u," - "\"backups_reused\":%llu,\"spans\":%llu,\"span_failures\":%llu}", + "\"backups_reused\":%llu,\"spans\":%llu,\"span_failures\":%llu," + "\"span_fail\":{\"reason\":%u,\"pc\":\"0x%08X\",\"start\":\"0x%08X\"," + "\"stop\":\"0x%08X\",\"ra\":\"0x%08X\",\"after\":\"0x%08X\"," + "\"insns\":%llu}}", id, (unsigned long long)st.plans, (unsigned long long)st.planned, (unsigned long long)st.wanted, (unsigned long long)st.refused, (unsigned long long)st.passes, (unsigned long long)st.aborted, @@ -8073,7 +8078,10 @@ static void handle_render_pass_stats(int id, const char *json) (unsigned)image_textures, (unsigned long long)image_bytes, (unsigned)psx_mod_render_pass_status(), (unsigned long long)gl_renderer_pass_backups_reused(), - (unsigned long long)st.spans, (unsigned long long)st.span_failures); + (unsigned long long)st.spans, (unsigned long long)st.span_failures, + (unsigned)sf.reason, (unsigned)sf.pc, (unsigned)sf.start_pc, + (unsigned)sf.stop_pc, (unsigned)sf.ra, (unsigned)sf.after, + (unsigned long long)sf.insns); } /* render_pass_refuse on=<0|1>: make the OpenGL backend decline render passes diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index 76348772..f95ebde8 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -512,6 +512,17 @@ extern int psx_game_text_native_ok_full(uint32_t addr); #endif extern void psx_dispatch_call(CPUState* cpu, uint32_t addr, uint32_t return_addr); +/* Guest span replay (dirty_ram_run_span, psx_mod_run_guest_span): while a span + * is open, every PC in [s_span_lo, s_span_hi) (CODE identity) is interpreted + * from the live RAM bytes, even where a compiled body or one of its resume + * points starts there. Calls the span makes leave the range and run on their + * normal backend. A span is a replay, not an entry: it stays out of capture, + * seeding and entry statistics. */ +static uint32_t s_span_lo, s_span_hi; +static inline int span_forced(uint32_t phys) { + return phys >= s_span_lo && phys < s_span_hi; +} + /* Forward decls from memory.c — used to read instruction bytes. */ extern uint8_t *memory_get_ram_ptr(void); extern void dirty_ram_mark_executable_range(uint32_t phys, uint32_t len); @@ -1714,7 +1725,9 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, #endif uint32_t _cr = callret_begin(cpu, pc, target); /* call-resolution ring */ #define CRET(code, rv) do { callret_end(_cr, cpu, (code)); return (rv); } while (0) - if (g_precise_mode || g_ls_replay_active) { cpu->pc = target; CRET(CRES_PLAIN, 1); } /* slice / lockstep-replay: plain transfer, never execute the callee */ + /* slice / lockstep-replay / guest span: plain transfer, never execute the + * callee (a span's runner calls it with the full trampoline). */ + if (g_precise_mode || g_ls_replay_active || span_forced(pc & 0x1FFFFFFFu)) { cpu->pc = target; CRET(CRES_PLAIN, 1); } if (rd != 31) { /* No architectural $ra contract: preserve the transfer as a * pc-chain and let the callee's eventual JR choose the real @@ -1934,7 +1947,9 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, #else #define XRES(code) do { (void)(code); } while (0) #endif - if (g_precise_mode || g_ls_replay_active) { cpu->pc = target; return 1; } /* slice / lockstep-replay: plain transfer, never execute the callee */ + /* slice / lockstep-replay / guest span: plain transfer, never execute the + * callee (a span's runner calls it with the full trampoline). */ + if (g_precise_mode || g_ls_replay_active || span_forced(pc & 0x1FFFFFFFu)) { cpu->pc = target; return 1; } #ifdef PSX_HAS_GAME_DISPATCH cpu->pc = 0; if (interp_enter_compiled(cpu, target)) { @@ -2420,16 +2435,6 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_addr); -/* Guest span replay (dirty_ram_run_span, psx_mod_run_guest_span): while a span - * is open, every PC in [s_span_lo, s_span_hi) (CODE identity) is interpreted - * from the live RAM bytes, even where a compiled body or one of its resume - * points starts there. Calls the span makes leave the range and run on their - * normal backend. A span is a replay, not an entry: it stays out of capture, - * seeding and entry statistics. */ -static uint32_t s_span_lo, s_span_hi; -static inline int span_forced(uint32_t phys) { - return phys >= s_span_lo && phys < s_span_hi; -} /* Public entry point. Caller (psx_dispatch) has translated `addr` to a * KSEG-stripped form already in some cases, so accept any address and @@ -2580,28 +2585,62 @@ void dirty_ram_span_set(uint32_t lo, uint32_t hi) { s_span_hi = hi; } +static DirtyRamSpanFailure s_span_failure; + +void dirty_ram_span_last_failure(DirtyRamSpanFailure *out) { + if (out) *out = s_span_failure; +} + int dirty_ram_run_span(CPUState* cpu, uint32_t start_pc, uint32_t stop_pc, uint64_t max_insns) { const uint32_t lo = start_pc & 0x1FFFFFFFu, hi = stop_pc & 0x1FFFFFFFu; + DirtyRamSpanFailure f = {0u, start_pc, start_pc, stop_pc, 0u, 0u, 0u}; if (!cpu || s_span_hi || ((start_pc | stop_pc) & 3u) || lo >= hi || - (start_pc ^ stop_pc) & 0xE0000000u) + (start_pc ^ stop_pc) & 0xE0000000u) { + f.reason = 6u; + s_span_failure = f; return 0; + } const uint64_t first = g_dirty_ram_insns_run; - int reached = 0; s_span_lo = lo; s_span_hi = hi; cpu->pc = start_pc; for (;;) { const uint32_t pc = cpu->pc; - if (pc == stop_pc) { reached = 1; break; } - if (!pc || !span_forced(pc & 0x1FFFFFFFu) || g_psx_call_bail || - g_dirty_ram_insns_run - first > max_insns) - break; - if (!dirty_ram_dispatch(cpu, pc, stop_pc)) break; + f.pc = pc; + f.ra = cpu->gpr[31]; + if (pc == stop_pc) break; + if (!pc) { f.reason = 1u; break; } + if (g_psx_call_bail) { f.reason = 3u; break; } + if (!span_forced(pc & 0x1FFFFFFFu)) { + /* The interpreter hands a call out of clean code back as a tail + * transfer (pc = callee, $ra = the return address). A call made + * by the span returns into it: run it as the caller would. A + * transfer out that is not a call ends the span. */ + const uint32_t ra = cpu->gpr[31]; + const uint32_t site = ra - 8u; + /* The span's last instruction may be a call: it returns to stop. */ + const uint32_t w = span_forced(site & 0x1FFFFFFFu) && + (span_forced(ra & 0x1FFFFFFFu) || ra == stop_pc) + ? fetch_word(site & 0x1FFFFFFFu) : 0u; + const int is_call = (w >> 26) == 0x03u || /* jal */ + ((w >> 26) == 0u && (w & 0x3Fu) == 0x09u); /* jalr */ + if (!is_call) { f.reason = 2u; break; } + cpu->pc = 0; + psx_dispatch_call(cpu, pc, ra); + if (g_psx_call_bail) { f.reason = 3u; break; } + if (cpu->pc != 0u && cpu->pc != ra) { f.after = cpu->pc; f.reason = 7u; break; } + cpu->pc = ra; + continue; + } + if (g_dirty_ram_insns_run - first > max_insns) { f.reason = 4u; break; } + if (!dirty_ram_dispatch(cpu, pc, stop_pc)) { f.reason = 5u; break; } } s_span_lo = s_span_hi = 0; dirty_ram_ld_delay_flush(cpu); - return reached; + f.insns = g_dirty_ram_insns_run - first; + if (f.reason) s_span_failure = f; + return f.reason == 0u; } /* ===== Cycle-budgeted precise event slicing (PRECISE_IRQ_SLICE.md) ===== */ diff --git a/runtime/src/gpu_gl_renderer.c b/runtime/src/gpu_gl_renderer.c index 3f3b38d9..66ed85df 100644 --- a/runtime/src/gpu_gl_renderer.c +++ b/runtime/src/gpu_gl_renderer.c @@ -6512,6 +6512,19 @@ static void pass_apply_promotion(void) { g->promoted = 1; g->t_start = s_interp_schedule.frame_start; g->t_len = (double)g->period * sp; + /* Phase 0 is the image the game actually flipped to. The capture at + * the pass point is the same for a game that draws nothing more into + * the rect before its flip; a game that finishes the frame later (V8:2 + * draws its HUD at the next submit, onto the rect about to be shown) + * would otherwise show its own frame without that last layer. The + * flip was matched to this generation's rect and presented geometry, + * and no guest code ran since it, so the rect holds that image. A + * FLIP_SHOWN generation's rect is not the one flipped to: it keeps + * the image taken when it opened. */ + if (!g->shown) { + pass_capture_into(s_pgen_tex[s_pgen_cur][0], g); + p_glBindFramebuffer(PSXGL_READ_FRAMEBUFFER, 0); + } s_pgen_promotions++; if (s_pdump_left > 0) pass_dump_generation(s_pgen_cur); } From 5297bd7a002712f2d2c719fe744e5331522edc5f Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 08:56:48 -0700 Subject: [PATCH 12/52] Render passes: replay a span of a compiled guest function (psx_mod_run_guest_span) Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/dirty_ram_interp.h | 18 +++++++ runtime/include/mod_plugins.h | 17 ++++++ runtime/include/render_pass.h | 2 + runtime/src/debug_server.c | 5 +- runtime/src/dirty_ram_interp.c | 69 ++++++++++++++++++++---- runtime/src/render_pass.c | 17 +++++- runtime/tests/test_render_pass_abort.c | 53 +++++++++++++++++- runtime/tests/test_render_pass_sandbox.c | 7 +++ 8 files changed, 173 insertions(+), 15 deletions(-) diff --git a/runtime/include/dirty_ram_interp.h b/runtime/include/dirty_ram_interp.h index 98ad41dc..18cc4ee8 100644 --- a/runtime/include/dirty_ram_interp.h +++ b/runtime/include/dirty_ram_interp.h @@ -42,6 +42,24 @@ extern "C" { * corruption, 2026-06-10). */ int dirty_ram_dispatch(CPUState* cpu, uint32_t addr, uint32_t stop_addr); +/* Replay [start_pc, stop_pc) of already-loaded guest code from the CPU state + * given: every PC in the range is interpreted from its live RAM bytes, even + * where a compiled body or a compiled resume point (the return address of a + * call) begins, so a span can start in the middle of a compiled function. + * Calls the span makes run on their normal backend and return into it. + * Returns 1 when control reaches stop_pc, 0 when it leaves the range any other + * way (a return, a jump out, a nested span) or runs past max_insns + * interpreted instructions. The range is half-open, CODE identity, one span + * at a time. A span is a replay, not a function entry: it fires no + * function-entry hooks at its own PCs and stays out of capture, alias seeding + * and per-PC entry statistics. Instruction hooks fire as in compiled code. + * Mods reach it through psx_mod_run_guest_span (render passes only). */ +int dirty_ram_run_span(CPUState* cpu, uint32_t start_pc, uint32_t stop_pc, + uint64_t max_insns); +/* The open span (0,0 = none), for landings that longjmp past its exit. */ +void dirty_ram_span_get(uint32_t *lo, uint32_t *hi); +void dirty_ram_span_set(uint32_t lo, uint32_t hi); + /* Retire a deferred R3000A load-delay writeback (see dirty_ram_interp.c). The * interpreter defers a load's destination-register write past the delay-slot * instruction, as hardware does; call this anywhere control leaves the diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 2bb49d20..737260c5 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -348,6 +348,23 @@ enum { PSX_MOD_RENDER_PASS_BUSY = 6 }; uint32_t psx_mod_render_pass_status(void); + +/* + * Replay part of an already-loaded guest function inside a render pass: + * run from start_pc with the CPU state given until control reaches stop_pc. + * Every PC in [start_pc, stop_pc) is interpreted from its RAM bytes, so the + * span may start anywhere in a compiled function, including just after one + * of its calls; calls the span makes run normally and return into it. + * A plugin uses this to redraw with the game's own frame code, branches and + * all, from registers it captured at start_pc during the real frame (an + * instruction hook), instead of re-implementing that code's call sequence. + * Returns 1 when stop_pc is reached; 0 when control leaves the range another + * way (a return or jump out, a nested span), after 1M interpreted + * instructions, or outside a pass. The pass restores the machine either way. + * Both PCs are 4-aligned, in one segment, start_pc < stop_pc. + */ +int psx_mod_run_guest_span(struct CPUState* cpu, uint32_t start_pc, + uint32_t stop_pc); int psx_mod_set_auto_skip_fmv(int enabled); /* * Draw still artwork behind the game image in OpenGL letterbox/pillarbox diff --git a/runtime/include/render_pass.h b/runtime/include/render_pass.h index d1b9a84c..87736a2c 100644 --- a/runtime/include/render_pass.h +++ b/runtime/include/render_pass.h @@ -38,6 +38,8 @@ typedef struct RenderPassStats { uint64_t nesting_repairs; /* aborts whose skipped exits the restore undid */ uint64_t verify_checks; /* PSX_RENDER_PASS_VERIFY comparisons */ uint64_t verify_mismatch; /* ... that found a difference */ + uint64_t spans; /* psx_mod_run_guest_span calls that reached stop */ + uint64_t span_failures; /* ... that left the span or overran */ uint64_t dropped[RENDER_PASS_DROP_CLASSES]; double last_pass_ms; /* host time of the last pass (sandbox + draw) */ double avg_pass_ms; /* smoothed */ diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index 9b236be9..95e8db9a 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -7977,7 +7977,7 @@ static void handle_render_pass_stats(int id, const char *json) "\"cost_us\":%llu,\"cost_rewarms\":%llu,\"frame_images\":%llu," "\"journaled\":%llu," "\"image_textures\":%u,\"image_bytes\":%llu,\"status\":%u," - "\"backups_reused\":%llu}", + "\"backups_reused\":%llu,\"spans\":%llu,\"span_failures\":%llu}", id, (unsigned long long)st.plans, (unsigned long long)st.planned, (unsigned long long)st.wanted, (unsigned long long)st.refused, (unsigned long long)st.passes, (unsigned long long)st.aborted, @@ -8003,7 +8003,8 @@ static void handle_render_pass_stats(int id, const char *json) (unsigned long long)gl_renderer_pass_journaled(), (unsigned)image_textures, (unsigned long long)image_bytes, (unsigned)psx_mod_render_pass_status(), - (unsigned long long)gl_renderer_pass_backups_reused()); + (unsigned long long)gl_renderer_pass_backups_reused(), + (unsigned long long)st.spans, (unsigned long long)st.span_failures); } /* render_pass_refuse on=<0|1>: make the OpenGL backend decline render passes diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index b6edd193..01bab932 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -2414,6 +2414,17 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_addr); +/* Guest span replay (dirty_ram_run_span, psx_mod_run_guest_span): while a span + * is open, every PC in [s_span_lo, s_span_hi) (CODE identity) is interpreted + * from the live RAM bytes, even where a compiled body or one of its resume + * points starts there. Calls the span makes leave the range and run on their + * normal backend. A span is a replay, not an entry: it stays out of capture, + * seeding and entry statistics. */ +static uint32_t s_span_lo, s_span_hi; +static inline int span_forced(uint32_t phys) { + return phys >= s_span_lo && phys < s_span_hi; +} + /* Public entry point. Caller (psx_dispatch) has translated `addr` to a * KSEG-stripped form already in some cases, so accept any address and * mask. Returns 1 if interpretation handled the basic block; 0 if the @@ -2553,6 +2564,40 @@ int dirty_ram_dispatch(CPUState* cpu, uint32_t addr, uint32_t stop_addr) { return r; } +void dirty_ram_span_get(uint32_t *lo, uint32_t *hi) { + if (lo) *lo = s_span_lo; + if (hi) *hi = s_span_hi; +} + +void dirty_ram_span_set(uint32_t lo, uint32_t hi) { + s_span_lo = lo; + s_span_hi = hi; +} + +int dirty_ram_run_span(CPUState* cpu, uint32_t start_pc, uint32_t stop_pc, + uint64_t max_insns) { + const uint32_t lo = start_pc & 0x1FFFFFFFu, hi = stop_pc & 0x1FFFFFFFu; + if (!cpu || s_span_hi || ((start_pc | stop_pc) & 3u) || lo >= hi || + (start_pc ^ stop_pc) & 0xE0000000u) + return 0; + const uint64_t first = g_dirty_ram_insns_run; + int reached = 0; + s_span_lo = lo; + s_span_hi = hi; + cpu->pc = start_pc; + for (;;) { + const uint32_t pc = cpu->pc; + if (pc == stop_pc) { reached = 1; break; } + if (!pc || !span_forced(pc & 0x1FFFFFFFu) || g_psx_call_bail || + g_dirty_ram_insns_run - first > max_insns) + break; + if (!dirty_ram_dispatch(cpu, pc, stop_pc)) break; + } + s_span_lo = s_span_hi = 0; + dirty_ram_ld_delay_flush(cpu); + return reached; +} + /* ===== Cycle-budgeted precise event slicing (PRECISE_IRQ_SLICE.md) ===== */ /* Is a hardware interrupt deliverable to the guest at this exact instruction @@ -2820,7 +2865,8 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ * They differ only for a PC in a retail RAM mirror. */ uint32_t phys = addr & 0x1FFFFFFFu; const uint32_t ram_phys = psx_ram_map_read(phys); - int clean_game_text_miss = 0; + const int forced = span_forced(phys); + int clean_game_text_miss = forced; if (addr == 0x80000048u) { g_sentinel_reach_dirty++; @@ -2848,7 +2894,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ /* Run the statically-compiled game function only while the target is still * native-safe. Dirty overlay pages and pages whose text bytes diverged from * the original EXE image fall through to interpret the live RAM bytes. */ - if (psx_game_text_native_ok(addr)) { + if (!forced && psx_game_text_native_ok(addr)) { g_mixed_depth++; { ls_func_enter(addr, cpu); @@ -2861,7 +2907,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ if (_gc) return 1; } clean_game_text_miss = psx_game_address_in_text(addr) ? 1 : 0; - } else if (psx_game_address_in_text(addr)) { + } else if (!forced && psx_game_address_in_text(addr)) { /* RAM at a game-text address diverged from the static EXE image * (runtime-relocated / overlaid / self-modified code the compiled * static function no longer reflects). The live RAM is the truth: @@ -2879,7 +2925,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ * another segment misses above and is interpreted here like any clean * text miss, never run through the other segment's body. Record it with * the full PC; the fix is a segment-qualified seed and regeneration. */ - if (clean_game_text_miss) + if (clean_game_text_miss && !forced) (void)psx_segment_miss_note(addr, psx_game_is_function_entry, cpu->gpr[31], cpu->gpr[29], (uint32_t)s_frame_count); @@ -2892,7 +2938,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ extern int psx_overlay_dispatch(CPUState *cpu, uint32_t addr); int previous_phase = g_exec_phase; g_exec_phase = 3; - int handled = psx_overlay_dispatch(cpu, addr); + int handled = !forced && psx_overlay_dispatch(cpu, addr); g_exec_phase = previous_phase; if (handled) return 1; } @@ -2909,7 +2955,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ extern void overlay_regs_snap(uint32_t out[34], const CPUState *cpu); extern void overlay_fp_log(uint32_t addr, const uint32_t *in_regs, const CPUState *cpu, int native); - int _ovfp = overlay_fp_enabled() && + int _ovfp = !forced && overlay_fp_enabled() && overlay_cache_window_contains(phys) && overlay_loader_is_candidate(phys); uint32_t _in_regs[34]; @@ -2924,7 +2970,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ { extern int overlay_loader_dispatch(CPUState *cpu, uint32_t addr); - if (overlay_loader_dispatch(cpu, addr)) { + if (!forced && overlay_loader_dispatch(cpu, addr)) { if (_ovfp) overlay_fp_log(addr, _in_regs, cpu, 1); return 1; } @@ -2959,7 +3005,7 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ * counts dispatches the interpreter actually handles inside a capture * window. The autocapture tick reads-and-resets this to decide whether * an unseen region variant is being interp-executed right now. */ - if (overlay_cache_window_contains(phys)) g_dirty_window_dispatches++; + if (!forced && overlay_cache_window_contains(phys)) g_dirty_window_dispatches++; /* Reset soft-fail state at block entry. */ g_unsupported_seen = 0; @@ -2977,13 +3023,14 @@ static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_ { extern uint32_t g_psx_mod_function_entry_hooks; extern int psx_mod_function_entry(CPUState *cpu, uint32_t address); - if (g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, addr)) return 1; + if (!forced && g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, addr)) + return 1; } /* Per-PC entry counter (visible via dirty_ram_stats). */ - DirtyRamPcEntry *pc_entry = pc_table_get_or_insert(phys); + DirtyRamPcEntry *pc_entry = forced ? NULL : pc_table_get_or_insert(phys); if (pc_entry) pc_entry->hits++; - { + if (!forced) { uint32_t word = phys >> 2; g_dirty_ram_dispatch_pc_bitmap[word >> 5] |= 1u << (word & 31u); /* ...and the segment it entered through, from the full PC diff --git a/runtime/src/render_pass.c b/runtime/src/render_pass.c index 6f849051..44165ce9 100644 --- a/runtime/src/render_pass.c +++ b/runtime/src/render_pass.c @@ -108,6 +108,7 @@ typedef struct RenderPassNesting { int ov_active_depth; uint32_t ov_inprogress; void (*ov_flush)(void); + uint32_t span_lo, span_hi; /* open guest span (dirty_ram_run_span) */ } RenderPassNesting; static void nesting_save(RenderPassNesting *n) { @@ -125,6 +126,7 @@ static void nesting_save(RenderPassNesting *n) { dirty_ram_ld_delay_save(&n->ld_delay); overlay_loader_native_nesting(&n->ov_active_depth, &n->ov_inprogress); n->ov_flush = g_overlay_flush_pending_cycles; + dirty_ram_span_get(&n->span_lo, &n->span_hi); } static void nesting_restore(const RenderPassNesting *n) { @@ -142,6 +144,7 @@ static void nesting_restore(const RenderPassNesting *n) { dirty_ram_ld_delay_restore(&n->ld_delay); overlay_loader_set_native_nesting(n->ov_active_depth, n->ov_inprogress); g_overlay_flush_pending_cycles = n->ov_flush; + dirty_ram_span_set(n->span_lo, n->span_hi); } /* PSX_RENDER_PASS_VERIFY: a pass that returned normally must leave the @@ -158,7 +161,8 @@ static int nesting_balanced(const RenderPassNesting *n) { now.exec_phase == n->exec_phase && now.precise_mode == n->precise_mode && now.ov_active_depth == n->ov_active_depth && - now.ov_flush == n->ov_flush; + now.ov_flush == n->ov_flush && + now.span_lo == n->span_lo && now.span_hi == n->span_hi; } /* After a watchdog abort, before the restore: which exits the longjmp @@ -193,6 +197,7 @@ static int nesting_describe(const RenderPassNesting *n, int bb_defer_ck, RP_NOTE(now.exec_phase != n->exec_phase, "exec phase %d->%d", now.exec_phase, n->exec_phase); RP_NOTE(now.ld_delay.armed != n->ld_delay.armed, "pending load"); + RP_NOTE(now.span_hi != n->span_hi, "guest span"); #undef RP_NOTE return count; } @@ -298,6 +303,16 @@ uint32_t psx_mod_render_pass_status(void) { return pass_status(); } +int psx_mod_run_guest_span(CPUState *cpu, uint32_t start_pc, uint32_t stop_pc) { + if (!g_psx_render_pass_active || !cpu) return 0; + if (dirty_ram_run_span(cpu, start_pc, stop_pc, 1000000u)) { + s_stats.spans++; + return 1; + } + s_stats.span_failures++; + return 0; +} + uint32_t psx_mod_render_pass_plan(uint32_t period_vblanks, uint32_t shown_after_vblanks, uint32_t *alpha_q16, uint32_t max) { diff --git a/runtime/tests/test_render_pass_abort.c b/runtime/tests/test_render_pass_abort.c index 55668e07..25638b2c 100644 --- a/runtime/tests/test_render_pass_abort.c +++ b/runtime/tests/test_render_pass_abort.c @@ -236,6 +236,29 @@ static void guest_frame(CPUState *cpu, const Frames *f, int level) { g_call_unit_depth = prev_unit; } +/* The interpreter's guest-span state (dirty_ram_run_span): a span replays + * guest frames like any other code, so a runaway inside one leaves it open + * when the watchdog longjmps out. */ +static uint32_t s_span_lo, s_span_hi; +static const Frames *s_span_frames; +void dirty_ram_span_get(uint32_t *lo, uint32_t *hi) { *lo = s_span_lo; *hi = s_span_hi; } +void dirty_ram_span_set(uint32_t lo, uint32_t hi) { s_span_lo = lo; s_span_hi = hi; } +int dirty_ram_run_span(CPUState *cpu, uint32_t start, uint32_t stop, uint64_t max) { + (void)max; + if (s_span_hi) return 0; + s_span_lo = start & 0x1FFFFFFFu; + s_span_hi = stop & 0x1FFFFFFFu; + guest_frame(cpu, s_span_frames, 0); + s_span_lo = s_span_hi = 0; + return 1; +} + +static int span_pass_fn(struct CPUState *cpu, void *user, uint32_t alpha_q16) { + (void)alpha_q16; + s_span_frames = (const Frames *)user; + return psx_mod_run_guest_span(cpu, 0x800143FCu, 0x8001473Cu); +} + static int pass_fn(struct CPUState *cpu, void *user, uint32_t alpha_q16) { (void)alpha_q16; guest_frame(cpu, (const Frames *)user, 0); @@ -251,7 +274,7 @@ static int leaky_pass_fn(struct CPUState *cpu, void *user, uint32_t alpha_q16) { typedef struct Live { int bb_defer, unit, dma, host, dma_ch, active, phase, precise, dispatch; int ov_depth; - uint32_t ov_ip, batch, resume; + uint32_t ov_ip, batch, resume, span_lo, span_hi; void (*flush)(void); DirtyRamLoadDelay ld; uint64_t cycles, next_service, dev_cycles; @@ -273,6 +296,8 @@ static void snap(Live *l) { l->batch = g_psx_cyc_batch; l->resume = g_dirty_safe_resume_pc; l->flush = g_overlay_flush_pending_cycles; + l->span_lo = s_span_lo; + l->span_hi = s_span_hi; l->ld = s_ld; l->cycles = psx_cycle_count; l->next_service = psx_next_service_cycle; @@ -300,6 +325,8 @@ static void check_live(const Live *a, const char *when) { SAME(batch, "pending cycle batch"); SAME(resume, "interpreter resume latch"); SAME(flush, "shard cycle-flush hook"); + SAME(span_lo, "guest span start"); + SAME(span_hi, "guest span end"); SAME(ld.armed, "pending load (armed)"); SAME(ld.val, "pending load (value)"); SAME(cycles, "guest clock"); @@ -383,6 +410,30 @@ int main(void) { CHECK(st.verify_mismatch == 1, "an unbalanced pass is reported in verify mode"); check_live(&live, "after an unbalanced pass"); + /* 4. A guest span runs only inside a pass. */ + CHECK(psx_mod_run_guest_span(&cpu, 0x800143FCu, 0x8001473Cu) == 0, + "a guest span outside a pass is refused"); + render_pass_get_stats(&st); + CHECK(st.spans == 0 && st.span_failures == 0, "a refused span counts nothing"); + + /* 5. A span that completes inside a pass is counted and closed. */ + snap(&live); + CHECK(psx_mod_render_pass(&cpu, &pass, span_pass_fn, &clean) == 1, + "a pass that replays a span is presented"); + render_pass_get_stats(&st); + CHECK(st.spans == 1, "the span reached its stop"); + check_live(&live, "after a pass with a span"); + + /* 6. A span that runs away: the watchdog's landing closes it, so later + * dispatches of those PCs take their compiled bodies again. */ + snap(&live); + CHECK(psx_mod_render_pass(&cpu, &pass, span_pass_fn, &runaway) == 0, + "a runaway span is rolled back"); + render_pass_get_stats(&st); + CHECK(st.watchdog == 2, "the watchdog cut the span off"); + CHECK(s_span_hi == 0 && s_span_lo == 0, "the abort closed the open span"); + check_live(&live, "after a span watchdog abort"); + printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); return failures ? 1 : 0; } diff --git a/runtime/tests/test_render_pass_sandbox.c b/runtime/tests/test_render_pass_sandbox.c index e5f80bba..26908c2a 100644 --- a/runtime/tests/test_render_pass_sandbox.c +++ b/runtime/tests/test_render_pass_sandbox.c @@ -176,6 +176,13 @@ static DirtyRamLoadDelay s_ld; void dirty_ram_ld_delay_discard(void) { memset(&s_ld, 0, sizeof s_ld); } void dirty_ram_ld_delay_save(DirtyRamLoadDelay *o) { *o = s_ld; } void dirty_ram_ld_delay_restore(const DirtyRamLoadDelay *i) { s_ld = *i; } +static uint32_t s_span_lo, s_span_hi; +void dirty_ram_span_get(uint32_t *lo, uint32_t *hi) { *lo = s_span_lo; *hi = s_span_hi; } +void dirty_ram_span_set(uint32_t lo, uint32_t hi) { s_span_lo = lo; s_span_hi = hi; } +int dirty_ram_run_span(CPUState *cpu, uint32_t start, uint32_t stop, uint64_t max) { + (void)cpu; (void)start; (void)stop; (void)max; + return 0; +} void overlay_loader_native_nesting(int *d, uint32_t *ip) { *d = 0; *ip = 0; } void overlay_loader_set_native_nesting(int d, uint32_t ip) { (void)d; (void)ip; } From 1e6ef854c51e60be1dbc647853dfd7b1db04121c Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 09:00:38 -0700 Subject: [PATCH 13/52] Frontend: --hidden-window runs the full presenter in a never-shown window --- runtime/src/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 4078fdcd..f174e1b6 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -1303,6 +1303,11 @@ static int g_hotkey_pad_fast_forward_toggle = 0; /* unbound: latch fas static uint32_t g_savestate_input_guard_min_until = 0; static uint32_t g_savestate_input_guard_max_until = 0; static int g_headless = 0; /* debug/CI frontend: no SDL window/audio */ +/* Test frontend: the full windowed runtime (presenter, frame interpolation, + * render passes) in a window that is never shown. For automated checks of + * presentation features without putting a window on the desktop; drive it + * over TCP like --headless. */ +static int g_hidden_window = 0; /* FMV instant-skip via the game's OWN end-of-movie path. Tomba's MDEC player * (FUN_8001efe8) tears a movie down when the streamed frame number reaches that @@ -13297,6 +13302,8 @@ int main(int argc, char** argv) { * --launcher force the GUI launcher (overrides skip_launcher) * --no-launcher skip the GUI launcher (boot straight in) * --headless skip SDL window/audio; use TCP screenshots/state + * --hidden-window full presenter in a never-shown window (TCP-driven + * tests of interpolation / render passes) * --netplay enable delay-sync LAN (also PSX_NETPLAY=1) * --net-slot N local player slot (0|1) * --net-input-player N host device to sample (0=P1, 1=P2; default auto) @@ -13338,6 +13345,9 @@ int main(int argc, char** argv) { } else if (std::strcmp(argv[i], "--headless") == 0) { g_headless = 1; force_no_launcher = true; + } else if (std::strcmp(argv[i], "--hidden-window") == 0) { + g_hidden_window = 1; + force_no_launcher = true; } else if (std::strcmp(argv[i], "--netplay") == 0) { net_cfg.enabled = 1; } else if (std::strcmp(argv[i], "--net-slot") == 0 && i + 1 < argc) { @@ -16183,6 +16193,11 @@ session_reboot: win_flags |= PSX_SDL_WINDOW_HIGH_DENSITY; } if (g_video_renderer == 2) win_flags |= SDL_WINDOW_VULKAN; + if (g_hidden_window) { + win_flags &= ~(Uint32)SDL_WINDOW_SHOWN; + win_flags |= SDL_WINDOW_HIDDEN; + g_fullscreen = 0; + } /* Fullscreen on launch (launcher's tri-state Fullscreen control): 1 = * borderless desktop fullscreen (keeps the desktop resolution, letterboxes * the image), 2 = exclusive fullscreen (real display-mode change), 0 = From b27be21d1e84cc09bce8166c35f2a02dd6e77f23 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 09:03:05 -0700 Subject: [PATCH 14/52] Frontend: --hidden-window never blocks on a modal or file picker --- runtime/src/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index f174e1b6..7980ad24 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -2472,18 +2472,21 @@ static void write_cached_path(const char* argv0, const char* filename, if (f.is_open()) f << path.string() << "\n"; } +/* Nobody is at the screen: never block on a modal dialog or a file picker. */ +static bool frontend_unattended() { return g_headless || g_hidden_window; } + static void launcher_warning(const char* title, const std::string& msg) { std::fprintf(stderr, "%s: %s\n", title, msg.c_str()); - // Headless (--headless / PSX_HEADLESS): NEVER pop a blocking modal — it would + // Unattended (--headless / PSX_HEADLESS / --hidden-window): NEVER pop a blocking modal — it would // hang an unattended/CI/scripted run forever waiting for a click. // SDL_ShowSimpleMessageBox is cross-platform; the Win32-only MessageBoxA left // macOS and Linux users with a silent exit (v0.4.0 macOS report, 2026-09-15). - if (!g_headless) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, title, msg.c_str(), NULL); + if (!frontend_unattended()) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, title, msg.c_str(), NULL); } static void launcher_info(const char* title, const std::string& msg) { std::fprintf(stderr, "%s: %s\n", title, msg.c_str()); - if (!g_headless) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, title, msg.c_str(), NULL); + if (!frontend_unattended()) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, title, msg.c_str(), NULL); } /* Game display name for picker dialogs ("Tomba!"); set after the game @@ -2494,7 +2497,8 @@ static bool pick_runtime_file(const char* title, const char* filter, std::filesystem::path& out, const char* cli_flag) { // Headless: never open an interactive file dialog (it blocks). Fail the // resolve so boot aborts cleanly with the stderr message the caller printed. - if (g_headless) { + // Also when unattended in a hidden window (--hidden-window). + if (frontend_unattended()) { std::fprintf(stderr, "psxrecomp: headless — cannot prompt for '%s'.\n" " Supply it on the command line: %s (or set it in game.toml).\n", From 61bc68e53391f2c29160af959af72205a52fb6da Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 09:11:43 -0700 Subject: [PATCH 15/52] Render passes: FLIP_SHOWN mode for games that flip each frame as soon as it is drawn --- runtime/include/gpu_gl_renderer.h | 3 +++ runtime/include/mod_plugins.h | 18 ++++++++++++++++++ runtime/include/render_pass_plan.h | 12 ++++++++++++ runtime/src/gpu_gl_renderer.c | 14 ++++++++++---- runtime/src/render_pass.c | 9 +++++++++ runtime/src/render_pass_plan.c | 10 ++++++++++ runtime/tests/test_render_pass_abort.c | 1 + runtime/tests/test_render_pass_plan.c | 21 +++++++++++++++++++++ runtime/tests/test_render_pass_sandbox.c | 1 + 9 files changed, 85 insertions(+), 4 deletions(-) diff --git a/runtime/include/gpu_gl_renderer.h b/runtime/include/gpu_gl_renderer.h index ba2f4a7f..9e3bcfe0 100644 --- a/runtime/include/gpu_gl_renderer.h +++ b/runtime/include/gpu_gl_renderer.h @@ -66,6 +66,9 @@ uint32_t gl_renderer_pass_plan(uint32_t period_vblanks, * rect at the same scale. Returns 0 when refused (nothing changed). */ int gl_renderer_pass_begin(int x, int y, int w, int h, int open_gen, uint32_t period_vblanks, int reuse_backup); +/* Generations opened from now on are for a frame already on screen (1) or + * for the next flip (0, default); render_pass_gen_flip_matches. */ +void gl_renderer_pass_set_flip_shown(int shown); /* Capture the drawn rect at alpha_q16 (keep) and roll the rect back. */ void gl_renderer_pass_end(uint32_t alpha_q16, int keep); uint32_t gl_renderer_pass_leaks(void); diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 737260c5..7c5a614d 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -349,6 +349,24 @@ enum { }; uint32_t psx_mod_render_pass_status(void); +/* + * When the game flips relative to the pass point. PENDING (default, reset at + * every session start): the pass rect is the one the next flip will show -- + * the PsyQ VSync(0)-then-PutDispEnv loop, whose frame N is drawn and waits. + * SHOWN: the game flips each frame as soon as it is drawn (for example + * PutDispEnv in a VBlank callback armed by the DrawSync callback), so by the + * time frame N+1's logic is done frame N is already on screen. The pass rect + * is then that on-screen rect, and frame N's own image and its in-between + * images are shown from the game's next flip on: one game frame later than + * the game shows them, as a host interpolator with one frame of history + * would. Set it from activation, before the first plan. + */ +enum { + PSX_MOD_RENDER_PASS_FLIP_PENDING = 0, + PSX_MOD_RENDER_PASS_FLIP_SHOWN = 1 +}; +int psx_mod_set_render_pass_flip(uint32_t mode); + /* * Replay part of an already-loaded guest function inside a render pass: * run from start_pc with the CPU state given until control reaches stop_pc. diff --git a/runtime/include/render_pass_plan.h b/runtime/include/render_pass_plan.h index 294efee6..e4e519f2 100644 --- a/runtime/include/render_pass_plan.h +++ b/runtime/include/render_pass_plan.h @@ -65,6 +65,18 @@ int render_pass_select(const uint32_t *phases, uint32_t n, double p, int render_pass_gen_select(const uint32_t *phases, uint32_t n, double p, uint32_t *lo, uint32_t *hi, float *t); +/* Is the flip the FLIP source just saw the one a pending generation waits + * for? A generation built for the next flip (`shown` 0, the canonical PsyQ + * VSync-then-PutDispEnv point) waits for the display to flip to its own rect. + * One built for a frame already on screen (`shown` 1: the game flips each + * frame as soon as it is drawn) waits for the next flip, to any other rect; + * its images then show one game frame late. Either way the presented + * geometry must still be the one the generation was captured at. */ +int render_pass_gen_flip_matches(int shown, int gen_x, int gen_y, + int gen_source, int gen_w, int gen_h, + int flip_x, int flip_y, int flip_source, + int flip_w, int flip_h); + /* Exponential moving average used for the per-pass host cost. */ double render_pass_ema(double current, double sample); diff --git a/runtime/src/gpu_gl_renderer.c b/runtime/src/gpu_gl_renderer.c index 52ff57e5..218092c9 100644 --- a/runtime/src/gpu_gl_renderer.c +++ b/runtime/src/gpu_gl_renderer.c @@ -5782,8 +5782,10 @@ typedef struct PassGen { uint32_t n; /* images: [0] = the game's own */ uint32_t phase[PASS_SLOTS]; /* Q16, ascending */ uint32_t period; /* guest VBlanks the frame stays on screen */ + int shown; /* built for a frame already on screen */ double t_start, t_len; /* host ticks, set on promotion */ } PassGen; +static int s_pass_flip_shown = 0; static PassGen s_pgen[2]; /* Slot textures are made as slots fill: [0, s_pgen_alloc_n) exist, all at * s_pgen_alloc_w x h. A generation never fills past pass_slot_cap, so two @@ -6196,6 +6198,7 @@ int gl_renderer_pass_begin(int x, int y, int w, int h, int open_gen, g->tex_w = tw; g->tex_h = th; g->source_path = wide ? GL_PRES_WIDE : GL_PRES_VRAM; g->period = period_vblanks ? period_vblanks : 1u; + g->shown = s_pass_flip_shown; pass_capture_into(s_pgen_tex[gi][0], g); /* the game's own image */ g->phase[0] = 0; g->n = 1; @@ -6421,14 +6424,17 @@ static uint64_t s_present_ticks_accum_fwd(uint64_t add) { return s_present_ticks_accum; } +void gl_renderer_pass_set_flip_shown(int shown) { s_pass_flip_shown = shown ? 1 : 0; } + /* FLIP source saw a new frame: it is the flip a pending generation was built - * for (same rect, same presented geometry) or a frame without passes. */ + * for (render_pass_gen_flip_matches) or a frame without passes. */ static void pass_note_new_frame(int origin_x, int origin_y, int source_path, int pw, int ph) { PassGen *pend = &s_pgen[1 - s_pgen_cur]; - if (pend->valid && !pend->promoted && pend->x == origin_x && - pend->y == origin_y && pend->source_path == source_path && - pend->tex_w == pw && pend->tex_h == ph) { + if (pend->valid && !pend->promoted && + render_pass_gen_flip_matches(pend->shown, pend->x, pend->y, + pend->source_path, pend->tex_w, pend->tex_h, + origin_x, origin_y, source_path, pw, ph)) { s_pgen_promote = 1; } else { s_pgen_promote = 0; diff --git a/runtime/src/render_pass.c b/runtime/src/render_pass.c index 44165ce9..c287993b 100644 --- a/runtime/src/render_pass.c +++ b/runtime/src/render_pass.c @@ -275,6 +275,15 @@ void render_pass_reset_session(void) { memset(g_render_pass_dropped_writes, 0, sizeof g_render_pass_dropped_writes); s_open_generation = 0; s_restored_valid = 0; + gl_renderer_pass_set_flip_shown(0); +} + +int psx_mod_set_render_pass_flip(uint32_t mode) { + if (mode != PSX_MOD_RENDER_PASS_FLIP_PENDING && + mode != PSX_MOD_RENDER_PASS_FLIP_SHOWN) + return 0; + gl_renderer_pass_set_flip_shown(mode == PSX_MOD_RENDER_PASS_FLIP_SHOWN); + return 1; } /* Everything that must hold before guest code may run frozen, as a diff --git a/runtime/src/render_pass_plan.c b/runtime/src/render_pass_plan.c index b04ef525..21e17fd5 100644 --- a/runtime/src/render_pass_plan.c +++ b/runtime/src/render_pass_plan.c @@ -111,6 +111,16 @@ int render_pass_select(const uint32_t *phases, uint32_t n, double p, return 1; } +int render_pass_gen_flip_matches(int shown, int gen_x, int gen_y, + int gen_source, int gen_w, int gen_h, + int flip_x, int flip_y, int flip_source, + int flip_w, int flip_h) { + const int same_rect = gen_x == flip_x && gen_y == flip_y; + if (gen_source != flip_source || gen_w != flip_w || gen_h != flip_h) + return 0; + return shown ? !same_rect : same_rect; +} + int render_pass_gen_select(const uint32_t *phases, uint32_t n, double p, uint32_t *lo, uint32_t *hi, float *t) { if (!(p <= RENDER_PASS_GEN_HOLD_MAX)) return 0; diff --git a/runtime/tests/test_render_pass_abort.c b/runtime/tests/test_render_pass_abort.c index 25638b2c..36673d48 100644 --- a/runtime/tests/test_render_pass_abort.c +++ b/runtime/tests/test_render_pass_abort.c @@ -152,6 +152,7 @@ uint32_t gl_renderer_pass_plan(uint32_t p, uint32_t s, uint32_t *a, return 0; } static int s_open_passes, s_kept; +void gl_renderer_pass_set_flip_shown(int shown) { (void)shown; } int gl_renderer_pass_begin(int x, int y, int w, int h, int open_gen, uint32_t period, int reuse_backup) { (void)x; (void)y; (void)w; (void)h; (void)open_gen; (void)period; diff --git a/runtime/tests/test_render_pass_plan.c b/runtime/tests/test_render_pass_plan.c index e514618f..65a12fcd 100644 --- a/runtime/tests/test_render_pass_plan.c +++ b/runtime/tests/test_render_pass_plan.c @@ -149,6 +149,26 @@ static void test_gen_select_late(void) { CHECK(!render_pass_gen_select(ph, 0, 0.5, &lo, &hi, &t), "no items, no pick"); } +/* Promotion: a generation for the next flip waits for its own rect; one for + * a frame already on screen waits for the flip after it, to another rect. */ +static void test_gen_flip_matches(void) { + /* PsyQ VSync-then-PutDispEnv: built for the rect the flip shows. */ + CHECK(render_pass_gen_flip_matches(0, 0, 240, 1, 320, 240, 0, 240, 1, 320, 240), + "pending: the flip to the generation's rect promotes it"); + CHECK(!render_pass_gen_flip_matches(0, 0, 240, 1, 320, 240, 0, 0, 1, 320, 240), + "pending: a flip to the other buffer does not"); + /* Flip-when-drawn (V8:2): built for the rect already on screen. */ + CHECK(render_pass_gen_flip_matches(1, 0, 240, 1, 320, 240, 0, 0, 1, 320, 240), + "shown: the next flip, to the other buffer, promotes it"); + CHECK(!render_pass_gen_flip_matches(1, 0, 240, 1, 320, 240, 0, 240, 1, 320, 240), + "shown: a redraw of the rect on screen is not the next flip"); + /* Geometry the images were captured at must still be presented. */ + CHECK(!render_pass_gen_flip_matches(1, 0, 240, 1, 320, 240, 0, 0, 0, 320, 240), + "a different presented source never promotes"); + CHECK(!render_pass_gen_flip_matches(0, 0, 0, 1, 320, 240, 0, 0, 1, 640, 480), + "a different presented size never promotes"); +} + static void test_budget_and_ema(void) { CHECK(fabs(render_pass_budget(0, 0, 100.0, 0.5) - 50.0) < 1e-9, "no history spends the share of the frame"); @@ -301,6 +321,7 @@ int main(void) { test_shedding(); test_select(); test_gen_select_late(); + test_gen_flip_matches(); test_budget_and_ema(); printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); return failures ? 1 : 0; diff --git a/runtime/tests/test_render_pass_sandbox.c b/runtime/tests/test_render_pass_sandbox.c index 26908c2a..ceb99fca 100644 --- a/runtime/tests/test_render_pass_sandbox.c +++ b/runtime/tests/test_render_pass_sandbox.c @@ -202,6 +202,7 @@ uint32_t gl_renderer_pass_plan(uint32_t p, uint32_t s, uint32_t *a, return 0; } static int s_open_passes, s_kept; +void gl_renderer_pass_set_flip_shown(int shown) { (void)shown; } int gl_renderer_pass_begin(int x, int y, int w, int h, int open_gen, uint32_t period, int reuse_backup) { (void)x; (void)y; (void)w; (void)h; (void)open_gen; (void)period; From 3935ae8cab4336ed14d3a01237b066079ac2961b Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 09:31:14 -0700 Subject: [PATCH 16/52] Render passes: spans run their calls with the full trampoline; phase 0 is the flipped image Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/dirty_ram_interp.h | 10 ++++ runtime/src/debug_server.c | 12 ++++- runtime/src/dirty_ram_interp.c | 79 ++++++++++++++++++++++-------- runtime/src/gpu_gl_renderer.c | 13 +++++ 4 files changed, 92 insertions(+), 22 deletions(-) diff --git a/runtime/include/dirty_ram_interp.h b/runtime/include/dirty_ram_interp.h index 18cc4ee8..e9a9620f 100644 --- a/runtime/include/dirty_ram_interp.h +++ b/runtime/include/dirty_ram_interp.h @@ -56,6 +56,16 @@ int dirty_ram_dispatch(CPUState* cpu, uint32_t addr, uint32_t stop_addr); * Mods reach it through psx_mod_run_guest_span (render passes only). */ int dirty_ram_run_span(CPUState* cpu, uint32_t start_pc, uint32_t stop_pc, uint64_t max_insns); +/* Why the last span that failed stopped: 1 returned (pc 0), 2 left the range, + * 3 call-bail unwind, 4 instruction budget, 5 the interpreter declined the PC, + * 6 bad arguments or a span already open, 7 a call did not return to the + * span (`after`). `pc` is where control was. */ +typedef struct DirtyRamSpanFailure { + uint32_t reason, pc, start_pc, stop_pc; + uint32_t ra, after; /* $ra at the exit; pc after a call that did not return */ + uint64_t insns; +} DirtyRamSpanFailure; +void dirty_ram_span_last_failure(DirtyRamSpanFailure *out); /* The open span (0,0 = none), for landings that longjmp past its exit. */ void dirty_ram_span_get(uint32_t *lo, uint32_t *hi); void dirty_ram_span_set(uint32_t lo, uint32_t hi); diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index 95e8db9a..6c6c4744 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -7957,7 +7957,9 @@ static void handle_render_pass_stats(int id, const char *json) RenderPassStats st; uint64_t gd[10], image_bytes = 0; uint32_t image_textures; + DirtyRamSpanFailure sf; render_pass_get_stats(&st); + dirty_ram_span_last_failure(&sf); gl_renderer_pass_diag(gd); image_textures = gl_renderer_pass_image_textures(&image_bytes); send_fmt("{\"id\":%d,\"ok\":true,\"plans\":%llu,\"planned\":%llu," @@ -7977,7 +7979,10 @@ static void handle_render_pass_stats(int id, const char *json) "\"cost_us\":%llu,\"cost_rewarms\":%llu,\"frame_images\":%llu," "\"journaled\":%llu," "\"image_textures\":%u,\"image_bytes\":%llu,\"status\":%u," - "\"backups_reused\":%llu,\"spans\":%llu,\"span_failures\":%llu}", + "\"backups_reused\":%llu,\"spans\":%llu,\"span_failures\":%llu," + "\"span_fail\":{\"reason\":%u,\"pc\":\"0x%08X\",\"start\":\"0x%08X\"," + "\"stop\":\"0x%08X\",\"ra\":\"0x%08X\",\"after\":\"0x%08X\"," + "\"insns\":%llu}}", id, (unsigned long long)st.plans, (unsigned long long)st.planned, (unsigned long long)st.wanted, (unsigned long long)st.refused, (unsigned long long)st.passes, (unsigned long long)st.aborted, @@ -8004,7 +8009,10 @@ static void handle_render_pass_stats(int id, const char *json) (unsigned)image_textures, (unsigned long long)image_bytes, (unsigned)psx_mod_render_pass_status(), (unsigned long long)gl_renderer_pass_backups_reused(), - (unsigned long long)st.spans, (unsigned long long)st.span_failures); + (unsigned long long)st.spans, (unsigned long long)st.span_failures, + (unsigned)sf.reason, (unsigned)sf.pc, (unsigned)sf.start_pc, + (unsigned)sf.stop_pc, (unsigned)sf.ra, (unsigned)sf.after, + (unsigned long long)sf.insns); } /* render_pass_refuse on=<0|1>: make the OpenGL backend decline render passes diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index 01bab932..41335c96 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -512,6 +512,17 @@ extern int psx_game_text_native_ok_full(uint32_t addr); #endif extern void psx_dispatch_call(CPUState* cpu, uint32_t addr, uint32_t return_addr); +/* Guest span replay (dirty_ram_run_span, psx_mod_run_guest_span): while a span + * is open, every PC in [s_span_lo, s_span_hi) (CODE identity) is interpreted + * from the live RAM bytes, even where a compiled body or one of its resume + * points starts there. Calls the span makes leave the range and run on their + * normal backend. A span is a replay, not an entry: it stays out of capture, + * seeding and entry statistics. */ +static uint32_t s_span_lo, s_span_hi; +static inline int span_forced(uint32_t phys) { + return phys >= s_span_lo && phys < s_span_hi; +} + /* Forward decls from memory.c — used to read instruction bytes. */ extern uint8_t *memory_get_ram_ptr(void); extern void dirty_ram_mark_executable_range(uint32_t phys, uint32_t len); @@ -1710,7 +1721,9 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, #endif uint32_t _cr = callret_begin(cpu, pc, target); /* call-resolution ring */ #define CRET(code, rv) do { callret_end(_cr, cpu, (code)); return (rv); } while (0) - if (g_precise_mode || g_ls_replay_active) { cpu->pc = target; CRET(CRES_PLAIN, 1); } /* slice / lockstep-replay: plain transfer, never execute the callee */ + /* slice / lockstep-replay / guest span: plain transfer, never execute the + * callee (a span's runner calls it with the full trampoline). */ + if (g_precise_mode || g_ls_replay_active || span_forced(pc & 0x1FFFFFFFu)) { cpu->pc = target; CRET(CRES_PLAIN, 1); } if (rd != 31) { /* No architectural $ra contract: preserve the transfer as a * pc-chain and let the callee's eventual JR choose the real @@ -1928,7 +1941,9 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, #else #define XRES(code) do { (void)(code); } while (0) #endif - if (g_precise_mode || g_ls_replay_active) { cpu->pc = target; return 1; } /* slice / lockstep-replay: plain transfer, never execute the callee */ + /* slice / lockstep-replay / guest span: plain transfer, never execute the + * callee (a span's runner calls it with the full trampoline). */ + if (g_precise_mode || g_ls_replay_active || span_forced(pc & 0x1FFFFFFFu)) { cpu->pc = target; return 1; } #ifdef PSX_HAS_GAME_DISPATCH cpu->pc = 0; if (interp_enter_compiled(cpu, target)) { @@ -2414,16 +2429,6 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, static int dirty_ram_dispatch_inner(CPUState* cpu, uint32_t addr, uint32_t stop_addr); -/* Guest span replay (dirty_ram_run_span, psx_mod_run_guest_span): while a span - * is open, every PC in [s_span_lo, s_span_hi) (CODE identity) is interpreted - * from the live RAM bytes, even where a compiled body or one of its resume - * points starts there. Calls the span makes leave the range and run on their - * normal backend. A span is a replay, not an entry: it stays out of capture, - * seeding and entry statistics. */ -static uint32_t s_span_lo, s_span_hi; -static inline int span_forced(uint32_t phys) { - return phys >= s_span_lo && phys < s_span_hi; -} /* Public entry point. Caller (psx_dispatch) has translated `addr` to a * KSEG-stripped form already in some cases, so accept any address and @@ -2574,28 +2579,62 @@ void dirty_ram_span_set(uint32_t lo, uint32_t hi) { s_span_hi = hi; } +static DirtyRamSpanFailure s_span_failure; + +void dirty_ram_span_last_failure(DirtyRamSpanFailure *out) { + if (out) *out = s_span_failure; +} + int dirty_ram_run_span(CPUState* cpu, uint32_t start_pc, uint32_t stop_pc, uint64_t max_insns) { const uint32_t lo = start_pc & 0x1FFFFFFFu, hi = stop_pc & 0x1FFFFFFFu; + DirtyRamSpanFailure f = {0u, start_pc, start_pc, stop_pc, 0u, 0u, 0u}; if (!cpu || s_span_hi || ((start_pc | stop_pc) & 3u) || lo >= hi || - (start_pc ^ stop_pc) & 0xE0000000u) + (start_pc ^ stop_pc) & 0xE0000000u) { + f.reason = 6u; + s_span_failure = f; return 0; + } const uint64_t first = g_dirty_ram_insns_run; - int reached = 0; s_span_lo = lo; s_span_hi = hi; cpu->pc = start_pc; for (;;) { const uint32_t pc = cpu->pc; - if (pc == stop_pc) { reached = 1; break; } - if (!pc || !span_forced(pc & 0x1FFFFFFFu) || g_psx_call_bail || - g_dirty_ram_insns_run - first > max_insns) - break; - if (!dirty_ram_dispatch(cpu, pc, stop_pc)) break; + f.pc = pc; + f.ra = cpu->gpr[31]; + if (pc == stop_pc) break; + if (!pc) { f.reason = 1u; break; } + if (g_psx_call_bail) { f.reason = 3u; break; } + if (!span_forced(pc & 0x1FFFFFFFu)) { + /* The interpreter hands a call out of clean code back as a tail + * transfer (pc = callee, $ra = the return address). A call made + * by the span returns into it: run it as the caller would. A + * transfer out that is not a call ends the span. */ + const uint32_t ra = cpu->gpr[31]; + const uint32_t site = ra - 8u; + /* The span's last instruction may be a call: it returns to stop. */ + const uint32_t w = span_forced(site & 0x1FFFFFFFu) && + (span_forced(ra & 0x1FFFFFFFu) || ra == stop_pc) + ? fetch_word(site & 0x1FFFFFFFu) : 0u; + const int is_call = (w >> 26) == 0x03u || /* jal */ + ((w >> 26) == 0u && (w & 0x3Fu) == 0x09u); /* jalr */ + if (!is_call) { f.reason = 2u; break; } + cpu->pc = 0; + psx_dispatch_call(cpu, pc, ra); + if (g_psx_call_bail) { f.reason = 3u; break; } + if (cpu->pc != 0u && cpu->pc != ra) { f.after = cpu->pc; f.reason = 7u; break; } + cpu->pc = ra; + continue; + } + if (g_dirty_ram_insns_run - first > max_insns) { f.reason = 4u; break; } + if (!dirty_ram_dispatch(cpu, pc, stop_pc)) { f.reason = 5u; break; } } s_span_lo = s_span_hi = 0; dirty_ram_ld_delay_flush(cpu); - return reached; + f.insns = g_dirty_ram_insns_run - first; + if (f.reason) s_span_failure = f; + return f.reason == 0u; } /* ===== Cycle-budgeted precise event slicing (PRECISE_IRQ_SLICE.md) ===== */ diff --git a/runtime/src/gpu_gl_renderer.c b/runtime/src/gpu_gl_renderer.c index 218092c9..ef6b8f3b 100644 --- a/runtime/src/gpu_gl_renderer.c +++ b/runtime/src/gpu_gl_renderer.c @@ -6490,6 +6490,19 @@ static void pass_apply_promotion(void) { g->promoted = 1; g->t_start = s_interp_schedule.frame_start; g->t_len = (double)g->period * sp; + /* Phase 0 is the image the game actually flipped to. The capture at + * the pass point is the same for a game that draws nothing more into + * the rect before its flip; a game that finishes the frame later (V8:2 + * draws its HUD at the next submit, onto the rect about to be shown) + * would otherwise show its own frame without that last layer. The + * flip was matched to this generation's rect and presented geometry, + * and no guest code ran since it, so the rect holds that image. A + * FLIP_SHOWN generation's rect is not the one flipped to: it keeps + * the image taken when it opened. */ + if (!g->shown) { + pass_capture_into(s_pgen_tex[s_pgen_cur][0], g); + p_glBindFramebuffer(PSXGL_READ_FRAMEBUFFER, 0); + } s_pgen_promotions++; if (s_pdump_left > 0) pass_dump_generation(s_pgen_cur); } From 642cd48f7da4f3e34fe624aaf8fee3d765428d24 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 10:16:55 -0700 Subject: [PATCH 17/52] Render passes: motion kit and per-frame driver for frame-rate plugins; porting guide Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/RENDER_PASSES.md | 119 +++++++ runtime/CMakeLists.txt | 12 + runtime/include/mod_plugins.h | 26 ++ runtime/include/render_pass_motion.h | 119 +++++++ runtime/runtime.cmake | 2 + runtime/src/render_pass_frame.c | 58 +++ runtime/src/render_pass_motion.c | 447 ++++++++++++++++++++++++ runtime/tests/test_render_pass_motion.c | 215 ++++++++++++ 8 files changed, 998 insertions(+) create mode 100644 runtime/include/render_pass_motion.h create mode 100644 runtime/src/render_pass_frame.c create mode 100644 runtime/src/render_pass_motion.c create mode 100644 runtime/tests/test_render_pass_motion.c diff --git a/docs/RENDER_PASSES.md b/docs/RENDER_PASSES.md index 6275f333..3090994e 100644 --- a/docs/RENDER_PASSES.md +++ b/docs/RENDER_PASSES.md @@ -73,6 +73,125 @@ back to `HOLD` when the status is `READY` again. A backend mode that cannot host passes (for example a renderer path whose VRAM is not one texture) should report `BACKEND` from `gl_renderer_pass_unavailable()`. +## Flip modes + +`psx_mod_set_render_pass_flip()` says how the game flips relative to the pass +point (default `PENDING`, reset at every session start): + +- `PENDING`: frame N is drawn and waits; the next flip shows the pass rect. + This is the PsyQ `VSync(0)`-then-`PutDispEnv` loop, and also any game that + flips only after the next frame is submitted (Vigilante 8: 2nd Offense + flips from a VBlank callback armed by the next submit). Phase 0 is + re-captured when the flip is seen, so a game that adds a last layer to the + shown buffer after the pass point (V8:2 draws its HUD at the next submit) + shows its own final image at phase 0. +- `SHOWN`: the game flips each frame as soon as it is drawn, so at the pass + point frame N is already on screen. The rect is that on-screen rect; frame + N and its in-betweens are shown from the next flip, one game frame later + than stock (the latency of any interpolator with one frame of history). + +Decide by decoding the game's DISPENV / DRAWENV tables and where it calls +`PutDispEnv` and `DrawOTag`, not by assumption: in V8:2 `DISPENV[i]` shows +the buffer `DRAWENV[1-i]` draws. + +## Replaying a span of frame code + +Re-implementing a game's per-frame draw call sequence in a plugin copies one +path through it (HUD, messages, pause menu, replay mode each branch +differently) and drifts from it. Instead, a plugin records the registers at +the start of the game's draw section during the real frame (an instruction +hook, `mod_instruction_sites`) and, inside a pass, replays that section: + +```c +int psx_mod_run_guest_span(struct CPUState *cpu, uint32_t start_pc, uint32_t stop_pc); +``` + +Every PC in `[start_pc, stop_pc)` is interpreted from its RAM bytes, even +where a compiled body or a compiled resume point (the return address of a +call) begins, so the span may start in the middle of a compiled function. +Calls the span makes leave the range as plain transfers and run with the +full dispatch trampoline back to their return address (compiled code is CPS: +a callee's own calls and returns go through the trampoline). A call may be +the span's last instruction. Anything else that leaves the range ends the +span with failure. Only inside a pass: the sandbox rolls a failed or runaway +span back, and the watchdog landing closes an open span. The span is a +replay of the game's own instructions, never a substitute for code the +recompiler could not translate; it stays out of capture, alias seeding and +per-PC entry statistics, and fires instruction hooks as compiled code does. +`render_pass_stats` counts `spans` / `span_failures` and keeps the last +failure (`span_fail`: reason, exit PC, `$ra`, post-call PC). + +## Blending game state (render_pass_motion.h) + +What makes a pass an in-between image is the state the draw code reads, +placed part of the way between two logic ticks. `render_pass_motion.h` holds +that for any title: + +```c +psx_motion_begin(set, tick); /* each frame, capture point */ +psx_motion_track(set, PSX_MOTION_MATRIX, obj + 0x20, psx_motion_identity(type, fn, mesh)); +psx_motion_prepare(set, &limits, &stats); /* pair with the previous frame */ +/* in each pass */ +psx_motion_apply(set, alpha); /* write blends to guest RAM */ +psx_motion_blend_at(set, kind, addr, alpha, &out); /* a value a hook hands on */ +``` + +Kinds: PsyQ `MATRIX` (slerped rotation, linear translation), its translation +only (billboards), `VECTOR`, `SVECTOR`, 12-bit `ANGLES` (shorter arc) and a +`SCALAR`. Values pair by address and identity, so a heap block reused by +another object never blends between the two. `limits.move_per_tick` (game +units) and `limits.turn_radians` separate motion from placement: a value +past them was respawned, teleported or cut to and keeps its current value. +Measure the game's real motion first; V8:2's world spans about 2^27 units +per axis and moves up to 2^16 per frame. + +## Per-frame driver + +```c +int psx_mod_activate_render_pass_rate(const char *pkg, const char *feature, + const char *option, uint32_t flip_mode); +uint32_t psx_mod_render_pass_frame(struct CPUState *cpu, + const PSXModRenderPassFrame *frame, + PSXModRenderPassFn fn, void *user); +``` + +The first reads a choice option (`display` or a rate) and selects the FLIP +source, HOLD blend, the flip mode and the rate. The second plans one game +frame, runs `fn` at each phase into the frame's rect, and switches the +presenter to a crossfade while passes are unavailable for a lasting reason +(back to HOLD when they return). + +## Porting a title + +1. Find the main loop's draw section: the range from camera setup through + OT build and HUD to the submit call, and every call in it. +2. Decode DISPENV/DRAWENV and the submit/flip path: which buffer the next + flip shows at the pass point, and in what order the game draws into it + (immediate `DrawOTag`, VBlank callback). Pick the flip mode. +3. Find the pass point (a function entry after the section's OT build, before + submit) and the logic tick counter. +4. Find what the draw code reads that moves: the camera input (often the + argument of a set-camera function: track it with `blend_at` from an entry + hook), object transforms and their identity, particles. +5. Measure motion per frame with histograms (mod counters) before setting + limits. +6. Plugin: instruction hook at the section start (registers), capture at the + pass point, `psx_mod_render_pass_frame` with a pass function that applies + the blend, replays the span and submits as the screen gets it. +7. Verify in `--hidden-window` (below): `render_pass_stats` passes with no + span failures, `render_pass_dump` images between their neighbours, + `PSX_RENDER_PASS_VERIFY=1` with `verify_mismatch` 0. + +`Vigilante82PSXRecomp/src/mods/v82_frame_rate_plugin.cpp` is the worked +example. + +## Testing without a window + +`--hidden-window` runs the full windowed runtime (presenter, interpolation, +render passes) in a window that is never shown and never opens a modal or a +file picker. `--headless` skips the presenter, so plans there are always +empty. Drive it over TCP; set `SDL_AUDIODRIVER=dummy` to keep it silent. + ## What a pass may and may not do While `fn` runs (`g_psx_render_pass_active`): diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 56a208d9..c2226f66 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -795,6 +795,18 @@ if(BUILD_TESTING) endif() add_test(NAME render_pass_plan_test COMMAND render_pass_plan_test) + # Motion kit and per-frame driver for render-pass plugins: blending, + # identity matching, limits and the crossfade fallback, on mock RAM. + add_executable(render_pass_motion_test + tests/test_render_pass_motion.c + src/render_pass_motion.c + src/render_pass_frame.c) + target_include_directories(render_pass_motion_test PRIVATE include) + if(NOT MSVC) + target_link_libraries(render_pass_motion_test PRIVATE m) + endif() + add_test(NAME render_pass_motion_test COMMAND render_pass_motion_test) + # Render-pass time freeze against mock devices (psx_cycles.c only). add_executable(render_pass_freeze_test tests/test_render_pass_freeze.c diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 7c5a614d..151e6f81 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -367,6 +367,32 @@ enum { }; int psx_mod_set_render_pass_flip(uint32_t mode); +/* + * The per-frame plumbing every frame-rate plugin repeats (render_pass_frame.c). + * Blending the game state itself: render_pass_motion.h. + * + * Activation: read a choice option holding "display" (follow the measured + * display refresh) or a frame rate, and select the FLIP source, HOLD blend, + * `flip_mode` and that rate. Returns 0 if any setting was refused. + */ +int psx_mod_activate_render_pass_rate(const char* package, const char* feature, + const char* option, uint32_t flip_mode); +typedef struct PSXModRenderPassFrame { + uint32_t struct_size; /* sizeof(PSXModRenderPassFrame) */ + uint32_t period_vblanks; /* VBlanks this game frame stays on screen */ + uint32_t shown_after_vblanks; /* VBlank presents before it is shown */ + uint16_t x, y, w, h; /* VRAM rect the passes draw */ +} PSXModRenderPassFrame; +/* + * Plan this game frame's passes and run `fn` at each phase. While passes are + * unavailable for a lasting reason (BACKEND, DISABLED) the presenter is + * switched to a motion-adaptive crossfade, and back to HOLD once they return. + * Returns how many passes produced an image. + */ +uint32_t psx_mod_render_pass_frame(struct CPUState* cpu, + const PSXModRenderPassFrame* frame, + PSXModRenderPassFn fn, void* user); + /* * Replay part of an already-loaded guest function inside a render pass: * run from start_pc with the CPU state given until control reaches stop_pc. diff --git a/runtime/include/render_pass_motion.h b/runtime/include/render_pass_motion.h new file mode 100644 index 00000000..9bb1ea7b --- /dev/null +++ b/runtime/include/render_pass_motion.h @@ -0,0 +1,119 @@ +#ifndef PSX_RENDER_PASS_MOTION_H +#define PSX_RENDER_PASS_MOTION_H +/* + * Motion kit for render-pass plugins (docs/RENDER_PASSES.md, "Blending game + * state"). A pass redraws the scene with the game's own code between two + * logic ticks; what makes the image an in-between one is the game state the + * draw code reads, placed part of the way from the previous tick to the + * current one. This kit owns that part for any title: + * + * per game frame, at the plugin's capture point + * psx_motion_begin(set, tick) the game's logic tick counter + * psx_motion_track(set, kind, addr, identity) for each value the draw + * code reads (object matrices, + * positions, angles, the camera) + * psx_motion_prepare(set, &limits, &stats) pair with the previous frame + * in each pass + * psx_motion_apply(set, alpha) write the blends into guest RAM + * psx_motion_blend_at(set, addr, ...) or blend one value a hook hands on + * + * Values are matched by address AND identity: game objects are heap blocks, + * and a freed address reused by another object must never blend between the + * two. A value that moved further than the limits allow in the ticks between + * the frames was placed (respawn, teleport, camera cut), not moved; it keeps + * its current value, as do values without history. Nothing is written + * outside psx_motion_apply, which a pass's sandbox rolls back. + * + * Guest RAM is read and written through psx_mod_read_* / psx_mod_write_*. + */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* What lives at a tracked address (guest RAM layout). */ +enum { + /* PsyQ MATRIX: 3x3 s16 rotation in 4.12 at +0x00..+0x11, s32 t[3] at + * +0x14. Rotation slerps when both rows are orthonormal, otherwise it + * blends elementwise; translation blends linearly. */ + PSX_MOTION_MATRIX = 1, + /* Only the translation of a MATRIX (+0x14..+0x1F): for matrices whose + * rotation the draw code rebuilds itself (billboards). */ + PSX_MOTION_MATRIX_TRANSLATION = 2, + PSX_MOTION_VECTOR = 3, /* s32 x, y, z */ + PSX_MOTION_SVECTOR = 4, /* s16 x, y, z */ + /* s16 x, y, z angles, 4096 per turn: each blends along the shorter arc. */ + PSX_MOTION_ANGLES = 5, + PSX_MOTION_SCALAR = 6 /* s32 */ +}; + +typedef struct PSXMotionLimits { + /* Distance one value may move per logic tick and still blend + * (translation, VECTOR, SVECTOR, SCALAR, in the game's units). */ + double move_per_tick; + /* Rotation between the two frames beyond which a value snaps + * (MATRIX rotation, ANGLES). 0 means pi (any turn up to a half turn). */ + double turn_radians; +} PSXMotionLimits; + +typedef struct PSXMotionStats { + uint32_t tracked; /* values captured this frame */ + uint32_t blended; /* ... that will blend */ + uint32_t placed; /* ... that moved or turned past the limits */ + uint32_t unmatched; /* ... new, or a different identity at the address */ + uint32_t ticks; /* logic ticks between the two frames (0 = no history) */ +} PSXMotionStats; + +typedef struct PSXMotionMatrix { + int16_t r[9]; + int32_t t[3]; +} PSXMotionMatrix; + +typedef struct PSXMotionSet PSXMotionSet; + +PSXMotionSet* psx_motion_set_create(uint32_t capacity); +void psx_motion_set_destroy(PSXMotionSet* set); + +/* Start this frame's capture. `tick` is the game's logic tick counter at + * this frame; the previous capture becomes the history. */ +void psx_motion_begin(PSXMotionSet* set, uint32_t tick); +/* Record the value of `kind` at `addr` as the draw code will read it. + * `identity` names what lives there (psx_motion_identity of its type, + * handler, model...). One value per (addr, kind) per frame; a repeat + * replaces the earlier one. Returns 0 when the set is full. */ +int psx_motion_track(PSXMotionSet* set, uint32_t kind, uint32_t addr, + uint32_t identity); +/* Pair this capture with the previous one. Returns how many values will + * blend. History counts only when it is the capture just before this one + * with 1..8 ticks between them; otherwise nothing blends. */ +uint32_t psx_motion_prepare(PSXMotionSet* set, const PSXMotionLimits* limits, + PSXMotionStats* stats); +/* Write every prepared value at t (0 = previous frame, 1 = this frame). */ +void psx_motion_apply(const PSXMotionSet* set, double t); +/* Blend one prepared value at t into `out` without writing guest RAM: + * a PSXMotionMatrix for the MATRIX kinds, int32_t[3] for VECTOR / SVECTOR / + * ANGLES, int32_t for SCALAR. Returns 0 when that value does not blend this + * frame (out then holds its current value) or was not tracked (out + * untouched, returns -1). */ +int psx_motion_blend_at(const PSXMotionSet* set, uint32_t kind, uint32_t addr, + double t, void* out); +/* Forget all history (scene change, load, a frame the plugin skipped). */ +void psx_motion_invalidate(PSXMotionSet* set); + +/* Mix up to three words into an identity tag. */ +uint32_t psx_motion_identity(uint32_t a, uint32_t b, uint32_t c); + +/* The math, for plugins that blend values the set does not hold. Returns 0 + * when the rotation turned past turn_radians (out = b). */ +int psx_motion_blend_matrix(const PSXMotionMatrix* a, const PSXMotionMatrix* b, + double t, double turn_radians, + PSXMotionMatrix* out); +void psx_motion_read_matrix(uint32_t addr, PSXMotionMatrix* out); +void psx_motion_write_matrix(uint32_t addr, const PSXMotionMatrix* m, + int rotation); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/runtime/runtime.cmake b/runtime/runtime.cmake index 5463e147..047ab000 100644 --- a/runtime/runtime.cmake +++ b/runtime/runtime.cmake @@ -353,6 +353,8 @@ set(PSXRECOMP_RUNTIME_SOURCES ${PSXRECOMP_ROOT}/runtime/src/frame_interpolation.c ${PSXRECOMP_ROOT}/runtime/src/render_pass.c ${PSXRECOMP_ROOT}/runtime/src/render_pass_plan.c + ${PSXRECOMP_ROOT}/runtime/src/render_pass_motion.c + ${PSXRECOMP_ROOT}/runtime/src/render_pass_frame.c ${PSXRECOMP_ROOT}/runtime/src/host_time.c ${PSXRECOMP_ROOT}/runtime/src/psx_fiber.c ${PSXRECOMP_ROOT}/runtime/src/sio.c diff --git a/runtime/src/render_pass_frame.c b/runtime/src/render_pass_frame.c new file mode 100644 index 00000000..9a4d8156 --- /dev/null +++ b/runtime/src/render_pass_frame.c @@ -0,0 +1,58 @@ +/* Per-frame driver and activation for render-pass frame-rate plugins: the + * parts every title repeats around psx_mod_render_pass_plan / _pass. */ +#include "mod_plugins.h" + +#include +#include + +#define FRAME_MAX_PHASES 16u + +static int s_crossfade; /* passes lastingly unavailable: presenter crossfades */ + +int psx_mod_activate_render_pass_rate(const char* package, const char* feature, + const char* option, uint32_t flip_mode) { + char value[16]; + unsigned long fps = 0; /* 0 follows the measured display refresh */ + if (package && feature && option && + psx_mod_option_value(package, feature, option, value, sizeof value) && + strcmp(value, "display") != 0) { + char* end = value; + const unsigned long parsed = strtoul(value, &end, 10); + if (end != value && *end == '\0') fps = parsed; + } + s_crossfade = 0; + if (!psx_mod_set_frame_interpolation_source(PSX_MOD_FRAME_SOURCE_FLIP) || + !psx_mod_set_render_pass_flip(flip_mode) || + !psx_mod_set_frame_interpolation_blend(PSX_MOD_FRAME_INTERPOLATION_HOLD)) + return 0; + return psx_mod_set_frame_interpolation((uint32_t)fps); +} + +uint32_t psx_mod_render_pass_frame(struct CPUState* cpu, + const PSXModRenderPassFrame* frame, + PSXModRenderPassFn fn, void* user) { + uint32_t phases[FRAME_MAX_PHASES], n, kept = 0; + const uint32_t status = psx_mod_render_pass_status(); + const int lasting = status == PSX_MOD_RENDER_PASS_BACKEND || + status == PSX_MOD_RENDER_PASS_DISABLED; + PSXModRenderPass pass; + if (lasting != s_crossfade) { + s_crossfade = lasting; + psx_mod_set_frame_interpolation_blend( + lasting ? PSX_MOD_FRAME_INTERPOLATION_MOTION_ADAPTIVE + : PSX_MOD_FRAME_INTERPOLATION_HOLD); + } + if (!cpu || !frame || !fn || frame->struct_size < sizeof *frame || + frame->period_vblanks == 0 || frame->w == 0 || frame->h == 0) + return 0; + n = psx_mod_render_pass_plan(frame->period_vblanks, frame->shown_after_vblanks, + phases, FRAME_MAX_PHASES); + memset(&pass, 0, sizeof pass); + pass.struct_size = sizeof pass; + pass.x = frame->x; pass.y = frame->y; pass.w = frame->w; pass.h = frame->h; + for (uint32_t i = 0; i < n; i++) { + pass.alpha_q16 = phases[i]; + if (psx_mod_render_pass(cpu, &pass, fn, user)) kept++; + } + return kept; +} diff --git a/runtime/src/render_pass_motion.c b/runtime/src/render_pass_motion.c new file mode 100644 index 00000000..89d9eeb1 --- /dev/null +++ b/runtime/src/render_pass_motion.c @@ -0,0 +1,447 @@ +/* Motion kit for render-pass plugins: capture, pair and blend the game state + * a pass redraws from. See include/render_pass_motion.h. */ +#include "render_pass_motion.h" +#include "mod_plugins.h" + +#include +#include +#include + +#define MOTION_MAX_TICKS 8u +#define MOTION_PI 3.14159265358979323846 + +typedef struct MotionEntry { + uint32_t addr, identity, seq; + uint8_t kind; + int32_t v[12]; /* MATRIX: r[0..8], t at [9..11]; others from v[0] */ +} MotionEntry; + +typedef struct MotionPair { uint32_t prev, cur; } MotionPair; + +struct PSXMotionSet { + uint32_t cap; + MotionEntry* cap_buf[2]; + uint32_t n[2]; + uint32_t tick[2]; + int began[2]; /* a capture was made into this buffer */ + int sorted[2]; + int cur; /* buffer the current capture writes */ + int history; /* the other buffer holds the capture just before */ + MotionPair* pairs; + uint32_t npairs; + uint32_t ticks; +}; + +uint32_t psx_motion_identity(uint32_t a, uint32_t b, uint32_t c) { + uint32_t h = 2166136261u; + const uint32_t w[3] = {a, b, c}; + for (int i = 0; i < 3; i++) + for (int k = 0; k < 4; k++) h = (h ^ ((w[i] >> (8 * k)) & 0xFFu)) * 16777619u; + return h; +} + +PSXMotionSet* psx_motion_set_create(uint32_t capacity) { + PSXMotionSet* s; + if (capacity == 0) return NULL; + s = (PSXMotionSet*)calloc(1, sizeof *s); + if (!s) return NULL; + s->cap = capacity; + s->cap_buf[0] = (MotionEntry*)calloc(capacity, sizeof(MotionEntry)); + s->cap_buf[1] = (MotionEntry*)calloc(capacity, sizeof(MotionEntry)); + s->pairs = (MotionPair*)calloc(capacity, sizeof(MotionPair)); + if (!s->cap_buf[0] || !s->cap_buf[1] || !s->pairs) { + psx_motion_set_destroy(s); + return NULL; + } + return s; +} + +void psx_motion_set_destroy(PSXMotionSet* s) { + if (!s) return; + free(s->cap_buf[0]); + free(s->cap_buf[1]); + free(s->pairs); + free(s); +} + +void psx_motion_invalidate(PSXMotionSet* s) { + if (!s) return; + s->history = 0; + s->began[0] = s->began[1] = 0; + s->n[0] = s->n[1] = 0; + s->npairs = 0; + s->ticks = 0; +} + +void psx_motion_begin(PSXMotionSet* s, uint32_t tick) { + if (!s) return; + s->history = s->began[s->cur]; + s->cur ^= 1; + s->n[s->cur] = 0; + s->tick[s->cur] = tick; + s->began[s->cur] = 1; + s->sorted[s->cur] = 0; + s->npairs = 0; + s->ticks = 0; +} + +/* ---- guest RAM --------------------------------------------------------- */ + +void psx_motion_read_matrix(uint32_t addr, PSXMotionMatrix* m) { + for (int i = 0; i < 9; i++) m->r[i] = (int16_t)psx_mod_read_half(addr + 2u * (uint32_t)i); + for (int i = 0; i < 3; i++) m->t[i] = (int32_t)psx_mod_read_word(addr + 0x14u + 4u * (uint32_t)i); +} + +void psx_motion_write_matrix(uint32_t addr, const PSXMotionMatrix* m, int rotation) { + if (rotation) + for (int i = 0; i < 9; i++) psx_mod_write_half(addr + 2u * (uint32_t)i, (uint16_t)m->r[i]); + for (int i = 0; i < 3; i++) psx_mod_write_word(addr + 0x14u + 4u * (uint32_t)i, (uint32_t)m->t[i]); +} + +static void read_entry(MotionEntry* e) { + switch (e->kind) { + case PSX_MOTION_MATRIX: + case PSX_MOTION_MATRIX_TRANSLATION: { + PSXMotionMatrix m; + psx_motion_read_matrix(e->addr, &m); + for (int i = 0; i < 9; i++) e->v[i] = m.r[i]; + for (int i = 0; i < 3; i++) e->v[9 + i] = m.t[i]; + break; + } + case PSX_MOTION_VECTOR: + for (int i = 0; i < 3; i++) e->v[i] = (int32_t)psx_mod_read_word(e->addr + 4u * (uint32_t)i); + break; + case PSX_MOTION_SVECTOR: + case PSX_MOTION_ANGLES: + for (int i = 0; i < 3; i++) e->v[i] = (int16_t)psx_mod_read_half(e->addr + 2u * (uint32_t)i); + break; + case PSX_MOTION_SCALAR: + e->v[0] = (int32_t)psx_mod_read_word(e->addr); + break; + } +} + +int psx_motion_track(PSXMotionSet* s, uint32_t kind, uint32_t addr, uint32_t identity) { + MotionEntry* e; + if (!s || kind < PSX_MOTION_MATRIX || kind > PSX_MOTION_SCALAR) return 0; + if (!s->began[s->cur] || s->n[s->cur] >= s->cap) return 0; + e = &s->cap_buf[s->cur][s->n[s->cur]]; + memset(e, 0, sizeof *e); + e->addr = addr; + e->kind = (uint8_t)kind; + e->identity = identity; + e->seq = s->n[s->cur]++; + s->sorted[s->cur] = 0; + read_entry(e); + return 1; +} + +/* ---- math ---------------------------------------------------------------- */ + +static int orthonormal(const int16_t* r) { + for (int i = 0; i < 3; i++) { + double len = 0; + for (int j = 0; j < 3; j++) len += (double)r[3 * i + j] * r[3 * i + j]; + if (fabs(sqrt(len) - 4096.0) > 4096.0 * 0.04) return 0; + for (int k = i + 1; k < 3; k++) { + double dot = 0; + for (int j = 0; j < 3; j++) dot += (double)r[3 * i + j] * r[3 * k + j]; + if (fabs(dot) > 4096.0 * 4096.0 * 0.04) return 0; + } + } + return 1; +} + +static void to_quat(const int16_t* r, double q[4]) { + double a[9], n; + for (int i = 0; i < 9; i++) a[i] = r[i] / 4096.0; + const double tr = a[0] + a[4] + a[8]; + if (tr > 0) { + double s = sqrt(tr + 1.0) * 2; + q[0] = 0.25 * s; q[1] = (a[7] - a[5]) / s; q[2] = (a[2] - a[6]) / s; q[3] = (a[3] - a[1]) / s; + } else if (a[0] > a[4] && a[0] > a[8]) { + double s = sqrt(1.0 + a[0] - a[4] - a[8]) * 2; + q[0] = (a[7] - a[5]) / s; q[1] = 0.25 * s; q[2] = (a[1] + a[3]) / s; q[3] = (a[2] + a[6]) / s; + } else if (a[4] > a[8]) { + double s = sqrt(1.0 + a[4] - a[0] - a[8]) * 2; + q[0] = (a[2] - a[6]) / s; q[1] = (a[1] + a[3]) / s; q[2] = 0.25 * s; q[3] = (a[5] + a[7]) / s; + } else { + double s = sqrt(1.0 + a[8] - a[0] - a[4]) * 2; + q[0] = (a[3] - a[1]) / s; q[1] = (a[2] + a[6]) / s; q[2] = (a[5] + a[7]) / s; q[3] = 0.25 * s; + } + n = sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]); + for (int i = 0; i < 4; i++) q[i] /= n; +} + +static int16_t fixed12(double v) { + double x = v * 4096.0; + if (x > 32767.0) x = 32767.0; + if (x < -32768.0) x = -32768.0; + return (int16_t)lround(x); +} + +static double turn_limit(double turn) { return turn > 0 ? turn : MOTION_PI; } + +/* Angle between two orientations, or -1 when either is not a rotation. */ +static double rotation_angle(const int16_t* a, const int16_t* b) { + double p[4], q[4], d; + if (!orthonormal(a) || !orthonormal(b)) return -1; + to_quat(a, p); + to_quat(b, q); + d = fabs(p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]); + if (d > 1.0) d = 1.0; + return 2.0 * acos(d); +} + +static int blend_rotation(const int16_t* a, const int16_t* b, double t, double turn, int16_t* out) { + if (orthonormal(a) && orthonormal(b)) { + double p[4], q[4], d, angle, wa, wb, r[4]; + to_quat(a, p); + to_quat(b, q); + d = p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]; + if (d < 0) { for (int i = 0; i < 4; i++) q[i] = -q[i]; d = -d; } + if (d > 1.0) d = 1.0; + angle = acos(d); + if (2.0 * angle > turn_limit(turn)) { memcpy(out, b, 9 * sizeof *out); return 0; } + wa = 1 - t; wb = t; + if (angle > 1e-6) { wa = sin((1 - t) * angle) / sin(angle); wb = sin(t * angle) / sin(angle); } + for (int i = 0; i < 4; i++) r[i] = wa * p[i] + wb * q[i]; + { + const double w = r[0], x = r[1], y = r[2], z = r[3]; + const double m[9] = {1 - 2 * (y * y + z * z), 2 * (x * y - z * w), 2 * (x * z + y * w), + 2 * (x * y + z * w), 1 - 2 * (x * x + z * z), 2 * (y * z - x * w), + 2 * (x * z - y * w), 2 * (y * z + x * w), 1 - 2 * (x * x + y * y)}; + for (int i = 0; i < 9; i++) out[i] = fixed12(m[i]); + } + return 1; + } + /* Scaled or sheared: elementwise, refusing jumps no motion produces. */ + for (int i = 0; i < 9; i++) + if (abs((int)a[i] - (int)b[i]) > 4096) { memcpy(out, b, 9 * sizeof *out); return 0; } + for (int i = 0; i < 9; i++) out[i] = (int16_t)lround(a[i] + (b[i] - a[i]) * t); + return 1; +} + +int psx_motion_blend_matrix(const PSXMotionMatrix* a, const PSXMotionMatrix* b, + double t, double turn, PSXMotionMatrix* out) { + const int ok = blend_rotation(a->r, b->r, t, turn, out->r); + for (int i = 0; i < 3; i++) + out->t[i] = ok ? (int32_t)llround(a->t[i] + ((double)b->t[i] - a->t[i]) * t) : b->t[i]; + return ok; +} + +static double dist3(const int32_t* a, const int32_t* b) { + double s = 0; + for (int i = 0; i < 3; i++) { const double d = (double)b[i] - a[i]; s += d * d; } + return sqrt(s); +} + +static int32_t arc12(int32_t from, int32_t to) { /* shortest signed delta */ + int32_t d = (to - from) & 4095; + return d > 2048 ? d - 4096 : d; /* an exact half turn goes forward */ +} + +/* ---- pairing ------------------------------------------------------------- */ + +static int entry_cmp(const void* x, const void* y) { + const MotionEntry* a = (const MotionEntry*)x; + const MotionEntry* b = (const MotionEntry*)y; + if (a->addr != b->addr) return a->addr < b->addr ? -1 : 1; + if (a->kind != b->kind) return a->kind < b->kind ? -1 : 1; + return a->seq < b->seq ? -1 : a->seq > b->seq; +} + +/* Sort by (addr, kind); of repeats the last tracked wins. */ +static void sort_capture(PSXMotionSet* s, int b) { + MotionEntry* e = s->cap_buf[b]; + uint32_t n = s->n[b], w = 0; + if (s->sorted[b]) return; + qsort(e, n, sizeof *e, entry_cmp); + for (uint32_t i = 0; i < n; i++) { + if (w && e[w - 1].addr == e[i].addr && e[w - 1].kind == e[i].kind) e[w - 1] = e[i]; + else e[w++] = e[i]; + } + s->n[b] = w; + s->sorted[b] = 1; +} + +/* 1 when the pair moved within the limits over `ticks`. */ +static int within_limits(const MotionEntry* a, const MotionEntry* b, + const PSXMotionLimits* lim, uint32_t ticks) { + const double move = lim->move_per_tick > 0 ? lim->move_per_tick * ticks : HUGE_VAL; + switch (a->kind) { + case PSX_MOTION_MATRIX: { + double ang; + int16_t ra[9], rb[9]; + if (dist3(&a->v[9], &b->v[9]) > move) return 0; + for (int i = 0; i < 9; i++) { ra[i] = (int16_t)a->v[i]; rb[i] = (int16_t)b->v[i]; } + ang = rotation_angle(ra, rb); + if (ang >= 0) return ang <= turn_limit(lim->turn_radians); + for (int i = 0; i < 9; i++) if (abs(a->v[i] - b->v[i]) > 4096) return 0; + return 1; + } + case PSX_MOTION_MATRIX_TRANSLATION: + return dist3(&a->v[9], &b->v[9]) <= move; + case PSX_MOTION_VECTOR: + case PSX_MOTION_SVECTOR: + return dist3(a->v, b->v) <= move; + case PSX_MOTION_ANGLES: { + const double lim12 = turn_limit(lim->turn_radians) * 4096.0 / (2.0 * MOTION_PI); + for (int i = 0; i < 3; i++) if (fabs((double)arc12(a->v[i], b->v[i])) > lim12) return 0; + return 1; + } + case PSX_MOTION_SCALAR: + return fabs((double)b->v[0] - a->v[0]) <= move; + } + return 0; +} + +uint32_t psx_motion_prepare(PSXMotionSet* s, const PSXMotionLimits* lim, + PSXMotionStats* stats) { + PSXMotionStats st; + const PSXMotionLimits none = {0, 0}; + const int c = s ? s->cur : 0, h = c ^ 1; + memset(&st, 0, sizeof st); + if (!lim) lim = &none; + if (!s || !s->began[c]) { if (stats) *stats = st; return 0; } + sort_capture(s, c); + st.tracked = s->n[c]; + s->npairs = 0; + s->ticks = 0; + if (s->history && s->began[h]) { + const uint32_t ticks = s->tick[c] - s->tick[h]; + if (ticks >= 1 && ticks <= MOTION_MAX_TICKS) s->ticks = ticks; + } + if (!s->ticks) { + st.unmatched = st.tracked; + } else { + const MotionEntry* pe = s->cap_buf[h]; + const MotionEntry* ce = s->cap_buf[c]; + uint32_t i = 0; + sort_capture(s, h); + for (uint32_t j = 0; j < s->n[c]; j++) { + while (i < s->n[h] && (pe[i].addr < ce[j].addr || + (pe[i].addr == ce[j].addr && pe[i].kind < ce[j].kind))) + i++; + if (i >= s->n[h] || pe[i].addr != ce[j].addr || pe[i].kind != ce[j].kind || + pe[i].identity != ce[j].identity) { + st.unmatched++; + } else if (!within_limits(&pe[i], &ce[j], lim, s->ticks)) { + st.placed++; + } else { + s->pairs[s->npairs].prev = i; + s->pairs[s->npairs].cur = j; + s->npairs++; + } + } + } + st.blended = s->npairs; + st.ticks = s->ticks; + if (stats) *stats = st; + return s->npairs; +} + +/* Blend one pair into `v` (entry layout). */ +static void blend_entry(const MotionEntry* a, const MotionEntry* b, double t, int32_t* v) { + switch (a->kind) { + case PSX_MOTION_MATRIX: { + int16_t ra[9], rb[9], ro[9]; + for (int i = 0; i < 9; i++) { ra[i] = (int16_t)a->v[i]; rb[i] = (int16_t)b->v[i]; } + blend_rotation(ra, rb, t, MOTION_PI * 2, ro); /* limits were applied at prepare */ + for (int i = 0; i < 9; i++) v[i] = ro[i]; + for (int i = 9; i < 12; i++) v[i] = (int32_t)llround(a->v[i] + ((double)b->v[i] - a->v[i]) * t); + break; + } + case PSX_MOTION_MATRIX_TRANSLATION: + for (int i = 0; i < 9; i++) v[i] = b->v[i]; + for (int i = 9; i < 12; i++) v[i] = (int32_t)llround(a->v[i] + ((double)b->v[i] - a->v[i]) * t); + break; + case PSX_MOTION_ANGLES: + for (int i = 0; i < 3; i++) + v[i] = (int32_t)lround(a->v[i] + arc12(a->v[i], b->v[i]) * t); + break; + default: + for (int i = 0; i < 3; i++) v[i] = (int32_t)llround(a->v[i] + ((double)b->v[i] - a->v[i]) * t); + break; + } +} + +static void write_entry(uint8_t kind, uint32_t addr, const int32_t* v) { + switch (kind) { + case PSX_MOTION_MATRIX: + case PSX_MOTION_MATRIX_TRANSLATION: { + PSXMotionMatrix m; + for (int i = 0; i < 9; i++) m.r[i] = (int16_t)v[i]; + for (int i = 0; i < 3; i++) m.t[i] = v[9 + i]; + psx_motion_write_matrix(addr, &m, kind == PSX_MOTION_MATRIX); + break; + } + case PSX_MOTION_VECTOR: + for (int i = 0; i < 3; i++) psx_mod_write_word(addr + 4u * (uint32_t)i, (uint32_t)v[i]); + break; + case PSX_MOTION_SVECTOR: + for (int i = 0; i < 3; i++) psx_mod_write_half(addr + 2u * (uint32_t)i, (uint16_t)v[i]); + break; + case PSX_MOTION_ANGLES: + for (int i = 0; i < 3; i++) psx_mod_write_half(addr + 2u * (uint32_t)i, (uint16_t)(v[i] & 4095)); + break; + case PSX_MOTION_SCALAR: + psx_mod_write_word(addr, (uint32_t)v[0]); + break; + } +} + +void psx_motion_apply(const PSXMotionSet* s, double t) { + if (!s || !s->npairs) return; + const MotionEntry* pe = s->cap_buf[s->cur ^ 1]; + const MotionEntry* ce = s->cap_buf[s->cur]; + for (uint32_t k = 0; k < s->npairs; k++) { + int32_t v[12]; + const MotionEntry* a = &pe[s->pairs[k].prev]; + const MotionEntry* b = &ce[s->pairs[k].cur]; + blend_entry(a, b, t, v); + write_entry(b->kind, b->addr, v); + } +} + +static void export_value(uint8_t kind, const int32_t* v, void* out) { + if (kind == PSX_MOTION_MATRIX || kind == PSX_MOTION_MATRIX_TRANSLATION) { + PSXMotionMatrix* m = (PSXMotionMatrix*)out; + for (int i = 0; i < 9; i++) m->r[i] = (int16_t)v[i]; + for (int i = 0; i < 3; i++) m->t[i] = v[9 + i]; + } else if (kind == PSX_MOTION_SCALAR) { + *(int32_t*)out = v[0]; + } else { + memcpy(out, v, 3 * sizeof(int32_t)); + } +} + +int psx_motion_blend_at(const PSXMotionSet* s, uint32_t kind, uint32_t addr, + double t, void* out) { + const MotionEntry* ce; + uint32_t lo = 0, hi; + if (!s || !out || !s->began[s->cur]) return -1; + ce = s->cap_buf[s->cur]; + hi = s->n[s->cur]; + if (!s->sorted[s->cur]) { + for (uint32_t j = hi; j-- > 0;) /* unprepared: newest wins */ + if (ce[j].addr == addr && ce[j].kind == kind) { export_value(ce[j].kind, ce[j].v, out); return 0; } + return -1; + } + while (lo < hi) { + const uint32_t mid = (lo + hi) / 2; + if (ce[mid].addr < addr || (ce[mid].addr == addr && ce[mid].kind < kind)) lo = mid + 1; + else hi = mid; + } + if (lo >= s->n[s->cur] || ce[lo].addr != addr || ce[lo].kind != kind) return -1; + for (uint32_t k = 0; k < s->npairs; k++) { + if (s->pairs[k].cur == lo) { + int32_t v[12]; + blend_entry(&s->cap_buf[s->cur ^ 1][s->pairs[k].prev], &ce[lo], t, v); + export_value(ce[lo].kind, v, out); + return 1; + } + } + export_value(ce[lo].kind, ce[lo].v, out); + return 0; +} diff --git a/runtime/tests/test_render_pass_motion.c b/runtime/tests/test_render_pass_motion.c new file mode 100644 index 00000000..6098ec78 --- /dev/null +++ b/runtime/tests/test_render_pass_motion.c @@ -0,0 +1,215 @@ +/* render_pass_motion.c and render_pass_frame.c against a mock guest RAM and + * mock render-pass / mod APIs. */ +#include "mod_plugins.h" +#include "render_pass_motion.h" + +#include +#include +#include + +static int failures; +#define CHECK(cond, msg) do { if (!(cond)) { failures++; printf("FAIL: %s\n", msg); } } while (0) + +/* ---- mock guest RAM ------------------------------------------------------ */ +static uint8_t s_ram[0x10000]; +static uint32_t off(uint32_t a) { return a & 0xFFFFu; } +uint8_t psx_mod_read_byte(uint32_t a) { return s_ram[off(a)]; } +uint16_t psx_mod_read_half(uint32_t a) { uint16_t v; memcpy(&v, s_ram + off(a), 2); return v; } +uint32_t psx_mod_read_word(uint32_t a) { uint32_t v; memcpy(&v, s_ram + off(a), 4); return v; } +void psx_mod_write_byte(uint32_t a, uint8_t v) { s_ram[off(a)] = v; } +void psx_mod_write_half(uint32_t a, uint16_t v) { memcpy(s_ram + off(a), &v, 2); } +void psx_mod_write_word(uint32_t a, uint32_t v) { memcpy(s_ram + off(a), &v, 4); } + +/* ---- mock mod / pass APIs (render_pass_frame.c) --------------------------- */ +static char s_option[16] = "display"; +static uint32_t s_fps = 99, s_source = 99, s_blend = 99, s_flip = 99, s_blend_calls; +static uint32_t s_status, s_phases, s_period, s_shown, s_passes_run; +int psx_mod_option_value(const char* p, const char* f, const char* o, char* out, uint32_t n) { + (void)p; (void)f; (void)o; + snprintf(out, n, "%s", s_option); + return 1; +} +int psx_mod_set_frame_interpolation(uint32_t fps) { s_fps = fps; return 1; } +int psx_mod_set_frame_interpolation_source(uint32_t s) { s_source = s; return 1; } +int psx_mod_set_frame_interpolation_blend(uint32_t b) { s_blend = b; s_blend_calls++; return 1; } +int psx_mod_set_render_pass_flip(uint32_t m) { s_flip = m; return 1; } +uint32_t psx_mod_render_pass_status(void) { return s_status; } +uint32_t psx_mod_render_pass_plan(uint32_t period, uint32_t shown, uint32_t* a, uint32_t max) { + s_period = period; s_shown = shown; + if (s_status != PSX_MOD_RENDER_PASS_READY) return 0; + for (uint32_t i = 0; i < s_phases && i < max; i++) a[i] = (i + 1) * 65536u / (s_phases + 1); + return s_phases < max ? s_phases : max; +} +int psx_mod_render_pass(struct CPUState* cpu, const PSXModRenderPass* p, + PSXModRenderPassFn fn, void* user) { + s_passes_run++; + return fn(cpu, user, p->alpha_q16); +} + +/* ---- helpers --------------------------------------------------------------- */ +static void put_matrix(uint32_t a, double yaw, int32_t x, int32_t y, int32_t z) { + PSXMotionMatrix m; + const double c = cos(yaw), s = sin(yaw); + const double r[9] = {c, 0, s, 0, 1, 0, -s, 0, c}; + for (int i = 0; i < 9; i++) m.r[i] = (int16_t)lround(r[i] * 4096.0); + m.t[0] = x; m.t[1] = y; m.t[2] = z; + psx_motion_write_matrix(a, &m, 1); +} +static double yaw_of(uint32_t a) { + PSXMotionMatrix m; + psx_motion_read_matrix(a, &m); + return atan2(m.r[2] / 4096.0, m.r[0] / 4096.0); +} + +static void test_matrix_slerp(void) { + PSXMotionSet* s = psx_motion_set_create(16); + PSXMotionLimits lim = {1000.0, 0}; + PSXMotionStats st; + PSXMotionMatrix m; + put_matrix(0x100, 0.0, 0, 0, 0); + psx_motion_begin(s, 10); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x100, 7); + CHECK(psx_motion_prepare(s, &lim, &st) == 0 && st.ticks == 0, "first frame has no history"); + put_matrix(0x100, 1.2, 800, 0, -400); + psx_motion_begin(s, 12); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x100, 7); + CHECK(psx_motion_prepare(s, &lim, &st) == 1 && st.ticks == 2 && st.blended == 1, + "the same object two ticks later blends"); + psx_motion_apply(s, 0.5); + psx_motion_read_matrix(0x100, &m); + CHECK(fabs(yaw_of(0x100) - 0.6) < 0.002, "rotation slerps to the half-way angle"); + CHECK(m.t[0] == 400 && m.t[2] == -200, "translation blends linearly"); + { + double len = 0; + for (int j = 0; j < 3; j++) len += (double)m.r[j] * m.r[j]; + CHECK(fabs(sqrt(len) - 4096.0) < 3.0, "the blended rotation stays a rotation"); + } + CHECK(psx_motion_blend_at(s, PSX_MOTION_MATRIX, 0x100, 1.0, &m) == 1 && + m.t[0] == 800, "blend_at at t=1 is the current value"); + psx_motion_set_destroy(s); +} + +static void test_identity_and_limits(void) { + PSXMotionSet* s = psx_motion_set_create(16); + PSXMotionLimits lim = {1000.0, 1.0}; + PSXMotionStats st; + int32_t v[3]; + put_matrix(0x200, 0.0, 0, 0, 0); /* moves within limits */ + put_matrix(0x300, 0.0, 0, 0, 0); /* reused by another object */ + put_matrix(0x400, 0.0, 0, 0, 0); /* teleports */ + put_matrix(0x500, 0.0, 0, 0, 0); /* spins past the turn limit */ + psx_motion_begin(s, 1); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x200, 1); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x300, 1); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x400, 1); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x500, 1); + psx_motion_prepare(s, &lim, &st); + put_matrix(0x200, 0.0, 1500, 0, 0); + put_matrix(0x300, 0.0, 10, 0, 0); + put_matrix(0x400, 0.0, 5000, 0, 0); + put_matrix(0x500, 2.0, 0, 0, 0); + psx_motion_begin(s, 3); /* two ticks: 2000 units allowed */ + psx_motion_track(s, PSX_MOTION_MATRIX, 0x200, 1); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x300, 2); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x400, 1); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x500, 1); + psx_motion_track(s, PSX_MOTION_VECTOR, 0x600, 1); /* new this frame */ + CHECK(psx_motion_prepare(s, &lim, &st) == 1, "only the moving object blends"); + CHECK(st.placed == 2 && st.unmatched == 2 && st.tracked == 5, + "teleport and spin are placed; reuse and new are unmatched"); + psx_motion_apply(s, 0.5); + CHECK((int32_t)psx_mod_read_word(0x300 + 0x14) == 10, "a reused address keeps its new object"); + CHECK((int32_t)psx_mod_read_word(0x400 + 0x14) == 5000, "a teleport is drawn where it landed"); + CHECK((int32_t)psx_mod_read_word(0x200 + 0x14) == 750, "the mover is half-way"); + CHECK(psx_motion_blend_at(s, PSX_MOTION_VECTOR, 0x600, 0.5, v) == 0, "no history: current value"); + CHECK(psx_motion_blend_at(s, PSX_MOTION_VECTOR, 0x700, 0.5, v) == -1, "untracked: refused"); + + /* A gap (a frame not captured) or too many ticks: nothing blends. */ + psx_motion_begin(s, 20); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x200, 1); + CHECK(psx_motion_prepare(s, &lim, &st) == 0 && st.ticks == 0, "17 ticks apart is not one motion"); + psx_motion_invalidate(s); + psx_motion_begin(s, 21); + psx_motion_track(s, PSX_MOTION_MATRIX, 0x200, 1); + CHECK(psx_motion_prepare(s, &lim, &st) == 0, "after invalidate there is no history"); + psx_motion_set_destroy(s); +} + +static void test_angles_vectors_scalars(void) { + PSXMotionSet* s = psx_motion_set_create(16); + PSXMotionLimits lim = {100.0, 0}; + PSXMotionStats st; + psx_mod_write_half(0x800, 4000); psx_mod_write_half(0x802, 100); psx_mod_write_half(0x804, 0); + psx_mod_write_half(0x810, (uint16_t)-50); psx_mod_write_half(0x812, 0); psx_mod_write_half(0x814, 0); + psx_mod_write_word(0x820, 1000); + psx_motion_begin(s, 5); + psx_motion_track(s, PSX_MOTION_ANGLES, 0x800, 1); + psx_motion_track(s, PSX_MOTION_SVECTOR, 0x810, 1); + psx_motion_track(s, PSX_MOTION_SCALAR, 0x820, 1); + psx_motion_prepare(s, &lim, &st); + psx_mod_write_half(0x800, 96); psx_mod_write_half(0x802, 300); psx_mod_write_half(0x804, 2048); + psx_mod_write_half(0x810, 50); + psx_mod_write_word(0x820, 1100); + psx_motion_begin(s, 6); + psx_motion_track(s, PSX_MOTION_ANGLES, 0x800, 1); + psx_motion_track(s, PSX_MOTION_SVECTOR, 0x810, 1); + psx_motion_track(s, PSX_MOTION_SCALAR, 0x820, 1); + CHECK(psx_motion_prepare(s, &lim, &st) == 3, "angles, svector and scalar blend"); + psx_motion_apply(s, 0.5); + CHECK(psx_mod_read_half(0x800) == 0, "4000 -> 96 crosses 4096 the short way (0)"); + CHECK(psx_mod_read_half(0x802) == 200, "100 -> 300 is 200"); + CHECK(psx_mod_read_half(0x804) == 1024, "0 -> 2048 half turn blends to 1024"); + CHECK((int16_t)psx_mod_read_half(0x810) == 0, "signed svector -50 -> 50 is 0"); + CHECK(psx_mod_read_word(0x820) == 1050, "scalar blends"); + psx_motion_set_destroy(s); +} + +static int s_fn_calls; +static double s_fn_last; +static int frame_fn(struct CPUState* cpu, void* user, uint32_t alpha) { + (void)cpu; (void)user; + s_fn_calls++; + s_fn_last = alpha / 65536.0; + return 1; +} + +static void test_frame_driver(void) { + PSXModRenderPassFrame f; + char cpu_storage[4096]; + struct CPUState* cpu = (struct CPUState*)cpu_storage; + strcpy(s_option, "165"); + CHECK(psx_mod_activate_render_pass_rate("p", "f", "rate", PSX_MOD_RENDER_PASS_FLIP_PENDING) && + s_fps == 165 && s_source == PSX_MOD_FRAME_SOURCE_FLIP && + s_blend == PSX_MOD_FRAME_INTERPOLATION_HOLD && + s_flip == PSX_MOD_RENDER_PASS_FLIP_PENDING, "activation selects rate, FLIP, HOLD, flip mode"); + strcpy(s_option, "display"); + psx_mod_activate_render_pass_rate("p", "f", "rate", PSX_MOD_RENDER_PASS_FLIP_SHOWN); + CHECK(s_fps == 0 && s_flip == PSX_MOD_RENDER_PASS_FLIP_SHOWN, "display refresh is rate 0"); + + memset(&f, 0, sizeof f); + f.struct_size = sizeof f; + f.period_vblanks = 2; f.w = 320; f.h = 240; + s_status = PSX_MOD_RENDER_PASS_READY; + s_phases = 3; + s_blend_calls = 0; + CHECK(psx_mod_render_pass_frame(cpu, &f, frame_fn, NULL) == 3 && s_fn_calls == 3 && + s_period == 2 && s_fn_last > 0.7, "every planned phase runs"); + CHECK(s_blend_calls == 0, "READY keeps HOLD without re-setting it"); + s_status = PSX_MOD_RENDER_PASS_BACKEND; + CHECK(psx_mod_render_pass_frame(cpu, &f, frame_fn, NULL) == 0 && + s_blend == PSX_MOD_FRAME_INTERPOLATION_MOTION_ADAPTIVE, "lasting refusal crossfades"); + s_status = PSX_MOD_RENDER_PASS_SESSION; + psx_mod_render_pass_frame(cpu, &f, frame_fn, NULL); + CHECK(s_blend == PSX_MOD_FRAME_INTERPOLATION_HOLD, "a transient reason returns to HOLD"); + f.struct_size = 4; + CHECK(psx_mod_render_pass_frame(cpu, &f, frame_fn, NULL) == 0, "a short struct is refused"); +} + +int main(void) { + test_matrix_slerp(); + test_identity_and_limits(); + test_angles_vectors_scalars(); + test_frame_driver(); + printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); + return failures ? 1 : 0; +} From bd2c3b8c623c7197c209eec9b447c0744398d650 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 10:24:36 -0700 Subject: [PATCH 18/52] Offline builds: host relay status only with recomp-net linked Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 7980ad24..8beae404 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -62,7 +62,9 @@ extern "C" void psx_event_step_conservative_env_init(void); #include "psx_netplay_rb.h" #include "psx_selfcheck.h" #include "psx_lobby_client.h" +#if defined(PSX_HAS_RECOMP_NET) #include "recomp_net/host_relay.h" /* RNetHostRelayStatus for the launcher relay line */ +#endif #include "netplay_bios_settle.h" #include "netplay_exit_reason.h" #include "host_time.h" @@ -10951,6 +10953,7 @@ namespace { if (!out || !out_cap) return 0; out[0] = '\0'; if (g_lnch_hosting_lan || g_lnch_joined_lan || !psx_lobby_in_lobby()) return 0; +#if defined(PSX_HAS_RECOMP_NET) RNetHostRelayStatus st; if (!psx_lobby_host_relay_status(&st)) return 0; if (st.role == 1) { @@ -10993,6 +10996,9 @@ namespace { return 1; } return 0; +#else + return 0; /* offline build: recomp-net (and its host relay) is not linked */ +#endif } int ae_np_force_turn_set(void*, int force) { if (g_lnch_hosting_lan || g_lnch_joined_lan) From 03f914be6f0a6aee91520664f0bb4e138886c782 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 10:29:52 -0700 Subject: [PATCH 19/52] Motion kit: ROTATION kind for bare 3x3 rotations Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/render_pass_motion.h | 8 ++++++-- runtime/src/render_pass_motion.c | 19 ++++++++++++++----- runtime/tests/test_render_pass_motion.c | 22 ++++++++++++++++++++++ 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/runtime/include/render_pass_motion.h b/runtime/include/render_pass_motion.h index 9bb1ea7b..c28ddc3b 100644 --- a/runtime/include/render_pass_motion.h +++ b/runtime/include/render_pass_motion.h @@ -45,7 +45,11 @@ enum { PSX_MOTION_SVECTOR = 4, /* s16 x, y, z */ /* s16 x, y, z angles, 4096 per turn: each blends along the shorter arc. */ PSX_MOTION_ANGLES = 5, - PSX_MOTION_SCALAR = 6 /* s32 */ + PSX_MOTION_SCALAR = 6, /* s32 */ + /* A bare 3x3 s16 rotation in 4.12 (18 bytes), blended like a MATRIX's; + * pair it with a VECTOR / SVECTOR kind wherever its translation lives + * (skeleton pose records, matrices stored apart from their position). */ + PSX_MOTION_ROTATION = 7 }; typedef struct PSXMotionLimits { @@ -92,7 +96,7 @@ uint32_t psx_motion_prepare(PSXMotionSet* set, const PSXMotionLimits* limits, /* Write every prepared value at t (0 = previous frame, 1 = this frame). */ void psx_motion_apply(const PSXMotionSet* set, double t); /* Blend one prepared value at t into `out` without writing guest RAM: - * a PSXMotionMatrix for the MATRIX kinds, int32_t[3] for VECTOR / SVECTOR / + * a PSXMotionMatrix for the MATRIX kinds and ROTATION (translation 0), int32_t[3] for VECTOR / SVECTOR / * ANGLES, int32_t for SCALAR. Returns 0 when that value does not blend this * frame (out then holds its current value) or was not tracked (out * untouched, returns -1). */ diff --git a/runtime/src/render_pass_motion.c b/runtime/src/render_pass_motion.c index 89d9eeb1..98810907 100644 --- a/runtime/src/render_pass_motion.c +++ b/runtime/src/render_pass_motion.c @@ -108,6 +108,9 @@ static void read_entry(MotionEntry* e) { for (int i = 0; i < 3; i++) e->v[9 + i] = m.t[i]; break; } + case PSX_MOTION_ROTATION: + for (int i = 0; i < 9; i++) e->v[i] = (int16_t)psx_mod_read_half(e->addr + 2u * (uint32_t)i); + break; case PSX_MOTION_VECTOR: for (int i = 0; i < 3; i++) e->v[i] = (int32_t)psx_mod_read_word(e->addr + 4u * (uint32_t)i); break; @@ -123,7 +126,7 @@ static void read_entry(MotionEntry* e) { int psx_motion_track(PSXMotionSet* s, uint32_t kind, uint32_t addr, uint32_t identity) { MotionEntry* e; - if (!s || kind < PSX_MOTION_MATRIX || kind > PSX_MOTION_SCALAR) return 0; + if (!s || kind < PSX_MOTION_MATRIX || kind > PSX_MOTION_ROTATION) return 0; if (!s->began[s->cur] || s->n[s->cur] >= s->cap) return 0; e = &s->cap_buf[s->cur][s->n[s->cur]]; memset(e, 0, sizeof *e); @@ -270,10 +273,11 @@ static int within_limits(const MotionEntry* a, const MotionEntry* b, const PSXMotionLimits* lim, uint32_t ticks) { const double move = lim->move_per_tick > 0 ? lim->move_per_tick * ticks : HUGE_VAL; switch (a->kind) { - case PSX_MOTION_MATRIX: { + case PSX_MOTION_MATRIX: + case PSX_MOTION_ROTATION: { double ang; int16_t ra[9], rb[9]; - if (dist3(&a->v[9], &b->v[9]) > move) return 0; + if (a->kind == PSX_MOTION_MATRIX && dist3(&a->v[9], &b->v[9]) > move) return 0; for (int i = 0; i < 9; i++) { ra[i] = (int16_t)a->v[i]; rb[i] = (int16_t)b->v[i]; } ang = rotation_angle(ra, rb); if (ang >= 0) return ang <= turn_limit(lim->turn_radians); @@ -344,7 +348,8 @@ uint32_t psx_motion_prepare(PSXMotionSet* s, const PSXMotionLimits* lim, /* Blend one pair into `v` (entry layout). */ static void blend_entry(const MotionEntry* a, const MotionEntry* b, double t, int32_t* v) { switch (a->kind) { - case PSX_MOTION_MATRIX: { + case PSX_MOTION_MATRIX: + case PSX_MOTION_ROTATION: { int16_t ra[9], rb[9], ro[9]; for (int i = 0; i < 9; i++) { ra[i] = (int16_t)a->v[i]; rb[i] = (int16_t)b->v[i]; } blend_rotation(ra, rb, t, MOTION_PI * 2, ro); /* limits were applied at prepare */ @@ -388,6 +393,9 @@ static void write_entry(uint8_t kind, uint32_t addr, const int32_t* v) { case PSX_MOTION_SCALAR: psx_mod_write_word(addr, (uint32_t)v[0]); break; + case PSX_MOTION_ROTATION: + for (int i = 0; i < 9; i++) psx_mod_write_half(addr + 2u * (uint32_t)i, (uint16_t)v[i]); + break; } } @@ -405,7 +413,8 @@ void psx_motion_apply(const PSXMotionSet* s, double t) { } static void export_value(uint8_t kind, const int32_t* v, void* out) { - if (kind == PSX_MOTION_MATRIX || kind == PSX_MOTION_MATRIX_TRANSLATION) { + if (kind == PSX_MOTION_MATRIX || kind == PSX_MOTION_MATRIX_TRANSLATION || + kind == PSX_MOTION_ROTATION) { PSXMotionMatrix* m = (PSXMotionMatrix*)out; for (int i = 0; i < 9; i++) m->r[i] = (int16_t)v[i]; for (int i = 0; i < 3; i++) m->t[i] = v[9 + i]; diff --git a/runtime/tests/test_render_pass_motion.c b/runtime/tests/test_render_pass_motion.c index 6098ec78..52f61a50 100644 --- a/runtime/tests/test_render_pass_motion.c +++ b/runtime/tests/test_render_pass_motion.c @@ -164,6 +164,27 @@ static void test_angles_vectors_scalars(void) { psx_motion_set_destroy(s); } +static void test_rotation_only(void) { + PSXMotionSet* s = psx_motion_set_create(4); + PSXMotionLimits lim = {100.0, 0}; + PSXMotionStats st; + /* A bare rotation (as in a pose record) with other data right after it. */ + put_matrix(0xA00, 0.0, 0, 0, 0); + psx_mod_write_word(0xA00 + 0x12, 0xDEADBEEFu); + psx_motion_begin(s, 1); + psx_motion_track(s, PSX_MOTION_ROTATION, 0xA00, 3); + psx_motion_prepare(s, &lim, &st); + put_matrix(0xA00, 1.0, 0, 0, 0); + psx_mod_write_word(0xA00 + 0x12, 0xDEADBEEFu); + psx_motion_begin(s, 2); + psx_motion_track(s, PSX_MOTION_ROTATION, 0xA00, 3); + CHECK(psx_motion_prepare(s, &lim, &st) == 1, "a bare rotation blends"); + psx_motion_apply(s, 0.5); + CHECK(fabs(yaw_of(0xA00) - 0.5) < 0.002, "rotation-only slerps"); + CHECK(psx_mod_read_word(0xA00 + 0x12) == 0xDEADBEEFu, "nothing past the 18 bytes is written"); + psx_motion_set_destroy(s); +} + static int s_fn_calls; static double s_fn_last; static int frame_fn(struct CPUState* cpu, void* user, uint32_t alpha) { @@ -209,6 +230,7 @@ int main(void) { test_matrix_slerp(); test_identity_and_limits(); test_angles_vectors_scalars(); + test_rotation_only(); test_frame_driver(); printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); return failures ? 1 : 0; From f9cafa73183fce791d035a59ab47fa6b1f9a7405 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 10:32:23 -0700 Subject: [PATCH 20/52] Mod runtime: named plugin counters (psx_mod_counter_add, mod_counters) Same API as the V8:2 branch's b2104464, for every frame-rate plugin. Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/mod_plugins.h | 7 +++++ runtime/src/debug_server.c | 40 ++++++++++++++++++++++++++++ runtime/src/mod_runtime.cpp | 50 +++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 151e6f81..08394d75 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -37,6 +37,13 @@ int psx_mod_function_entry(struct CPUState* cpu, uint32_t address); /* Active function-entry hook count (0 = none). Hot callers test it before the * call, so a run without an active hook pays one load per interpreted entry. */ extern uint32_t g_psx_mod_function_entry_hooks; + +/* Always-on named event counters for trusted plugins (observability, not + * logging): e.g. how often each guard in a hook rejected. `name` should be a + * string literal of the form "."; up to 128 distinct names are + * kept, further names are counted in an overflow bucket. Emulation-thread only. + * TCP: {"cmd":"mod_counters"} lists every counter with its last frame. */ +void psx_mod_counter_add(const char* name, uint32_t delta); /* Entry callbacks can make nested guest calls while retaining host registers. * Save/load and rewind must wait until that host context has returned. */ int psx_mod_function_entry_active(void); diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index 6c6c4744..ac926631 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -7799,6 +7799,45 @@ static void handle_input_route_status(int id, const char *json) * {"cmd":"ws_hud_mode","tag_rects":0|1} * tag_rects=1 lets TAGGED rect-family prims re-anchor too (Tomba's AP * counter renders through the tagged sprite funnel). */ +/* Named plugin counters (psx_mod_counter_add), always on: + * {"cmd":"mod_counters"} + * -> counters: [{name, count, last_frame}], overflow. */ +static void handle_mod_counters(int id, const char *json) +{ + extern int psx_mod_counters_snapshot(const char **names, uint64_t *counts, + uint64_t *last_frames, int cap, + uint64_t *overflow); + (void)json; + enum { CAP = 128 }; + const char *names[CAP]; + uint64_t counts[CAP], last[CAP], overflow = 0; + int n = psx_mod_counters_snapshot(names, counts, last, CAP, &overflow); + if (n > CAP) n = CAP; + size_t cap = 256u + (size_t)n * 160u; + char *buf = (char *)malloc(cap); + if (!buf) { send_err(id, "alloc failed"); return; } + size_t off = 0; + off += (size_t)snprintf(buf + off, cap - off, + "{\"id\":%d,\"ok\":true,\"frame\":%llu,\"counters\":[", + id, (unsigned long long)s_frame_count); + for (int i = 0; i < n && off < cap; i++) { + char esc[96]; + size_t e = 0; + for (const char *p = names[i]; *p && e + 2 < sizeof esc; p++) + if (*p != '"' && *p != '\\' && (unsigned char)*p >= 0x20) esc[e++] = *p; + esc[e] = '\0'; + off += (size_t)snprintf(buf + off, cap - off, + "%s{\"name\":\"%s\",\"count\":%llu,\"last_frame\":%llu}", + i ? "," : "", esc, (unsigned long long)counts[i], + (unsigned long long)last[i]); + } + if (off < cap) + snprintf(buf + off, cap - off, "],\"overflow\":%llu}", + (unsigned long long)overflow); + debug_server_send_line(buf); + free(buf); +} + static void handle_ws_hud_mode(int id, const char *json) { int v = json_get_int(json, "tag_rects", -1); @@ -14100,6 +14139,7 @@ static const CmdEntry s_commands[] = { { "ws_aspect_cone_site", handle_ws_aspect_cone_site }, { "ws_margin", handle_ws_margin }, { "ws_hud_mode", handle_ws_hud_mode }, + { "mod_counters", handle_mod_counters }, { "kernel_bless", handle_kernel_bless }, { "ws_aspect", handle_ws_aspect }, { "display_aspect", handle_display_aspect }, diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index 2c6e4a6a..d89f3fcc 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -54,6 +54,8 @@ extern "C" int fntrace_is_game_started(void); /* Declared in mod_plugins.h; see active_function_entry_hooks() below. */ uint32_t g_psx_mod_function_entry_hooks = 0; +/* Guest vblanks seen by the mod runtime: the plugin counters' time base. */ +static uint64_t g_mod_vblanks = 0; namespace PSXRecompV4 { namespace { @@ -1426,6 +1428,7 @@ extern "C" void mod_runtime_activate_plugins(void) { extern "C" void mod_runtime_on_vblank(void) { using namespace PSXRecompV4; + ++g_mod_vblanks; RuntimeMods& s = state(); if (!s.initialized || !s.plan.ok) return; for (const ModResolution::Plugin& plugin : s.plan.plugins) { @@ -1523,6 +1526,53 @@ extern "C" uint32_t psx_mod_alloc_gpu_dma_memory(uint32_t size, return psx_mod_gpu_dma_memory_alloc(size, alignment); } +namespace { +struct ModCounter { + const char* name = nullptr; /* caller literal; compared by content */ + uint64_t count = 0; + uint64_t last_frame = 0; +}; +constexpr size_t kModCounterCap = 128; +ModCounter g_mod_counters[kModCounterCap]; +size_t g_mod_counter_count = 0; +uint64_t g_mod_counter_overflow = 0; +} // namespace + +extern "C" void psx_mod_counter_add(const char* name, uint32_t delta) { + if (!name || !name[0]) return; + for (size_t i = 0; i < g_mod_counter_count; i++) { + ModCounter& c = g_mod_counters[i]; + if (c.name == name || std::strcmp(c.name, name) == 0) { + c.count += delta; + c.last_frame = g_mod_vblanks; + return; + } + } + if (g_mod_counter_count == kModCounterCap) { + g_mod_counter_overflow += delta; + return; + } + ModCounter& c = g_mod_counters[g_mod_counter_count++]; + c.name = name; + c.count = delta; + c.last_frame = g_mod_vblanks; +} + +/* Debug-server accessor: copies up to `cap` entries; returns the total count + * of distinct counters and writes the overflow bucket. */ +extern "C" int psx_mod_counters_snapshot(const char** names, uint64_t* counts, + uint64_t* last_frames, int cap, + uint64_t* overflow) { + const int n = (int)g_mod_counter_count; + for (int i = 0; i < n && i < cap; i++) { + names[i] = g_mod_counters[i].name; + counts[i] = g_mod_counters[i].count; + last_frames[i] = g_mod_counters[i].last_frame; + } + if (overflow) *overflow = g_mod_counter_overflow; + return n; +} + extern "C" int32_t psx_mod_widescreen_x_margin(void) { return (int32_t)psx_ws_x_margin(); } From 495549c20d1e10ddcd0994162a211a1d96bb98fa Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 10:36:15 -0700 Subject: [PATCH 21/52] CLI: build emitters incrementally whenever framework sources are present A staged binary could predate a moved submodule and emit code for the old framework silently. Co-Authored-By: Claude Opus 5.5 (1M context) --- psxrecomp_cli.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/psxrecomp_cli.py b/psxrecomp_cli.py index b148a05c..c7a35fcd 100755 --- a/psxrecomp_cli.py +++ b/psxrecomp_cli.py @@ -409,12 +409,24 @@ def ensure_emitters( Generate & rebuild without a pre-staged setup-host SDK. """ if not force: + # With the framework's recompiler sources present, always run the + # (incremental) build: a binary that merely exists may predate the + # sources -- a submodule moved to another revision -- and would emit + # code for the old framework without a word (a hook site listed in + # game.toml silently missing). Ninja makes the up-to-date case cheap. + # Without sources (an SDK pack), the staged binaries are the only ones. try: - game, bios = find_emitters(project_root) - progress.log(f"Emitters ready: {game}, {bios}") - return game, bios + recompiler_source_dir(project_root) + have_sources = True except FileNotFoundError: - pass + have_sources = False + if not have_sources: + try: + game, bios = find_emitters(project_root) + progress.log(f"Emitters ready: {game}, {bios}") + return game, bios + except FileNotFoundError: + pass progress.phase( "emitters", From d61439547034c6b667e33114dd3a2c904b9c8fff Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 11:14:58 -0700 Subject: [PATCH 22/52] Debug server: window_size resizes the game window for window-shaped checks Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/TCP_COMMANDS.md | 15 ++++++++++++--- runtime/src/debug_server.c | 8 ++++++++ runtime/src/main.cpp | 9 +++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/TCP_COMMANDS.md b/docs/TCP_COMMANDS.md index 1cbd3e8b..bf7ed6d4 100644 --- a/docs/TCP_COMMANDS.md +++ b/docs/TCP_COMMANDS.md @@ -56,7 +56,8 @@ Columns: **N** = native, **D** = DuckStation oracle. | `present_shot` | ✓ | | `path` | PNG of the **composed present surface** — the frame after the backend fits the display buffer to the window, so it carries the presented aspect. ⚠ every other capture resolves the display buffer *before* that fit: on a 508×256 display in a 4:3 window they answer 508×256 while the player sees 640×480. Use this one for anything aspect-shaped (widescreen, letterbox), where a pre-fit buffer would hide the very stage the change touches. Staged and fulfilled on the next present, so the ack means *queued* — poll `present_shot_seq`. Unavailable headless and on the Vulkan backend (its swapchain has no readback hook) | | `present_shot_seq` | ✓ | | — | Completion counter for `present_shot`, plus `wrote` (1 = that completion produced a PNG). Sample before staging, poll until `seq` moves. Advances on success *and* failure, so the poll always terminates | | `gl_interp` | ✓ | | — | OpenGL frame-rate presenter ([FRAME_RATE.md](FRAME_RATE.md)): enabled/suspended, host and target Hz, swaps, `source` (`vblank`/`flip`), `flip_period`, `captures` (new source frames) and `duplicates` (VBlanks that re-presented the same frame) | -| `render_pass_stats` | ✓ | | — | Render passes ([RENDER_PASSES.md](RENDER_PASSES.md)): plans, phases wanted/planned (shedding), passes, rollbacks (`nesting_repairs`: watchdog aborts whose skipped frame exits the restore undid), dropped device stores by class, `verify_mismatch` under `PSX_RENDER_PASS_VERIFY=1`, host-time split per pass, smoothed pass cost (`cost_us`; `cost_rewarms`: estimates no pass had run on for a while, measured again), presents made from pass images (`late_presents`: held past the frame's planned end because the next flip was late; `expired`: frames whose images stopped showing after several frame lengths without a flip), pass image textures allocated (`image_textures`, `image_bytes`), `status` (`psx_mod_render_pass_status`: 0 ready, 1 no presenter, 2 backend, 3 disabled, 4 session, 5 fast-forward, 6 busy), `backups_reused` (passes that reused the previous pass's VRAM backup) | +| `render_pass_stats` | ✓ | | — | Render passes ([RENDER_PASSES.md](RENDER_PASSES.md)): plans, phases wanted/planned (shedding), passes, rollbacks (`nesting_repairs`: watchdog aborts whose skipped frame exits the restore undid), dropped device stores by class, `verify_mismatch` under `PSX_RENDER_PASS_VERIFY=1`, host-time split per pass, smoothed pass cost (`cost_us`; `cost_rewarms`: estimates no pass had run on for a while, measured again), presents made from pass images (`late_presents`: held past the frame's planned end because the next flip was late; `expired`: frames whose images stopped showing after several frame lengths without a flip), pass image textures allocated (`image_textures`, `image_bytes`), `status` (`psx_mod_render_pass_status`: 0 ready, 1 no presenter, 2 backend, 3 disabled, 4 session, 5 fast-forward, 6 busy), `backups_reused` (passes that reused the previous pass's VRAM backup), `spans` / `span_failures` and the last failure `span_fail` (`psx_mod_run_guest_span`: reason, exit PC, `$ra`, PC after a call that did not return) | +| `window_size` | ✓ | | `w`, `h` | Resize the game window as a player would (Fit / adaptive widescreen follow it): window-shaped checks in `--hidden-window` runs. Pair with `present_shot` | | `render_pass_dump` | ✓ | | `path`, `count` | Write the images (the game's own frame, then each pass in phase order) of the next `count` frames that get passes as `/g__a.png` | | `render_pass_refuse` | ✓ | | `on` | Make the OpenGL backend decline render passes (`status` 2, BACKEND), as a renderer mode without them would; tests a plugin's fallback. `PSX_RENDER_PASS_REFUSE=1` does the same from start | | `geom_correction` | | ✓ | — | `[video] geometry_correction` / `perspective_texturing` engagement: enable flag plus free-running `geometry_vertex_hits` and `perspective_triangles` totals. Both enhancements silently fall back to the faithful path on anything they cannot prove is projected geometry, so a zero counter with the flag on means the title never qualifies — sample twice and diff for a rate | @@ -429,9 +430,9 @@ The TCP server is the canonical instrumentation surface. Rule 3 in `CLAUDE.md` i ## Complete command index (generated) -**322 commands registered** — 309 on the native server (`runtime/src/debug_server.c`), 61 on the Beetle server (`runtime/src/beetle_debug_server.c`). +**330 commands registered** — 317 on the native server (`runtime/src/debug_server.c`), 61 on the Beetle server (`runtime/src/beetle_debug_server.c`). -61 of 322 have prose above; **261 are index-only**. An index-only command still works — it just has no description here yet. Send it `{"cmd":""}` and read the reply, or find its `handle_*` function in the server source. +62 of 330 have prose above; **268 are index-only**. An index-only command still works — it just has no description here yet. Send it `{"cmd":""}` and read the reply, or find its `handle_*` function in the server source. Regenerate with `python tools/gen_tcp_commands.py`; `--check` fails if this block has drifted from the code. @@ -451,6 +452,7 @@ Regenerate with `python tools/gen_tcp_commands.py`; `--check` fails if this bloc | `call_focus_stats` | ✓ | | | | `callret_watch` | ✓ | | ✓ | | `capture_freeze` | ✓ | | | +| `capture_mark` | ✓ | | | | `capture_quads` | ✓ | | | | `card_buffer_dump` | ✓ | | | | `card_data_writes` | ✓ | | | @@ -567,6 +569,7 @@ Regenerate with `python tools/gen_tcp_commands.py`; `--check` fails if this bloc | `gpu_opcodes` | ✓ | | | | `gpu_ring_stats` | ✓ | | | | `gpu_state` | ✓ | | ✓ | +| `gpu_timeline` | ✓ | | | | `gte_frame_stats` | ✓ | | | | `gte_intpl_dump` | ✓ | | | | `gte_latch_dump` | ✓ | | | @@ -601,6 +604,8 @@ Regenerate with `python tools/gen_tcp_commands.py`; `--check` fails if this bloc | `mmio_clear` | ✓ | | ✓ | | `mmio_dump` | ✓ | | ✓ | | `mmx6_freshfix` | ✓ | | | +| `mod_counters` | ✓ | | | +| `nclip_stats` | ✓ | | | | `overlay_candidates` | ✓ | | | | `overlay_capture_dump` | ✓ | | | | `overlay_cps_probe` | ✓ | | | @@ -633,6 +638,8 @@ Regenerate with `python tools/gen_tcp_commands.py`; `--check` fails if this bloc | `phase_hot` | ✓ | | | | `phase_profile` | ✓ | | | | `ping` | ✓ | ✓ | ✓ | +| `present_image_ring_get` | ✓ | | | +| `present_image_ring_stats` | ✓ | | | | `present_ring` | ✓ | | | | `present_shot` | ✓ | | ✓ | | `present_shot_seq` | ✓ | | ✓ | @@ -719,6 +726,7 @@ Regenerate with `python tools/gen_tcp_commands.py`; `--check` fails if this bloc | `watch` | ✓ | | ✓ | | `wide_full` | ✓ | | | | `wide_shot` | ✓ | | | +| `window_size` | ✓ | | ✓ | | `write_ram` | ✓ | | ✓ | | `ws_aspect` | ✓ | | | | `ws_aspect_cone_site` | ✓ | | | @@ -733,6 +741,7 @@ Regenerate with `python tools/gen_tcp_commands.py`; `--check` fails if this bloc | `ws_hud_mode` | ✓ | | | | `ws_margin` | ✓ | | | | `ws_nw` | ✓ | | | +| `ws_tag_stats` | ✓ | | | | `ws_ui_groups` | ✓ | | | | `wtrace_add` | ✓ | | | | `wtrace_all_dump` | ✓ | ✓ | | diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index fbefca5c..d5b821fa 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -8143,6 +8143,13 @@ static void handle_display_aspect(int id, const char *json) { send_fmt("{\"id\":%d,\"ok\":true,\"num\":%d,\"den\":%d,\"adaptive\":%d}",id,num,den,adaptive!=0); } +extern int psx_debug_window_size(int w, int h); +static void handle_window_size(int id, const char *json) { + int w = json_get_int(json, "w", -1), h = json_get_int(json, "h", -1); + if (!psx_debug_window_size(w, h)) { send_err(id, "need a window and 64<=w,h<=16384"); return; } + send_fmt("{\"id\":%d,\"ok\":true,\"w\":%d,\"h\":%d}", id, w, h); +} + /* Live native-wide vs squash toggle (A/B): ws_nw on=<0|1> re-engages the wide * path in the chosen mode without a relaunch. 2 = native-wide, 1 = squash. */ extern void psx_ws_set_native_wide(int on); @@ -14363,6 +14370,7 @@ static const CmdEntry s_commands[] = { { "kernel_bless", handle_kernel_bless }, { "ws_aspect", handle_ws_aspect }, { "display_aspect", handle_display_aspect }, + { "window_size", handle_window_size }, { "ws_nw", handle_ws_nw }, { "scanline", handle_scanline }, { "ws_backdrop_ring", handle_ws_backdrop_ring }, diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index d43caf13..af600119 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -2009,6 +2009,15 @@ extern "C" int psx_debug_display_aspect(int num, int den, int adaptive) { return 1; } +/* Resize the game window as a player would (Fit/adaptive widescreen follow the + * resulting window events). For TCP-driven checks of window-shaped behaviour + * in --hidden-window runs. */ +extern "C" int psx_debug_window_size(int w, int h) { + if (!sdl_window || w < 64 || h < 64 || w > 16384 || h > 16384) return 0; + SDL_SetWindowSize(sdl_window, w, h); + return 1; +} + static bool g_gl_active = false; /* GL context live -> GL present path */ static bool g_vk_active = false; /* Vulkan context live -> VK present path */ From 95fed967430ca6237d341701818e95e706bbe685 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 11:19:28 -0700 Subject: [PATCH 23/52] Widescreen: a full-display-width primitive is an overlay, not UI Letterbox bars squashed as HUD left the revealed margins showing the frame's clear colour. Also link gpu_timeline.c into the GPU exec tests (broken since b2104464). Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/CMakeLists.txt | 14 ++++++++----- runtime/src/gpu.c | 6 +++++- runtime/tests/gpu_exec_stubs.inc | 1 + .../tests/test_ws_auto_ui_untextured_exec.c | 21 +++++++++++++++++++ 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 824c6bc4..1a799d02 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.20) project(psxrecomp-runtime C CXX) include(CTest) @@ -405,7 +405,8 @@ if(BUILD_TESTING) add_executable(gpu_textured_dot_nw_shift_exec_test tests/test_gpu_textured_dot_nw_shift_exec.c - src/psx_video_timing.c) + src/psx_video_timing.c + src/gpu_timeline.c) target_include_directories(gpu_textured_dot_nw_shift_exec_test PRIVATE include src) @@ -422,7 +423,8 @@ if(BUILD_TESTING) add_executable(ws_auto_ui_untextured_exec_test tests/test_ws_auto_ui_untextured_exec.c src/ws_ui_group.c - src/psx_video_timing.c) + src/psx_video_timing.c + src/gpu_timeline.c) target_include_directories(ws_auto_ui_untextured_exec_test PRIVATE include src) @@ -438,7 +440,8 @@ if(BUILD_TESTING) add_executable(ws_shared_split_ui_exec_test tests/test_ws_shared_split_ui_exec.c src/ws_ui_group.c - src/psx_video_timing.c) + src/psx_video_timing.c + src/gpu_timeline.c) target_include_directories(ws_shared_split_ui_exec_test PRIVATE include src) if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") target_compile_options(ws_shared_split_ui_exec_test PRIVATE @@ -449,7 +452,8 @@ if(BUILD_TESTING) add_executable(ws_view_anchor_test tests/test_ws_view_anchor.c) add_executable(ws_view_anchor_gpu_test tests/test_ws_view_anchor_gpu.c - src/psx_video_timing.c) + src/psx_video_timing.c + src/gpu_timeline.c) foreach(_anchor_test ws_view_anchor ws_view_anchor_gpu) target_include_directories(${_anchor_test}_test PRIVATE include src) if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index 42143b62..a0dd9bf0 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -5559,7 +5559,11 @@ static void ws_ui_prepass_add(const uint32_t *words, uint32_t word_count, int32_t width = max_x - min_x, height = max_y - min_y; int32_t X = ws_disp_x(), W = ws_disp_w(), H = ws_disp_h(); - if ((min_x <= X && max_x >= X + W && min_y <= 0 && max_y >= H) || + /* Anything spanning the whole display width is a full-width overlay -- + * letterbox bars, fade strips, subtitle bands -- not a widget: it widens + * with the image. Squashed as UI, a cutscene's bars left the revealed + * margins showing whatever the frame cleared to (Spider-Man). */ + if ((min_x <= X && max_x >= X + W) || (width > W / 2 && height > H / 4)) { ws_ui_reject.too_big++; return; diff --git a/runtime/tests/gpu_exec_stubs.inc b/runtime/tests/gpu_exec_stubs.inc index 72d6fb72..7c63fdcf 100644 --- a/runtime/tests/gpu_exec_stubs.inc +++ b/runtime/tests/gpu_exec_stubs.inc @@ -5,6 +5,7 @@ * Draw calls that tests observe are recorded below. */ uint64_t s_frame_count; +uint64_t psx_cycle_count; /* gpu_timeline.c stamps notes with it */ int g_exec_phase; uint32_t g_debug_current_func_addr; uint32_t g_debug_last_store_pc; diff --git a/runtime/tests/test_ws_auto_ui_untextured_exec.c b/runtime/tests/test_ws_auto_ui_untextured_exec.c index 8d781264..b771355c 100644 --- a/runtime/tests/test_ws_auto_ui_untextured_exec.c +++ b/runtime/tests/test_ws_auto_ui_untextured_exec.c @@ -242,6 +242,27 @@ int main(void) { assert(ws_ui_prepass_count == 3); assert(ws_ui_reject.backing == 0); + /* A letterbox bar spanning the whole display width in the HUD's own + * rank is a full-width overlay: never UI, drawn edge to edge. */ + reset_state(1); + build_hud(60, 128, 64, 120); + { + const int16_t bx0 = (int16_t)ws_disp_x(), bx1 = (int16_t)(ws_disp_x() + ws_disp_w()); + const uint32_t bar[5] = { + 0x28000000u, pack_vertex(bx0, 0), pack_vertex(bx1, 0), + pack_vertex(bx0, 30), pack_vertex(bx1, 30), + }; + put_node(NODE_FLAT, 0xFFFFFFu, bar, 5); + gpu_ws_prepass_linked_list(OT_HEAD); + assert(ws_ui_prepass_count == 2); /* frame + gouraud fill only */ + assert(ws_ui_reject.too_big == 1); + gpu_exec_reset_triangles(); + load_packet(NODE_FLAT, 5); + gp0_exec_mono_quad(); + assert(gpu_exec_triangles.min_x == bx0); + assert(gpu_exec_triangles.max_x == bx1); + } + puts("ws_auto_ui_untextured_exec_test: PASS"); return 0; } From cfd13c0b0a4ad02fc8324b57a7363d1d82830282 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 11:24:51 -0700 Subject: [PATCH 24/52] Widescreen: needles and dial hands inside a HUD widget squash with it Triangles and rotated quads in the HUD rank that lie inside the admitted pieces they overlap join that widget (Spider-Man's compass arrow stretched while its ring squashed). Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/src/gpu.c | 111 ++++++++++++++++-- .../tests/test_ws_auto_ui_untextured_exec.c | 44 ++++++- 2 files changed, 140 insertions(+), 15 deletions(-) diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index a0dd9bf0..459a0a59 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -127,6 +127,9 @@ typedef struct { uint8_t op; uint8_t full_draw_area; uint8_t shared_split_ui; + /* A triangle or a rotated quad: UI only as part of a widget it lies + * inside (ws_ui_prepass_admit_enclosed), never on its own. */ + uint8_t enclosed_only; WsPrepassPacketGuard packet_guard; } WsUiPrepassItem; static WsUiPrepassItem ws_ui_prepass[WS_UI_PREPASS_MAX]; @@ -163,6 +166,7 @@ static struct { uint32_t rank; /* admitted, then dropped by the max_rank filter */ uint32_t stale; /* live packet no longer matches cached bytes */ uint32_t backing; /* NOT a reject: lower-rank backing panels kept */ + uint32_t enclosed; /* NOT a reject: needles/hands inside a widget */ } ws_ui_reject; /* Geometry of the primitives the max_rank filter discarded. A count alone @@ -2059,13 +2063,13 @@ int psx_ws_ui_groups_json(char *buf, int cap) { "\"disp_x\":%d,\"disp_w\":%d,\"join_gap\":%d," "\"rejected\":{\"opcode\":%u,\"not_axis\":%u,\"degenerate\":%u," "\"too_big\":%u,\"cap\":%u,\"rank\":%u,\"stale\":%u}," - "\"backing_panels\":%u,\"n\":%u,", + "\"backing_panels\":%u,\"enclosed_parts\":%u,\"n\":%u,", ws_active(), ws_auto_ui_squash, ws_auto_ui_dense, ws_ui_prepass_rank != 0xFFFFu ? (int)ws_ui_prepass_rank : -1, ws_disp_x(), ws_disp_w(), WS_UI_GROUP_JOIN_GAP, ws_ui_reject.opcode, ws_ui_reject.not_axis, ws_ui_reject.degenerate, ws_ui_reject.too_big, ws_ui_reject.cap, ws_ui_reject.rank, - ws_ui_reject.stale, ws_ui_reject.backing, + ws_ui_reject.stale, ws_ui_reject.backing, ws_ui_reject.enclosed, ws_ui_prepass_count); off += snprintf(buf + off, (size_t)(cap - off), "\"rank_dropped\":["); for (uint32_t i = 0; i < ws_ui_rankdrop_count && off < cap - 120; i++) { @@ -2738,9 +2742,22 @@ static int ws_axis_aligned_quad(const int32_t vx[4], const int32_t vy[4]) { return corners == 15u; } +/* A widget part that is not an axis-aligned rectangle (a triangle, a rotated + * quad): squashed with its widget when the prepass admitted it as lying + * inside that widget (ws_ui_prepass_finish). */ +static int ws_auto_ui_transform_part(int32_t *vx, int n) { + if (psx_ws_prim_is_tagged()) return 0; + int32_t anchor; + if (!ws_auto_ui_anchor(&anchor)) return 0; + for (int i = 0; i < n; i++) + vx[i] = ws_scale_about(vx[i], anchor) + ws_shared_ui_delta(); + ws_auto_ui_transform_count++; + return 1; +} + static int ws_auto_ui_transform_quad(int32_t vx[4], const int32_t vy[4]) { - if (psx_ws_prim_is_tagged() || !ws_axis_aligned_quad(vx, vy)) - return 0; + if (psx_ws_prim_is_tagged()) return 0; + if (!ws_axis_aligned_quad(vx, vy)) return ws_auto_ui_transform_part(vx, 4); int32_t min_x = vx[0], max_x = vx[0], min_y = vy[0], max_y = vy[0]; for (int i = 1; i < 4; i++) { @@ -4358,6 +4375,7 @@ static void gp0_exec_mono_tri(void) { parse_vertex(gp0_cmd_buf[1 + i], &vx[i], &vy[i]); } if (psx_gpu_triangle_oversize(vx, vy, 0, 1, 2)) return; + ws_auto_ui_transform_part(vx, 3); ws_nw_hud_shift_vertices(vx, 3); for (int i = 0; i < 3; i++) { vx[i] += draw_offset_x; @@ -4469,6 +4487,7 @@ static void gp0_exec_shaded_tri(void) { parse_vertex(gp0_cmd_buf[1 + i * 2], &vx[i], &vy[i]); } if (psx_gpu_triangle_oversize(vx, vy, 0, 1, 2)) return; + ws_auto_ui_transform_part(vx, 3); ws_nw_hud_shift_vertices(vx, 3); for (int i = 0; i < 3; i++) { vx[i] += draw_offset_x; @@ -4593,6 +4612,7 @@ static void gp0_exec_textured_tri(void) { uint16_t tpage = tpage_word & 0x1FF; set_tpage_from_poly(tpage_word); /* latches even for size-rejected polys */ if (psx_gpu_triangle_oversize(vx, vy, 0, 1, 2)) return; + ws_auto_ui_transform_part(vx, 3); ws_nw_hud_shift_vertices(vx, 3); for (int i = 0; i < 3; i++) { @@ -4727,6 +4747,7 @@ static void gp0_exec_shaded_textured_tri(void) { uint16_t tpage = tpage_word & 0x1FF; set_tpage_from_poly(tpage_word); /* latches even for size-rejected polys */ if (psx_gpu_triangle_oversize(vx, vy, 0, 1, 2)) return; + ws_auto_ui_transform_part(vx, 3); ws_nw_hud_shift_vertices(vx, 3); for (int i = 0; i < 3; i++) { @@ -5487,8 +5508,27 @@ static void ws_ui_prepass_add(const uint32_t *words, uint32_t word_count, if (ws_ui_prepass_count >= WS_UI_PREPASS_MAX) { ws_ui_reject.cap++; return; } uint32_t op = words[0] >> 24; int32_t min_x, max_x, min_y, max_y; + int enclosed_only = 0; - if (op >= 0x20u && op <= 0x3Fu && (op & 0x08u)) { + if (op >= 0x20u && op <= 0x3Fu && !(op & 0x08u)) { + /* A triangle is a widget part only when it lies inside the widget: + * a compass needle, a dial hand (Spider-Man's compass arrow, two + * flat triangles in the ring's own rank). */ + const int textured = (op & 0x04u) != 0; + const int shaded = (op & 0x10u) != 0; + const int step = 1 + (textured ? 1 : 0) + (shaded ? 1 : 0); + int32_t vx, vy; + parse_vertex(words[1], &min_x, &min_y); + max_x = min_x; max_y = min_y; + for (int i = 1; i < 3; i++) { + parse_vertex(words[1 + i * step], &vx, &vy); + if (vx < min_x) min_x = vx; + if (vx > max_x) max_x = vx; + if (vy < min_y) min_y = vy; + if (vy > max_y) max_y = vy; + } + enclosed_only = 1; + } else if (op >= 0x20u && op <= 0x3Fu && (op & 0x08u)) { /* Any 4-vertex polygon. Untextured HUD fills (health gradients, * meter bars) sit in the same front layer as the textured frames * around them; leaving them out kept their raw 4:3 X while the frame @@ -5511,7 +5551,10 @@ static void ws_ui_prepass_add(const uint32_t *words, uint32_t word_count, int32_t vx[4], vy[4]; for (int i = 0; i < 4; i++) parse_vertex(words[indices[i]], &vx[i], &vy[i]); - if (!ws_axis_aligned_quad(vx, vy)) { ws_ui_reject.not_axis++; return; } + if (!ws_axis_aligned_quad(vx, vy)) { + ws_ui_reject.not_axis++; + enclosed_only = 1; /* a rotated piece: see triangles */ + } min_x = max_x = vx[0]; min_y = max_y = vy[0]; for (int i = 1; i < 4; i++) { if (vx[i] < min_x) min_x = vx[i]; @@ -5585,6 +5628,7 @@ static void ws_ui_prepass_add(const uint32_t *words, uint32_t word_count, item->op = (uint8_t)op; item->full_draw_area = full_draw_area ? 1 : 0; item->shared_split_ui = 0; + item->enclosed_only = (uint8_t)enclosed_only; item->packet_guard = ws_prepass_packet_guard(words, word_count); } @@ -5619,7 +5663,7 @@ void gpu_ws_prepass_linked_list(uint32_t start_addr) { ws_auto_ui_dense = 0; ws_ui_reject.opcode = ws_ui_reject.not_axis = ws_ui_reject.degenerate = ws_ui_reject.too_big = ws_ui_reject.cap = ws_ui_reject.rank = - ws_ui_reject.stale = ws_ui_reject.backing = 0; + ws_ui_reject.stale = ws_ui_reject.backing = ws_ui_reject.enclosed = 0; ws_ui_rankdrop_count = 0; if (!ws_auto_ui_squash || !ws_active()) return; @@ -5703,11 +5747,19 @@ void gpu_ws_prepass_linked_list(uint32_t start_addr) { * Selecting the last empty bucket made the memory-card glyph layer (rank * 4095 followed by an empty rank 4096) disappear from the correction * pass. Pick the highest rank that contains an eligible UI primitive. */ - uint16_t max_rank = ws_ui_prepass[0].ot_rank; - for (uint32_t i = 1; i < ws_ui_prepass_count; i++) { - if (ws_ui_prepass[i].ot_rank > max_rank) + /* Candidates (triangles, rotated quads) never pick the rank: a world + * triangle sorted to the front would otherwise make itself the HUD. */ + uint16_t max_rank = 0xFFFFu; + for (uint32_t i = 0; i < ws_ui_prepass_count; i++) { + if (ws_ui_prepass[i].enclosed_only) continue; + if (max_rank == 0xFFFFu || ws_ui_prepass[i].ot_rank > max_rank) max_rank = ws_ui_prepass[i].ot_rank; } + if (max_rank == 0xFFFFu) { + ws_ui_reject.rank = ws_ui_prepass_count; + ws_ui_prepass_count = 0; + return; + } ws_ui_prepass_rank = max_rank; /* HUD pieces one rank back. A HUD often draws parts of a widget one @@ -5727,18 +5779,20 @@ void gpu_ws_prepass_linked_list(uint32_t start_addr) { uint16_t backing_rank = 0xFFFFu; for (uint32_t i = 0; i < ws_ui_prepass_count; i++) { uint16_t r = ws_ui_prepass[i].ot_rank; - if (r < max_rank && (backing_rank == 0xFFFFu || r > backing_rank)) + if (!ws_ui_prepass[i].enclosed_only && r < max_rank && + (backing_rank == 0xFFFFu || r > backing_rank)) backing_rank = r; } static uint8_t keep[WS_UI_PREPASS_MAX]; for (uint32_t i = 0; i < ws_ui_prepass_count; i++) - keep[i] = ws_ui_prepass[i].ot_rank == max_rank; + keep[i] = ws_ui_prepass[i].ot_rank == max_rank && + !ws_ui_prepass[i].enclosed_only; const int32_t small_w = ws_disp_w() / 4, small_h = ws_disp_h() / 4; for (int changed = 1; changed && backing_rank != 0xFFFFu;) { changed = 0; for (uint32_t i = 0; i < ws_ui_prepass_count; i++) { const WsUiPrepassItem *it = &ws_ui_prepass[i]; - if (keep[i] || it->ot_rank != backing_rank) continue; + if (keep[i] || it->enclosed_only || it->ot_rank != backing_rank) continue; const int small = it->group.width <= small_w && it->h <= small_h; const int untextured = ws_ui_untextured_op(it->op); for (uint32_t j = 0; j < ws_ui_prepass_count; j++) { @@ -5754,6 +5808,37 @@ void gpu_ws_prepass_linked_list(uint32_t start_addr) { } } + /* Widget parts that are not axis-aligned rectangles -- a compass needle, + * a dial hand -- join from the HUD rank when they lie inside the admitted + * pieces they overlap (the union of their boxes). Left out, they stretch + * with the wide image while the frame around them squashes. */ + for (uint32_t i = 0; i < ws_ui_prepass_count; i++) { + const WsUiPrepassItem *it = &ws_ui_prepass[i]; + if (!it->enclosed_only || it->ot_rank != max_rank) continue; + const int32_t x0 = it->group.x, x1 = it->group.x + it->group.width; + const int32_t y0 = it->y, y1 = it->y + it->h; + int32_t ux0 = 0, ux1 = 0, uy0 = 0, uy1 = 0; + int any = 0; + for (uint32_t j = 0; j < ws_ui_prepass_count; j++) { + const WsUiPrepassItem *ui = &ws_ui_prepass[j]; + if (!keep[j] || ui->enclosed_only) continue; + const int32_t a0 = ui->group.x, a1 = ui->group.x + ui->group.width; + const int32_t b0 = ui->y, b1 = ui->y + ui->h; + if (a0 >= x1 || x0 >= a1 || b0 >= y1 || y0 >= b1) continue; + if (!any) { ux0 = a0; ux1 = a1; uy0 = b0; uy1 = b1; any = 1; } + else { + if (a0 < ux0) ux0 = a0; + if (a1 > ux1) ux1 = a1; + if (b0 < uy0) uy0 = b0; + if (b1 > uy1) uy1 = b1; + } + } + if (any && ux0 <= x0 && x1 <= ux1 && uy0 <= y0 && y1 <= uy1) { + keep[i] = 1; + ws_ui_reject.enclosed++; + } + } + uint32_t out = 0; for (uint32_t i = 0; i < ws_ui_prepass_count; i++) { if (keep[i]) { diff --git a/runtime/tests/test_ws_auto_ui_untextured_exec.c b/runtime/tests/test_ws_auto_ui_untextured_exec.c index b771355c..7b2c012a 100644 --- a/runtime/tests/test_ws_auto_ui_untextured_exec.c +++ b/runtime/tests/test_ws_auto_ui_untextured_exec.c @@ -176,12 +176,15 @@ int main(void) { assert(gmax == ws_scale_about(120, left)); assert(fmin == gmin && fmax == gmax); - /* A non-axis-aligned untextured quad is world geometry, never UI. */ + /* A non-axis-aligned untextured quad reaching outside every widget is + * world geometry, never UI (one inside a widget is a part of it: see the + * needle below). */ reset_state(1); build_hud(60, 128, 64, 120); - test_ram[NODE_FILL / 4u + 1u + 3u] = pack_vertex(121, 25); /* skew v1 */ + test_ram[NODE_FILL / 4u + 1u + 3u] = pack_vertex(140, 25); /* skew v1 out */ gpu_ws_prepass_linked_list(OT_HEAD); assert(ws_ui_prepass_count == 2); + assert(ws_ui_reject.enclosed == 0); /* Backing panel enclosing the frame: admitted from the rank behind the * HUD and squashed with it about the shared run's centre. */ @@ -263,6 +266,43 @@ int main(void) { assert(gpu_exec_triangles.max_x == bx1); } + /* A needle inside its widget (Spider-Man's compass arrow: flat + * triangles in the ring's rank) joins the widget and squashes with it. */ + reset_state(1); + build_hud(60, 128, 64, 120); + { + const uint32_t tri[4] = { + 0x20FFFF00u, pack_vertex(70, 22), pack_vertex(100, 30), pack_vertex(80, 34), + }; + put_node(NODE_FLAT, 0xFFFFFFu, tri, 4); + gpu_ws_prepass_linked_list(OT_HEAD); + assert(ws_ui_prepass_count == 3); /* frame, fill, needle */ + assert(ws_ui_reject.enclosed == 1); + gpu_exec_reset_triangles(); + load_packet(NODE_FLAT, 4); + gp0_exec_mono_tri(); + const int32_t widget = 60 + (128 - 60) / 2; + assert(gpu_exec_triangles.min_x == ws_scale_about(70, widget)); + assert(gpu_exec_triangles.max_x == ws_scale_about(100, widget)); + } + + /* A triangle reaching outside every widget is world geometry. */ + reset_state(1); + build_hud(60, 128, 64, 120); + { + const uint32_t tri[4] = { + 0x20FFFF00u, pack_vertex(50, 22), pack_vertex(140, 30), pack_vertex(80, 34), + }; + put_node(NODE_FLAT, 0xFFFFFFu, tri, 4); + gpu_ws_prepass_linked_list(OT_HEAD); + assert(ws_ui_prepass_count == 2); + assert(ws_ui_reject.enclosed == 0); + gpu_exec_reset_triangles(); + load_packet(NODE_FLAT, 4); + gp0_exec_mono_tri(); + assert(gpu_exec_triangles.min_x == 50 && gpu_exec_triangles.max_x == 140); + } + puts("ws_auto_ui_untextured_exec_test: PASS"); return 0; } From bf91728a93098d45554b1dbd72d7ef0156e261d4 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 11:26:28 -0700 Subject: [PATCH 25/52] Widescreen: full-width overlays to within W/64 of each edge Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/src/gpu.c | 12 +++++++----- runtime/tests/test_ws_auto_ui_untextured_exec.c | 9 +++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index 459a0a59..47d063b8 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -5602,11 +5602,13 @@ static void ws_ui_prepass_add(const uint32_t *words, uint32_t word_count, int32_t width = max_x - min_x, height = max_y - min_y; int32_t X = ws_disp_x(), W = ws_disp_w(), H = ws_disp_h(); - /* Anything spanning the whole display width is a full-width overlay -- - * letterbox bars, fade strips, subtitle bands -- not a widget: it widens - * with the image. Squashed as UI, a cutscene's bars left the revealed - * margins showing whatever the frame cleared to (Spider-Man). */ - if ((min_x <= X && max_x >= X + W) || + /* Anything spanning the display width (to within W/64 of each edge) is a + * full-width overlay -- letterbox bars, fade strips, menu band rules -- + * not a widget: it widens with the image. Squashed as UI, a cutscene's + * bars left the revealed margins showing whatever the frame cleared to, + * and the pause menu's rules (x 2..510 of 512) stopped short of the band + * they frame (Spider-Man). */ + if ((min_x <= X + W / 64 && max_x >= X + W - W / 64) || (width > W / 2 && height > H / 4)) { ws_ui_reject.too_big++; return; diff --git a/runtime/tests/test_ws_auto_ui_untextured_exec.c b/runtime/tests/test_ws_auto_ui_untextured_exec.c index 7b2c012a..f22bc5d2 100644 --- a/runtime/tests/test_ws_auto_ui_untextured_exec.c +++ b/runtime/tests/test_ws_auto_ui_untextured_exec.c @@ -259,6 +259,15 @@ int main(void) { gpu_ws_prepass_linked_list(OT_HEAD); assert(ws_ui_prepass_count == 2); /* frame + gouraud fill only */ assert(ws_ui_reject.too_big == 1); + /* A rule stopping two pixels short of each edge is full width too. */ + const uint32_t rule[5] = { + 0x28000000u, pack_vertex((int16_t)(bx0 + 2), 40), pack_vertex((int16_t)(bx1 - 2), 40), + pack_vertex((int16_t)(bx0 + 2), 44), pack_vertex((int16_t)(bx1 - 2), 44), + }; + put_node(NODE_FLAT, 0xFFFFFFu, rule, 5); + gpu_ws_prepass_linked_list(OT_HEAD); + assert(ws_ui_prepass_count == 2 && ws_ui_reject.too_big == 1); + put_node(NODE_FLAT, 0xFFFFFFu, bar, 5); gpu_exec_reset_triangles(); load_packet(NODE_FLAT, 5); gp0_exec_mono_quad(); From af4dc2309e560524014b7d414a80167d4f22d81f Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 11:32:36 -0700 Subject: [PATCH 26/52] PGXP variant: stage the clone's mod catalog after the base target's Both wrote one mods/bundled concurrently under -j2 and the wipe failed. Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/runtime.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/runtime.cmake b/runtime/runtime.cmake index 89e80b5d..e5bc1729 100644 --- a/runtime/runtime.cmake +++ b/runtime/runtime.cmake @@ -2417,6 +2417,14 @@ function(psxrecomp_add_runtime_target target) "Also build the _pgxp PGXP precision-shadowing variant" OFF) if(PSX_PGXP_VARIANT) psxrecomp_add_runtime_target(${target}-pgxp PGXP PGXP_CLONE ${ARGN}) + # Both executables sit in one directory and stage one + # mods/bundled: run the clone's staging (which wipes and rewrites + # it) after the base target's, never concurrently with it. + if(TARGET ${target}_mod_catalog_stage AND + TARGET ${target}-pgxp_mod_catalog_stage) + add_dependencies(${target}-pgxp_mod_catalog_stage + ${target}_mod_catalog_stage) + endif() endif() endif() endfunction() From 9594b3d79bb123dfaccef55b794d2d896431b6e7 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 11:33:29 -0700 Subject: [PATCH 27/52] Mod catalog: stage sibling runtimes one after another Siblings sharing an output directory (PGXP clones, Tomba 2's regions) raced each other's mods/bundled wipe under -j2. Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/runtime.cmake | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/runtime/runtime.cmake b/runtime/runtime.cmake index e5bc1729..b0879b38 100644 --- a/runtime/runtime.cmake +++ b/runtime/runtime.cmake @@ -1068,6 +1068,15 @@ function(_psxrt_finalize_mod_catalog_guards) VERBATIM) add_dependencies("${_guard_target}" "${_stage_target}") add_dependencies(${_t} "${_guard_target}") + # Siblings can share one output directory (above; and every + # PSX_PGXP_VARIANT clone sits beside its base). Each staging step + # wipes and rewrites mods/bundled, so under a parallel build one + # sibling's wipe raced the other's staging or check. Stage siblings + # one after another: each after the previous one staged and verified. + if(_i GREATER 0) + add_dependencies("${_stage_target}" "${_prev_guard_target}") + endif() + set(_prev_guard_target "${_guard_target}") endforeach() # One ctest, registered against the first staging target's output @@ -2417,14 +2426,6 @@ function(psxrecomp_add_runtime_target target) "Also build the _pgxp PGXP precision-shadowing variant" OFF) if(PSX_PGXP_VARIANT) psxrecomp_add_runtime_target(${target}-pgxp PGXP PGXP_CLONE ${ARGN}) - # Both executables sit in one directory and stage one - # mods/bundled: run the clone's staging (which wipes and rewrites - # it) after the base target's, never concurrently with it. - if(TARGET ${target}_mod_catalog_stage AND - TARGET ${target}-pgxp_mod_catalog_stage) - add_dependencies(${target}-pgxp_mod_catalog_stage - ${target}_mod_catalog_stage) - endif() endif() endif() endfunction() From 36bea23bd2400fc46069a391a103ec15f9fa775e Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 11:45:15 -0700 Subject: [PATCH 28/52] PGXP: census which check refuses a precise-word depth lookup Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/pgxp.h | 10 ++++++++++ runtime/src/debug_server.c | 12 ++++++++++-- runtime/src/pgxp.cpp | 12 +++++++++--- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/runtime/include/pgxp.h b/runtime/include/pgxp.h index aa55b3aa..9b0df4bc 100644 --- a/runtime/include/pgxp.h +++ b/runtime/include/pgxp.h @@ -103,6 +103,16 @@ typedef struct PGXPStats { uint64_t w_valid; /* lookups that also carried a usable depth */ uint64_t produced; /* RTPS/RTPT projections pushed into shadows */ uint64_t swc2_stores; /* GTE reg shadows copied to RAM shadows */ + /* pgxp_load_precise_word outcomes (perspective texturing, per vertex): + * which check refused the depth. untracked = no shadow for that address in + * this generation; mismatch = shadow describes a different word; partial = + * only one half carries a projection; no_z = projection without depth. */ + uint64_t word_lookups; + uint64_t word_hit; + uint64_t word_untracked; + uint64_t word_mismatch; + uint64_t word_partial; + uint64_t word_no_z; } PGXPStats; void pgxp_get_stats(PGXPStats *out); diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index d5b821fa..514e8466 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -5289,7 +5289,9 @@ static void handle_geom_correction(int id, const char *json) "\"lookups\":%llu,\"dataflow_hit\":%llu,\"fallback_hit\":%llu," "\"native\":%llu,\"value_mismatch\":%llu,\"trunc_reject\":%llu," "\"tolerance_reject\":%llu,\"w_valid\":%llu," - "\"produced\":%llu,\"swc2_stores\":%llu}}", + "\"produced\":%llu,\"swc2_stores\":%llu," + "\"word\":{\"lookups\":%llu,\"hit\":%llu,\"untracked\":%llu," + "\"mismatch\":%llu,\"partial\":%llu,\"no_z\":%llu}}}", id, gte_geometry_correction_enabled(), (unsigned)hits, @@ -5308,7 +5310,13 @@ static void handle_geom_correction(int id, const char *json) (unsigned long long)ps.tolerance_reject, (unsigned long long)ps.w_valid, (unsigned long long)ps.produced, - (unsigned long long)ps.swc2_stores); + (unsigned long long)ps.swc2_stores, + (unsigned long long)ps.word_lookups, + (unsigned long long)ps.word_hit, + (unsigned long long)ps.word_untracked, + (unsigned long long)ps.word_mismatch, + (unsigned long long)ps.word_partial, + (unsigned long long)ps.word_no_z); } /* pgxp — live-tune the value-propagation engine for one-toggle isolation runs diff --git a/runtime/src/pgxp.cpp b/runtime/src/pgxp.cpp index c2906c9e..51ec0f61 100644 --- a/runtime/src/pgxp.cpp +++ b/runtime/src/pgxp.cpp @@ -809,12 +809,18 @@ extern "C" void pgxp_test_set_generation(uint32_t gen) { s_gen = gen; } extern "C" int pgxp_load_precise_word(uint32_t addr, uint32_t packed, int32_t *x16, int32_t *y16, uint16_t *z) { if (!s_enabled) return 0; + s_stats.word_lookups++; PGXPValue *pv = pgxp_ptr(addr); - if (!pv || pv->gen != s_gen || pv->value != packed || - (pv->flags & PGXP_F_VXY) != PGXP_F_VXY) + if (!pv || pv->gen != s_gen) { s_stats.word_untracked++; return 0; } + if (pv->value != packed) { s_stats.word_mismatch++; return 0; } + if ((pv->flags & PGXP_F_VXY) != PGXP_F_VXY) { + s_stats.word_partial++; return 0; + } if (x16) *x16 = pv->x16; if (y16) *y16 = pv->y16; if (z) *z = (pv->flags & PGXP_F_VZ) ? pv->z : 0; - return (pv->flags & PGXP_F_VZ) && pv->z != 0; + if (!(pv->flags & PGXP_F_VZ) || pv->z == 0) { s_stats.word_no_z++; return 0; } + s_stats.word_hit++; + return 1; } From ce22e54e891e7685abddb3ec1b2dbae57114061c Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 11:57:55 -0700 Subject: [PATCH 29/52] TCP pgxp_shadow: read PGXP shadow slots by address or register Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/pgxp.h | 8 ++++++++ runtime/src/debug_server.c | 35 +++++++++++++++++++++++++++++++++++ runtime/src/pgxp.cpp | 17 +++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/runtime/include/pgxp.h b/runtime/include/pgxp.h index 9b0df4bc..25e8e90a 100644 --- a/runtime/include/pgxp.h +++ b/runtime/include/pgxp.h @@ -127,6 +127,14 @@ void pgxp_store_gte_reg(uint32_t addr, uint8_t reg); int pgxp_load_precise_word(uint32_t addr, uint32_t packed, int32_t *x16, int32_t *y16, uint16_t *z); +/* Debug read of one shadow slot (TCP pgxp_shadow). `space`: 0 = guest + * address (RAM / scratchpad), 1 = GPR index (32 = HI, 33 = LO), 2 = GTE data + * register. Returns 0 when the slot does not exist; *live says whether it + * belongs to the current generation. */ +int pgxp_debug_shadow(int space, uint32_t key, int *live, uint32_t *value, + uint32_t *flags, int32_t *x16, int32_t *y16, + uint16_t *z); + /* --- test accessors (always compiled; trivial) ---------------------------- */ /* index 0..3 selects the SXY0..SXYP register shadow (GTE data regs 12..15). */ diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index 514e8466..ee6898ec 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -5319,6 +5319,40 @@ static void handle_geom_correction(int id, const char *json) (unsigned long long)ps.word_no_z); } +/* pgxp_shadow — read PGXP shadow slots: {"cmd":"pgxp_shadow","addr":A, + * "count":N} walks N guest words from A (RAM / scratchpad); "space":"gpr" or + * "gte" with "index"/"count" reads register shadows instead. Each slot: the + * word it describes, whether it is live this generation, the per-half/depth + * flags (1 = X, 2 = Y, 4 = Z) and the 16.16 positions. Pair it with read_ram + * to see whether a packet word still matches its shadow. */ +static void handle_pgxp_shadow(int id, const char *json) +{ + char sp[16] = ""; + json_get_str(json, "space", sp, sizeof sp); + int space = strcmp(sp, "gpr") == 0 ? 1 : strcmp(sp, "gte") == 0 ? 2 : 0; + char addr_str[32] = ""; + uint32_t key = space ? (uint32_t)json_get_int(json, "index", 0) + : (json_get_str(json, "addr", addr_str, sizeof addr_str) + ? hex_to_u32(addr_str) : 0u); + int count = json_get_int(json, "count", 1); + if (count < 1) count = 1; + if (count > 256) count = 256; + static char buf[256 * 112 + 128]; + size_t n = (size_t)snprintf(buf, sizeof buf, "{\"id\":%d,\"ok\":true,\"slots\":[", id); + for (int i = 0; i < count && n < sizeof buf - 128; i++) { + uint32_t k = space ? key + (uint32_t)i : key + (uint32_t)i * 4u; + int live = 0; uint32_t value = 0, flags = 0; int32_t x16 = 0, y16 = 0; uint16_t z = 0; + if (!pgxp_debug_shadow(space, k, &live, &value, &flags, &x16, &y16, &z)) + break; + n += (size_t)snprintf(buf + n, sizeof buf - n, + "%s{\"key\":\"0x%08X\",\"live\":%d,\"value\":\"0x%08X\"," + "\"flags\":%u,\"x16\":%d,\"y16\":%d,\"z\":%u}", + i ? "," : "", k, live, value, flags, x16, y16, z); + } + snprintf(buf + n, sizeof buf - n, "]}"); + send_fmt("%s", buf); +} + /* pgxp — live-tune the value-propagation engine for one-toggle isolation runs * without a rebuild: {"cmd":"pgxp","cpu_mode":0|1,"tolerance":F}. Fields are * optional; the reply echoes the resulting state (same shape as @@ -14367,6 +14401,7 @@ static const CmdEntry s_commands[] = { { "gpu_state", handle_gpu_state }, { "geom_correction", handle_geom_correction }, { "pgxp", handle_pgxp }, + { "pgxp_shadow", handle_pgxp_shadow }, { "ws_aspect_cone_site", handle_ws_aspect_cone_site }, { "ws_margin", handle_ws_margin }, { "ws_hud_mode", handle_ws_hud_mode }, diff --git a/runtime/src/pgxp.cpp b/runtime/src/pgxp.cpp index 51ec0f61..565f79d5 100644 --- a/runtime/src/pgxp.cpp +++ b/runtime/src/pgxp.cpp @@ -767,6 +767,23 @@ extern "C" void pgxp_store_gte_reg(uint32_t addr, uint8_t reg) { *dst = *src; } +extern "C" int pgxp_debug_shadow(int space, uint32_t key, int *live, + uint32_t *value, uint32_t *flags, + int32_t *x16, int32_t *y16, uint16_t *z) { + const PGXPValue *pv = nullptr; + if (space == 0) pv = pgxp_ptr(key); + else if (space == 1 && key < 34) pv = &s_gpr[key]; + else if (space == 2 && key < 32) pv = &s_gte[key]; + if (!pv) return 0; + *live = pv->gen == s_gen; + *value = pv->value; + *flags = pv->flags; + *x16 = pv->x16; + *y16 = pv->y16; + *z = pv->z; + return 1; +} + /* ------------------------------------------------------------------------- */ /* Test accessors */ /* ------------------------------------------------------------------------- */ From 534dcd5df3bbfe4585f8024b0032615d962f843a Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:00:42 -0700 Subject: [PATCH 30/52] PGXP: always-on ring of refused perspective-depth lookups (TCP pgxp_miss_ring) Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/pgxp.h | 20 +++++++++++++++++ runtime/src/debug_server.c | 35 +++++++++++++++++++++++++++++ runtime/src/pgxp.cpp | 45 +++++++++++++++++++++++++++++++++++--- 3 files changed, 97 insertions(+), 3 deletions(-) diff --git a/runtime/include/pgxp.h b/runtime/include/pgxp.h index 25e8e90a..291d90cd 100644 --- a/runtime/include/pgxp.h +++ b/runtime/include/pgxp.h @@ -127,6 +127,26 @@ void pgxp_store_gte_reg(uint32_t addr, uint8_t reg); int pgxp_load_precise_word(uint32_t addr, uint32_t packed, int32_t *x16, int32_t *y16, uint16_t *z); +/* Refused precise-word lookups, newest at (seq - 1) % cap (TCP pgxp_miss_ring). */ +enum { + PGXP_MISS_UNTRACKED = 1, + PGXP_MISS_MISMATCH = 2, + PGXP_MISS_PARTIAL = 3, + PGXP_MISS_NO_Z = 4 +}; +#define PGXP_MISS_RING_CAP 8192u +typedef struct PGXPWordMiss { + uint64_t seq; + uint32_t addr; /* packet word address (canonical RAM offset) */ + uint32_t packet; /* the word the GPU consumed */ + uint32_t shadow_value; /* the word the shadow describes */ + uint8_t shadow_flags; /* 1 = X, 2 = Y, 4 = Z */ + uint8_t live; /* shadow belongs to the current generation */ + uint8_t reason; /* PGXP_MISS_* */ +} PGXPWordMiss; +/* Returns the total number of misses ever recorded. */ +uint64_t pgxp_word_miss_ring(const PGXPWordMiss **ring, uint32_t *cap); + /* Debug read of one shadow slot (TCP pgxp_shadow). `space`: 0 = guest * address (RAM / scratchpad), 1 = GPR index (32 = HI, 33 = LO), 2 = GTE data * register. Returns 0 when the slot does not exist; *live says whether it diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index ee6898ec..573f66d1 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -5353,6 +5353,40 @@ static void handle_pgxp_shadow(int id, const char *json) send_fmt("%s", buf); } +/* pgxp_miss_ring — the newest refused perspective-depth lookups (always-on + * ring, PGXP_MISS_RING_CAP deep): {"cmd":"pgxp_miss_ring","count":N}. Each + * entry: packet word address (canonical RAM offset), the word the GPU + * consumed, the word/flags the shadow held, and the reason (untracked, + * mismatch, partial, no_z). Join addr with wtrace_dump to name the writer. */ +static void handle_pgxp_miss_ring(int id, const char *json) +{ + static const char *const reasons[] = { "?", "untracked", "mismatch", + "partial", "no_z" }; + const PGXPWordMiss *ring; uint32_t cap; + uint64_t total = pgxp_word_miss_ring(&ring, &cap); + int count = json_get_int(json, "count", 256); + uint64_t avail = total < cap ? total : cap; + if (count < 0) count = 0; + if ((uint64_t)count > avail) count = (int)avail; + size_t sz = (size_t)count * 160u + 256u; + char *buf = (char *)malloc(sz); + if (!buf) { send_err(id, "oom"); return; } + size_t n = (size_t)snprintf(buf, sz, "{\"id\":%d,\"ok\":true,\"total\":%llu,\"entries\":[", + id, (unsigned long long)total); + for (int i = 0; i < count; i++) { + const PGXPWordMiss *m = &ring[(total - (uint64_t)count + (uint64_t)i) % cap]; + n += (size_t)snprintf(buf + n, sz - n, + "%s{\"seq\":%llu,\"addr\":\"0x%08X\",\"packet\":\"0x%08X\"," + "\"shadow\":\"0x%08X\",\"flags\":%u,\"live\":%u,\"reason\":\"%s\"}", + i ? "," : "", (unsigned long long)m->seq, m->addr, m->packet, + m->shadow_value, m->shadow_flags, m->live, + reasons[m->reason < 5 ? m->reason : 0]); + } + snprintf(buf + n, sz - n, "]}"); + send_fmt("%s", buf); + free(buf); +} + /* pgxp — live-tune the value-propagation engine for one-toggle isolation runs * without a rebuild: {"cmd":"pgxp","cpu_mode":0|1,"tolerance":F}. Fields are * optional; the reply echoes the resulting state (same shape as @@ -14402,6 +14436,7 @@ static const CmdEntry s_commands[] = { { "geom_correction", handle_geom_correction }, { "pgxp", handle_pgxp }, { "pgxp_shadow", handle_pgxp_shadow }, + { "pgxp_miss_ring", handle_pgxp_miss_ring }, { "ws_aspect_cone_site", handle_ws_aspect_cone_site }, { "ws_margin", handle_ws_margin }, { "ws_hud_mode", handle_ws_hud_mode }, diff --git a/runtime/src/pgxp.cpp b/runtime/src/pgxp.cpp index 565f79d5..50a3f15b 100644 --- a/runtime/src/pgxp.cpp +++ b/runtime/src/pgxp.cpp @@ -823,21 +823,60 @@ extern "C" void pgxp_test_set_generation(uint32_t gen) { s_gen = gen; } /* Address-keyed depth lookup for the shipped perspective-texturing path * (gpu.c prepare_texture_triangle). Same contract as the retired hashed * table: hit only when the tracked word matches the packet word exactly. */ +/* Always-on ring of refused precise-word lookups: which packet word, what + * the shadow at its address held, and why it was refused. Join it with + * wtrace_dump (writer PC per address) to find the guest code path that drops + * provenance. */ +static PGXPWordMiss s_miss_ring[PGXP_MISS_RING_CAP]; +static uint64_t s_miss_seq = 0; + +static void note_word_miss(uint32_t addr, uint32_t packed, const PGXPValue *pv, + uint8_t reason) { + PGXPWordMiss *m = &s_miss_ring[s_miss_seq % PGXP_MISS_RING_CAP]; + m->seq = s_miss_seq++; + m->addr = addr; + m->packet = packed; + m->shadow_value = pv ? pv->value : 0; + m->shadow_flags = pv ? (uint8_t)pv->flags : 0; + m->live = (pv && pv->gen == s_gen) ? 1 : 0; + m->reason = reason; +} + +extern "C" uint64_t pgxp_word_miss_ring(const PGXPWordMiss **ring, + uint32_t *cap) { + *ring = s_miss_ring; + *cap = PGXP_MISS_RING_CAP; + return s_miss_seq; +} + extern "C" int pgxp_load_precise_word(uint32_t addr, uint32_t packed, int32_t *x16, int32_t *y16, uint16_t *z) { if (!s_enabled) return 0; s_stats.word_lookups++; PGXPValue *pv = pgxp_ptr(addr); - if (!pv || pv->gen != s_gen) { s_stats.word_untracked++; return 0; } - if (pv->value != packed) { s_stats.word_mismatch++; return 0; } + if (!pv || pv->gen != s_gen) { + s_stats.word_untracked++; + note_word_miss(addr, packed, pv, PGXP_MISS_UNTRACKED); + return 0; + } + if (pv->value != packed) { + s_stats.word_mismatch++; + note_word_miss(addr, packed, pv, PGXP_MISS_MISMATCH); + return 0; + } if ((pv->flags & PGXP_F_VXY) != PGXP_F_VXY) { s_stats.word_partial++; + note_word_miss(addr, packed, pv, PGXP_MISS_PARTIAL); return 0; } if (x16) *x16 = pv->x16; if (y16) *y16 = pv->y16; if (z) *z = (pv->flags & PGXP_F_VZ) ? pv->z : 0; - if (!(pv->flags & PGXP_F_VZ) || pv->z == 0) { s_stats.word_no_z++; return 0; } + if (!(pv->flags & PGXP_F_VZ) || pv->z == 0) { + s_stats.word_no_z++; + note_word_miss(addr, packed, pv, PGXP_MISS_NO_Z); + return 0; + } s_stats.word_hit++; return 1; } From 72e6d7e01d152ecdc4523641c7dd18a6e003c72c Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:21:52 -0700 Subject: [PATCH 31/52] PGXP: carry vertex fields through bitwise ops, keep depth, fix in-place aliasing Hook every GPR-writing ALU op; rebase onto the 11-bit GP0 field. Spider-Man ORs clip flags into SXY2 before storing it. Co-Authored-By: Claude Opus 5.5 (1M context) --- recompiler/src/pgxp_hook_emitter.cpp | 18 +- runtime/src/dirty_ram_interp.c | 39 +++- runtime/src/pgxp.cpp | 262 +++++++++++++++++---------- runtime/src/psx_interpreter.c | 27 ++- runtime/tests/test_pgxp.cpp | 90 +++++++++ 5 files changed, 310 insertions(+), 126 deletions(-) diff --git a/recompiler/src/pgxp_hook_emitter.cpp b/recompiler/src/pgxp_hook_emitter.cpp index a998b12c..5f251f3e 100644 --- a/recompiler/src/pgxp_hook_emitter.cpp +++ b/recompiler/src/pgxp_hook_emitter.cpp @@ -24,11 +24,13 @@ inline int16_t get_imm16(uint32_t i) { return (int16_t)(i & 0xFFFF); } * the macros preprocess to ((void)0) and the optimizer erases the dead * capture locals, so base objects are unchanged; only a -DPSX_PGXP=1 TU pays. * - * Deliberately unhooked: AND/XOR/NOR/SLT-family and the exotic immediates — - * they only ever DESTROY precision, and the engine's validate-on-read drops - * their stale shadows without help. The configured widescreen special sites - * return early above translate_instruction's main dispatch and are likewise - * unhooked (they are cull compares, not vertex moves; validation covers). */ + * Every GPR-writing ALU op is hooked. Bitwise ops (AND/OR/XOR/NOR, ANDI/ORI/ + * XORI) carry a vertex half whose 11-bit GPU field survives them - engines + * pack clip flags above the field after projecting - and SLT-family results + * are reset, so no destination keeps a stale shadow. The configured + * widescreen special sites return early above translate_instruction's main + * dispatch and are unhooked (they are cull compares, not vertex moves; + * validation covers). */ bool emission_ends_on_preprocessor_directive(const std::string& code) { /* Scan back to the start of the final line, then find its first * non-blank character. A directive is legal with leading whitespace, so @@ -89,7 +91,8 @@ void append_pgxp_hooks(uint32_t instr, std::string& code) { code, instr, reg_name(rs), reg_name(rt)); return; case 0x20: case 0x21: case 0x22: case 0x23: /* ADD(U)/SUB(U) */ - case 0x25: /* OR */ + case 0x24: case 0x25: case 0x26: case 0x27: /* AND/OR/XOR/NOR */ + case 0x2A: case 0x2B: /* SLT/SLTU */ if (rd == 0) return; code = fmt::format( "{{ uint32_t _pgx1 = {}; uint32_t _pgx2 = {}; {}\n " @@ -107,7 +110,8 @@ void append_pgxp_hooks(uint32_t instr, std::string& code) { reg_name(rs), code, instr, reg_name(rt), (uint32_t)(int32_t)offset); return; - case 0x0D: /* ORI */ + case 0x0A: case 0x0B: /* SLTI / SLTIU */ + case 0x0C: case 0x0D: case 0x0E: /* ANDI / ORI / XORI */ if (rt == 0) return; code = fmt::format( "{{ uint32_t _pgx1 = {}; {}\n PGXP_ALU(0x{:08X}u, {}, _pgx1, 0x{:04X}u); }}", diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index f95ebde8..2d4ada9a 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -1877,10 +1877,13 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, cpu->gpr[0] = 0; return 0; } - case 0x24: /* AND */ - cpu->gpr[rd] = cpu->gpr[rs] & cpu->gpr[rt]; + case 0x24: { /* AND */ + uint32_t a = cpu->gpr[rs], b = cpu->gpr[rt]; + cpu->gpr[rd] = a & b; + psx_pgxp_alu(cpu, insn, cpu->gpr[rd], a, b); cpu->gpr[0] = 0; return 0; + } case 0x25: { /* OR */ uint32_t a = cpu->gpr[rs], b = cpu->gpr[rt]; cpu->gpr[rd] = a | b; @@ -1888,14 +1891,20 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, cpu->gpr[0] = 0; return 0; } - case 0x26: /* XOR */ - cpu->gpr[rd] = cpu->gpr[rs] ^ cpu->gpr[rt]; + case 0x26: { /* XOR */ + uint32_t a = cpu->gpr[rs], b = cpu->gpr[rt]; + cpu->gpr[rd] = a ^ b; + psx_pgxp_alu(cpu, insn, cpu->gpr[rd], a, b); cpu->gpr[0] = 0; return 0; - case 0x27: /* NOR */ - cpu->gpr[rd] = ~(cpu->gpr[rs] | cpu->gpr[rt]); + } + case 0x27: { /* NOR */ + uint32_t a = cpu->gpr[rs], b = cpu->gpr[rt]; + cpu->gpr[rd] = ~(a | b); + psx_pgxp_alu(cpu, insn, cpu->gpr[rd], a, b); cpu->gpr[0] = 0; return 0; + } case 0x2A: /* SLT */ { uint32_t vanilla = @@ -1905,6 +1914,7 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, !psx_ws_aspect_cone_site(cpu, pc, insn, vanilla, &kept)) (void)psx_ws_cull_keep_site(pc, insn, vanilla, &kept); cpu->gpr[rd] = kept; + psx_pgxp_alu(cpu, insn, kept, 0, 0); cpu->gpr[0] = 0; return 0; } @@ -1915,6 +1925,7 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, if (!psx_ws_cull_scale_site(pc, insn, cpu->gpr[rs], cpu->gpr[rt], &kept)) (void)psx_ws_cull_keep_site(pc, insn, vanilla, &kept); cpu->gpr[rd] = kept; + psx_pgxp_alu(cpu, insn, kept, 0, 0); cpu->gpr[0] = 0; return 0; } @@ -2106,6 +2117,7 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, cpu->gpr[rt] = (uint32_t)psx_ws_cull_slti(cpu->gpr[rs], imm); else cpu->gpr[rt] = ((int32_t)cpu->gpr[rs] < simm) ? 1u : 0u; + psx_pgxp_alu(cpu, insn, cpu->gpr[rt], 0, 0); cpu->gpr[0] = 0; return 0; } @@ -2135,13 +2147,17 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, cpu->gpr[rt] = (uint32_t)psx_ws_cull_sltiu(cpu->gpr[rs], imm); else cpu->gpr[rt] = (cpu->gpr[rs] < (uint32_t)simm) ? 1u : 0u; + psx_pgxp_alu(cpu, insn, cpu->gpr[rt], 0, 0); cpu->gpr[0] = 0; return 0; } - case 0x0C: /* ANDI */ - cpu->gpr[rt] = cpu->gpr[rs] & imm; + case 0x0C: { /* ANDI */ + uint32_t a = cpu->gpr[rs]; + cpu->gpr[rt] = a & imm; + psx_pgxp_alu(cpu, insn, cpu->gpr[rt], a, imm); cpu->gpr[0] = 0; return 0; + } case 0x0D: { /* ORI */ uint32_t a = cpu->gpr[rs]; if (rs == 0 && rt != 0 && psx_ws_is_signed_x_bound_site(pc, insn)) @@ -2152,10 +2168,13 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, cpu->gpr[0] = 0; return 0; } - case 0x0E: /* XORI */ - cpu->gpr[rt] = cpu->gpr[rs] ^ imm; + case 0x0E: { /* XORI */ + uint32_t a = cpu->gpr[rs]; + cpu->gpr[rt] = a ^ imm; + psx_pgxp_alu(cpu, insn, cpu->gpr[rt], a, imm); cpu->gpr[0] = 0; return 0; + } case 0x0F: /* LUI rt, imm */ if (psx_ws_is_signed_x_bound_site(pc, insn)) cpu->gpr[rt] = (uint32_t)psx_ws_player_x_bound((int32_t)(imm << 16)); diff --git a/runtime/src/pgxp.cpp b/runtime/src/pgxp.cpp index 50a3f15b..cee86da0 100644 --- a/runtime/src/pgxp.cpp +++ b/runtime/src/pgxp.cpp @@ -419,17 +419,95 @@ static inline int halves_independent(uint32_t a, uint32_t b, uint32_t r, int sub ((lo >> 16) == 0); /* no carry/borrow out of low */ } +/* Bitwise ops (AND/OR/XOR/NOR and ANDI/ORI/XORI) move bits; they do not + * compute coordinates. GP0 decodes only the 11-bit field of each vertex half + * (bits 0..10 of X, 16..26 of Y), and engines pack clip / outcode bits into + * the rest of the word after projecting (Spider-Man ORs off-screen flags into + * bits 14/15 of each half of SXY2 before storing it). A result half whose GPU + * field equals the field of a tracked operand half therefore still describes + * that vertex. Carrying it is exact - no arithmetic, like a move - so it runs + * in both tiers. The carried value keeps the shadow invariant (integer part + * == the half read as int16): the fraction rides along, the integer becomes + * the result half. The GPU consumer rebases onto the field it decodes. */ +static inline int half_exact(const PGXPValue *pv, uint32_t value, int hi_half) { + if (!comp_tracked(pv, value, hi_half)) return 0; + int32_t v16 = hi_half ? pv->y16 : pv->x16; + /* A saturated projection shadow sits beyond the clamped word; it is not + * the value of that half and must not be carried as one. */ + return (v16 >> 16) == (int32_t)(int16_t)(hi_half ? (value >> 16) : value); +} + +static inline int carry_field(PGXPValue *dst, const PGXPValue *src, + uint32_t sval, uint32_t result, int hi_half) { + if (!half_exact(src, sval, hi_half)) return 0; + uint32_t sh = hi_half ? 16u : 0u; + if ((((sval ^ result) >> sh) & 0x7FFu) != 0) return 0; + int32_t frac = (hi_half ? src->y16 : src->x16) & 0xFFFF; + int32_t v = (int32_t)((uint32_t)(int32_t)(int16_t)(result >> sh) << 16) | frac; + if (hi_half) { dst->y16 = v; dst->flags |= PGXP_F_VY; } + else { dst->x16 = v; dst->flags |= PGXP_F_VX; } + return 1; +} + +static inline int has_depth(const PGXPValue *pv) { + return pv && pv->gen == s_gen && (pv->flags & PGXP_F_VZ) && pv->z != 0; +} + +/* Depth belongs to a whole vertex: it survives an op only when both halves of + * the result came from one operand that carried it, and the other operand is + * not itself a vertex (a constant, a mask, an offset). */ +static inline void keep_depth(PGXPValue *dst, const PGXPValue *p, + const PGXPValue *other) { + if ((dst->flags & PGXP_F_VXY) == PGXP_F_VXY && has_depth(p) && + !has_depth(other)) { + dst->z = p->z; + dst->flags |= PGXP_F_VZ; + } +} + +static void alu_bitwise(PGXPValue *dst, const PGXPValue *a, uint32_t s1, + const PGXPValue *b, uint32_t s2, uint32_t result) { + pv_reset(dst, result); + /* Prefer the operand that is a whole vertex, so a vertex ORed with flags + * keeps its depth even when the flag word happens to share a field. */ + const PGXPValue *p = a; uint32_t pval = s1; + const PGXPValue *q = b; uint32_t qval = s2; + if (!has_depth(a) && has_depth(b)) { p = b; pval = s2; q = a; qval = s1; } + const PGXPValue *from[2] = { nullptr, nullptr }; + for (int hi = 0; hi < 2; hi++) { + if (carry_field(dst, p, pval, result, hi)) from[hi] = p; + else if (carry_field(dst, q, qval, result, hi)) from[hi] = q; + else if (((hi ? result >> 16 : result) & 0xFFFFu) == 0) { + /* An exactly-zero half is an exact coordinate (the repack + * pattern ORs a shifted half into a zero half). */ + if (hi) { dst->y16 = 0; dst->flags |= PGXP_F_VY; } + else { dst->x16 = 0; dst->flags |= PGXP_F_VX; } + } + } + if (from[0] && from[0] == from[1]) + keep_depth(dst, from[0], from[0] == p ? q : p); +} + +static const PGXPValue kNoShadow = { 0, 0, 0, 0, 0, 0 }; + +/* Snapshot a source GPR shadow: the destination may alias a source (in-place + * ops such as `or t2, t2, t9` or `addiu t0, t0, 4`), and it is reset before + * the sources are read. */ +static inline const PGXPValue *gpr_shadow(uint32_t r, PGXPValue *copy) { + *copy = (r != 0) ? s_gpr[r] : kNoShadow; + return copy; +} + extern "C" void psx_pgxp_alu(struct CPUState *cpu, uint32_t instr, uint32_t result, uint32_t s1, uint32_t s2) { (void)cpu; if (!g_pgxp_active) return; uint32_t op = f_op(instr); - uint32_t dst_reg; - PGXPValue *a = nullptr, *b = nullptr; /* source shadows (may be 0) */ + PGXPValue ca, cb; if (op == 0) { /* SPECIAL */ - dst_reg = f_rd(instr); + uint32_t dst_reg = f_rd(instr); uint32_t rs = f_rs(instr), rt = f_rt(instr); uint32_t funct = f_funct(instr); if (funct == 0x11 || funct == 0x13) { /* MTHI / MTLO */ @@ -445,38 +523,31 @@ extern "C" void psx_pgxp_alu(struct CPUState *cpu, uint32_t instr, switch (funct) { case 0x10: /* MFHI */ - if (s_cpu_mode && s_gpr[PGXP_REG_HI].gen == s_gen) { - pv_validate(&s_gpr[PGXP_REG_HI], result); - *dst = s_gpr[PGXP_REG_HI]; - } else pv_reset(dst, result); - return; - case 0x12: /* MFLO */ - if (s_cpu_mode && s_gpr[PGXP_REG_LO].gen == s_gen) { - pv_validate(&s_gpr[PGXP_REG_LO], result); - *dst = s_gpr[PGXP_REG_LO]; + case 0x12: { /* MFLO */ + PGXPValue *hl = &s_gpr[funct == 0x10 ? PGXP_REG_HI : PGXP_REG_LO]; + if (s_cpu_mode && hl->gen == s_gen) { + pv_validate(hl, result); + *dst = *hl; } else pv_reset(dst, result); return; + } case 0x00: case 0x02: case 0x03: /* SLL / SRL / SRA */ case 0x04: case 0x06: case 0x07: { /* SLLV / SRLV / SRAV */ uint32_t sh = (funct < 4) ? f_shamt(instr) : (s2 & 31u); - uint32_t src_reg = rt; - PGXPValue *src = (src_reg != 0) ? &s_gpr[src_reg] : nullptr; + const PGXPValue *src = gpr_shadow(rt, &ca); int right = (funct & 3u) != 0; - if (!s_cpu_mode || sh != 16 || !src || src->gen != s_gen) { - pv_reset(dst, result); - return; - } - pv_validate(src, s1); pv_reset(dst, result); + if (!s_cpu_mode || sh != 16 || src->gen != s_gen) + return; if (!right) { /* << 16: low comp -> Y */ - if (src->flags & PGXP_F_VX) { + if (comp_tracked(src, s1, 0)) { dst->y16 = src->x16; dst->flags |= PGXP_F_VY; } dst->x16 = 0; dst->flags |= PGXP_F_VX; /* low half exactly zero */ } else { /* >> 16: high comp -> X */ - if (src->flags & PGXP_F_VY) { + if (comp_tracked(src, s1, 1)) { dst->x16 = src->y16; dst->flags |= PGXP_F_VX; } @@ -485,52 +556,36 @@ extern "C" void psx_pgxp_alu(struct CPUState *cpu, uint32_t instr, } return; } - case 0x20: case 0x21: /* ADD / ADDU */ - case 0x22: case 0x23: /* SUB / SUBU */ - case 0x25: { /* OR */ - /* MOVE idioms first — they matter even without full cpu-mode - * arithmetic, and they are exact. */ - int is_or = (funct == 0x25); - int is_sub = (funct == 0x22 || funct == 0x23); - if ((is_or || !is_sub) && rt == 0) { /* op rd, rs, $zero */ - if (rs != 0 && s_gpr[rs].gen == s_gen) { - pv_validate(&s_gpr[rs], result); - *dst = s_gpr[rs]; + case 0x24: case 0x25: case 0x26: case 0x27: { /* AND/OR/XOR/NOR */ + const PGXPValue *a = gpr_shadow(rs, &ca); + const PGXPValue *b = gpr_shadow(rt, &cb); + /* OR with $zero is the MOVE idiom: the whole shadow, depth too. */ + if (funct == 0x25 && (rs == 0 || rt == 0)) { + const PGXPValue *m = (rt == 0) ? a : b; + if (m->gen == s_gen) { + *dst = *m; + pv_validate(dst, result); } else pv_reset(dst, result); return; } - if ((is_or || !is_sub) && rs == 0) { /* op rd, $zero, rt */ - if (rt != 0 && s_gpr[rt].gen == s_gen) { - pv_validate(&s_gpr[rt], result); - *dst = s_gpr[rt]; + alu_bitwise(dst, a, s1, b, s2, result); + return; + } + case 0x20: case 0x21: /* ADD / ADDU */ + case 0x22: case 0x23: { /* SUB / SUBU */ + const PGXPValue *a = gpr_shadow(rs, &ca); + const PGXPValue *b = gpr_shadow(rt, &cb); + int is_sub = (funct == 0x22 || funct == 0x23); + /* MOVE idioms first - exact, so they run in both tiers. */ + if (rt == 0 || (!is_sub && rs == 0)) { + const PGXPValue *m = (rt == 0) ? a : b; + if (m->gen == s_gen) { + *dst = *m; + pv_validate(dst, result); } else pv_reset(dst, result); return; } if (!s_cpu_mode) { pv_reset(dst, result); return; } - a = (rs != 0) ? &s_gpr[rs] : nullptr; - b = (rt != 0) ? &s_gpr[rt] : nullptr; - if (is_or) { - /* Merge disjoint halves (the lhu/sll/or repack pattern). */ - if ((s1 & s2) != 0) { pv_reset(dst, result); return; } - pv_reset(dst, result); - const PGXPValue *xsrc; uint32_t xval; - if ((s1 & 0xFFFFu) != 0) { xsrc = a; xval = s1; } - else { xsrc = b; xval = s2; } - const PGXPValue *ysrc; uint32_t yval; - if ((s1 & 0xFFFF0000u) != 0) { ysrc = a; yval = s1; } - else { ysrc = b; yval = s2; } - if (comp_tracked(xsrc, xval, 0)) { - dst->x16 = xsrc->x16; dst->flags |= PGXP_F_VX; - } else if ((result & 0xFFFFu) == 0) { - dst->x16 = 0; dst->flags |= PGXP_F_VX; - } - if (comp_tracked(ysrc, yval, 1)) { - dst->y16 = ysrc->y16; dst->flags |= PGXP_F_VY; - } else if ((result & 0xFFFF0000u) == 0) { - dst->y16 = 0; dst->flags |= PGXP_F_VY; - } - return; - } /* add/sub: require at least one tracked component and halves * that combined independently (no cross-half carry). */ if (!halves_independent(s1, s2, result, is_sub) || @@ -545,19 +600,24 @@ extern "C" void psx_pgxp_alu(struct CPUState *cpu, uint32_t instr, dst->y16 = is_sub ? comp16(a, s1, 1) - comp16(b, s2, 1) : comp16(a, s1, 1) + comp16(b, s2, 1); dst->flags = PGXP_F_VXY; + /* A vertex plus / minus an offset is still that vertex. */ + if (comp_tracked(a, s1, 0) && comp_tracked(a, s1, 1)) + keep_depth(dst, a, b); + else if (!is_sub && comp_tracked(b, s2, 0) && comp_tracked(b, s2, 1)) + keep_depth(dst, b, a); return; } - default: + default: /* SLT/SLTU/...: not a vertex */ pv_reset(dst, result); return; } } /* immediates */ - dst_reg = f_rt(instr); + uint32_t dst_reg = f_rt(instr); if (dst_reg == 0) return; PGXPValue *dst = &s_gpr[dst_reg]; - uint32_t rs = f_rs(instr); + const PGXPValue *a = gpr_shadow(f_rs(instr), &ca); switch (op) { case 0x0F: { /* LUI: both halves exact */ @@ -570,54 +630,43 @@ extern "C" void psx_pgxp_alu(struct CPUState *cpu, uint32_t instr, case 0x08: case 0x09: { /* ADDI / ADDIU */ int32_t imm = f_simm(instr); if (imm == 0) { /* MOVE idiom */ - if (rs != 0 && s_gpr[rs].gen == s_gen) { - pv_validate(&s_gpr[rs], result); - *dst = s_gpr[rs]; + if (a->gen == s_gen) { + *dst = *a; + pv_validate(dst, result); } else pv_reset(dst, result); return; } - a = (rs != 0) ? &s_gpr[rs] : nullptr; /* A negative immediate is a subtraction of its magnitude: checking * carry on the sign-extended form would reject nearly every -N. */ - { - int neg = imm < 0; - uint32_t mag = (uint32_t)(neg ? -imm : imm); - if (!s_cpu_mode || - !halves_independent(s1, mag, result, neg) || - (!comp_tracked(a, s1, 0) && !comp_tracked(a, s1, 1))) { - pv_reset(dst, result); - return; - } - int32_t dx = (int32_t)(mag & 0xFFFFu) << 16; + int neg = imm < 0; + uint32_t mag = (uint32_t)(neg ? -imm : imm); + if (!s_cpu_mode || + !halves_independent(s1, mag, result, neg) || + (!comp_tracked(a, s1, 0) && !comp_tracked(a, s1, 1))) { pv_reset(dst, result); - dst->x16 = comp16(a, s1, 0) + (neg ? -dx : dx); - dst->y16 = comp16(a, s1, 1); /* no carry crossed: Y untouched */ - dst->flags = PGXP_F_VXY; - } - return; - } - case 0x0D: { /* ORI */ - uint32_t imm = instr & 0xFFFFu; - if (imm == 0 || (s_cpu_mode && (s1 & 0xFFFFu) == 0)) { - a = (rs != 0) ? &s_gpr[rs] : nullptr; - pv_reset(dst, result); - if (comp_tracked(a, s1, 1)) { - dst->y16 = a->y16; dst->flags |= PGXP_F_VY; - } - if (imm == 0) { - if (comp_tracked(a, s1, 0)) { - dst->x16 = a->x16; dst->flags |= PGXP_F_VX; - } - } else { /* exact constant low half */ - dst->x16 = ((int32_t)(int16_t)imm) << 16; - dst->flags |= PGXP_F_VX; - } return; } + int32_t dx = (int32_t)(mag & 0xFFFFu) << 16; pv_reset(dst, result); + dst->x16 = comp16(a, s1, 0) + (neg ? -dx : dx); + dst->y16 = comp16(a, s1, 1); /* no carry crossed: Y untouched */ + dst->flags = PGXP_F_VXY; + if (comp_tracked(a, s1, 0) && comp_tracked(a, s1, 1)) + keep_depth(dst, a, nullptr); return; } - default: /* ANDI/XORI/SLTI/... */ + case 0x0C: case 0x0D: case 0x0E: { /* ANDI / ORI / XORI */ + uint32_t imm = instr & 0xFFFFu; + alu_bitwise(dst, a, s1, nullptr, imm, result); + /* ORI into a zero low half writes an exact constant there (the + * lui/ori and repack idioms). */ + if (op == 0x0D && !(dst->flags & PGXP_F_VX) && (s1 & 0xFFFFu) == 0) { + dst->x16 = ((int32_t)(int16_t)imm) << 16; + dst->flags |= PGXP_F_VX; + } + return; + } + default: /* SLTI/SLTIU: not a vertex */ pv_reset(dst, result); return; } @@ -686,6 +735,13 @@ extern "C" void pgxp_gte_reg_written(int reg, uint32_t value) { /* GPU consumer */ /* ------------------------------------------------------------------------- */ +static inline int32_t field_rebase(int32_t v16, uint32_t half, int32_t parsed) { + int32_t as16 = (int16_t)half; + int32_t as11 = ((int32_t)(half << 21)) >> 21; + if (parsed != as11 || parsed == as16) return v16; + return (int32_t)((int64_t)v16 + ((int64_t)as11 - as16) * 65536); +} + extern "C" int pgxp_get_precise_vertex(uint32_t addr, uint32_t packet_word, int32_t int_x, int32_t int_y, int32_t *x16, int32_t *y16, @@ -717,6 +773,12 @@ extern "C" int pgxp_get_precise_vertex(uint32_t addr, uint32_t packet_word, } if (have) { + /* A shadow describes each half read as int16; GP0 decodes only its + * 11-bit field (engines keep clip / outcode bits above it). When the + * caller parsed the field, rebase the precise value onto it - the + * fraction is unchanged. Any other integer is caught below. */ + px = field_rebase(px, packet_word & 0xFFFFu, int_x); + py = field_rebase(py, packet_word >> 16, int_y); /* Truncation agreement: the GPU parsed 11-bit integers out of the * packet; a precise position whose integer part disagrees (a * wrapped/CPU-modified coordinate) must not be believed. */ diff --git a/runtime/src/psx_interpreter.c b/runtime/src/psx_interpreter.c index 340305f0..4f94d87e 100644 --- a/runtime/src/psx_interpreter.c +++ b/runtime/src/psx_interpreter.c @@ -283,13 +283,18 @@ static void exec_one(CPUState* cpu) { } case 0x23: set_reg(cpu, rd, rs_val - rt_val); psx_pgxp_alu(cpu, insn, cpu->gpr[rd], rs_val, rt_val); break; /* SUBU */ - case 0x24: set_reg(cpu, rd, rs_val & rt_val); break; /* AND */ + case 0x24: set_reg(cpu, rd, rs_val & rt_val); + psx_pgxp_alu(cpu, insn, cpu->gpr[rd], rs_val, rt_val); break; /* AND */ case 0x25: set_reg(cpu, rd, rs_val | rt_val); psx_pgxp_alu(cpu, insn, cpu->gpr[rd], rs_val, rt_val); break; /* OR */ - case 0x26: set_reg(cpu, rd, rs_val ^ rt_val); break; /* XOR */ - case 0x27: set_reg(cpu, rd, ~(rs_val | rt_val)); break; /* NOR */ - case 0x2A: set_reg(cpu, rd, (int32_t)rs_val < (int32_t)rt_val ? 1 : 0); break; /* SLT */ - case 0x2B: set_reg(cpu, rd, rs_val < rt_val ? 1 : 0); break; /* SLTU */ + case 0x26: set_reg(cpu, rd, rs_val ^ rt_val); + psx_pgxp_alu(cpu, insn, cpu->gpr[rd], rs_val, rt_val); break; /* XOR */ + case 0x27: set_reg(cpu, rd, ~(rs_val | rt_val)); + psx_pgxp_alu(cpu, insn, cpu->gpr[rd], rs_val, rt_val); break; /* NOR */ + case 0x2A: set_reg(cpu, rd, (int32_t)rs_val < (int32_t)rt_val ? 1 : 0); + psx_pgxp_alu(cpu, insn, cpu->gpr[rd], rs_val, rt_val); break; /* SLT */ + case 0x2B: set_reg(cpu, rd, rs_val < rt_val ? 1 : 0); + psx_pgxp_alu(cpu, insn, cpu->gpr[rd], rs_val, rt_val); break; /* SLTU */ default: /* R3000A ignores undefined SPECIAL encodings (no trap). */ break; @@ -363,12 +368,16 @@ static void exec_one(CPUState* cpu) { } case 0x09: set_reg(cpu, RT(insn), rs_val + (uint32_t)SIMM(insn)); psx_pgxp_alu(cpu, insn, cpu->gpr[RT(insn)], rs_val, (uint32_t)SIMM(insn)); break; /* ADDIU */ - case 0x0A: set_reg(cpu, RT(insn), (int32_t)rs_val < SIMM(insn) ? 1 : 0); break; /* SLTI */ - case 0x0B: set_reg(cpu, RT(insn), rs_val < (uint32_t)SIMM(insn) ? 1 : 0); break; /* SLTIU */ - case 0x0C: set_reg(cpu, RT(insn), rs_val & IMM16(insn)); break; /* ANDI */ + case 0x0A: set_reg(cpu, RT(insn), (int32_t)rs_val < SIMM(insn) ? 1 : 0); + psx_pgxp_alu(cpu, insn, cpu->gpr[RT(insn)], rs_val, (uint32_t)SIMM(insn)); break; /* SLTI */ + case 0x0B: set_reg(cpu, RT(insn), rs_val < (uint32_t)SIMM(insn) ? 1 : 0); + psx_pgxp_alu(cpu, insn, cpu->gpr[RT(insn)], rs_val, (uint32_t)SIMM(insn)); break; /* SLTIU */ + case 0x0C: set_reg(cpu, RT(insn), rs_val & IMM16(insn)); + psx_pgxp_alu(cpu, insn, cpu->gpr[RT(insn)], rs_val, IMM16(insn)); break; /* ANDI */ case 0x0D: set_reg(cpu, RT(insn), rs_val | IMM16(insn)); psx_pgxp_alu(cpu, insn, cpu->gpr[RT(insn)], rs_val, IMM16(insn)); break; /* ORI */ - case 0x0E: set_reg(cpu, RT(insn), rs_val ^ IMM16(insn)); break; /* XORI */ + case 0x0E: set_reg(cpu, RT(insn), rs_val ^ IMM16(insn)); + psx_pgxp_alu(cpu, insn, cpu->gpr[RT(insn)], rs_val, IMM16(insn)); break; /* XORI */ case 0x0F: set_reg(cpu, RT(insn), (uint32_t)IMM16(insn) << 16); psx_pgxp_alu(cpu, insn, cpu->gpr[RT(insn)], 0, 0); break; /* LUI */ diff --git a/runtime/tests/test_pgxp.cpp b/runtime/tests/test_pgxp.cpp index 2b022f24..8de86d08 100644 --- a/runtime/tests/test_pgxp.cpp +++ b/runtime/tests/test_pgxp.cpp @@ -63,6 +63,12 @@ static uint32_t enc_cop2(uint32_t sub, uint32_t rt, uint32_t rd) { #define SRA(rt, rd, sh) enc_r(0, rt, rd, sh, 0x03) #define OR(rs, rt, rd) enc_r(rs, rt, rd, 0, 0x25) #define ADDU(rs, rt, rd) enc_r(rs, rt, rd, 0, 0x21) +#define SUBU(rs, rt, rd) enc_r(rs, rt, rd, 0, 0x23) +#define AND(rs, rt, rd) enc_r(rs, rt, rd, 0, 0x24) +#define NOR(rs, rt, rd) enc_r(rs, rt, rd, 0, 0x27) +#define SLT(rs, rt, rd) enc_r(rs, rt, rd, 0, 0x2A) +#define ANDI(rs, rt, imm) enc_i(0x0C, rs, rt, (uint16_t)(imm)) +#define ORI(rs, rt, imm) enc_i(0x0D, rs, rt, (uint16_t)(imm)) /* One projected vertex: x = 160.5, y = 80.25 -> packed integer word. */ static const uint32_t PACKED = (80u << 16) | 160u; @@ -213,6 +219,90 @@ int main(void) { CHECK(lookup(ADDR_B, (PACKED >> 16) << 16, 0, 80, nullptr, nullptr, nullptr) == PGXP_SRC_NATIVE); + /* --- clip flags packed above the GPU field (Spider-Man 0x8007F31C): + * mfc2 t2,SXY2; subu t9,t2,t4; nor t9,t9,t5; and t2,t2,t5; or t2,t2,t9 + * ... and t2,t2,a3; or t2,t2,t9'; sw t2 + * The flag ops rewrite bits 14/15 and 30/31 of the word, never the 11-bit + * fields GP0 decodes, so the vertex (and its depth) must survive - in + * BOTH tiers, since bitwise carries are exact. --- */ + for (int mode = 0; mode < 2; mode++) { + pgxp_set_cpu_mode(mode); + const uint32_t T2 = 10, T4 = 12, T5 = 13, T9 = 25, A3 = 7; + const uint32_t bounds = (240u << 16) | 128u; /* x >= 128 -> flag */ + const uint32_t m14 = 0xBFFFBFFFu, m15 = 0x7FFF7FFFu; + pgxp_gte_push_sxy(X16, Y16, SZ3, PACKED); + psx_pgxp_cop2(nullptr, MFC2(T2, 14), PACKED, 0); + psx_pgxp_load(nullptr, LW(1, T4), 0x80180000u, bounds); /* untracked */ + psx_pgxp_alu(nullptr, LUI(T5, 0xBFFF), 0xBFFF0000u, 0, 0); + psx_pgxp_alu(nullptr, ORI(T5, T5, 0xBFFF), m14, 0xBFFF0000u, 0xBFFFu); + uint32_t d = PACKED - bounds; + psx_pgxp_alu(nullptr, SUBU(T2, T4, T9), d, PACKED, bounds); + uint32_t f = ~(d | m14); + psx_pgxp_alu(nullptr, NOR(T9, T5, T9), f, d, m14); + uint32_t w = PACKED & m14; + psx_pgxp_alu(nullptr, AND(T2, T5, T2), w, PACKED, m14); + psx_pgxp_alu(nullptr, OR(T2, T9, T2), w | f, w, f); + w |= f; + CHECK(w == (PACKED | 0x4000u)); /* x flagged */ + psx_pgxp_alu(nullptr, AND(T2, A3, T2), w & m15, w, m15); + w &= m15; + psx_pgxp_load(nullptr, LW(1, T9), 0x80180004u, 0x80000000u); + psx_pgxp_alu(nullptr, OR(T2, T9, T2), w | 0x80000000u, w, 0x80000000u); + w |= 0x80000000u; + psx_pgxp_store(nullptr, SW(1, T2), ADDR_B, w); + int32_t x, y; uint16_t z; + CHECK(lookup(ADDR_B, w, 160, 80, &x, &y, &z) == PGXP_SRC_DATAFLOW); + CHECK(x == X16 && y == Y16 && z == SZ3); + uint16_t wz = 0; + CHECK(pgxp_load_precise_word(ADDR_B, w, nullptr, nullptr, &wz) == 1); + CHECK(wz == SZ3); + } + pgxp_set_cpu_mode(0); + + /* --- in-place ops read their source before the destination is reset --- */ + pgxp_set_cpu_mode(1); + produce_at(ADDR_A); + psx_pgxp_load(nullptr, LW(1, 8), ADDR_A, PACKED); + psx_pgxp_alu(nullptr, ADDIU(8, 8, 4), PACKED + 4u, PACKED, 4u); + psx_pgxp_store(nullptr, SW(1, 8), ADDR_B, PACKED + 4u); + { + int32_t x, y; uint16_t z; + CHECK(lookup(ADDR_B, PACKED + 4u, 164, 80, &x, &y, &z) == + PGXP_SRC_DATAFLOW); + CHECK(x == X16 + (4 << 16) && y == Y16); + CHECK(z == SZ3); /* vertex + offset keeps depth */ + } + pgxp_set_cpu_mode(0); + + /* --- a mask that changes the GPU field does not carry that half --- */ + produce_at(ADDR_A); + psx_pgxp_load(nullptr, LW(1, 8), ADDR_A, PACKED); + psx_pgxp_alu(nullptr, ANDI(8, 8, 0x0080), PACKED & 0x80u, PACKED, 0x80u); + psx_pgxp_store(nullptr, SW(1, 8), ADDR_B, PACKED & 0x80u); + CHECK(lookup(ADDR_B, PACKED & 0x80u, 128, 0, nullptr, nullptr, nullptr) != + PGXP_SRC_DATAFLOW); + CHECK(pgxp_load_precise_word(ADDR_B, PACKED & 0x80u, nullptr, nullptr, + nullptr) == 0); + + /* --- a saturated projection is not that half's value: never carried --- */ + { + const uint32_t sat = (80u << 16) | 1023u; /* x clamped */ + pgxp_gte_push_sxy(2000 << 16, Y16, SZ3, sat); + psx_pgxp_cop2(nullptr, MFC2(10, 14), sat, 0); + psx_pgxp_load(nullptr, LW(1, 25), 0x80180008u, 0); /* untracked 0 */ + psx_pgxp_alu(nullptr, OR(10, 25, 10), sat, sat, 0); + psx_pgxp_store(nullptr, SW(1, 10), ADDR_B, sat); + CHECK(pgxp_load_precise_word(ADDR_B, sat, nullptr, nullptr, nullptr) == 0); + } + + /* --- SLT-family results are not vertices: the destination resets --- */ + pgxp_gte_push_sxy(X16, Y16, SZ3, PACKED); + psx_pgxp_cop2(nullptr, MFC2(10, 14), PACKED, 0); + psx_pgxp_alu(nullptr, SLT(0, 10, 10), 1u, 0, PACKED); + psx_pgxp_store(nullptr, SW(1, 10), ADDR_B, 1u); + CHECK(lookup(ADDR_B, 1u, 1, 0, nullptr, nullptr, nullptr) == + PGXP_SRC_NATIVE); + /* --- truncation agreement: integer part must match the native parse --- */ produce_at(ADDR_A); CHECK(lookup(ADDR_A, PACKED, 161, 80, nullptr, nullptr, nullptr) == From cf6ac8a580a10e2dfdb61448049374c5e2ddf4d5 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:21:53 -0700 Subject: [PATCH 32/52] Runtime tests: link gpu_timeline where needed, no-debug ring stub, guards for span replay Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/CMakeLists.txt | 1 + runtime/src/gpu.c | 1 + runtime/tests/test_gpu_gp0_history_guard.py | 7 +++++-- runtime/tests/test_interp_mod_entry_guards.py | 5 ++++- runtime/tests/test_segment_miss_wiring.py | 3 ++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 1a799d02..f139b5ec 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -255,6 +255,7 @@ if(BUILD_TESTING) tests/psx_ram_runtime_map_stubs.c src/memory.c src/dma.c + src/gpu_timeline.c src/boot_state.c src/psx_icache.c src/psx_ram_geometry.c) diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index 47d063b8..82ef3efa 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -6081,6 +6081,7 @@ static void gp0_ring_record(const uint32_t *words, int n) { (void)n; } +void gpu_gp0_ring_set_frozen(int frozen) { (void)frozen; } uint64_t gpu_gp0_ring_total(void) { return 0; } uint32_t gpu_gp0_ring_capacity(void) { return 0; } uint32_t gpu_gp0_ring_max_words(void) { return GPU_GP0_RING_MAX_WORDS; } diff --git a/runtime/tests/test_gpu_gp0_history_guard.py b/runtime/tests/test_gpu_gp0_history_guard.py index 5a98d829..bf8f2949 100644 --- a/runtime/tests/test_gpu_gp0_history_guard.py +++ b/runtime/tests/test_gpu_gp0_history_guard.py @@ -18,6 +18,7 @@ import tempfile ROOT = pathlib.Path(__file__).resolve().parents[2] GPU_C = ROOT / "runtime" / "src" / "gpu.c" +GPU_TIMELINE_C = ROOT / "runtime" / "src" / "gpu_timeline.c" DEFAULT_GCC = pathlib.Path(r"C:\msys64\mingw64\bin\gcc.exe") DRIVER_C = r""" @@ -201,6 +202,7 @@ STUBS_C = r""" #include uint64_t s_frame_count = 0; +uint64_t psx_cycle_count = 0; uint32_t g_debug_last_store_pc = 0x80012340u; uint32_t g_psx_ram_size = 0x00200000u; uint32_t g_psx_ram_mask = 0x001FFFFFu; @@ -242,8 +244,8 @@ int ws_cull_should_keep(uint32_t addr) { (void)addr; return 1; } int ws_ui_group_should_keep(uint32_t addr) { (void)addr; return 1; } uint32_t psx_mod_gpu_dma_resolve_address(uint32_t address) { return address; } void ws_ui_group_assign(WsUiGroupItem *items, size_t count, - int32_t display_width, int dense_menu) -{ (void)items; (void)count; (void)display_width; (void)dense_menu; } + int32_t display_width, int dense_menu, int in_place) +{ (void)items; (void)count; (void)display_width; (void)dense_menu; (void)in_place; } int32_t ws_ui_anchor_for_bounds(int32_t x, int32_t width, int32_t display_width) { (void)x; (void)width; return display_width / 2; } int gte_geometry_correction_enabled(void) { return 0; } @@ -436,6 +438,7 @@ def build(cc: str, work: pathlib.Path, name: str, prod: bool) -> pathlib.Path: cmd.extend([ str(work / "driver.c"), str(GPU_C), + str(GPU_TIMELINE_C), str(work / "stubs.c"), ]) if platform.system() == "Darwin": diff --git a/runtime/tests/test_interp_mod_entry_guards.py b/runtime/tests/test_interp_mod_entry_guards.py index 10ed543c..b6b6fc1a 100644 --- a/runtime/tests/test_interp_mod_entry_guards.py +++ b/runtime/tests/test_interp_mod_entry_guards.py @@ -21,7 +21,10 @@ def main(): assert source.count('psx_mod_function_entry(cpu, addr)') == 1 # Every interpreted entry reaches these calls: without an active hook they # must cost one load, never a call into the plugin table. - assert 'if (g_psx_mod_function_entry_hooks && psx_mod_function_entry(cpu, addr)) return 1;' in source + # A forced span replay (psx_mod_run_guest_span) runs inside a hook + # already: it must not re-enter the entry hooks, so the check leads. + assert ('if (!forced && g_psx_mod_function_entry_hooks && ' + 'psx_mod_function_entry(cpu, addr))\n return 1;') in source assert 'if (g_psx_mod_function_entry_hooks &&\n' in source local_start = source.index('if (allow_local_dirty_flow && target != 0 &&') local_end = source.index('current_page = target_phys >> 12;', local_start) diff --git a/runtime/tests/test_segment_miss_wiring.py b/runtime/tests/test_segment_miss_wiring.py index c4b1457f..fd0aa979 100644 --- a/runtime/tests/test_segment_miss_wiring.py +++ b/runtime/tests/test_segment_miss_wiring.py @@ -48,7 +48,8 @@ def main(): block = block[:block.index('#endif\n\n /* B-2')] assert re.search(r'clean_game_text_miss = psx_game_address_in_text\(addr\) \? 1 : 0;', block), \ 'a compiled-dispatch miss in game text no longer sets clean_game_text_miss' - hook = re.search(r'if \(clean_game_text_miss\)\s*\(void\)psx_segment_miss_note\(addr, ' + # A forced span replay interprets compiled text on purpose: not a miss. + hook = re.search(r'if \(clean_game_text_miss && !forced\)\s*\(void\)psx_segment_miss_note\(addr, ' r'psx_game_is_function_entry,\s*cpu->gpr\[31\], cpu->gpr\[29\],', block) assert hook, 'dirty_ram_dispatch_inner no longer notes segment misses on a clean-text miss' assert block.index('psx_dispatch_game_compiled(cpu, addr)') < hook.start(), \ From cf443afb3df750ed816ab7e6c5a5d6e608316c73 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:23:39 -0700 Subject: [PATCH 33/52] ws_cull_edge_interp_test: stub mod instruction hooks Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/tests/test_ws_cull_edge_interp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/tests/test_ws_cull_edge_interp.c b/runtime/tests/test_ws_cull_edge_interp.c index 09e17b5a..75df7839 100644 --- a/runtime/tests/test_ws_cull_edge_interp.c +++ b/runtime/tests/test_ws_cull_edge_interp.c @@ -47,6 +47,9 @@ uint64_t g_psx_bail_resolved; uint32_t i_stat; uint32_t i_mask; uint64_t psx_cycle_count; +/* Mod instruction hooks (mod_runtime.cpp): none installed in this test. */ +uint32_t g_psx_mod_instruction_hooks; +void psx_mod_instruction(CPUState *cpu, uint32_t addr, uint32_t insn) { (void)cpu; (void)addr; (void)insn; } /* Live RAM geometry (memory.c): retail 2 MiB, as the stub RAM below. */ uint32_t g_psx_ram_size = PSX_MAIN_RAM_RETAIL_BYTES; uint32_t g_psx_ram_mask = PSX_MAIN_RAM_RETAIL_BYTES - 1u; From 295aee77e7cbc508a71271a436927d5c2f2b60f8 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:24:16 -0700 Subject: [PATCH 34/52] overlay_pair_dedup_harness: stub psx_mod_instruction Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/tests/overlay_pair_dedup_harness.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/tests/overlay_pair_dedup_harness.c b/runtime/tests/overlay_pair_dedup_harness.c index ec25d17f..b1f570f6 100644 --- a/runtime/tests/overlay_pair_dedup_harness.c +++ b/runtime/tests/overlay_pair_dedup_harness.c @@ -191,6 +191,9 @@ int psx_mod_function_entry(CPUState *cpu, uint32_t address) { (void)cpu; (void)address; return 0; } +void psx_mod_instruction(CPUState *cpu, uint32_t address, uint32_t instruction) { + (void)cpu; (void)address; (void)instruction; +} int psx_netplay_is_resimulating(void) { return 0; } int psx_game_text_native_ok(uint32_t address) { (void)address; return 1; } uint32_t psx_ws_angle_widen(uint32_t vanilla) { return vanilla; } From 521cbeaa52e66a1491a83ff744b4b653ced0039b Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:24:34 -0700 Subject: [PATCH 35/52] gl_internal_scale_guards: flat batch queues with its backdrop gate Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/tests/test_gl_internal_scale_guards.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/tests/test_gl_internal_scale_guards.py b/runtime/tests/test_gl_internal_scale_guards.py index 0aa758cd..2945999f 100644 --- a/runtime/tests/test_gl_internal_scale_guards.py +++ b/runtime/tests/test_gl_internal_scale_guards.py @@ -102,7 +102,7 @@ class GlScaleGuards(unittest.TestCase): self.assertIn("(nverts + 2 * nl) * 6 * sizeof(float)", flush) self.assertRegex(flush, r"if \(nl\) flat_batch_draw_hr_lines\(nverts, nl\);\n" r"\s*else glDrawArrays\((GL_TRIANGLES|fmode), 0, nverts\);") - self.assertIn("hiw_enqueue_geo(s_fb, nverts, semi, mask, mirror, 0)", flush) + self.assertIn("hiw_enqueue_geo(s_fb, nverts, semi, mask, mirror, s_fb_gate)", flush) wide = flush[flush.index("wide_target_begin("):] self.assertRegex(wide, r"glDrawArrays\((GL_TRIANGLES|fmode), 0, nverts\);") hr = body(GL, "static void flat_batch_draw_hr_lines(int nverts, int nl)") @@ -143,7 +143,7 @@ class HiresWindowGuards(unittest.TestCase): for site, call in (("static void flush_tex_batch(void)", "if (hiw_on() && hiw_enqueue_tex(nverts, semi, mirror, s_tb_gate)) mirror = 0;"), ("static void flush_flat_batch(void)", - "if (hiw_on() && hiw_enqueue_geo(s_fb, nverts, semi, mask, mirror, 0)) mirror = 0;"), + "if (hiw_on() && hiw_enqueue_geo(s_fb, nverts, semi, mask, mirror, s_fb_gate)) mirror = 0;"), ("static void gpu_geometry(", "mirror = 0;")): fn = body(GL, site) self.assertIn(call, fn, site) From 8f814a37bae24ec7cab819644b0363e3f0672574 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:24:55 -0700 Subject: [PATCH 36/52] wide_overlay_band_scissor: guard the draw-area clamp in wide_band_scissor_x Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/tests/test_wide_overlay_band_scissor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/tests/test_wide_overlay_band_scissor.py b/runtime/tests/test_wide_overlay_band_scissor.py index 484147ad..dece81ac 100644 --- a/runtime/tests/test_wide_overlay_band_scissor.py +++ b/runtime/tests/test_wide_overlay_band_scissor.py @@ -21,13 +21,14 @@ def body(text, signature): gl = (src / "gpu_gl_renderer.c").read_text(encoding="utf-8") -band = body(gl, "static void wide_band_scissor(void) {") +band = body(gl, "static void wide_band_scissor_x(int x, int w) {") +assert "static void wide_band_scissor(void) { wide_band_scissor_x(0, g_wide_w); }" in gl, "GL band scissor does not cover the full wide width" assert "s_area_y1" in band and "s_area_y2" in band, "GL band scissor ignores the draw area" flat = body(gl, "static void wide_flat_rect_direct(") assert "wide_band_scissor();" in flat, "GL overlay pass does not use the band scissor" assert "VRAM_H * s_scale); /* full surface" not in flat, "GL overlay pass uses a full-height scissor" target = body(gl, "static void wide_target_begin(") -assert "wide_band_scissor();" in target, "GL wide mirror does not use the band scissor" +assert "wide_band_scissor_x(" in target, "GL wide mirror does not use the band scissor" vk = (src / "gpu_vk_renderer.c").read_text(encoding="utf-8") begin = body(vk, "static void wide_pass_begin(VkCommandBuffer cb) {") From e4b3e3d7cd76a9e052f91e36b40e38565115323f Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:25:14 -0700 Subject: [PATCH 37/52] sdl3_main_single_include: allow standalone test executables with their own main Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/tests/test_sdl3_main_single_include.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/runtime/tests/test_sdl3_main_single_include.py b/runtime/tests/test_sdl3_main_single_include.py index 6b44eec8..75836f54 100644 --- a/runtime/tests/test_sdl3_main_single_include.py +++ b/runtime/tests/test_sdl3_main_single_include.py @@ -21,9 +21,22 @@ def main() -> int: if SDL_MAIN_HEADER in source: owners.append(path.relative_to(ROOT).as_posix()) + # The header's implementation is per executable. The app's entry point is + # runtime/src/main.cpp and nothing under src/ or include/ may pull it in + # (any of those would be linked into the app next to main.cpp). A test may + # include it only as the entry-point TU of its own standalone executable: + # the file defines main() itself, and is not linked into the app. + standalone = [] + for owner in list(owners): + if owner.startswith("runtime/tests/"): + text = (ROOT / owner).read_text(encoding="utf-8") + if "int main(" in text: + standalone.append(owner) + owners.remove(owner) if owners != ["runtime/src/main.cpp"]: raise AssertionError( - "SDL_main.h must be included exactly once by runtime/src/main.cpp; " + "SDL_main.h must be included by runtime/src/main.cpp and, outside " + "tests with their own main(), nowhere else; " f"found {owners}" ) From 0aebc621d141bf2bfef17e6812419b3961b9a3a1 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:25:28 -0700 Subject: [PATCH 38/52] optional_netplay_auth: netplay-off main.cpp needs no recomp_net headers Co-Authored-By: Claude Opus 5.5 (1M context) --- recompiler/tests/test_optional_netplay_auth.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recompiler/tests/test_optional_netplay_auth.py b/recompiler/tests/test_optional_netplay_auth.py index b1073c88..783fb21e 100644 --- a/recompiler/tests/test_optional_netplay_auth.py +++ b/recompiler/tests/test_optional_netplay_auth.py @@ -30,6 +30,7 @@ def main(): (root / "recomp_net").mkdir() (root / "recomp_net/auth.h").write_text("RNET_AUTH_HEADER_INCLUDED\n") (root / "recomp_net/chat_filter.h").write_text("RNET_CHAT_HEADER_INCLUDED\n") + (root / "recomp_net/host_relay.h").write_text("RNET_RELAY_HEADER_INCLUDED\n") flags = ["RECOMP_LAUNCHER=1", "RECOMP_LAUNCHER_HAS_ACCOUNT=1", "SDL_VERSION_ATLEAST(x,y,z)=1", "DEFAULT_DEBUG_PORT=4370"] if enabled: @@ -45,9 +46,13 @@ def main(): assert p.returncode == 0, p.stderr if enabled: for token in ("RNET_AUTH_HEADER_INCLUDED", "rnet_account_pump()", - "ae_np_account_login_begin", "account_available = ae_np_account_available"): + "ae_np_account_login_begin", "account_available = ae_np_account_available", + "RNET_RELAY_HEADER_INCLUDED"): assert token in p.stdout, f"enabled path lost {token}" else: + # netplay-off builds must not need any recomp_net header + # (none exist in this include path, so -E would have failed). + assert "RNET_RELAY_HEADER_INCLUDED" not in p.stdout assert "rnet_account_" not in p.stdout, "offline launcher retained account linkage" assert "RNET_ACCOUNT_" not in p.stdout, "offline launcher retained account state dependency" # Compile the REAL offline lobby TU too: its early chat-report include From dae2493af3723b9321834836b127b065c9dd0235 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:35:39 -0700 Subject: [PATCH 39/52] overlay config hash: append mod_instruction_sites and cull_scale only when used Co-Authored-By: Claude Opus 5.5 (1M context) --- recompiler/src/config_loader.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/recompiler/src/config_loader.cpp b/recompiler/src/config_loader.cpp index 1105b210..d6816baa 100644 --- a/recompiler/src/config_loader.cpp +++ b/recompiler/src/config_loader.cpp @@ -63,7 +63,10 @@ uint32_t overlay_codegen_config_hash(const GameConfig& c) { h.words("sprite_tag_funcs", c.ws_sprite_tag_funcs); h.words("mod_function_entry_funcs", c.mod_function_entry_funcs); - h.words("mod_instruction_sites", c.mod_instruction_sites); + // Appended only when used, like the other late additions: a config that + // does not use the feature keeps the hash (and every overlay cache) it had. + if (!c.mod_instruction_sites.empty()) + h.words("mod_instruction_sites", c.mod_instruction_sites); h.words("cull_bias", c.ws_cull_bias_sites); if (!c.ws_cull_bias_lower_sites.empty()) h.words("cull_bias_lower", c.ws_cull_bias_lower_sites); @@ -133,13 +136,15 @@ uint32_t overlay_codegen_config_hash(const GameConfig& c) { std::vector scale_sites = c.ws_cull_scale_sites; std::sort(scale_sites.begin(), scale_sites.end(), [](const auto& a, const auto& b) { return a.address < b.address; }); - h.tag("cull_scale"); - h.u32((uint32_t)scale_sites.size()); - for (const auto& site : scale_sites) { - h.u32(site.address); - h.u32(site.expected); - h.u32(site.operand); - h.u32(site.half_extent); + if (!scale_sites.empty()) { // appended only when used (see above) + h.tag("cull_scale"); + h.u32((uint32_t)scale_sites.size()); + for (const auto& site : scale_sites) { + h.u32(site.address); + h.u32(site.expected); + h.u32(site.operand); + h.u32(site.half_extent); + } } std::vector angle_sites = c.ws_cull_angle_sites; From 227cb93500ea2bf067edd377f149069a18ebfbd7 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:35:39 -0700 Subject: [PATCH 40/52] PGXP: shift the SXY FIFO shadows on an SXYP write Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/src/gte.cpp | 20 ++++++++------------ runtime/src/pgxp.cpp | 26 +++++++++++++++++++++++--- runtime/tests/test_pgxp.cpp | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 15 deletions(-) diff --git a/runtime/src/gte.cpp b/runtime/src/gte.cpp index e586d8d8..bde90940 100644 --- a/runtime/src/gte.cpp +++ b/runtime/src/gte.cpp @@ -2138,10 +2138,10 @@ extern "C" void gte_write_data(CPUState* cpu, uint8_t reg, uint32_t val) { cpu->gte_data[29] = packed; } break; - /* Guest writes to the SXY FIFO drop the affected register shadows: - * we never model FIFO side effects on shadows — the shifted regs 12/13 - * now describe words their shadows no longer match, and validation - * drops those on next use. */ + /* Guest writes to the SXY FIFO: regs 12/13 overwrite their shadow, a + * reg 14 write overwrites SXY2 and its SXYP mirror, and a reg 15 + * write is the FIFO push, which pgxp_gte_reg_written applies to the + * shadows exactly as the registers move. */ case 12: case 13: cpu->gte_data[reg] = val; if (!PSXRecomp::GTE::s_gte_replay_sandbox) @@ -2150,20 +2150,16 @@ extern "C" void gte_write_data(CPUState* cpu, uint8_t reg, uint32_t val) { case 14: cpu->gte_data[14] = val; cpu->gte_data[15] = val; - if (!PSXRecomp::GTE::s_gte_replay_sandbox) { - pgxp_gte_reg_written(14, val); - pgxp_gte_reg_written(15, val); - } + if (!PSXRecomp::GTE::s_gte_replay_sandbox) + pgxp_gte_reg_written(14, val); /* resets the SXYP mirror too */ break; case 15: cpu->gte_data[12] = cpu->gte_data[13]; cpu->gte_data[13] = cpu->gte_data[14]; cpu->gte_data[14] = val; cpu->gte_data[15] = val; - if (!PSXRecomp::GTE::s_gte_replay_sandbox) { - pgxp_gte_reg_written(14, val); - pgxp_gte_reg_written(15, val); - } + if (!PSXRecomp::GTE::s_gte_replay_sandbox) + pgxp_gte_reg_written(15, val); /* FIFO push on the shadows */ break; case 28: { cpu->gte_data[9] = (val & 0x1Fu) << 7; diff --git a/runtime/src/pgxp.cpp b/runtime/src/pgxp.cpp index cee86da0..55b1bb29 100644 --- a/runtime/src/pgxp.cpp +++ b/runtime/src/pgxp.cpp @@ -206,6 +206,13 @@ static inline int32_t f_simm(uint32_t i) { return (int32_t)(int16_t)(i & 0xFFF /* Memory-mode hooks: loads / stores */ /* ------------------------------------------------------------------------- */ +/* SXY2 and SXYP are one register seen at two addresses: whichever the hook + * just filled, the other describes the same word. */ +static inline void gte_sxy2_mirror(uint32_t reg) { + if (reg == 14) s_gte[15] = s_gte[14]; + else if (reg == 15) s_gte[14] = s_gte[15]; +} + extern "C" void psx_pgxp_load(struct CPUState *cpu, uint32_t instr, uint32_t addr, uint32_t value) { (void)cpu; @@ -323,6 +330,7 @@ extern "C" void psx_pgxp_cop2(struct CPUState *cpu, uint32_t instr, } else { pv_reset(dst, value); } + gte_sxy2_mirror(f_rt(instr)); return; } case 0x3A: { /* SWC2: [addr] <- gte[rt] */ @@ -360,9 +368,9 @@ extern "C" void psx_pgxp_cop2(struct CPUState *cpu, uint32_t instr, } else { pv_reset(dst, value); } - /* An SXYP write (rd==15) shifts the hardware FIFO; we do not - * model it — regs 12..14 now describe words they no longer - * match, and validation drops them on next use. */ + /* An SXYP write (rd==15) already shifted the FIFO shadows + * (pgxp_gte_reg_written, from the GTE register write). */ + gte_sxy2_mirror(f_rd(instr)); return; } case 0x02: { /* CFC2: control regs carry no @@ -727,8 +735,20 @@ extern "C" void pgxp_gte_reg_written(int reg, uint32_t value) { * machine state back, so its writes must not stick to the shadows). */ if (s_suppress != 0) return; if (reg < 0 || reg > 31) return; + if (reg == 15) { + /* SXYP is a FIFO push: SXY1 moves to SXY0, SXY2 to SXY1, the value + * lands in SXY2 (psx-spx GTE "SXYP"). Engines draw quads from a + * projected-vertex table this way - load three corners, NCLIP, push + * the fourth through SXYP, NCLIP, store SXY0..2 into the packet - so + * the shadows shift with the registers. The MTC2 / LWC2 hook then + * copies the source shadow into the pushed slot. */ + s_gte[12] = s_gte[13]; + s_gte[13] = s_gte[14]; + reg = 14; + } pv_kill(&s_gte[reg]); pv_reset(&s_gte[reg], value); + gte_sxy2_mirror(reg); /* SXY2 and SXYP: one register */ } /* ------------------------------------------------------------------------- */ diff --git a/runtime/tests/test_pgxp.cpp b/runtime/tests/test_pgxp.cpp index 8de86d08..5001ff03 100644 --- a/runtime/tests/test_pgxp.cpp +++ b/runtime/tests/test_pgxp.cpp @@ -259,6 +259,38 @@ int main(void) { } pgxp_set_cpu_mode(0); + /* --- quad from a projected-vertex table (Spider-Man 0x8007C5D4): + * lwc2 SXY0..2 <- table; NCLIP; lwc2 SXYP <- table; NCLIP; + * swc2 SXY0..2 -> packet + * The SXYP write pushes the FIFO; the stored words are corners 1..3. --- */ + { + const uint32_t TABLE = 0x80180100u, PKT = 0x80180200u; + uint32_t words[4]; + for (uint32_t i = 0; i < 4; i++) { + words[i] = ((80u + i) << 16) | (160u + i); + pgxp_gte_push_sxy((int32_t)((160 + i) << 16) | 0x8000, + (int32_t)((80 + i) << 16) | 0x4000, + (uint16_t)(100 + i), words[i]); + psx_pgxp_cop2(nullptr, SWC2(14), words[i], TABLE + i * 4u); + } + for (uint32_t i = 0; i < 3; i++) { /* lwc2 SXY0..2 */ + pgxp_gte_reg_written((int)(12 + i), words[i]); + psx_pgxp_cop2(nullptr, enc_i(0x32, 1, 12 + i, 0), words[i], + TABLE + i * 4u); + } + pgxp_gte_reg_written(15, words[3]); /* lwc2 SXYP: push */ + psx_pgxp_cop2(nullptr, enc_i(0x32, 1, 15, 0), words[3], TABLE + 12u); + for (uint32_t i = 0; i < 3; i++) + psx_pgxp_cop2(nullptr, SWC2(12 + i), words[i + 1], PKT + i * 4u); + for (uint32_t i = 0; i < 3; i++) { + int32_t x, y; uint16_t z; + CHECK(lookup(PKT + i * 4u, words[i + 1], 161 + (int32_t)i, + 81 + (int32_t)i, &x, &y, &z) == PGXP_SRC_DATAFLOW); + CHECK(x == ((int32_t)((161 + i) << 16) | 0x8000)); + CHECK(z == 101 + i); + } + } + /* --- in-place ops read their source before the destination is reset --- */ pgxp_set_cpu_mode(1); produce_at(ADDR_A); From a408bd836896b55bb188c341d5fd3bf360665592 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 12:41:53 -0700 Subject: [PATCH 41/52] Render passes: roll precision-tracking shadows back with the machine Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/include/pgxp.h | 6 ++ runtime/src/gte.cpp | 71 +++++++++++++ runtime/src/pgxp.cpp | 122 ++++++++++++++++++++++- runtime/src/render_pass.c | 6 ++ runtime/tests/test_pgxp.cpp | 28 ++++++ runtime/tests/test_render_pass_abort.c | 8 ++ runtime/tests/test_render_pass_sandbox.c | 4 + 7 files changed, 240 insertions(+), 5 deletions(-) diff --git a/runtime/include/pgxp.h b/runtime/include/pgxp.h index 291d90cd..3eceb809 100644 --- a/runtime/include/pgxp.h +++ b/runtime/include/pgxp.h @@ -127,6 +127,12 @@ void pgxp_store_gte_reg(uint32_t addr, uint8_t reg); int pgxp_load_precise_word(uint32_t addr, uint32_t packed, int32_t *x16, int32_t *y16, uint16_t *z); +/* Render-pass checkpoint: journal every shadow a sandboxed pass mutates and + * put the shadows back when the sandbox restores the machine. Use through + * gte_precision_checkpoint_begin / _rollback (which also cover gte.cpp). */ +void pgxp_checkpoint_begin(void); +void pgxp_checkpoint_rollback(void); + /* Refused precise-word lookups, newest at (seq - 1) % cap (TCP pgxp_miss_ring). */ enum { PGXP_MISS_UNTRACKED = 1, diff --git a/runtime/src/gte.cpp b/runtime/src/gte.cpp index bde90940..75c7036e 100644 --- a/runtime/src/gte.cpp +++ b/runtime/src/gte.cpp @@ -372,6 +372,76 @@ extern "C" int gte_geometry_correction_lookup(uint32_t packed, return 1; } +/* Render-pass checkpoint for the gte.cpp side of precision tracking: the + * position cache entries a pass writes are journaled and put back, and the + * speculative bracket depth is restored (a watchdog abort can leave one open). + * The PGXP shadows roll back through pgxp_checkpoint_*. */ +struct GeomJournalEntry { GeomVertex *slot; GeomVertex old; }; +static uint32_t s_gck_depth = 0; +static GeomJournalEntry *s_gck_log = nullptr; +static size_t s_gck_n = 0, s_gck_cap = 0; +static int s_gck_lossy = 0; +static uint32_t s_gck_generation = 0; +static GeomVertex *s_gck_cache = nullptr; +static uint32_t s_gck_spec_depth = 0; +static int s_gck_spec_invalidated = 0; + +static uint8_t *s_gck_bits = nullptr; /* one bit per cache slot */ + +static inline void geom_ck_note(GeomVertex *slot) { + if (s_gck_depth == 0) return; + if (s_geom_cache != s_gck_cache || !s_gck_bits) { s_gck_lossy = 1; return; } + size_t i = (size_t)(slot - s_geom_cache); + uint8_t bit = (uint8_t)(1u << (i & 7u)); + if (s_gck_bits[i >> 3] & bit) return; /* journaled this pass */ + if (s_gck_n == s_gck_cap) { + size_t cap = s_gck_cap ? s_gck_cap * 2 : 16384; + GeomJournalEntry *p = (GeomJournalEntry *)std::realloc( + s_gck_log, cap * sizeof *p); + if (!p) { s_gck_lossy = 1; return; } + s_gck_log = p; + s_gck_cap = cap; + } + s_gck_bits[i >> 3] |= bit; + s_gck_log[s_gck_n].slot = slot; + s_gck_log[s_gck_n].old = *slot; + s_gck_n++; +} + +extern "C" void gte_precision_checkpoint_begin(void) { + pgxp_checkpoint_begin(); + if (s_gck_depth++ != 0) return; + if (s_geom_cache && !s_gck_bits) + s_gck_bits = (uint8_t *)std::calloc(GEOM_CACHE_SIZE / 8u, 1); + s_gck_n = 0; + s_gck_generation = s_geom_generation; + s_gck_cache = s_geom_cache; + s_gck_spec_depth = s_speculative_depth; + s_gck_spec_invalidated = s_speculative_timeline_invalidated; +} + +extern "C" void gte_precision_checkpoint_rollback(void) { + if (s_gck_depth != 0 && --s_gck_depth == 0) { + for (size_t i = s_gck_n; i-- > 0;) { + GeomVertex *slot = s_gck_log[i].slot; + *slot = s_gck_log[i].old; + size_t k = (size_t)(slot - s_gck_cache); + s_gck_bits[k >> 3] &= (uint8_t)~(1u << (k & 7u)); + } + s_gck_n = 0; + s_speculative_depth = s_gck_spec_depth; + s_speculative_timeline_invalidated = s_gck_spec_invalidated; + if (s_gck_lossy || s_geom_cache != s_gck_cache || + s_geom_generation < s_gck_generation) { + s_gck_lossy = 0; + gte_geom_generation_advance(); /* fail closed */ + } else { + s_geom_generation = s_gck_generation; + } + } + pgxp_checkpoint_rollback(); +} + static inline void geom_note(uint32_t packed, int64_t x16, int64_t y16) { if (s_speculative_depth != 0 || s_gte_replay_sandbox || !s_geom_enabled || !s_geom_cache) return; @@ -382,6 +452,7 @@ static inline void geom_note(uint32_t packed, int64_t x16, int64_t y16) { int64_t slot = geom_slot(packed); if (slot < 0) return; GeomVertex &entry = s_geom_cache[slot]; + geom_ck_note(&entry); if (entry.generation == s_geom_generation) { /* Already occupied this generation: only flag ambiguity if the stored * sub-pixel position actually DIFFERS — re-projecting the same vertex diff --git a/runtime/src/pgxp.cpp b/runtime/src/pgxp.cpp index 55b1bb29..a092997b 100644 --- a/runtime/src/pgxp.cpp +++ b/runtime/src/pgxp.cpp @@ -93,9 +93,12 @@ static PGXPStats s_stats; /* Lifecycle */ /* ------------------------------------------------------------------------- */ +static void ck_wrapped(void); + extern "C" void pgxp_invalidate_all(void) { if (s_suppress != 0) { s_deferred_invalidate = 1; return; } if (++s_gen == 0) { + ck_wrapped(); /* generation wrapped: physically clear so stale slots can't revive */ if (s_ram) std::memset(s_ram, 0, PGXP_RAM_WORDS * sizeof(PGXPValue)); std::memset(s_scratch, 0, sizeof(s_scratch)); @@ -163,6 +166,115 @@ static inline PGXPValue *pgxp_ptr(uint32_t addr) { return nullptr; } +/* ------------------------------------------------------------------------- */ +/* Checkpoint (render passes) */ +/* ------------------------------------------------------------------------- */ + +/* A render pass (render_pass.c) runs guest draw code on a sandboxed machine + * and puts RAM, scratchpad and registers back with raw copies afterwards. The + * shadows must roll back with them: otherwise they describe the words the + * pass wrote (interpolated vertices), and the live frame's packets - consumed + * after the passes - fail validation. Copying the shadow arrays whole per + * pass would cost tens of MB; instead every RAM / scratchpad slot a pass + * mutates is journaled on its first write, and register shadows (small) are + * copied whole. A journal that cannot grow, or a generation wrap during the + * pass, fails closed: rollback invalidates everything. */ +struct PGXPJournalEntry { + PGXPValue *slot; + PGXPValue old; +}; + +static uint32_t s_ck_depth = 0; +static uint8_t *s_ck_bits = nullptr; /* one bit per shadow slot */ +static PGXPValue *s_ck_ram = nullptr; /* s_ram the bits index */ +static PGXPJournalEntry *s_ck_log = nullptr; +static size_t s_ck_n = 0, s_ck_cap = 0; +static int s_ck_lossy = 0; +static PGXPValue s_ck_gpr[34], s_ck_gte[32]; +static uint32_t s_ck_gen = 0, s_ck_suppress = 0; +static int s_ck_deferred = 0; + +static inline size_t ck_index(const PGXPValue *pv) { + if (pv >= s_scratch && pv < s_scratch + PGXP_SCRATCH_WORDS) + return (size_t)PGXP_RAM_WORDS + (size_t)(pv - s_scratch); + return (size_t)(pv - s_ram); +} + +/* Journal a RAM / scratchpad slot before its first mutation in a pass. */ +static inline void ck_note(PGXPValue *pv) { + if (s_ck_depth == 0 || !pv) return; + if (s_ram != s_ck_ram && !(pv >= s_scratch && + pv < s_scratch + PGXP_SCRATCH_WORDS)) { + s_ck_lossy = 1; /* shadow RAM appeared mid-pass */ + return; + } + size_t i = ck_index(pv); + uint8_t bit = (uint8_t)(1u << (i & 7u)); + if (s_ck_bits[i >> 3] & bit) return; + if (s_ck_n == s_ck_cap) { + size_t cap = s_ck_cap ? s_ck_cap * 2 : 65536; + PGXPJournalEntry *p = (PGXPJournalEntry *)std::realloc( + s_ck_log, cap * sizeof *p); + if (!p) { s_ck_lossy = 1; return; } + s_ck_log = p; + s_ck_cap = cap; + } + s_ck_bits[i >> 3] |= bit; + s_ck_log[s_ck_n].slot = pv; + s_ck_log[s_ck_n].old = *pv; + s_ck_n++; +} + +static void ck_wrapped(void) { + if (s_ck_depth != 0) s_ck_lossy = 1; /* shadows were cleared */ +} + +static inline PGXPValue *pgxp_ptr_w(uint32_t addr) { + PGXPValue *pv = pgxp_ptr(addr); + ck_note(pv); + return pv; +} + +extern "C" void pgxp_checkpoint_begin(void) { + if (s_ck_depth++ != 0) return; /* the outermost pass journals */ + if (!s_ck_bits) { + s_ck_bits = (uint8_t *)std::calloc( + ((size_t)PGXP_RAM_WORDS + PGXP_SCRATCH_WORDS + 7u) / 8u, 1); + if (!s_ck_bits) s_ck_lossy = 1; + } + s_ck_ram = s_ram; + s_ck_n = 0; + std::memcpy(s_ck_gpr, s_gpr, sizeof s_gpr); + std::memcpy(s_ck_gte, s_gte, sizeof s_gte); + s_ck_gen = s_gen; + s_ck_suppress = s_suppress; + s_ck_deferred = s_deferred_invalidate; +} + +extern "C" void pgxp_checkpoint_rollback(void) { + if (s_ck_depth == 0) return; + if (--s_ck_depth != 0) return; + for (size_t i = s_ck_n; i-- > 0;) { + PGXPJournalEntry *e = &s_ck_log[i]; + *e->slot = e->old; + size_t k = ck_index(e->slot); + s_ck_bits[k >> 3] &= (uint8_t)~(1u << (k & 7u)); + } + s_ck_n = 0; + std::memcpy(s_gpr, s_ck_gpr, sizeof s_gpr); + std::memcpy(s_gte, s_ck_gte, sizeof s_gte); + s_gen = s_ck_gen; + /* A watchdog abort can leave a suppress bracket open: the machine it + * interrupted is gone, so its bracket is too. */ + s_suppress = s_ck_suppress; + s_deferred_invalidate = s_ck_deferred; + recompute_active(); + if (s_ck_lossy || s_ram != s_ck_ram) { + s_ck_lossy = 0; + pgxp_invalidate_all(); + } +} + static inline int pv_live(const PGXPValue *pv) { return pv && pv->gen == s_gen && (pv->flags & PGXP_F_VXY) != 0; } @@ -223,7 +335,7 @@ extern "C" void psx_pgxp_load(struct CPUState *cpu, uint32_t instr, switch (f_op(instr)) { case 0x23: { /* LW */ - PGXPValue *src = pgxp_ptr(addr); + PGXPValue *src = pgxp_ptr_w(addr); /* validation may mutate it */ if (src && src->gen == s_gen) { pv_validate(src, value); *dst = *src; @@ -263,7 +375,7 @@ extern "C" void psx_pgxp_store(struct CPUState *cpu, uint32_t instr, uint32_t addr, uint32_t value) { (void)cpu; if (!g_pgxp_active) return; - PGXPValue *dst = pgxp_ptr(addr); + PGXPValue *dst = pgxp_ptr_w(addr); if (!dst) return; uint32_t rt = f_rt(instr); PGXPValue *src = (rt != 0) ? &s_gpr[rt] : nullptr; @@ -322,7 +434,7 @@ extern "C" void psx_pgxp_cop2(struct CPUState *cpu, uint32_t instr, switch (f_op(instr)) { case 0x32: { /* LWC2: gte[rt] <- [addr] */ - PGXPValue *src = pgxp_ptr(addr); + PGXPValue *src = pgxp_ptr_w(addr); /* validation may mutate it */ PGXPValue *dst = &s_gte[f_rt(instr)]; if (src && src->gen == s_gen) { pv_validate(src, value); @@ -334,7 +446,7 @@ extern "C" void psx_pgxp_cop2(struct CPUState *cpu, uint32_t instr, return; } case 0x3A: { /* SWC2: [addr] <- gte[rt] */ - PGXPValue *dst = pgxp_ptr(addr); + PGXPValue *dst = pgxp_ptr_w(addr); if (!dst) return; PGXPValue *src = &s_gte[f_rt(instr)]; if (src->gen == s_gen) { @@ -841,7 +953,7 @@ extern "C" int pgxp_get_precise_vertex(uint32_t addr, uint32_t packet_word, * the double write is idempotent (same source shadow, same destination). */ extern "C" void pgxp_store_gte_reg(uint32_t addr, uint8_t reg) { if (!g_pgxp_active) return; - PGXPValue *dst = pgxp_ptr(addr); + PGXPValue *dst = pgxp_ptr_w(addr); if (!dst) return; const PGXPValue *src = &s_gte[reg & 31u]; if (src->gen != s_gen) return; diff --git a/runtime/src/render_pass.c b/runtime/src/render_pass.c index c287993b..39547986 100644 --- a/runtime/src/render_pass.c +++ b/runtime/src/render_pass.c @@ -40,6 +40,10 @@ extern uint8_t *memory_get_scratchpad_ptr(void); extern uint32_t memory_get_ram_bytes(void); extern uint32_t i_stat; extern uint32_t i_mask; +/* gte.cpp: precision-tracking shadows (PGXP + the position cache) roll back + * with the machine, or they describe the words a pass wrote. */ +extern void gte_precision_checkpoint_begin(void); +extern void gte_precision_checkpoint_rollback(void); extern uint32_t dma_snapshot_bytes(void); extern void dma_snapshot_write(uint8_t *p); extern int dma_snapshot_read(const uint8_t *p, uint32_t len); @@ -450,6 +454,7 @@ static int checkpoint_save(const CPUState *cpu) { s_ck.call_bail = g_psx_call_bail; memset(&s_ck.nest, 0, sizeof s_ck.nest); nesting_save(&s_ck.nest); + gte_precision_checkpoint_begin(); return 1; } @@ -473,6 +478,7 @@ static void checkpoint_restore(CPUState *cpu) { g_psx_dispatch_depth = s_ck.dispatch_depth; g_psx_call_bail = s_ck.call_bail; nesting_restore(&s_ck.nest); + gte_precision_checkpoint_rollback(); } static double s_ms_per_tick = 0.0; diff --git a/runtime/tests/test_pgxp.cpp b/runtime/tests/test_pgxp.cpp index 5001ff03..5c70e66e 100644 --- a/runtime/tests/test_pgxp.cpp +++ b/runtime/tests/test_pgxp.cpp @@ -291,6 +291,34 @@ int main(void) { } } + /* --- render-pass checkpoint: a sandboxed pass rewrites a packet word + * (raw-restored afterwards); the shadow must come back with it --- */ + { + const uint32_t other = (90u << 16) | 170u; + produce_at(ADDR_A); + pgxp_checkpoint_begin(); + pgxp_gte_push_sxy((170 << 16) | 0x1000, (90 << 16) | 0x2000, 7, other); + psx_pgxp_cop2(nullptr, SWC2(14), other, ADDR_A); + CHECK(lookup(ADDR_A, other, 170, 90, nullptr, nullptr, nullptr) == + PGXP_SRC_DATAFLOW); /* the pass sees its own word */ + pgxp_invalidate_all(); /* undone by the rollback */ + pgxp_suppress_begin(); /* left open by an abort */ + pgxp_checkpoint_rollback(); + CHECK(pgxp_test_suppress_depth() == 0); + CHECK(pgxp_test_active()); + int32_t x, y; uint16_t z; + CHECK(lookup(ADDR_A, PACKED, 160, 80, &x, &y, &z) == PGXP_SRC_DATAFLOW); + CHECK(x == X16 && y == Y16 && z == SZ3); + /* a generation wrap inside the pass cannot be undone: fail closed */ + produce_at(ADDR_A); + pgxp_checkpoint_begin(); + pgxp_test_set_generation(0xFFFFFFFFu); + pgxp_invalidate_all(); + pgxp_checkpoint_rollback(); + CHECK(lookup(ADDR_A, PACKED, 160, 80, nullptr, nullptr, nullptr) == + PGXP_SRC_NATIVE); + } + /* --- in-place ops read their source before the destination is reset --- */ pgxp_set_cpu_mode(1); produce_at(ADDR_A); diff --git a/runtime/tests/test_render_pass_abort.c b/runtime/tests/test_render_pass_abort.c index 36673d48..aafdc8ea 100644 --- a/runtime/tests/test_render_pass_abort.c +++ b/runtime/tests/test_render_pass_abort.c @@ -136,6 +136,12 @@ void overlay_loader_set_native_nesting(int d, uint32_t ip) { s_ov_active_depth = d; s_ov_inprogress = ip; } +/* Precision-tracking checkpoint (gte.cpp): every pass opens one and every + * restore - including the watchdog landing - closes it. */ +static int s_prec_open, s_prec_begins; +void gte_precision_checkpoint_begin(void) { s_prec_open++; s_prec_begins++; } +void gte_precision_checkpoint_rollback(void) { s_prec_open--; } + /* GPU and presenter. */ uint64_t gpu_pass_state_hash(void) { return 42; } int gpu_pass_checkpoint_save(void) { return 1; } @@ -434,6 +440,8 @@ int main(void) { CHECK(st.watchdog == 2, "the watchdog cut the span off"); CHECK(s_span_hi == 0 && s_span_lo == 0, "the abort closed the open span"); check_live(&live, "after a span watchdog abort"); + CHECK(s_prec_begins > 0 && s_prec_open == 0, + "precision shadows were checkpointed and rolled back on every pass, aborts included"); printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); return failures ? 1 : 0; diff --git a/runtime/tests/test_render_pass_sandbox.c b/runtime/tests/test_render_pass_sandbox.c index ceb99fca..d447cae1 100644 --- a/runtime/tests/test_render_pass_sandbox.c +++ b/runtime/tests/test_render_pass_sandbox.c @@ -185,6 +185,9 @@ int dirty_ram_run_span(CPUState *cpu, uint32_t start, uint32_t stop, uint64_t ma } void overlay_loader_native_nesting(int *d, uint32_t *ip) { *d = 0; *ip = 0; } void overlay_loader_set_native_nesting(int d, uint32_t ip) { (void)d; (void)ip; } +static int s_prec_open; +void gte_precision_checkpoint_begin(void) { s_prec_open++; } +void gte_precision_checkpoint_rollback(void) { s_prec_open--; } /* GPU and presenter. */ uint64_t gpu_pass_state_hash(void) { return 42; } @@ -571,6 +574,7 @@ int main(void) { test_pass(); test_ram_8mb(); test_journal(); + CHECK(s_prec_open == 0, "precision checkpoints balanced"); printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); return failures ? 1 : 0; } From 9c1e716a61e0b01bbcd4e6d50f4940dfc1829895 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Fri, 2 Oct 2026 18:05:59 -0700 Subject: [PATCH 42/52] Preserve PGXP mod selection through renderer initialization --- docs/MOD_PACKAGES.md | 7 ++++++ runtime/CMakeLists.txt | 3 +++ runtime/include/mod_pgxp_policy.h | 28 ++++++++++++++++++++++ runtime/include/mod_plugins.h | 6 +++++ runtime/src/main.cpp | 35 ++++++++++++++++++++-------- runtime/src/mod_builtin_pgxp.c | 8 +------ runtime/tests/test_mod_pgxp_policy.c | 34 +++++++++++++++++++++++++++ 7 files changed, 104 insertions(+), 17 deletions(-) create mode 100644 runtime/include/mod_pgxp_policy.h create mode 100644 runtime/tests/test_mod_pgxp_policy.c diff --git a/docs/MOD_PACKAGES.md b/docs/MOD_PACKAGES.md index c6e5aedd..dd91fdd2 100644 --- a/docs/MOD_PACKAGES.md +++ b/docs/MOD_PACKAGES.md @@ -733,6 +733,13 @@ some selections of one feature is a `[[requirement]]`, not a dependency. ## Implicit requirements across packages +The shared PGXP plugin uses `psx_mod_set_pgxp_precision(enabled, cpu_mode)`. +This stores a session selection as well as setting live correction flags, so +later renderer initialization cannot erase mod activation with the base video +settings. Session start clears the selection before activating the new plan; +the player's persistent settings remain unchanged. Explicit validation +environment overrides still take precedence at renderer initialization. + Package format 7 lets a feature, while a condition on its own options holds, need a feature of **another** package: diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index f139b5ec..07c58bcd 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -46,6 +46,9 @@ if(BUILD_TESTING) add_executable(mod_session_baseline_test tests/test_mod_session_baseline.c) target_include_directories(mod_session_baseline_test PRIVATE include) add_test(NAME mod_session_baseline_test COMMAND mod_session_baseline_test) + add_executable(mod_pgxp_policy_test tests/test_mod_pgxp_policy.c) + target_include_directories(mod_pgxp_policy_test PRIVATE include) + add_test(NAME mod_pgxp_policy_test COMMAND mod_pgxp_policy_test) # Netplay: libjuice resolves from third_party/ with the network sealed, # and a recomp-net pinning another libjuice stops the configure. foreach(_psx_juice_case same other) diff --git a/runtime/include/mod_pgxp_policy.h b/runtime/include/mod_pgxp_policy.h new file mode 100644 index 00000000..7f7130af --- /dev/null +++ b/runtime/include/mod_pgxp_policy.h @@ -0,0 +1,28 @@ +#ifndef PSX_MOD_PGXP_POLICY_H +#define PSX_MOD_PGXP_POLICY_H + +/* Session overrides are independent of the player's persistent video config. + * Renderer initialization resolves them again after activation, because GTE + * and GPU initialization may reset the live correction flags. */ +typedef struct PSXModPgxpConfig { + int geometry, textures, cpu; +} PSXModPgxpConfig; +typedef struct PSXModPgxpPolicy { + int enabled, cpu; /* -1: no mod selection */ +} PSXModPgxpPolicy; +static inline void psx_mod_pgxp_reset(PSXModPgxpPolicy* policy) { + policy->enabled = policy->cpu = -1; +} +static inline void psx_mod_pgxp_select(PSXModPgxpPolicy* policy, int enabled, int cpu) { + policy->enabled = enabled != 0; + policy->cpu = cpu != 0; +} +static inline PSXModPgxpConfig psx_mod_pgxp_resolve( + const PSXModPgxpPolicy* policy, PSXModPgxpConfig base) { + if (policy->enabled >= 0) { + base.geometry = base.textures = policy->enabled; + base.cpu = policy->cpu; + } + return base; +} +#endif diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index b380e94d..f051f0f8 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -138,6 +138,12 @@ uint32_t psx_mod_alloc_gpu_dma_memory(uint32_t size, uint32_t alignment); */ int psx_mod_set_main_ram_8mb(int enabled); +/* Session-owned precision selection, applied immediately and retained across + * renderer initialization. Disabling a mod restores the player's base config + * at the next session; explicit debug environment overrides still take priority. + * Does not modify persistent settings or architectural GTE state. */ +void psx_mod_set_pgxp_precision(int enabled, int cpu_mode); + /* Current per-side widescreen reveal in native game pixels (zero at 4:3). */ int32_t psx_mod_widescreen_x_margin(void); diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index af600119..9876f664 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -94,6 +94,7 @@ extern "C" void psx_event_step_conservative_env_init(void); #include "game_options.h" #include "mod_plugins.h" #include "mod_session_baseline.h" +#include "mod_pgxp_policy.h" #include "mod_runtime.h" #include "mod_packages.h" #include "present_image_ring.h" @@ -1245,6 +1246,14 @@ static int g_video_geometry_correction = 0; static int g_video_perspective_texturing = 0; static int g_video_pgxp_cpu_mode = 0; static float g_video_pgxp_tolerance = 0.5f; +static PSXModPgxpPolicy g_mod_pgxp_policy = {-1, -1}; + +extern "C" void psx_mod_set_pgxp_precision(int enabled, int cpu_mode) { + psx_mod_pgxp_select(&g_mod_pgxp_policy, enabled, cpu_mode); + gte_geometry_correction_set(enabled != 0); + gpu_texture_correction_set(enabled != 0); + pgxp_set_cpu_mode(cpu_mode != 0); +} static int g_video_renderer = PSXRecompV4::DEFAULT_VIDEO_RENDERER; /* Settings -> Display -> Internal resolution (internal_resolution.h). The @@ -1533,6 +1542,10 @@ extern "C" int psx_mod_set_adaptive_display_aspect( static PSXModSessionBaseline g_mod_owned_baseline; static void reset_mod_owned_presentation(void) { + psx_mod_pgxp_reset(&g_mod_pgxp_policy); + gte_geometry_correction_set(g_video_geometry_correction); + gpu_texture_correction_set(g_video_perspective_texturing); + pgxp_set_cpu_mode(g_video_pgxp_cpu_mode); PSXModSessionScalars live; live.video_vsync = g_video_vsync; live.frame_interpolation = g_frame_interpolation; @@ -15933,15 +15946,17 @@ session_reboot: * corrections from process start so free-running (headless) boots can be * measured from the first projected vertex — a TCP toggle always arrives * after the interesting window. '0' = off, anything else = on. */ + PSXModPgxpConfig precision = psx_mod_pgxp_resolve(&g_mod_pgxp_policy, + {g_video_geometry_correction, g_video_perspective_texturing, g_video_pgxp_cpu_mode}); if (const char* e = std::getenv("PSX_GEOMETRY_CORRECTION")) - g_video_geometry_correction = (*e && *e != '0') ? 1 : 0; + precision.geometry = (*e && *e != '0') ? 1 : 0; if (const char* e = std::getenv("PSX_PERSPECTIVE_TEXTURING")) - g_video_perspective_texturing = (*e && *e != '0') ? 1 : 0; + precision.textures = (*e && *e != '0') ? 1 : 0; if (const char* e = std::getenv("PSX_PGXP_CPU_MODE")) - g_video_pgxp_cpu_mode = (*e && *e != '0') ? 1 : 0; - gte_geometry_correction_set(g_video_geometry_correction); - gpu_texture_correction_set(g_video_perspective_texturing); - pgxp_set_cpu_mode(g_video_pgxp_cpu_mode); + precision.cpu = (*e && *e != '0') ? 1 : 0; + gte_geometry_correction_set(precision.geometry); + gpu_texture_correction_set(precision.textures); + pgxp_set_cpu_mode(precision.cpu); pgxp_set_tolerance(g_video_pgxp_tolerance); /* Scanlines: env override wins over config, same as the corrections above, * so a headless/free-run boot can be captured with the effect armed from the @@ -15955,12 +15970,12 @@ session_reboot: } gl_renderer_set_scanlines(g_video_scanlines ? 1 : 0, g_video_scanline_strength); - if (g_video_geometry_correction || g_video_perspective_texturing) { + if (precision.geometry || precision.textures) { std::fprintf(stdout, "psxrecomp: geometry correction %s, perspective texturing %s%s\n", - g_video_geometry_correction ? "on" : "off", - g_video_perspective_texturing ? "on" : "off", - (g_video_geometry_correction && requested_scale < 2) + precision.geometry ? "on" : "off", + precision.textures ? "on" : "off", + (precision.geometry && requested_scale < 2) ? " (needs [video] supersampling >= 2 to be visible)" : ""); } /* Display aspect. Identity at the default 4:3. The present letterbox uses diff --git a/runtime/src/mod_builtin_pgxp.c b/runtime/src/mod_builtin_pgxp.c index f0b25755..f53b7519 100644 --- a/runtime/src/mod_builtin_pgxp.c +++ b/runtime/src/mod_builtin_pgxp.c @@ -21,10 +21,6 @@ #define PKG_PGXP "psx.enhancement.pgxp" -/* gte.cpp / gpu.c — the two correction toggles this mod arms. */ -extern void gte_geometry_correction_set(int enabled); -extern void gpu_texture_correction_set(int enabled); - static int pgxp_option_flag(const char* feature, const char* id) { char text[16] = ""; return psx_mod_option_value(PKG_PGXP, feature, id, text, sizeof text) && @@ -32,9 +28,7 @@ static int pgxp_option_flag(const char* feature, const char* id) { } static void builtin_pgxp_activate(void) { - gte_geometry_correction_set(1); - gpu_texture_correction_set(1); /* also arms the shadow engine */ - pgxp_set_cpu_mode(pgxp_option_flag("pgxp", "cpu_mode")); + psx_mod_set_pgxp_precision(1, pgxp_option_flag("pgxp", "cpu_mode")); } PSX_MOD_CONSTRUCTOR(psx_register_builtin_pgxp_plugin) { diff --git a/runtime/tests/test_mod_pgxp_policy.c b/runtime/tests/test_mod_pgxp_policy.c new file mode 100644 index 00000000..3197f8bb --- /dev/null +++ b/runtime/tests/test_mod_pgxp_policy.c @@ -0,0 +1,34 @@ +#include "mod_pgxp_policy.h" +#include +#include + +int main(void) { + PSXModPgxpPolicy policy; + PSXModPgxpConfig configured = {0, 0, 1}; + psx_mod_pgxp_reset(&policy); + PSXModPgxpConfig live = psx_mod_pgxp_resolve(&policy, configured); + assert(!live.geometry && !live.textures && live.cpu); + + /* Activation before renderer initialization must survive re-resolution. */ + psx_mod_pgxp_select(&policy, 1, 0); + live = psx_mod_pgxp_resolve(&policy, configured); + assert(live.geometry && live.textures && !live.cpu); + assert(!configured.geometry && !configured.textures && configured.cpu); + + /* A later vanilla/netplay session inherits the player's config only. */ + psx_mod_pgxp_reset(&policy); + live = psx_mod_pgxp_resolve(&policy, configured); + assert(!live.geometry && !live.textures && live.cpu); + configured.geometry = 1; + live = psx_mod_pgxp_resolve(&policy, configured); + assert(live.geometry && !live.textures && live.cpu); + + psx_mod_pgxp_select(&policy, 0, 1); + live = psx_mod_pgxp_resolve(&policy, configured); + assert(!live.geometry && !live.textures && live.cpu); + psx_mod_pgxp_select(&policy, 1, 1); + live = psx_mod_pgxp_resolve(&policy, configured); + assert(live.geometry && live.textures && live.cpu); + puts("PGXP session policy passed"); + return 0; +} From 5f780a8e5eb7b9fe3ed415d939803f9591412bd1 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sat, 3 Oct 2026 11:12:09 -0700 Subject: [PATCH 43/52] Add native draw replay and projection interpolation; fix foreground wall classification --- docs/internal/FAITHFUL_TIMING_PLAN.md | 7 + recompiler/src/code_generator.cpp | 2 +- runtime/include/render_pass_plan.h | 4 +- runtime/include/render_pass_projection.h | 32 +++ runtime/include/render_pass_replay.hpp | 84 ++++++++ runtime/runtime.cmake | 1 + runtime/src/dirty_ram_interp.c | 4 +- runtime/src/gpu.c | 25 ++- runtime/src/gte.cpp | 8 + runtime/src/main.cpp | 9 +- runtime/src/mod_runtime.cpp | 3 + runtime/src/render_pass_projection.cpp | 185 ++++++++++++++++++ runtime/tests/gpu_exec_stubs.inc | 3 + runtime/tests/test_gte_register_access.cpp | 53 +++++ runtime/tests/test_mod_runtime.cpp | 2 + runtime/tests/test_render_pass_sandbox.c | 22 +++ .../tests/test_ws_auto_ui_untextured_exec.c | 51 +++++ 17 files changed, 474 insertions(+), 21 deletions(-) create mode 100644 runtime/include/render_pass_projection.h create mode 100644 runtime/include/render_pass_replay.hpp create mode 100644 runtime/src/render_pass_projection.cpp diff --git a/docs/internal/FAITHFUL_TIMING_PLAN.md b/docs/internal/FAITHFUL_TIMING_PLAN.md index b5e5de62..b61ce465 100644 --- a/docs/internal/FAITHFUL_TIMING_PLAN.md +++ b/docs/internal/FAITHFUL_TIMING_PLAN.md @@ -213,6 +213,13 @@ on a fixed region -> next. ## 5. Status / Log (update every session) +- **2026-10-03 - Render replay validation and texture streaming.** Increased the bounded small-transfer VRAM journal from 16 to 64 entries; Jersey Devil streams 31 texture/CLUT uploads in a draw. The 32-transfer rollback regression compares all VRAM bytes. Jersey Devil configures the SDK draw environment before replay packet allocation, preventing its command storage from overwriting a world quad. Final live runs completed at least 1,040 Jersey Devil and 1,088 A Bug's Life extra passes with zero state-verification mismatches, VRAM leaks, watchdogs or span failures. Changes remain local beyond base 9c1e716a. + +- **2026-10-03 - Ape Escape wall-flicker regression.** Dense frame/VRAM capture isolated world GT4s incorrectly promoted to UI behind a front-layer fade. UI grouping now selects the actual populated drawing layer, retaining empty trailing OT behavior. Captured-packet tests fail on the prior core and pass on the fix; software and 4K OpenGL/PGXP captures show no gaps in the affected camera interval. No guest timing or draw replay changes. + +- **2026-10-02 - Native high-rate rendering for Jersey Devil, A Bug's Life, and Ape Escape.** Added final RTPS/RTPT transform capture and guarded replay through the original draw sections. Projection overrides restore rotation/translation registers after each command. Camera cuts, unmatched geometry, stale captures, overflow, and aborted spans retain current poses or skip extra frames. Authoritative CPU/RAM/VRAM and guest timing remain isolated; live verification found zero mismatches in the sampled Ape Escape and A Bug's Life routes. GTE register and projection replay regressions pass. Ape Escape's card-menu scene predicate now applies in squash projection mode as well as native-wide; session resets clear it. Keyboard routing preserves analog mode on analog-locked titles. Changes are local beyond base 9c1e716a. + + - **2026-10-01 — MMX6 adaptive framework integration.** The opt-in function filters from the MMX6 branch are being reconciled with the active-plan function-entry registry and master overlay store-PC forwarding. A handled diff --git a/recompiler/src/code_generator.cpp b/recompiler/src/code_generator.cpp index 103d1ef1..d9c2a463 100644 --- a/recompiler/src/code_generator.cpp +++ b/recompiler/src/code_generator.cpp @@ -1655,7 +1655,7 @@ std::string CodeGenerator::translate_instruction_body(uint32_t addr, uint32_t in case 0x2A: code = translate_slt(instr); break; // slt case 0x2B: code = translate_sltu(instr); break; // sltu default: - code = fmt::format("/* TODO: SPECIAL funct=0x{:02X} */", funct); + code = fmt::format("/* undefined SPECIAL funct=0x{:02X}: R3000A-compatible no-op */", funct); } } // Immediate and load/store instructions diff --git a/runtime/include/render_pass_plan.h b/runtime/include/render_pass_plan.h index e4e519f2..72b5ee5b 100644 --- a/runtime/include/render_pass_plan.h +++ b/runtime/include/render_pass_plan.h @@ -161,7 +161,9 @@ int render_pass_store_to(const RenderPassStoreTarget *t, uint32_t addr, /* VRAM journal for a pass's writes outside its display rect * (gpu_gl_renderer.c pass_refuse_write): the CPU-side policy and the CPU VRAM * rows. The renderer keeps the matching GPU copies per entry. */ -#define RENDER_PASS_JOURNAL_MAX 16 +/* Jersey Devil streams more than 16 small texture/CLUT rectangles in a draw. + * Keep the transaction bounded, but allow the complete set to roll back. */ +#define RENDER_PASS_JOURNAL_MAX 64 enum { RENDER_PASS_VRAM_ALLOW = 0, /* inside the rect, empty, or already journaled */ RENDER_PASS_VRAM_JOURNAL = 1, /* outside: back up, then allow */ diff --git a/runtime/include/render_pass_projection.h b/runtime/include/render_pass_projection.h new file mode 100644 index 00000000..cd8189a2 --- /dev/null +++ b/runtime/include/render_pass_projection.h @@ -0,0 +1,32 @@ +#pragma once +#include +#ifdef __cplusplus +extern "C" { +#endif +struct CPUState; +typedef struct PSXProjectionHistory PSXProjectionHistory; +typedef struct PSXProjectionStats { + uint32_t captured, matched, changed, unmatched, discontinuities, overflow, replayed; +} PSXProjectionStats; +/* Capture the final model/view transforms that the game actually projects. + * Replay uses the same guest draw code, with interpolated transforms only for + * identified vertices. Unmatched vertices and camera cuts keep current state. + * A history belongs to one game drawing section; emulation thread only. */ +PSXProjectionHistory* psx_projection_create(uint32_t capacity); +void psx_projection_destroy(PSXProjectionHistory* history); +void psx_projection_invalidate(PSXProjectionHistory* history); +void psx_projection_reset_session(void); +void psx_projection_capture_begin(PSXProjectionHistory* history); +void psx_projection_capture_end(PSXProjectionHistory* history, uint32_t ticks, + double max_translation_per_tick); +void psx_projection_replay_begin(PSXProjectionHistory* history, uint32_t alpha_q16); +void psx_projection_replay_end(PSXProjectionHistory* history); +void psx_projection_stats(const PSXProjectionHistory* history, PSXProjectionStats* out); +/* GTE bridge: before RTPS/RTPT imports its registers. Returns nonzero only + * when a render pass temporarily replaced rotation/translation. The bridge + * restores those eight control registers after exporting command results. */ +int psx_projection_command(struct CPUState* cpu, uint32_t command); +extern int (*g_psx_projection_command)(struct CPUState*, uint32_t); +#ifdef __cplusplus +} +#endif diff --git a/runtime/include/render_pass_replay.hpp b/runtime/include/render_pass_replay.hpp new file mode 100644 index 00000000..fa3dff83 --- /dev/null +++ b/runtime/include/render_pass_replay.hpp @@ -0,0 +1,84 @@ +#pragma once +#include "cpu_state.h" +#include "mod_plugins.h" +#include "psx_cycle_freeze.h" +#include "render_pass_projection.h" +#include "pgxp.h" +#include +#include + +extern "C" uint8_t* memory_get_ram_ptr(void); +extern "C" uint8_t* memory_get_scratchpad_ptr(void); +extern "C" uint32_t memory_get_ram_bytes(void); + +/* A draw section may calculate temporary matrices, consume random seeds or + * update effect caches. Start every replay from the original section's RAM, + * rather than applying those calculations twice to the completed frame. Only + * restore inside the framework's machine/VRAM sandbox. */ +class PSXDrawReplay { + CPUState entry{}; + std::vector ram; + uint8_t scratch[1024]{}; + uint32_t start = 0, stop = 0, previous_tick = 0; + bool captured = false, ready = false, have_tick = false; + PSXProjectionHistory* history = nullptr; +public: + PSXProjectionStats stats{}; + uint32_t ticks = 0; + ~PSXDrawReplay() { psx_projection_destroy(history); } + void invalidate() { + captured = ready = have_tick = false; ticks = 0; + psx_projection_invalidate(history); + } + void capture(CPUState* cpu, uint32_t first, uint32_t last) { + if (g_psx_render_pass_active) return; + if (captured) invalidate(); // previous drawing section never completed + if (!history) history = psx_projection_create(65536); + if (!history || first >= last || ((first | last) & 3)) return; + entry = *cpu; start = first; stop = last; + ram.resize(memory_get_ram_bytes()); + std::memcpy(ram.data(), memory_get_ram_ptr(), ram.size()); + std::memcpy(scratch, memory_get_scratchpad_ptr(), sizeof scratch); + captured = true; ready = false; + psx_projection_capture_begin(history); + } + bool prepare(uint32_t tick) { + if (!captured) { invalidate(); return false; } + captured = false; + ticks = have_tick ? tick - previous_tick : 0; + previous_tick = tick; have_tick = true; + psx_projection_capture_end(history, ticks, 512.0); + psx_projection_stats(history, &stats); + ready = ticks && ticks <= 8 && stats.changed && !stats.overflow; + return ready; + } + bool restore(CPUState* cpu, uint32_t alpha) { + if (!ready || !g_psx_render_pass_active || ram.size() != memory_get_ram_bytes()) return false; + std::memcpy(memory_get_ram_ptr(), ram.data(), ram.size()); + std::memcpy(memory_get_scratchpad_ptr(), scratch, sizeof scratch); + // Raw RAM is now from section entry. Its current-frame precision + // shadows are stale; the pass checkpoint restores them afterwards. + pgxp_invalidate_all(); + *cpu = entry; + psx_projection_replay_begin(history, alpha); + return true; + } + bool draw(CPUState* cpu) { + const bool reached = psx_mod_run_guest_span(cpu, start, stop) != 0; + psx_projection_replay_end(history); + psx_projection_stats(history, &stats); + return reached && stats.replayed != 0; + } + static uint32_t call(CPUState* cpu, uint32_t function, uint32_t a0=0, uint32_t a1=0) { + const CPUState saved = *cpu; + cpu->pc = 0; cpu->gpr[4] = a0; cpu->gpr[5] = a1; + psx_dispatch_call(cpu, function, saved.gpr[31]); + const uint32_t result = cpu->gpr[2]; *cpu = saved; return result; + } + static void rate(uint32_t fps, uint32_t flip) { + psx_mod_set_frame_interpolation_source(PSX_MOD_FRAME_SOURCE_FLIP); + psx_mod_set_render_pass_flip(flip); + psx_mod_set_frame_interpolation_blend(PSX_MOD_FRAME_INTERPOLATION_HOLD); + psx_mod_set_frame_interpolation(fps); + } +}; diff --git a/runtime/runtime.cmake b/runtime/runtime.cmake index b0879b38..5142a864 100644 --- a/runtime/runtime.cmake +++ b/runtime/runtime.cmake @@ -354,6 +354,7 @@ set(PSXRECOMP_RUNTIME_SOURCES ${PSXRECOMP_ROOT}/runtime/src/render_pass.c ${PSXRECOMP_ROOT}/runtime/src/render_pass_plan.c ${PSXRECOMP_ROOT}/runtime/src/render_pass_motion.c + ${PSXRECOMP_ROOT}/runtime/src/render_pass_projection.cpp ${PSXRECOMP_ROOT}/runtime/src/render_pass_frame.c ${PSXRECOMP_ROOT}/runtime/src/host_time.c ${PSXRECOMP_ROOT}/runtime/src/psx_fiber.c diff --git a/runtime/src/dirty_ram_interp.c b/runtime/src/dirty_ram_interp.c index 2d4ada9a..56283ada 100644 --- a/runtime/src/dirty_ram_interp.c +++ b/runtime/src/dirty_ram_interp.c @@ -1930,7 +1930,9 @@ static int exec_one_fetched_inner(CPUState *cpu, uint32_t pc, uint32_t insn, return 0; } default: - return abort_unsupported(pc, insn, "SPECIAL funct"); + /* R3000A ignores undefined SPECIAL encodings; psx_interpreter.c + * already models this, so the dirty interpreter must agree. */ + return 0; } break; diff --git a/runtime/src/gpu.c b/runtime/src/gpu.c index 82ef3efa..08f93eb3 100644 --- a/runtime/src/gpu.c +++ b/runtime/src/gpu.c @@ -455,7 +455,7 @@ void gpu_ws_set_native_scene_predicate(int (*predicate)(void)) { int gpu_ws_present_native_43(void) { if (!ws_engaged()) return 0; - if (ws_mode == 2 && s_ws_native_scene_predicate && s_ws_native_scene_predicate()) + if (s_ws_native_scene_predicate && s_ws_native_scene_predicate()) return 1; int game_mode = ws_game_mode(); if (!game_mode) ws_scene_latch.confirmed = 0; @@ -5672,6 +5672,7 @@ void gpu_ws_prepass_linked_list(uint32_t start_addr) { uint32_t addr = psx_mod_gpu_dma_resolve_address(start_addr); uint32_t safety = 0; uint16_t rank = 0xFFFFu; + uint16_t max_rank = 0xFFFFu; const uint32_t max_nodes = 0x40000u; int area_left = (int)draw_area_left, area_right = (int)draw_area_right; GpuDisplayInfo di; @@ -5720,6 +5721,13 @@ void gpu_ws_prepass_linked_list(uint32_t start_addr) { /* CPU->VRAM data follows its 3-word header and is not a command * stream. Such transfers are not UI draws; stop this node. */ if (op >= 0xA0u && op <= 0xBFu) break; + /* Select the frontmost populated drawing layer, including + * full-screen fades and non-rectangular world primitives. + * Choosing only among UI-shaped candidates promotes a deeper + * wall quad to HUD when the real front layer has no widgets. */ + if (op >= 0x20u && op <= 0x7Fu && rank != 0xFFFFu && + (max_rank == 0xFFFFu || rank > max_rank)) + max_rank = rank; uint32_t words[12] = {0}; for (int i = 0; i < count && i < 12; i++) { words[i] = psx_read_word( @@ -5745,18 +5753,9 @@ void gpu_ws_prepass_linked_list(uint32_t start_addr) { return; } - /* Empty ordering-table buckets can trail the actual frontmost layer. - * Selecting the last empty bucket made the memory-card glyph layer (rank - * 4095 followed by an empty rank 4096) disappear from the correction - * pass. Pick the highest rank that contains an eligible UI primitive. */ - /* Candidates (triangles, rotated quads) never pick the rank: a world - * triangle sorted to the front would otherwise make itself the HUD. */ - uint16_t max_rank = 0xFFFFu; - for (uint32_t i = 0; i < ws_ui_prepass_count; i++) { - if (ws_ui_prepass[i].enclosed_only) continue; - if (max_rank == 0xFFFFu || ws_ui_prepass[i].ot_rank > max_rank) - max_rank = ws_ui_prepass[i].ot_rank; - } + /* Empty trailing OT buckets do not pick the layer. A populated front + * layer without eligible widgets also must not fall back to a deeper + * UI-shaped world surface (Ape Escape's intro walls). */ if (max_rank == 0xFFFFu) { ws_ui_reject.rank = ws_ui_prepass_count; ws_ui_prepass_count = 0; diff --git a/runtime/src/gte.cpp b/runtime/src/gte.cpp index 75c7036e..7e347c7e 100644 --- a/runtime/src/gte.cpp +++ b/runtime/src/gte.cpp @@ -3,6 +3,7 @@ #include "nd_intro_ot.h" #include "pgxp.h" #include "gte_nclip_stats.h" +#include "render_pass_projection.h" #include #include #include @@ -12,6 +13,7 @@ extern "C" uint32_t psx_read_word(uint32_t addr); extern "C" int gpu_ws_precise_nclip_enabled(void); extern "C" uint64_t s_frame_count; /* debug_server.c */ extern "C" uint32_t g_debug_last_store_pc; /* debug_server.c */ +extern "C" { int (*g_psx_projection_command)(CPUState*, uint32_t) = nullptr; } namespace PSXRecomp { namespace GTE { @@ -1954,6 +1956,11 @@ static void gte_run_command(PSXRecomp::GTE::GTEState* gte, uint32_t cmd) { extern "C" void gte_execute(CPUState* cpu, uint32_t cmd) { using namespace PSXRecomp::GTE; + uint32_t original_transform[8]; + const bool observe_projection = g_psx_projection_command && + ((cmd & 63) == 1 || (cmd & 63) == 0x30); + if (observe_projection) std::memcpy(original_transform, cpu->gte_ctrl, sizeof original_transform); + const bool intermediate = observe_projection && g_psx_projection_command(cpu, cmd); #ifndef PSX_NO_DEBUG_TOOLS if (!s_gte_replay_sandbox) s_gte_exec_count++; s_gte_caller_ra = cpu->gpr[31]; /* dome-locate probe: game fn that issued this projection */ @@ -1987,6 +1994,7 @@ extern "C" void gte_execute(CPUState* cpu, uint32_t cmd) { #endif gte_export_cpu_state(cpu, >e); + if (intermediate) std::memcpy(cpu->gte_ctrl, original_transform, sizeof original_transform); #ifndef PSX_NO_DEBUG_TOOLS /* ND digit-rain: NdIntroSiblingFaceLoop (jal 0x80069CC4; $ra stays 69C3C.. diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 9876f664..6a8521ef 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -1576,6 +1576,7 @@ static void reset_mod_owned_presentation(void) { g_ws_adaptive_max_num = 16; g_ws_adaptive_max_den = 9; psx_mod_set_world_scene_predicate(nullptr); + gpu_ws_set_native_scene_predicate(nullptr); psx_mod_set_retained_scene_predicate(nullptr); psx_mod_set_adaptive_backdrop_preload(0); g_bezel_path.clear(); @@ -4807,12 +4808,10 @@ static int pad_mode_boot_analog(int mode) { return mode == PSXRecompV4::PAD_MODE_ANALOG ? 1 : 0; } -/* Keyboard has no DualShock sticks/config handshake — always present as a - * plain digital pad (SCPH-1080). Leaving keyboard slots in ANALOG/policy mode made - * P2–P5 show as connected while games that expect digital multitap pads never - * saw usable button input. */ +/* Keyboard mappings can drive both DualShock sticks. Honor the configured + * mode, including analog-only title locks; multitap policy belongs to the + * SIO seat below and applies equally to keyboards and physical controllers. */ static int effective_player_mode(const PlayerInput& p) { - if (p.kind == 1) return (int)PSXRecompV4::PAD_MODE_DIGITAL; return p.mode; } diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index 2ad10627..0ad85068 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -7,6 +7,7 @@ #include "mod_plugins.h" #include "gpu.h" #include "psx_memory.h" +#include "render_pass_projection.h" #include "psx_sha256.h" #include "cpu_state.h" @@ -1552,6 +1553,8 @@ extern "C" int psx_mod_read_disc_file(const char* path, void* buffer, extern "C" void mod_runtime_activate_plugins(void) { using namespace PSXRecompV4; RuntimeMods& s = state(); + psx_projection_reset_session(); + gpu_ws_set_native_scene_predicate(nullptr); psx_ram_reset_size_request(); if (!s.initialized || !s.plan.ok) return; s.disc_extents.clear(); diff --git a/runtime/src/render_pass_projection.cpp b/runtime/src/render_pass_projection.cpp new file mode 100644 index 00000000..5a2d9ef6 --- /dev/null +++ b/runtime/src/render_pass_projection.cpp @@ -0,0 +1,185 @@ +#include "render_pass_projection.h" +#include "render_pass_motion.h" +#include "cpu_state.h" +#include "psx_cycle_freeze.h" +#include +#include +#include +#include +#include +#include + +namespace { +struct Projection { + uint64_t key; + uint32_t vertices[6]; + uint32_t caller, command; + PSXMotionMatrix current{}, previous{}; + bool blend = false; +}; +PSXMotionMatrix matrix(const CPUState* cpu) { + PSXMotionMatrix m{}; + for (unsigned i = 0; i < 9; ++i) + m.r[i] = int16_t(cpu->gte_ctrl[i / 2] >> (16 * (i % 2))); + for (unsigned i = 0; i < 3; ++i) m.t[i] = int32_t(cpu->gte_ctrl[5 + i]); + return m; +} +void set_matrix(CPUState* cpu, const PSXMotionMatrix& m) { + for (unsigned i = 0; i < 4; ++i) + cpu->gte_ctrl[i] = uint16_t(m.r[2*i]) | (uint32_t(uint16_t(m.r[2*i+1])) << 16); + cpu->gte_ctrl[4] = uint32_t(int32_t(m.r[8])); + for (unsigned i = 0; i < 3; ++i) cpu->gte_ctrl[5+i] = uint32_t(m.t[i]); +} +Projection projection(const CPUState* cpu, uint32_t command) { + Projection p{}; + p.current = matrix(cpu); + p.command = command; + p.caller = cpu->gpr[31] & 0x1FFFFFFFu; + const unsigned count = (command & 63) == 0x30 ? 6 : 2; + p.key = 1469598103934665603ull; + auto hash = [&](uint32_t v) { p.key = (p.key ^ v) * 1099511628211ull; }; + hash(p.caller); hash(command); + for (unsigned i = 0; i < count; ++i) { + // VZ is signed 16-bit; ignore unused high halves in backing registers. + p.vertices[i] = (i & 1) ? uint16_t(cpu->gte_data[i]) : cpu->gte_data[i]; + hash(p.vertices[i]); + } + return p; +} +bool same_vertices(const Projection& a, const Projection& b) { + return a.caller == b.caller && a.command == b.command && + std::memcmp(a.vertices, b.vertices, sizeof a.vertices) == 0; +} +double distance(const PSXMotionMatrix& a, const PSXMotionMatrix& b) { + double d = 0; + for (unsigned i=0; i<3; ++i) { double v=double(a.t[i])-b.t[i]; d += v*v; } + // Distinguish coincident instances with different rotations. + for (unsigned i=0; i<9; ++i) { double v=(double(a.r[i])-b.r[i])/16; d += v*v; } + return d; +} +bool same_matrix(const PSXMotionMatrix& a, const PSXMotionMatrix& b) { + return std::memcmp(a.r, b.r, sizeof a.r) == 0 && + std::memcmp(a.t, b.t, sizeof a.t) == 0; +} +} + +struct PSXProjectionHistory { + uint32_t capacity; + std::vector current, previous; + std::unordered_map> index; + std::vector used; + PSXProjectionStats stats{}; + bool capturing = false, replaying = false, history_valid = false; + double alpha = 1; +}; +static PSXProjectionHistory* active = nullptr; +extern "C" void psx_projection_reset_session(void) { + if (active) psx_projection_invalidate(active); + g_psx_projection_command = nullptr; +} + +extern "C" PSXProjectionHistory* psx_projection_create(uint32_t capacity) { + if (!capacity || capacity > 262144) return nullptr; + auto* h = new (std::nothrow) PSXProjectionHistory; + if (h) { h->capacity = capacity; h->current.reserve(capacity); h->previous.reserve(capacity); } + return h; +} +extern "C" void psx_projection_invalidate(PSXProjectionHistory* h) { + if (!h) return; + if (active == h) { active = nullptr; g_psx_projection_command = nullptr; } + h->current.clear(); h->previous.clear(); h->index.clear(); h->used.clear(); + h->stats = {}; h->capturing = h->replaying = h->history_valid = false; +} +extern "C" void psx_projection_destroy(PSXProjectionHistory* h) { + psx_projection_invalidate(h); delete h; +} +extern "C" void psx_projection_capture_begin(PSXProjectionHistory* h) { + if (!h || g_psx_render_pass_active) return; + h->previous.swap(h->current); h->current.clear(); + h->stats = {}; h->capturing = true; h->replaying = false; + active = h; g_psx_projection_command = psx_projection_command; +} +extern "C" void psx_projection_capture_end(PSXProjectionHistory* h, uint32_t ticks, + double max_move) { + if (!h) return; + h->capturing = false; + if (active == h) { active = nullptr; g_psx_projection_command = nullptr; } + h->stats.captured = uint32_t(h->current.size()); + h->index.clear(); + if (h->history_valid && ticks && ticks <= 8 && !h->stats.overflow) { + for (uint32_t i=0; iprevious.size(); ++i) h->index[h->previous[i].key].push_back(i); + h->used.assign(h->previous.size(), 0); + const double limit = max_move * ticks; + for (auto& p : h->current) { + auto it = h->index.find(p.key); + uint32_t best = UINT32_MAX; + double best_d = INFINITY; + if (it != h->index.end()) for (uint32_t i : it->second) { + if (h->used[i] || !same_vertices(p, h->previous[i])) continue; + const double d = distance(p.current, h->previous[i].current); + if (d < best_d) { best = i; best_d = d; } + } + if (best == UINT32_MAX) { ++h->stats.unmatched; continue; } + h->used[best] = 1; + p.previous = h->previous[best].current; + bool placed = false; + for (unsigned i=0; i<3; ++i) + placed |= std::abs(double(p.current.t[i])-p.previous.t[i]) > limit; + PSXMotionMatrix midpoint; + p.blend = !placed && psx_motion_blend_matrix(&p.previous, &p.current, .5, 1.2, &midpoint); + if (p.blend) { + ++h->stats.matched; + if (!same_matrix(p.previous,p.current)) ++h->stats.changed; + } else ++h->stats.discontinuities; + } + } else h->stats.unmatched = h->stats.captured; + h->history_valid = !h->stats.overflow && !h->current.empty(); + // Index the current frame for replay; visibility/subdivision may reorder + // projections. Never blend a different vertex because an ordinal shifted. + h->index.clear(); + for (uint32_t i=0; icurrent.size(); ++i) h->index[h->current[i].key].push_back(i); +} +extern "C" void psx_projection_replay_begin(PSXProjectionHistory* h, uint32_t alpha) { + if (!h || !g_psx_render_pass_active) return; + h->capturing = false; h->replaying = true; + h->used.assign(h->current.size(), 0); + h->alpha = std::min(alpha, 65536u) / 65536.0; + h->stats.replayed = 0; active = h; g_psx_projection_command = psx_projection_command; +} +extern "C" void psx_projection_replay_end(PSXProjectionHistory* h) { + if (!h) return; + h->replaying = false; + if (active == h) { active = nullptr; g_psx_projection_command = nullptr; } +} +extern "C" void psx_projection_stats(const PSXProjectionHistory* h, PSXProjectionStats* out) { + if (out) *out = h ? h->stats : PSXProjectionStats{}; +} +extern "C" int psx_projection_command(CPUState* cpu, uint32_t command) { + auto* h = active; + if (!h || ((command & 63) != 1 && (command & 63) != 0x30)) return 0; + // A watchdog may unwind a replay callback without its normal end call. + // The sandbox flag, rather than a plugin-local flag, owns replay lifetime. + if (h->replaying && !g_psx_render_pass_active) { + active = nullptr; g_psx_projection_command = nullptr; h->replaying = false; return 0; + } + Projection p = projection(cpu, command); + if (h->capturing && !g_psx_render_pass_active) { + if (h->current.size() == h->capacity) ++h->stats.overflow; + else h->current.push_back(p); + return 0; + } + if (!h->replaying || !g_psx_render_pass_active) return 0; + auto it = h->index.find(p.key); + if (it == h->index.end()) return 0; + for (uint32_t i : it->second) { + const auto& c = h->current[i]; + if (h->used[i] || !same_vertices(c,p) || !same_matrix(c.current,p.current)) continue; + h->used[i] = 1; + if (!c.blend || same_matrix(c.previous,c.current)) return 0; + PSXMotionMatrix intermediate; + psx_motion_blend_matrix(&c.previous, &c.current, h->alpha, 1.2, &intermediate); + set_matrix(cpu, intermediate); ++h->stats.replayed; + return 1; + } + return 0; +} diff --git a/runtime/tests/gpu_exec_stubs.inc b/runtime/tests/gpu_exec_stubs.inc index 7c63fdcf..b75ba8d9 100644 --- a/runtime/tests/gpu_exec_stubs.inc +++ b/runtime/tests/gpu_exec_stubs.inc @@ -230,6 +230,9 @@ void gr_draw_shaded_textured_triangle(int x0, int y0, int u0, int v0, uint32_t color2, uint16_t clut_x, uint16_t clut_y, uint16_t texpage, int raw_texture) { +#ifdef GPU_EXEC_RECORD_SHADED_TEXTURED + gpu_exec_record_triangle(x0, y0, x1, y1, x2, y2); +#endif (void)x0; (void)y0; (void)u0; (void)v0; (void)color0; (void)x1; (void)y1; (void)u1; (void)v1; (void)color1; (void)x2; (void)y2; (void)u2; (void)v2; (void)color2; (void)clut_x; (void)clut_y; diff --git a/runtime/tests/test_gte_register_access.cpp b/runtime/tests/test_gte_register_access.cpp index b365797c..5dff3ea7 100644 --- a/runtime/tests/test_gte_register_access.cpp +++ b/runtime/tests/test_gte_register_access.cpp @@ -1,6 +1,7 @@ #include "cpu_state.h" #include "gte.h" #include "gte_nclip_stats.h" +#include "render_pass_projection.h" #include #include @@ -407,6 +408,57 @@ int test_sequence_fuzz() { return 0; } +static unsigned projection_callback_calls; +static int substitute_projection(CPUState *cpu, uint32_t) { + ++projection_callback_calls; + cpu->gte_ctrl[0] = 0x1000u; + cpu->gte_ctrl[1] = 0u; + cpu->gte_ctrl[2] = 0x1000u; + cpu->gte_ctrl[3] = 0u; + cpu->gte_ctrl[4] = 0x1000u; + cpu->gte_ctrl[5] = 32u; + cpu->gte_ctrl[6] = 16u; + cpu->gte_ctrl[7] = 1024u; + return 1; +} + +int test_projection_override_restores_transform() { + for (uint32_t command : {0x80001u, 0x80030u}) { + CPUState actual{}; + actual.gte_ctrl[0] = 0x800u; + actual.gte_ctrl[2] = 0x800u; + actual.gte_ctrl[4] = 0x800u; + actual.gte_ctrl[5] = 80u; + actual.gte_ctrl[6] = 40u; + actual.gte_ctrl[7] = 2048u; + actual.gte_ctrl[26] = 256u; + actual.gte_data[0] = 0x00100020u; + actual.gte_data[1] = 64u; + actual.gte_data[2] = 0x00300040u; + actual.gte_data[3] = 96u; + actual.gte_data[4] = 0x00500060u; + actual.gte_data[5] = 128u; + CPUState original = actual, expected = actual; + substitute_projection(&expected, command); + gte_test_execute_reference(&expected, command); + projection_callback_calls = 0; + g_psx_projection_command = substitute_projection; + gte_execute(&actual, command); + g_psx_projection_command = nullptr; + if (projection_callback_calls != 1 || + std::memcmp(actual.gte_ctrl, original.gte_ctrl, 8 * sizeof(uint32_t)) || + std::memcmp(actual.gte_data, expected.gte_data, sizeof(actual.gte_data))) { + std::fprintf(stderr, "FAIL: projection override leaked transform or changed output (%x)\n", command); + return 1; + } + g_psx_projection_command = substitute_projection; + gte_execute(&actual, 0x06u); + g_psx_projection_command = nullptr; + if (projection_callback_calls != 1) return 1; + } + return 0; +} + int test_command_marshaling() { constexpr std::array kFunctions = { 0x01, 0x06, 0x0C, 0x10, 0x11, 0x12, 0x13, 0x14, @@ -765,6 +817,7 @@ int main() { if (int rc = test_writes()) return rc; if (int rc = test_sequence_fuzz()) return rc; if (int rc = test_command_marshaling()) return rc; + if (int rc = test_projection_override_restores_transform()) return rc; if (int rc = test_command_timing_hook()) return rc; if (int rc = test_precise_sxy_invalidation()) return rc; if (int rc = test_precise_nclip_is_title_scoped()) return rc; diff --git a/runtime/tests/test_mod_runtime.cpp b/runtime/tests/test_mod_runtime.cpp index 76869ec2..9d8db5f9 100644 --- a/runtime/tests/test_mod_runtime.cpp +++ b/runtime/tests/test_mod_runtime.cpp @@ -76,6 +76,8 @@ extern "C" uint32_t psx_mod_gpu_dma_memory_alloc(uint32_t, uint32_t) { return 0; } extern "C" void psx_ram_reset_size_request(void) {} +extern "C" void psx_projection_reset_session(void) {} +extern "C" void gpu_ws_set_native_scene_predicate(int (*)(void)) {} extern "C" int psx_ws_x_margin(void) { return 0; } /* Stand-in for the GPU's display geometry. psx_mod_display_width/height must diff --git a/runtime/tests/test_render_pass_sandbox.c b/runtime/tests/test_render_pass_sandbox.c index d447cae1..6fd3b20c 100644 --- a/runtime/tests/test_render_pass_sandbox.c +++ b/runtime/tests/test_render_pass_sandbox.c @@ -569,11 +569,33 @@ static void test_journal(void) { #undef POLICY } +static void test_texture_stream_journal(void) { + RenderPassJournal j = {0}; + memcpy(s_vram, s_vram0, sizeof s_vram); + /* The Jersey draw OT alternates animated texture strips and CLUT rows. + * All 32 destinations must be backed up before the replay writes them. */ + for (int i = 0; i < 32; ++i) { + int x = (i / 2) * 16, y = (i & 1) ? 492 : 64; + int w = (i & 1) ? 16 : 4, h = (i & 1) ? 1 : 64; + CHECK(render_pass_vram_policy(&j, 512, 0, 512, 240, VW, VH, + 1, &x, &y, &w, &h) == RENDER_PASS_VRAM_JOURNAL, + "texture stream fits the bounded journal"); + CHECK(render_pass_journal_add(&j, s_vram, VW, x, y, w, h) == i, + "texture destination backed up"); + paint(x, y, w, h, (uint16_t)(0x9000 + i)); + } + render_pass_journal_rollback(&j, s_vram, VW); + CHECK(!memcmp(s_vram, s_vram0, sizeof s_vram), + "texture stream and palettes restored exactly"); + render_pass_journal_free(&j); +} + int main(void) { test_store_policy(); test_pass(); test_ram_8mb(); test_journal(); + test_texture_stream_journal(); CHECK(s_prec_open == 0, "precision checkpoints balanced"); printf(failures ? "FAILED (%d)\n" : "ALL PASS\n", failures); return failures ? 1 : 0; diff --git a/runtime/tests/test_ws_auto_ui_untextured_exec.c b/runtime/tests/test_ws_auto_ui_untextured_exec.c index f22bc5d2..572ad517 100644 --- a/runtime/tests/test_ws_auto_ui_untextured_exec.c +++ b/runtime/tests/test_ws_auto_ui_untextured_exec.c @@ -17,6 +17,7 @@ #include #define GPU_EXEC_REAL_UI_GROUP +#define GPU_EXEC_RECORD_SHADED_TEXTURED #include "../src/gpu.c" #include "gpu_exec_stubs.inc" @@ -152,9 +153,59 @@ static void run_fills(int *gouraud_min, int *gouraud_max, *flat_max = gpu_exec_triangles.max_x; } +/* Captured Ape intro GT4: world rank 3105, then a full-screen fade at 4095. + * Relative ranks suffice here. The wall becomes exactly rectangular for a + * few frames, but it must never become UI just because the fade is excluded. */ +static void test_wall_behind_front_layer(int triangle) { + reset_state(0); + hres1 = 0; hres2 = 1; /* Ape's 384x240 display */ + ws_cfg_num = 16; ws_cfg_den = 9; ws_xnum = 3; ws_xden = 4; + memset(test_ram, 0, sizeof(test_ram)); + const uint32_t wall[12] = { + 0x3C00FEFEu, 0x001C00C4u, 0x3ED8593Fu, + 0x0000FEFEu, 0x004100C4u, 0x0089653Fu, + 0x003FBEBEu, 0x001C008Bu, 0x006F591Fu, + 0x003FBEBEu, 0x0041008Bu, 0x0042651Fu, + }; + const uint32_t fade[3] = { + 0x63000000u, pack_vertex(0, 0), 0x00F00180u, + }; + const uint32_t front_triangle[4] = { + 0x20808080u, pack_vertex(1, 1), pack_vertex(8, 1), pack_vertex(1, 8), + }; + test_ram[OT_HEAD / 4u] = NODE_RING; + put_node(NODE_RING, NODE_GAP, wall, 12); + test_ram[NODE_GAP / 4u] = NODE_FILL; + put_node(NODE_FILL, NODE_FLAT, triangle ? front_triangle : fade, + triangle ? 4 : 3); + test_ram[NODE_FLAT / 4u] = 0xFFFFFFu; /* trailing empty rank */ + gpu_ws_prepass_linked_list(OT_HEAD); + assert(ws_ui_prepass_count == 0); + gpu_exec_reset_triangles(); + load_packet(NODE_RING, 12); + gp0_exec_shaded_textured_quad(); + assert(gpu_exec_triangles.calls == 2); + assert(gpu_exec_triangles.min_x == 139); + assert(gpu_exec_triangles.max_x == 196); + assert(ws_auto_ui_transform_count == 0); +} + int main(void) { int gmin, gmax, fmin, fmax; + test_wall_behind_front_layer(0); + test_wall_behind_front_layer(1); + + /* A real HUD remains eligible when its last drawing layer is followed + * by an empty OT bucket, as in Ape's memory-card menu. */ + reset_state(1); + build_hud(60, 128, 64, 120); + test_ram[NODE_FLAT / 4u] = (5u << 24) | NODE_PANEL; + test_ram[NODE_PANEL / 4u] = 0xFFFFFFu; + run_fills(&gmin, &gmax, &fmin, &fmax); + assert(gmin == ws_scale_about(64, 94)); + assert(gmax == ws_scale_about(120, 94)); + /* in_place: the fill and its frame share the run's own centre. */ reset_state(1); build_hud(60, 128, 64, 120); From 09d388ab853ae4831cfb8377b5eb12c029b2da9d Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sat, 3 Oct 2026 11:38:07 -0700 Subject: [PATCH 44/52] Match original-disc release overlays to PGXP runtime flavor --- tools/aot_overlay_pipeline.py | 22 ++++++++++++-------- tools/tests/test_aot_overlay_pipeline.py | 26 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/tools/aot_overlay_pipeline.py b/tools/aot_overlay_pipeline.py index 5f95622b..fb68366a 100644 --- a/tools/aot_overlay_pipeline.py +++ b/tools/aot_overlay_pipeline.py @@ -717,16 +717,16 @@ def extract(profile_path, game_toml, recompiler, output, cue=None, disc=None, pr output, views) -def audit(game_toml, recompiler, cache, inventory, output, static_dispatch=None): +def audit(game_toml, recompiler, cache, inventory, output, static_dispatch=None, flavor=0): target = ['--static-dispatch', str(static_dispatch)] if static_dispatch else ['--cache-root', str(cache)] subprocess.run([sys.executable, str(FRAMEWORK / 'tools/audit_aot_cache.py'), '--framework-root', str(FRAMEWORK), '--recompiler', str(recompiler), - '--game-toml', str(game_toml), *target, + '--game-toml', str(game_toml), '--flavor', str(flavor), *target, '--inventory', str(inventory), '--output', str(output)], check=True) return json.loads(output.read_text()) -def build(inventory, game_toml, recompiler, work, gcc, workers, project_root=None, cps=False): +def build(inventory, game_toml, recompiler, work, gcc, workers, project_root=None, cps=False, flavor=0): """Independent recipe builds cannot nominate entries in sibling images.""" cache = work / 'cache' cache.mkdir(parents=True) @@ -739,7 +739,7 @@ def build(inventory, game_toml, recompiler, work, gcc, workers, project_root=Non '--project-root', str(project_root or game_toml.parent), '--recompiler', str(recompiler), '--runtime-include', str(FRAMEWORK / 'runtime/include'), '--out-dir', str(target / 'cache'), '--compiler', 'gcc', '--gcc', gcc, - '--flavor', '0', '--jobs', '1'] + (['--cps'] if cps else []) + '--flavor', str(flavor), '--jobs', '1'] + (['--cps'] if cps else []) with (target / 'compile.log').open('w') as log: subprocess.run(command, stdout=log, stderr=subprocess.STDOUT, check=True) return index, job, target @@ -969,7 +969,7 @@ def run(): parser.add_argument('--runtime-config', type=Path, help='Packaged config controlling native cache namespace/code generation') parser.add_argument('--runtime-build-dir', type=Path, - help='Verify the staged runtime publishes the supported flavor-0 ABI') + help='Read and validate the staged runtime overlay ABI (base or PGXP)') parser.add_argument('--runtime-target', default='psx-runtime') parser.add_argument('--recompiler', type=Path, required=True) parser.add_argument('--work-dir', type=Path, required=True) @@ -995,10 +995,13 @@ def run(): import tomllib require_runtime_cache(tomllib.loads((args.runtime_config or args.game_toml) .read_text(encoding='utf-8-sig'))) + flavor = 0 if args.runtime_build_dir: from release_stage import _flavor_from_build - require(_flavor_from_build(str(args.runtime_build_dir), args.runtime_target) == 0, - 'This AOT pipeline currently requires a flavor-0 runtime') + flavor = _flavor_from_build(str(args.runtime_build_dir), args.runtime_target) + require(flavor in (0, 2), 'Unsupported runtime overlay flavor') + require(args.action == 'release' or flavor == 0, + 'Static AOT generation currently requires a flavor-0 runtime') import tomllib config, recompiler = args.game_toml.resolve(), args.recompiler.resolve() profile_path = args.profile.resolve() @@ -1048,8 +1051,9 @@ def run(): require(tomllib.loads(runtime_config.read_text(encoding='utf-8-sig'))['game']['id'] == inventory['game_id'], 'Runtime config/game mismatch') cache = build(inventory, runtime_config, recompiler, work, args.gcc, args.workers, config.parent, - args.cps) - receipt = audit(runtime_config, recompiler, cache, work / 'runtime-input-inventory.json', work / 'audit.json') + args.cps, flavor) + receipt = audit(runtime_config, recompiler, cache, work / 'runtime-input-inventory.json', work / 'audit.json', + flavor=flavor) receipt['profile_sha256'] = inventory['profile_sha256'] receipt['original_disc_sha256'] = inventory['original_disc_sha256'] receipt['required_images'] = inventory['required_images'] diff --git a/tools/tests/test_aot_overlay_pipeline.py b/tools/tests/test_aot_overlay_pipeline.py index 91e8a6f4..20685e5a 100644 --- a/tools/tests/test_aot_overlay_pipeline.py +++ b/tools/tests/test_aot_overlay_pipeline.py @@ -17,6 +17,32 @@ import audit_aot_cache as auditor import indexed_lzss_pack as lzss_pack +class PgxpReleaseNamespaceTests(unittest.TestCase): + def test_pgxp_compile_and_audit_follow_runtime_flavor(self): + with tempfile.TemporaryDirectory() as directory: + work = Path(directory) + commands = [] + + def compile_fixture(command, **kwargs): + commands.append(command) + Path(command[command.index('--out-dir') + 1]).mkdir(parents=True) + + with mock.patch.object(pipeline.subprocess, 'run', side_effect=compile_fixture): + pipeline.build(dict(jobs=[dict(input='invented.json', name='image')]), + work / 'game.toml', work / 'emitter', work, + 'gcc', 1, flavor=2) + self.assertEqual(commands[0][commands[0].index('--flavor') + 1], '2') + receipt = work / 'audit.json' + receipt.write_text('{"flavor": 2}') + with mock.patch.object(pipeline.subprocess, 'run') as run: + result = pipeline.audit(work / 'game.toml', work / 'emitter', + work / 'cache', work / 'inventory.json', + receipt, flavor=2) + command = run.call_args.args[0] + self.assertEqual(command[command.index('--flavor') + 1], '2') + self.assertEqual(result['flavor'], 2) + + class FakeDisc: def __init__(self, files): self.data = files From f7f0ad1097178d5df01a16eafe030f435565ed64 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sat, 3 Oct 2026 11:47:10 -0700 Subject: [PATCH 45/52] Refresh existing BIOS backends and fingerprints with the pinned emitter --- generated/OpenBIOS.emitter.sha | 2 +- generated/OpenBIOS_full.c | 1767 +++++--- generated/SCPH1001.emitter.sha | 2 +- generated/SCPH1001_full.c | 7155 +++++++++++++++++++++----------- 4 files changed, 5950 insertions(+), 2976 deletions(-) diff --git a/generated/OpenBIOS.emitter.sha b/generated/OpenBIOS.emitter.sha index eb8b1ed1..836a61ab 100644 --- a/generated/OpenBIOS.emitter.sha +++ b/generated/OpenBIOS.emitter.sha @@ -1 +1 @@ -8fdced1ab1e5ddec820658cbfa01e434eca73a0a2af8185e4d73699b00627619 +13726a0f0c2be1cae753c2afdb2e7af421e08d79e2309250e04dd52f7d4d8c7c diff --git a/generated/OpenBIOS_full.c b/generated/OpenBIOS_full.c index ecb86e34..e784d9dd 100644 --- a/generated/OpenBIOS_full.c +++ b/generated/OpenBIOS_full.c @@ -1281,7 +1281,8 @@ label_BFC000B8: psx_cyc_step(cpu, 0x10004u); #endif /* 0xBFC000C0: 0202102B sltu $v0, $s0, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0202102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC000C0u); #endif @@ -1622,7 +1623,8 @@ label_BFC00118: psx_cyc_step(cpu, 0x10000u); #endif /* 0xBFC0011C: 321000FF andi $s0, $s0, 0xFF */ - cpu->gpr[16] = cpu->gpr[16] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[16] = cpu->gpr[16] & 0xFFu; + PGXP_ALU(0x321000FFu, cpu->gpr[16], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0011Cu); #endif @@ -3945,7 +3947,8 @@ label_BFC003A8: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC003B8: 00661826 xor $v1, $v1, $a2 */ - cpu->gpr[3] = cpu->gpr[3] ^ cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[3] = cpu->gpr[3] ^ cpu->gpr[6]; + PGXP_ALU(0x00661826u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC003B8u); #endif @@ -4118,7 +4121,8 @@ label_BFC003D0: psx_cyc_step(cpu, 0x60u); #endif /* 0xBFC003E0: 00A62826 xor $a1, $a1, $a2 */ - cpu->gpr[5] = cpu->gpr[5] ^ cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[5] = cpu->gpr[5] ^ cpu->gpr[6]; + PGXP_ALU(0x00A62826u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC003E0u); #endif @@ -4170,7 +4174,8 @@ label_BFC003E4: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC003EC: 00451026 xor $v0, $v0, $a1 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[5]; + PGXP_ALU(0x00451026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC003ECu); #endif @@ -4189,7 +4194,8 @@ label_BFC003E4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC003F4: 2C420001 sltiu $v0, $v0, 1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC003F4u); #endif @@ -4816,7 +4822,8 @@ label_BFC00478: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC00488: 30E700F0 andi $a3, $a3, 0xF0 */ - cpu->gpr[7] = cpu->gpr[7] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xF0u; + PGXP_ALU(0x30E700F0u, cpu->gpr[7], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0xBFC00488u); #endif @@ -5388,7 +5395,8 @@ label_BFC00514: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC00514: 38820052 xori $v0, $a0, 0x52 */ - cpu->gpr[2] = cpu->gpr[4] ^ 0x52u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] ^ 0x52u; + PGXP_ALU(0x38820052u, cpu->gpr[2], _pgx1, 0x0052u); } #ifdef PSX_COSIM cosim_instr(0xBFC00514u); #endif @@ -5407,7 +5415,8 @@ label_BFC00514: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC0051C: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0051Cu); #endif @@ -5442,7 +5451,8 @@ label_BFC00520: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC00520: 38820051 xori $v0, $a0, 0x51 */ - cpu->gpr[2] = cpu->gpr[4] ^ 0x51u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] ^ 0x51u; + PGXP_ALU(0x38820051u, cpu->gpr[2], _pgx1, 0x0051u); } #ifdef PSX_COSIM cosim_instr(0xBFC00520u); #endif @@ -5461,7 +5471,8 @@ label_BFC00520: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC00528: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC00528u); #endif @@ -13509,7 +13520,8 @@ label_BFC00D4C: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC00D54: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC00D54u); #endif @@ -15460,7 +15472,8 @@ label_BFC00F38: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC00F64: 2C430009 sltiu $v1, $v0, 9 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000009u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000009u ? 1 : 0); + PGXP_ALU(0x2C430009u, cpu->gpr[3], _pgx1, 0x0009u); } #ifdef PSX_COSIM cosim_instr(0xBFC00F64u); #endif @@ -19391,7 +19404,8 @@ label_BFC01364: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC01378: 2842000F slti $v0, $v0, 15 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + PGXP_ALU(0x2842000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC01378u); #endif @@ -21063,7 +21077,8 @@ label_BFC0150C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC01520: 28420014 slti $v0, $v0, 20 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (20) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (20) ? 1 : 0); + PGXP_ALU(0x28420014u, cpu->gpr[2], _pgx1, 0x0014u); } #ifdef PSX_COSIM cosim_instr(0xBFC01520u); #endif @@ -23647,7 +23662,8 @@ label_BFC017B0: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC017B4: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC017B4u); #endif @@ -26795,7 +26811,8 @@ label_BFC01AE8: psx_cyc_step(cpu, 0x10004u); #endif /* 0xBFC01AE8: 2A02000F slti $v0, $s0, 15 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[16] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[16] < (15) ? 1 : 0); + PGXP_ALU(0x2A02000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC01AE8u); #endif @@ -28285,7 +28302,8 @@ label_BFC01C40: psx_cyc_step(cpu, 0x800004u); #endif /* 0xBFC01C40: 32E28000 andi $v0, $s7, 0x8000 */ - cpu->gpr[2] = cpu->gpr[23] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[23]; cpu->gpr[2] = cpu->gpr[23] & 0x8000u; + PGXP_ALU(0x32E28000u, cpu->gpr[2], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0xBFC01C40u); #endif @@ -28479,7 +28497,8 @@ label_BFC01C5C: psx_cyc_step(cpu, 0x800004u); #endif /* 0xBFC01C70: 32E20200 andi $v0, $s7, 0x200 */ - cpu->gpr[2] = cpu->gpr[23] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[23]; cpu->gpr[2] = cpu->gpr[23] & 0x200u; + PGXP_ALU(0x32E20200u, cpu->gpr[2], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0xBFC01C70u); #endif @@ -28798,7 +28817,8 @@ label_BFC01CBC: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC01CC4: 30C600F0 andi $a2, $a2, 0xF0 */ - cpu->gpr[6] = cpu->gpr[6] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0xF0u; + PGXP_ALU(0x30C600F0u, cpu->gpr[6], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0xBFC01CC4u); #endif @@ -28950,7 +28970,8 @@ label_BFC01CE0: psx_cyc_step(cpu, 0x84u); #endif /* 0xBFC01CE8: 0047102B sltu $v0, $v0, $a3 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0047102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01CE8u); #endif @@ -29103,7 +29124,8 @@ label_BFC01D0C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC01D14: 304200F0 andi $v0, $v0, 0xF0 */ - cpu->gpr[2] = cpu->gpr[2] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xF0u; + PGXP_ALU(0x304200F0u, cpu->gpr[2], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0xBFC01D14u); #endif @@ -29351,7 +29373,8 @@ label_BFC01D4C: psx_cyc_step(cpu, 0x1010u); #endif /* 0xBFC01D54: 2C8C0001 sltiu $t4, $a0, 1 */ - cpu->gpr[12] = (uint32_t)(cpu->gpr[4] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[12] = (uint32_t)(cpu->gpr[4] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C8C0001u, cpu->gpr[12], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC01D54u); #endif @@ -29467,7 +29490,8 @@ label_BFC01D6C: psx_cyc_step(cpu, 0x94u); #endif /* 0xBFC01D70: 0047202B sltu $a0, $v0, $a3 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0047202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01D70u); #endif @@ -29520,7 +29544,8 @@ label_BFC01D7C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC01D7C: 28420002 slti $v0, $v0, 2 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (2) ? 1 : 0); + PGXP_ALU(0x28420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC01D7Cu); #endif @@ -33843,7 +33868,8 @@ label_BFC021C4: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC021E4: 30A500F0 andi $a1, $a1, 0xF0 */ - cpu->gpr[5] = cpu->gpr[5] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xF0u; + PGXP_ALU(0x30A500F0u, cpu->gpr[5], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0xBFC021E4u); #endif @@ -35457,7 +35483,8 @@ label_BFC02378: psx_cyc_step(cpu, 0x58u); #endif /* 0xBFC02378: 0083302B sltu $a2, $a0, $v1 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[4] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[6] = (uint32_t)(cpu->gpr[4] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0083302Bu, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02378u); #endif @@ -35510,7 +35537,8 @@ label_BFC02384: psx_cyc_step(cpu, 0x1Cu); #endif /* 0xBFC02384: 0043202B sltu $a0, $v0, $v1 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02384u); #endif @@ -37718,7 +37746,8 @@ label_BFC025AC: psx_cyc_step(cpu, 0x60u); #endif /* 0xBFC025AC: 28C50040 slti $a1, $a2, 64 */ - cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[6] < (64) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[6] < (64) ? 1 : 0); + PGXP_ALU(0x28C50040u, cpu->gpr[5], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0xBFC025ACu); #endif @@ -38870,7 +38899,8 @@ label_BFC026BC: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC026C4: 3222007F andi $v0, $s1, 0x7F */ - cpu->gpr[2] = cpu->gpr[17] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = cpu->gpr[17] & 0x7Fu; + PGXP_ALU(0x3222007Fu, cpu->gpr[2], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC026C4u); #endif @@ -38943,7 +38973,8 @@ label_BFC026D0: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC026D8: 0222102B sltu $v0, $s1, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[17] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[17] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0222102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC026D8u); #endif @@ -39285,7 +39316,8 @@ label_BFC02738: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC02740: 30428000 andi $v0, $v0, 0x8000 */ - cpu->gpr[2] = cpu->gpr[2] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x8000u; + PGXP_ALU(0x30428000u, cpu->gpr[2], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0xBFC02740u); #endif @@ -39529,7 +39561,8 @@ label_BFC02774: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC02774: 3222003F andi $v0, $s1, 0x3F */ - cpu->gpr[2] = cpu->gpr[17] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = cpu->gpr[17] & 0x3Fu; + PGXP_ALU(0x3222003Fu, cpu->gpr[2], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC02774u); #endif @@ -39626,7 +39659,8 @@ label_BFC02784: psx_cyc_step(cpu, 0x90004u); #endif /* 0xBFC0278C: 0270102A slt $v0, $s3, $s0 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0270102Au, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0278Cu); #endif @@ -42244,7 +42278,8 @@ label_BFC02A20: psx_cyc_step(cpu, 0x40004u); #endif /* 0xBFC02A28: 3242007F andi $v0, $s2, 0x7F */ - cpu->gpr[2] = cpu->gpr[18] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[2] = cpu->gpr[18] & 0x7Fu; + PGXP_ALU(0x3242007Fu, cpu->gpr[2], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC02A28u); #endif @@ -42317,7 +42352,8 @@ label_BFC02A34: psx_cyc_step(cpu, 0x40004u); #endif /* 0xBFC02A3C: 0242102B sltu $v0, $s2, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[18] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[18] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0242102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02A3Cu); #endif @@ -42659,7 +42695,8 @@ label_BFC02A9C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC02AA4: 30428000 andi $v0, $v0, 0x8000 */ - cpu->gpr[2] = cpu->gpr[2] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x8000u; + PGXP_ALU(0x30428000u, cpu->gpr[2], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0xBFC02AA4u); #endif @@ -42891,7 +42928,8 @@ label_BFC02AD4: psx_cyc_step(cpu, 0x40008u); #endif /* 0xBFC02AD4: 3243003F andi $v1, $s2, 0x3F */ - cpu->gpr[3] = cpu->gpr[18] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[3] = cpu->gpr[18] & 0x3Fu; + PGXP_ALU(0x3243003Fu, cpu->gpr[3], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC02AD4u); #endif @@ -42988,7 +43026,8 @@ label_BFC02AE4: psx_cyc_step(cpu, 0x280004u); #endif /* 0xBFC02AEC: 0275102A slt $v0, $s3, $s5 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0275102Au, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02AECu); #endif @@ -50849,7 +50888,8 @@ label_BFC032B4: psx_cyc_step(cpu, 0x40010004u); #endif /* 0xBFC032C4: 021E102B sltu $v0, $s0, $fp */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[30] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[30]; cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[30] ? 1 : 0); + PGXP_ALU(0x021E102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC032C4u); #endif @@ -51113,7 +51153,8 @@ label_BFC0330C: psx_cyc_step(cpu, 0x20108u); #endif /* 0xBFC0330C: 0228182A slt $v1, $s1, $t0 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0228182Au, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0330Cu); #endif @@ -51429,7 +51470,8 @@ label_BFC03354: psx_cyc_step(cpu, 0x244u); #endif /* 0xBFC03354: 0049302A slt $a2, $v0, $t1 */ - cpu->gpr[6] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[6] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0049302Au, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03354u); #endif @@ -53045,7 +53087,8 @@ label_BFC034F8: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC03504: 00641826 xor $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] ^ cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] ^ cpu->gpr[4]; + PGXP_ALU(0x00641826u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03504u); #endif @@ -53412,7 +53455,8 @@ label_BFC03564: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0356C: 30430001 andi $v1, $v0, 0x1 */ - cpu->gpr[3] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30430001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0356Cu); #endif @@ -53496,7 +53540,8 @@ label_BFC0357C: psx_cyc_step(cpu, 0x110004u); #endif /* 0xBFC03580: 0214102B sltu $v0, $s0, $s4 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[20] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[20] ? 1 : 0); + PGXP_ALU(0x0214102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03580u); #endif @@ -53888,7 +53933,8 @@ label_BFC035D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC035D0: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC035D0u); #endif @@ -54177,7 +54223,8 @@ label_BFC03610: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC0361C: 2C84001A sltiu $a0, $a0, 26 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2C84001Au, cpu->gpr[4], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0361Cu); #endif @@ -54231,7 +54278,8 @@ label_BFC03628: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC03628: 00451024 and $v0, $v0, $a1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[5]; + PGXP_ALU(0x00451024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03628u); #endif @@ -55022,7 +55070,8 @@ label_BFC036E0: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC036E4: 30C207FF andi $v0, $a2, 0x7FF */ - cpu->gpr[2] = cpu->gpr[6] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[6] & 0x7FFu; + PGXP_ALU(0x30C207FFu, cpu->gpr[2], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC036E4u); #endif @@ -55144,7 +55193,8 @@ label_BFC03700: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC03708: 304307FF andi $v1, $v0, 0x7FF */ - cpu->gpr[3] = cpu->gpr[2] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x7FFu; + PGXP_ALU(0x304307FFu, cpu->gpr[3], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03708u); #endif @@ -55260,7 +55310,8 @@ label_BFC0371C: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC03724: 0043102B sltu $v0, $v0, $v1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03724u); #endif @@ -55461,7 +55512,8 @@ label_BFC03758: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC03758: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC03758u); #endif @@ -55899,7 +55951,8 @@ label_BFC037C0: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC037CC: 02221024 and $v0, $s1, $v0 */ - cpu->gpr[2] = cpu->gpr[17] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[17] & cpu->gpr[2]; + PGXP_ALU(0x02221024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC037CCu); #endif @@ -55922,7 +55975,8 @@ label_BFC037C0: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC037D4: 00A4202B sltu $a0, $a1, $a0 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x00A4202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC037D4u); #endif @@ -56199,7 +56253,8 @@ label_BFC0380C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0380C: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC0380Cu); #endif @@ -57844,7 +57899,8 @@ label_BFC039B0: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC039B0: 2CC6001A sltiu $a2, $a2, 26 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[6] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = (uint32_t)(cpu->gpr[6] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2CC6001Au, cpu->gpr[6], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC039B0u); #endif @@ -57898,7 +57954,8 @@ label_BFC039BC: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC039BC: 00681824 and $v1, $v1, $t0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[8]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[8]; + PGXP_ALU(0x00681824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC039BCu); #endif @@ -58162,7 +58219,8 @@ label_BFC039FC: psx_cyc_step(cpu, 0xC8u); #endif /* 0xBFC039FC: 00C3382B sltu $a3, $a2, $v1 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[6] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[7] = (uint32_t)(cpu->gpr[6] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x00C3382Bu, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC039FCu); #endif @@ -58215,7 +58273,8 @@ label_BFC03A08: psx_cyc_step(cpu, 0x4Cu); #endif /* 0xBFC03A08: 0043302B sltu $a2, $v0, $v1 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043302Bu, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03A08u); #endif @@ -58563,7 +58622,8 @@ label_BFC03A54: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC03A54: 2C84001A sltiu $a0, $a0, 26 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2C84001Au, cpu->gpr[4], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC03A54u); #endif @@ -58617,7 +58677,8 @@ label_BFC03A60: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC03A60: 00461024 and $v0, $v0, $a2 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + PGXP_ALU(0x00461024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03A60u); #endif @@ -62272,7 +62333,8 @@ label_BFC03DE0: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC03DEC: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03DECu); #endif @@ -62347,7 +62409,8 @@ label_BFC03DF8: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC03DFC: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03DFCu); #endif @@ -62358,7 +62421,8 @@ label_BFC03DF8: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC03E00: 2CA51733 sltiu $a1, $a1, 5939 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < 0x00001733u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < 0x00001733u ? 1 : 0); + PGXP_ALU(0x2CA51733u, cpu->gpr[5], _pgx1, 0x1733u); } #ifdef PSX_COSIM cosim_instr(0xBFC03E00u); #endif @@ -62475,7 +62539,8 @@ label_BFC03E10: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC03E20: 0085282B sltu $a1, $a0, $a1 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[4] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[5] = (uint32_t)(cpu->gpr[4] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0085282Bu, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03E20u); #endif @@ -62628,7 +62693,8 @@ label_BFC03E2C: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC03E50: 3082FFFF andi $v0, $a0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3082FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03E50u); #endif @@ -62833,7 +62899,8 @@ label_BFC03E70: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC03E74: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03E74u); #endif @@ -62844,7 +62911,8 @@ label_BFC03E70: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC03E78: 2C42037F sltiu $v0, $v0, 895 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000037Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000037Fu ? 1 : 0); + PGXP_ALU(0x2C42037Fu, cpu->gpr[2], _pgx1, 0x037Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC03E78u); #endif @@ -62997,7 +63065,8 @@ label_BFC03E94: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC03EA0: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03EA0u); #endif @@ -63116,7 +63185,8 @@ label_BFC03EC0: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC03EC0: 3063FFFF andi $v1, $v1, 0xFFFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + PGXP_ALU(0x3063FFFFu, cpu->gpr[3], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03EC0u); #endif @@ -63127,7 +63197,8 @@ label_BFC03EC0: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC03EC4: 2C630FD4 sltiu $v1, $v1, 4052 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000FD4u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000FD4u ? 1 : 0); + PGXP_ALU(0x2C630FD4u, cpu->gpr[3], _pgx1, 0x0FD4u); } #ifdef PSX_COSIM cosim_instr(0xBFC03EC4u); #endif @@ -67424,7 +67495,8 @@ label_BFC04304: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC04304: 2C830010 sltiu $v1, $a0, 16 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < 0x00000010u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < 0x00000010u ? 1 : 0); + PGXP_ALU(0x2C830010u, cpu->gpr[3], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC04304u); #endif @@ -68746,7 +68818,8 @@ label_BFC0443C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC04440: 2C42000A sltiu $v0, $v0, 10 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2C42000Au, cpu->gpr[2], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC04440u); #endif @@ -69220,7 +69293,8 @@ label_BFC044B0: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC044B0: 2D08000A sltiu $t0, $t0, 10 */ - cpu->gpr[8] = (uint32_t)(cpu->gpr[8] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = (uint32_t)(cpu->gpr[8] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2D08000Au, cpu->gpr[8], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC044B0u); #endif @@ -69514,7 +69588,8 @@ label_BFC044F0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC044F8: 30421000 andi $v0, $v0, 0x1000 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1000u; + PGXP_ALU(0x30421000u, cpu->gpr[2], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0xBFC044F8u); #endif @@ -70320,7 +70395,8 @@ label_BFC045B8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC045CC: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC045CCu); #endif @@ -73347,7 +73423,8 @@ label_BFC048AC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC048B4: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC048B4u); #endif @@ -73599,7 +73676,8 @@ label_BFC048E4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC048F4: 30420004 andi $v0, $v0, 0x4 */ - cpu->gpr[2] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30420004u, cpu->gpr[2], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC048F4u); #endif @@ -74633,7 +74711,8 @@ label_BFC049E0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC049E8: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC049E8u); #endif @@ -74885,7 +74964,8 @@ label_BFC04A18: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC04A28: 30420004 andi $v0, $v0, 0x4 */ - cpu->gpr[2] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30420004u, cpu->gpr[2], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC04A28u); #endif @@ -77343,7 +77423,8 @@ label_BFC04C70: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC04C74: 00621024 and $v0, $v1, $v0 */ - cpu->gpr[2] = cpu->gpr[3] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[3] & cpu->gpr[2]; + PGXP_ALU(0x00621024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04C74u); #endif @@ -78209,7 +78290,8 @@ label_BFC04D3C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC04D44: 30420007 andi $v0, $v0, 0x7 */ - cpu->gpr[2] = cpu->gpr[2] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x7u; + PGXP_ALU(0x30420007u, cpu->gpr[2], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0xBFC04D44u); #endif @@ -78712,7 +78794,8 @@ label_BFC04DB8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC04DC0: 3042007F andi $v0, $v0, 0x7F */ - cpu->gpr[2] = cpu->gpr[2] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x7Fu; + PGXP_ALU(0x3042007Fu, cpu->gpr[2], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC04DC0u); #endif @@ -79103,7 +79186,8 @@ label_BFC04E1C: psx_cyc_step(cpu, 0x30008u); #endif /* 0xBFC04E20: 0230182B sltu $v1, $s1, $s0 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[17] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[3] = (uint32_t)(cpu->gpr[17] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04E20u); #endif @@ -79608,7 +79692,8 @@ label_BFC04E84: psx_cyc_step(cpu, 0x50008u); #endif /* 0xBFC04E84: 0212182B sltu $v1, $s0, $s2 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[16] < cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[3] = (uint32_t)(cpu->gpr[16] < cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0212182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04E84u); #endif @@ -79815,7 +79900,8 @@ label_BFC04EB0: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC04EB0: 28430020 slti $v1, $v0, 32 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (32) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (32) ? 1 : 0); + PGXP_ALU(0x28430020u, cpu->gpr[3], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0xBFC04EB0u); #endif @@ -79900,7 +79986,8 @@ label_BFC04EC4: psx_cyc_step(cpu, 0x50004u); #endif /* 0xBFC04EC4: 0212102B sltu $v0, $s0, $s2 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0212102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04EC4u); #endif @@ -83370,7 +83457,8 @@ label_BFC0522C: psx_cyc_step(cpu, 0x80008u); #endif /* 0xBFC05234: 00731824 and $v1, $v1, $s3 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[19]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[19]; + PGXP_ALU(0x00731824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC05234u); #endif @@ -83451,7 +83539,8 @@ label_BFC05240: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC05248: 30C3FFFF andi $v1, $a2, 0xFFFF */ - cpu->gpr[3] = cpu->gpr[6] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[3] = cpu->gpr[6] & 0xFFFFu; + PGXP_ALU(0x30C3FFFFu, cpu->gpr[3], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC05248u); #endif @@ -83474,7 +83563,8 @@ label_BFC05240: psx_cyc_step(cpu, 0x10000u); #endif /* 0xBFC05250: 3210FFFF andi $s0, $s0, 0xFFFF */ - cpu->gpr[16] = cpu->gpr[16] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[16] = cpu->gpr[16] & 0xFFFFu; + PGXP_ALU(0x3210FFFFu, cpu->gpr[16], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC05250u); #endif @@ -84170,7 +84260,8 @@ label_BFC052F4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC05308: 00621824 and $v1, $v1, $v0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[2]; + PGXP_ALU(0x00621824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC05308u); #endif @@ -84299,7 +84390,8 @@ label_BFC05324: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC0532C: 00641824 and $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + PGXP_ALU(0x00641824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0532Cu); #endif @@ -84708,7 +84800,8 @@ label_BFC05384: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC0538C: 00641824 and $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + PGXP_ALU(0x00641824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0538Cu); #endif @@ -84825,7 +84918,8 @@ label_BFC053A4: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC053AC: 00441024 and $v0, $v0, $a0 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[4]; + PGXP_ALU(0x00441024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC053ACu); #endif @@ -85188,7 +85282,8 @@ label_BFC053E0: psx_cyc_step(cpu, 0x50u); #endif /* 0xBFC05410: 30C4FFFF andi $a0, $a2, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[6] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[4] = cpu->gpr[6] & 0xFFFFu; + PGXP_ALU(0x30C4FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC05410u); #endif @@ -86811,7 +86906,8 @@ label_BFC055D8: psx_cyc_step(cpu, 0x38u); #endif /* 0xBFC055D8: 0065202B sltu $a0, $v1, $a1 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[3] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[4] = (uint32_t)(cpu->gpr[3] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0065202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC055D8u); #endif @@ -87079,7 +87175,8 @@ label_BFC05618: psx_cyc_step(cpu, 0x38u); #endif /* 0xBFC05618: 0064282B sltu $a1, $v1, $a0 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[5] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064282Bu, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC05618u); #endif @@ -87705,7 +87802,8 @@ label_BFC056B4: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC056B4: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC056B4u); #endif @@ -87922,7 +88020,8 @@ label_BFC056EC: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC056EC: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC056ECu); #endif @@ -88128,7 +88227,8 @@ label_BFC05724: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC05724: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC05724u); #endif @@ -88275,7 +88375,8 @@ label_BFC0574C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC0574C: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0574Cu); #endif @@ -88526,7 +88627,8 @@ label_BFC0578C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC0578C: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0578Cu); #endif @@ -89314,7 +89416,8 @@ label_BFC05858: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0585C: 2C63001A sltiu $v1, $v1, 26 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2C63001Au, cpu->gpr[3], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0585Cu); #endif @@ -89380,7 +89483,8 @@ label_BFC05868: psx_cyc_step(cpu, 0x1Cu); #endif /* 0xBFC0586C: 00831024 and $v0, $a0, $v1 */ - cpu->gpr[2] = cpu->gpr[4] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[4] & cpu->gpr[3]; + PGXP_ALU(0x00831024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0586Cu); #endif @@ -89464,7 +89568,8 @@ label_BFC05878: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0587C: 2C63001A sltiu $v1, $v1, 26 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2C63001Au, cpu->gpr[3], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0587Cu); #endif @@ -90541,7 +90646,8 @@ label_BFC05958: psx_cyc_step(cpu, 0x90u); #endif /* 0xBFC05960: 2C870001 sltiu $a3, $a0, 1 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[4] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[7] = (uint32_t)(cpu->gpr[4] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C870001u, cpu->gpr[7], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC05960u); #endif @@ -95822,7 +95928,8 @@ label_BFC05E74: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC05E78: 2C43000A sltiu $v1, $v0, 10 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2C43000Au, cpu->gpr[3], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC05E78u); #endif @@ -95887,7 +95994,8 @@ label_BFC05E84: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC05E88: 00821024 and $v0, $a0, $v0 */ - cpu->gpr[2] = cpu->gpr[4] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[4] & cpu->gpr[2]; + PGXP_ALU(0x00821024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC05E88u); #endif @@ -95910,7 +96018,8 @@ label_BFC05E84: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC05E90: 2C420006 sltiu $v0, $v0, 6 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000006u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000006u ? 1 : 0); + PGXP_ALU(0x2C420006u, cpu->gpr[2], _pgx1, 0x0006u); } #ifdef PSX_COSIM cosim_instr(0xBFC05E90u); #endif @@ -96011,7 +96120,8 @@ label_BFC05EA4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC05EA8: 2C42001A sltiu $v0, $v0, 26 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2C42001Au, cpu->gpr[2], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC05EA8u); #endif @@ -96157,7 +96267,8 @@ label_BFC05EC4: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC05EC8: 00442026 xor $a0, $v0, $a0 */ - cpu->gpr[4] = cpu->gpr[2] ^ cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[2] ^ cpu->gpr[4]; + PGXP_ALU(0x00442026u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC05EC8u); #endif @@ -97072,7 +97183,8 @@ label_BFC05F90: psx_cyc_step(cpu, 0x4Cu); #endif /* 0xBFC05F94: 0043302B sltu $a2, $v0, $v1 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043302Bu, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC05F94u); #endif @@ -97473,7 +97585,8 @@ label_BFC05FE4: psx_cyc_step(cpu, 0x4Cu); #endif /* 0xBFC05FE8: 0043302B sltu $a2, $v0, $v1 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043302Bu, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC05FE8u); #endif @@ -98786,7 +98899,8 @@ label_BFC060E4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0610C: 30427FFF andi $v0, $v0, 0x7FFF */ - cpu->gpr[2] = cpu->gpr[2] & 0x7FFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x7FFFu; + PGXP_ALU(0x30427FFFu, cpu->gpr[2], _pgx1, 0x7FFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0610Cu); #endif @@ -99426,7 +99540,8 @@ label_BFC061A0: psx_cyc_step(cpu, 0x20044u); #endif /* 0xBFC061A0: 0226102A slt $v0, $s1, $a2 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0226102Au, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC061A0u); #endif @@ -99937,7 +100052,8 @@ label_BFC06220: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC06220: 2C82000F sltiu $v0, $a0, 15 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[4] < 0x0000000Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = (uint32_t)(cpu->gpr[4] < 0x0000000Fu ? 1 : 0); + PGXP_ALU(0x2C82000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC06220u); #endif @@ -100639,7 +100755,8 @@ label_BFC062A8: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC062BC: 00A21024 and $v0, $a1, $v0 */ - cpu->gpr[2] = cpu->gpr[5] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[5] & cpu->gpr[2]; + PGXP_ALU(0x00A21024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC062BCu); #endif @@ -100671,7 +100788,8 @@ label_BFC062C0: psx_cyc_step(cpu, 0x50u); #endif /* 0xBFC062C0: 28860009 slti $a2, $a0, 9 */ - cpu->gpr[6] = (uint32_t)((int32_t)cpu->gpr[4] < (9) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[6] = (uint32_t)((int32_t)cpu->gpr[4] < (9) ? 1 : 0); + PGXP_ALU(0x28860009u, cpu->gpr[6], _pgx1, 0x0009u); } #ifdef PSX_COSIM cosim_instr(0xBFC062C0u); #endif @@ -101246,7 +101364,8 @@ label_BFC06348: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC06348: 28430800 slti $v1, $v0, 2048 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (2048) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (2048) ? 1 : 0); + PGXP_ALU(0x28430800u, cpu->gpr[3], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0xBFC06348u); #endif @@ -102912,7 +103031,8 @@ label_BFC064E4: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC064E8: 2CA5001A sltiu $a1, $a1, 26 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2CA5001Au, cpu->gpr[5], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC064E8u); #endif @@ -102966,7 +103086,8 @@ label_BFC064F4: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC064F4: 00461024 and $v0, $v0, $a2 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + PGXP_ALU(0x00461024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC064F4u); #endif @@ -105726,7 +105847,8 @@ label_BFC067D4: psx_cyc_step(cpu, 0x80028u); #endif /* 0xBFC067D4: 0073282A slt $a1, $v1, $s3 */ - cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0073282Au, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC067D4u); #endif @@ -105811,7 +105933,8 @@ label_BFC067E8: psx_cyc_step(cpu, 0x40048u); #endif /* 0xBFC067E8: 0072302A slt $a2, $v1, $s2 */ - cpu->gpr[6] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[6] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0072302Au, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC067E8u); #endif @@ -106917,7 +107040,8 @@ label_BFC068F8: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC068F8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC068F8u); #endif @@ -107065,7 +107189,8 @@ label_BFC06924: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC06924: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06924u); #endif @@ -107577,7 +107702,8 @@ label_BFC069A8: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC069AC: 2C820005 sltiu $v0, $a0, 5 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[4] < 0x00000005u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = (uint32_t)(cpu->gpr[4] < 0x00000005u ? 1 : 0); + PGXP_ALU(0x2C820005u, cpu->gpr[2], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0xBFC069ACu); #endif @@ -109990,7 +110116,8 @@ label_BFC06BC8: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC06BC8: 2C64000A sltiu $a0, $v1, 10 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[3] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[4] = (uint32_t)(cpu->gpr[3] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2C64000Au, cpu->gpr[4], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC06BC8u); #endif @@ -110117,7 +110244,8 @@ label_BFC06BE4: psx_cyc_step(cpu, 0x1108u); #endif /* 0xBFC06BE4: 010C1824 and $v1, $t0, $t4 */ - cpu->gpr[3] = cpu->gpr[8] & cpu->gpr[12]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[3] = cpu->gpr[8] & cpu->gpr[12]; + PGXP_ALU(0x010C1824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC06BE4u); #endif @@ -110140,7 +110268,8 @@ label_BFC06BE4: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC06BEC: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06BECu); #endif @@ -110151,7 +110280,8 @@ label_BFC06BE4: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC06BF0: 2C630006 sltiu $v1, $v1, 6 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000006u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000006u ? 1 : 0); + PGXP_ALU(0x2C630006u, cpu->gpr[3], _pgx1, 0x0006u); } #ifdef PSX_COSIM cosim_instr(0xBFC06BF0u); #endif @@ -110216,7 +110346,8 @@ label_BFC06BFC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC06C00: 2C42001A sltiu $v0, $v0, 26 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2C42001Au, cpu->gpr[2], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC06C00u); #endif @@ -110469,7 +110600,8 @@ label_BFC06C38: psx_cyc_step(cpu, 0x500u); #endif /* 0xBFC06C40: 310A00FF andi $t2, $t0, 0xFF */ - cpu->gpr[10] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[10] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310A00FFu, cpu->gpr[10], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06C40u); #endif @@ -111165,7 +111297,8 @@ label_BFC06C7C: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC06CB0: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC06CB0u); #endif @@ -111939,7 +112072,8 @@ label_BFC06D78: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC06D80: 2C430021 sltiu $v1, $v0, 33 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000021u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000021u ? 1 : 0); + PGXP_ALU(0x2C430021u, cpu->gpr[3], _pgx1, 0x0021u); } #ifdef PSX_COSIM cosim_instr(0xBFC06D80u); #endif @@ -113276,7 +113410,8 @@ label_BFC06ED8: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC06EE0: 3068000F andi $t0, $v1, 0xF */ - cpu->gpr[8] = cpu->gpr[3] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[8] = cpu->gpr[3] & 0xFu; + PGXP_ALU(0x3068000Fu, cpu->gpr[8], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC06EE0u); #endif @@ -114891,7 +115026,8 @@ label_BFC07074: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC07080: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07080u); #endif @@ -116895,7 +117031,8 @@ label_BFC0728C: psx_cyc_step(cpu, 0x84u); #endif /* 0xBFC07290: 28E2000B slti $v0, $a3, 11 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[7] < (11) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[7] < (11) ? 1 : 0); + PGXP_ALU(0x28E2000Bu, cpu->gpr[2], _pgx1, 0x000Bu); } #ifdef PSX_COSIM cosim_instr(0xBFC07290u); #endif @@ -117825,7 +117962,8 @@ label_BFC07354: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC07360: 306400FF andi $a0, $v1, 0xFF */ - cpu->gpr[4] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[4] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC07360u); #endif @@ -117836,7 +117974,8 @@ label_BFC07354: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC07364: 2C84000E sltiu $a0, $a0, 14 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x0000000Eu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x0000000Eu ? 1 : 0); + PGXP_ALU(0x2C84000Eu, cpu->gpr[4], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0xBFC07364u); #endif @@ -117890,7 +118029,8 @@ label_BFC07370: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC07370: 30840001 andi $a0, $a0, 0x1 */ - cpu->gpr[4] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30840001u, cpu->gpr[4], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC07370u); #endif @@ -119578,7 +119718,8 @@ label_BFC07510: psx_cyc_step(cpu, 0x30004u); #endif /* 0xBFC07514: 0211102B sltu $v0, $s0, $s1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0211102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07514u); #endif @@ -122137,7 +122278,8 @@ label_BFC0776C: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC07784: 30E70001 andi $a3, $a3, 0x1 */ - cpu->gpr[7] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E70001u, cpu->gpr[7], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC07784u); #endif @@ -122225,7 +122367,8 @@ label_BFC07798: psx_cyc_step(cpu, 0xA0u); #endif /* 0xBFC07798: 2CA70401 sltiu $a3, $a1, 1025 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[5] < 0x00000401u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[7] = (uint32_t)(cpu->gpr[5] < 0x00000401u ? 1 : 0); + PGXP_ALU(0x2CA70401u, cpu->gpr[7], _pgx1, 0x0401u); } #ifdef PSX_COSIM cosim_instr(0xBFC07798u); #endif @@ -122747,7 +122890,8 @@ label_BFC07814: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC0782C: 30E70001 andi $a3, $a3, 0x1 */ - cpu->gpr[7] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E70001u, cpu->gpr[7], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0782Cu); #endif @@ -122835,7 +122979,8 @@ label_BFC07840: psx_cyc_step(cpu, 0xA0u); #endif /* 0xBFC07840: 2CA70401 sltiu $a3, $a1, 1025 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[5] < 0x00000401u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[7] = (uint32_t)(cpu->gpr[5] < 0x00000401u ? 1 : 0); + PGXP_ALU(0x2CA70401u, cpu->gpr[7], _pgx1, 0x0401u); } #ifdef PSX_COSIM cosim_instr(0xBFC07840u); #endif @@ -123353,7 +123498,8 @@ label_BFC078BC: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC078D4: 30C60001 andi $a2, $a2, 0x1 */ - cpu->gpr[6] = cpu->gpr[6] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x1u; + PGXP_ALU(0x30C60001u, cpu->gpr[6], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC078D4u); #endif @@ -123923,7 +124069,8 @@ label_BFC07968: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC07980: 306300FE andi $v1, $v1, 0xFE */ - cpu->gpr[3] = cpu->gpr[3] & 0xFEu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFEu; + PGXP_ALU(0x306300FEu, cpu->gpr[3], _pgx1, 0x00FEu); } #ifdef PSX_COSIM cosim_instr(0xBFC07980u); #endif @@ -124216,7 +124363,8 @@ label_BFC079C8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC079DC: 2C420002 sltiu $v0, $v0, 2 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC079DCu); #endif @@ -124541,7 +124689,8 @@ label_BFC07A24: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC07A38: 30630010 andi $v1, $v1, 0x10 */ - cpu->gpr[3] = cpu->gpr[3] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x10u; + PGXP_ALU(0x30630010u, cpu->gpr[3], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC07A38u); #endif @@ -125456,7 +125605,8 @@ label_BFC07B18: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC07B20: 30420004 andi $v0, $v0, 0x4 */ - cpu->gpr[2] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30420004u, cpu->gpr[2], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC07B20u); #endif @@ -126150,7 +126300,8 @@ label_BFC07BE0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC07BE8: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC07BE8u); #endif @@ -126380,7 +126531,8 @@ label_BFC07C20: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC07C28: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC07C28u); #endif @@ -126474,7 +126626,8 @@ label_BFC07C34: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC07C44: 30420008 andi $v0, $v0, 0x8 */ - cpu->gpr[2] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30420008u, cpu->gpr[2], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC07C44u); #endif @@ -126931,7 +127084,8 @@ label_BFC07CA4: psx_cyc_step(cpu, 0x120u); #endif /* 0xBFC07CAC: 28A87403 slti $t0, $a1, 29699 */ - cpu->gpr[8] = (uint32_t)((int32_t)cpu->gpr[5] < (29699) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[8] = (uint32_t)((int32_t)cpu->gpr[5] < (29699) ? 1 : 0); + PGXP_ALU(0x28A87403u, cpu->gpr[8], _pgx1, 0x7403u); } #ifdef PSX_COSIM cosim_instr(0xBFC07CACu); #endif @@ -127729,7 +127883,8 @@ label_BFC07D68: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC07D6C: 00651824 and $v1, $v1, $a1 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[5]; + PGXP_ALU(0x00651824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07D6Cu); #endif @@ -128406,7 +128561,8 @@ label_BFC07E14: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC07E14: 30680003 andi $t0, $v1, 0x3 */ - cpu->gpr[8] = cpu->gpr[3] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[8] = cpu->gpr[3] & 0x3u; + PGXP_ALU(0x30680003u, cpu->gpr[8], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0xBFC07E14u); #endif @@ -128543,7 +128699,8 @@ label_BFC07E30: psx_cyc_step(cpu, 0x8080u); #endif /* 0xBFC07E30: 00EF3824 and $a3, $a3, $t7 */ - cpu->gpr[7] = cpu->gpr[7] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[7] = cpu->gpr[7] & cpu->gpr[15]; + PGXP_ALU(0x00EF3824u, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07E30u); #endif @@ -128573,7 +128730,8 @@ label_BFC07E34: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC07E38: 01074026 xor $t0, $t0, $a3 */ - cpu->gpr[8] = cpu->gpr[8] ^ cpu->gpr[7]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[8] = cpu->gpr[8] ^ cpu->gpr[7]; + PGXP_ALU(0x01074026u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07E38u); #endif @@ -128584,7 +128742,8 @@ label_BFC07E34: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC07E3C: 3908003D xori $t0, $t0, 0x3D */ - cpu->gpr[8] = cpu->gpr[8] ^ 0x3Du; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] ^ 0x3Du; + PGXP_ALU(0x3908003Du, cpu->gpr[8], _pgx1, 0x003Du); } #ifdef PSX_COSIM cosim_instr(0xBFC07E3Cu); #endif @@ -128631,7 +128790,8 @@ label_BFC07E34: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC07E4C: 00E83826 xor $a3, $a3, $t0 */ - cpu->gpr[7] = cpu->gpr[7] ^ cpu->gpr[8]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[7] = cpu->gpr[7] ^ cpu->gpr[8]; + PGXP_ALU(0x00E83826u, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07E4Cu); #endif @@ -128684,7 +128844,8 @@ label_BFC07E34: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC07E5C: 00E83826 xor $a3, $a3, $t0 */ - cpu->gpr[7] = cpu->gpr[7] ^ cpu->gpr[8]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[7] = cpu->gpr[7] ^ cpu->gpr[8]; + PGXP_ALU(0x00E83826u, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07E5Cu); #endif @@ -128790,7 +128951,8 @@ label_BFC07E74: psx_cyc_step(cpu, 0x2080u); #endif /* 0xBFC07E78: 00ED3824 and $a3, $a3, $t5 */ - cpu->gpr[7] = cpu->gpr[7] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[7] = cpu->gpr[7] & cpu->gpr[13]; + PGXP_ALU(0x00ED3824u, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07E78u); #endif @@ -134818,7 +134980,8 @@ label_BFC08478: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC08478: 2CA20002 sltiu $v0, $a1, 2 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[5] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[2] = (uint32_t)(cpu->gpr[5] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2CA20002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC08478u); #endif @@ -135180,7 +135343,8 @@ label_BFC084D4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC084D8: 0043182B sltu $v1, $v0, $v1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC084D8u); #endif @@ -135763,7 +135927,8 @@ label_BFC08570: psx_cyc_step(cpu, 0x10004u); #endif /* 0xBFC08574: 0050102B sltu $v0, $v0, $s0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0050102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08574u); #endif @@ -135836,7 +136001,8 @@ label_BFC08584: psx_cyc_step(cpu, 0x280004u); #endif /* 0xBFC08584: 0275102B sltu $v0, $s3, $s5 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[19] < cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[2] = (uint32_t)(cpu->gpr[19] < cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0275102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08584u); #endif @@ -136446,7 +136612,8 @@ label_BFC08604: psx_cyc_step(cpu, 0x38u); #endif /* 0xBFC08604: 0085182B sltu $v1, $a0, $a1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0085182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08604u); #endif @@ -136500,7 +136667,8 @@ label_BFC08610: psx_cyc_step(cpu, 0x38u); #endif /* 0xBFC08610: 00A4182B sltu $v1, $a1, $a0 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x00A4182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08610u); #endif @@ -136597,7 +136765,8 @@ label_BFC08624: psx_cyc_step(cpu, 0x50u); #endif /* 0xBFC08628: 0086202B sltu $a0, $a0, $a2 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0086202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08628u); #endif @@ -137097,7 +137266,8 @@ label_BFC08688: psx_cyc_step(cpu, 0x188u); #endif /* 0xBFC08698: 0067402B sltu $t0, $v1, $a3 */ - cpu->gpr[8] = (uint32_t)(cpu->gpr[3] < cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[8] = (uint32_t)(cpu->gpr[3] < cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0067402Bu, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08698u); #endif @@ -137118,7 +137288,8 @@ label_BFC08688: psx_cyc_step(cpu, 0x88u); #endif /* 0xBFC086A0: 00E3182B sltu $v1, $a3, $v1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[7] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[7] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x00E3182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC086A0u); #endif @@ -137620,7 +137791,8 @@ label_BFC086E8: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC086E8: 2CC20025 sltiu $v0, $a2, 37 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[6] < 0x00000025u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[2] = (uint32_t)(cpu->gpr[6] < 0x00000025u ? 1 : 0); + PGXP_ALU(0x2CC20025u, cpu->gpr[2], _pgx1, 0x0025u); } #ifdef PSX_COSIM cosim_instr(0xBFC086E8u); #endif @@ -138087,7 +138259,8 @@ label_BFC08760: psx_cyc_step(cpu, 0x1000000u); #endif /* 0xBFC08760: 331800FF andi $t8, $t8, 0xFF */ - cpu->gpr[24] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[24] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x331800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08760u); #endif @@ -138098,7 +138271,8 @@ label_BFC08760: psx_cyc_step(cpu, 0x1000000u); #endif /* 0xBFC08764: 2F180005 sltiu $t8, $t8, 5 */ - cpu->gpr[24] = (uint32_t)(cpu->gpr[24] < 0x00000005u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[24] = (uint32_t)(cpu->gpr[24] < 0x00000005u ? 1 : 0); + PGXP_ALU(0x2F180005u, cpu->gpr[24], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0xBFC08764u); #endif @@ -138413,7 +138587,8 @@ label_BFC087A8: psx_cyc_step(cpu, 0x1002000u); #endif /* 0xBFC087A8: 030DC024 and $t8, $t8, $t5 */ - cpu->gpr[24] = cpu->gpr[24] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[24] = cpu->gpr[24] & cpu->gpr[13]; + PGXP_ALU(0x030DC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC087A8u); #endif @@ -138424,7 +138599,8 @@ label_BFC087A8: psx_cyc_step(cpu, 0x1000000u); #endif /* 0xBFC087AC: 331800FF andi $t8, $t8, 0xFF */ - cpu->gpr[24] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[24] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x331800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC087ACu); #endif @@ -138519,7 +138695,8 @@ label_BFC087C0: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC087C0: 3863002D xori $v1, $v1, 0x2D */ - cpu->gpr[3] = cpu->gpr[3] ^ 0x2Du; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] ^ 0x2Du; + PGXP_ALU(0x3863002Du, cpu->gpr[3], _pgx1, 0x002Du); } #ifdef PSX_COSIM cosim_instr(0xBFC087C0u); #endif @@ -138530,7 +138707,8 @@ label_BFC087C0: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC087C4: 2C630001 sltiu $v1, $v1, 1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C630001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC087C4u); #endif @@ -138773,7 +138951,8 @@ label_BFC087F4: psx_cyc_step(cpu, 0xC8u); #endif /* 0xBFC087F8: 0066382A slt $a3, $v1, $a2 */ - cpu->gpr[7] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[7] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0066382Au, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC087F8u); #endif @@ -138857,7 +139036,8 @@ label_BFC08804: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0880C: 0062102B sltu $v0, $v1, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0880Cu); #endif @@ -138878,7 +139058,8 @@ label_BFC08804: psx_cyc_step(cpu, 0x80Cu); #endif /* 0xBFC08814: 006B102B sltu $v0, $v1, $t3 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[3] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[2] = (uint32_t)(cpu->gpr[3] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x006B102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08814u); #endif @@ -139473,7 +139654,8 @@ label_BFC08898: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC08898: 30E700FF andi $a3, $a3, 0xFF */ - cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30E700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08898u); #endif @@ -139484,7 +139666,8 @@ label_BFC08898: psx_cyc_step(cpu, 0x1000080u); #endif /* 0xBFC0889C: 2CF8000A sltiu $t8, $a3, 10 */ - cpu->gpr[24] = (uint32_t)(cpu->gpr[7] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[24] = (uint32_t)(cpu->gpr[7] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2CF8000Au, cpu->gpr[24], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0889Cu); #endif @@ -139549,7 +139732,8 @@ label_BFC088A8: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC088AC: 30E700FF andi $a3, $a3, 0xFF */ - cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30E700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC088ACu); #endif @@ -139560,7 +139744,8 @@ label_BFC088A8: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC088B0: 2CE7001A sltiu $a3, $a3, 26 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[7] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = (uint32_t)(cpu->gpr[7] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2CE7001Au, cpu->gpr[7], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC088B0u); #endif @@ -139614,7 +139799,8 @@ label_BFC088BC: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC088BC: 30E700FF andi $a3, $a3, 0xFF */ - cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30E700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC088BCu); #endif @@ -139625,7 +139811,8 @@ label_BFC088BC: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC088C0: 2CE7001A sltiu $a3, $a3, 26 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[7] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = (uint32_t)(cpu->gpr[7] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2CE7001Au, cpu->gpr[7], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC088C0u); #endif @@ -141170,7 +141357,8 @@ label_BFC08A44: psx_cyc_step(cpu, 0x1000008u); #endif /* 0xBFC08A48: 2878002E slti $t8, $v1, 46 */ - cpu->gpr[24] = (uint32_t)((int32_t)cpu->gpr[3] < (46) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[24] = (uint32_t)((int32_t)cpu->gpr[3] < (46) ? 1 : 0); + PGXP_ALU(0x2878002Eu, cpu->gpr[24], _pgx1, 0x002Eu); } #ifdef PSX_COSIM cosim_instr(0xBFC08A48u); #endif @@ -141370,7 +141558,8 @@ label_BFC08A6C: psx_cyc_step(cpu, 0x200100u); #endif /* 0xBFC08A6C: 3AA80001 xori $t0, $s5, 0x1 */ - cpu->gpr[8] = cpu->gpr[21] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[21]; cpu->gpr[8] = cpu->gpr[21] ^ 0x1u; + PGXP_ALU(0x3AA80001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC08A6Cu); #endif @@ -141388,7 +141577,8 @@ label_BFC08A70: psx_cyc_step(cpu, 0x400110u); #endif /* 0xBFC08A70: 0104B024 and $s6, $t0, $a0 */ - cpu->gpr[22] = cpu->gpr[8] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[22] = cpu->gpr[8] & cpu->gpr[4]; + PGXP_ALU(0x0104B024u, cpu->gpr[22], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08A70u); #endif @@ -141580,7 +141770,8 @@ label_BFC08A98: psx_cyc_step(cpu, 0x90u); #endif /* 0xBFC08AA4: 28E4005B slti $a0, $a3, 91 */ - cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[7] < (91) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[7] < (91) ? 1 : 0); + PGXP_ALU(0x28E4005Bu, cpu->gpr[4], _pgx1, 0x005Bu); } #ifdef PSX_COSIM cosim_instr(0xBFC08AA4u); #endif @@ -141810,7 +142001,8 @@ label_BFC08AD8: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC08AD8: 2CA5000A sltiu $a1, $a1, 10 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2CA5000Au, cpu->gpr[5], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC08AD8u); #endif @@ -142152,7 +142344,8 @@ label_BFC08B28: psx_cyc_step(cpu, 0x200100u); #endif /* 0xBFC08B2C: 3AA80001 xori $t0, $s5, 0x1 */ - cpu->gpr[8] = cpu->gpr[21] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[21]; cpu->gpr[8] = cpu->gpr[21] ^ 0x1u; + PGXP_ALU(0x3AA80001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC08B2Cu); #endif @@ -142510,7 +142703,8 @@ label_BFC08B78: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC08B7C: 2C84000A sltiu $a0, $a0, 10 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2C84000Au, cpu->gpr[4], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC08B7Cu); #endif @@ -142531,7 +142725,8 @@ label_BFC08B78: psx_cyc_step(cpu, 0x90u); #endif /* 0xBFC08B84: 28E4005B slti $a0, $a3, 91 */ - cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[7] < (91) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[7] < (91) ? 1 : 0); + PGXP_ALU(0x28E4005Bu, cpu->gpr[4], _pgx1, 0x005Bu); } #ifdef PSX_COSIM cosim_instr(0xBFC08B84u); #endif @@ -142681,7 +142876,8 @@ label_BFC08B98: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC08BA4: 00642026 xor $a0, $v1, $a0 */ - cpu->gpr[4] = cpu->gpr[3] ^ cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[3] ^ cpu->gpr[4]; + PGXP_ALU(0x00642026u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08BA4u); #endif @@ -142732,7 +142928,8 @@ label_BFC08BB4: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC08BB4: 2885003D slti $a1, $a0, 61 */ - cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[4] < (61) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[4] < (61) ? 1 : 0); + PGXP_ALU(0x2885003Du, cpu->gpr[5], _pgx1, 0x003Du); } #ifdef PSX_COSIM cosim_instr(0xBFC08BB4u); #endif @@ -143167,7 +143364,8 @@ label_BFC08C28: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC08C28: 2F0F000D sltiu $t7, $t8, 13 */ - cpu->gpr[15] = (uint32_t)(cpu->gpr[24] < 0x0000000Du ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[15] = (uint32_t)(cpu->gpr[24] < 0x0000000Du ? 1 : 0); + PGXP_ALU(0x2F0F000Du, cpu->gpr[15], _pgx1, 0x000Du); } #ifdef PSX_COSIM cosim_instr(0xBFC08C28u); #endif @@ -143386,7 +143584,8 @@ label_BFC08C58: psx_cyc_step(cpu, 0x29u); #endif /* 0xBFC08C5C: 0003282B sltu $a1, $zero, $v1 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[0] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[5] = (uint32_t)(cpu->gpr[0] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0003282Bu, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08C5Cu); #endif @@ -143534,7 +143733,8 @@ label_BFC08C84: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC08C8C: 2C630001 sltiu $v1, $v1, 1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C630001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC08C8Cu); #endif @@ -143861,7 +144061,8 @@ label_BFC08CBC: psx_cyc_step(cpu, 0x2040000u); #endif /* 0xBFC08CBC: 3A590008 xori $t9, $s2, 0x8 */ - cpu->gpr[25] = cpu->gpr[18] ^ 0x8u; + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[25] = cpu->gpr[18] ^ 0x8u; + PGXP_ALU(0x3A590008u, cpu->gpr[25], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC08CBCu); #endif @@ -143872,7 +144073,8 @@ label_BFC08CBC: psx_cyc_step(cpu, 0x2000001u); #endif /* 0xBFC08CC0: 0019C82B sltu $t9, $zero, $t9 */ - cpu->gpr[25] = (uint32_t)(cpu->gpr[0] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[25] = (uint32_t)(cpu->gpr[0] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0019C82Bu, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08CC0u); #endif @@ -143883,7 +144085,8 @@ label_BFC08CBC: psx_cyc_step(cpu, 0x2000800u); #endif /* 0xBFC08CC4: 01795824 and $t3, $t3, $t9 */ - cpu->gpr[11] = cpu->gpr[11] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[11] = cpu->gpr[11] & cpu->gpr[25]; + PGXP_ALU(0x01795824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08CC4u); #endif @@ -144083,7 +144286,8 @@ label_BFC08CF4: psx_cyc_step(cpu, 0x2001001u); #endif /* 0xBFC08CF8: 0019602B sltu $t4, $zero, $t9 */ - cpu->gpr[12] = (uint32_t)(cpu->gpr[0] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[12] = (uint32_t)(cpu->gpr[0] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0019602Bu, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08CF8u); #endif @@ -144127,7 +144331,8 @@ label_BFC08CFC: psx_cyc_step(cpu, 0x3010u); #endif /* 0xBFC08D00: 008C682A slt $t5, $a0, $t4 */ - cpu->gpr[13] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[12] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[13] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[12] ? 1 : 0); + PGXP_ALU(0x008C682Au, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08D00u); #endif @@ -144357,7 +144562,8 @@ label_BFC08D2C: psx_cyc_step(cpu, 0x1000u); #endif /* 0xBFC08D34: 2D8C0003 sltiu $t4, $t4, 3 */ - cpu->gpr[12] = (uint32_t)(cpu->gpr[12] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[12] = (uint32_t)(cpu->gpr[12] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2D8C0003u, cpu->gpr[12], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0xBFC08D34u); #endif @@ -144502,7 +144708,8 @@ label_BFC08D4C: psx_cyc_step(cpu, 0x1000u); #endif /* 0xBFC08D54: 2D8C0003 sltiu $t4, $t4, 3 */ - cpu->gpr[12] = (uint32_t)(cpu->gpr[12] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[12] = (uint32_t)(cpu->gpr[12] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2D8C0003u, cpu->gpr[12], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0xBFC08D54u); #endif @@ -144793,7 +145000,8 @@ label_BFC08D88: psx_cyc_step(cpu, 0x41008u); #endif /* 0xBFC08DA0: 0072602B sltu $t4, $v1, $s2 */ - cpu->gpr[12] = (uint32_t)(cpu->gpr[3] < cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[12] = (uint32_t)(cpu->gpr[3] < cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0072602Bu, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08DA0u); #endif @@ -144994,7 +145202,8 @@ label_BFC08DD4: psx_cyc_step(cpu, 0x19u); #endif /* 0xBFC08DD4: 00032027 nor $a0, $zero, $v1 */ - cpu->gpr[4] = ~(cpu->gpr[0] | cpu->gpr[3]); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = ~(cpu->gpr[0] | cpu->gpr[3]); + PGXP_ALU(0x00032027u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08DD4u); #endif @@ -145017,7 +145226,8 @@ label_BFC08DD4: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC08DDC: 00641824 and $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + PGXP_ALU(0x00641824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08DDCu); #endif @@ -145583,7 +145793,8 @@ label_BFC08E64: psx_cyc_step(cpu, 0x400010u); #endif /* 0xBFC08E64: 2EC40034 sltiu $a0, $s6, 52 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[22] < 0x00000034u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[4] = (uint32_t)(cpu->gpr[22] < 0x00000034u ? 1 : 0); + PGXP_ALU(0x2EC40034u, cpu->gpr[4], _pgx1, 0x0034u); } #ifdef PSX_COSIM cosim_instr(0xBFC08E64u); #endif @@ -145975,7 +146186,8 @@ label_BFC08EBC: psx_cyc_step(cpu, 0x800008u); #endif /* 0xBFC08EBC: 2EE30034 sltiu $v1, $s7, 52 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[23] < 0x00000034u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[23]; cpu->gpr[3] = (uint32_t)(cpu->gpr[23] < 0x00000034u ? 1 : 0); + PGXP_ALU(0x2EE30034u, cpu->gpr[3], _pgx1, 0x0034u); } #ifdef PSX_COSIM cosim_instr(0xBFC08EBCu); #endif @@ -146603,7 +146815,8 @@ label_BFC08F38: psx_cyc_step(cpu, 0x80008u); #endif /* 0xBFC08F40: 02639824 and $s3, $s3, $v1 */ - cpu->gpr[19] = cpu->gpr[19] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[19] = cpu->gpr[19] & cpu->gpr[3]; + PGXP_ALU(0x02639824u, cpu->gpr[19], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08F40u); #endif @@ -147229,7 +147442,8 @@ label_BFC08FC0: psx_cyc_step(cpu, 0x58u); #endif /* 0xBFC08FC0: 0064302A slt $a2, $v1, $a0 */ - cpu->gpr[6] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[6] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064302Au, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08FC0u); #endif @@ -147594,7 +147808,8 @@ label_BFC0900C: psx_cyc_step(cpu, 0x40030u); #endif /* 0xBFC0900C: 0092282A slt $a1, $a0, $s2 */ - cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0092282Au, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0900Cu); #endif @@ -147928,7 +148143,8 @@ label_BFC0904C: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC0904C: 2CC6005F sltiu $a2, $a2, 95 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[6] < 0x0000005Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = (uint32_t)(cpu->gpr[6] < 0x0000005Fu ? 1 : 0); + PGXP_ALU(0x2CC6005Fu, cpu->gpr[6], _pgx1, 0x005Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0904Cu); #endif @@ -147994,7 +148210,8 @@ label_BFC09058: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0905C: 3063001F andi $v1, $v1, 0x1F */ - cpu->gpr[3] = cpu->gpr[3] & 0x1Fu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x1Fu; + PGXP_ALU(0x3063001Fu, cpu->gpr[3], _pgx1, 0x001Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0905Cu); #endif @@ -148084,7 +148301,8 @@ label_BFC09074: psx_cyc_step(cpu, 0x40008u); #endif /* 0xBFC09078: 2A430063 slti $v1, $s2, 99 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[18] < (99) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[18] < (99) ? 1 : 0); + PGXP_ALU(0x2A430063u, cpu->gpr[3], _pgx1, 0x0063u); } #ifdef PSX_COSIM cosim_instr(0xBFC09078u); #endif @@ -148147,7 +148365,8 @@ label_BFC09084: psx_cyc_step(cpu, 0x40018u); #endif /* 0xBFC09088: 0092182A slt $v1, $a0, $s2 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0092182Au, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC09088u); #endif @@ -150556,7 +150775,8 @@ label_BFC09274: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC09280: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC09280u); #endif @@ -150567,7 +150787,8 @@ label_BFC09274: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC09284: 2C64000A sltiu $a0, $v1, 10 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[3] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[4] = (uint32_t)(cpu->gpr[3] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2C64000Au, cpu->gpr[4], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC09284u); #endif @@ -150642,7 +150863,8 @@ label_BFC09290: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC09298: 2843006A slti $v1, $v0, 106 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (106) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (106) ? 1 : 0); + PGXP_ALU(0x2843006Au, cpu->gpr[3], _pgx1, 0x006Au); } #ifdef PSX_COSIM cosim_instr(0xBFC09298u); #endif @@ -150726,7 +150948,8 @@ label_BFC092A4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC092A8: 28430026 slti $v1, $v0, 38 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (38) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (38) ? 1 : 0); + PGXP_ALU(0x28430026u, cpu->gpr[3], _pgx1, 0x0026u); } #ifdef PSX_COSIM cosim_instr(0xBFC092A8u); #endif @@ -151657,7 +151880,8 @@ label_BFC09374: psx_cyc_step(cpu, 0x10004u); #endif /* 0xBFC0938C: 2E02000A sltiu $v0, $s0, 10 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2E02000Au, cpu->gpr[2], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0938Cu); #endif @@ -151902,7 +152126,8 @@ label_BFC093C0: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC093C8: 28430076 slti $v1, $v0, 118 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (118) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (118) ? 1 : 0); + PGXP_ALU(0x28430076u, cpu->gpr[3], _pgx1, 0x0076u); } #ifdef PSX_COSIM cosim_instr(0xBFC093C8u); #endif @@ -152190,7 +152415,8 @@ label_BFC09408: psx_cyc_step(cpu, 0x300004u); #endif /* 0xBFC09408: 02B4102A slt $v0, $s5, $s4 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[21] < (int32_t)cpu->gpr[20] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[21]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[21] < (int32_t)cpu->gpr[20] ? 1 : 0); + PGXP_ALU(0x02B4102Au, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC09408u); #endif @@ -152553,7 +152779,8 @@ label_BFC09464: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC09464: 3084000F andi $a0, $a0, 0xF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFu; + PGXP_ALU(0x3084000Fu, cpu->gpr[4], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC09464u); #endif @@ -153102,7 +153329,8 @@ label_BFC094E8: psx_cyc_step(cpu, 0x900008u); #endif /* 0xBFC094E8: 02F4182A slt $v1, $s7, $s4 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[23] < (int32_t)cpu->gpr[20] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[23]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[23] < (int32_t)cpu->gpr[20] ? 1 : 0); + PGXP_ALU(0x02F4182Au, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC094E8u); #endif @@ -153646,7 +153874,8 @@ label_BFC0956C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC0956C: 3084000F andi $a0, $a0, 0xF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFu; + PGXP_ALU(0x3084000Fu, cpu->gpr[4], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0956Cu); #endif @@ -154279,7 +154508,8 @@ label_BFC0A510: psx_cyc_step(cpu, 0x502u); #endif /* 0xBFC0A510: 0148082A slt $at, $t2, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0148082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030010u); #endif @@ -155184,7 +155414,8 @@ label_BFC0A59C: psx_cyc_step(cpu, 0x10008u); #endif /* 0xBFC0A5B8: 38700045 xori $s0, $v1, 0x45 */ - cpu->gpr[16] = cpu->gpr[3] ^ 0x45u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[16] = cpu->gpr[3] ^ 0x45u; + PGXP_ALU(0x38700045u, cpu->gpr[16], _pgx1, 0x0045u); } #ifdef PSX_COSIM cosim_instr(0x800300B8u); #endif @@ -155192,7 +155423,8 @@ label_BFC0A59C: psx_cyc_step(cpu, 0x10000u); #endif /* 0xBFC0A5BC: 2E100001 sltiu $s0, $s0, 1 */ - cpu->gpr[16] = (uint32_t)(cpu->gpr[16] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[16] = (uint32_t)(cpu->gpr[16] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2E100001u, cpu->gpr[16], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800300BCu); #endif @@ -156242,7 +156474,8 @@ label_BFC0A6F8: psx_cyc_step(cpu, 0xC04u); #endif /* 0xBFC0A700: 014B102A slt $v0, $t2, $t3 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x014B102Au, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030200u); #endif @@ -156329,7 +156562,8 @@ label_BFC0A710: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0A71C: 2C430003 sltiu $v1, $v0, 3 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C430003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x8003021Cu); #endif @@ -156570,7 +156804,8 @@ label_BFC0A760: psx_cyc_step(cpu, 0x400Cu); #endif /* 0xBFC0A76C: 004E182A slt $v1, $v0, $t6 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x004E182Au, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003026Cu); #endif @@ -158972,7 +159207,8 @@ label_BFC0AA54: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC0AA5C: 00651824 and $v1, $v1, $a1 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[5]; + PGXP_ALU(0x00651824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003055Cu); #endif @@ -159287,7 +159523,8 @@ label_BFC0AAC0: psx_cyc_step(cpu, 0x1104u); #endif /* 0xBFC0AAC0: 010C102A slt $v0, $t0, $t4 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[12] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[12] ? 1 : 0); + PGXP_ALU(0x010C102Au, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800305C0u); #endif @@ -159401,7 +159638,8 @@ label_BFC0AAD4: psx_cyc_step(cpu, 0x400u); #endif /* 0xBFC0AAE0: 2D4A0028 sltiu $t2, $t2, 40 */ - cpu->gpr[10] = (uint32_t)(cpu->gpr[10] < 0x00000028u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[10] = (uint32_t)(cpu->gpr[10] < 0x00000028u ? 1 : 0); + PGXP_ALU(0x2D4A0028u, cpu->gpr[10], _pgx1, 0x0028u); } #ifdef PSX_COSIM cosim_instr(0x800305E0u); #endif @@ -159703,7 +159941,8 @@ label_BFC0AB34: psx_cyc_step(cpu, 0x8Cu); #endif /* 0xBFC0AB34: 0067102A slt $v0, $v1, $a3 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0067102Au, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030634u); #endif @@ -160105,7 +160344,8 @@ label_BFC0ABC4: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC0ABCC: 00641824 and $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + PGXP_ALU(0x00641824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800306CCu); #endif @@ -162105,7 +162345,8 @@ label_BFC0AE6C: psx_cyc_step(cpu, 0x320u); #endif /* 0xBFC0AE6C: 00A8482A slt $t1, $a1, $t0 */ - cpu->gpr[9] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[9] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x00A8482Au, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003096Cu); #endif @@ -162262,7 +162503,8 @@ label_BFC0AE94: psx_cyc_step(cpu, 0x320u); #endif /* 0xBFC0AE94: 00A8482A slt $t1, $a1, $t0 */ - cpu->gpr[9] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[9] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x00A8482Au, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030994u); #endif @@ -162413,7 +162655,8 @@ label_BFC0AEBC: psx_cyc_step(cpu, 0x320u); #endif /* 0xBFC0AEBC: 00A8482A slt $t1, $a1, $t0 */ - cpu->gpr[9] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[9] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x00A8482Au, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800309BCu); #endif @@ -164288,7 +164531,8 @@ label_BFC0B0A4: psx_cyc_step(cpu, 0x60u); #endif /* 0xBFC0B0C8: 00C5282A slt $a1, $a2, $a1 */ - cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x00C5282Au, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030BC8u); #endif @@ -164397,7 +164641,8 @@ label_BFC0B0E4: psx_cyc_step(cpu, 0x430u); #endif /* 0xBFC0B0E4: 008A282A slt $a1, $a0, $t2 */ - cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x008A282Au, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030BE4u); #endif @@ -165247,7 +165492,8 @@ label_BFC0B184: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC0B1C4: 00641824 and $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + PGXP_ALU(0x00641824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030CC4u); #endif @@ -165729,7 +165975,8 @@ label_BFC0B264: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0B270: 2C42000A sltiu $v0, $v0, 10 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2C42000Au, cpu->gpr[2], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x80030D70u); #endif @@ -165737,7 +165984,8 @@ label_BFC0B264: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0B274: 38420001 xori $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + PGXP_ALU(0x38420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80030D74u); #endif @@ -165835,7 +166083,8 @@ label_BFC0B280: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0B294: 2C420002 sltiu $v0, $v0, 2 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80030D94u); #endif @@ -165896,7 +166145,8 @@ label_BFC0B298: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0B2A4: 3842000F xori $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] ^ 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0xFu; + PGXP_ALU(0x3842000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80030DA4u); #endif @@ -165909,7 +166159,8 @@ label_BFC0B298: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0B2AC: 2C420001 sltiu $v0, $v0, 1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80030DACu); #endif @@ -166222,7 +166473,8 @@ label_BFC0B2F4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B2FC: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030DFCu); #endif @@ -166290,7 +166542,8 @@ label_BFC0B308: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B310: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030E10u); #endif @@ -166452,7 +166705,8 @@ label_BFC0B33C: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC0B340: 0044202B sltu $a0, $v0, $a0 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030E40u); #endif @@ -166582,7 +166836,8 @@ label_BFC0B35C: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B35C: 2C430004 sltiu $v1, $v0, 4 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000004u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000004u ? 1 : 0); + PGXP_ALU(0x2C430004u, cpu->gpr[3], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80030E5Cu); #endif @@ -166641,7 +166896,8 @@ label_BFC0B368: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0B36C: 2C420002 sltiu $v0, $v0, 2 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80030E6Cu); #endif @@ -166835,7 +167091,8 @@ label_BFC0B39C: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B3A8: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030EA8u); #endif @@ -166901,7 +167158,8 @@ label_BFC0B3B4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B3BC: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030EBCu); #endif @@ -167255,7 +167513,8 @@ label_BFC0B410: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B424: 30620007 andi $v0, $v1, 0x7 */ - cpu->gpr[2] = cpu->gpr[3] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[3] & 0x7u; + PGXP_ALU(0x30620007u, cpu->gpr[2], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x80030F24u); #endif @@ -167339,7 +167598,8 @@ label_BFC0B43C: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0B43C: 30630018 andi $v1, $v1, 0x18 */ - cpu->gpr[3] = cpu->gpr[3] & 0x18u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x18u; + PGXP_ALU(0x30630018u, cpu->gpr[3], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0x80030F3Cu); #endif @@ -167439,7 +167699,8 @@ label_BFC0B454: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0B458: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80030F58u); #endif @@ -167447,7 +167708,8 @@ label_BFC0B454: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B45C: 2C430005 sltiu $v1, $v0, 5 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000005u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000005u ? 1 : 0); + PGXP_ALU(0x2C430005u, cpu->gpr[3], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0x80030F5Cu); #endif @@ -167994,7 +168256,8 @@ label_BFC0B4D0: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B4EC: 2C43000D sltiu $v1, $v0, 13 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x0000000Du ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x0000000Du ? 1 : 0); + PGXP_ALU(0x2C43000Du, cpu->gpr[3], _pgx1, 0x000Du); } #ifdef PSX_COSIM cosim_instr(0x80030FECu); #endif @@ -170064,7 +170327,8 @@ label_BFC0B718: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0B718: 2C420001 sltiu $v0, $v0, 1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80031218u); #endif @@ -170108,7 +170372,8 @@ label_BFC0B71C: psx_cyc_step(cpu, 0xA0008u); #endif /* 0xBFC0B728: 0233182B sltu $v1, $s1, $s3 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[17] < cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[3] = (uint32_t)(cpu->gpr[17] < cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0233182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031228u); #endif @@ -170642,7 +170907,8 @@ label_BFC0B7A0: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B7AC: 2C43000A sltiu $v1, $v0, 10 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2C43000Au, cpu->gpr[3], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x800312ACu); #endif @@ -172007,7 +172273,8 @@ label_BFC0B930: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B938: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031438u); #endif @@ -172220,7 +172487,8 @@ label_BFC0B95C: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0B968: 38620001 xori $v0, $v1, 0x1 */ - cpu->gpr[2] = cpu->gpr[3] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[3] ^ 0x1u; + PGXP_ALU(0x38620001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80031468u); #endif @@ -172493,7 +172761,8 @@ label_BFC0B9B0: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0B9BC: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800314BCu); #endif @@ -172579,7 +172848,8 @@ label_BFC0B9D0: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0B9DC: 2CA50001 sltiu $a1, $a1, 1 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2CA50001u, cpu->gpr[5], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800314DCu); #endif @@ -172599,7 +172869,8 @@ label_BFC0B9D0: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0B9E4: 30A50280 andi $a1, $a1, 0x280 */ - cpu->gpr[5] = cpu->gpr[5] & 0x280u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x280u; + PGXP_ALU(0x30A50280u, cpu->gpr[5], _pgx1, 0x0280u); } #ifdef PSX_COSIM cosim_instr(0x800314E4u); #endif @@ -172683,7 +172954,8 @@ label_BFC0B9F0: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC0BA08: 2CC60001 sltiu $a2, $a2, 1 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[6] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = (uint32_t)(cpu->gpr[6] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2CC60001u, cpu->gpr[6], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80031508u); #endif @@ -172800,7 +173072,8 @@ label_BFC0BA0C: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC0BA30: 30C60280 andi $a2, $a2, 0x280 */ - cpu->gpr[6] = cpu->gpr[6] & 0x280u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x280u; + PGXP_ALU(0x30C60280u, cpu->gpr[6], _pgx1, 0x0280u); } #ifdef PSX_COSIM cosim_instr(0x80031530u); #endif @@ -173427,7 +173700,8 @@ label_BFC0BAE0: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC0BAF0: 30642000 andi $a0, $v1, 0x2000 */ - cpu->gpr[4] = cpu->gpr[3] & 0x2000u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[4] = cpu->gpr[3] & 0x2000u; + PGXP_ALU(0x30642000u, cpu->gpr[4], _pgx1, 0x2000u); } #ifdef PSX_COSIM cosim_instr(0x800315F0u); #endif @@ -173540,7 +173814,8 @@ label_BFC0BB04: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0BB04: 2C420001 sltiu $v0, $v0, 1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80031604u); #endif @@ -173657,7 +173932,8 @@ label_BFC0BB24: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0BB2C: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8003162Cu); #endif @@ -173725,7 +174001,8 @@ label_BFC0BB38: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0BB40: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031640u); #endif @@ -174083,7 +174360,8 @@ label_BFC0BB94: psx_cyc_step(cpu, 0x11u); #endif /* 0xBFC0BB94: 0004202B sltu $a0, $zero, $a0 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0004202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031694u); #endif @@ -175353,7 +175631,8 @@ label_BFC0BCD4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0BD44: 0043182A slt $v1, $v0, $v1 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043182Au, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031844u); #endif @@ -175690,7 +175969,8 @@ label_BFC0BD9C: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC0BD9C: 2E220002 sltiu $v0, $s1, 2 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[17] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = (uint32_t)(cpu->gpr[17] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2E220002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8003189Cu); #endif @@ -175914,7 +176194,8 @@ label_BFC0BDE4: psx_cyc_step(cpu, 0x5004u); #endif /* 0xBFC0BDE8: 01CC102B sltu $v0, $t6, $t4 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[14] < cpu->gpr[12] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[2] = (uint32_t)(cpu->gpr[14] < cpu->gpr[12] ? 1 : 0); + PGXP_ALU(0x01CC102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800318E8u); #endif @@ -176264,7 +176545,8 @@ label_BFC0BE3C: psx_cyc_step(cpu, 0x30004u); #endif /* 0xBFC0BE44: 0211102B sltu $v0, $s0, $s1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0211102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031944u); #endif @@ -176899,7 +177181,8 @@ label_BFC0BEE4: psx_cyc_step(cpu, 0x20088u); #endif /* 0xBFC0BEE4: 0071382A slt $a3, $v1, $s1 */ - cpu->gpr[7] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[7] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0071382Au, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800319E4u); #endif @@ -177032,7 +177315,8 @@ label_BFC0BEF0: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC0BF18: 2A220002 slti $v0, $s1, 2 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[17] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[17] < (2) ? 1 : 0); + PGXP_ALU(0x2A220002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80031A18u); #endif @@ -177155,7 +177439,8 @@ label_BFC0BF34: psx_cyc_step(cpu, 0x20404u); #endif /* 0xBFC0BF34: 0151102A slt $v0, $t2, $s1 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0151102Au, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031A34u); #endif @@ -177203,7 +177488,8 @@ label_BFC0BF40: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC0BF40: 29030003 slti $v1, $t0, 3 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[8] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[8] < (3) ? 1 : 0); + PGXP_ALU(0x29030003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80031A40u); #endif @@ -177517,7 +177803,8 @@ label_BFC0BFA4: psx_cyc_step(cpu, 0x1C0u); #endif /* 0xBFC0BFAC: 00E6402A slt $t0, $a3, $a2 */ - cpu->gpr[8] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[8] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x00E6402Au, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031AACu); #endif @@ -177639,7 +177926,8 @@ label_BFC0BFC0: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC0BFD0: 00E8382A slt $a3, $a3, $t0 */ - cpu->gpr[7] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[7] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x00E8382Au, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031AD0u); #endif @@ -178569,7 +178857,8 @@ label_BFC0C0DC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0C0F8: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80031BF8u); #endif @@ -180345,7 +180634,8 @@ label_BFC0C354: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC0C358: 30850600 andi $a1, $a0, 0x600 */ - cpu->gpr[5] = cpu->gpr[4] & 0x600u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[5] = cpu->gpr[4] & 0x600u; + PGXP_ALU(0x30850600u, cpu->gpr[5], _pgx1, 0x0600u); } #ifdef PSX_COSIM cosim_instr(0x80031E58u); #endif @@ -180353,7 +180643,8 @@ label_BFC0C354: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC0C35C: 308307FF andi $v1, $a0, 0x7FF */ - cpu->gpr[3] = cpu->gpr[4] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x7FFu; + PGXP_ALU(0x308307FFu, cpu->gpr[3], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80031E5Cu); #endif @@ -180462,7 +180753,8 @@ label_BFC0C37C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC0C37C: 30840400 andi $a0, $a0, 0x400 */ - cpu->gpr[4] = cpu->gpr[4] & 0x400u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x400u; + PGXP_ALU(0x30840400u, cpu->gpr[4], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x80031E7Cu); #endif @@ -180591,7 +180883,8 @@ label_BFC0C3A0: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC0C3A0: 2C640600 sltiu $a0, $v1, 1536 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[3] < 0x00000600u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[4] = (uint32_t)(cpu->gpr[3] < 0x00000600u ? 1 : 0); + PGXP_ALU(0x2C640600u, cpu->gpr[4], _pgx1, 0x0600u); } #ifdef PSX_COSIM cosim_instr(0x80031EA0u); #endif @@ -180788,7 +181081,8 @@ label_BFC0C3C0: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC0C3C4: 30A20600 andi $v0, $a1, 0x600 */ - cpu->gpr[2] = cpu->gpr[5] & 0x600u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[2] = cpu->gpr[5] & 0x600u; + PGXP_ALU(0x30A20600u, cpu->gpr[2], _pgx1, 0x0600u); } #ifdef PSX_COSIM cosim_instr(0x80031EC4u); #endif @@ -180833,7 +181127,8 @@ label_BFC0C3C0: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC0C3D8: 30A407FF andi $a0, $a1, 0x7FF */ - cpu->gpr[4] = cpu->gpr[5] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[4] = cpu->gpr[5] & 0x7FFu; + PGXP_ALU(0x30A407FFu, cpu->gpr[4], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80031ED8u); #endif @@ -186147,7 +186442,8 @@ label_BFC0CB40: psx_cyc_step(cpu, 0x128u); #endif /* 0xBFC0CB40: 0105182B sltu $v1, $t0, $a1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[8] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[3] = (uint32_t)(cpu->gpr[8] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0105182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032640u); #endif @@ -186508,7 +186804,8 @@ label_BFC0CBA4: psx_cyc_step(cpu, 0x184u); #endif /* 0xBFC0CBA8: 0048382B sltu $a3, $v0, $t0 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[7] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0048382Bu, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800326A8u); #endif @@ -186550,7 +186847,8 @@ label_BFC0CBAC: psx_cyc_step(cpu, 0x184u); #endif /* 0xBFC0CBB0: 0102382B sltu $a3, $t0, $v0 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[8] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[7] = (uint32_t)(cpu->gpr[8] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0102382Bu, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800326B0u); #endif @@ -186589,7 +186887,8 @@ label_BFC0CBB4: psx_cyc_step(cpu, 0x184u); #endif /* 0xBFC0CBB8: 0048382B sltu $a3, $v0, $t0 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[7] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0048382Bu, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800326B8u); #endif @@ -186670,7 +186969,8 @@ label_BFC0CBC4: psx_cyc_step(cpu, 0xB0u); #endif /* 0xBFC0CBC8: 00A4382B sltu $a3, $a1, $a0 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[7] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x00A4382Bu, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800326C8u); #endif @@ -186745,7 +187045,8 @@ label_BFC0CBD4: psx_cyc_step(cpu, 0x184u); #endif /* 0xBFC0CBD4: 0102382B sltu $a3, $t0, $v0 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[8] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[7] = (uint32_t)(cpu->gpr[8] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0102382Bu, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800326D4u); #endif @@ -186809,7 +187110,8 @@ label_BFC0CBE0: psx_cyc_step(cpu, 0xB0u); #endif /* 0xBFC0CBE4: 0085382B sltu $a3, $a0, $a1 */ - cpu->gpr[7] = (uint32_t)(cpu->gpr[4] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[7] = (uint32_t)(cpu->gpr[4] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0085382Bu, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800326E4u); #endif @@ -186890,7 +187192,8 @@ label_BFC0CBF0: psx_cyc_step(cpu, 0x490u); #endif /* 0xBFC0CBF4: 0087502B sltu $t2, $a0, $a3 */ - cpu->gpr[10] = (uint32_t)(cpu->gpr[4] < cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[10] = (uint32_t)(cpu->gpr[4] < cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0087502Bu, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800326F4u); #endif @@ -188369,7 +188672,8 @@ label_BFC0CDB8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0CDC0: 2C42001F sltiu $v0, $v0, 31 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000001Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000001Fu ? 1 : 0); + PGXP_ALU(0x2C42001Fu, cpu->gpr[2], _pgx1, 0x001Fu); } #ifdef PSX_COSIM cosim_instr(0x800328C0u); #endif @@ -188868,7 +189172,8 @@ label_BFC0CE44: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0CE4C: 2C42001F sltiu $v0, $v0, 31 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000001Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000001Fu ? 1 : 0); + PGXP_ALU(0x2C42001Fu, cpu->gpr[2], _pgx1, 0x001Fu); } #ifdef PSX_COSIM cosim_instr(0x8003294Cu); #endif @@ -189905,7 +190210,8 @@ label_BFC0CFA4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0CFAC: 304207FF andi $v0, $v0, 0x7FF */ - cpu->gpr[2] = cpu->gpr[2] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x7FFu; + PGXP_ALU(0x304207FFu, cpu->gpr[2], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80032AACu); #endif @@ -190083,7 +190389,8 @@ label_BFC0CFC0: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC0CFDC: 00451024 and $v0, $v0, $a1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[5]; + PGXP_ALU(0x00451024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032ADCu); #endif @@ -190667,7 +190974,8 @@ label_BFC0D070: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0D078: 3063000F andi $v1, $v1, 0xF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFu; + PGXP_ALU(0x3063000Fu, cpu->gpr[3], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032B78u); #endif @@ -190675,7 +190983,8 @@ label_BFC0D070: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC0D07C: 2C66000F sltiu $a2, $v1, 15 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[3] < 0x0000000Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[6] = (uint32_t)(cpu->gpr[3] < 0x0000000Fu ? 1 : 0); + PGXP_ALU(0x2C66000Fu, cpu->gpr[6], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032B7Cu); #endif @@ -190686,7 +190995,8 @@ label_BFC0D070: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC0D080: 3045000F andi $a1, $v0, 0xF */ - cpu->gpr[5] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3045000Fu, cpu->gpr[5], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032B80u); #endif @@ -191003,7 +191313,8 @@ label_BFC0D0C0: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D0CC: 304300FF andi $v1, $v0, 0xFF */ - cpu->gpr[3] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80032BCCu); #endif @@ -191746,7 +192057,8 @@ label_BFC0D174: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D180: 2843006C slti $v1, $v0, 108 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (108) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (108) ? 1 : 0); + PGXP_ALU(0x2843006Cu, cpu->gpr[3], _pgx1, 0x006Cu); } #ifdef PSX_COSIM cosim_instr(0x80032C80u); #endif @@ -191903,7 +192215,8 @@ label_BFC0D198: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D1A4: 2843038C slti $v1, $v0, 908 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (908) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[2] < (908) ? 1 : 0); + PGXP_ALU(0x2843038Cu, cpu->gpr[3], _pgx1, 0x038Cu); } #ifdef PSX_COSIM cosim_instr(0x80032CA4u); #endif @@ -192025,7 +192338,8 @@ label_BFC0D1B8: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC0D1B8: 2C450011 sltiu $a1, $v0, 17 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2C450011u, cpu->gpr[5], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x80032CB8u); #endif @@ -192238,7 +192552,8 @@ label_BFC0D1F4: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC0D1F4: 31030001 andi $v1, $t0, 0x1 */ - cpu->gpr[3] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[3] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31030001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80032CF4u); #endif @@ -192428,7 +192743,8 @@ label_BFC0D214: psx_cyc_step(cpu, 0x1Cu); #endif /* 0xBFC0D220: 0043202A slt $a0, $v0, $v1 */ - cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043202Au, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032D20u); #endif @@ -192501,7 +192817,8 @@ label_BFC0D22C: psx_cyc_step(cpu, 0x1Cu); #endif /* 0xBFC0D238: 0062202A slt $a0, $v1, $v0 */ - cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062202Au, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032D38u); #endif @@ -192721,7 +193038,8 @@ label_BFC0D264: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D268: 2C430040 sltiu $v1, $v0, 64 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C430040u, cpu->gpr[3], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80032D68u); #endif @@ -192812,7 +193130,8 @@ label_BFC0D27C: psx_cyc_step(cpu, 0x1Cu); #endif /* 0xBFC0D27C: 0062202A slt $a0, $v1, $v0 */ - cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062202Au, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032D7Cu); #endif @@ -192895,7 +193214,8 @@ label_BFC0D288: psx_cyc_step(cpu, 0x1Cu); #endif /* 0xBFC0D298: 0043202A slt $a0, $v0, $v1 */ - cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043202Au, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032D98u); #endif @@ -192962,7 +193282,8 @@ label_BFC0D29C: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC0D29C: 2C450011 sltiu $a1, $v0, 17 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2C450011u, cpu->gpr[5], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x80032D9Cu); #endif @@ -193178,7 +193499,8 @@ label_BFC0D2D8: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC0D2D8: 31030001 andi $v1, $t0, 0x1 */ - cpu->gpr[3] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[3] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31030001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80032DD8u); #endif @@ -193359,7 +193681,8 @@ label_BFC0D2F8: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0D300: 30A50003 andi $a1, $a1, 0x3 */ - cpu->gpr[5] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30A50003u, cpu->gpr[5], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80032E00u); #endif @@ -193374,7 +193697,8 @@ label_BFC0D2F8: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC0D308: 3082001F andi $v0, $a0, 0x1F */ - cpu->gpr[2] = cpu->gpr[4] & 0x1Fu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] & 0x1Fu; + PGXP_ALU(0x3082001Fu, cpu->gpr[2], _pgx1, 0x001Fu); } #ifdef PSX_COSIM cosim_instr(0x80032E08u); #endif @@ -193623,7 +193947,8 @@ label_BFC0D34C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0D34C: 3042000F andi $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3042000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032E4Cu); #endif @@ -193661,7 +193986,8 @@ label_BFC0D34C: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC0D35C: 28850020 slti $a1, $a0, 32 */ - cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[4] < (32) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[5] = (uint32_t)((int32_t)cpu->gpr[4] < (32) ? 1 : 0); + PGXP_ALU(0x28850020u, cpu->gpr[5], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80032E5Cu); #endif @@ -193791,7 +194117,8 @@ label_BFC0D378: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D37C: 2C430040 sltiu $v1, $v0, 64 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C430040u, cpu->gpr[3], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80032E7Cu); #endif @@ -194054,7 +194381,8 @@ label_BFC0D3A8: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0D3B0: 30A50003 andi $a1, $a1, 0x3 */ - cpu->gpr[5] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30A50003u, cpu->gpr[5], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80032EB0u); #endif @@ -194093,7 +194421,8 @@ label_BFC0D3A8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0D3C4: 3042001F andi $v0, $v0, 0x1F */ - cpu->gpr[2] = cpu->gpr[2] & 0x1Fu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1Fu; + PGXP_ALU(0x3042001Fu, cpu->gpr[2], _pgx1, 0x001Fu); } #ifdef PSX_COSIM cosim_instr(0x80032EC4u); #endif @@ -194360,7 +194689,8 @@ label_BFC0D408: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC0D410: 3084000F andi $a0, $a0, 0xF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFu; + PGXP_ALU(0x3084000Fu, cpu->gpr[4], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032F10u); #endif @@ -194398,7 +194728,8 @@ label_BFC0D408: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC0D420: 28840020 slti $a0, $a0, 32 */ - cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[4] < (32) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[4] < (32) ? 1 : 0); + PGXP_ALU(0x28840020u, cpu->gpr[4], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80032F20u); #endif @@ -194474,7 +194805,8 @@ label_BFC0D430: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0D434: 28420040 slti $v0, $v0, 64 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (64) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (64) ? 1 : 0); + PGXP_ALU(0x28420040u, cpu->gpr[2], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80032F34u); #endif @@ -194626,7 +194958,8 @@ label_BFC0D460: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC0D460: 31030001 andi $v1, $t0, 0x1 */ - cpu->gpr[3] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[3] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31030001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80032F60u); #endif @@ -194918,7 +195251,8 @@ label_BFC0D4A0: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC0D4A0: 2C450011 sltiu $a1, $v0, 17 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2C450011u, cpu->gpr[5], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x80032FA0u); #endif @@ -195083,7 +195417,8 @@ label_BFC0D4C4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D4C8: 2C430040 sltiu $v1, $v0, 64 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C430040u, cpu->gpr[3], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80032FC8u); #endif @@ -195661,7 +195996,8 @@ label_BFC0D54C: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0D554: 3063000F andi $v1, $v1, 0xF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFu; + PGXP_ALU(0x3063000Fu, cpu->gpr[3], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80033054u); #endif @@ -195669,7 +196005,8 @@ label_BFC0D54C: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC0D558: 2C66000F sltiu $a2, $v1, 15 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[3] < 0x0000000Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[6] = (uint32_t)(cpu->gpr[3] < 0x0000000Fu ? 1 : 0); + PGXP_ALU(0x2C66000Fu, cpu->gpr[6], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80033058u); #endif @@ -195677,7 +196014,8 @@ label_BFC0D54C: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC0D55C: 3045000F andi $a1, $v0, 0xF */ - cpu->gpr[5] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3045000Fu, cpu->gpr[5], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003305Cu); #endif @@ -195888,7 +196226,8 @@ label_BFC0D588: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0D58C: 30A5003F andi $a1, $a1, 0x3F */ - cpu->gpr[5] = cpu->gpr[5] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x3Fu; + PGXP_ALU(0x30A5003Fu, cpu->gpr[5], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x8003308Cu); #endif @@ -195899,7 +196238,8 @@ label_BFC0D588: psx_cyc_step(cpu, 0x21u); #endif /* 0xBFC0D590: 0005282B sltu $a1, $zero, $a1 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[0] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[5] = (uint32_t)(cpu->gpr[0] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0005282Bu, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033090u); #endif @@ -195961,7 +196301,8 @@ label_BFC0D588: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0D5AC: 3063FFCF andi $v1, $v1, 0xFFCF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFCFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFCFu; + PGXP_ALU(0x3063FFCFu, cpu->gpr[3], _pgx1, 0xFFCFu); } #ifdef PSX_COSIM cosim_instr(0x800330ACu); #endif @@ -196044,7 +196385,8 @@ label_BFC0D5C4: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0D5CC: 30A50030 andi $a1, $a1, 0x30 */ - cpu->gpr[5] = cpu->gpr[5] & 0x30u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x30u; + PGXP_ALU(0x30A50030u, cpu->gpr[5], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x800330CCu); #endif @@ -196121,7 +196463,8 @@ label_BFC0D5D8: psx_cyc_step(cpu, 0x60u); #endif /* 0xBFC0D5E4: 00A62824 and $a1, $a1, $a2 */ - cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[6]; + PGXP_ALU(0x00A62824u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800330E4u); #endif @@ -196234,7 +196577,8 @@ label_BFC0D608: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D610: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033110u); #endif @@ -197277,7 +197621,8 @@ label_BFC0D730: psx_cyc_step(cpu, 0x10410u); #endif /* 0xBFC0D738: 0204502B sltu $t2, $s0, $a0 */ - cpu->gpr[10] = (uint32_t)(cpu->gpr[16] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[10] = (uint32_t)(cpu->gpr[16] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0204502Bu, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033238u); #endif @@ -197427,7 +197772,8 @@ label_BFC0D754: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0D760: 2C63FFFE sltiu $v1, $v1, -2 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0xFFFFFFFEu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0xFFFFFFFEu ? 1 : 0); + PGXP_ALU(0x2C63FFFEu, cpu->gpr[3], _pgx1, 0xFFFEu); } #ifdef PSX_COSIM cosim_instr(0x80033260u); #endif @@ -198806,7 +199152,8 @@ label_BFC0D8C4: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC0D8E8: 0044102B sltu $v0, $v0, $a0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800333E8u); #endif @@ -199186,7 +199533,8 @@ label_BFC0D950: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D964: 0043182B sltu $v1, $v0, $v1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033464u); #endif @@ -199203,7 +199551,8 @@ label_BFC0D950: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D96C: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003346Cu); #endif @@ -199401,7 +199750,8 @@ label_BFC0D9A4: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0D9B8: 3063000F andi $v1, $v1, 0xF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFu; + PGXP_ALU(0x3063000Fu, cpu->gpr[3], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x800334B8u); #endif @@ -199430,7 +199780,8 @@ label_BFC0D9A4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D9C4: 2C430040 sltiu $v1, $v0, 64 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C430040u, cpu->gpr[3], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x800334C4u); #endif @@ -199447,7 +199798,8 @@ label_BFC0D9A4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D9CC: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800334CCu); #endif @@ -199540,7 +199892,8 @@ label_BFC0D9D8: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0D9EC: 0043182B sltu $v1, $v0, $v1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800334ECu); #endif @@ -199981,7 +200334,8 @@ label_BFC0DA80: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0DA8C: 2C430040 sltiu $v1, $v0, 64 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C430040u, cpu->gpr[3], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x8003358Cu); #endif @@ -200278,7 +200632,8 @@ label_BFC0DAE8: psx_cyc_step(cpu, 0x1008u); #endif /* 0xBFC0DAF4: 318300F0 andi $v1, $t4, 0xF0 */ - cpu->gpr[3] = cpu->gpr[12] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[3] = cpu->gpr[12] & 0xF0u; + PGXP_ALU(0x318300F0u, cpu->gpr[3], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x800335F4u); #endif @@ -200313,7 +200668,8 @@ label_BFC0DAE8: psx_cyc_step(cpu, 0x1000u); #endif /* 0xBFC0DB04: 318C0F00 andi $t4, $t4, 0xF00 */ - cpu->gpr[12] = cpu->gpr[12] & 0xF00u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[12] = cpu->gpr[12] & 0xF00u; + PGXP_ALU(0x318C0F00u, cpu->gpr[12], _pgx1, 0x0F00u); } #ifdef PSX_COSIM cosim_instr(0x80033604u); #endif @@ -200342,7 +200698,8 @@ label_BFC0DAE8: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC0DB10: 316B000F andi $t3, $t3, 0xF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFu; + PGXP_ALU(0x316B000Fu, cpu->gpr[11], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80033610u); #endif @@ -200368,7 +200725,8 @@ label_BFC0DAE8: psx_cyc_step(cpu, 0x500u); #endif /* 0xBFC0DB1C: 310A000F andi $t2, $t0, 0xF */ - cpu->gpr[10] = cpu->gpr[8] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[10] = cpu->gpr[8] & 0xFu; + PGXP_ALU(0x310A000Fu, cpu->gpr[10], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003361Cu); #endif @@ -200530,7 +200888,8 @@ label_BFC0DB34: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0DB4C: 28630040 slti $v1, $v1, 64 */ - cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[3] < (64) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)((int32_t)cpu->gpr[3] < (64) ? 1 : 0); + PGXP_ALU(0x28630040u, cpu->gpr[3], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x8003364Cu); #endif @@ -200740,7 +201099,8 @@ label_BFC0DB84: psx_cyc_step(cpu, 0x210u); #endif /* 0xBFC0DB84: 31240001 andi $a0, $t1, 0x1 */ - cpu->gpr[4] = cpu->gpr[9] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[4] = cpu->gpr[9] & 0x1u; + PGXP_ALU(0x31240001u, cpu->gpr[4], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80033684u); #endif @@ -201246,7 +201606,8 @@ label_BFC0DBF4: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC0DC28: 3065000C andi $a1, $v1, 0xC */ - cpu->gpr[5] = cpu->gpr[3] & 0xCu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[5] = cpu->gpr[3] & 0xCu; + PGXP_ALU(0x3065000Cu, cpu->gpr[5], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0x80033728u); #endif @@ -201315,7 +201676,8 @@ label_BFC0DC38: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0DC38: 2C630040 sltiu $v1, $v1, 64 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C630040u, cpu->gpr[3], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80033738u); #endif @@ -201393,7 +201755,8 @@ label_BFC0DC48: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0DC4C: 306300FD andi $v1, $v1, 0xFD */ - cpu->gpr[3] = cpu->gpr[3] & 0xFDu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFDu; + PGXP_ALU(0x306300FDu, cpu->gpr[3], _pgx1, 0x00FDu); } #ifdef PSX_COSIM cosim_instr(0x8003374Cu); #endif @@ -201835,7 +202198,8 @@ label_BFC0DCD0: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC0DCD4: 316B00FF andi $t3, $t3, 0xFF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFFu; + PGXP_ALU(0x316B00FFu, cpu->gpr[11], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800337D4u); #endif @@ -201843,7 +202207,8 @@ label_BFC0DCD0: psx_cyc_step(cpu, 0x808u); #endif /* 0xBFC0DCD8: 2D63000D sltiu $v1, $t3, 13 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[11] < 0x0000000Du ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[3] = (uint32_t)(cpu->gpr[11] < 0x0000000Du ? 1 : 0); + PGXP_ALU(0x2D63000Du, cpu->gpr[3], _pgx1, 0x000Du); } #ifdef PSX_COSIM cosim_instr(0x800337D8u); #endif @@ -202353,7 +202718,8 @@ label_BFC0DD50: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0DD58: 306300F0 andi $v1, $v1, 0xF0 */ - cpu->gpr[3] = cpu->gpr[3] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xF0u; + PGXP_ALU(0x306300F0u, cpu->gpr[3], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80033858u); #endif @@ -202399,7 +202765,8 @@ label_BFC0DD64: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC0DD68: 310800F0 andi $t0, $t0, 0xF0 */ - cpu->gpr[8] = cpu->gpr[8] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xF0u; + PGXP_ALU(0x310800F0u, cpu->gpr[8], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80033868u); #endif @@ -202448,7 +202815,8 @@ label_BFC0DD6C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0DD74: 3042000F andi $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3042000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80033874u); #endif @@ -202593,7 +202961,8 @@ label_BFC0DD8C: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC0DD94: 306300F0 andi $v1, $v1, 0xF0 */ - cpu->gpr[3] = cpu->gpr[3] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xF0u; + PGXP_ALU(0x306300F0u, cpu->gpr[3], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80033894u); #endif @@ -202686,7 +203055,8 @@ label_BFC0DDA8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0DDB0: 3042000F andi $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3042000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x800338B0u); #endif @@ -203030,7 +203400,8 @@ label_BFC0DDF0: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC0DDF4: 29020041 slti $v0, $t0, 65 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[8] < (65) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[8] < (65) ? 1 : 0); + PGXP_ALU(0x29020041u, cpu->gpr[2], _pgx1, 0x0041u); } #ifdef PSX_COSIM cosim_instr(0x800338F4u); #endif @@ -203213,7 +203584,8 @@ label_BFC0DE28: psx_cyc_step(cpu, 0x208u); #endif /* 0xBFC0DE28: 31230001 andi $v1, $t1, 0x1 */ - cpu->gpr[3] = cpu->gpr[9] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[3] = cpu->gpr[9] & 0x1u; + PGXP_ALU(0x31230001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80033928u); #endif @@ -203545,7 +203917,8 @@ label_BFC0DE70: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0DE74: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80033974u); #endif @@ -203553,7 +203926,8 @@ label_BFC0DE70: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0DE78: 2C43000E sltiu $v1, $v0, 14 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x0000000Eu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x0000000Eu ? 1 : 0); + PGXP_ALU(0x2C43000Eu, cpu->gpr[3], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x80033978u); #endif @@ -204097,7 +204471,8 @@ label_BFC0DF00: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0DF08: 304200F0 andi $v0, $v0, 0xF0 */ - cpu->gpr[2] = cpu->gpr[2] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xF0u; + PGXP_ALU(0x304200F0u, cpu->gpr[2], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80033A08u); #endif @@ -204535,7 +204910,8 @@ label_BFC0DF68: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0DF70: 3042000F andi $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3042000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80033A70u); #endif @@ -204653,7 +205029,8 @@ label_BFC0DF80: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0DF90: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80033A90u); #endif @@ -204661,7 +205038,8 @@ label_BFC0DF80: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0DF94: 2C420040 sltiu $v0, $v0, 64 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C420040u, cpu->gpr[2], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80033A94u); #endif @@ -205041,7 +205419,8 @@ label_BFC0DFDC: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC0DFE0: 2D020020 sltiu $v0, $t0, 32 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[8] < 0x00000020u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[2] = (uint32_t)(cpu->gpr[8] < 0x00000020u ? 1 : 0); + PGXP_ALU(0x2D020020u, cpu->gpr[2], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80033AE0u); #endif @@ -205265,7 +205644,8 @@ label_BFC0E004: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC0E014: 0043182B sltu $v1, $v0, $v1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033B14u); #endif @@ -205635,7 +206015,8 @@ label_BFC1E51C: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC1E51C: 2CC30020 sltiu $v1, $a2, 32 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[6] < 0x00000020u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[3] = (uint32_t)(cpu->gpr[6] < 0x00000020u ? 1 : 0); + PGXP_ALU(0x2CC30020u, cpu->gpr[3], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x00000548u); #endif @@ -205840,7 +206221,8 @@ label_BFC1E540: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC1E554: 30830003 andi $v1, $a0, 0x3 */ - cpu->gpr[3] = cpu->gpr[4] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x3u; + PGXP_ALU(0x30830003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00000580u); #endif @@ -205920,7 +206302,8 @@ label_BFC1E540: psx_cyc_step(cpu, 0x240u); #endif /* 0xBFC1E578: 30C900FF andi $t1, $a2, 0xFF */ - cpu->gpr[9] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[9] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30C900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000005A4u); #endif @@ -208316,7 +208699,8 @@ label_BFC1E848: psx_cyc_step(cpu, 0x90u); #endif /* 0xBFC1E848: 00872024 and $a0, $a0, $a3 */ - cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[7]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[7]; + PGXP_ALU(0x00872024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00000874u); #endif @@ -209070,7 +209454,8 @@ label_BFC1E94C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1E958: 30420008 andi $v0, $v0, 0x8 */ - cpu->gpr[2] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30420008u, cpu->gpr[2], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x00000984u); #endif @@ -209131,7 +209516,8 @@ label_BFC1E964: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1E96C: 30420008 andi $v0, $v0, 0x8 */ - cpu->gpr[2] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30420008u, cpu->gpr[2], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x00000998u); #endif @@ -209209,7 +209595,8 @@ label_BFC1E978: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1E984: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000009B0u); #endif @@ -210003,7 +210390,8 @@ label_BFC1EA60: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1EA6C: 30420004 andi $v0, $v0, 0x4 */ - cpu->gpr[2] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30420004u, cpu->gpr[2], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00000A98u); #endif @@ -210067,7 +210455,8 @@ label_BFC1EA78: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1EA80: 30420004 andi $v0, $v0, 0x4 */ - cpu->gpr[2] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30420004u, cpu->gpr[2], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00000AACu); #endif @@ -210174,7 +210563,8 @@ label_BFC1EA8C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1EAA4: 30840007 andi $a0, $a0, 0x7 */ - cpu->gpr[4] = cpu->gpr[4] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x7u; + PGXP_ALU(0x30840007u, cpu->gpr[4], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x00000AD0u); #endif @@ -210318,7 +210708,8 @@ label_BFC1EACC: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC1EAD4: 30630018 andi $v1, $v1, 0x18 */ - cpu->gpr[3] = cpu->gpr[3] & 0x18u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x18u; + PGXP_ALU(0x30630018u, cpu->gpr[3], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0x00000B00u); #endif @@ -210401,7 +210792,8 @@ label_BFC1EAE0: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC1EAF0: 30630018 andi $v1, $v1, 0x18 */ - cpu->gpr[3] = cpu->gpr[3] & 0x18u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x18u; + PGXP_ALU(0x30630018u, cpu->gpr[3], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0x00000B1Cu); #endif @@ -210496,7 +210888,8 @@ label_BFC1EB0C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1EB14: 30420007 andi $v0, $v0, 0x7 */ - cpu->gpr[2] = cpu->gpr[2] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x7u; + PGXP_ALU(0x30420007u, cpu->gpr[2], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x00000B40u); #endif @@ -210513,7 +210906,8 @@ label_BFC1EB0C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1EB1C: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00000B48u); #endif @@ -210521,7 +210915,8 @@ label_BFC1EB0C: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1EB20: 2C430005 sltiu $v1, $v0, 5 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000005u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < 0x00000005u ? 1 : 0); + PGXP_ALU(0x2C430005u, cpu->gpr[3], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0x00000B4Cu); #endif @@ -210770,7 +211165,8 @@ label_BFC1EB50: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC1EB68: 2C4400F7 sltiu $a0, $v0, 247 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x000000F7u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x000000F7u ? 1 : 0); + PGXP_ALU(0x2C4400F7u, cpu->gpr[4], _pgx1, 0x00F7u); } #ifdef PSX_COSIM cosim_instr(0x00000B94u); #endif @@ -210966,7 +211362,8 @@ label_BFC1EB88: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC1EB94: 2C4400EC sltiu $a0, $v0, 236 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x000000ECu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x000000ECu ? 1 : 0); + PGXP_ALU(0x2C4400ECu, cpu->gpr[4], _pgx1, 0x00ECu); } #ifdef PSX_COSIM cosim_instr(0x00000BC0u); #endif @@ -211005,7 +211402,8 @@ label_BFC1EB98: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC1EB9C: 2C440006 sltiu $a0, $v0, 6 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x00000006u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x00000006u ? 1 : 0); + PGXP_ALU(0x2C440006u, cpu->gpr[4], _pgx1, 0x0006u); } #ifdef PSX_COSIM cosim_instr(0x00000BC8u); #endif @@ -211079,7 +211477,8 @@ label_BFC1EBA8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1EBA8: 2C420003 sltiu $v0, $v0, 3 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C420003u, cpu->gpr[2], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00000BD4u); #endif @@ -212280,7 +212679,8 @@ label_BFC1ECA0: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC1ECAC: 2C45001B sltiu $a1, $v0, 27 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x0000001Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x0000001Bu ? 1 : 0); + PGXP_ALU(0x2C45001Bu, cpu->gpr[5], _pgx1, 0x001Bu); } #ifdef PSX_COSIM cosim_instr(0x00000CD8u); #endif @@ -212394,7 +212794,8 @@ label_BFC1ECC0: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC1ECC0: 2C440013 sltiu $a0, $v0, 19 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x00000013u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x00000013u ? 1 : 0); + PGXP_ALU(0x2C440013u, cpu->gpr[4], _pgx1, 0x0013u); } #ifdef PSX_COSIM cosim_instr(0x00000CECu); #endif @@ -212463,7 +212864,8 @@ label_BFC1ECD0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1ECD0: 2C420002 sltiu $v0, $v0, 2 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00000CFCu); #endif @@ -212947,7 +213349,8 @@ label_BFC1ED24: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1ED2C: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00000D58u); #endif @@ -213117,7 +213520,8 @@ label_BFC1ED54: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC1ED60: 2C4500E7 sltiu $a1, $v0, 231 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x000000E7u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x000000E7u ? 1 : 0); + PGXP_ALU(0x2C4500E7u, cpu->gpr[5], _pgx1, 0x00E7u); } #ifdef PSX_COSIM cosim_instr(0x00000D8Cu); #endif @@ -213197,7 +213601,8 @@ label_BFC1ED6C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1ED70: 2C420003 sltiu $v0, $v0, 3 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C420003u, cpu->gpr[2], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00000D9Cu); #endif @@ -213691,7 +214096,8 @@ label_BFC1EDE0: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC1EDE0: 2C46001A sltiu $a2, $v0, 26 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < 0x0000001Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < 0x0000001Au ? 1 : 0); + PGXP_ALU(0x2C46001Au, cpu->gpr[6], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0x00000E0Cu); #endif @@ -213798,7 +214204,8 @@ label_BFC1EDF8: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC1EDFC: 2C440019 sltiu $a0, $v0, 25 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x00000019u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < 0x00000019u ? 1 : 0); + PGXP_ALU(0x2C440019u, cpu->gpr[4], _pgx1, 0x0019u); } #ifdef PSX_COSIM cosim_instr(0x00000E28u); #endif @@ -214109,7 +214516,8 @@ label_BFC1EE64: psx_cyc_step(cpu, 0x60u); #endif /* 0xBFC1EE74: 00A63024 and $a2, $a1, $a2 */ - cpu->gpr[6] = cpu->gpr[5] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[5] & cpu->gpr[6]; + PGXP_ALU(0x00A63024u, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00000EA0u); #endif @@ -214169,7 +214577,8 @@ label_BFC1EE80: psx_cyc_step(cpu, 0x60u); #endif /* 0xBFC1EE84: 00A62824 and $a1, $a1, $a2 */ - cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[6]; + PGXP_ALU(0x00A62824u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00000EB0u); #endif @@ -214299,7 +214708,8 @@ label_BFC1EEA0: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC1EEA0: 2C4500FF sltiu $a1, $v0, 255 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x000000FFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x000000FFu ? 1 : 0); + PGXP_ALU(0x2C4500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00000ECCu); #endif @@ -214317,7 +214727,8 @@ label_BFC1EEA0: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC1EEA8: 2C4500E6 sltiu $a1, $v0, 230 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x000000E6u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = (uint32_t)(cpu->gpr[2] < 0x000000E6u ? 1 : 0); + PGXP_ALU(0x2C4500E6u, cpu->gpr[5], _pgx1, 0x00E6u); } #ifdef PSX_COSIM cosim_instr(0x00000ED4u); #endif @@ -215179,7 +215590,8 @@ label_BFC1EF34: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC1EF68: 00A2282B sltu $a1, $a1, $v0 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[5] = (uint32_t)(cpu->gpr[5] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x00A2282Bu, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00000F94u); #endif @@ -215240,7 +215652,8 @@ label_BFC1EF74: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC1EF7C: 30A50010 andi $a1, $a1, 0x10 */ - cpu->gpr[5] = cpu->gpr[5] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x10u; + PGXP_ALU(0x30A50010u, cpu->gpr[5], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00000FA8u); #endif @@ -215801,7 +216214,8 @@ label_BFC1EFF4: psx_cyc_step(cpu, 0x90u); #endif /* 0xBFC1EFF8: 30E4000F andi $a0, $a3, 0xF */ - cpu->gpr[4] = cpu->gpr[7] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[4] = cpu->gpr[7] & 0xFu; + PGXP_ALU(0x30E4000Fu, cpu->gpr[4], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x00001024u); #endif @@ -215937,7 +216351,8 @@ label_BFC1F014: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC1F018: 30C6000F andi $a2, $a2, 0xF */ - cpu->gpr[6] = cpu->gpr[6] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0xFu; + PGXP_ALU(0x30C6000Fu, cpu->gpr[6], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x00001044u); #endif @@ -216055,7 +216470,8 @@ label_BFC1F034: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1F034: 30840010 andi $a0, $a0, 0x10 */ - cpu->gpr[4] = cpu->gpr[4] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x10u; + PGXP_ALU(0x30840010u, cpu->gpr[4], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00001060u); #endif @@ -216465,7 +216881,8 @@ label_BFC1F098: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F0A8: 30420100 andi $v0, $v0, 0x100 */ - cpu->gpr[2] = cpu->gpr[2] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x100u; + PGXP_ALU(0x30420100u, cpu->gpr[2], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x000010D4u); #endif @@ -217519,7 +217936,8 @@ label_BFC1F19C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F1A0: 2C420003 sltiu $v0, $v0, 3 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C420003u, cpu->gpr[2], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x000011CCu); #endif @@ -218792,7 +219210,8 @@ label_BFC1F2E8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F2F0: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x0000131Cu); #endif @@ -219850,7 +220269,8 @@ label_BFC1F410: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC1F418: 30C30010 andi $v1, $a2, 0x10 */ - cpu->gpr[3] = cpu->gpr[6] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[3] = cpu->gpr[6] & 0x10u; + PGXP_ALU(0x30C30010u, cpu->gpr[3], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00001444u); #endif @@ -219907,7 +220327,8 @@ label_BFC1F428: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC1F428: 30C30020 andi $v1, $a2, 0x20 */ - cpu->gpr[3] = cpu->gpr[6] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[3] = cpu->gpr[6] & 0x20u; + PGXP_ALU(0x30C30020u, cpu->gpr[3], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x00001454u); #endif @@ -220117,7 +220538,8 @@ label_BFC1F438: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC1F474: 30630010 andi $v1, $v1, 0x10 */ - cpu->gpr[3] = cpu->gpr[3] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x10u; + PGXP_ALU(0x30630010u, cpu->gpr[3], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000014A0u); #endif @@ -220527,7 +220949,8 @@ label_BFC1F4D4: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC1F4EC: 30630010 andi $v1, $v1, 0x10 */ - cpu->gpr[3] = cpu->gpr[3] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x10u; + PGXP_ALU(0x30630010u, cpu->gpr[3], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00001518u); #endif @@ -221057,7 +221480,8 @@ label_BFC1F568: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC1F594: 00461024 and $v0, $v0, $a2 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + PGXP_ALU(0x00461024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000015C0u); #endif @@ -221092,7 +221516,8 @@ label_BFC1F568: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F5A4: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000015D0u); #endif @@ -221126,7 +221551,8 @@ label_BFC1F568: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC1F5B4: 00461024 and $v0, $v0, $a2 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + PGXP_ALU(0x00461024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000015E0u); #endif @@ -221160,7 +221586,8 @@ label_BFC1F568: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F5C4: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000015F0u); #endif @@ -221282,7 +221709,8 @@ label_BFC1F568: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F5F8: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001624u); #endif @@ -221470,7 +221898,8 @@ label_BFC1F634: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC1F63C: 00461024 and $v0, $v0, $a2 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[6]; + PGXP_ALU(0x00461024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001668u); #endif @@ -221957,7 +222386,8 @@ label_BFC1F6B8: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F6D4: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001700u); #endif @@ -221965,7 +222395,8 @@ label_BFC1F6B8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F6D8: 30420004 andi $v0, $v0, 0x4 */ - cpu->gpr[2] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30420004u, cpu->gpr[2], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00001704u); #endif @@ -222136,7 +222567,8 @@ label_BFC1F704: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F70C: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001738u); #endif @@ -222205,7 +222637,8 @@ label_BFC1F718: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F724: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001750u); #endif @@ -222213,7 +222646,8 @@ label_BFC1F718: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F728: 30420200 andi $v0, $v0, 0x200 */ - cpu->gpr[2] = cpu->gpr[2] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x200u; + PGXP_ALU(0x30420200u, cpu->gpr[2], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0x00001754u); #endif @@ -222384,7 +222818,8 @@ label_BFC1F754: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F75C: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001788u); #endif @@ -222443,7 +222878,8 @@ label_BFC1F764: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F774: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000017A0u); #endif @@ -222451,7 +222887,8 @@ label_BFC1F764: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F778: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x000017A4u); #endif @@ -222622,7 +223059,8 @@ label_BFC1F7A4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F7AC: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000017D8u); #endif @@ -222691,7 +223129,8 @@ label_BFC1F7B8: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F7C4: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000017F0u); #endif @@ -222699,7 +223138,8 @@ label_BFC1F7B8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F7C8: 30420400 andi $v0, $v0, 0x400 */ - cpu->gpr[2] = cpu->gpr[2] & 0x400u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x400u; + PGXP_ALU(0x30420400u, cpu->gpr[2], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x000017F4u); #endif @@ -223021,7 +223461,8 @@ label_BFC1F7F4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F7FC: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001828u); #endif @@ -223159,7 +223600,8 @@ label_BFC1F814: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F814: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001840u); #endif @@ -223190,7 +223632,8 @@ label_BFC1F818: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F818: 30420100 andi $v0, $v0, 0x100 */ - cpu->gpr[2] = cpu->gpr[2] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x100u; + PGXP_ALU(0x30420100u, cpu->gpr[2], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x00001844u); #endif @@ -223466,7 +223909,8 @@ label_BFC1F84C: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F84C: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001878u); #endif @@ -223613,7 +224057,8 @@ label_BFC1F858: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F864: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001890u); #endif @@ -223621,7 +224066,8 @@ label_BFC1F858: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F868: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001894u); #endif @@ -223792,7 +224238,8 @@ label_BFC1F894: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F89C: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000018C8u); #endif @@ -223851,7 +224298,8 @@ label_BFC1F8A4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F8B4: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000018E0u); #endif @@ -223859,7 +224307,8 @@ label_BFC1F8A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F8B8: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000018E4u); #endif @@ -224030,7 +224479,8 @@ label_BFC1F8E4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F8EC: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001918u); #endif @@ -224099,7 +224549,8 @@ label_BFC1F8F8: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F904: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001930u); #endif @@ -224107,7 +224558,8 @@ label_BFC1F8F8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F908: 30420020 andi $v0, $v0, 0x20 */ - cpu->gpr[2] = cpu->gpr[2] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x20u; + PGXP_ALU(0x30420020u, cpu->gpr[2], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x00001934u); #endif @@ -224278,7 +224730,8 @@ label_BFC1F934: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F93C: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001968u); #endif @@ -224337,7 +224790,8 @@ label_BFC1F944: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F954: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001980u); #endif @@ -224345,7 +224799,8 @@ label_BFC1F944: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F958: 30420040 andi $v0, $v0, 0x40 */ - cpu->gpr[2] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x30420040u, cpu->gpr[2], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x00001984u); #endif @@ -224516,7 +224971,8 @@ label_BFC1F984: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F98C: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000019B8u); #endif @@ -224585,7 +225041,8 @@ label_BFC1F998: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F9A4: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000019D0u); #endif @@ -224593,7 +225050,8 @@ label_BFC1F998: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F9A8: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000019D4u); #endif @@ -224764,7 +225222,8 @@ label_BFC1F9D4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F9DC: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001A08u); #endif @@ -224823,7 +225282,8 @@ label_BFC1F9E4: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1F9F4: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001A20u); #endif @@ -224831,7 +225291,8 @@ label_BFC1F9E4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1F9F8: 30420008 andi $v0, $v0, 0x8 */ - cpu->gpr[2] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30420008u, cpu->gpr[2], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x00001A24u); #endif @@ -225002,7 +225463,8 @@ label_BFC1FA24: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC1FA2C: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001A58u); #endif @@ -225137,7 +225599,8 @@ label_BFC1FA48: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FA54: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001A80u); #endif @@ -225201,7 +225664,8 @@ label_BFC1FA60: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FA68: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001A94u); #endif @@ -225446,7 +225910,8 @@ label_BFC1FAA0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FAAC: 30420040 andi $v0, $v0, 0x40 */ - cpu->gpr[2] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x30420040u, cpu->gpr[2], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x00001AD8u); #endif @@ -225510,7 +225975,8 @@ label_BFC1FAB8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FAC0: 30420040 andi $v0, $v0, 0x40 */ - cpu->gpr[2] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x30420040u, cpu->gpr[2], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x00001AECu); #endif @@ -225761,7 +226227,8 @@ label_BFC1FAF8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FB04: 30420020 andi $v0, $v0, 0x20 */ - cpu->gpr[2] = cpu->gpr[2] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x20u; + PGXP_ALU(0x30420020u, cpu->gpr[2], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x00001B30u); #endif @@ -225825,7 +226292,8 @@ label_BFC1FB10: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FB18: 30420020 andi $v0, $v0, 0x20 */ - cpu->gpr[2] = cpu->gpr[2] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x20u; + PGXP_ALU(0x30420020u, cpu->gpr[2], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x00001B44u); #endif @@ -226070,7 +226538,8 @@ label_BFC1FB50: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FB5C: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00001B88u); #endif @@ -226134,7 +226603,8 @@ label_BFC1FB68: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FB70: 30420010 andi $v0, $v0, 0x10 */ - cpu->gpr[2] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30420010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00001B9Cu); #endif @@ -227657,7 +228127,8 @@ label_BFC1FCB4: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC1FCD8: 00451024 and $v0, $v0, $a1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[5]; + PGXP_ALU(0x00451024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001D04u); #endif @@ -228112,7 +228583,8 @@ label_BFC1FD74: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC1FD74: 2C830003 sltiu $v1, $a0, 3 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C830003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00001DA0u); #endif @@ -228264,7 +228736,8 @@ label_BFC1FD98: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1FD98: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001DC4u); #endif @@ -228272,7 +228745,8 @@ label_BFC1FD98: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC1FD9C: 2C830003 sltiu $v1, $a0, 3 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C830003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00001DC8u); #endif @@ -228362,7 +228836,8 @@ label_BFC1FDA8: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC1FDB8: 30C20010 andi $v0, $a2, 0x10 */ - cpu->gpr[2] = cpu->gpr[6] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[6] & 0x10u; + PGXP_ALU(0x30C20010u, cpu->gpr[2], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00001DE4u); #endif @@ -228370,7 +228845,8 @@ label_BFC1FDA8: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC1FDBC: 30C30001 andi $v1, $a2, 0x1 */ - cpu->gpr[3] = cpu->gpr[6] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[3] = cpu->gpr[6] & 0x1u; + PGXP_ALU(0x30C30001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001DE8u); #endif @@ -228378,7 +228854,8 @@ label_BFC1FDA8: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC1FDC0: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001DECu); #endif @@ -228407,7 +228884,8 @@ label_BFC1FDA8: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC1FDCC: 30C61000 andi $a2, $a2, 0x1000 */ - cpu->gpr[6] = cpu->gpr[6] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x1000u; + PGXP_ALU(0x30C61000u, cpu->gpr[6], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x00001DF8u); #endif @@ -228574,7 +229052,8 @@ label_BFC1FDF8: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC1FDF8: 3082FFFF andi $v0, $a0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3082FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001E24u); #endif @@ -228645,7 +229124,8 @@ label_BFC1FDF8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1FE18: 2C420003 sltiu $v0, $v0, 3 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C420003u, cpu->gpr[2], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00001E44u); #endif @@ -228714,7 +229194,8 @@ label_BFC1FE2C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1FE2C: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001E58u); #endif @@ -228785,7 +229266,8 @@ label_BFC1FE2C: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC1FE4C: 00021027 nor $v0, $zero, $v0 */ - cpu->gpr[2] = ~(cpu->gpr[0] | cpu->gpr[2]); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = ~(cpu->gpr[0] | cpu->gpr[2]); + PGXP_ALU(0x00021027u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001E78u); #endif @@ -228793,7 +229275,8 @@ label_BFC1FE2C: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC1FE50: 00451024 and $v0, $v0, $a1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[5]; + PGXP_ALU(0x00451024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001E7Cu); #endif @@ -228865,7 +229348,8 @@ label_BFC1FE60: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1FE60: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001E8Cu); #endif @@ -228876,7 +229360,8 @@ label_BFC1FE60: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC1FE64: 2C830003 sltiu $v1, $a0, 3 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[4] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C830003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00001E90u); #endif @@ -229792,7 +230277,8 @@ label_BFC1FF40: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC1FF5C: 3063003C andi $v1, $v1, 0x3C */ - cpu->gpr[3] = cpu->gpr[3] & 0x3Cu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x3Cu; + PGXP_ALU(0x3063003Cu, cpu->gpr[3], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x00001F88u); #endif @@ -229963,7 +230449,8 @@ label_BFC1FF78: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC1FF94: 2C650003 sltiu $a1, $v1, 3 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[3] < 0x00000003u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[5] = (uint32_t)(cpu->gpr[3] < 0x00000003u ? 1 : 0); + PGXP_ALU(0x2C650003u, cpu->gpr[5], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00001FC0u); #endif @@ -230306,7 +230793,8 @@ label_BFC1FFD8: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC1FFD8: 30830404 andi $v1, $a0, 0x404 */ - cpu->gpr[3] = cpu->gpr[4] & 0x404u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x404u; + PGXP_ALU(0x30830404u, cpu->gpr[3], _pgx1, 0x0404u); } #ifdef PSX_COSIM cosim_instr(0x00002004u); #endif @@ -230337,7 +230825,8 @@ label_BFC1FFDC: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC1FFDC: 38630404 xori $v1, $v1, 0x404 */ - cpu->gpr[3] = cpu->gpr[3] ^ 0x404u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] ^ 0x404u; + PGXP_ALU(0x38630404u, cpu->gpr[3], _pgx1, 0x0404u); } #ifdef PSX_COSIM cosim_instr(0x00002008u); #endif @@ -230368,7 +230857,8 @@ label_BFC1FFE0: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC1FFE0: 2C630001 sltiu $v1, $v1, 1 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C630001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x0000200Cu); #endif @@ -230442,7 +230932,8 @@ label_BFC1FFE8: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC1FFEC: 00832024 and $a0, $a0, $v1 */ - cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[3]; + PGXP_ALU(0x00832024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002018u); #endif @@ -231204,7 +231695,8 @@ label_BFC20070: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC20078: 00822024 and $a0, $a0, $v0 */ - cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[2]; + PGXP_ALU(0x00822024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000020A4u); #endif @@ -231670,7 +232162,8 @@ label_BFC200E8: psx_cyc_step(cpu, 0x510u); #endif /* 0xBFC200F0: 0104502B sltu $t2, $t0, $a0 */ - cpu->gpr[10] = (uint32_t)(cpu->gpr[8] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[10] = (uint32_t)(cpu->gpr[8] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0104502Bu, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000211Cu); #endif @@ -231773,7 +232266,8 @@ label_BFC20104: psx_cyc_step(cpu, 0x500u); #endif /* 0xBFC2010C: 010A502B sltu $t2, $t0, $t2 */ - cpu->gpr[10] = (uint32_t)(cpu->gpr[8] < cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[10] = (uint32_t)(cpu->gpr[8] < cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x010A502Bu, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002138u); #endif @@ -232691,7 +233185,8 @@ label_BFC201D4: psx_cyc_step(cpu, 0x10Cu); #endif /* 0xBFC201D8: 0062402B sltu $t0, $v1, $v0 */ - cpu->gpr[8] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[8] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062402Bu, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002204u); #endif @@ -233438,7 +233933,8 @@ label_BFC202A4: psx_cyc_step(cpu, 0x10Cu); #endif /* 0xBFC202B4: 0062402B sltu $t0, $v1, $v0 */ - cpu->gpr[8] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[8] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062402Bu, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000022E0u); #endif @@ -234016,7 +234512,8 @@ label_BFC20318: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC20324: 00C23024 and $a2, $a2, $v0 */ - cpu->gpr[6] = cpu->gpr[6] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[6] = cpu->gpr[6] & cpu->gpr[2]; + PGXP_ALU(0x00C23024u, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002350u); #endif @@ -234189,7 +234686,8 @@ label_BFC20350: psx_cyc_step(cpu, 0x848u); #endif /* 0xBFC20350: 00CB182B sltu $v1, $a2, $t3 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[6] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[3] = (uint32_t)(cpu->gpr[6] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x00CB182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000237Cu); #endif @@ -234418,7 +234916,8 @@ label_BFC20388: psx_cyc_step(cpu, 0x114u); #endif /* 0xBFC20388: 0048202B sltu $a0, $v0, $t0 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0048202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000023B4u); #endif @@ -234466,7 +234965,8 @@ label_BFC20394: psx_cyc_step(cpu, 0x850u); #endif /* 0xBFC20394: 00CB202B sltu $a0, $a2, $t3 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[6] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[4] = (uint32_t)(cpu->gpr[6] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x00CB202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000023C0u); #endif @@ -234743,7 +235243,8 @@ label_BFC203D4: psx_cyc_step(cpu, 0x218u); #endif /* 0xBFC203DC: 0124182B sltu $v1, $t1, $a0 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[9] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[9] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0124182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002408u); #endif @@ -235239,7 +235740,8 @@ label_BFC20448: psx_cyc_step(cpu, 0x114u); #endif /* 0xBFC20454: 0048202B sltu $a0, $v0, $t0 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[4] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0048202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002480u); #endif @@ -235271,7 +235773,8 @@ label_BFC20458: psx_cyc_step(cpu, 0x850u); #endif /* 0xBFC20458: 00CB202B sltu $a0, $a2, $t3 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[6] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[4] = (uint32_t)(cpu->gpr[6] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x00CB202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002484u); #endif @@ -235551,7 +236054,8 @@ label_BFC2049C: psx_cyc_step(cpu, 0x850u); #endif /* 0xBFC2049C: 00CB202B sltu $a0, $a2, $t3 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[6] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[4] = (uint32_t)(cpu->gpr[6] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x00CB202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000024C8u); #endif @@ -235990,7 +236494,8 @@ label_BFC20500: psx_cyc_step(cpu, 0x218u); #endif /* 0xBFC20508: 0124182B sltu $v1, $t1, $a0 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[9] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[9] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0124182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002534u); #endif @@ -236415,7 +236920,8 @@ label_BFC2056C: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC20574: 00832024 and $a0, $a0, $v1 */ - cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[3]; + PGXP_ALU(0x00832024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000025A0u); #endif @@ -236471,7 +236977,8 @@ label_BFC2056C: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC2058C: 00A32824 and $a1, $a1, $v1 */ - cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[3]; + PGXP_ALU(0x00A32824u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000025B8u); #endif @@ -236673,7 +237180,8 @@ label_BFC205B4: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC205BC: 00832024 and $a0, $a0, $v1 */ - cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[3]; + PGXP_ALU(0x00832024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000025E8u); #endif @@ -236732,7 +237240,8 @@ label_BFC205B4: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC205D4: 00A32824 and $a1, $a1, $v1 */ - cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[3]; + PGXP_ALU(0x00A32824u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002600u); #endif @@ -236937,7 +237446,8 @@ label_BFC20610: psx_cyc_step(cpu, 0x30004u); #endif /* 0xBFC20610: 0211102B sltu $v0, $s0, $s1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[2] = (uint32_t)(cpu->gpr[16] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0211102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000263Cu); #endif @@ -237626,7 +238136,8 @@ label_BFC206D0: psx_cyc_step(cpu, 0x4Cu); #endif /* 0xBFC206D0: 0043302B sltu $a2, $v0, $v1 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[6] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043302Bu, cpu->gpr[6], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000026FCu); #endif @@ -238832,7 +239343,8 @@ label_BFC207C0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC207C0: 3042003C andi $v0, $v0, 0x3C */ - cpu->gpr[2] = cpu->gpr[2] & 0x3Cu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x3Cu; + PGXP_ALU(0x3042003Cu, cpu->gpr[2], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x000027ECu); #endif @@ -238908,7 +239420,8 @@ label_BFC207CC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC207D8: 304200FE andi $v0, $v0, 0xFE */ - cpu->gpr[2] = cpu->gpr[2] & 0xFEu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFEu; + PGXP_ALU(0x304200FEu, cpu->gpr[2], _pgx1, 0x00FEu); } #ifdef PSX_COSIM cosim_instr(0x00002804u); #endif @@ -241496,7 +242009,8 @@ label_BFC20B30: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC20B54: 2C65000D sltiu $a1, $v1, 13 */ - cpu->gpr[5] = (uint32_t)(cpu->gpr[3] < 0x0000000Du ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[5] = (uint32_t)(cpu->gpr[3] < 0x0000000Du ? 1 : 0); + PGXP_ALU(0x2C65000Du, cpu->gpr[5], _pgx1, 0x000Du); } #ifdef PSX_COSIM cosim_instr(0x00002B80u); #endif @@ -241643,7 +242157,8 @@ label_BFC20B80: psx_cyc_step(cpu, 0x11u); #endif /* 0xBFC20B80: 0004202B sltu $a0, $zero, $a0 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0004202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002BACu); #endif @@ -241753,7 +242268,8 @@ label_BFC20B80: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC20BB0: 3063000F andi $v1, $v1, 0xF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFu; + PGXP_ALU(0x3063000Fu, cpu->gpr[3], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x00002BDCu); #endif @@ -242272,7 +242788,8 @@ label_BFC20C5C: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC20C5C: 30A30008 andi $v1, $a1, 0x8 */ - cpu->gpr[3] = cpu->gpr[5] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[3] = cpu->gpr[5] & 0x8u; + PGXP_ALU(0x30A30008u, cpu->gpr[3], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x00002C88u); #endif @@ -242655,7 +243172,8 @@ label_BFC20CCC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC20CDC: 3842005A xori $v0, $v0, 0x5A */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x5Au; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x5Au; + PGXP_ALU(0x3842005Au, cpu->gpr[2], _pgx1, 0x005Au); } #ifdef PSX_COSIM cosim_instr(0x00002D08u); #endif @@ -242714,7 +243232,8 @@ label_BFC20CCC: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC20CF4: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002D20u); #endif @@ -242837,7 +243356,8 @@ label_BFC20D10: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC20D14: 3842005D xori $v0, $v0, 0x5D */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x5Du; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x5Du; + PGXP_ALU(0x3842005Du, cpu->gpr[2], _pgx1, 0x005Du); } #ifdef PSX_COSIM cosim_instr(0x00002D40u); #endif @@ -242900,7 +243420,8 @@ label_BFC20D10: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC20D30: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002D5Cu); #endif @@ -243142,7 +243663,8 @@ label_BFC20D5C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC20D6C: 3842005C xori $v0, $v0, 0x5C */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x5Cu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x5Cu; + PGXP_ALU(0x3842005Cu, cpu->gpr[2], _pgx1, 0x005Cu); } #ifdef PSX_COSIM cosim_instr(0x00002D98u); #endif @@ -243208,7 +243730,8 @@ label_BFC20D5C: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC20D88: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002DB4u); #endif @@ -243454,7 +243977,8 @@ label_BFC20DA0: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC20DD0: 00A22826 xor $a1, $a1, $v0 */ - cpu->gpr[5] = cpu->gpr[5] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[5] ^ cpu->gpr[2]; + PGXP_ALU(0x00A22826u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002DFCu); #endif @@ -243534,7 +244058,8 @@ label_BFC20DD4: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC20DE8: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00002E14u); #endif @@ -243697,7 +244222,8 @@ label_BFC20DFC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC20E1C: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00002E48u); #endif @@ -244044,7 +244570,8 @@ label_BFC20E48: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC20E98: 00641826 xor $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] ^ cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] ^ cpu->gpr[4]; + PGXP_ALU(0x00641826u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002EC4u); #endif @@ -244313,7 +244840,8 @@ label_BFC20EE8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC20EF0: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00002F1Cu); #endif @@ -244574,7 +245102,8 @@ label_BFC20F18: psx_cyc_step(cpu, 0x48u); #endif /* 0xBFC20F3C: 2C66000A sltiu $a2, $v1, 10 */ - cpu->gpr[6] = (uint32_t)(cpu->gpr[3] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[6] = (uint32_t)(cpu->gpr[3] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2C66000Au, cpu->gpr[6], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x00002F68u); #endif @@ -244736,7 +245265,8 @@ label_BFC20F70: psx_cyc_step(cpu, 0x11u); #endif /* 0xBFC20F70: 0004202B sltu $a0, $zero, $a0 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0004202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002F9Cu); #endif @@ -244846,7 +245376,8 @@ label_BFC20F70: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC20FA0: 3063000F andi $v1, $v1, 0xF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFu; + PGXP_ALU(0x3063000Fu, cpu->gpr[3], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x00002FCCu); #endif @@ -245682,7 +246213,8 @@ label_BFC2104C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC21064: 30A50008 andi $a1, $a1, 0x8 */ - cpu->gpr[5] = cpu->gpr[5] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x8u; + PGXP_ALU(0x30A50008u, cpu->gpr[5], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x00003090u); #endif @@ -246066,7 +246598,8 @@ label_BFC210C0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC210D0: 3842005A xori $v0, $v0, 0x5A */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x5Au; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x5Au; + PGXP_ALU(0x3842005Au, cpu->gpr[2], _pgx1, 0x005Au); } #ifdef PSX_COSIM cosim_instr(0x000030FCu); #endif @@ -246125,7 +246658,8 @@ label_BFC210C0: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC210E8: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003114u); #endif @@ -246487,7 +247021,8 @@ label_BFC2113C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2114C: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00003178u); #endif @@ -246590,7 +247125,8 @@ label_BFC2113C: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC21178: 00821026 xor $v0, $a0, $v0 */ - cpu->gpr[2] = cpu->gpr[4] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[4] ^ cpu->gpr[2]; + PGXP_ALU(0x00821026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000031A4u); #endif @@ -246923,7 +247459,8 @@ label_BFC211CC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC211DC: 3842005C xori $v0, $v0, 0x5C */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x5Cu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x5Cu; + PGXP_ALU(0x3842005Cu, cpu->gpr[2], _pgx1, 0x005Cu); } #ifdef PSX_COSIM cosim_instr(0x00003208u); #endif @@ -246989,7 +247526,8 @@ label_BFC211CC: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC211F8: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003224u); #endif @@ -247223,7 +247761,8 @@ label_BFC21230: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21238: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00003264u); #endif @@ -247360,7 +247899,8 @@ label_BFC21254: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21264: 30420004 andi $v0, $v0, 0x4 */ - cpu->gpr[2] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30420004u, cpu->gpr[2], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00003290u); #endif @@ -247892,7 +248432,8 @@ label_BFC212E0: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC212F8: 28440004 slti $a0, $v0, 4 */ - cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[2] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)((int32_t)cpu->gpr[2] < (4) ? 1 : 0); + PGXP_ALU(0x28440004u, cpu->gpr[4], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00003324u); #endif @@ -248383,7 +248924,8 @@ label_BFC2137C: psx_cyc_step(cpu, 0x19u); #endif /* 0xBFC2137C: 0003202B sltu $a0, $zero, $v1 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0003202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000033A8u); #endif @@ -248493,7 +249035,8 @@ label_BFC2137C: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC213AC: 3063000F andi $v1, $v1, 0xF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFu; + PGXP_ALU(0x3063000Fu, cpu->gpr[3], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x000033D8u); #endif @@ -248933,7 +249476,8 @@ label_BFC21450: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC21450: 3085000C andi $a1, $a0, 0xC */ - cpu->gpr[5] = cpu->gpr[4] & 0xCu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[5] = cpu->gpr[4] & 0xCu; + PGXP_ALU(0x3085000Cu, cpu->gpr[5], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0x0000347Cu); #endif @@ -249067,7 +249611,8 @@ label_BFC2145C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC21480: 30840004 andi $a0, $a0, 0x4 */ - cpu->gpr[4] = cpu->gpr[4] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x4u; + PGXP_ALU(0x30840004u, cpu->gpr[4], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x000034ACu); #endif @@ -249571,7 +250116,8 @@ label_BFC21504: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC2150C: 30430001 andi $v1, $v0, 0x1 */ - cpu->gpr[3] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30430001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00003538u); #endif @@ -249833,7 +250379,8 @@ label_BFC2153C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21544: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00003570u); #endif @@ -249956,7 +250503,8 @@ label_BFC21558: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21558: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00003584u); #endif @@ -250279,7 +250827,8 @@ label_BFC21588: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC215C4: 00220826 xor $at, $at, $v0 */ - cpu->gpr[1] = cpu->gpr[1] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[1]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = cpu->gpr[1] ^ cpu->gpr[2]; + PGXP_ALU(0x00220826u, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000035F0u); #endif @@ -250361,7 +250910,8 @@ label_BFC21588: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC215E8: 2C420080 sltiu $v0, $v0, 128 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00003614u); #endif @@ -250581,7 +251131,8 @@ label_BFC215FC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC21638: 00220826 xor $at, $at, $v0 */ - cpu->gpr[1] = cpu->gpr[1] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[1]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = cpu->gpr[1] ^ cpu->gpr[2]; + PGXP_ALU(0x00220826u, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003664u); #endif @@ -250663,7 +251214,8 @@ label_BFC215FC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2165C: 2C42007F sltiu $v0, $v0, 127 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C42007Fu, cpu->gpr[2], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x00003688u); #endif @@ -250947,7 +251499,8 @@ label_BFC216AC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC216B8: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000036E4u); #endif @@ -251008,7 +251561,8 @@ label_BFC216C4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC216CC: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000036F8u); #endif @@ -251084,7 +251638,8 @@ label_BFC216D8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC216E4: 2C420001 sltiu $v0, $v0, 1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00003710u); #endif @@ -251179,7 +251734,8 @@ label_BFC216F0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC216FC: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00003728u); #endif @@ -251243,7 +251799,8 @@ label_BFC21708: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21710: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x0000373Cu); #endif @@ -252155,7 +252712,8 @@ label_BFC2180C: psx_cyc_step(cpu, 0x15u); #endif /* 0xBFC2181C: 0002202B sltu $a0, $zero, $v0 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[4] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002202Bu, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003848u); #endif @@ -253058,7 +253616,8 @@ label_BFC21924: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC21938: 00641824 and $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + PGXP_ALU(0x00641824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003964u); #endif @@ -253428,7 +253987,8 @@ label_BFC21998: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC219AC: 00641824 and $v1, $v1, $a0 */ - cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[3] & cpu->gpr[4]; + PGXP_ALU(0x00641824u, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000039D8u); #endif @@ -253977,7 +254537,8 @@ label_BFC21A20: psx_cyc_step(cpu, 0x800000u); #endif /* 0xBFC21A68: 32F7FFFF andi $s7, $s7, 0xFFFF */ - cpu->gpr[23] = cpu->gpr[23] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[23]; cpu->gpr[23] = cpu->gpr[23] & 0xFFFFu; + PGXP_ALU(0x32F7FFFFu, cpu->gpr[23], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00003A94u); #endif @@ -254126,7 +254687,8 @@ label_BFC21A98: psx_cyc_step(cpu, 0x20001u); #endif /* 0xBFC21AA0: 0011882B sltu $s1, $zero, $s1 */ - cpu->gpr[17] = (uint32_t)(cpu->gpr[0] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[17] = (uint32_t)(cpu->gpr[0] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0011882Bu, cpu->gpr[17], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003ACCu); #endif @@ -254258,7 +254820,8 @@ label_BFC21AC4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21ACC: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00003AF8u); #endif @@ -254475,7 +255038,8 @@ label_BFC21B0C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21B14: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00003B40u); #endif @@ -254607,7 +255171,8 @@ label_BFC21B34: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21B3C: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00003B68u); #endif @@ -254811,7 +255376,8 @@ label_BFC21B78: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21B80: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00003BACu); #endif @@ -254888,7 +255454,8 @@ label_BFC21B8C: psx_cyc_step(cpu, 0x10000u); #endif /* 0xBFC21B98: 3210000F andi $s0, $s0, 0xF */ - cpu->gpr[16] = cpu->gpr[16] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[16] = cpu->gpr[16] & 0xFu; + PGXP_ALU(0x3210000Fu, cpu->gpr[16], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x00003BC4u); #endif @@ -254991,7 +255558,8 @@ label_BFC21BAC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21BB4: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00003BE0u); #endif @@ -255249,7 +255817,8 @@ label_BFC21BEC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21BF4: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00003C20u); #endif @@ -255558,7 +256127,8 @@ label_BFC21C20: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC21C24: 30630080 andi $v1, $v1, 0x80 */ - cpu->gpr[3] = cpu->gpr[3] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x80u; + PGXP_ALU(0x30630080u, cpu->gpr[3], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00003C50u); #endif @@ -255774,7 +256344,8 @@ label_BFC21C48: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC21C50: 02221024 and $v0, $s1, $v0 */ - cpu->gpr[2] = cpu->gpr[17] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[17] & cpu->gpr[2]; + PGXP_ALU(0x02221024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003C7Cu); #endif @@ -255951,7 +256522,8 @@ label_BFC21C88: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21C90: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00003CBCu); #endif @@ -256064,7 +256636,8 @@ label_BFC21CAC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21CB4: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00003CE0u); #endif @@ -256192,7 +256765,8 @@ label_BFC21CD4: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC21CDC: 02221024 and $v0, $s1, $v0 */ - cpu->gpr[2] = cpu->gpr[17] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[17] & cpu->gpr[2]; + PGXP_ALU(0x02221024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003D08u); #endif @@ -256343,7 +256917,8 @@ label_BFC21D08: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21D10: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00003D3Cu); #endif @@ -257085,7 +257660,8 @@ label_BFC21DDC: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC21DE4: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003E10u); #endif @@ -257131,7 +257707,8 @@ label_BFC21DE8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21DF0: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00003E1Cu); #endif @@ -257217,7 +257794,8 @@ label_BFC21E00: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC21E08: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00003E34u); #endif @@ -257470,7 +258048,8 @@ label_BFC21E34: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC21E3C: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003E68u); #endif @@ -258412,7 +258991,8 @@ label_BFC21F1C: psx_cyc_step(cpu, 0x60u); #endif /* 0xBFC21F3C: 00A62824 and $a1, $a1, $a2 */ - cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[6]; + PGXP_ALU(0x00A62824u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003F68u); #endif @@ -258943,7 +259523,8 @@ label_BFC21FE0: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC21FE0: 30840001 andi $a0, $a0, 0x1 */ - cpu->gpr[4] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30840001u, cpu->gpr[4], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x0000400Cu); #endif @@ -262472,7 +263053,8 @@ label_BFC22414: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC22414: 38C20041 xori $v0, $a2, 0x41 */ - cpu->gpr[2] = cpu->gpr[6] ^ 0x41u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[6] ^ 0x41u; + PGXP_ALU(0x38C20041u, cpu->gpr[2], _pgx1, 0x0041u); } #ifdef PSX_COSIM cosim_instr(0x00004440u); #endif @@ -262487,7 +263069,8 @@ label_BFC22414: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC2241C: 38C20023 xori $v0, $a2, 0x23 */ - cpu->gpr[2] = cpu->gpr[6] ^ 0x23u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[6] ^ 0x23u; + PGXP_ALU(0x38C20023u, cpu->gpr[2], _pgx1, 0x0023u); } #ifdef PSX_COSIM cosim_instr(0x00004448u); #endif @@ -262575,7 +263158,8 @@ label_BFC22428: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC22430: 3062FFFF andi $v0, $v1, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[3] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[3] & 0xFFFFu; + PGXP_ALU(0x3062FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x0000445Cu); #endif @@ -262744,7 +263328,8 @@ label_BFC22458: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC22464: 2C630011 sltiu $v1, $v1, 17 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = (uint32_t)(cpu->gpr[3] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2C630011u, cpu->gpr[3], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x00004490u); #endif @@ -262792,7 +263377,8 @@ label_BFC22470: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC22470: 00431024 and $v0, $v0, $v1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[3]; + PGXP_ALU(0x00431024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000449Cu); #endif @@ -262848,7 +263434,8 @@ label_BFC2247C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC22484: 2C420011 sltiu $v0, $v0, 17 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2C420011u, cpu->gpr[2], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x000044B0u); #endif @@ -262911,7 +263498,8 @@ label_BFC22490: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC22498: 3042FF7F andi $v0, $v0, 0xFF7F */ - cpu->gpr[2] = cpu->gpr[2] & 0xFF7Fu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFF7Fu; + PGXP_ALU(0x3042FF7Fu, cpu->gpr[2], _pgx1, 0xFF7Fu); } #ifdef PSX_COSIM cosim_instr(0x000044C4u); #endif @@ -263139,7 +263727,8 @@ label_BFC224CC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC224D0: 2C420002 sltiu $v0, $v0, 2 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x000044FCu); #endif diff --git a/generated/SCPH1001.emitter.sha b/generated/SCPH1001.emitter.sha index e62bf8ba..5478b6cf 100644 --- a/generated/SCPH1001.emitter.sha +++ b/generated/SCPH1001.emitter.sha @@ -1 +1 @@ -dbbd49315c65cc68b62698b435380b4c00abaf2c77b6ee8a3ed0342597bf9f64 +fe1bcc25dbc83f7c8f47fa466994d2df37f6dd86d259e386f5f12ce4ca3c0eca diff --git a/generated/SCPH1001_full.c b/generated/SCPH1001_full.c index 66a2e689..d6e21052 100644 --- a/generated/SCPH1001_full.c +++ b/generated/SCPH1001_full.c @@ -3644,7 +3644,8 @@ label_BFC003B8: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC003C0: 0043082B sltu $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC003C0u); #endif @@ -5801,7 +5802,8 @@ label_BFC00810: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC0081C: 31CF00FF andi $t7, $t6, 0xFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0081Cu); #endif @@ -5836,7 +5838,8 @@ label_BFC00810: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC00828: 316C00FF andi $t4, $t3, 0xFF */ - cpu->gpr[12] = cpu->gpr[11] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0xFFu; + PGXP_ALU(0x316C00FFu, cpu->gpr[12], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00828u); #endif @@ -5976,7 +5979,8 @@ label_BFC00810: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC00858: 31F800FF andi $t8, $t7, 0xFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00858u); #endif @@ -7743,7 +7747,8 @@ label_BFC00A04: psx_cyc_step(cpu, 0x1000010u); #endif /* 0xBFC00A14: 309800FF andi $t8, $a0, 0xFF */ - cpu->gpr[24] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[24] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x309800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00A14u); #endif @@ -7786,7 +7791,8 @@ label_BFC00A04: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC00A24: 31090008 andi $t1, $t0, 0x8 */ - cpu->gpr[9] = cpu->gpr[8] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x8u; + PGXP_ALU(0x31090008u, cpu->gpr[9], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00A24u); #endif @@ -7941,7 +7947,8 @@ label_BFC00A40: psx_cyc_step(cpu, 0x410u); #endif /* 0xBFC00A48: 308A00FF andi $t2, $a0, 0xFF */ - cpu->gpr[10] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[10] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308A00FFu, cpu->gpr[10], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00A48u); #endif @@ -7984,7 +7991,8 @@ label_BFC00A40: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC00A58: 318D0008 andi $t5, $t4, 0x8 */ - cpu->gpr[13] = cpu->gpr[12] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x8u; + PGXP_ALU(0x318D0008u, cpu->gpr[13], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00A58u); #endif @@ -8191,7 +8199,8 @@ label_BFC00A7C: psx_cyc_step(cpu, 0x4008u); #endif /* 0xBFC00A88: 306E00FF andi $t6, $v1, 0xFF */ - cpu->gpr[14] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[14] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00A88u); #endif @@ -8234,7 +8243,8 @@ label_BFC00A7C: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC00A98: 30580008 andi $t8, $v0, 0x8 */ - cpu->gpr[24] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30580008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00A98u); #endif @@ -8255,7 +8265,8 @@ label_BFC00A7C: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC00AA0: 304A0044 andi $t2, $v0, 0x44 */ - cpu->gpr[10] = cpu->gpr[2] & 0x44u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x44u; + PGXP_ALU(0x304A0044u, cpu->gpr[10], _pgx1, 0x0044u); } #ifdef PSX_COSIM cosim_instr(0xBFC00AA0u); #endif @@ -8400,7 +8411,8 @@ label_BFC00AB4: psx_cyc_step(cpu, 0x2000008u); #endif /* 0xBFC00AC0: 307900FF andi $t9, $v1, 0xFF */ - cpu->gpr[25] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[25] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x307900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00AC0u); #endif @@ -8443,7 +8455,8 @@ label_BFC00AB4: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC00AD0: 30490008 andi $t1, $v0, 0x8 */ - cpu->gpr[9] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[9] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30490008u, cpu->gpr[9], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00AD0u); #endif @@ -8496,7 +8509,8 @@ label_BFC00ADC: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC00ADC: 304A0044 andi $t2, $v0, 0x44 */ - cpu->gpr[10] = cpu->gpr[2] & 0x44u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x44u; + PGXP_ALU(0x304A0044u, cpu->gpr[10], _pgx1, 0x0044u); } #ifdef PSX_COSIM cosim_instr(0xBFC00ADCu); #endif @@ -8557,7 +8571,8 @@ label_BFC00AE8: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC00AE8: 304B0004 andi $t3, $v0, 0x4 */ - cpu->gpr[11] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x304B0004u, cpu->gpr[11], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC00AE8u); #endif @@ -8820,7 +8835,8 @@ label_BFC00B20: psx_cyc_step(cpu, 0x4008u); #endif /* 0xBFC00B2C: 306E00FF andi $t6, $v1, 0xFF */ - cpu->gpr[14] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[14] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00B2Cu); #endif @@ -8863,7 +8879,8 @@ label_BFC00B20: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC00B3C: 30580044 andi $t8, $v0, 0x44 */ - cpu->gpr[24] = cpu->gpr[2] & 0x44u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x44u; + PGXP_ALU(0x30580044u, cpu->gpr[24], _pgx1, 0x0044u); } #ifdef PSX_COSIM cosim_instr(0xBFC00B3Cu); #endif @@ -8884,7 +8901,8 @@ label_BFC00B20: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC00B44: 304B0004 andi $t3, $v0, 0x4 */ - cpu->gpr[11] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x304B0004u, cpu->gpr[11], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC00B44u); #endif @@ -9563,7 +9581,8 @@ label_BFC00BD8: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC00BE8: 304F00FF andi $t7, $v0, 0xFF */ - cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00BE8u); #endif @@ -9606,7 +9625,8 @@ label_BFC00BD8: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC00BF8: 33280008 andi $t0, $t9, 0x8 */ - cpu->gpr[8] = cpu->gpr[25] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x8u; + PGXP_ALU(0x33280008u, cpu->gpr[8], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00BF8u); #endif @@ -9761,7 +9781,8 @@ label_BFC00C14: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC00C1C: 304900FF andi $t1, $v0, 0xFF */ - cpu->gpr[9] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[9] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00C1Cu); #endif @@ -9804,7 +9825,8 @@ label_BFC00C14: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC00C2C: 316C0008 andi $t4, $t3, 0x8 */ - cpu->gpr[12] = cpu->gpr[11] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x8u; + PGXP_ALU(0x316C0008u, cpu->gpr[12], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00C2Cu); #endif @@ -9999,7 +10021,8 @@ label_BFC00C50: psx_cyc_step(cpu, 0x2004u); #endif /* 0xBFC00C58: 304D00FF andi $t5, $v0, 0xFF */ - cpu->gpr[13] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304D00FFu, cpu->gpr[13], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00C58u); #endif @@ -10042,7 +10065,8 @@ label_BFC00C50: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC00C68: 31F80008 andi $t8, $t7, 0x8 */ - cpu->gpr[24] = cpu->gpr[15] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x8u; + PGXP_ALU(0x31F80008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00C68u); #endif @@ -10196,7 +10220,8 @@ label_BFC00C84: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC00C8C: 305900FF andi $t9, $v0, 0xFF */ - cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC00C8Cu); #endif @@ -10239,7 +10264,8 @@ label_BFC00C84: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC00C9C: 312A0008 andi $t2, $t1, 0x8 */ - cpu->gpr[10] = cpu->gpr[9] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x8u; + PGXP_ALU(0x312A0008u, cpu->gpr[10], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00C9Cu); #endif @@ -10463,7 +10489,8 @@ label_BFC00CC0: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC00CD8: 31CF0008 andi $t7, $t6, 0x8 */ - cpu->gpr[15] = cpu->gpr[14] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x8u; + PGXP_ALU(0x31CF0008u, cpu->gpr[15], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00CD8u); #endif @@ -10569,7 +10596,8 @@ label_BFC00CE4: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC00CF8: 31090008 andi $t1, $t0, 0x8 */ - cpu->gpr[9] = cpu->gpr[8] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x8u; + PGXP_ALU(0x31090008u, cpu->gpr[9], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC00CF8u); #endif @@ -13097,7 +13125,8 @@ label_BFC00EF4: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC00F00: 2C610080 sltiu $at, $v1, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C610080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0xBFC00F00u); #endif @@ -13181,7 +13210,8 @@ label_BFC00F10: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC00F10: 2C610080 sltiu $at, $v1, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C610080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0xBFC00F10u); #endif @@ -13274,7 +13304,8 @@ label_BFC00F1C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC00F28: 33190004 andi $t9, $t8, 0x4 */ - cpu->gpr[25] = cpu->gpr[24] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x4u; + PGXP_ALU(0x33190004u, cpu->gpr[25], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC00F28u); #endif @@ -13403,7 +13434,8 @@ label_BFC00F38: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC00F4C: 2C610080 sltiu $at, $v1, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C610080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0xBFC00F4Cu); #endif @@ -13489,7 +13521,8 @@ label_BFC00F58: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC00F64: 33190004 andi $t9, $t8, 0x4 */ - cpu->gpr[25] = cpu->gpr[24] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x4u; + PGXP_ALU(0x33190004u, cpu->gpr[25], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC00F64u); #endif @@ -13828,7 +13861,8 @@ label_BFC00F9C: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC00FB0: 2C610080 sltiu $at, $v1, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C610080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0xBFC00FB0u); #endif @@ -13914,7 +13948,8 @@ label_BFC00FBC: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC00FC8: 33190004 andi $t9, $t8, 0x4 */ - cpu->gpr[25] = cpu->gpr[24] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x4u; + PGXP_ALU(0x33190004u, cpu->gpr[25], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC00FC8u); #endif @@ -14271,7 +14306,8 @@ label_BFC01018: psx_cyc_step(cpu, 0x28000u); #endif /* 0xBFC01018: 322F0001 andi $t7, $s1, 0x1 */ - cpu->gpr[15] = cpu->gpr[17] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[15] = cpu->gpr[17] & 0x1u; + PGXP_ALU(0x322F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC01018u); #endif @@ -14389,7 +14425,8 @@ label_BFC01034: psx_cyc_step(cpu, 0x1020000u); #endif /* 0xBFC01034: 32380004 andi $t8, $s1, 0x4 */ - cpu->gpr[24] = cpu->gpr[17] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[24] = cpu->gpr[17] & 0x4u; + PGXP_ALU(0x32380004u, cpu->gpr[24], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC01034u); #endif @@ -14638,7 +14675,8 @@ label_BFC0106C: psx_cyc_step(cpu, 0x2020000u); #endif /* 0xBFC0106C: 32390001 andi $t9, $s1, 0x1 */ - cpu->gpr[25] = cpu->gpr[17] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[25] = cpu->gpr[17] & 0x1u; + PGXP_ALU(0x32390001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0106Cu); #endif @@ -14659,7 +14697,8 @@ label_BFC0106C: psx_cyc_step(cpu, 0x1020000u); #endif /* 0xBFC01074: 32380004 andi $t8, $s1, 0x4 */ - cpu->gpr[24] = cpu->gpr[17] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[24] = cpu->gpr[17] & 0x4u; + PGXP_ALU(0x32380004u, cpu->gpr[24], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC01074u); #endif @@ -14764,7 +14803,8 @@ label_BFC0108C: psx_cyc_step(cpu, 0x1020000u); #endif /* 0xBFC0108C: 32380004 andi $t8, $s1, 0x4 */ - cpu->gpr[24] = cpu->gpr[17] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[24] = cpu->gpr[17] & 0x4u; + PGXP_ALU(0x32380004u, cpu->gpr[24], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC0108Cu); #endif @@ -14987,7 +15027,8 @@ label_BFC010C0: psx_cyc_step(cpu, 0x2020000u); #endif /* 0xBFC010C4: 32390001 andi $t9, $s1, 0x1 */ - cpu->gpr[25] = cpu->gpr[17] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[25] = cpu->gpr[17] & 0x1u; + PGXP_ALU(0x32390001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC010C4u); #endif @@ -15124,7 +15165,8 @@ label_BFC010E4: psx_cyc_step(cpu, 0x24000u); #endif /* 0xBFC010E4: 322E0004 andi $t6, $s1, 0x4 */ - cpu->gpr[14] = cpu->gpr[17] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[14] = cpu->gpr[17] & 0x4u; + PGXP_ALU(0x322E0004u, cpu->gpr[14], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC010E4u); #endif @@ -15734,7 +15776,8 @@ label_BFC0117C: psx_cyc_step(cpu, 0x4Au); #endif /* 0xBFC01180: 00C3082A slt $at, $a2, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x00C3082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01180u); #endif @@ -16069,7 +16112,8 @@ label_BFC011D0: psx_cyc_step(cpu, 0x28000u); #endif /* 0xBFC011D0: 322F0001 andi $t7, $s1, 0x1 */ - cpu->gpr[15] = cpu->gpr[17] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[15] = cpu->gpr[17] & 0x1u; + PGXP_ALU(0x322F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC011D0u); #endif @@ -16199,7 +16243,8 @@ label_BFC011F0: psx_cyc_step(cpu, 0x1020000u); #endif /* 0xBFC011F0: 32380004 andi $t8, $s1, 0x4 */ - cpu->gpr[24] = cpu->gpr[17] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[24] = cpu->gpr[17] & 0x4u; + PGXP_ALU(0x32380004u, cpu->gpr[24], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC011F0u); #endif @@ -16411,7 +16456,8 @@ label_BFC01218: psx_cyc_step(cpu, 0x24000u); #endif /* 0xBFC01224: 322E0001 andi $t6, $s1, 0x1 */ - cpu->gpr[14] = cpu->gpr[17] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[14] = cpu->gpr[17] & 0x1u; + PGXP_ALU(0x322E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC01224u); #endif @@ -16548,7 +16594,8 @@ label_BFC01244: psx_cyc_step(cpu, 0x28000u); #endif /* 0xBFC01244: 322F0004 andi $t7, $s1, 0x4 */ - cpu->gpr[15] = cpu->gpr[17] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[15] = cpu->gpr[17] & 0x4u; + PGXP_ALU(0x322F0004u, cpu->gpr[15], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC01244u); #endif @@ -16700,7 +16747,8 @@ label_BFC01268: psx_cyc_step(cpu, 0x1020000u); #endif /* 0xBFC01268: 32380008 andi $t8, $s1, 0x8 */ - cpu->gpr[24] = cpu->gpr[17] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[24] = cpu->gpr[17] & 0x8u; + PGXP_ALU(0x32380008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC01268u); #endif @@ -16869,7 +16917,8 @@ label_BFC01288: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC0128C: 02218824 and $s1, $s1, $at */ - cpu->gpr[17] = cpu->gpr[17] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[17] = cpu->gpr[17] & cpu->gpr[1]; + PGXP_ALU(0x02218824u, cpu->gpr[17], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0128Cu); #endif @@ -16981,7 +17030,8 @@ label_BFC012A0: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC012A4: 32220008 andi $v0, $s1, 0x8 */ - cpu->gpr[2] = cpu->gpr[17] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = cpu->gpr[17] & 0x8u; + PGXP_ALU(0x32220008u, cpu->gpr[2], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC012A4u); #endif @@ -17576,7 +17626,8 @@ label_BFC01338: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC01338: 32220040 andi $v0, $s1, 0x40 */ - cpu->gpr[2] = cpu->gpr[17] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = cpu->gpr[17] & 0x40u; + PGXP_ALU(0x32220040u, cpu->gpr[2], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0xBFC01338u); #endif @@ -17710,7 +17761,8 @@ label_BFC01354: psx_cyc_step(cpu, 0x3000002u); #endif /* 0xBFC01360: 0338082A slt $at, $t9, $t8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x0338082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01360u); #endif @@ -17850,7 +17902,8 @@ label_BFC01380: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC01380: 32220030 andi $v0, $s1, 0x30 */ - cpu->gpr[2] = cpu->gpr[17] & 0x30u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = cpu->gpr[17] & 0x30u; + PGXP_ALU(0x32220030u, cpu->gpr[2], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0xBFC01380u); #endif @@ -17966,7 +18019,8 @@ label_BFC01394: psx_cyc_step(cpu, 0x200006u); #endif /* 0xBFC0139C: 0055082A slt $at, $v0, $s5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0055082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0139Cu); #endif @@ -18069,7 +18123,8 @@ label_BFC013B0: psx_cyc_step(cpu, 0x210002u); #endif /* 0xBFC013B4: 0215082A slt $at, $s0, $s5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0215082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC013B4u); #endif @@ -18798,7 +18853,8 @@ label_BFC0147C: psx_cyc_step(cpu, 0x200006u); #endif /* 0xBFC01484: 0055082A slt $at, $v0, $s5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0055082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01484u); #endif @@ -18901,7 +18957,8 @@ label_BFC01498: psx_cyc_step(cpu, 0x210002u); #endif /* 0xBFC0149C: 0215082A slt $at, $s0, $s5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0215082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0149Cu); #endif @@ -19076,7 +19133,8 @@ label_BFC014C8: psx_cyc_step(cpu, 0x1004002u); #endif /* 0xBFC014D0: 030E082A slt $at, $t8, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x030E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC014D0u); #endif @@ -19185,7 +19243,8 @@ label_BFC014E4: psx_cyc_step(cpu, 0x18002u); #endif /* 0xBFC014EC: 020F082A slt $at, $s0, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x020F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC014ECu); #endif @@ -19600,7 +19659,8 @@ label_BFC01558: psx_cyc_step(cpu, 0x1020000u); #endif /* 0xBFC01560: 32380010 andi $t8, $s1, 0x10 */ - cpu->gpr[24] = cpu->gpr[17] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[24] = cpu->gpr[17] & 0x10u; + PGXP_ALU(0x32380010u, cpu->gpr[24], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC01560u); #endif @@ -19808,7 +19868,8 @@ label_BFC01594: psx_cyc_step(cpu, 0x1020000u); #endif /* 0xBFC01594: 32380010 andi $t8, $s1, 0x10 */ - cpu->gpr[24] = cpu->gpr[17] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[24] = cpu->gpr[17] & 0x10u; + PGXP_ALU(0x32380010u, cpu->gpr[24], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC01594u); #endif @@ -19886,7 +19947,8 @@ label_BFC015A0: psx_cyc_step(cpu, 0x204002u); #endif /* 0xBFC015A8: 01D5082A slt $at, $t6, $s5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x01D5082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC015A8u); #endif @@ -19989,7 +20051,8 @@ label_BFC015BC: psx_cyc_step(cpu, 0x210002u); #endif /* 0xBFC015C0: 0215082A slt $at, $s0, $s5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0215082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC015C0u); #endif @@ -20154,7 +20217,8 @@ label_BFC015EC: psx_cyc_step(cpu, 0x208002u); #endif /* 0xBFC015F0: 01F5082A slt $at, $t7, $s5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x01F5082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC015F0u); #endif @@ -20495,7 +20559,8 @@ label_BFC0164C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01650: 2C410045 sltiu $at, $v0, 69 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000045u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000045u ? 1 : 0); + PGXP_ALU(0x2C410045u, cpu->gpr[1], _pgx1, 0x0045u); } #ifdef PSX_COSIM cosim_instr(0xBFC01650u); #endif @@ -20580,7 +20645,8 @@ label_BFC0165C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01660: 2C410033 sltiu $at, $v0, 51 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000033u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000033u ? 1 : 0); + PGXP_ALU(0x2C410033u, cpu->gpr[1], _pgx1, 0x0033u); } #ifdef PSX_COSIM cosim_instr(0xBFC01660u); #endif @@ -20665,7 +20731,8 @@ label_BFC0166C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01670: 2C41002E sltiu $at, $v0, 46 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000002Eu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000002Eu ? 1 : 0); + PGXP_ALU(0x2C41002Eu, cpu->gpr[1], _pgx1, 0x002Eu); } #ifdef PSX_COSIM cosim_instr(0xBFC01670u); #endif @@ -20749,7 +20816,8 @@ label_BFC0167C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01680: 2C41002B sltiu $at, $v0, 43 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000002Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000002Bu ? 1 : 0); + PGXP_ALU(0x2C41002Bu, cpu->gpr[1], _pgx1, 0x002Bu); } #ifdef PSX_COSIM cosim_instr(0xBFC01680u); #endif @@ -20833,7 +20901,8 @@ label_BFC0168C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01690: 2C410021 sltiu $at, $v0, 33 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000021u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000021u ? 1 : 0); + PGXP_ALU(0x2C410021u, cpu->gpr[1], _pgx1, 0x0021u); } #ifdef PSX_COSIM cosim_instr(0xBFC01690u); #endif @@ -21343,7 +21412,8 @@ label_BFC01700: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01704: 2C410031 sltiu $at, $v0, 49 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000031u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000031u ? 1 : 0); + PGXP_ALU(0x2C410031u, cpu->gpr[1], _pgx1, 0x0031u); } #ifdef PSX_COSIM cosim_instr(0xBFC01704u); #endif @@ -21630,7 +21700,8 @@ label_BFC01738: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC0173C: 2C410037 sltiu $at, $v0, 55 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000037u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000037u ? 1 : 0); + PGXP_ALU(0x2C410037u, cpu->gpr[1], _pgx1, 0x0037u); } #ifdef PSX_COSIM cosim_instr(0xBFC0173Cu); #endif @@ -21715,7 +21786,8 @@ label_BFC01748: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC0174C: 2C410035 sltiu $at, $v0, 53 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000035u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000035u ? 1 : 0); + PGXP_ALU(0x2C410035u, cpu->gpr[1], _pgx1, 0x0035u); } #ifdef PSX_COSIM cosim_instr(0xBFC0174Cu); #endif @@ -21996,7 +22068,8 @@ label_BFC0177C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01784: 2C410039 sltiu $at, $v0, 57 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000039u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000039u ? 1 : 0); + PGXP_ALU(0x2C410039u, cpu->gpr[1], _pgx1, 0x0039u); } #ifdef PSX_COSIM cosim_instr(0xBFC01784u); #endif @@ -22284,7 +22357,8 @@ label_BFC017B8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC017BC: 2C41006A sltiu $at, $v0, 106 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000006Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000006Au ? 1 : 0); + PGXP_ALU(0x2C41006Au, cpu->gpr[1], _pgx1, 0x006Au); } #ifdef PSX_COSIM cosim_instr(0xBFC017BCu); #endif @@ -22369,7 +22443,8 @@ label_BFC017C8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC017CC: 2C410059 sltiu $at, $v0, 89 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000059u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000059u ? 1 : 0); + PGXP_ALU(0x2C410059u, cpu->gpr[1], _pgx1, 0x0059u); } #ifdef PSX_COSIM cosim_instr(0xBFC017CCu); #endif @@ -22454,7 +22529,8 @@ label_BFC017D8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC017DC: 2C410050 sltiu $at, $v0, 80 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000050u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000050u ? 1 : 0); + PGXP_ALU(0x2C410050u, cpu->gpr[1], _pgx1, 0x0050u); } #ifdef PSX_COSIM cosim_instr(0xBFC017DCu); #endif @@ -22734,7 +22810,8 @@ label_BFC0180C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01814: 2C410065 sltiu $at, $v0, 101 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000065u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000065u ? 1 : 0); + PGXP_ALU(0x2C410065u, cpu->gpr[1], _pgx1, 0x0065u); } #ifdef PSX_COSIM cosim_instr(0xBFC01814u); #endif @@ -23013,7 +23090,8 @@ label_BFC01844: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC0184C: 2C410071 sltiu $at, $v0, 113 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000071u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000071u ? 1 : 0); + PGXP_ALU(0x2C410071u, cpu->gpr[1], _pgx1, 0x0071u); } #ifdef PSX_COSIM cosim_instr(0xBFC0184Cu); #endif @@ -23098,7 +23176,8 @@ label_BFC01858: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC0185C: 2C41006F sltiu $at, $v0, 111 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000006Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000006Fu ? 1 : 0); + PGXP_ALU(0x2C41006Fu, cpu->gpr[1], _pgx1, 0x006Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0185Cu); #endif @@ -23280,7 +23359,8 @@ label_BFC01878: psx_cyc_step(cpu, 0x2020000u); #endif /* 0xBFC01880: 32390001 andi $t9, $s1, 0x1 */ - cpu->gpr[25] = cpu->gpr[17] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[25] = cpu->gpr[17] & 0x1u; + PGXP_ALU(0x32390001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC01880u); #endif @@ -23377,7 +23457,8 @@ label_BFC0188C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC01894: 2C410076 sltiu $at, $v0, 118 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000076u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000076u ? 1 : 0); + PGXP_ALU(0x2C410076u, cpu->gpr[1], _pgx1, 0x0076u); } #ifdef PSX_COSIM cosim_instr(0xBFC01894u); #endif @@ -23559,7 +23640,8 @@ label_BFC018B0: psx_cyc_step(cpu, 0x24000u); #endif /* 0xBFC018B8: 322E0001 andi $t6, $s1, 0x1 */ - cpu->gpr[14] = cpu->gpr[17] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[14] = cpu->gpr[17] & 0x1u; + PGXP_ALU(0x322E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC018B8u); #endif @@ -25067,7 +25149,8 @@ label_BFC01A60: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC01A68: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC01A68u); #endif @@ -26405,7 +26488,8 @@ label_BFC01B88: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC01B94: 0044082B sltu $at, $v0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01B94u); #endif @@ -26653,7 +26737,8 @@ label_BFC01BB4: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC01BD8: 0043082B sltu $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01BD8u); #endif @@ -26674,7 +26759,8 @@ label_BFC01BB4: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC01BE0: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01BE0u); #endif @@ -26749,7 +26835,8 @@ label_BFC01BEC: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC01BEC: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01BECu); #endif @@ -26940,7 +27027,8 @@ label_BFC01C08: psx_cyc_step(cpu, 0x8012u); #endif /* 0xBFC01C1C: 008F082B sltu $at, $a0, $t7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x008F082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01C1Cu); #endif @@ -27500,7 +27588,8 @@ label_BFC01C8C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC01CA8: 00A12824 and $a1, $a1, $at */ - cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[5] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A12824u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01CA8u); #endif @@ -27600,7 +27689,8 @@ label_BFC01CB4: psx_cyc_step(cpu, 0x540u); #endif /* 0xBFC01CC0: 00CA4024 and $t0, $a2, $t2 */ - cpu->gpr[8] = cpu->gpr[6] & cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[8] = cpu->gpr[6] & cpu->gpr[10]; + PGXP_ALU(0x00CA4024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01CC0u); #endif @@ -27611,7 +27701,8 @@ label_BFC01CB4: psx_cyc_step(cpu, 0x122u); #endif /* 0xBFC01CC4: 0105082B sltu $at, $t0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0105082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01CC4u); #endif @@ -27825,7 +27916,8 @@ label_BFC01D00: psx_cyc_step(cpu, 0x2000080u); #endif /* 0xBFC01D00: 30F90001 andi $t9, $a3, 0x1 */ - cpu->gpr[25] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[25] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30F90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC01D00u); #endif @@ -27909,7 +28001,8 @@ label_BFC01D0C: psx_cyc_step(cpu, 0x142u); #endif /* 0xBFC01D18: 00C14024 and $t0, $a2, $at */ - cpu->gpr[8] = cpu->gpr[6] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[6] & cpu->gpr[1]; + PGXP_ALU(0x00C14024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01D18u); #endif @@ -28031,7 +28124,8 @@ label_BFC01D24: psx_cyc_step(cpu, 0x2102u); #endif /* 0xBFC01D34: 01A8082B sltu $at, $t5, $t0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x01A8082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01D34u); #endif @@ -28116,7 +28210,8 @@ label_BFC01D40: psx_cyc_step(cpu, 0x142u); #endif /* 0xBFC01D4C: 00C14024 and $t0, $a2, $at */ - cpu->gpr[8] = cpu->gpr[6] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[6] & cpu->gpr[1]; + PGXP_ALU(0x00C14024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01D4Cu); #endif @@ -28263,7 +28358,8 @@ label_BFC01D70: psx_cyc_step(cpu, 0x1480u); #endif /* 0xBFC01D74: 00EA6024 and $t4, $a3, $t2 */ - cpu->gpr[12] = cpu->gpr[7] & cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[12] = cpu->gpr[7] & cpu->gpr[10]; + PGXP_ALU(0x00EA6024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01D74u); #endif @@ -28318,7 +28414,8 @@ label_BFC01D70: psx_cyc_step(cpu, 0x4480u); #endif /* 0xBFC01D88: 00EA7024 and $t6, $a3, $t2 */ - cpu->gpr[14] = cpu->gpr[7] & cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[14] = cpu->gpr[7] & cpu->gpr[10]; + PGXP_ALU(0x00EA7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01D88u); #endif @@ -28341,7 +28438,8 @@ label_BFC01D70: psx_cyc_step(cpu, 0x62u); #endif /* 0xBFC01D90: 00C5082B sltu $at, $a2, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x00C5082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01D90u); #endif @@ -28416,7 +28514,8 @@ label_BFC01D9C: psx_cyc_step(cpu, 0x142u); #endif /* 0xBFC01DA4: 00C14024 and $t0, $a2, $at */ - cpu->gpr[8] = cpu->gpr[6] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[6] & cpu->gpr[1]; + PGXP_ALU(0x00C14024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01DA4u); #endif @@ -28453,7 +28552,8 @@ label_BFC01DAC: psx_cyc_step(cpu, 0x8042u); #endif /* 0xBFC01DAC: 00C17824 and $t7, $a2, $at */ - cpu->gpr[15] = cpu->gpr[6] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[6] & cpu->gpr[1]; + PGXP_ALU(0x00C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01DACu); #endif @@ -28464,7 +28564,8 @@ label_BFC01DAC: psx_cyc_step(cpu, 0x8022u); #endif /* 0xBFC01DB0: 00AF082B sltu $at, $a1, $t7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x00AF082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01DB0u); #endif @@ -28485,7 +28586,8 @@ label_BFC01DAC: psx_cyc_step(cpu, 0x122u); #endif /* 0xBFC01DB8: 0105082B sltu $at, $t0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0105082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01DB8u); #endif @@ -28715,7 +28817,8 @@ label_BFC01DC8: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC01DF8: 31F80001 andi $t8, $t7, 0x1 */ - cpu->gpr[24] = cpu->gpr[15] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x1u; + PGXP_ALU(0x31F80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC01DF8u); #endif @@ -28781,7 +28884,8 @@ label_BFC01E08: psx_cyc_step(cpu, 0x122u); #endif /* 0xBFC01E08: 0105082B sltu $at, $t0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0105082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01E08u); #endif @@ -29378,7 +29482,8 @@ label_BFC01E5C: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC01E94: 02218824 and $s1, $s1, $at */ - cpu->gpr[17] = cpu->gpr[17] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[17] = cpu->gpr[17] & cpu->gpr[1]; + PGXP_ALU(0x02218824u, cpu->gpr[17], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01E94u); #endif @@ -29506,7 +29611,8 @@ label_BFC01EA0: psx_cyc_step(cpu, 0x8006u); #endif /* 0xBFC01EB4: 004F082B sltu $at, $v0, $t7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x004F082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01EB4u); #endif @@ -29956,7 +30062,8 @@ label_BFC01F18: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC01F2C: 30830001 andi $v1, $a0, 0x1 */ - cpu->gpr[3] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30830001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC01F2Cu); #endif @@ -30038,7 +30145,8 @@ label_BFC01F38: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC01F40: 0044082B sltu $at, $v0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01F40u); #endif @@ -30091,7 +30199,8 @@ label_BFC01F44: psx_cyc_step(cpu, 0x40210u); #endif /* 0xBFC01F4C: 00924824 and $t1, $a0, $s2 */ - cpu->gpr[9] = cpu->gpr[4] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[9] = cpu->gpr[4] & cpu->gpr[18]; + PGXP_ALU(0x00924824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01F4Cu); #endif @@ -30145,7 +30254,8 @@ label_BFC01F58: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC01F58: 0044082B sltu $at, $v0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01F58u); #endif @@ -30173,7 +30283,8 @@ label_BFC01F5C: psx_cyc_step(cpu, 0x20012u); #endif /* 0xBFC01F60: 0091082B sltu $at, $a0, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0091082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01F60u); #endif @@ -30424,7 +30535,8 @@ label_BFC01FA0: psx_cyc_step(cpu, 0x20012u); #endif /* 0xBFC01FA0: 0091082B sltu $at, $a0, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0091082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC01FA0u); #endif @@ -30572,7 +30684,8 @@ label_BFC01FAC: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC01FCC: 304E0001 andi $t6, $v0, 0x1 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC01FCCu); #endif @@ -30856,7 +30969,8 @@ label_BFC02008: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC02008: 304E0001 andi $t6, $v0, 0x1 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC02008u); #endif @@ -30916,7 +31030,8 @@ label_BFC02014: psx_cyc_step(cpu, 0x42004u); #endif /* 0xBFC02014: 00526824 and $t5, $v0, $s2 */ - cpu->gpr[13] = cpu->gpr[2] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[13] = cpu->gpr[2] & cpu->gpr[18]; + PGXP_ALU(0x00526824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02014u); #endif @@ -31097,7 +31212,8 @@ label_BFC02038: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC0204C: 30830001 andi $v1, $a0, 0x1 */ - cpu->gpr[3] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30830001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0204Cu); #endif @@ -31575,7 +31691,8 @@ label_BFC020B0: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC020C4: 30830001 andi $v1, $a0, 0x1 */ - cpu->gpr[3] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30830001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC020C4u); #endif @@ -33017,7 +33134,8 @@ label_BFC02200: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC02224: 30427FFF andi $v0, $v0, 0x7FFF */ - cpu->gpr[2] = cpu->gpr[2] & 0x7FFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x7FFFu; + PGXP_ALU(0x30427FFFu, cpu->gpr[2], _pgx1, 0x7FFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC02224u); #endif @@ -33537,7 +33655,8 @@ label_BFC022C0: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC022C8: 308E00FF andi $t6, $a0, 0xFF */ - cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC022C8u); #endif @@ -33593,7 +33712,8 @@ label_BFC022C0: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC022DC: 304F0004 andi $t7, $v0, 0x4 */ - cpu->gpr[15] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x304F0004u, cpu->gpr[15], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC022DCu); #endif @@ -33690,7 +33810,8 @@ label_BFC022F0: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC022F0: 30580003 andi $t8, $v0, 0x3 */ - cpu->gpr[24] = cpu->gpr[2] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x3u; + PGXP_ALU(0x30580003u, cpu->gpr[24], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0xBFC022F0u); #endif @@ -34356,7 +34477,8 @@ label_BFC025E0: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC025F0: 308E00FF andi $t6, $a0, 0xFF */ - cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC025F0u); #endif @@ -34399,7 +34521,8 @@ label_BFC025E0: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC02600: 33190008 andi $t9, $t8, 0x8 */ - cpu->gpr[25] = cpu->gpr[24] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x8u; + PGXP_ALU(0x33190008u, cpu->gpr[25], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC02600u); #endif @@ -34420,7 +34543,8 @@ label_BFC025E0: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC02608: 2A610002 slti $at, $s3, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (2) ? 1 : 0); + PGXP_ALU(0x2A610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC02608u); #endif @@ -34473,7 +34597,8 @@ label_BFC0260C: psx_cyc_step(cpu, 0x110u); #endif /* 0xBFC02614: 308800FF andi $t0, $a0, 0xFF */ - cpu->gpr[8] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[8] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308800FFu, cpu->gpr[8], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC02614u); #endif @@ -34516,7 +34641,8 @@ label_BFC0260C: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC02624: 314B0008 andi $t3, $t2, 0x8 */ - cpu->gpr[11] = cpu->gpr[10] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x8u; + PGXP_ALU(0x314B0008u, cpu->gpr[11], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC02624u); #endif @@ -34537,7 +34663,8 @@ label_BFC0260C: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC0262C: 2A610002 slti $at, $s3, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (2) ? 1 : 0); + PGXP_ALU(0x2A610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC0262Cu); #endif @@ -34579,7 +34706,8 @@ label_BFC02630: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC02634: 2A610025 slti $at, $s3, 37 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (37) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (37) ? 1 : 0); + PGXP_ALU(0x2A610025u, cpu->gpr[1], _pgx1, 0x0025u); } #ifdef PSX_COSIM cosim_instr(0xBFC02634u); #endif @@ -35317,7 +35445,8 @@ label_BFC026D8: psx_cyc_step(cpu, 0x80006u); #endif /* 0xBFC026D8: 0053082B sltu $at, $v0, $s3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0053082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC026D8u); #endif @@ -35470,7 +35599,8 @@ label_BFC02700: psx_cyc_step(cpu, 0x80006u); #endif /* 0xBFC02700: 0053082B sltu $at, $v0, $s3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0053082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02700u); #endif @@ -35996,7 +36126,8 @@ label_BFC02770: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC02780: 308E00FF andi $t6, $a0, 0xFF */ - cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC02780u); #endif @@ -36039,7 +36170,8 @@ label_BFC02770: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC02790: 33190008 andi $t9, $t8, 0x8 */ - cpu->gpr[25] = cpu->gpr[24] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x8u; + PGXP_ALU(0x33190008u, cpu->gpr[25], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC02790u); #endif @@ -36113,7 +36245,8 @@ label_BFC0279C: psx_cyc_step(cpu, 0x110u); #endif /* 0xBFC027A4: 308800FF andi $t0, $a0, 0xFF */ - cpu->gpr[8] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[8] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308800FFu, cpu->gpr[8], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC027A4u); #endif @@ -36156,7 +36289,8 @@ label_BFC0279C: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC027B4: 314B0008 andi $t3, $t2, 0x8 */ - cpu->gpr[11] = cpu->gpr[10] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x8u; + PGXP_ALU(0x314B0008u, cpu->gpr[11], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC027B4u); #endif @@ -36231,7 +36365,8 @@ label_BFC027C0: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC027C8: 2E610002 sltiu $at, $s3, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2E610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC027C8u); #endif @@ -36327,7 +36462,8 @@ label_BFC027DC: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC027DC: 2E610002 sltiu $at, $s3, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2E610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC027DCu); #endif @@ -36355,7 +36491,8 @@ label_BFC027E0: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC027E4: 2E610025 sltiu $at, $s3, 37 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < 0x00000025u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < 0x00000025u ? 1 : 0); + PGXP_ALU(0x2E610025u, cpu->gpr[1], _pgx1, 0x0025u); } #ifdef PSX_COSIM cosim_instr(0xBFC027E4u); #endif @@ -37093,7 +37230,8 @@ label_BFC02888: psx_cyc_step(cpu, 0x80006u); #endif /* 0xBFC02888: 0053082B sltu $at, $v0, $s3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0053082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02888u); #endif @@ -37369,7 +37507,8 @@ label_BFC028CC: psx_cyc_step(cpu, 0x80006u); #endif /* 0xBFC028D0: 0053082B sltu $at, $v0, $s3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0053082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC028D0u); #endif @@ -38245,7 +38384,8 @@ label_BFC02984: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC02994: 308E00FF andi $t6, $a0, 0xFF */ - cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC02994u); #endif @@ -38288,7 +38428,8 @@ label_BFC02984: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC029A4: 33190008 andi $t9, $t8, 0x8 */ - cpu->gpr[25] = cpu->gpr[24] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x8u; + PGXP_ALU(0x33190008u, cpu->gpr[25], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC029A4u); #endif @@ -38362,7 +38503,8 @@ label_BFC029B0: psx_cyc_step(cpu, 0x110u); #endif /* 0xBFC029B8: 308800FF andi $t0, $a0, 0xFF */ - cpu->gpr[8] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[8] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308800FFu, cpu->gpr[8], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC029B8u); #endif @@ -38405,7 +38547,8 @@ label_BFC029B0: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC029C8: 314B0008 andi $t3, $t2, 0x8 */ - cpu->gpr[11] = cpu->gpr[10] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x8u; + PGXP_ALU(0x314B0008u, cpu->gpr[11], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC029C8u); #endif @@ -39069,7 +39212,8 @@ label_BFC02A5C: psx_cyc_step(cpu, 0x200006u); #endif /* 0xBFC02A5C: 0055082B sltu $at, $v0, $s5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0055082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02A5Cu); #endif @@ -39360,7 +39504,8 @@ label_BFC02AA8: psx_cyc_step(cpu, 0x200006u); #endif /* 0xBFC02AA8: 0055082B sltu $at, $v0, $s5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0055082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02AA8u); #endif @@ -40240,7 +40385,8 @@ label_BFC02B8C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC02B90: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC02B90u); #endif @@ -40558,7 +40704,8 @@ label_BFC02BC8: psx_cyc_step(cpu, 0x32u); #endif /* 0xBFC02BCC: 00A4082B sltu $at, $a1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x00A4082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02BCCu); #endif @@ -40679,7 +40826,8 @@ label_BFC02BE4: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC02BE8: 0082082B sltu $at, $a0, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0082082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02BE8u); #endif @@ -41668,7 +41816,8 @@ label_BFC02CC0: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC02CC4: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC02CC4u); #endif @@ -43178,7 +43327,8 @@ label_BFC02E3C: psx_cyc_step(cpu, 0x60002u); #endif /* 0xBFC02E3C: 0232082A slt $at, $s1, $s2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0232082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02E3Cu); #endif @@ -43579,7 +43729,8 @@ label_BFC02EA0: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC02EA8: 308200FF andi $v0, $a0, 0xFF */ - cpu->gpr[2] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC02EA8u); #endif @@ -43634,7 +43785,8 @@ label_BFC02EA0: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC02EBC: 31CF0002 andi $t7, $t6, 0x2 */ - cpu->gpr[15] = cpu->gpr[14] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x2u; + PGXP_ALU(0x31CF0002u, cpu->gpr[15], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC02EBCu); #endif @@ -43809,7 +43961,8 @@ label_BFC02EDC: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC02EE4: 308200FF andi $v0, $a0, 0xFF */ - cpu->gpr[2] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC02EE4u); #endif @@ -43864,7 +44017,8 @@ label_BFC02EDC: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC02EF8: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC02EF8u); #endif @@ -44233,7 +44387,8 @@ label_BFC02F58: psx_cyc_step(cpu, 0xA00002u); #endif /* 0xBFC02F58: 02F5082A slt $at, $s7, $s5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[23] < (int32_t)cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[23]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[23] < (int32_t)cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x02F5082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02F58u); #endif @@ -44419,7 +44574,8 @@ label_BFC02F84: psx_cyc_step(cpu, 0xA00002u); #endif /* 0xBFC02F84: 02B7082A slt $at, $s5, $s7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[21] < (int32_t)cpu->gpr[23] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[21]; uint32_t _pgx2 = cpu->gpr[23]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[21] < (int32_t)cpu->gpr[23] ? 1 : 0); + PGXP_ALU(0x02B7082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02F84u); #endif @@ -44701,7 +44857,8 @@ label_BFC02FD0: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC02FD4: 0230082A slt $at, $s1, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02FD4u); #endif @@ -44787,7 +44944,8 @@ label_BFC02FE0: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC02FE4: 0230082A slt $at, $s1, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02FE4u); #endif @@ -44808,7 +44966,8 @@ label_BFC02FE0: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC02FEC: 0230082A slt $at, $s1, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC02FECu); #endif @@ -44973,7 +45132,8 @@ label_BFC03014: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC03018: 0230082A slt $at, $s1, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03018u); #endif @@ -45015,7 +45175,8 @@ label_BFC0301C: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC03020: 0230082A slt $at, $s1, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03020u); #endif @@ -45108,7 +45269,8 @@ label_BFC03034: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC03034: 0230082A slt $at, $s1, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03034u); #endif @@ -49556,7 +49718,8 @@ label_BFC03450: psx_cyc_step(cpu, 0x46u); #endif /* 0xBFC03454: 0046082A slt $at, $v0, $a2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0046082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03454u); #endif @@ -49621,7 +49784,8 @@ label_BFC03460: psx_cyc_step(cpu, 0x46u); #endif /* 0xBFC03464: 0046082A slt $at, $v0, $a2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0046082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03464u); #endif @@ -50795,7 +50959,8 @@ label_BFC03564: psx_cyc_step(cpu, 0x1Cu); #endif /* 0xBFC03564: 0044182B sltu $v1, $v0, $a0 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03564u); #endif @@ -51581,7 +51746,8 @@ label_BFC03610: psx_cyc_step(cpu, 0x1Cu); #endif /* 0xBFC03610: 0044182B sltu $v1, $v0, $a0 */ - cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[3] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044182Bu, cpu->gpr[3], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03610u); #endif @@ -55004,7 +55170,8 @@ label_BFC03910: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC03924: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC03924u); #endif @@ -55078,7 +55245,8 @@ label_BFC03930: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC03938: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC03938u); #endif @@ -58575,7 +58743,8 @@ label_BFC03CAC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC03CAC: 28410800 slti $at, $v0, 2048 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (2048) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (2048) ? 1 : 0); + PGXP_ALU(0x28410800u, cpu->gpr[1], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0xBFC03CACu); #endif @@ -59503,7 +59672,8 @@ label_BFC03D80: psx_cyc_step(cpu, 0x1048000u); #endif /* 0xBFC03DB0: 01F2C024 and $t8, $t7, $s2 */ - cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[18]; + PGXP_ALU(0x01F2C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03DB0u); #endif @@ -59744,7 +59914,8 @@ label_BFC03DDC: psx_cyc_step(cpu, 0x40300u); #endif /* 0xBFC03DF0: 01124824 and $t1, $t0, $s2 */ - cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[18]; + PGXP_ALU(0x01124824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC03DF0u); #endif @@ -59888,7 +60059,8 @@ label_BFC03E04: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC03E1C: 31AEFFFF andi $t6, $t5, 0xFFFF */ - cpu->gpr[14] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31AEFFFFu, cpu->gpr[14], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03E1Cu); #endif @@ -59965,7 +60137,8 @@ label_BFC03E04: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC03E38: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03E38u); #endif @@ -60558,7 +60731,8 @@ label_BFC03EBC: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC03EE8: 3328FFFF andi $t0, $t9, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[25] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0xFFFFu; + PGXP_ALU(0x3328FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03EE8u); #endif @@ -60593,7 +60767,8 @@ label_BFC03EBC: psx_cyc_step(cpu, 0x810u); #endif /* 0xBFC03EF4: 308BFFFF andi $t3, $a0, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[11] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x308BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC03EF4u); #endif @@ -62661,7 +62836,8 @@ label_BFC04138: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC04150: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04150u); #endif @@ -62736,7 +62912,8 @@ label_BFC0415C: psx_cyc_step(cpu, 0x3000010u); #endif /* 0xBFC04164: 0304C824 and $t9, $t8, $a0 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[4]; + PGXP_ALU(0x0304C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04164u); #endif @@ -62963,7 +63140,8 @@ label_BFC04190: psx_cyc_step(cpu, 0x310u); #endif /* 0xBFC04198: 01044824 and $t1, $t0, $a0 */ - cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[4]; + PGXP_ALU(0x01044824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04198u); #endif @@ -63113,7 +63291,8 @@ label_BFC041AC: psx_cyc_step(cpu, 0xC20u); #endif /* 0xBFC041C0: 01455824 and $t3, $t2, $a1 */ - cpu->gpr[11] = cpu->gpr[10] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[11] = cpu->gpr[10] & cpu->gpr[5]; + PGXP_ALU(0x01455824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC041C0u); #endif @@ -63340,7 +63519,8 @@ label_BFC041EC: psx_cyc_step(cpu, 0x3020u); #endif /* 0xBFC041F4: 01856824 and $t5, $t4, $a1 */ - cpu->gpr[13] = cpu->gpr[12] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[13] = cpu->gpr[12] & cpu->gpr[5]; + PGXP_ALU(0x01856824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC041F4u); #endif @@ -63415,7 +63595,8 @@ label_BFC04200: psx_cyc_step(cpu, 0xC008u); #endif /* 0xBFC04208: 01C37824 and $t7, $t6, $v1 */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[3]; + PGXP_ALU(0x01C37824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04208u); #endif @@ -63489,7 +63670,8 @@ label_BFC04214: psx_cyc_step(cpu, 0x3000008u); #endif /* 0xBFC0421C: 0303C824 and $t9, $t8, $v1 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[3]; + PGXP_ALU(0x0303C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0421Cu); #endif @@ -65285,7 +65467,8 @@ label_BFC046D8: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC046F8: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC046F8u); #endif @@ -65363,7 +65546,8 @@ label_BFC04708: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC0470C: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0470Cu); #endif @@ -66117,7 +66301,8 @@ label_BFC047B8: psx_cyc_step(cpu, 0x52u); #endif /* 0xBFC047C8: 00C4082B sltu $at, $a2, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x00C4082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC047C8u); #endif @@ -66180,7 +66365,8 @@ label_BFC047D4: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC047D8: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC047D8u); #endif @@ -66310,7 +66496,8 @@ label_BFC047E8: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC047FC: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC047FCu); #endif @@ -66395,7 +66582,8 @@ label_BFC0480C: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC04810: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC04810u); #endif @@ -67523,7 +67711,8 @@ label_BFC04934: psx_cyc_step(cpu, 0xC040u); #endif /* 0xBFC0494C: 01C67824 and $t7, $t6, $a2 */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[6]; + PGXP_ALU(0x01C67824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0494Cu); #endif @@ -67567,7 +67756,8 @@ label_BFC04934: psx_cyc_step(cpu, 0x3000020u); #endif /* 0xBFC0495C: 0305C824 and $t9, $t8, $a1 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[5]; + PGXP_ALU(0x0305C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0495Cu); #endif @@ -67764,7 +67954,8 @@ label_BFC04934: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC049A0: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC049A0u); #endif @@ -69259,7 +69450,8 @@ label_BFC04B14: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC04B28: 30580010 andi $t8, $v0, 0x10 */ - cpu->gpr[24] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30580010u, cpu->gpr[24], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC04B28u); #endif @@ -70660,7 +70852,8 @@ label_BFC04C70: psx_cyc_step(cpu, 0x1000040u); #endif /* 0xBFC04CA0: 30D80010 andi $t8, $a2, 0x10 */ - cpu->gpr[24] = cpu->gpr[6] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[24] = cpu->gpr[6] & 0x10u; + PGXP_ALU(0x30D80010u, cpu->gpr[24], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC04CA0u); #endif @@ -70781,7 +70974,8 @@ label_BFC04CBC: psx_cyc_step(cpu, 0x140u); #endif /* 0xBFC04CBC: 30C80020 andi $t0, $a2, 0x20 */ - cpu->gpr[8] = cpu->gpr[6] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[8] = cpu->gpr[6] & 0x20u; + PGXP_ALU(0x30C80020u, cpu->gpr[8], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0xBFC04CBCu); #endif @@ -71005,7 +71199,8 @@ label_BFC04CE4: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC04CF8: 304B0010 andi $t3, $v0, 0x10 */ - cpu->gpr[11] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304B0010u, cpu->gpr[11], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC04CF8u); #endif @@ -71134,7 +71329,8 @@ label_BFC04D0C: psx_cyc_step(cpu, 0x1040u); #endif /* 0xBFC04D18: 30CC00FF andi $t4, $a2, 0xFF */ - cpu->gpr[12] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[12] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30CC00FFu, cpu->gpr[12], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC04D18u); #endif @@ -71586,7 +71782,8 @@ label_BFC04D78: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC04D94: 304F0010 andi $t7, $v0, 0x10 */ - cpu->gpr[15] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304F0010u, cpu->gpr[15], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC04D94u); #endif @@ -71715,7 +71912,8 @@ label_BFC04DA8: psx_cyc_step(cpu, 0x1000010u); #endif /* 0xBFC04DB4: 309800FF andi $t8, $a0, 0xFF */ - cpu->gpr[24] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[24] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x309800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC04DB4u); #endif @@ -72043,7 +72241,8 @@ label_BFC04DEC: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC04E04: 31CF0004 andi $t7, $t6, 0x4 */ - cpu->gpr[15] = cpu->gpr[14] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x4u; + PGXP_ALU(0x31CF0004u, cpu->gpr[15], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC04E04u); #endif @@ -72160,7 +72359,8 @@ label_BFC04E18: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC04E20: 30580004 andi $t8, $v0, 0x4 */ - cpu->gpr[24] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30580004u, cpu->gpr[24], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC04E20u); #endif @@ -72343,7 +72543,8 @@ label_BFC04E34: psx_cyc_step(cpu, 0x84u); #endif /* 0xBFC04E54: 30470007 andi $a3, $v0, 0x7 */ - cpu->gpr[7] = cpu->gpr[2] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[7] = cpu->gpr[2] & 0x7u; + PGXP_ALU(0x30470007u, cpu->gpr[7], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0xBFC04E54u); #endif @@ -72354,7 +72555,8 @@ label_BFC04E34: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC04E58: 30E700FF andi $a3, $a3, 0xFF */ - cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30E700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC04E58u); #endif @@ -72375,7 +72577,8 @@ label_BFC04E34: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC04E60: 30430018 andi $v1, $v0, 0x18 */ - cpu->gpr[3] = cpu->gpr[2] & 0x18u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x18u; + PGXP_ALU(0x30430018u, cpu->gpr[3], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0xBFC04E60u); #endif @@ -72475,7 +72678,8 @@ label_BFC04E64: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC04E7C: 29010004 slti $at, $t0, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4) ? 1 : 0); + PGXP_ALU(0x29010004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC04E7Cu); #endif @@ -72496,7 +72700,8 @@ label_BFC04E64: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC04E84: 30430018 andi $v1, $v0, 0x18 */ - cpu->gpr[3] = cpu->gpr[2] & 0x18u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x18u; + PGXP_ALU(0x30430018u, cpu->gpr[3], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0xBFC04E84u); #endif @@ -72624,7 +72829,8 @@ label_BFC04E88: psx_cyc_step(cpu, 0x1002u); #endif /* 0xBFC04EAC: 29810004 slti $at, $t4, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (4) ? 1 : 0); + PGXP_ALU(0x29810004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC04EACu); #endif @@ -72677,7 +72883,8 @@ label_BFC04EB8: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC04EB8: 30430018 andi $v1, $v0, 0x18 */ - cpu->gpr[3] = cpu->gpr[2] & 0x18u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x18u; + PGXP_ALU(0x30430018u, cpu->gpr[3], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0xBFC04EB8u); #endif @@ -72695,7 +72902,8 @@ label_BFC04EBC: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC04EBC: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC04EBCu); #endif @@ -72805,7 +73013,8 @@ label_BFC04EC8: psx_cyc_step(cpu, 0x2002u); #endif /* 0xBFC04EDC: 29A10004 slti $at, $t5, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (4) ? 1 : 0); + PGXP_ALU(0x29A10004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC04EDCu); #endif @@ -72955,7 +73164,8 @@ label_BFC04EE8: psx_cyc_step(cpu, 0x2000002u); #endif /* 0xBFC04F0C: 2B210004 slti $at, $t9, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (4) ? 1 : 0); + PGXP_ALU(0x2B210004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC04F0Cu); #endif @@ -73039,7 +73249,8 @@ label_BFC04F1C: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC04F20: 2D010005 sltiu $at, $t0, 5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < 0x00000005u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < 0x00000005u ? 1 : 0); + PGXP_ALU(0x2D010005u, cpu->gpr[1], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0xBFC04F20u); #endif @@ -73870,7 +74081,8 @@ label_BFC04FBC: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC04FD4: 31CF0008 andi $t7, $t6, 0x8 */ - cpu->gpr[15] = cpu->gpr[14] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x8u; + PGXP_ALU(0x31CF0008u, cpu->gpr[15], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC04FD4u); #endif @@ -73987,7 +74199,8 @@ label_BFC04FE8: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC04FF0: 30580008 andi $t8, $v0, 0x8 */ - cpu->gpr[24] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30580008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC04FF0u); #endif @@ -74138,7 +74351,8 @@ label_BFC05004: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05018: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC05018u); #endif @@ -75268,7 +75482,8 @@ label_BFC05120: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC05150: 29010004 slti $at, $t0, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4) ? 1 : 0); + PGXP_ALU(0x29010004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC05150u); #endif @@ -75424,7 +75639,8 @@ label_BFC05160: psx_cyc_step(cpu, 0x1002u); #endif /* 0xBFC05180: 29810004 slti $at, $t4, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (4) ? 1 : 0); + PGXP_ALU(0x29810004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC05180u); #endif @@ -77465,7 +77681,8 @@ label_BFC05300: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05304: 2841001A slti $at, $v0, 26 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (26) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (26) ? 1 : 0); + PGXP_ALU(0x2841001Au, cpu->gpr[1], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0xBFC05304u); #endif @@ -77550,7 +77767,8 @@ label_BFC05310: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05314: 2841000F slti $at, $v0, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + PGXP_ALU(0x2841000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC05314u); #endif @@ -77635,7 +77853,8 @@ label_BFC05320: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05324: 28410009 slti $at, $v0, 9 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (9) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (9) ? 1 : 0); + PGXP_ALU(0x28410009u, cpu->gpr[1], _pgx1, 0x0009u); } #ifdef PSX_COSIM cosim_instr(0xBFC05324u); #endif @@ -77720,7 +77939,8 @@ label_BFC05330: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05334: 28410006 slti $at, $v0, 6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (6) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (6) ? 1 : 0); + PGXP_ALU(0x28410006u, cpu->gpr[1], _pgx1, 0x0006u); } #ifdef PSX_COSIM cosim_instr(0xBFC05334u); #endif @@ -77805,7 +78025,8 @@ label_BFC05340: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05344: 28410004 slti $at, $v0, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4) ? 1 : 0); + PGXP_ALU(0x28410004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC05344u); #endif @@ -78171,7 +78392,8 @@ label_BFC05388: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05390: 2841000C slti $at, $v0, 12 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (12) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (12) ? 1 : 0); + PGXP_ALU(0x2841000Cu, cpu->gpr[1], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0xBFC05390u); #endif @@ -78442,7 +78664,8 @@ label_BFC053C0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC053C8: 28410015 slti $at, $v0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (21) ? 1 : 0); + PGXP_ALU(0x28410015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0xBFC053C8u); #endif @@ -78527,7 +78750,8 @@ label_BFC053D4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC053D8: 28410013 slti $at, $v0, 19 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (19) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (19) ? 1 : 0); + PGXP_ALU(0x28410013u, cpu->gpr[1], _pgx1, 0x0013u); } #ifdef PSX_COSIM cosim_instr(0xBFC053D8u); #endif @@ -78800,7 +79024,8 @@ label_BFC05408: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05410: 28410017 slti $at, $v0, 23 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (23) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (23) ? 1 : 0); + PGXP_ALU(0x28410017u, cpu->gpr[1], _pgx1, 0x0017u); } #ifdef PSX_COSIM cosim_instr(0xBFC05410u); #endif @@ -79071,7 +79296,8 @@ label_BFC05440: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05448: 284100F7 slti $at, $v0, 247 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (247) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (247) ? 1 : 0); + PGXP_ALU(0x284100F7u, cpu->gpr[1], _pgx1, 0x00F7u); } #ifdef PSX_COSIM cosim_instr(0xBFC05448u); #endif @@ -79156,7 +79382,8 @@ label_BFC05454: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05458: 284100E7 slti $at, $v0, 231 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (231) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (231) ? 1 : 0); + PGXP_ALU(0x284100E7u, cpu->gpr[1], _pgx1, 0x00E7u); } #ifdef PSX_COSIM cosim_instr(0xBFC05458u); #endif @@ -79241,7 +79468,8 @@ label_BFC05464: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05468: 28410051 slti $at, $v0, 81 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + PGXP_ALU(0x28410051u, cpu->gpr[1], _pgx1, 0x0051u); } #ifdef PSX_COSIM cosim_instr(0xBFC05468u); #endif @@ -79512,7 +79740,8 @@ label_BFC05498: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC054A0: 284100EF slti $at, $v0, 239 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (239) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (239) ? 1 : 0); + PGXP_ALU(0x284100EFu, cpu->gpr[1], _pgx1, 0x00EFu); } #ifdef PSX_COSIM cosim_instr(0xBFC054A0u); #endif @@ -79786,7 +80015,8 @@ label_BFC054D0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC054D8: 28410DDE slti $at, $v0, 3550 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3550) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3550) ? 1 : 0); + PGXP_ALU(0x28410DDEu, cpu->gpr[1], _pgx1, 0x0DDEu); } #ifdef PSX_COSIM cosim_instr(0xBFC054D8u); #endif @@ -79871,7 +80101,8 @@ label_BFC054E4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC054E8: 284100FF slti $at, $v0, 255 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (255) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (255) ? 1 : 0); + PGXP_ALU(0x284100FFu, cpu->gpr[1], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC054E8u); #endif @@ -80143,7 +80374,8 @@ label_BFC05518: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05520: 28411000 slti $at, $v0, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4096) ? 1 : 0); + PGXP_ALU(0x28411000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0xBFC05520u); #endif @@ -82070,7 +82302,8 @@ label_BFC056E4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC056E8: 28410CCD slti $at, $v0, 3277 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3277) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3277) ? 1 : 0); + PGXP_ALU(0x28410CCDu, cpu->gpr[1], _pgx1, 0x0CCDu); } #ifdef PSX_COSIM cosim_instr(0xBFC056E8u); #endif @@ -82155,7 +82388,8 @@ label_BFC056F4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC056F8: 28410017 slti $at, $v0, 23 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (23) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (23) ? 1 : 0); + PGXP_ALU(0x28410017u, cpu->gpr[1], _pgx1, 0x0017u); } #ifdef PSX_COSIM cosim_instr(0xBFC056F8u); #endif @@ -82240,7 +82474,8 @@ label_BFC05704: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05708: 2841000A slti $at, $v0, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (10) ? 1 : 0); + PGXP_ALU(0x2841000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC05708u); #endif @@ -82717,7 +82952,8 @@ label_BFC05768: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC05770: 28411000 slti $at, $v0, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4096) ? 1 : 0); + PGXP_ALU(0x28411000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0xBFC05770u); #endif @@ -83403,7 +83639,8 @@ label_BFC057EC: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC0581C: 29210004 slti $at, $t1, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (4) ? 1 : 0); + PGXP_ALU(0x29210004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC0581Cu); #endif @@ -83574,7 +83811,8 @@ label_BFC05828: psx_cyc_step(cpu, 0x8002u); #endif /* 0xBFC05854: 29E10004 slti $at, $t7, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (4) ? 1 : 0); + PGXP_ALU(0x29E10004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC05854u); #endif @@ -89293,7 +89531,8 @@ label_BFC05DB0: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC05DBC: 308300FF andi $v1, $a0, 0xFF */ - cpu->gpr[3] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC05DBCu); #endif @@ -89936,7 +90175,8 @@ label_BFC05E58: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC05E70: 31F80100 andi $t8, $t7, 0x100 */ - cpu->gpr[24] = cpu->gpr[15] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x100u; + PGXP_ALU(0x31F80100u, cpu->gpr[24], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0xBFC05E70u); #endif @@ -91622,7 +91862,8 @@ label_BFC06038: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC06044: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06044u); #endif @@ -92171,7 +92412,8 @@ label_BFC060DC: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC060EC: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC060ECu); #endif @@ -92236,7 +92478,8 @@ label_BFC060DC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC06104: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06104u); #endif @@ -92342,7 +92585,8 @@ label_BFC06114: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC06120: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06120u); #endif @@ -93331,7 +93575,8 @@ label_BFC06218: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC06230: 304E0010 andi $t6, $v0, 0x10 */ - cpu->gpr[14] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304E0010u, cpu->gpr[14], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC06230u); #endif @@ -94016,7 +94261,8 @@ label_BFC062CC: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC062F8: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC062F8u); #endif @@ -94027,7 +94273,8 @@ label_BFC062CC: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC062FC: 304E000F andi $t6, $v0, 0xF */ - cpu->gpr[14] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x304E000Fu, cpu->gpr[14], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC062FCu); #endif @@ -94050,7 +94297,8 @@ label_BFC062CC: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC06304: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06304u); #endif @@ -94163,7 +94411,8 @@ label_BFC062CC: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0632C: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0632Cu); #endif @@ -94174,7 +94423,8 @@ label_BFC062CC: psx_cyc_step(cpu, 0x8008u); #endif /* 0xBFC06330: 306F000F andi $t7, $v1, 0xF */ - cpu->gpr[15] = cpu->gpr[3] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[15] = cpu->gpr[3] & 0xFu; + PGXP_ALU(0x306F000Fu, cpu->gpr[15], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC06330u); #endif @@ -94206,7 +94456,8 @@ label_BFC062CC: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC0633C: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0633Cu); #endif @@ -94253,7 +94504,8 @@ label_BFC062CC: psx_cyc_step(cpu, 0x1000040u); #endif /* 0xBFC0634C: 30D80010 andi $t8, $a2, 0x10 */ - cpu->gpr[24] = cpu->gpr[6] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[24] = cpu->gpr[6] & 0x10u; + PGXP_ALU(0x30D80010u, cpu->gpr[24], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC0634Cu); #endif @@ -94274,7 +94526,8 @@ label_BFC062CC: psx_cyc_step(cpu, 0x90u); #endif /* 0xBFC06354: 308700FF andi $a3, $a0, 0xFF */ - cpu->gpr[7] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[7] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06354u); #endif @@ -94503,7 +94756,8 @@ label_BFC0636C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC06390: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06390u); #endif @@ -94541,7 +94795,8 @@ label_BFC0636C: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC0639C: 314B00FF andi $t3, $t2, 0xFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFu; + PGXP_ALU(0x314B00FFu, cpu->gpr[11], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0639Cu); #endif @@ -94932,7 +95187,8 @@ label_BFC063CC: psx_cyc_step(cpu, 0x10Au); #endif /* 0xBFC06414: 0103082B sltu $at, $t0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0103082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC06414u); #endif @@ -95175,7 +95431,8 @@ label_BFC06444: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC06458: 304A0010 andi $t2, $v0, 0x10 */ - cpu->gpr[10] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304A0010u, cpu->gpr[10], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC06458u); #endif @@ -95420,7 +95677,8 @@ label_BFC06478: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC06498: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC06498u); #endif @@ -95458,7 +95716,8 @@ label_BFC06478: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC064A4: 318D00FF andi $t5, $t4, 0xFF */ - cpu->gpr[13] = cpu->gpr[12] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0xFFu; + PGXP_ALU(0x318D00FFu, cpu->gpr[13], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC064A4u); #endif @@ -95496,7 +95755,8 @@ label_BFC06478: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC064B0: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC064B0u); #endif @@ -96600,7 +96860,8 @@ label_BFC065C0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC065D8: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC065D8u); #endif @@ -97202,7 +97463,8 @@ label_BFC06680: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC06698: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC06698u); #endif @@ -98895,7 +99157,8 @@ label_BFC06808: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC06810: 00412024 and $a0, $v0, $at */ - cpu->gpr[4] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[4] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00412024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC06810u); #endif @@ -103837,7 +104100,8 @@ label_BFC06CC8: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC06CD0: 00412024 and $a0, $v0, $at */ - cpu->gpr[4] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[4] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00412024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC06CD0u); #endif @@ -110741,7 +111005,8 @@ label_BFC073B0: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC073BC: 01C2082A slt $at, $t6, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01C2082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC073BCu); #endif @@ -110897,7 +111162,8 @@ label_BFC073CC: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC073EC: 0102082A slt $at, $t0, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0102082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC073ECu); #endif @@ -112077,7 +112343,8 @@ label_BFC07518: psx_cyc_step(cpu, 0xE00u); #endif /* 0xBFC07528: 012A5826 xor $t3, $t1, $t2 */ - cpu->gpr[11] = cpu->gpr[9] ^ cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[9] ^ cpu->gpr[10]; + PGXP_ALU(0x012A5826u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07528u); #endif @@ -112112,7 +112379,8 @@ label_BFC07518: psx_cyc_step(cpu, 0x100006u); #endif /* 0xBFC07534: 0054082B sltu $at, $v0, $s4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[20] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[20] ? 1 : 0); + PGXP_ALU(0x0054082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07534u); #endif @@ -112553,7 +112821,8 @@ label_BFC07580: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC075BC: 3063FFFF andi $v1, $v1, 0xFFFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + PGXP_ALU(0x3063FFFFu, cpu->gpr[3], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC075BCu); #endif @@ -112702,7 +112971,8 @@ label_BFC075DC: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC075EC: 30480001 andi $t0, $v0, 0x1 */ - cpu->gpr[8] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30480001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC075ECu); #endif @@ -112841,7 +113111,8 @@ label_BFC0760C: psx_cyc_step(cpu, 0x110002u); #endif /* 0xBFC0760C: 0214082B sltu $at, $s0, $s4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[20] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[20] ? 1 : 0); + PGXP_ALU(0x0214082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0760Cu); #endif @@ -113588,7 +113859,8 @@ label_BFC076C8: psx_cyc_step(cpu, 0x1020002u); #endif /* 0xBFC076D4: 0238082A slt $at, $s1, $t8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x0238082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC076D4u); #endif @@ -114865,7 +115137,8 @@ label_BFC07834: psx_cyc_step(cpu, 0xA0002u); #endif /* 0xBFC07848: 0233082B sltu $at, $s1, $s3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0233082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07848u); #endif @@ -114919,7 +115192,8 @@ label_BFC07854: psx_cyc_step(cpu, 0x140002u); #endif /* 0xBFC07854: 0254082B sltu $at, $s2, $s4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[18] < cpu->gpr[20] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)(cpu->gpr[18] < cpu->gpr[20] ? 1 : 0); + PGXP_ALU(0x0254082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07854u); #endif @@ -115361,7 +115635,8 @@ label_BFC078C8: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC078C8: 304E0010 andi $t6, $v0, 0x10 */ - cpu->gpr[14] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304E0010u, cpu->gpr[14], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC078C8u); #endif @@ -116759,7 +117034,8 @@ label_BFC07A04: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC07A24: 31CF07FF andi $t7, $t6, 0x7FF */ - cpu->gpr[15] = cpu->gpr[14] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x7FFu; + PGXP_ALU(0x31CF07FFu, cpu->gpr[15], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC07A24u); #endif @@ -116915,7 +117191,8 @@ label_BFC07A3C: psx_cyc_step(cpu, 0x1000010u); #endif /* 0xBFC07A44: 309807FF andi $t8, $a0, 0x7FF */ - cpu->gpr[24] = cpu->gpr[4] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[24] = cpu->gpr[4] & 0x7FFu; + PGXP_ALU(0x309807FFu, cpu->gpr[24], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC07A44u); #endif @@ -117062,7 +117339,8 @@ label_BFC07A60: psx_cyc_step(cpu, 0x112u); #endif /* 0xBFC07A68: 0088082B sltu $at, $a0, $t0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0088082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07A68u); #endif @@ -117228,7 +117506,8 @@ label_BFC07A8C: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC07A90: 304A0010 andi $t2, $v0, 0x10 */ - cpu->gpr[10] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304A0010u, cpu->gpr[10], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC07A90u); #endif @@ -117951,7 +118230,8 @@ label_BFC07B40: psx_cyc_step(cpu, 0x406u); #endif /* 0xBFC07B50: 004A082B sltu $at, $v0, $t2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x004A082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC07B50u); #endif @@ -118277,7 +118557,8 @@ label_BFC07B98: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC07B98: 304E0010 andi $t6, $v0, 0x10 */ - cpu->gpr[14] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304E0010u, cpu->gpr[14], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC07B98u); #endif @@ -119102,7 +119383,8 @@ label_BFC07C1C: psx_cyc_step(cpu, 0x400004u); #endif /* 0xBFC07C58: 2AC2000A slti $v0, $s6, 10 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[22] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[22] < (10) ? 1 : 0); + PGXP_ALU(0x2AC2000Au, cpu->gpr[2], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC07C58u); #endif @@ -120733,7 +121015,8 @@ label_BFC07E14: psx_cyc_step(cpu, 0x400004u); #endif /* 0xBFC07E18: 2AC2000A slti $v0, $s6, 10 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[22] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[22] < (10) ? 1 : 0); + PGXP_ALU(0x2AC2000Au, cpu->gpr[2], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC07E18u); #endif @@ -121504,7 +121787,8 @@ label_BFC07EC0: psx_cyc_step(cpu, 0x400004u); #endif /* 0xBFC07EC4: 2AC2000A slti $v0, $s6, 10 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[22] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[22] < (10) ? 1 : 0); + PGXP_ALU(0x2AC2000Au, cpu->gpr[2], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC07EC4u); #endif @@ -122056,7 +122340,8 @@ label_BFC07F44: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC07F44: 304E00FF andi $t6, $v0, 0xFF */ - cpu->gpr[14] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC07F44u); #endif @@ -122200,7 +122485,8 @@ label_BFC07F64: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC07F64: 304F00FF andi $t7, $v0, 0xFF */ - cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC07F64u); #endif @@ -122515,7 +122801,8 @@ label_BFC07FAC: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC07FAC: 305800FF andi $t8, $v0, 0xFF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC07FACu); #endif @@ -122674,7 +122961,8 @@ label_BFC07FD4: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC07FD4: 305900FF andi $t9, $v0, 0xFF */ - cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC07FD4u); #endif @@ -123661,7 +123949,8 @@ label_BFC080B0: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC080B0: 304E0010 andi $t6, $v0, 0x10 */ - cpu->gpr[14] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304E0010u, cpu->gpr[14], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC080B0u); #endif @@ -125340,7 +125629,8 @@ label_BFC08264: psx_cyc_step(cpu, 0x2000Au); #endif /* 0xBFC08268: 0223082B sltu $at, $s1, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0223082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08268u); #endif @@ -125832,7 +126122,8 @@ label_BFC082D8: psx_cyc_step(cpu, 0x2000Au); #endif /* 0xBFC082E0: 0223082B sltu $at, $s1, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0223082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC082E0u); #endif @@ -125914,7 +126205,8 @@ label_BFC082F0: psx_cyc_step(cpu, 0x2000Au); #endif /* 0xBFC082F4: 0223082B sltu $at, $s1, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0223082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC082F4u); #endif @@ -127594,7 +127886,8 @@ label_BFC084A0: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC084A4: 2A610008 slti $at, $s3, 8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (8) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (8) ? 1 : 0); + PGXP_ALU(0x2A610008u, cpu->gpr[1], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC084A4u); #endif @@ -127797,7 +128090,8 @@ label_BFC084CC: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC084D0: 2A610008 slti $at, $s3, 8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (8) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (8) ? 1 : 0); + PGXP_ALU(0x2A610008u, cpu->gpr[1], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC084D0u); #endif @@ -127825,7 +128119,8 @@ label_BFC084D8: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC084D8: 2A610008 slti $at, $s3, 8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (8) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (8) ? 1 : 0); + PGXP_ALU(0x2A610008u, cpu->gpr[1], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC084D8u); #endif @@ -128219,7 +128514,8 @@ label_BFC08520: psx_cyc_step(cpu, 0x420002u); #endif /* 0xBFC0852C: 02D1082A slt $at, $s6, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x02D1082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0852Cu); #endif @@ -128523,7 +128819,8 @@ label_BFC08574: psx_cyc_step(cpu, 0xA0002u); #endif /* 0xBFC08578: 0271082A slt $at, $s3, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0271082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08578u); #endif @@ -130234,7 +130531,8 @@ label_BFC08720: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC0872C: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC0872Cu); #endif @@ -130254,7 +130552,8 @@ label_BFC08720: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC08734: 004E1026 xor $v0, $v0, $t6 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[14]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[14]; + PGXP_ALU(0x004E1026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08734u); #endif @@ -130265,7 +130564,8 @@ label_BFC08720: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08738: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08738u); #endif @@ -130300,7 +130600,8 @@ label_BFC08720: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC08744: 004F1026 xor $v0, $v0, $t7 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[15]; + PGXP_ALU(0x004F1026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08744u); #endif @@ -130311,7 +130612,8 @@ label_BFC08720: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08748: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08748u); #endif @@ -130383,7 +130685,8 @@ label_BFC08758: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC08760: 00581026 xor $v0, $v0, $t8 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[24]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[24]; + PGXP_ALU(0x00581026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08760u); #endif @@ -130394,7 +130697,8 @@ label_BFC08758: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08764: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08764u); #endif @@ -130414,7 +130718,8 @@ label_BFC08758: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0876C: 00591026 xor $v0, $v0, $t9 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[25]; + PGXP_ALU(0x00591026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0876Cu); #endif @@ -130425,7 +130730,8 @@ label_BFC08758: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08770: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08770u); #endif @@ -130457,7 +130763,8 @@ label_BFC08758: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC0877C: 00481026 xor $v0, $v0, $t0 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[8]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[8]; + PGXP_ALU(0x00481026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0877Cu); #endif @@ -130468,7 +130775,8 @@ label_BFC08758: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08780: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08780u); #endif @@ -130515,7 +130823,8 @@ label_BFC08758: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC08790: 00491026 xor $v0, $v0, $t1 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[9]; + PGXP_ALU(0x00491026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08790u); #endif @@ -130526,7 +130835,8 @@ label_BFC08758: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08794: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08794u); #endif @@ -130762,7 +131072,8 @@ label_BFC087C4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC087D0: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC087D0u); #endif @@ -130782,7 +131093,8 @@ label_BFC087C4: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC087D8: 004E1026 xor $v0, $v0, $t6 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[14]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[14]; + PGXP_ALU(0x004E1026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC087D8u); #endif @@ -130793,7 +131105,8 @@ label_BFC087C4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC087DC: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC087DCu); #endif @@ -130828,7 +131141,8 @@ label_BFC087C4: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC087E8: 004F1026 xor $v0, $v0, $t7 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[15]; + PGXP_ALU(0x004F1026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC087E8u); #endif @@ -130839,7 +131153,8 @@ label_BFC087C4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC087EC: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC087ECu); #endif @@ -130911,7 +131226,8 @@ label_BFC087FC: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC08804: 00581026 xor $v0, $v0, $t8 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[24]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[24]; + PGXP_ALU(0x00581026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08804u); #endif @@ -130922,7 +131238,8 @@ label_BFC087FC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08808: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08808u); #endif @@ -130942,7 +131259,8 @@ label_BFC087FC: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC08810: 00591026 xor $v0, $v0, $t9 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[25]; + PGXP_ALU(0x00591026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08810u); #endif @@ -130953,7 +131271,8 @@ label_BFC087FC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08814: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08814u); #endif @@ -130985,7 +131304,8 @@ label_BFC087FC: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC08820: 00481026 xor $v0, $v0, $t0 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[8]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[8]; + PGXP_ALU(0x00481026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08820u); #endif @@ -130996,7 +131316,8 @@ label_BFC087FC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08824: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08824u); #endif @@ -131043,7 +131364,8 @@ label_BFC087FC: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC08834: 00491026 xor $v0, $v0, $t1 */ - cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[2] = cpu->gpr[2] ^ cpu->gpr[9]; + PGXP_ALU(0x00491026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC08834u); #endif @@ -131054,7 +131376,8 @@ label_BFC087FC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC08838: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0xBFC08838u); #endif @@ -137556,7 +137879,8 @@ label_BFC08EA8: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC08EAC: 2A01000F slti $at, $s0, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (15) ? 1 : 0); + PGXP_ALU(0x2A01000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC08EACu); #endif @@ -139632,7 +139956,8 @@ label_BFC09098: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC090A4: 31AE00F0 andi $t6, $t5, 0xF0 */ - cpu->gpr[14] = cpu->gpr[13] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0xF0u; + PGXP_ALU(0x31AE00F0u, cpu->gpr[14], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0xBFC090A4u); #endif @@ -145349,7 +145674,8 @@ label_BFC09618: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC0962C: 2A010014 slti $at, $s0, 20 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (20) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (20) ? 1 : 0); + PGXP_ALU(0x2A010014u, cpu->gpr[1], _pgx1, 0x0014u); } #ifdef PSX_COSIM cosim_instr(0xBFC0962Cu); #endif @@ -145403,7 +145729,8 @@ label_BFC09630: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC09638: 2A010014 slti $at, $s0, 20 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (20) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (20) ? 1 : 0); + PGXP_ALU(0x2A010014u, cpu->gpr[1], _pgx1, 0x0014u); } #ifdef PSX_COSIM cosim_instr(0xBFC09638u); #endif @@ -147781,7 +148108,8 @@ label_BFC09890: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC09890: 38820052 xori $v0, $a0, 0x52 */ - cpu->gpr[2] = cpu->gpr[4] ^ 0x52u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] ^ 0x52u; + PGXP_ALU(0x38820052u, cpu->gpr[2], _pgx1, 0x0052u); } #ifdef PSX_COSIM cosim_instr(0xBFC09890u); #endif @@ -147800,7 +148128,8 @@ label_BFC09890: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC09898: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC09898u); #endif @@ -147835,7 +148164,8 @@ label_BFC0989C: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC0989C: 38820051 xori $v0, $a0, 0x51 */ - cpu->gpr[2] = cpu->gpr[4] ^ 0x51u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] ^ 0x51u; + PGXP_ALU(0x38820051u, cpu->gpr[2], _pgx1, 0x0051u); } #ifdef PSX_COSIM cosim_instr(0xBFC0989Cu); #endif @@ -147854,7 +148184,8 @@ label_BFC0989C: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC098A4: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC098A4u); #endif @@ -149198,7 +149529,8 @@ label_BFC099D8: psx_cyc_step(cpu, 0x2080000u); #endif /* 0xBFC099D8: 32798000 andi $t9, $s3, 0x8000 */ - cpu->gpr[25] = cpu->gpr[19] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[25] = cpu->gpr[19] & 0x8000u; + PGXP_ALU(0x32798000u, cpu->gpr[25], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0xBFC099D8u); #endif @@ -149231,7 +149563,8 @@ label_BFC099D8: psx_cyc_step(cpu, 0x80800u); #endif /* 0xBFC099E4: 326B0200 andi $t3, $s3, 0x200 */ - cpu->gpr[11] = cpu->gpr[19] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[11] = cpu->gpr[19] & 0x200u; + PGXP_ALU(0x326B0200u, cpu->gpr[11], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0xBFC099E4u); #endif @@ -149318,7 +149651,8 @@ label_BFC099F4: psx_cyc_step(cpu, 0x80800u); #endif /* 0xBFC099F8: 326B0200 andi $t3, $s3, 0x200 */ - cpu->gpr[11] = cpu->gpr[19] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[11] = cpu->gpr[19] & 0x200u; + PGXP_ALU(0x326B0200u, cpu->gpr[11], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0xBFC099F8u); #endif @@ -149393,7 +149727,8 @@ label_BFC09A04: psx_cyc_step(cpu, 0x80800u); #endif /* 0xBFC09A04: 326B0200 andi $t3, $s3, 0x200 */ - cpu->gpr[11] = cpu->gpr[19] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[11] = cpu->gpr[19] & 0x200u; + PGXP_ALU(0x326B0200u, cpu->gpr[11], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0xBFC09A04u); #endif @@ -149875,7 +150210,8 @@ label_BFC09A80: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC09A88: 31F800F0 andi $t8, $t7, 0xF0 */ - cpu->gpr[24] = cpu->gpr[15] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xF0u; + PGXP_ALU(0x31F800F0u, cpu->gpr[24], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0xBFC09A88u); #endif @@ -150014,7 +150350,8 @@ label_BFC09AA4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC09AA8: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC09AA8u); #endif @@ -150049,7 +150386,8 @@ label_BFC09AA4: psx_cyc_step(cpu, 0x2000006u); #endif /* 0xBFC09AB4: 0322082B sltu $at, $t9, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[25] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[25] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0322082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC09AB4u); #endif @@ -150123,7 +150461,8 @@ label_BFC09AC0: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC09AC8: 304B1FFF andi $t3, $v0, 0x1FFF */ - cpu->gpr[11] = cpu->gpr[2] & 0x1FFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x1FFFu; + PGXP_ALU(0x304B1FFFu, cpu->gpr[11], _pgx1, 0x1FFFu); } #ifdef PSX_COSIM cosim_instr(0xBFC09AC8u); #endif @@ -150289,7 +150628,8 @@ label_BFC09AF0: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC09AF8: 318D00F0 andi $t5, $t4, 0xF0 */ - cpu->gpr[13] = cpu->gpr[12] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0xF0u; + PGXP_ALU(0x318D00F0u, cpu->gpr[13], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0xBFC09AF8u); #endif @@ -150854,7 +151194,8 @@ label_BFC09B98: psx_cyc_step(cpu, 0x10Au); #endif /* 0xBFC09B9C: 0068082A slt $at, $v1, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0068082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC09B9Cu); #endif @@ -150920,7 +151261,8 @@ label_BFC09BA8: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC09BAC: 28610002 slti $at, $v1, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (2) ? 1 : 0); + PGXP_ALU(0x28610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC09BACu); #endif @@ -153005,7 +153347,8 @@ label_BFC09DB4: psx_cyc_step(cpu, 0x2000008u); #endif /* 0xBFC09DBC: 3079007F andi $t9, $v1, 0x7F */ - cpu->gpr[25] = cpu->gpr[3] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[25] = cpu->gpr[3] & 0x7Fu; + PGXP_ALU(0x3079007Fu, cpu->gpr[25], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC09DBCu); #endif @@ -153145,7 +153488,8 @@ label_BFC09DD8: psx_cyc_step(cpu, 0x20Au); #endif /* 0xBFC09DE0: 0069082B sltu $at, $v1, $t1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0069082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC09DE0u); #endif @@ -153322,7 +153666,8 @@ label_BFC09DFC: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC09E10: 316C8000 andi $t4, $t3, 0x8000 */ - cpu->gpr[12] = cpu->gpr[11] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x8000u; + PGXP_ALU(0x316C8000u, cpu->gpr[12], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0xBFC09E10u); #endif @@ -154649,7 +154994,8 @@ label_BFC09F78: psx_cyc_step(cpu, 0x22000u); #endif /* 0xBFC09F7C: 322D003F andi $t5, $s1, 0x3F */ - cpu->gpr[13] = cpu->gpr[17] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[13] = cpu->gpr[17] & 0x3Fu; + PGXP_ALU(0x322D003Fu, cpu->gpr[13], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC09F7Cu); #endif @@ -154754,7 +155100,8 @@ label_BFC09F8C: psx_cyc_step(cpu, 0x40006u); #endif /* 0xBFC09F90: 0052082A slt $at, $v0, $s2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0052082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC09F90u); #endif @@ -156189,7 +156536,8 @@ label_BFC0A0F8: psx_cyc_step(cpu, 0x2000008u); #endif /* 0xBFC0A100: 3079007F andi $t9, $v1, 0x7F */ - cpu->gpr[25] = cpu->gpr[3] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[25] = cpu->gpr[3] & 0x7Fu; + PGXP_ALU(0x3079007Fu, cpu->gpr[25], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0A100u); #endif @@ -156329,7 +156677,8 @@ label_BFC0A11C: psx_cyc_step(cpu, 0x20Au); #endif /* 0xBFC0A124: 0069082B sltu $at, $v1, $t1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0069082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0A124u); #endif @@ -156506,7 +156855,8 @@ label_BFC0A140: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC0A154: 316C8000 andi $t4, $t3, 0x8000 */ - cpu->gpr[12] = cpu->gpr[11] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x8000u; + PGXP_ALU(0x316C8000u, cpu->gpr[12], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0xBFC0A154u); #endif @@ -157881,7 +158231,8 @@ label_BFC0A2CC: psx_cyc_step(cpu, 0x24000u); #endif /* 0xBFC0A2D0: 322E003F andi $t6, $s1, 0x3F */ - cpu->gpr[14] = cpu->gpr[17] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[14] = cpu->gpr[17] & 0x3Fu; + PGXP_ALU(0x322E003Fu, cpu->gpr[14], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0A2D0u); #endif @@ -157986,7 +158337,8 @@ label_BFC0A2E0: psx_cyc_step(cpu, 0x40006u); #endif /* 0xBFC0A2E4: 0052082A slt $at, $v0, $s2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0052082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0A2E4u); #endif @@ -158879,7 +159231,8 @@ label_BFC0A3D4: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC0A3D4: 28C10040 slti $at, $a2, 64 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (64) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (64) ? 1 : 0); + PGXP_ALU(0x28C10040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0xBFC0A3D4u); #endif @@ -159079,7 +159432,8 @@ label_BFC0A400: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC0A410: 28C10040 slti $at, $a2, 64 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (64) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (64) ? 1 : 0); + PGXP_ALU(0x28C10040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0xBFC0A410u); #endif @@ -160625,7 +160979,8 @@ label_BFC0A570: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC0A598: 31CF00F0 andi $t7, $t6, 0xF0 */ - cpu->gpr[15] = cpu->gpr[14] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xF0u; + PGXP_ALU(0x31CF00F0u, cpu->gpr[15], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0xBFC0A598u); #endif @@ -161634,7 +161989,8 @@ label_BFC0A694: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC0A698: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0A698u); #endif @@ -162095,7 +162451,8 @@ label_BFC0A700: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC0A708: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0A708u); #endif @@ -162179,7 +162536,8 @@ label_BFC0A718: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC0A71C: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0A71Cu); #endif @@ -162488,7 +162846,8 @@ label_BFC0A754: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC0A760: 28A1000F slti $at, $a1, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (15) ? 1 : 0); + PGXP_ALU(0x28A1000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0A760u); #endif @@ -163596,7 +163955,8 @@ label_BFC0A87C: psx_cyc_step(cpu, 0x40002u); #endif /* 0xBFC0A880: 2A41000F slti $at, $s2, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (15) ? 1 : 0); + PGXP_ALU(0x2A41000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0A880u); #endif @@ -175753,7 +176113,8 @@ label_BFC0B488: psx_cyc_step(cpu, 0x82u); #endif /* 0xBFC0B494: 28E10014 slti $at, $a3, 20 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (20) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (20) ? 1 : 0); + PGXP_ALU(0x28E10014u, cpu->gpr[1], _pgx1, 0x0014u); } #ifdef PSX_COSIM cosim_instr(0xBFC0B494u); #endif @@ -175840,7 +176201,8 @@ label_BFC0B4A4: psx_cyc_step(cpu, 0x82u); #endif /* 0xBFC0B4A4: 28E10014 slti $at, $a3, 20 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (20) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (20) ? 1 : 0); + PGXP_ALU(0x28E10014u, cpu->gpr[1], _pgx1, 0x0014u); } #ifdef PSX_COSIM cosim_instr(0xBFC0B4A4u); #endif @@ -177895,7 +178257,8 @@ label_BFC0B68C: psx_cyc_step(cpu, 0x8002u); #endif /* 0xBFC0B694: 2DE10008 sltiu $at, $t7, 8 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < 0x00000008u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < 0x00000008u ? 1 : 0); + PGXP_ALU(0x2DE10008u, cpu->gpr[1], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0xBFC0B694u); #endif @@ -183378,7 +183741,8 @@ label_BFC0BC64: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC0BC80: 2861000F slti $at, $v1, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (15) ? 1 : 0); + PGXP_ALU(0x2861000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0BC80u); #endif @@ -184844,7 +185208,8 @@ label_BFC0BE0C: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC0BE10: 2A01000F slti $at, $s0, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (15) ? 1 : 0); + PGXP_ALU(0x2A01000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0BE10u); #endif @@ -185997,7 +186362,8 @@ label_BFC0BF38: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC0BF54: 28610014 slti $at, $v1, 20 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (20) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (20) ? 1 : 0); + PGXP_ALU(0x28610014u, cpu->gpr[1], _pgx1, 0x0014u); } #ifdef PSX_COSIM cosim_instr(0xBFC0BF54u); #endif @@ -190783,7 +191149,8 @@ label_BFC0C5F4: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC0C5FC: 29C12710 slti $at, $t6, 10000 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (10000) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (10000) ? 1 : 0); + PGXP_ALU(0x29C12710u, cpu->gpr[1], _pgx1, 0x2710u); } #ifdef PSX_COSIM cosim_instr(0xBFC0C5FCu); #endif @@ -190939,7 +191306,8 @@ label_BFC0C60C: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC0C62C: 29012710 slti $at, $t0, 10000 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (10000) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (10000) ? 1 : 0); + PGXP_ALU(0x29012710u, cpu->gpr[1], _pgx1, 0x2710u); } #ifdef PSX_COSIM cosim_instr(0xBFC0C62Cu); #endif @@ -191095,7 +191463,8 @@ label_BFC0C648: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC0C654: 2921000A slti $at, $t1, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (10) ? 1 : 0); + PGXP_ALU(0x2921000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0C654u); #endif @@ -191297,7 +191666,8 @@ label_BFC0C678: psx_cyc_step(cpu, 0x2002u); #endif /* 0xBFC0C690: 29A1000A slti $at, $t5, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (10) ? 1 : 0); + PGXP_ALU(0x29A1000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0C690u); #endif @@ -191417,7 +191787,8 @@ label_BFC0C6A4: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC0C6B0: 29C1000A slti $at, $t6, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (10) ? 1 : 0); + PGXP_ALU(0x29C1000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0C6B0u); #endif @@ -191619,7 +191990,8 @@ label_BFC0C6D4: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC0C6EC: 2901000A slti $at, $t0, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (10) ? 1 : 0); + PGXP_ALU(0x2901000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0xBFC0C6ECu); #endif @@ -192293,7 +192665,8 @@ label_BFC0C790: psx_cyc_step(cpu, 0x28002u); #endif /* 0xBFC0C798: 01F1082A slt $at, $t7, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x01F1082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0C798u); #endif @@ -192449,7 +192822,8 @@ label_BFC0C7A8: psx_cyc_step(cpu, 0x20202u); #endif /* 0xBFC0C7C8: 0131082A slt $at, $t1, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0131082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0C7C8u); #endif @@ -194531,7 +194905,8 @@ label_BFC0C9EC: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC0C9F0: 2E210002 sltiu $at, $s1, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2E210002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC0C9F0u); #endif @@ -195821,7 +196196,8 @@ label_BFC0CB30: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC0CB38: 33280004 andi $t0, $t9, 0x4 */ - cpu->gpr[8] = cpu->gpr[25] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x4u; + PGXP_ALU(0x33280004u, cpu->gpr[8], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC0CB38u); #endif @@ -196500,7 +196876,8 @@ label_BFC0CBEC: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC0CBF4: 31AE0002 andi $t6, $t5, 0x2 */ - cpu->gpr[14] = cpu->gpr[13] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x2u; + PGXP_ALU(0x31AE0002u, cpu->gpr[14], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC0CBF4u); #endif @@ -197796,7 +198173,8 @@ label_BFC0CD20: psx_cyc_step(cpu, 0x302u); #endif /* 0xBFC0CD28: 01014824 and $t1, $t0, $at */ - cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[1]; + PGXP_ALU(0x01014824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0xBFC0CD28u); #endif @@ -199235,7 +199613,8 @@ label_BFC0CE94: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC0CE9C: 30580001 andi $t8, $v0, 0x1 */ - cpu->gpr[24] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30580001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0CE9Cu); #endif @@ -199620,7 +199999,8 @@ label_BFC0CF00: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC0CF08: 304E0001 andi $t6, $v0, 0x1 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0CF08u); #endif @@ -200779,7 +201159,8 @@ label_BFC0CFF0: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC0CFF4: 28810709 slti $at, $a0, 1801 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1801) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1801) ? 1 : 0); + PGXP_ALU(0x28810709u, cpu->gpr[1], _pgx1, 0x0709u); } #ifdef PSX_COSIM cosim_instr(0xBFC0CFF4u); #endif @@ -200864,7 +201245,8 @@ label_BFC0D000: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC0D004: 28810097 slti $at, $a0, 151 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (151) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (151) ? 1 : 0); + PGXP_ALU(0x28810097u, cpu->gpr[1], _pgx1, 0x0097u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D004u); #endif @@ -200949,7 +201331,8 @@ label_BFC0D010: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC0D014: 2881006F slti $at, $a0, 111 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (111) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (111) ? 1 : 0); + PGXP_ALU(0x2881006Fu, cpu->gpr[1], _pgx1, 0x006Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0D014u); #endif @@ -201227,7 +201610,8 @@ label_BFC0D044: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC0D04C: 28810259 slti $at, $a0, 601 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (601) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (601) ? 1 : 0); + PGXP_ALU(0x28810259u, cpu->gpr[1], _pgx1, 0x0259u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D04Cu); #endif @@ -201504,7 +201888,8 @@ label_BFC0D07C: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC0D084: 28812581 slti $at, $a0, 9601 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (9601) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (9601) ? 1 : 0); + PGXP_ALU(0x28812581u, cpu->gpr[1], _pgx1, 0x2581u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D084u); #endif @@ -201589,7 +201974,8 @@ label_BFC0D090: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC0D094: 288112C1 slti $at, $a0, 4801 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (4801) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (4801) ? 1 : 0); + PGXP_ALU(0x288112C1u, cpu->gpr[1], _pgx1, 0x12C1u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D094u); #endif @@ -202396,7 +202782,8 @@ label_BFC0D11C: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC0D144: 30580001 andi $t8, $v0, 0x1 */ - cpu->gpr[24] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30580001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D144u); #endif @@ -202417,7 +202804,8 @@ label_BFC0D11C: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0D14C: 30590010 andi $t9, $v0, 0x10 */ - cpu->gpr[25] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30590010u, cpu->gpr[25], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D14Cu); #endif @@ -202492,7 +202880,8 @@ label_BFC0D158: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0D158: 30590010 andi $t9, $v0, 0x10 */ - cpu->gpr[25] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30590010u, cpu->gpr[25], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D158u); #endif @@ -202520,7 +202909,8 @@ label_BFC0D15C: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0D160: 305900C0 andi $t9, $v0, 0xC0 */ - cpu->gpr[25] = cpu->gpr[2] & 0xC0u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0xC0u; + PGXP_ALU(0x305900C0u, cpu->gpr[25], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D160u); #endif @@ -202573,7 +202963,8 @@ label_BFC0D164: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC0D16C: 31090001 andi $t1, $t0, 0x1 */ - cpu->gpr[9] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31090001u, cpu->gpr[9], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D16Cu); #endif @@ -203199,7 +203590,8 @@ label_BFC0D218: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC0D220: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D220u); #endif @@ -203352,7 +203744,8 @@ label_BFC0D240: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0D240: 305900C0 andi $t9, $v0, 0xC0 */ - cpu->gpr[25] = cpu->gpr[2] & 0xC0u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0xC0u; + PGXP_ALU(0x305900C0u, cpu->gpr[25], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D240u); #endif @@ -204595,7 +204988,8 @@ label_BFC0D34C: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC0D390: 33280002 andi $t0, $t9, 0x2 */ - cpu->gpr[8] = cpu->gpr[25] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x2u; + PGXP_ALU(0x33280002u, cpu->gpr[8], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D390u); #endif @@ -204702,7 +205096,8 @@ label_BFC0D3A4: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC0D3AC: 312A0002 andi $t2, $t1, 0x2 */ - cpu->gpr[10] = cpu->gpr[9] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x2u; + PGXP_ALU(0x312A0002u, cpu->gpr[10], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D3ACu); #endif @@ -204890,7 +205285,8 @@ label_BFC0D3D8: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC0D3E0: 31AE0004 andi $t6, $t5, 0x4 */ - cpu->gpr[14] = cpu->gpr[13] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x4u; + PGXP_ALU(0x31AE0004u, cpu->gpr[14], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D3E0u); #endif @@ -205053,7 +205449,8 @@ label_BFC0D400: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC0D408: 31F80004 andi $t8, $t7, 0x4 */ - cpu->gpr[24] = cpu->gpr[15] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x4u; + PGXP_ALU(0x31F80004u, cpu->gpr[24], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D408u); #endif @@ -205937,7 +206334,8 @@ label_BFC0D4F0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC0D4F4: 2C41000F sltiu $at, $v0, 15 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000000Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000000Fu ? 1 : 0); + PGXP_ALU(0x2C41000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0xBFC0D4F4u); #endif @@ -207768,7 +208166,8 @@ label_BFC0D6B4: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC0D6D4: 30510007 andi $s1, $v0, 0x7 */ - cpu->gpr[17] = cpu->gpr[2] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[17] = cpu->gpr[2] & 0x7u; + PGXP_ALU(0x30510007u, cpu->gpr[17], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D6D4u); #endif @@ -207789,7 +208188,8 @@ label_BFC0D6B4: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC0D6DC: 2A010005 slti $at, $s0, 5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (5) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (5) ? 1 : 0); + PGXP_ALU(0x2A010005u, cpu->gpr[1], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D6DCu); #endif @@ -207878,7 +208278,8 @@ label_BFC0D6E8: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC0D6F0: 2A010005 slti $at, $s0, 5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (5) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (5) ? 1 : 0); + PGXP_ALU(0x2A010005u, cpu->gpr[1], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0xBFC0D6F0u); #endif @@ -208377,7 +208778,8 @@ label_BFC0D764: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0D768: 3059001D andi $t9, $v0, 0x1D */ - cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + PGXP_ALU(0x3059001Du, cpu->gpr[25], _pgx1, 0x001Du); } #ifdef PSX_COSIM cosim_instr(0xBFC0D768u); #endif @@ -208488,7 +208890,8 @@ label_BFC0D77C: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0D77C: 3059001D andi $t9, $v0, 0x1D */ - cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + PGXP_ALU(0x3059001Du, cpu->gpr[25], _pgx1, 0x001Du); } #ifdef PSX_COSIM cosim_instr(0xBFC0D77Cu); #endif @@ -209026,7 +209429,8 @@ label_BFC0D7F4: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0D7F8: 3059001D andi $t9, $v0, 0x1D */ - cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + PGXP_ALU(0x3059001Du, cpu->gpr[25], _pgx1, 0x001Du); } #ifdef PSX_COSIM cosim_instr(0xBFC0D7F8u); #endif @@ -209137,7 +209541,8 @@ label_BFC0D80C: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC0D80C: 3059001D andi $t9, $v0, 0x1D */ - cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + PGXP_ALU(0x3059001Du, cpu->gpr[25], _pgx1, 0x001Du); } #ifdef PSX_COSIM cosim_instr(0xBFC0D80Cu); #endif @@ -213728,7 +214133,8 @@ label_BFC100A8: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC100B0: 0043082B sltu $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000005B0u); #endif @@ -215055,7 +215461,8 @@ label_BFC107C0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC107C0: 3042003C andi $v0, $v0, 0x3C */ - cpu->gpr[2] = cpu->gpr[2] & 0x3Cu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x3Cu; + PGXP_ALU(0x3042003Cu, cpu->gpr[2], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x00000CC0u); #endif @@ -215128,7 +215535,8 @@ label_BFC107CC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC107D8: 304200FE andi $v0, $v0, 0xFE */ - cpu->gpr[2] = cpu->gpr[2] & 0xFEu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFEu; + PGXP_ALU(0x304200FEu, cpu->gpr[2], _pgx1, 0x00FEu); } #ifdef PSX_COSIM cosim_instr(0x00000CD8u); #endif @@ -217494,7 +217902,8 @@ label_BFC10B38: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC10B44: 0044082B sltu $at, $v0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001044u); #endif @@ -217709,7 +218118,8 @@ label_BFC10B64: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC10B88: 0043082B sltu $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001088u); #endif @@ -217727,7 +218137,8 @@ label_BFC10B64: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC10B90: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001090u); #endif @@ -217799,7 +218210,8 @@ label_BFC10B9C: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC10B9C: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000109Cu); #endif @@ -217988,7 +218400,8 @@ label_BFC10BB8: psx_cyc_step(cpu, 0x8012u); #endif /* 0xBFC10BCC: 008F082B sltu $at, $a0, $t7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x008F082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000010CCu); #endif @@ -218815,7 +219228,8 @@ label_BFC10C74: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC10CAC: 02218824 and $s1, $s1, $at */ - cpu->gpr[17] = cpu->gpr[17] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[17] = cpu->gpr[17] & cpu->gpr[1]; + PGXP_ALU(0x02218824u, cpu->gpr[17], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000011ACu); #endif @@ -218928,7 +219342,8 @@ label_BFC10CB8: psx_cyc_step(cpu, 0x8006u); #endif /* 0xBFC10CCC: 004F082B sltu $at, $v0, $t7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x004F082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000011CCu); #endif @@ -219327,7 +219742,8 @@ label_BFC10D30: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC10D44: 30830001 andi $v1, $a0, 0x1 */ - cpu->gpr[3] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30830001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001244u); #endif @@ -219400,7 +219816,8 @@ label_BFC10D50: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC10D58: 0044082B sltu $at, $v0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001258u); #endif @@ -219450,7 +219867,8 @@ label_BFC10D5C: psx_cyc_step(cpu, 0x40210u); #endif /* 0xBFC10D64: 00924824 and $t1, $a0, $s2 */ - cpu->gpr[9] = cpu->gpr[4] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[9] = cpu->gpr[4] & cpu->gpr[18]; + PGXP_ALU(0x00924824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001264u); #endif @@ -219498,7 +219916,8 @@ label_BFC10D70: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC10D70: 0044082B sltu $at, $v0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001270u); #endif @@ -219523,7 +219942,8 @@ label_BFC10D74: psx_cyc_step(cpu, 0x20012u); #endif /* 0xBFC10D78: 0091082B sltu $at, $a0, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0091082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001278u); #endif @@ -219750,7 +220170,8 @@ label_BFC10DB8: psx_cyc_step(cpu, 0x20012u); #endif /* 0xBFC10DB8: 0091082B sltu $at, $a0, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0091082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000012B8u); #endif @@ -219880,7 +220301,8 @@ label_BFC10DC4: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC10DE4: 304E0001 andi $t6, $v0, 0x1 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x000012E4u); #endif @@ -220146,7 +220568,8 @@ label_BFC10E20: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC10E20: 304E0001 andi $t6, $v0, 0x1 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001320u); #endif @@ -220203,7 +220626,8 @@ label_BFC10E2C: psx_cyc_step(cpu, 0x42004u); #endif /* 0xBFC10E2C: 00526824 and $t5, $v0, $s2 */ - cpu->gpr[13] = cpu->gpr[2] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[13] = cpu->gpr[2] & cpu->gpr[18]; + PGXP_ALU(0x00526824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000132Cu); #endif @@ -220357,7 +220781,8 @@ label_BFC10E50: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC10E64: 30830001 andi $v1, $a0, 0x1 */ - cpu->gpr[3] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30830001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001364u); #endif @@ -220781,7 +221206,8 @@ label_BFC10EC8: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC10EDC: 30830001 andi $v1, $a0, 0x1 */ - cpu->gpr[3] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30830001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x000013DCu); #endif @@ -222086,7 +222512,8 @@ label_BFC11008: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC11040: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001540u); #endif @@ -222683,7 +223110,8 @@ label_BFC110F8: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC110F8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x000015F8u); #endif @@ -222691,7 +223119,8 @@ label_BFC110F8: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC110FC: 28810003 slti $at, $a0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + PGXP_ALU(0x28810003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x000015FCu); #endif @@ -222702,7 +223131,8 @@ label_BFC110F8: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC11100: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001600u); #endif @@ -222866,7 +223296,8 @@ label_BFC11114: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC11124: 00811026 xor $v0, $a0, $at */ - cpu->gpr[2] = cpu->gpr[4] ^ cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[4] ^ cpu->gpr[1]; + PGXP_ALU(0x00811026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001624u); #endif @@ -222895,7 +223326,8 @@ label_BFC11114: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC11130: 2C420001 sltiu $v0, $v0, 1 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[2] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001630u); #endif @@ -223001,7 +223433,8 @@ label_BFC1114C: psx_cyc_step(cpu, 0x2000080u); #endif /* 0xBFC1114C: 30F90010 andi $t9, $a3, 0x10 */ - cpu->gpr[25] = cpu->gpr[7] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[25] = cpu->gpr[7] & 0x10u; + PGXP_ALU(0x30F90010u, cpu->gpr[25], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x0000164Cu); #endif @@ -223019,7 +223452,8 @@ label_BFC1114C: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC11154: 30E80001 andi $t0, $a3, 0x1 */ - cpu->gpr[8] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[8] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E80001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00001654u); #endif @@ -223060,7 +223494,8 @@ label_BFC11158: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC1115C: 30E80001 andi $t0, $a3, 0x1 */ - cpu->gpr[8] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[8] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E80001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x0000165Cu); #endif @@ -223085,7 +223520,8 @@ label_BFC11160: psx_cyc_step(cpu, 0x880u); #endif /* 0xBFC11164: 30EB1000 andi $t3, $a3, 0x1000 */ - cpu->gpr[11] = cpu->gpr[7] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[11] = cpu->gpr[7] & 0x1000u; + PGXP_ALU(0x30EB1000u, cpu->gpr[11], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x00001664u); #endif @@ -223183,7 +223619,8 @@ label_BFC11174: psx_cyc_step(cpu, 0x880u); #endif /* 0xBFC11178: 30EB1000 andi $t3, $a3, 0x1000 */ - cpu->gpr[11] = cpu->gpr[7] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[11] = cpu->gpr[7] & 0x1000u; + PGXP_ALU(0x30EB1000u, cpu->gpr[11], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x00001678u); #endif @@ -223215,7 +223652,8 @@ label_BFC1117C: psx_cyc_step(cpu, 0x480u); #endif /* 0xBFC1117C: 30EA0001 andi $t2, $a3, 0x1 */ - cpu->gpr[10] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[10] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30EA0001u, cpu->gpr[10], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x0000167Cu); #endif @@ -223233,7 +223671,8 @@ label_BFC1117C: psx_cyc_step(cpu, 0x880u); #endif /* 0xBFC11184: 30EB1000 andi $t3, $a3, 0x1000 */ - cpu->gpr[11] = cpu->gpr[7] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[11] = cpu->gpr[7] & 0x1000u; + PGXP_ALU(0x30EB1000u, cpu->gpr[11], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x00001684u); #endif @@ -223284,7 +223723,8 @@ label_BFC1118C: psx_cyc_step(cpu, 0x880u); #endif /* 0xBFC1118C: 30EB1000 andi $t3, $a3, 0x1000 */ - cpu->gpr[11] = cpu->gpr[7] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[11] = cpu->gpr[7] & 0x1000u; + PGXP_ALU(0x30EB1000u, cpu->gpr[11], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x0000168Cu); #endif @@ -223431,7 +223871,8 @@ label_BFC111AC: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC111AC: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x000016ACu); #endif @@ -223442,7 +223883,8 @@ label_BFC111AC: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC111B0: 28810003 slti $at, $a0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + PGXP_ALU(0x28810003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x000016B0u); #endif @@ -223645,7 +224087,8 @@ label_BFC111E4: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC111E8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x000016E8u); #endif @@ -223704,7 +224147,8 @@ label_BFC111E4: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC11204: 28810003 slti $at, $a0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + PGXP_ALU(0x28810003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00001704u); #endif @@ -223857,7 +224301,8 @@ label_BFC11228: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC11228: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001728u); #endif @@ -223925,7 +224370,8 @@ label_BFC11228: psx_cyc_step(cpu, 0x3000001u); #endif /* 0xBFC11248: 0300C827 nor $t9, $t8, $zero */ - cpu->gpr[25] = ~(cpu->gpr[24] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[25] = ~(cpu->gpr[24] | cpu->gpr[0]); + PGXP_ALU(0x0300C827u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001748u); #endif @@ -223933,7 +224379,8 @@ label_BFC11228: psx_cyc_step(cpu, 0x2004100u); #endif /* 0xBFC1124C: 01D94024 and $t0, $t6, $t9 */ - cpu->gpr[8] = cpu->gpr[14] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[14] & cpu->gpr[25]; + PGXP_ALU(0x01D94024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000174Cu); #endif @@ -224004,7 +224451,8 @@ label_BFC1125C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1125C: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x0000175Cu); #endif @@ -224015,7 +224463,8 @@ label_BFC1125C: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC11260: 28810003 slti $at, $a0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + PGXP_ALU(0x28810003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x00001760u); #endif @@ -224273,7 +224722,8 @@ label_BFC11294: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC112AC: 31CF0010 andi $t7, $t6, 0x10 */ - cpu->gpr[15] = cpu->gpr[14] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x10u; + PGXP_ALU(0x31CF0010u, cpu->gpr[15], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000017ACu); #endif @@ -224340,7 +224790,8 @@ label_BFC112B8: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC112C0: 33190010 andi $t9, $t8, 0x10 */ - cpu->gpr[25] = cpu->gpr[24] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x10u; + PGXP_ALU(0x33190010u, cpu->gpr[25], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000017C0u); #endif @@ -224631,7 +225082,8 @@ label_BFC112F4: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC1130C: 31CF0020 andi $t7, $t6, 0x20 */ - cpu->gpr[15] = cpu->gpr[14] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x20u; + PGXP_ALU(0x31CF0020u, cpu->gpr[15], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x0000180Cu); #endif @@ -224698,7 +225150,8 @@ label_BFC11318: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC11320: 33190020 andi $t9, $t8, 0x20 */ - cpu->gpr[25] = cpu->gpr[24] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x20u; + PGXP_ALU(0x33190020u, cpu->gpr[25], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x00001820u); #endif @@ -225004,7 +225457,8 @@ label_BFC11358: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC11370: 31CF0040 andi $t7, $t6, 0x40 */ - cpu->gpr[15] = cpu->gpr[14] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x40u; + PGXP_ALU(0x31CF0040u, cpu->gpr[15], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x00001870u); #endif @@ -225068,7 +225522,8 @@ label_BFC1137C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC11384: 33190040 andi $t9, $t8, 0x40 */ - cpu->gpr[25] = cpu->gpr[24] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x40u; + PGXP_ALU(0x33190040u, cpu->gpr[25], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x00001884u); #endif @@ -225371,7 +225826,8 @@ label_BFC113BC: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC113D4: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x000018D4u); #endif @@ -225432,7 +225888,8 @@ label_BFC113E0: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC113E8: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x000018E8u); #endif @@ -226513,7 +226970,8 @@ label_BFC11500: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC11520: 3063003C andi $v1, $v1, 0x3C */ - cpu->gpr[3] = cpu->gpr[3] & 0x3Cu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x3Cu; + PGXP_ALU(0x3063003Cu, cpu->gpr[3], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x00001A20u); #endif @@ -226648,7 +227106,8 @@ label_BFC1152C: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC11538: 2C610004 sltiu $at, $v1, 4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000004u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000004u ? 1 : 0); + PGXP_ALU(0x2C610004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00001A38u); #endif @@ -226829,7 +227288,8 @@ label_BFC11560: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC11568: 31090404 andi $t1, $t0, 0x404 */ - cpu->gpr[9] = cpu->gpr[8] & 0x404u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x404u; + PGXP_ALU(0x31090404u, cpu->gpr[9], _pgx1, 0x0404u); } #ifdef PSX_COSIM cosim_instr(0x00001A68u); #endif @@ -226962,7 +227422,8 @@ label_BFC11584: psx_cyc_step(cpu, 0x1802u); #endif /* 0xBFC1158C: 01616024 and $t4, $t3, $at */ - cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[1]; + PGXP_ALU(0x01616024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001A8Cu); #endif @@ -227964,7 +228425,8 @@ label_BFC11644: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC11694: 0062082B sltu $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001B94u); #endif @@ -228481,7 +228943,8 @@ label_BFC11720: psx_cyc_step(cpu, 0x110002u); #endif /* 0xBFC11724: 0214082B sltu $at, $s0, $s4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[20] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[20] ? 1 : 0); + PGXP_ALU(0x0214082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001C24u); #endif @@ -228793,7 +229256,8 @@ label_BFC1175C: psx_cyc_step(cpu, 0x8Au); #endif /* 0xBFC11790: 0067082B sltu $at, $v1, $a3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0067082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001C90u); #endif @@ -229124,7 +229588,8 @@ label_BFC117E8: psx_cyc_step(cpu, 0x46u); #endif /* 0xBFC117EC: 0046082B sltu $at, $v0, $a2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0046082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001CECu); #endif @@ -229340,7 +229805,8 @@ label_BFC11800: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC11834: 01C2082B sltu $at, $t6, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01C2082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001D34u); #endif @@ -229583,7 +230049,8 @@ label_BFC11870: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC11874: 0062082B sltu $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001D74u); #endif @@ -230117,7 +230584,8 @@ label_BFC1191C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1191C: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001E1Cu); #endif @@ -230245,7 +230713,8 @@ label_BFC11944: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC11944: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001E44u); #endif @@ -230725,7 +231194,8 @@ label_BFC119C8: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC119C8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001EC8u); #endif @@ -230970,7 +231440,8 @@ label_BFC11A10: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC11A10: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001F10u); #endif @@ -231172,7 +231643,8 @@ label_BFC11A4C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC11A4C: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x00001F4Cu); #endif @@ -231502,7 +231974,8 @@ label_BFC11A88: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC11ABC: 01C2082B sltu $at, $t6, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01C2082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00001FBCu); #endif @@ -231752,7 +232225,8 @@ label_BFC11AFC: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC11B00: 0062082B sltu $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002000u); #endif @@ -232289,7 +232763,8 @@ label_BFC11BA8: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC11BA8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x000020A8u); #endif @@ -232434,7 +232909,8 @@ label_BFC11BD4: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC11BD8: 3063FFFF andi $v1, $v1, 0xFFFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + PGXP_ALU(0x3063FFFFu, cpu->gpr[3], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x000020D8u); #endif @@ -233318,7 +233794,8 @@ label_BFC11C8C: psx_cyc_step(cpu, 0x100C000u); #endif /* 0xBFC11CA8: 01CFC024 and $t8, $t6, $t7 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + PGXP_ALU(0x01CFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000021A8u); #endif @@ -233326,7 +233803,8 @@ label_BFC11C8C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC11CAC: 33190004 andi $t9, $t8, 0x4 */ - cpu->gpr[25] = cpu->gpr[24] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x4u; + PGXP_ALU(0x33190004u, cpu->gpr[25], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x000021ACu); #endif @@ -233490,7 +233968,8 @@ label_BFC11CD4: psx_cyc_step(cpu, 0x700u); #endif /* 0xBFC11CE0: 01095024 and $t2, $t0, $t1 */ - cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + PGXP_ALU(0x01095024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000021E0u); #endif @@ -233498,7 +233977,8 @@ label_BFC11CD4: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC11CE4: 314B0200 andi $t3, $t2, 0x200 */ - cpu->gpr[11] = cpu->gpr[10] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x200u; + PGXP_ALU(0x314B0200u, cpu->gpr[11], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0x000021E4u); #endif @@ -233653,7 +234133,8 @@ label_BFC11D0C: psx_cyc_step(cpu, 0x7000u); #endif /* 0xBFC11D18: 018D7024 and $t6, $t4, $t5 */ - cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + PGXP_ALU(0x018D7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002218u); #endif @@ -233661,7 +234142,8 @@ label_BFC11D0C: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC11D1C: 31CF0002 andi $t7, $t6, 0x2 */ - cpu->gpr[15] = cpu->gpr[14] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x2u; + PGXP_ALU(0x31CF0002u, cpu->gpr[15], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x0000221Cu); #endif @@ -233825,7 +234307,8 @@ label_BFC11D44: psx_cyc_step(cpu, 0x3000100u); #endif /* 0xBFC11D50: 03194024 and $t0, $t8, $t9 */ - cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + PGXP_ALU(0x03194024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002250u); #endif @@ -233833,7 +234316,8 @@ label_BFC11D44: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC11D54: 31090400 andi $t1, $t0, 0x400 */ - cpu->gpr[9] = cpu->gpr[8] & 0x400u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x400u; + PGXP_ALU(0x31090400u, cpu->gpr[9], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x00002254u); #endif @@ -233988,7 +234472,8 @@ label_BFC11D7C: psx_cyc_step(cpu, 0x1C00u); #endif /* 0xBFC11D88: 014B6024 and $t4, $t2, $t3 */ - cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + PGXP_ALU(0x014B6024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002288u); #endif @@ -233996,7 +234481,8 @@ label_BFC11D7C: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC11D8C: 318D0100 andi $t5, $t4, 0x100 */ - cpu->gpr[13] = cpu->gpr[12] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x100u; + PGXP_ALU(0x318D0100u, cpu->gpr[13], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x0000228Cu); #endif @@ -234160,7 +234646,8 @@ label_BFC11DB4: psx_cyc_step(cpu, 0x100C000u); #endif /* 0xBFC11DC0: 01CFC024 and $t8, $t6, $t7 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + PGXP_ALU(0x01CFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000022C0u); #endif @@ -234168,7 +234655,8 @@ label_BFC11DB4: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC11DC4: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x000022C4u); #endif @@ -234323,7 +234811,8 @@ label_BFC11DEC: psx_cyc_step(cpu, 0x700u); #endif /* 0xBFC11DF8: 01095024 and $t2, $t0, $t1 */ - cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + PGXP_ALU(0x01095024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000022F8u); #endif @@ -234331,7 +234820,8 @@ label_BFC11DEC: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC11DFC: 314B0010 andi $t3, $t2, 0x10 */ - cpu->gpr[11] = cpu->gpr[10] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x10u; + PGXP_ALU(0x314B0010u, cpu->gpr[11], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000022FCu); #endif @@ -234495,7 +234985,8 @@ label_BFC11E24: psx_cyc_step(cpu, 0x7000u); #endif /* 0xBFC11E30: 018D7024 and $t6, $t4, $t5 */ - cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + PGXP_ALU(0x018D7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002330u); #endif @@ -234503,7 +234994,8 @@ label_BFC11E24: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC11E34: 31CF0020 andi $t7, $t6, 0x20 */ - cpu->gpr[15] = cpu->gpr[14] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x20u; + PGXP_ALU(0x31CF0020u, cpu->gpr[15], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x00002334u); #endif @@ -234658,7 +235150,8 @@ label_BFC11E5C: psx_cyc_step(cpu, 0x3000100u); #endif /* 0xBFC11E68: 03194024 and $t0, $t8, $t9 */ - cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + PGXP_ALU(0x03194024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002368u); #endif @@ -234666,7 +235159,8 @@ label_BFC11E5C: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC11E6C: 31090040 andi $t1, $t0, 0x40 */ - cpu->gpr[9] = cpu->gpr[8] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x40u; + PGXP_ALU(0x31090040u, cpu->gpr[9], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x0000236Cu); #endif @@ -234830,7 +235324,8 @@ label_BFC11E94: psx_cyc_step(cpu, 0x1C00u); #endif /* 0xBFC11EA0: 014B6024 and $t4, $t2, $t3 */ - cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + PGXP_ALU(0x014B6024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000023A0u); #endif @@ -234838,7 +235333,8 @@ label_BFC11E94: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC11EA4: 318D0080 andi $t5, $t4, 0x80 */ - cpu->gpr[13] = cpu->gpr[12] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x80u; + PGXP_ALU(0x318D0080u, cpu->gpr[13], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000023A4u); #endif @@ -234993,7 +235489,8 @@ label_BFC11ECC: psx_cyc_step(cpu, 0x100C000u); #endif /* 0xBFC11ED8: 01CFC024 and $t8, $t6, $t7 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + PGXP_ALU(0x01CFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000023D8u); #endif @@ -235001,7 +235498,8 @@ label_BFC11ECC: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC11EDC: 33190008 andi $t9, $t8, 0x8 */ - cpu->gpr[25] = cpu->gpr[24] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x8u; + PGXP_ALU(0x33190008u, cpu->gpr[25], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x000023DCu); #endif @@ -235345,7 +235843,8 @@ label_BFC11F40: psx_cyc_step(cpu, 0x811u); #endif /* 0xBFC11F40: 00805827 nor $t3, $a0, $zero */ - cpu->gpr[11] = ~(cpu->gpr[4] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[11] = ~(cpu->gpr[4] | cpu->gpr[0]); + PGXP_ALU(0x00805827u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002440u); #endif @@ -235561,7 +236060,8 @@ label_BFC11F58: psx_cyc_step(cpu, 0x100C000u); #endif /* 0xBFC11F74: 01CFC024 and $t8, $t6, $t7 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + PGXP_ALU(0x01CFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002474u); #endif @@ -235569,7 +236069,8 @@ label_BFC11F58: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC11F78: 33190004 andi $t9, $t8, 0x4 */ - cpu->gpr[25] = cpu->gpr[24] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x4u; + PGXP_ALU(0x33190004u, cpu->gpr[25], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00002478u); #endif @@ -235727,7 +236228,8 @@ label_BFC11FA0: psx_cyc_step(cpu, 0x700u); #endif /* 0xBFC11FAC: 01095024 and $t2, $t0, $t1 */ - cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + PGXP_ALU(0x01095024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000024ACu); #endif @@ -235738,7 +236240,8 @@ label_BFC11FA0: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC11FB0: 314B0200 andi $t3, $t2, 0x200 */ - cpu->gpr[11] = cpu->gpr[10] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x200u; + PGXP_ALU(0x314B0200u, cpu->gpr[11], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0x000024B0u); #endif @@ -235899,7 +236402,8 @@ label_BFC11FD8: psx_cyc_step(cpu, 0x7000u); #endif /* 0xBFC11FE4: 018D7024 and $t6, $t4, $t5 */ - cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + PGXP_ALU(0x018D7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000024E4u); #endif @@ -235907,7 +236411,8 @@ label_BFC11FD8: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC11FE8: 31CF0002 andi $t7, $t6, 0x2 */ - cpu->gpr[15] = cpu->gpr[14] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x2u; + PGXP_ALU(0x31CF0002u, cpu->gpr[15], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x000024E8u); #endif @@ -236065,7 +236570,8 @@ label_BFC12010: psx_cyc_step(cpu, 0x3000100u); #endif /* 0xBFC1201C: 03194024 and $t0, $t8, $t9 */ - cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + PGXP_ALU(0x03194024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000251Cu); #endif @@ -236076,7 +236582,8 @@ label_BFC12010: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC12020: 31090400 andi $t1, $t0, 0x400 */ - cpu->gpr[9] = cpu->gpr[8] & 0x400u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x400u; + PGXP_ALU(0x31090400u, cpu->gpr[9], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x00002520u); #endif @@ -236237,7 +236744,8 @@ label_BFC12048: psx_cyc_step(cpu, 0x1C00u); #endif /* 0xBFC12054: 014B6024 and $t4, $t2, $t3 */ - cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + PGXP_ALU(0x014B6024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002554u); #endif @@ -236245,7 +236753,8 @@ label_BFC12048: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC12058: 318D0100 andi $t5, $t4, 0x100 */ - cpu->gpr[13] = cpu->gpr[12] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x100u; + PGXP_ALU(0x318D0100u, cpu->gpr[13], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x00002558u); #endif @@ -236403,7 +236912,8 @@ label_BFC12080: psx_cyc_step(cpu, 0x100C000u); #endif /* 0xBFC1208C: 01CFC024 and $t8, $t6, $t7 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + PGXP_ALU(0x01CFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000258Cu); #endif @@ -236414,7 +236924,8 @@ label_BFC12080: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC12090: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00002590u); #endif @@ -236575,7 +237086,8 @@ label_BFC120B8: psx_cyc_step(cpu, 0x700u); #endif /* 0xBFC120C4: 01095024 and $t2, $t0, $t1 */ - cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + PGXP_ALU(0x01095024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000025C4u); #endif @@ -236583,7 +237095,8 @@ label_BFC120B8: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC120C8: 314B0010 andi $t3, $t2, 0x10 */ - cpu->gpr[11] = cpu->gpr[10] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x10u; + PGXP_ALU(0x314B0010u, cpu->gpr[11], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000025C8u); #endif @@ -236741,7 +237254,8 @@ label_BFC120F0: psx_cyc_step(cpu, 0x7000u); #endif /* 0xBFC120FC: 018D7024 and $t6, $t4, $t5 */ - cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + PGXP_ALU(0x018D7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000025FCu); #endif @@ -236752,7 +237266,8 @@ label_BFC120F0: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC12100: 31CF0020 andi $t7, $t6, 0x20 */ - cpu->gpr[15] = cpu->gpr[14] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x20u; + PGXP_ALU(0x31CF0020u, cpu->gpr[15], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x00002600u); #endif @@ -236913,7 +237428,8 @@ label_BFC12128: psx_cyc_step(cpu, 0x3000100u); #endif /* 0xBFC12134: 03194024 and $t0, $t8, $t9 */ - cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + PGXP_ALU(0x03194024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002634u); #endif @@ -236921,7 +237437,8 @@ label_BFC12128: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC12138: 31090040 andi $t1, $t0, 0x40 */ - cpu->gpr[9] = cpu->gpr[8] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x40u; + PGXP_ALU(0x31090040u, cpu->gpr[9], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x00002638u); #endif @@ -237079,7 +237596,8 @@ label_BFC12160: psx_cyc_step(cpu, 0x1C00u); #endif /* 0xBFC1216C: 014B6024 and $t4, $t2, $t3 */ - cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + PGXP_ALU(0x014B6024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000266Cu); #endif @@ -237090,7 +237608,8 @@ label_BFC12160: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC12170: 318D0080 andi $t5, $t4, 0x80 */ - cpu->gpr[13] = cpu->gpr[12] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x80u; + PGXP_ALU(0x318D0080u, cpu->gpr[13], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00002670u); #endif @@ -237251,7 +237770,8 @@ label_BFC12198: psx_cyc_step(cpu, 0x100C000u); #endif /* 0xBFC121A4: 01CFC024 and $t8, $t6, $t7 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + PGXP_ALU(0x01CFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000026A4u); #endif @@ -237259,7 +237779,8 @@ label_BFC12198: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC121A8: 33190008 andi $t9, $t8, 0x8 */ - cpu->gpr[25] = cpu->gpr[24] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x8u; + PGXP_ALU(0x33190008u, cpu->gpr[25], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x000026A8u); #endif @@ -237597,7 +238118,8 @@ label_BFC1220C: psx_cyc_step(cpu, 0x811u); #endif /* 0xBFC1220C: 00805827 nor $t3, $a0, $zero */ - cpu->gpr[11] = ~(cpu->gpr[4] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[11] = ~(cpu->gpr[4] | cpu->gpr[0]); + PGXP_ALU(0x00805827u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000270Cu); #endif @@ -241614,7 +242136,8 @@ label_BFC12670: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC12680: 33190010 andi $t9, $t8, 0x10 */ - cpu->gpr[25] = cpu->gpr[24] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x10u; + PGXP_ALU(0x33190010u, cpu->gpr[25], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00002B80u); #endif @@ -241855,7 +242378,8 @@ label_BFC126B8: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC126D4: 318D0004 andi $t5, $t4, 0x4 */ - cpu->gpr[13] = cpu->gpr[12] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x4u; + PGXP_ALU(0x318D0004u, cpu->gpr[13], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00002BD4u); #endif @@ -242890,7 +243414,8 @@ label_BFC127DC: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC127EC: 33190010 andi $t9, $t8, 0x10 */ - cpu->gpr[25] = cpu->gpr[24] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x10u; + PGXP_ALU(0x33190010u, cpu->gpr[25], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x00002CECu); #endif @@ -243131,7 +243656,8 @@ label_BFC12824: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC12840: 318D0004 andi $t5, $t4, 0x4 */ - cpu->gpr[13] = cpu->gpr[12] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x4u; + PGXP_ALU(0x318D0004u, cpu->gpr[13], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00002D40u); #endif @@ -245110,7 +245636,8 @@ label_BFC12A5C: psx_cyc_step(cpu, 0x100000Au); #endif /* 0xBFC12A5C: 0061C024 and $t8, $v1, $at */ - cpu->gpr[24] = cpu->gpr[3] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[3] & cpu->gpr[1]; + PGXP_ALU(0x0061C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00002F5Cu); #endif @@ -246215,7 +246742,8 @@ label_BFC12B90: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC12B94: 0062082B sltu $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003094u); #endif @@ -246423,7 +246951,8 @@ label_BFC12BC8: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC12BCC: 28810010 slti $at, $a0, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (16) ? 1 : 0); + PGXP_ALU(0x28810010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000030CCu); #endif @@ -246844,7 +247373,8 @@ label_BFC12C08: psx_cyc_step(cpu, 0x3000002u); #endif /* 0xBFC12C40: 0319082B sltu $at, $t8, $t9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0319082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003140u); #endif @@ -247151,7 +247681,8 @@ label_BFC12C7C: psx_cyc_step(cpu, 0x10402u); #endif /* 0xBFC12C98: 020A082B sltu $at, $s0, $t2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x020A082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003198u); #endif @@ -248112,7 +248643,8 @@ label_BFC12D8C: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC12DAC: 316C0044 andi $t4, $t3, 0x44 */ - cpu->gpr[12] = cpu->gpr[11] & 0x44u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x44u; + PGXP_ALU(0x316C0044u, cpu->gpr[12], _pgx1, 0x0044u); } #ifdef PSX_COSIM cosim_instr(0x000032ACu); #endif @@ -248217,7 +248749,8 @@ label_BFC12DBC: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC12DD0: 31F80044 andi $t8, $t7, 0x44 */ - cpu->gpr[24] = cpu->gpr[15] & 0x44u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x44u; + PGXP_ALU(0x31F80044u, cpu->gpr[24], _pgx1, 0x0044u); } #ifdef PSX_COSIM cosim_instr(0x000032D0u); #endif @@ -248434,7 +248967,8 @@ label_BFC12E04: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC12E18: 316C0004 andi $t4, $t3, 0x4 */ - cpu->gpr[12] = cpu->gpr[11] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x4u; + PGXP_ALU(0x316C0004u, cpu->gpr[12], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00003318u); #endif @@ -248971,7 +249505,8 @@ label_BFC12EA4: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC12EAC: 2CC10010 sltiu $at, $a2, 16 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < 0x00000010u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < 0x00000010u ? 1 : 0); + PGXP_ALU(0x2CC10010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000033ACu); #endif @@ -249031,7 +249566,8 @@ label_BFC12EBC: psx_cyc_step(cpu, 0x82u); #endif /* 0xBFC12EBC: 2CE10010 sltiu $at, $a3, 16 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[7] < 0x00000010u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)(cpu->gpr[7] < 0x00000010u ? 1 : 0); + PGXP_ALU(0x2CE10010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x000033BCu); #endif @@ -249656,7 +250192,8 @@ label_BFC12F7C: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC12F80: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003480u); #endif @@ -249732,7 +250269,8 @@ label_BFC12F8C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC12F9C: 30420002 andi $v0, $v0, 0x2 */ - cpu->gpr[2] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30420002u, cpu->gpr[2], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x0000349Cu); #endif @@ -249743,7 +250281,8 @@ label_BFC12F8C: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC12FA0: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000034A0u); #endif @@ -250066,7 +250605,8 @@ label_BFC12FF4: psx_cyc_step(cpu, 0x3000002u); #endif /* 0xBFC13008: 0319082B sltu $at, $t8, $t9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0319082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003508u); #endif @@ -250084,7 +250624,8 @@ label_BFC12FF4: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC13010: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00003510u); #endif @@ -250248,7 +250789,8 @@ label_BFC1302C: psx_cyc_step(cpu, 0x400Au); #endif /* 0xBFC13038: 006E082B sltu $at, $v1, $t6 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x006E082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003538u); #endif @@ -256481,7 +257023,8 @@ label_BFC1372C: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC13758: 0058082B sltu $at, $v0, $t8 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x0058082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003C58u); #endif @@ -256890,7 +257433,8 @@ label_BFC137BC: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC137C0: 0062082B sltu $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003CC0u); #endif @@ -257184,7 +257728,8 @@ label_BFC137E0: psx_cyc_step(cpu, 0x3000002u); #endif /* 0xBFC13818: 0319082B sltu $at, $t8, $t9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0319082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003D18u); #endif @@ -257554,7 +258099,8 @@ label_BFC13868: psx_cyc_step(cpu, 0x10802u); #endif /* 0xBFC13884: 020B082B sltu $at, $s0, $t3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x020B082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003D84u); #endif @@ -257823,7 +258369,8 @@ label_BFC138AC: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC138DC: 0058082B sltu $at, $v0, $t8 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x0058082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003DDCu); #endif @@ -258116,7 +258663,8 @@ label_BFC13934: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC13938: 0202082B sltu $at, $s0, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0202082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003E38u); #endif @@ -258496,7 +259044,8 @@ label_BFC139A8: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC139B0: 31CF1000 andi $t7, $t6, 0x1000 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1000u; + PGXP_ALU(0x31CF1000u, cpu->gpr[15], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x00003EB0u); #endif @@ -258654,7 +259203,8 @@ label_BFC139DC: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC139E0: 0211082B sltu $at, $s0, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0211082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003EE0u); #endif @@ -258913,7 +259463,8 @@ label_BFC13A1C: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC13A24: 304E0001 andi $t6, $v0, 0x1 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00003F24u); #endif @@ -258960,7 +259511,8 @@ label_BFC13A30: psx_cyc_step(cpu, 0x8040u); #endif /* 0xBFC13A30: 30CF00FF andi $t7, $a2, 0xFF */ - cpu->gpr[15] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00003F30u); #endif @@ -259016,7 +259568,8 @@ label_BFC13A40: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC13A40: 30580004 andi $t8, $v0, 0x4 */ - cpu->gpr[24] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30580004u, cpu->gpr[24], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00003F40u); #endif @@ -259031,7 +259584,8 @@ label_BFC13A40: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC13A48: 30C2007F andi $v0, $a2, 0x7F */ - cpu->gpr[2] = cpu->gpr[6] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[6] & 0x7Fu; + PGXP_ALU(0x30C2007Fu, cpu->gpr[2], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x00003F48u); #endif @@ -259151,7 +259705,8 @@ label_BFC13A68: psx_cyc_step(cpu, 0x44u); #endif /* 0xBFC13A68: 30C2007F andi $v0, $a2, 0x7F */ - cpu->gpr[2] = cpu->gpr[6] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[2] = cpu->gpr[6] & 0x7Fu; + PGXP_ALU(0x30C2007Fu, cpu->gpr[2], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x00003F68u); #endif @@ -259426,7 +259981,8 @@ label_BFC13AAC: psx_cyc_step(cpu, 0xC02u); #endif /* 0xBFC13AB4: 01415824 and $t3, $t2, $at */ - cpu->gpr[11] = cpu->gpr[10] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[11] = cpu->gpr[10] & cpu->gpr[1]; + PGXP_ALU(0x01415824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00003FB4u); #endif @@ -259488,7 +260044,8 @@ label_BFC13AC0: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC13AC8: 318D0002 andi $t5, $t4, 0x2 */ - cpu->gpr[13] = cpu->gpr[12] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x2u; + PGXP_ALU(0x318D0002u, cpu->gpr[13], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00003FC8u); #endif @@ -259741,7 +260298,8 @@ label_BFC13B08: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC13B10: 3042007F andi $v0, $v0, 0x7F */ - cpu->gpr[2] = cpu->gpr[2] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x7Fu; + PGXP_ALU(0x3042007Fu, cpu->gpr[2], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x00004010u); #endif @@ -259996,7 +260554,8 @@ label_BFC13B4C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC13B50: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00004050u); #endif @@ -260421,7 +260980,8 @@ label_BFC13BAC: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC13BC0: 31F80007 andi $t8, $t7, 0x7 */ - cpu->gpr[24] = cpu->gpr[15] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x7u; + PGXP_ALU(0x31F80007u, cpu->gpr[24], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x000040C0u); #endif @@ -260638,7 +261198,8 @@ label_BFC13BE4: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC13BF4: 31090097 andi $t1, $t0, 0x97 */ - cpu->gpr[9] = cpu->gpr[8] & 0x97u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x97u; + PGXP_ALU(0x31090097u, cpu->gpr[9], _pgx1, 0x0097u); } #ifdef PSX_COSIM cosim_instr(0x000040F4u); #endif @@ -261581,7 +262142,8 @@ label_BFC13CEC: psx_cyc_step(cpu, 0x60002u); #endif /* 0xBFC13CF0: 0251082B sltu $at, $s2, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[18] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[18] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0251082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000041F0u); #endif @@ -261620,7 +262182,8 @@ label_BFC13CF4: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC13CF8: 308E00FF andi $t6, $a0, 0xFF */ - cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000041F8u); #endif @@ -261698,7 +262261,8 @@ label_BFC13D04: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC13D08: 0230082B sltu $at, $s1, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00004208u); #endif @@ -261987,7 +262551,8 @@ label_BFC13D4C: psx_cyc_step(cpu, 0x60002u); #endif /* 0xBFC13D4C: 0251082B sltu $at, $s2, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[18] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[18] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0251082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x0000424Cu); #endif @@ -262212,7 +262777,8 @@ label_BFC13D7C: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC13D80: 308E00FF andi $t6, $a0, 0xFF */ - cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00004280u); #endif @@ -262265,7 +262831,8 @@ label_BFC13D84: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC13D94: 31F80097 andi $t8, $t7, 0x97 */ - cpu->gpr[24] = cpu->gpr[15] & 0x97u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x97u; + PGXP_ALU(0x31F80097u, cpu->gpr[24], _pgx1, 0x0097u); } #ifdef PSX_COSIM cosim_instr(0x00004294u); #endif @@ -262321,7 +262888,8 @@ label_BFC13DA0: psx_cyc_step(cpu, 0x2020002u); #endif /* 0xBFC13DA4: 0239082B sltu $at, $s1, $t9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0239082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000042A4u); #endif @@ -263011,7 +263579,8 @@ label_BFC13E60: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC13E68: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00004368u); #endif @@ -264508,7 +265077,8 @@ label_BFC14048: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC14060: 31AE0001 andi $t6, $t5, 0x1 */ - cpu->gpr[14] = cpu->gpr[13] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x1u; + PGXP_ALU(0x31AE0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00004560u); #endif @@ -264573,7 +265143,8 @@ label_BFC1406C: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC14074: 31F80001 andi $t8, $t7, 0x1 */ - cpu->gpr[24] = cpu->gpr[15] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x1u; + PGXP_ALU(0x31F80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00004574u); #endif @@ -264768,7 +265339,8 @@ label_BFC14090: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC140B8: 314B0002 andi $t3, $t2, 0x2 */ - cpu->gpr[11] = cpu->gpr[10] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x2u; + PGXP_ALU(0x314B0002u, cpu->gpr[11], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x000045B8u); #endif @@ -264832,7 +265404,8 @@ label_BFC140C4: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC140CC: 318D0002 andi $t5, $t4, 0x2 */ - cpu->gpr[13] = cpu->gpr[12] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x2u; + PGXP_ALU(0x318D0002u, cpu->gpr[13], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x000045CCu); #endif @@ -264938,7 +265511,8 @@ label_BFC140E4: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC140EC: 31CF0080 andi $t7, $t6, 0x80 */ - cpu->gpr[15] = cpu->gpr[14] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x80u; + PGXP_ALU(0x31CF0080u, cpu->gpr[15], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000045ECu); #endif @@ -265014,7 +265588,8 @@ label_BFC140FC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC14100: 28420051 slti $v0, $v0, 81 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + PGXP_ALU(0x28420051u, cpu->gpr[2], _pgx1, 0x0051u); } #ifdef PSX_COSIM cosim_instr(0x00004600u); #endif @@ -265022,7 +265597,8 @@ label_BFC140FC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC14104: 38420001 xori $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + PGXP_ALU(0x38420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00004604u); #endif @@ -265096,7 +265672,8 @@ label_BFC14114: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC1411C: 31090080 andi $t1, $t0, 0x80 */ - cpu->gpr[9] = cpu->gpr[8] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x80u; + PGXP_ALU(0x31090080u, cpu->gpr[9], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x0000461Cu); #endif @@ -265279,7 +265856,8 @@ label_BFC14138: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC14158: 31AE0002 andi $t6, $t5, 0x2 */ - cpu->gpr[14] = cpu->gpr[13] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x2u; + PGXP_ALU(0x31AE0002u, cpu->gpr[14], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00004658u); #endif @@ -265343,7 +265921,8 @@ label_BFC14164: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC1416C: 31F80002 andi $t8, $t7, 0x2 */ - cpu->gpr[24] = cpu->gpr[15] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x2u; + PGXP_ALU(0x31F80002u, cpu->gpr[24], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x0000466Cu); #endif @@ -265429,7 +266008,8 @@ label_BFC14178: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC14188: 3043000F andi $v1, $v0, 0xF */ - cpu->gpr[3] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3043000Fu, cpu->gpr[3], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x00004688u); #endif @@ -265555,7 +266135,8 @@ label_BFC141A8: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC141B0: 312A0080 andi $t2, $t1, 0x80 */ - cpu->gpr[10] = cpu->gpr[9] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x80u; + PGXP_ALU(0x312A0080u, cpu->gpr[10], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000046B0u); #endif @@ -265624,7 +266205,8 @@ label_BFC141C0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC141C4: 28420051 slti $v0, $v0, 81 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + PGXP_ALU(0x28420051u, cpu->gpr[2], _pgx1, 0x0051u); } #ifdef PSX_COSIM cosim_instr(0x000046C4u); #endif @@ -265632,7 +266214,8 @@ label_BFC141C0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC141C8: 38420001 xori $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + PGXP_ALU(0x38420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x000046C8u); #endif @@ -265709,7 +266292,8 @@ label_BFC141D8: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC141E0: 31AE0080 andi $t6, $t5, 0x80 */ - cpu->gpr[14] = cpu->gpr[13] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x80u; + PGXP_ALU(0x31AE0080u, cpu->gpr[14], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000046E0u); #endif @@ -265877,7 +266461,8 @@ label_BFC141FC: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC1421C: 33280002 andi $t0, $t9, 0x2 */ - cpu->gpr[8] = cpu->gpr[25] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x2u; + PGXP_ALU(0x33280002u, cpu->gpr[8], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x0000471Cu); #endif @@ -265944,7 +266529,8 @@ label_BFC14228: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC14230: 312A0002 andi $t2, $t1, 0x2 */ - cpu->gpr[10] = cpu->gpr[9] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x2u; + PGXP_ALU(0x312A0002u, cpu->gpr[10], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00004730u); #endif @@ -266121,7 +266707,8 @@ label_BFC1425C: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC14264: 316C0080 andi $t4, $t3, 0x80 */ - cpu->gpr[12] = cpu->gpr[11] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x80u; + PGXP_ALU(0x316C0080u, cpu->gpr[12], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00004764u); #endif @@ -266190,7 +266777,8 @@ label_BFC14274: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC14278: 28420051 slti $v0, $v0, 81 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + PGXP_ALU(0x28420051u, cpu->gpr[2], _pgx1, 0x0051u); } #ifdef PSX_COSIM cosim_instr(0x00004778u); #endif @@ -266198,7 +266786,8 @@ label_BFC14274: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1427C: 38420001 xori $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + PGXP_ALU(0x38420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x0000477Cu); #endif @@ -266275,7 +266864,8 @@ label_BFC1428C: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC14294: 31F80080 andi $t8, $t7, 0x80 */ - cpu->gpr[24] = cpu->gpr[15] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x80u; + PGXP_ALU(0x31F80080u, cpu->gpr[24], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00004794u); #endif @@ -266335,7 +266925,8 @@ label_BFC142A0: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC142A8: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000047A8u); #endif @@ -266385,7 +266976,8 @@ label_BFC142B4: psx_cyc_step(cpu, 0x200005u); #endif /* 0xBFC142B4: 0015102B sltu $v0, $zero, $s5 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0015102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000047B4u); #endif @@ -266526,7 +267118,8 @@ label_BFC142C8: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC142E8: 312A0002 andi $t2, $t1, 0x2 */ - cpu->gpr[10] = cpu->gpr[9] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x2u; + PGXP_ALU(0x312A0002u, cpu->gpr[10], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x000047E8u); #endif @@ -266590,7 +267183,8 @@ label_BFC142F4: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC142FC: 316C0080 andi $t4, $t3, 0x80 */ - cpu->gpr[12] = cpu->gpr[11] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x80u; + PGXP_ALU(0x316C0080u, cpu->gpr[12], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000047FCu); #endif @@ -266657,7 +267251,8 @@ label_BFC14308: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC14310: 31AE0002 andi $t6, $t5, 0x2 */ - cpu->gpr[14] = cpu->gpr[13] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x2u; + PGXP_ALU(0x31AE0002u, cpu->gpr[14], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00004810u); #endif @@ -266721,7 +267316,8 @@ label_BFC1431C: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC14324: 31F80002 andi $t8, $t7, 0x2 */ - cpu->gpr[24] = cpu->gpr[15] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x2u; + PGXP_ALU(0x31F80002u, cpu->gpr[24], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00004824u); #endif @@ -266827,7 +267423,8 @@ label_BFC1433C: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC14344: 33280002 andi $t0, $t9, 0x2 */ - cpu->gpr[8] = cpu->gpr[25] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x2u; + PGXP_ALU(0x33280002u, cpu->gpr[8], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00004844u); #endif @@ -266933,7 +267530,8 @@ label_BFC14350: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC1436C: 312A0080 andi $t2, $t1, 0x80 */ - cpu->gpr[10] = cpu->gpr[9] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x80u; + PGXP_ALU(0x312A0080u, cpu->gpr[10], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x0000486Cu); #endif @@ -267008,7 +267606,8 @@ label_BFC1437C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC14380: 28420051 slti $v0, $v0, 81 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + PGXP_ALU(0x28420051u, cpu->gpr[2], _pgx1, 0x0051u); } #ifdef PSX_COSIM cosim_instr(0x00004880u); #endif @@ -267016,7 +267615,8 @@ label_BFC1437C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC14384: 38420001 xori $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + PGXP_ALU(0x38420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00004884u); #endif @@ -267090,7 +267690,8 @@ label_BFC14394: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC1439C: 31AE0080 andi $t6, $t5, 0x80 */ - cpu->gpr[14] = cpu->gpr[13] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x80u; + PGXP_ALU(0x31AE0080u, cpu->gpr[14], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x0000489Cu); #endif @@ -267156,7 +267757,8 @@ label_BFC143A8: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC143B0: 0002102B sltu $v0, $zero, $v0 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0002102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000048B0u); #endif @@ -267203,7 +267805,8 @@ label_BFC143BC: psx_cyc_step(cpu, 0x200005u); #endif /* 0xBFC143BC: 0015102B sltu $v0, $zero, $s5 */ - cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[0]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[2] = (uint32_t)(cpu->gpr[0] < cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x0015102Bu, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000048BCu); #endif @@ -267341,7 +267944,8 @@ label_BFC143D0: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC143F0: 33280002 andi $t0, $t9, 0x2 */ - cpu->gpr[8] = cpu->gpr[25] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x2u; + PGXP_ALU(0x33280002u, cpu->gpr[8], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x000048F0u); #endif @@ -267405,7 +268009,8 @@ label_BFC143FC: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC14404: 312A0002 andi $t2, $t1, 0x2 */ - cpu->gpr[10] = cpu->gpr[9] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x2u; + PGXP_ALU(0x312A0002u, cpu->gpr[10], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00004904u); #endif @@ -268883,7 +269488,8 @@ label_BFC1454C: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC14560: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00004A60u); #endif @@ -268947,7 +269553,8 @@ label_BFC1456C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC14574: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00004A74u); #endif @@ -272918,7 +273525,8 @@ label_BFC149BC: psx_cyc_step(cpu, 0x610u); #endif /* 0xBFC149D4: 01245024 and $t2, $t1, $a0 */ - cpu->gpr[10] = cpu->gpr[9] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[10] = cpu->gpr[9] & cpu->gpr[4]; + PGXP_ALU(0x01245024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00004ED4u); #endif @@ -273138,7 +273746,8 @@ label_BFC14A0C: psx_cyc_step(cpu, 0x1810u); #endif /* 0xBFC14A24: 01646024 and $t4, $t3, $a0 */ - cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[4]; + PGXP_ALU(0x01646024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00004F24u); #endif @@ -273579,7 +274188,8 @@ label_BFC14A90: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC14AA8: 31CF0080 andi $t7, $t6, 0x80 */ - cpu->gpr[15] = cpu->gpr[14] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x80u; + PGXP_ALU(0x31CF0080u, cpu->gpr[15], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00004FA8u); #endif @@ -273643,7 +274253,8 @@ label_BFC14AB4: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC14ABC: 33190080 andi $t9, $t8, 0x80 */ - cpu->gpr[25] = cpu->gpr[24] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x80u; + PGXP_ALU(0x33190080u, cpu->gpr[25], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00004FBCu); #endif @@ -273766,7 +274377,8 @@ label_BFC14AD8: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC14AD8: 30480001 andi $t0, $v0, 0x1 */ - cpu->gpr[8] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30480001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00004FD8u); #endif @@ -274453,7 +275065,8 @@ label_BFC14B6C: psx_cyc_step(cpu, 0x1008010u); #endif /* 0xBFC14BA0: 01E4C024 and $t8, $t7, $a0 */ - cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[4]; + PGXP_ALU(0x01E4C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000050A0u); #endif @@ -274950,7 +275563,8 @@ label_BFC14C28: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC14C5C: 312A0001 andi $t2, $t1, 0x1 */ - cpu->gpr[10] = cpu->gpr[9] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x1u; + PGXP_ALU(0x312A0001u, cpu->gpr[10], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x0000515Cu); #endif @@ -275632,7 +276246,8 @@ label_BFC14CF4: psx_cyc_step(cpu, 0x8002u); #endif /* 0xBFC14D1C: 2DE1000A sltiu $at, $t7, 10 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2DE1000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x0000521Cu); #endif @@ -276008,7 +276623,8 @@ label_BFC14D58: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC14D7C: 312A000F andi $t2, $t1, 0xF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFu; + PGXP_ALU(0x312A000Fu, cpu->gpr[10], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x0000527Cu); #endif @@ -276512,7 +277128,8 @@ label_BFC14E40: psx_cyc_step(cpu, 0x208u); #endif /* 0xBFC14E40: 30690008 andi $t1, $v1, 0x8 */ - cpu->gpr[9] = cpu->gpr[3] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[9] = cpu->gpr[3] & 0x8u; + PGXP_ALU(0x30690008u, cpu->gpr[9], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x00005340u); #endif @@ -277009,7 +277626,8 @@ label_BFC14ED4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC14EE4: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000053E4u); #endif @@ -277257,7 +277875,8 @@ label_BFC14F2C: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC14F34: 30A300FF andi $v1, $a1, 0xFF */ - cpu->gpr[3] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[3] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00005434u); #endif @@ -277398,7 +278017,8 @@ label_BFC14F2C: psx_cyc_step(cpu, 0x308u); #endif /* 0xBFC14F74: 01034826 xor $t1, $t0, $v1 */ - cpu->gpr[9] = cpu->gpr[8] ^ cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[9] = cpu->gpr[8] ^ cpu->gpr[3]; + PGXP_ALU(0x01034826u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00005474u); #endif @@ -278144,7 +278764,8 @@ label_BFC15074: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC1507C: 31090002 andi $t1, $t0, 0x2 */ - cpu->gpr[9] = cpu->gpr[8] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x2u; + PGXP_ALU(0x31090002u, cpu->gpr[9], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x0000557Cu); #endif @@ -278211,7 +278832,8 @@ label_BFC15088: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC15090: 314B0002 andi $t3, $t2, 0x2 */ - cpu->gpr[11] = cpu->gpr[10] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x2u; + PGXP_ALU(0x314B0002u, cpu->gpr[11], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00005590u); #endif @@ -278366,7 +278988,8 @@ label_BFC150B0: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC150C4: 304E0004 andi $t6, $v0, 0x4 */ - cpu->gpr[14] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x304E0004u, cpu->gpr[14], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x000055C4u); #endif @@ -279264,7 +279887,8 @@ label_BFC15188: psx_cyc_step(cpu, 0x1000002u); #endif /* 0xBFC151C0: 2F01000D sltiu $at, $t8, 13 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < 0x0000000Du ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < 0x0000000Du ? 1 : 0); + PGXP_ALU(0x2F01000Du, cpu->gpr[1], _pgx1, 0x000Du); } #ifdef PSX_COSIM cosim_instr(0x000056C0u); #endif @@ -279593,7 +280217,8 @@ label_BFC151FC: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC15220: 312A000F andi $t2, $t1, 0xF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFu; + PGXP_ALU(0x312A000Fu, cpu->gpr[10], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x00005720u); #endif @@ -280126,7 +280751,8 @@ label_BFC152DC: psx_cyc_step(cpu, 0x210u); #endif /* 0xBFC152DC: 30890008 andi $t1, $a0, 0x8 */ - cpu->gpr[9] = cpu->gpr[4] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[9] = cpu->gpr[4] & 0x8u; + PGXP_ALU(0x30890008u, cpu->gpr[9], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x000057DCu); #endif @@ -280667,7 +281293,8 @@ label_BFC15370: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC15380: 332800FF andi $t0, $t9, 0xFF */ - cpu->gpr[8] = cpu->gpr[25] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0xFFu; + PGXP_ALU(0x332800FFu, cpu->gpr[8], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00005880u); #endif @@ -280860,7 +281487,8 @@ label_BFC153B4: psx_cyc_step(cpu, 0x2040u); #endif /* 0xBFC153BC: 30CD00FF andi $t5, $a2, 0xFF */ - cpu->gpr[13] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[13] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30CD00FFu, cpu->gpr[13], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000058BCu); #endif @@ -281643,7 +282271,8 @@ label_BFC15490: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC154BC: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000059BCu); #endif @@ -281765,7 +282394,8 @@ label_BFC154D0: psx_cyc_step(cpu, 0x4040u); #endif /* 0xBFC154D0: 30CE00FF andi $t6, $a2, 0xFF */ - cpu->gpr[14] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[14] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30CE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000059D0u); #endif @@ -281773,7 +282403,8 @@ label_BFC154D0: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC154D4: 31CF00FF andi $t7, $t6, 0xFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000059D4u); #endif @@ -281781,7 +282412,8 @@ label_BFC154D0: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC154D8: 305800FF andi $t8, $v0, 0xFF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000059D8u); #endif @@ -281819,7 +282451,8 @@ label_BFC154D0: psx_cyc_step(cpu, 0x3008000u); #endif /* 0xBFC154E8: 01F8C826 xor $t9, $t7, $t8 */ - cpu->gpr[25] = cpu->gpr[15] ^ cpu->gpr[24]; + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[15] ^ cpu->gpr[24]; + PGXP_ALU(0x01F8C826u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000059E8u); #endif @@ -282056,7 +282689,8 @@ label_BFC15508: psx_cyc_step(cpu, 0x4040u); #endif /* 0xBFC15534: 30CE00FF andi $t6, $a2, 0xFF */ - cpu->gpr[14] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[14] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30CE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00005A34u); #endif @@ -282453,7 +283087,8 @@ label_BFC15580: psx_cyc_step(cpu, 0x3800u); #endif /* 0xBFC155A4: 016C6826 xor $t5, $t3, $t4 */ - cpu->gpr[13] = cpu->gpr[11] ^ cpu->gpr[12]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[11] ^ cpu->gpr[12]; + PGXP_ALU(0x016C6826u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00005AA4u); #endif @@ -282803,7 +283438,8 @@ label_BFC15600: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC15608: 314B0002 andi $t3, $t2, 0x2 */ - cpu->gpr[11] = cpu->gpr[10] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x2u; + PGXP_ALU(0x314B0002u, cpu->gpr[11], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00005B08u); #endif @@ -282867,7 +283503,8 @@ label_BFC15614: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC1561C: 318D0002 andi $t5, $t4, 0x2 */ - cpu->gpr[13] = cpu->gpr[12] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x2u; + PGXP_ALU(0x318D0002u, cpu->gpr[13], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x00005B1Cu); #endif @@ -283295,7 +283932,8 @@ label_BFC15664: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC1567C: 2DC10004 sltiu $at, $t6, 4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000004u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000004u ? 1 : 0); + PGXP_ALU(0x2DC10004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00005B7Cu); #endif @@ -283627,7 +284265,8 @@ label_BFC156B8: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC156DC: 3328000F andi $t0, $t9, 0xF */ - cpu->gpr[8] = cpu->gpr[25] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0xFu; + PGXP_ALU(0x3328000Fu, cpu->gpr[8], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x00005BDCu); #endif @@ -284173,7 +284812,8 @@ label_BFC15798: psx_cyc_step(cpu, 0x2000008u); #endif /* 0xBFC15798: 30790004 andi $t9, $v1, 0x4 */ - cpu->gpr[25] = cpu->gpr[3] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[25] = cpu->gpr[3] & 0x4u; + PGXP_ALU(0x30790004u, cpu->gpr[25], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x00005C98u); #endif @@ -284458,7 +285098,8 @@ label_BFC157F0: psx_cyc_step(cpu, 0x808u); #endif /* 0xBFC157F0: 306B0008 andi $t3, $v1, 0x8 */ - cpu->gpr[11] = cpu->gpr[3] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[11] = cpu->gpr[3] & 0x8u; + PGXP_ALU(0x306B0008u, cpu->gpr[11], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x00005CF0u); #endif @@ -285818,7 +286459,8 @@ label_BFC15964: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC15974: 304F0001 andi $t7, $v0, 0x1 */ - cpu->gpr[15] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00005E74u); #endif @@ -285872,7 +286514,8 @@ label_BFC15980: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC15984: 28A10401 slti $at, $a1, 1025 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (1025) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (1025) ? 1 : 0); + PGXP_ALU(0x28A10401u, cpu->gpr[1], _pgx1, 0x0401u); } #ifdef PSX_COSIM cosim_instr(0x00005E84u); #endif @@ -286428,7 +287071,8 @@ label_BFC15A18: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC15A28: 304F0001 andi $t7, $v0, 0x1 */ - cpu->gpr[15] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00005F28u); #endif @@ -286485,7 +287129,8 @@ label_BFC15A34: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC15A38: 28A10401 slti $at, $a1, 1025 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (1025) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (1025) ? 1 : 0); + PGXP_ALU(0x28A10401u, cpu->gpr[1], _pgx1, 0x0401u); } #ifdef PSX_COSIM cosim_instr(0x00005F38u); #endif @@ -287038,7 +287683,8 @@ label_BFC15ACC: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC15ADC: 304F0001 andi $t7, $v0, 0x1 */ - cpu->gpr[15] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00005FDCu); #endif @@ -287544,7 +288190,8 @@ label_BFC15B7C: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC15B84: 304F0001 andi $t7, $v0, 0x1 */ - cpu->gpr[15] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x00006084u); #endif @@ -289028,7 +289675,8 @@ label_BFC15D18: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC15D28: 310900FF andi $t1, $t0, 0xFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00006228u); #endif @@ -289184,7 +289832,8 @@ label_BFC15D4C: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC15D64: 2DC10011 sltiu $at, $t6, 17 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2DC10011u, cpu->gpr[1], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x00006264u); #endif @@ -289245,7 +289894,8 @@ label_BFC15D70: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC15D78: 31F8FFBF andi $t8, $t7, 0xFFBF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFBFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFBFu; + PGXP_ALU(0x31F8FFBFu, cpu->gpr[24], _pgx1, 0xFFBFu); } #ifdef PSX_COSIM cosim_instr(0x00006278u); #endif @@ -289295,7 +289945,8 @@ label_BFC15D80: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC15D8C: 2D010011 sltiu $at, $t0, 17 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2D010011u, cpu->gpr[1], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x0000628Cu); #endif @@ -289362,7 +290013,8 @@ label_BFC15D98: psx_cyc_step(cpu, 0x2000200u); #endif /* 0xBFC15DA0: 3329FF7F andi $t1, $t9, 0xFF7F */ - cpu->gpr[9] = cpu->gpr[25] & 0xFF7Fu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[9] = cpu->gpr[25] & 0xFF7Fu; + PGXP_ALU(0x3329FF7Fu, cpu->gpr[9], _pgx1, 0xFF7Fu); } #ifdef PSX_COSIM cosim_instr(0x000062A0u); #endif @@ -289592,7 +290244,8 @@ label_BFC15DD8: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC15DE8: 31AE00FF andi $t6, $t5, 0xFF */ - cpu->gpr[14] = cpu->gpr[13] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0xFFu; + PGXP_ALU(0x31AE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x000062E8u); #endif @@ -289748,7 +290401,8 @@ label_BFC15E0C: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC15E24: 2D210011 sltiu $at, $t1, 17 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2D210011u, cpu->gpr[1], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x00006324u); #endif @@ -289809,7 +290463,8 @@ label_BFC15E30: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC15E38: 314BFFBF andi $t3, $t2, 0xFFBF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFBFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFBFu; + PGXP_ALU(0x314BFFBFu, cpu->gpr[11], _pgx1, 0xFFBFu); } #ifdef PSX_COSIM cosim_instr(0x00006338u); #endif @@ -289859,7 +290514,8 @@ label_BFC15E40: psx_cyc_step(cpu, 0x2002u); #endif /* 0xBFC15E4C: 2DA10011 sltiu $at, $t5, 17 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2DA10011u, cpu->gpr[1], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x0000634Cu); #endif @@ -289926,7 +290582,8 @@ label_BFC15E58: psx_cyc_step(cpu, 0x5000u); #endif /* 0xBFC15E60: 318EFF7F andi $t6, $t4, 0xFF7F */ - cpu->gpr[14] = cpu->gpr[12] & 0xFF7Fu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[14] = cpu->gpr[12] & 0xFF7Fu; + PGXP_ALU(0x318EFF7Fu, cpu->gpr[14], _pgx1, 0xFF7Fu); } #ifdef PSX_COSIM cosim_instr(0x00006360u); #endif @@ -290666,7 +291323,8 @@ label_BFC15F30: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC15F38: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00006438u); #endif @@ -290792,7 +291450,8 @@ label_BFC15F4C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC15F4C: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x0000644Cu); #endif @@ -291112,7 +291771,8 @@ label_BFC15F74: psx_cyc_step(cpu, 0x4000004u); #endif /* 0xBFC15FC0: 0342D026 xor $k0, $k0, $v0 */ - cpu->gpr[26] = cpu->gpr[26] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[26]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[26] = cpu->gpr[26] ^ cpu->gpr[2]; + PGXP_ALU(0x0342D026u, cpu->gpr[26], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x000064C0u); #endif @@ -291173,7 +291833,8 @@ label_BFC15F74: psx_cyc_step(cpu, 0x4000002u); #endif /* 0xBFC15FDC: 2F410080 sltiu $at, $k0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[26] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[26]; cpu->gpr[1] = (uint32_t)(cpu->gpr[26] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2F410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000064DCu); #endif @@ -291488,7 +292149,8 @@ label_BFC16014: psx_cyc_step(cpu, 0x4000004u); #endif /* 0xBFC16060: 0342D026 xor $k0, $k0, $v0 */ - cpu->gpr[26] = cpu->gpr[26] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[26]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[26] = cpu->gpr[26] ^ cpu->gpr[2]; + PGXP_ALU(0x0342D026u, cpu->gpr[26], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x00006560u); #endif @@ -291549,7 +292211,8 @@ label_BFC16014: psx_cyc_step(cpu, 0x4000002u); #endif /* 0xBFC1607C: 2F41007F sltiu $at, $k0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[26] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[26]; cpu->gpr[1] = (uint32_t)(cpu->gpr[26] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2F41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x0000657Cu); #endif @@ -292177,7 +292840,8 @@ label_BFC1618C: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC1619C: 2DC10004 sltiu $at, $t6, 4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000004u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000004u ? 1 : 0); + PGXP_ALU(0x2DC10004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x0000669Cu); #endif @@ -292347,7 +293011,8 @@ label_BFC161C4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC161CC: 2C410040 sltiu $at, $v0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C410040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x000066CCu); #endif @@ -292365,7 +293030,8 @@ label_BFC161C4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC161D4: 2C41007F sltiu $at, $v0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x000066D4u); #endif @@ -292404,7 +293070,8 @@ label_BFC161D8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC161DC: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000066DCu); #endif @@ -292476,7 +293143,8 @@ label_BFC161E8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC161E8: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x000066E8u); #endif @@ -292504,7 +293172,8 @@ label_BFC161EC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC161F0: 2C4100AD sltiu $at, $v0, 173 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000ADu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000ADu ? 1 : 0); + PGXP_ALU(0x2C4100ADu, cpu->gpr[1], _pgx1, 0x00ADu); } #ifdef PSX_COSIM cosim_instr(0x000066F0u); #endif @@ -292543,7 +293212,8 @@ label_BFC161F4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC161F8: 2C4100B8 sltiu $at, $v0, 184 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B8u ? 1 : 0); + PGXP_ALU(0x2C4100B8u, cpu->gpr[1], _pgx1, 0x00B8u); } #ifdef PSX_COSIM cosim_instr(0x000066F8u); #endif @@ -292618,7 +293288,8 @@ label_BFC16204: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16204: 2C4100B8 sltiu $at, $v0, 184 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B8u ? 1 : 0); + PGXP_ALU(0x2C4100B8u, cpu->gpr[1], _pgx1, 0x00B8u); } #ifdef PSX_COSIM cosim_instr(0x00006704u); #endif @@ -292643,7 +293314,8 @@ label_BFC16208: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1620C: 2C4100C0 sltiu $at, $v0, 192 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C0u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C0u ? 1 : 0); + PGXP_ALU(0x2C4100C0u, cpu->gpr[1], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0x0000670Cu); #endif @@ -292682,7 +293354,8 @@ label_BFC16210: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16214: 2C4100C8 sltiu $at, $v0, 200 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C8u ? 1 : 0); + PGXP_ALU(0x2C4100C8u, cpu->gpr[1], _pgx1, 0x00C8u); } #ifdef PSX_COSIM cosim_instr(0x00006714u); #endif @@ -292754,7 +293427,8 @@ label_BFC16220: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16220: 2C4100C8 sltiu $at, $v0, 200 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C8u ? 1 : 0); + PGXP_ALU(0x2C4100C8u, cpu->gpr[1], _pgx1, 0x00C8u); } #ifdef PSX_COSIM cosim_instr(0x00006720u); #endif @@ -292779,7 +293453,8 @@ label_BFC16224: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16228: 2C4100CF sltiu $at, $v0, 207 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000CFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000CFu ? 1 : 0); + PGXP_ALU(0x2C4100CFu, cpu->gpr[1], _pgx1, 0x00CFu); } #ifdef PSX_COSIM cosim_instr(0x00006728u); #endif @@ -292821,7 +293496,8 @@ label_BFC1622C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16230: 2C4100DA sltiu $at, $v0, 218 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000DAu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000DAu ? 1 : 0); + PGXP_ALU(0x2C4100DAu, cpu->gpr[1], _pgx1, 0x00DAu); } #ifdef PSX_COSIM cosim_instr(0x00006730u); #endif @@ -292893,7 +293569,8 @@ label_BFC1623C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1623C: 2C4100DA sltiu $at, $v0, 218 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000DAu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000DAu ? 1 : 0); + PGXP_ALU(0x2C4100DAu, cpu->gpr[1], _pgx1, 0x00DAu); } #ifdef PSX_COSIM cosim_instr(0x0000673Cu); #endif @@ -292918,7 +293595,8 @@ label_BFC16240: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16244: 2C4100E9 sltiu $at, $v0, 233 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000E9u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000E9u ? 1 : 0); + PGXP_ALU(0x2C4100E9u, cpu->gpr[1], _pgx1, 0x00E9u); } #ifdef PSX_COSIM cosim_instr(0x00006744u); #endif @@ -292957,7 +293635,8 @@ label_BFC16248: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1624C: 2C4100F0 sltiu $at, $v0, 240 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F0u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F0u ? 1 : 0); + PGXP_ALU(0x2C4100F0u, cpu->gpr[1], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x0000674Cu); #endif @@ -293029,7 +293708,8 @@ label_BFC16258: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16258: 2C4100F0 sltiu $at, $v0, 240 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F0u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F0u ? 1 : 0); + PGXP_ALU(0x2C4100F0u, cpu->gpr[1], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x00006758u); #endif @@ -293057,7 +293737,8 @@ label_BFC1625C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16260: 2C4100F8 sltiu $at, $v0, 248 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F8u ? 1 : 0); + PGXP_ALU(0x2C4100F8u, cpu->gpr[1], _pgx1, 0x00F8u); } #ifdef PSX_COSIM cosim_instr(0x00006760u); #endif @@ -293421,7 +294102,8 @@ label_BFC162B8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC162C0: 2C41004F sltiu $at, $v0, 79 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000004Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000004Fu ? 1 : 0); + PGXP_ALU(0x2C41004Fu, cpu->gpr[1], _pgx1, 0x004Fu); } #ifdef PSX_COSIM cosim_instr(0x000067C0u); #endif @@ -293436,7 +294118,8 @@ label_BFC162B8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC162C8: 2C410059 sltiu $at, $v0, 89 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000059u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000059u ? 1 : 0); + PGXP_ALU(0x2C410059u, cpu->gpr[1], _pgx1, 0x0059u); } #ifdef PSX_COSIM cosim_instr(0x000067C8u); #endif @@ -293478,7 +294161,8 @@ label_BFC162CC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC162D0: 2C410060 sltiu $at, $v0, 96 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000060u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000060u ? 1 : 0); + PGXP_ALU(0x2C410060u, cpu->gpr[1], _pgx1, 0x0060u); } #ifdef PSX_COSIM cosim_instr(0x000067D0u); #endif @@ -293550,7 +294234,8 @@ label_BFC162DC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC162DC: 2C410060 sltiu $at, $v0, 96 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000060u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000060u ? 1 : 0); + PGXP_ALU(0x2C410060u, cpu->gpr[1], _pgx1, 0x0060u); } #ifdef PSX_COSIM cosim_instr(0x000067DCu); #endif @@ -293575,7 +294260,8 @@ label_BFC162E0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC162E4: 2C41007A sltiu $at, $v0, 122 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Au ? 1 : 0); + PGXP_ALU(0x2C41007Au, cpu->gpr[1], _pgx1, 0x007Au); } #ifdef PSX_COSIM cosim_instr(0x000067E4u); #endif @@ -293614,7 +294300,8 @@ label_BFC162E8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC162EC: 2C410081 sltiu $at, $v0, 129 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000081u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000081u ? 1 : 0); + PGXP_ALU(0x2C410081u, cpu->gpr[1], _pgx1, 0x0081u); } #ifdef PSX_COSIM cosim_instr(0x000067ECu); #endif @@ -293686,7 +294373,8 @@ label_BFC162F8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC162F8: 2C410081 sltiu $at, $v0, 129 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000081u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000081u ? 1 : 0); + PGXP_ALU(0x2C410081u, cpu->gpr[1], _pgx1, 0x0081u); } #ifdef PSX_COSIM cosim_instr(0x000067F8u); #endif @@ -293714,7 +294402,8 @@ label_BFC162FC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16300: 2C41009B sltiu $at, $v0, 155 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Bu ? 1 : 0); + PGXP_ALU(0x2C41009Bu, cpu->gpr[1], _pgx1, 0x009Bu); } #ifdef PSX_COSIM cosim_instr(0x00006800u); #endif @@ -293753,7 +294442,8 @@ label_BFC16304: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16308: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x00006808u); #endif @@ -293828,7 +294518,8 @@ label_BFC16314: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16314: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x00006814u); #endif @@ -293853,7 +294544,8 @@ label_BFC16318: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1631C: 2C4100F2 sltiu $at, $v0, 242 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F2u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F2u ? 1 : 0); + PGXP_ALU(0x2C4100F2u, cpu->gpr[1], _pgx1, 0x00F2u); } #ifdef PSX_COSIM cosim_instr(0x0000681Cu); #endif @@ -293930,7 +294622,8 @@ label_BFC1632C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1632C: 2C4100F2 sltiu $at, $v0, 242 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F2u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F2u ? 1 : 0); + PGXP_ALU(0x2C4100F2u, cpu->gpr[1], _pgx1, 0x00F2u); } #ifdef PSX_COSIM cosim_instr(0x0000682Cu); #endif @@ -294178,7 +294871,8 @@ label_BFC16370: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16378: 2C410040 sltiu $at, $v0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C410040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x00006878u); #endif @@ -294196,7 +294890,8 @@ label_BFC16370: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16380: 2C41007F sltiu $at, $v0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x00006880u); #endif @@ -294235,7 +294930,8 @@ label_BFC16384: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16388: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00006888u); #endif @@ -294310,7 +295006,8 @@ label_BFC16394: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16394: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00006894u); #endif @@ -294335,7 +295032,8 @@ label_BFC16398: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1639C: 2C410097 sltiu $at, $v0, 151 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000097u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000097u ? 1 : 0); + PGXP_ALU(0x2C410097u, cpu->gpr[1], _pgx1, 0x0097u); } #ifdef PSX_COSIM cosim_instr(0x0000689Cu); #endif @@ -294374,7 +295072,8 @@ label_BFC163A0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC163A4: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x000068A4u); #endif @@ -294446,7 +295145,8 @@ label_BFC163B0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC163B0: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x000068B0u); #endif @@ -294471,7 +295171,8 @@ label_BFC163B4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC163B8: 2C4100B7 sltiu $at, $v0, 183 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B7u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B7u ? 1 : 0); + PGXP_ALU(0x2C4100B7u, cpu->gpr[1], _pgx1, 0x00B7u); } #ifdef PSX_COSIM cosim_instr(0x000068B8u); #endif @@ -294513,7 +295214,8 @@ label_BFC163BC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC163C0: 2C4100BF sltiu $at, $v0, 191 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + PGXP_ALU(0x2C4100BFu, cpu->gpr[1], _pgx1, 0x00BFu); } #ifdef PSX_COSIM cosim_instr(0x000068C0u); #endif @@ -294585,7 +295287,8 @@ label_BFC163CC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC163CC: 2C4100BF sltiu $at, $v0, 191 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + PGXP_ALU(0x2C4100BFu, cpu->gpr[1], _pgx1, 0x00BFu); } #ifdef PSX_COSIM cosim_instr(0x000068CCu); #endif @@ -294610,7 +295313,8 @@ label_BFC163D0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC163D4: 2C4100D7 sltiu $at, $v0, 215 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000D7u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000D7u ? 1 : 0); + PGXP_ALU(0x2C4100D7u, cpu->gpr[1], _pgx1, 0x00D7u); } #ifdef PSX_COSIM cosim_instr(0x000068D4u); #endif @@ -294690,7 +295394,8 @@ label_BFC163E4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC163E4: 2C4100D7 sltiu $at, $v0, 215 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000D7u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000D7u ? 1 : 0); + PGXP_ALU(0x2C4100D7u, cpu->gpr[1], _pgx1, 0x00D7u); } #ifdef PSX_COSIM cosim_instr(0x000068E4u); #endif @@ -294938,7 +295643,8 @@ label_BFC16428: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16430: 2C410040 sltiu $at, $v0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C410040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x00006930u); #endif @@ -294953,7 +295659,8 @@ label_BFC16428: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16438: 2C410061 sltiu $at, $v0, 97 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000061u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000061u ? 1 : 0); + PGXP_ALU(0x2C410061u, cpu->gpr[1], _pgx1, 0x0061u); } #ifdef PSX_COSIM cosim_instr(0x00006938u); #endif @@ -294995,7 +295702,8 @@ label_BFC1643C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16440: 2C410070 sltiu $at, $v0, 112 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000070u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000070u ? 1 : 0); + PGXP_ALU(0x2C410070u, cpu->gpr[1], _pgx1, 0x0070u); } #ifdef PSX_COSIM cosim_instr(0x00006940u); #endif @@ -295067,7 +295775,8 @@ label_BFC1644C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1644C: 2C410070 sltiu $at, $v0, 112 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000070u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000070u ? 1 : 0); + PGXP_ALU(0x2C410070u, cpu->gpr[1], _pgx1, 0x0070u); } #ifdef PSX_COSIM cosim_instr(0x0000694Cu); #endif @@ -295092,7 +295801,8 @@ label_BFC16450: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16454: 2C41007F sltiu $at, $v0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x00006954u); #endif @@ -295131,7 +295841,8 @@ label_BFC16458: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1645C: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x0000695Cu); #endif @@ -295203,7 +295914,8 @@ label_BFC16468: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16468: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x00006968u); #endif @@ -295231,7 +295943,8 @@ label_BFC1646C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16470: 2C410092 sltiu $at, $v0, 146 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000092u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000092u ? 1 : 0); + PGXP_ALU(0x2C410092u, cpu->gpr[1], _pgx1, 0x0092u); } #ifdef PSX_COSIM cosim_instr(0x00006970u); #endif @@ -295270,7 +295983,8 @@ label_BFC16474: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16478: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x00006978u); #endif @@ -295345,7 +296059,8 @@ label_BFC16484: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC16484: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x00006984u); #endif @@ -295370,7 +296085,8 @@ label_BFC16488: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1648C: 2C4100BF sltiu $at, $v0, 191 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + PGXP_ALU(0x2C4100BFu, cpu->gpr[1], _pgx1, 0x00BFu); } #ifdef PSX_COSIM cosim_instr(0x0000698Cu); #endif @@ -295447,7 +296163,8 @@ label_BFC1649C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1649C: 2C4100BF sltiu $at, $v0, 191 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + PGXP_ALU(0x2C4100BFu, cpu->gpr[1], _pgx1, 0x00BFu); } #ifdef PSX_COSIM cosim_instr(0x0000699Cu); #endif @@ -295695,7 +296412,8 @@ label_BFC164E0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC164E8: 2C41007F sltiu $at, $v0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x000069E8u); #endif @@ -295832,7 +296550,8 @@ label_BFC16500: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC1650C: 316C00FF andi $t4, $t3, 0xFF */ - cpu->gpr[12] = cpu->gpr[11] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0xFFu; + PGXP_ALU(0x316C00FFu, cpu->gpr[12], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x00006A0Cu); #endif @@ -303017,7 +303736,8 @@ label_BFC18600: psx_cyc_step(cpu, 0x2010002u); #endif /* 0xBFC1860C: 0219082A slt $at, $s0, $t9 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0219082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003060Cu); #endif @@ -304535,7 +305255,8 @@ label_BFC18788: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC18788: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80030788u); #endif @@ -306073,7 +306794,8 @@ label_BFC18930: psx_cyc_step(cpu, 0x8012u); #endif /* 0xBFC18934: 00817824 and $t7, $a0, $at */ - cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80030934u); #endif @@ -306704,7 +307426,8 @@ label_BFC189B0: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC189BC: 2862003D slti $v0, $v1, 61 */ - cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[3] < (61) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[2] = (uint32_t)((int32_t)cpu->gpr[3] < (61) ? 1 : 0); + PGXP_ALU(0x2862003Du, cpu->gpr[2], _pgx1, 0x003Du); } #ifdef PSX_COSIM cosim_instr(0x800309BCu); #endif @@ -306715,7 +307438,8 @@ label_BFC189B0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC189C0: 38420001 xori $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + PGXP_ALU(0x38420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800309C0u); #endif @@ -315488,7 +316212,8 @@ label_BFC194F0: psx_cyc_step(cpu, 0x10102u); #endif /* 0xBFC194FC: 0208082A slt $at, $s0, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0208082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800314FCu); #endif @@ -317209,7 +317934,8 @@ label_BFC1970C: psx_cyc_step(cpu, 0x1000u); #endif /* 0xBFC19714: 318CFFF3 andi $t4, $t4, 0xFFF3 */ - cpu->gpr[12] = cpu->gpr[12] & 0xFFF3u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[12] = cpu->gpr[12] & 0xFFF3u; + PGXP_ALU(0x318CFFF3u, cpu->gpr[12], _pgx1, 0xFFF3u); } #ifdef PSX_COSIM cosim_instr(0x80031714u); #endif @@ -317843,7 +318569,8 @@ label_BFC197D8: psx_cyc_step(cpu, 0x208u); #endif /* 0xBFC197D8: 31230003 andi $v1, $t1, 0x3 */ - cpu->gpr[3] = cpu->gpr[9] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[3] = cpu->gpr[9] & 0x3u; + PGXP_ALU(0x31230003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x800317D8u); #endif @@ -317946,7 +318673,8 @@ label_BFC197F0: psx_cyc_step(cpu, 0x2004u); #endif /* 0xBFC197F8: 304D00C0 andi $t5, $v0, 0xC0 */ - cpu->gpr[13] = cpu->gpr[2] & 0xC0u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[2] & 0xC0u; + PGXP_ALU(0x304D00C0u, cpu->gpr[13], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0x800317F8u); #endif @@ -317954,7 +318682,8 @@ label_BFC197F0: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC197FC: 304F0030 andi $t7, $v0, 0x30 */ - cpu->gpr[15] = cpu->gpr[2] & 0x30u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x30u; + PGXP_ALU(0x304F0030u, cpu->gpr[15], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x800317FCu); #endif @@ -318019,7 +318748,8 @@ label_BFC197F0: psx_cyc_step(cpu, 0x2004u); #endif /* 0xBFC19818: 304D000C andi $t5, $v0, 0xC */ - cpu->gpr[13] = cpu->gpr[2] & 0xCu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[2] & 0xCu; + PGXP_ALU(0x304D000Cu, cpu->gpr[13], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0x80031818u); #endif @@ -318039,7 +318769,8 @@ label_BFC197F0: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC19820: 304E0003 andi $t6, $v0, 0x3 */ - cpu->gpr[14] = cpu->gpr[2] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x3u; + PGXP_ALU(0x304E0003u, cpu->gpr[14], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80031820u); #endif @@ -318210,7 +318941,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x2004u); #endif /* 0xBFC19850: 304D00C0 andi $t5, $v0, 0xC0 */ - cpu->gpr[13] = cpu->gpr[2] & 0xC0u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[2] & 0xC0u; + PGXP_ALU(0x304D00C0u, cpu->gpr[13], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0x80031850u); #endif @@ -318218,7 +318950,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC19854: 304E0030 andi $t6, $v0, 0x30 */ - cpu->gpr[14] = cpu->gpr[2] & 0x30u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x30u; + PGXP_ALU(0x304E0030u, cpu->gpr[14], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x80031854u); #endif @@ -318283,7 +319016,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x2004u); #endif /* 0xBFC19870: 304D000C andi $t5, $v0, 0xC */ - cpu->gpr[13] = cpu->gpr[2] & 0xCu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[2] & 0xCu; + PGXP_ALU(0x304D000Cu, cpu->gpr[13], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0x80031870u); #endif @@ -318300,7 +319034,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC19878: 304F0003 andi $t7, $v0, 0x3 */ - cpu->gpr[15] = cpu->gpr[2] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x3u; + PGXP_ALU(0x304F0003u, cpu->gpr[15], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80031878u); #endif @@ -318344,7 +319079,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x2000008u); #endif /* 0xBFC1988C: 307900C0 andi $t9, $v1, 0xC0 */ - cpu->gpr[25] = cpu->gpr[3] & 0xC0u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[25] = cpu->gpr[3] & 0xC0u; + PGXP_ALU(0x307900C0u, cpu->gpr[25], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0x8003188Cu); #endif @@ -318355,7 +319091,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x4008u); #endif /* 0xBFC19890: 306E0030 andi $t6, $v1, 0x30 */ - cpu->gpr[14] = cpu->gpr[3] & 0x30u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[14] = cpu->gpr[3] & 0x30u; + PGXP_ALU(0x306E0030u, cpu->gpr[14], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x80031890u); #endif @@ -318416,7 +319153,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x2000008u); #endif /* 0xBFC198AC: 3079000C andi $t9, $v1, 0xC */ - cpu->gpr[25] = cpu->gpr[3] & 0xCu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[25] = cpu->gpr[3] & 0xCu; + PGXP_ALU(0x3079000Cu, cpu->gpr[25], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0x800318ACu); #endif @@ -318436,7 +319174,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x2008u); #endif /* 0xBFC198B4: 306D0003 andi $t5, $v1, 0x3 */ - cpu->gpr[13] = cpu->gpr[3] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[13] = cpu->gpr[3] & 0x3u; + PGXP_ALU(0x306D0003u, cpu->gpr[13], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x800318B4u); #endif @@ -318479,7 +319218,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x1000010u); #endif /* 0xBFC198C8: 309800C0 andi $t8, $a0, 0xC0 */ - cpu->gpr[24] = cpu->gpr[4] & 0xC0u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[24] = cpu->gpr[4] & 0xC0u; + PGXP_ALU(0x309800C0u, cpu->gpr[24], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0x800318C8u); #endif @@ -318487,7 +319227,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC198CC: 308E0030 andi $t6, $a0, 0x30 */ - cpu->gpr[14] = cpu->gpr[4] & 0x30u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0x30u; + PGXP_ALU(0x308E0030u, cpu->gpr[14], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x800318CCu); #endif @@ -318551,7 +319292,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x1000010u); #endif /* 0xBFC198E8: 3098000C andi $t8, $a0, 0xC */ - cpu->gpr[24] = cpu->gpr[4] & 0xCu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[24] = cpu->gpr[4] & 0xCu; + PGXP_ALU(0x3098000Cu, cpu->gpr[24], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0x800318E8u); #endif @@ -318571,7 +319313,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x2000010u); #endif /* 0xBFC198F0: 30990003 andi $t9, $a0, 0x3 */ - cpu->gpr[25] = cpu->gpr[4] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[4] & 0x3u; + PGXP_ALU(0x30990003u, cpu->gpr[25], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x800318F0u); #endif @@ -318614,7 +319357,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x8020u); #endif /* 0xBFC19904: 30AF00C0 andi $t7, $a1, 0xC0 */ - cpu->gpr[15] = cpu->gpr[5] & 0xC0u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[15] = cpu->gpr[5] & 0xC0u; + PGXP_ALU(0x30AF00C0u, cpu->gpr[15], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0x80031904u); #endif @@ -318622,7 +319366,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x4020u); #endif /* 0xBFC19908: 30AE0030 andi $t6, $a1, 0x30 */ - cpu->gpr[14] = cpu->gpr[5] & 0x30u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[14] = cpu->gpr[5] & 0x30u; + PGXP_ALU(0x30AE0030u, cpu->gpr[14], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x80031908u); #endif @@ -318686,7 +319431,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x8020u); #endif /* 0xBFC19924: 30AF000C andi $t7, $a1, 0xC */ - cpu->gpr[15] = cpu->gpr[5] & 0xCu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[15] = cpu->gpr[5] & 0xCu; + PGXP_ALU(0x30AF000Cu, cpu->gpr[15], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0x80031924u); #endif @@ -318703,7 +319449,8 @@ label_BFC19848: psx_cyc_step(cpu, 0x1000020u); #endif /* 0xBFC1992C: 30B80003 andi $t8, $a1, 0x3 */ - cpu->gpr[24] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[24] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30B80003u, cpu->gpr[24], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x8003192Cu); #endif @@ -318817,7 +319564,8 @@ label_BFC19944: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1994C: 3042000F andi $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3042000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003194Cu); #endif @@ -318979,7 +319727,8 @@ label_BFC19970: psx_cyc_step(cpu, 0xA000u); #endif /* 0xBFC19978: 31AF00F0 andi $t7, $t5, 0xF0 */ - cpu->gpr[15] = cpu->gpr[13] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[15] = cpu->gpr[13] & 0xF0u; + PGXP_ALU(0x31AF00F0u, cpu->gpr[15], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80031978u); #endif @@ -319045,7 +319794,8 @@ label_BFC19984: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1998C: 3042000F andi $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3042000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003198Cu); #endif @@ -319129,7 +319879,8 @@ label_BFC1999C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC199A4: 331900F0 andi $t9, $t8, 0xF0 */ - cpu->gpr[25] = cpu->gpr[24] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xF0u; + PGXP_ALU(0x331900F0u, cpu->gpr[25], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x800319A4u); #endif @@ -319243,7 +319994,8 @@ label_BFC199C4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC199CC: 3042000F andi $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3042000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x800319CCu); #endif @@ -321383,7 +322135,8 @@ label_BFC19C54: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC19C60: 2DCF0001 sltiu $t7, $t6, 1 */ - cpu->gpr[15] = (uint32_t)(cpu->gpr[14] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = (uint32_t)(cpu->gpr[14] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2DCF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80031C60u); #endif @@ -321509,7 +322262,8 @@ label_BFC19C80: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC19C8C: 2F190001 sltiu $t9, $t8, 1 */ - cpu->gpr[25] = (uint32_t)(cpu->gpr[24] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = (uint32_t)(cpu->gpr[24] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2F190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80031C8Cu); #endif @@ -324366,7 +325120,8 @@ label_BFC19FD0: psx_cyc_step(cpu, 0x4012u); #endif /* 0xBFC19FDC: 00817024 and $t6, $a0, $at */ - cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80031FDCu); #endif @@ -324849,7 +325604,8 @@ label_BFC1A050: psx_cyc_step(cpu, 0x4012u); #endif /* 0xBFC1A05C: 00817024 and $t6, $a0, $at */ - cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003205Cu); #endif @@ -325535,7 +326291,8 @@ label_BFC1A11C: psx_cyc_step(cpu, 0x4012u); #endif /* 0xBFC1A128: 00817024 and $t6, $a0, $at */ - cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032128u); #endif @@ -326224,7 +326981,8 @@ label_BFC1A1BC: psx_cyc_step(cpu, 0x4012u); #endif /* 0xBFC1A1C8: 00817024 and $t6, $a0, $at */ - cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800321C8u); #endif @@ -329065,7 +329823,8 @@ label_BFC1A49C: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1A4A0: 2A0100D0 slti $at, $s0, 208 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (208) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (208) ? 1 : 0); + PGXP_ALU(0x2A0100D0u, cpu->gpr[1], _pgx1, 0x00D0u); } #ifdef PSX_COSIM cosim_instr(0x800324A0u); #endif @@ -329341,7 +330100,8 @@ label_BFC1A4E4: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC1A4F0: 2DF80001 sltiu $t8, $t7, 1 */ - cpu->gpr[24] = (uint32_t)(cpu->gpr[15] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = (uint32_t)(cpu->gpr[15] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2DF80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800324F0u); #endif @@ -329615,7 +330375,8 @@ label_BFC1A538: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1A53C: 2A0100D0 slti $at, $s0, 208 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (208) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (208) ? 1 : 0); + PGXP_ALU(0x2A0100D0u, cpu->gpr[1], _pgx1, 0x00D0u); } #ifdef PSX_COSIM cosim_instr(0x8003253Cu); #endif @@ -329878,7 +330639,8 @@ label_BFC1A580: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC1A58C: 2F280001 sltiu $t0, $t9, 1 */ - cpu->gpr[8] = (uint32_t)(cpu->gpr[25] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = (uint32_t)(cpu->gpr[25] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2F280001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8003258Cu); #endif @@ -330147,7 +330909,8 @@ label_BFC1A5C8: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC1A5D4: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800325D4u); #endif @@ -330511,7 +331274,8 @@ label_BFC1A630: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC1A644: 2D210007 sltiu $at, $t1, 7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000007u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000007u ? 1 : 0); + PGXP_ALU(0x2D210007u, cpu->gpr[1], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x80032644u); #endif @@ -331447,7 +332211,8 @@ label_BFC1A6EC: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC1A704: 2DCF0001 sltiu $t7, $t6, 1 */ - cpu->gpr[15] = (uint32_t)(cpu->gpr[14] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = (uint32_t)(cpu->gpr[14] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2DCF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80032704u); #endif @@ -331604,7 +332369,8 @@ label_BFC1A728: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC1A73C: 2F190001 sltiu $t9, $t8, 1 */ - cpu->gpr[25] = (uint32_t)(cpu->gpr[24] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = (uint32_t)(cpu->gpr[24] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2F190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8003273Cu); #endif @@ -331725,7 +332491,8 @@ label_BFC1A760: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC1A768: 2861002B slti $at, $v1, 43 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (43) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (43) ? 1 : 0); + PGXP_ALU(0x2861002Bu, cpu->gpr[1], _pgx1, 0x002Bu); } #ifdef PSX_COSIM cosim_instr(0x80032768u); #endif @@ -331776,7 +332543,8 @@ label_BFC1A774: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC1A774: 2861002F slti $at, $v1, 47 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (47) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (47) ? 1 : 0); + PGXP_ALU(0x2861002Fu, cpu->gpr[1], _pgx1, 0x002Fu); } #ifdef PSX_COSIM cosim_instr(0x80032774u); #endif @@ -334612,7 +335380,8 @@ label_BFC1AAB8: psx_cyc_step(cpu, 0x8002u); #endif /* 0xBFC1AAC4: 2DE1000A sltiu $at, $t7, 10 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2DE1000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x80032AC4u); #endif @@ -334627,7 +335396,8 @@ label_BFC1AAB8: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC1AACC: 3058000F andi $t8, $v0, 0xF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3058000Fu, cpu->gpr[24], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032ACCu); #endif @@ -334659,7 +335429,8 @@ label_BFC1AAD0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1AAD0: 3042000F andi $v0, $v0, 0xF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3042000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032AD0u); #endif @@ -334667,7 +335438,8 @@ label_BFC1AAD0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1AAD4: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80032AD4u); #endif @@ -334675,7 +335447,8 @@ label_BFC1AAD0: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC1AAD8: 3058000F andi $t8, $v0, 0xF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3058000Fu, cpu->gpr[24], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032AD8u); #endif @@ -334693,7 +335466,8 @@ label_BFC1AADC: psx_cyc_step(cpu, 0x1000002u); #endif /* 0xBFC1AADC: 2F01000A sltiu $at, $t8, 10 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2F01000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x80032ADCu); #endif @@ -334744,7 +335518,8 @@ label_BFC1AAE8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1AAE8: 304200F0 andi $v0, $v0, 0xF0 */ - cpu->gpr[2] = cpu->gpr[2] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xF0u; + PGXP_ALU(0x304200F0u, cpu->gpr[2], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80032AE8u); #endif @@ -334752,7 +335527,8 @@ label_BFC1AAE8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC1AAEC: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80032AECu); #endif @@ -334846,7 +335622,8 @@ label_BFC1AB00: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC1AB0C: 3045000F andi $a1, $v0, 0xF */ - cpu->gpr[5] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x3045000Fu, cpu->gpr[5], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032B0Cu); #endif @@ -334943,7 +335720,8 @@ label_BFC1AB20: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC1AB2C: 30A5000F andi $a1, $a1, 0xF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFu; + PGXP_ALU(0x30A5000Fu, cpu->gpr[5], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032B2Cu); #endif @@ -335040,7 +335818,8 @@ label_BFC1AB40: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC1AB4C: 30A5000F andi $a1, $a1, 0xF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFu; + PGXP_ALU(0x30A5000Fu, cpu->gpr[5], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80032B4Cu); #endif @@ -336155,7 +336934,8 @@ label_BFC1AC80: psx_cyc_step(cpu, 0x8002u); #endif /* 0xBFC1AC94: 2DE1000A sltiu $at, $t7, 10 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2DE1000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x80032C94u); #endif @@ -336986,7 +337766,8 @@ label_BFC1AD60: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC1AD68: 0041C024 and $t8, $v0, $at */ - cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x0041C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032D68u); #endif @@ -337046,7 +337827,8 @@ label_BFC1AD74: psx_cyc_step(cpu, 0x2000006u); #endif /* 0xBFC1AD78: 0041C824 and $t9, $v0, $at */ - cpu->gpr[25] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[25] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x0041C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032D78u); #endif @@ -337187,7 +337969,8 @@ label_BFC1AD94: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC1AD98: 00414024 and $t0, $v0, $at */ - cpu->gpr[8] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00414024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032D98u); #endif @@ -337247,7 +338030,8 @@ label_BFC1ADA4: psx_cyc_step(cpu, 0x206u); #endif /* 0xBFC1ADA8: 00414824 and $t1, $v0, $at */ - cpu->gpr[9] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00414824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032DA8u); #endif @@ -338379,7 +339163,8 @@ label_BFC1AE80: psx_cyc_step(cpu, 0x14002u); #endif /* 0xBFC1AE88: 02017024 and $t6, $s0, $at */ - cpu->gpr[14] = cpu->gpr[16] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[16] & cpu->gpr[1]; + PGXP_ALU(0x02017024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032E88u); #endif @@ -338589,7 +339374,8 @@ label_BFC1AEC4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1AEC4: 28410015 slti $at, $v0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (21) ? 1 : 0); + PGXP_ALU(0x28410015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80032EC4u); #endif @@ -338883,7 +339669,8 @@ label_BFC1AF18: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1AF24: 2841000B slti $at, $v0, 11 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (11) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (11) ? 1 : 0); + PGXP_ALU(0x2841000Bu, cpu->gpr[1], _pgx1, 0x000Bu); } #ifdef PSX_COSIM cosim_instr(0x80032F24u); #endif @@ -338949,7 +339736,8 @@ label_BFC1AF28: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1AF38: 2841000B slti $at, $v0, 11 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (11) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (11) ? 1 : 0); + PGXP_ALU(0x2841000Bu, cpu->gpr[1], _pgx1, 0x000Bu); } #ifdef PSX_COSIM cosim_instr(0x80032F38u); #endif @@ -339223,7 +340011,8 @@ label_BFC1AF64: psx_cyc_step(cpu, 0x2Au); #endif /* 0xBFC1AF84: 00A3082B sltu $at, $a1, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x00A3082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032F84u); #endif @@ -339347,7 +340136,8 @@ label_BFC1AFA0: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC1AFAC: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80032FACu); #endif @@ -339644,7 +340434,8 @@ label_BFC1AFE8: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC1B004: 00A2082B sltu $at, $a1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x00A2082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033004u); #endif @@ -340083,7 +340874,8 @@ label_BFC1B08C: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC1B09C: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003309Cu); #endif @@ -340122,7 +340914,8 @@ label_BFC1B0A0: psx_cyc_step(cpu, 0x2Au); #endif /* 0xBFC1B0A4: 00A3082B sltu $at, $a1, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x00A3082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800330A4u); #endif @@ -340198,7 +340991,8 @@ label_BFC1B0B0: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC1B0B4: 28C10063 slti $at, $a2, 99 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (99) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (99) ? 1 : 0); + PGXP_ALU(0x28C10063u, cpu->gpr[1], _pgx1, 0x0063u); } #ifdef PSX_COSIM cosim_instr(0x800330B4u); #endif @@ -340239,7 +341033,8 @@ label_BFC1B0B8: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC1B0BC: 00A2082B sltu $at, $a1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x00A2082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800330BCu); #endif @@ -340290,7 +341085,8 @@ label_BFC1B0C8: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1B0C8: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800330C8u); #endif @@ -340318,7 +341114,8 @@ label_BFC1B0CC: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC1B0D0: 28C10063 slti $at, $a2, 99 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (99) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (99) ? 1 : 0); + PGXP_ALU(0x28C10063u, cpu->gpr[1], _pgx1, 0x0063u); } #ifdef PSX_COSIM cosim_instr(0x800330D0u); #endif @@ -340438,7 +341235,8 @@ label_BFC1B0E4: psx_cyc_step(cpu, 0x10022u); #endif /* 0xBFC1B0F4: 00B0082B sltu $at, $a1, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x00B0082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800330F4u); #endif @@ -340507,7 +341305,8 @@ label_BFC1B100: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1B10C: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x8003310Cu); #endif @@ -340572,7 +341371,8 @@ label_BFC1B11C: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC1B11C: 28C10063 slti $at, $a2, 99 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (99) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (99) ? 1 : 0); + PGXP_ALU(0x28C10063u, cpu->gpr[1], _pgx1, 0x0063u); } #ifdef PSX_COSIM cosim_instr(0x8003311Cu); #endif @@ -340597,7 +341397,8 @@ label_BFC1B120: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC1B124: 28610015 slti $at, $v1, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (21) ? 1 : 0); + PGXP_ALU(0x28610015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80033124u); #endif @@ -341032,7 +341833,8 @@ label_BFC1B1A4: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC1B1A8: 28C10063 slti $at, $a2, 99 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (99) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (99) ? 1 : 0); + PGXP_ALU(0x28C10063u, cpu->gpr[1], _pgx1, 0x0063u); } #ifdef PSX_COSIM cosim_instr(0x800331A8u); #endif @@ -341487,7 +342289,8 @@ label_BFC1B228: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC1B238: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033238u); #endif @@ -341529,7 +342332,8 @@ label_BFC1B23C: psx_cyc_step(cpu, 0x2Au); #endif /* 0xBFC1B240: 00A3082B sltu $at, $a1, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x00A3082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033240u); #endif @@ -341672,7 +342476,8 @@ label_BFC1B260: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC1B264: 0043082A slt $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033264u); #endif @@ -341797,7 +342602,8 @@ label_BFC1B280: psx_cyc_step(cpu, 0x1000Au); #endif /* 0xBFC1B288: 0203082A slt $at, $s0, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0203082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033288u); #endif @@ -341881,7 +342687,8 @@ label_BFC1B2A0: psx_cyc_step(cpu, 0x2Au); #endif /* 0xBFC1B2A0: 00A3082B sltu $at, $a1, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x00A3082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800332A0u); #endif @@ -341929,7 +342736,8 @@ label_BFC1B2AC: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1B2AC: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800332ACu); #endif @@ -342075,7 +342883,8 @@ label_BFC1B2C8: psx_cyc_step(cpu, 0x10022u); #endif /* 0xBFC1B2D8: 00B0082B sltu $at, $a1, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x00B0082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800332D8u); #endif @@ -342093,7 +342902,8 @@ label_BFC1B2C8: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1B2E0: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800332E0u); #endif @@ -343155,7 +343965,8 @@ label_BFC1B410: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC1B41C: 2CA10015 sltiu $at, $a1, 21 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000015u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000015u ? 1 : 0); + PGXP_ALU(0x2CA10015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x8003341Cu); #endif @@ -343344,7 +344155,8 @@ label_BFC1B43C: psx_cyc_step(cpu, 0x10022u); #endif /* 0xBFC1B45C: 00B0082B sltu $at, $a1, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x00B0082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003345Cu); #endif @@ -343591,7 +344403,8 @@ label_BFC1B494: psx_cyc_step(cpu, 0x10022u); #endif /* 0xBFC1B4A0: 00B0082B sltu $at, $a1, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x00B0082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800334A0u); #endif @@ -343650,7 +344463,8 @@ label_BFC1B4A4: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC1B4B0: 2C810002 sltiu $at, $a0, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C810002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x800334B0u); #endif @@ -343801,7 +344615,8 @@ label_BFC1B4D0: psx_cyc_step(cpu, 0x10012u); #endif /* 0xBFC1B4DC: 0204082B sltu $at, $s0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0204082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800334DCu); #endif @@ -343994,7 +344809,8 @@ label_BFC1B508: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC1B51C: 0045082A slt $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003351Cu); #endif @@ -344111,7 +344927,8 @@ label_BFC1B538: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC1B540: 28810015 slti $at, $a0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (21) ? 1 : 0); + PGXP_ALU(0x28810015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80033540u); #endif @@ -344365,7 +345182,8 @@ label_BFC1B58C: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC1B590: 0062082B sltu $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033590u); #endif @@ -344480,7 +345298,8 @@ label_BFC1B5A4: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC1B5B0: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800335B0u); #endif @@ -344528,7 +345347,8 @@ label_BFC1B5BC: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1B5BC: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800335BCu); #endif @@ -344700,7 +345520,8 @@ label_BFC1B5EC: psx_cyc_step(cpu, 0x10022u); #endif /* 0xBFC1B5F0: 0205082B sltu $at, $s0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0205082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800335F0u); #endif @@ -344715,7 +345536,8 @@ label_BFC1B5EC: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1B5F8: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800335F8u); #endif @@ -345691,7 +346513,8 @@ label_BFC1B6EC: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC1B6F4: 28610015 slti $at, $v1, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (21) ? 1 : 0); + PGXP_ALU(0x28610015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800336F4u); #endif @@ -345851,7 +346674,8 @@ label_BFC1B718: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC1B728: 2DF80001 sltiu $t8, $t7, 1 */ - cpu->gpr[24] = (uint32_t)(cpu->gpr[15] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = (uint32_t)(cpu->gpr[15] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2DF80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80033728u); #endif @@ -345990,7 +346814,8 @@ label_BFC1B748: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC1B758: 2F280001 sltiu $t0, $t9, 1 */ - cpu->gpr[8] = (uint32_t)(cpu->gpr[25] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = (uint32_t)(cpu->gpr[25] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2F280001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80033758u); #endif @@ -348404,7 +349229,8 @@ label_BFC1B9EC: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC1B9F8: 2D210015 sltiu $at, $t1, 21 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000015u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000015u ? 1 : 0); + PGXP_ALU(0x2D210015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800339F8u); #endif @@ -349276,7 +350102,8 @@ label_BFC1BAF4: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC1BB00: 2C610002 sltiu $at, $v1, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80033B00u); #endif @@ -349480,7 +350307,8 @@ label_BFC1BB2C: psx_cyc_step(cpu, 0x2000Au); #endif /* 0xBFC1BB38: 0223082B sltu $at, $s1, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0223082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033B38u); #endif @@ -349558,7 +350386,8 @@ label_BFC1BB44: psx_cyc_step(cpu, 0x8006u); #endif /* 0xBFC1BB50: 01E2082B sltu $at, $t7, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[15] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01E2082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033B50u); #endif @@ -349606,7 +350435,8 @@ label_BFC1BB5C: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC1BB5C: 2A210015 slti $at, $s1, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (21) ? 1 : 0); + PGXP_ALU(0x2A210015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80033B5Cu); #endif @@ -349816,7 +350646,8 @@ label_BFC1BB88: psx_cyc_step(cpu, 0x1020002u); #endif /* 0xBFC1BB94: 0311082B sltu $at, $t8, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0311082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033B94u); #endif @@ -349831,7 +350662,8 @@ label_BFC1BB88: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC1BB9C: 2A210015 slti $at, $s1, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (21) ? 1 : 0); + PGXP_ALU(0x2A210015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80033B9Cu); #endif @@ -349887,7 +350719,8 @@ label_BFC1BBA0: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC1BBAC: 28610002 slti $at, $v1, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (2) ? 1 : 0); + PGXP_ALU(0x28610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80033BACu); #endif @@ -350041,7 +350874,8 @@ label_BFC1BBD0: psx_cyc_step(cpu, 0x2000Au); #endif /* 0xBFC1BBDC: 0223082A slt $at, $s1, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0223082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033BDCu); #endif @@ -350151,7 +350985,8 @@ label_BFC1BBF0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1BC00: 28410015 slti $at, $v0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (21) ? 1 : 0); + PGXP_ALU(0x28410015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80033C00u); #endif @@ -350341,7 +351176,8 @@ label_BFC1BC2C: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC1BC30: 2A210015 slti $at, $s1, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (21) ? 1 : 0); + PGXP_ALU(0x2A210015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80033C30u); #endif @@ -350620,7 +351456,8 @@ label_BFC1BC74: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC1BC84: 28410002 slti $at, $v0, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (2) ? 1 : 0); + PGXP_ALU(0x28410002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80033C84u); #endif @@ -350774,7 +351611,8 @@ label_BFC1BCA4: psx_cyc_step(cpu, 0x20006u); #endif /* 0xBFC1BCB4: 0222082A slt $at, $s1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0222082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033CB4u); #endif @@ -350845,7 +351683,8 @@ label_BFC1BCC0: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC1BCCC: 0062082A slt $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033CCCu); #endif @@ -351015,7 +351854,8 @@ label_BFC1BCF4: psx_cyc_step(cpu, 0x20402u); #endif /* 0xBFC1BD00: 0151082A slt $at, $t2, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0151082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033D00u); #endif @@ -351452,7 +352292,8 @@ label_BFC1BD80: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC1BD8C: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80033D8Cu); #endif @@ -351761,7 +352602,8 @@ label_BFC1BDDC: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC1BDEC: 2D210005 sltiu $at, $t1, 5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000005u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000005u ? 1 : 0); + PGXP_ALU(0x2D210005u, cpu->gpr[1], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0x80033DECu); #endif @@ -353464,7 +354306,8 @@ label_BFC1BF90: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC1BFBC: 2C610002 sltiu $at, $v1, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80033FBCu); #endif @@ -353717,7 +354560,8 @@ label_BFC1BFF8: psx_cyc_step(cpu, 0x1000Au); #endif /* 0xBFC1C004: 0203082B sltu $at, $s0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0203082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034004u); #endif @@ -353816,7 +354660,8 @@ label_BFC1C018: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC1C024: 0102082B sltu $at, $t0, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0102082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034024u); #endif @@ -353901,7 +354746,8 @@ label_BFC1C03C: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1C03C: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x8003403Cu); #endif @@ -354182,7 +355028,8 @@ label_BFC1C07C: psx_cyc_step(cpu, 0x10402u); #endif /* 0xBFC1C088: 0150082B sltu $at, $t2, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[10] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[10] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0150082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034088u); #endif @@ -354390,7 +355237,8 @@ label_BFC1C0B8: psx_cyc_step(cpu, 0x802u); #endif /* 0xBFC1C0C4: 29610002 slti $at, $t3, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (2) ? 1 : 0); + PGXP_ALU(0x29610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x800340C4u); #endif @@ -354405,7 +355253,8 @@ label_BFC1C0B8: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1C0CC: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800340CCu); #endif @@ -354564,7 +355413,8 @@ label_BFC1C0EC: psx_cyc_step(cpu, 0x14002u); #endif /* 0xBFC1C0F8: 020E082A slt $at, $s0, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x020E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800340F8u); #endif @@ -354582,7 +355432,8 @@ label_BFC1C0EC: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1C100: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80034100u); #endif @@ -355345,7 +356196,8 @@ label_BFC1C1A4: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC1C1B4: 2D210002 sltiu $at, $t1, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2D210002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x800341B4u); #endif @@ -355616,7 +356468,8 @@ label_BFC1C1F8: psx_cyc_step(cpu, 0x10202u); #endif /* 0xBFC1C204: 0209082B sltu $at, $s0, $t1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0209082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034204u); #endif @@ -355715,7 +356568,8 @@ label_BFC1C218: psx_cyc_step(cpu, 0x502u); #endif /* 0xBFC1C224: 010A082B sltu $at, $t0, $t2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x010A082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034224u); #endif @@ -355821,7 +356675,8 @@ label_BFC1C244: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1C244: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80034244u); #endif @@ -356037,7 +356892,8 @@ label_BFC1C27C: psx_cyc_step(cpu, 0x10102u); #endif /* 0xBFC1C280: 0110082B sltu $at, $t0, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0110082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034280u); #endif @@ -356417,7 +357273,8 @@ label_BFC1C2D8: psx_cyc_step(cpu, 0x10012u); #endif /* 0xBFC1C2F8: 0204082B sltu $at, $s0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0204082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800342F8u); #endif @@ -356508,7 +357365,8 @@ label_BFC1C30C: psx_cyc_step(cpu, 0x902u); #endif /* 0xBFC1C310: 010B082B sltu $at, $t0, $t3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x010B082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034310u); #endif @@ -356635,7 +357493,8 @@ label_BFC1C338: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC1C338: 2C810002 sltiu $at, $a0, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2C810002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80034338u); #endif @@ -356834,7 +357693,8 @@ label_BFC1C370: psx_cyc_step(cpu, 0x10012u); #endif /* 0xBFC1C374: 0204082B sltu $at, $s0, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0204082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034374u); #endif @@ -356957,7 +357817,8 @@ label_BFC1C380: psx_cyc_step(cpu, 0xA2u); #endif /* 0xBFC1C3A0: 00E5082B sltu $at, $a3, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[7] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[7] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x00E5082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800343A0u); #endif @@ -357151,7 +358012,8 @@ label_BFC1C3D8: psx_cyc_step(cpu, 0x902u); #endif /* 0xBFC1C3D8: 010B082B sltu $at, $t0, $t3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x010B082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800343D8u); #endif @@ -357454,7 +358316,8 @@ label_BFC1C42C: psx_cyc_step(cpu, 0x10102u); #endif /* 0xBFC1C42C: 0110082B sltu $at, $t0, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0110082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003442Cu); #endif @@ -357616,7 +358479,8 @@ label_BFC1C454: psx_cyc_step(cpu, 0x902u); #endif /* 0xBFC1C454: 010B082B sltu $at, $t0, $t3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x010B082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034454u); #endif @@ -357787,7 +358651,8 @@ label_BFC1C488: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC1C490: 0043082B sltu $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034490u); #endif @@ -360015,7 +360880,8 @@ label_BFC1C6E8: psx_cyc_step(cpu, 0x2006u); #endif /* 0xBFC1C6FC: 01A2082B sltu $at, $t5, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01A2082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800346FCu); #endif @@ -360066,7 +360932,8 @@ label_BFC1C708: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1C708: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80034708u); #endif @@ -360191,7 +361058,8 @@ label_BFC1C720: psx_cyc_step(cpu, 0x14002u); #endif /* 0xBFC1C72C: 01D0082B sltu $at, $t6, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x01D0082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003472Cu); #endif @@ -360209,7 +361077,8 @@ label_BFC1C720: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1C734: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80034734u); #endif @@ -362016,7 +362885,8 @@ label_BFC1C904: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC1C910: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034910u); #endif @@ -362853,7 +363723,8 @@ label_BFC1C9F0: psx_cyc_step(cpu, 0x2000012u); #endif /* 0xBFC1C9F4: 0081C824 and $t9, $a0, $at */ - cpu->gpr[25] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[25] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x0081C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800349F4u); #endif @@ -363142,7 +364013,8 @@ label_BFC1CA38: psx_cyc_step(cpu, 0x212u); #endif /* 0xBFC1CA3C: 00814824 and $t1, $a0, $at */ - cpu->gpr[9] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00814824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034A3Cu); #endif @@ -363294,7 +364166,8 @@ label_BFC1CA5C: psx_cyc_step(cpu, 0x412u); #endif /* 0xBFC1CA60: 00815024 and $t2, $a0, $at */ - cpu->gpr[10] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[10] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00815024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034A60u); #endif @@ -363443,7 +364316,8 @@ label_BFC1CA80: psx_cyc_step(cpu, 0x812u); #endif /* 0xBFC1CA84: 00815824 and $t3, $a0, $at */ - cpu->gpr[11] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[11] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00815824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034A84u); #endif @@ -363589,7 +364463,8 @@ label_BFC1CAA4: psx_cyc_step(cpu, 0x1012u); #endif /* 0xBFC1CAA8: 00816024 and $t4, $a0, $at */ - cpu->gpr[12] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00816024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034AA8u); #endif @@ -363741,7 +364616,8 @@ label_BFC1CAC8: psx_cyc_step(cpu, 0x2012u); #endif /* 0xBFC1CACC: 00816824 and $t5, $a0, $at */ - cpu->gpr[13] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[13] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00816824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80034ACCu); #endif @@ -364962,7 +365838,8 @@ label_BFC1CBF4: psx_cyc_step(cpu, 0x140u); #endif /* 0xBFC1CC18: 30C8000F andi $t0, $a2, 0xF */ - cpu->gpr[8] = cpu->gpr[6] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[8] = cpu->gpr[6] & 0xFu; + PGXP_ALU(0x30C8000Fu, cpu->gpr[8], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80034C18u); #endif @@ -364970,7 +365847,8 @@ label_BFC1CBF4: psx_cyc_step(cpu, 0x880u); #endif /* 0xBFC1CC1C: 30EB000F andi $t3, $a3, 0xF */ - cpu->gpr[11] = cpu->gpr[7] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[11] = cpu->gpr[7] & 0xFu; + PGXP_ALU(0x30EB000Fu, cpu->gpr[11], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80034C1Cu); #endif @@ -365150,7 +366028,8 @@ label_BFC1CC3C: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC1CC64: 30E8000F andi $t0, $a3, 0xF */ - cpu->gpr[8] = cpu->gpr[7] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[8] = cpu->gpr[7] & 0xFu; + PGXP_ALU(0x30E8000Fu, cpu->gpr[8], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80034C64u); #endif @@ -365185,7 +366064,8 @@ label_BFC1CC3C: psx_cyc_step(cpu, 0x4040u); #endif /* 0xBFC1CC74: 30CE000F andi $t6, $a2, 0xF */ - cpu->gpr[14] = cpu->gpr[6] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[14] = cpu->gpr[6] & 0xFu; + PGXP_ALU(0x30CE000Fu, cpu->gpr[14], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80034C74u); #endif @@ -365324,7 +366204,8 @@ label_BFC1CC90: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC1CCA4: 2881003C slti $at, $a0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (60) ? 1 : 0); + PGXP_ALU(0x2881003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x80034CA4u); #endif @@ -366881,7 +367762,8 @@ label_BFC1CE24: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC1CE2C: 2E010005 sltiu $at, $s0, 5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < 0x00000005u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < 0x00000005u ? 1 : 0); + PGXP_ALU(0x2E010005u, cpu->gpr[1], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0x80034E2Cu); #endif @@ -370505,7 +371387,8 @@ label_BFC1D294: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC1D2AC: 28610002 slti $at, $v1, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (2) ? 1 : 0); + PGXP_ALU(0x28610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x800352ACu); #endif @@ -371653,7 +372536,8 @@ label_BFC1D42C: psx_cyc_step(cpu, 0x200Au); #endif /* 0xBFC1D43C: 01A3082A slt $at, $t5, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x01A3082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003543Cu); #endif @@ -374266,7 +375150,8 @@ label_BFC1D7AC: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC1D7B4: 004E082A slt $at, $v0, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x004E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800357B4u); #endif @@ -374817,7 +375702,8 @@ label_BFC1D86C: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC1D870: 2A61003C slti $at, $s3, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (60) ? 1 : 0); + PGXP_ALU(0x2A61003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x80035870u); #endif @@ -374992,7 +375878,8 @@ label_BFC1D87C: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC1D8A4: 2A61003C slti $at, $s3, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (60) ? 1 : 0); + PGXP_ALU(0x2A61003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x800358A4u); #endif @@ -375123,7 +376010,8 @@ label_BFC1D8C4: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC1D8C8: 2A810064 slti $at, $s4, 100 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (100) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (100) ? 1 : 0); + PGXP_ALU(0x2A810064u, cpu->gpr[1], _pgx1, 0x0064u); } #ifdef PSX_COSIM cosim_instr(0x800358C8u); #endif @@ -375167,7 +376055,8 @@ label_BFC1D8CC: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC1D8D0: 2A810064 slti $at, $s4, 100 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (100) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (100) ? 1 : 0); + PGXP_ALU(0x2A810064u, cpu->gpr[1], _pgx1, 0x0064u); } #ifdef PSX_COSIM cosim_instr(0x800358D0u); #endif @@ -376281,7 +377170,8 @@ label_BFC1DA18: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC1DA24: 31F80010 andi $t8, $t7, 0x10 */ - cpu->gpr[24] = cpu->gpr[15] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x10u; + PGXP_ALU(0x31F80010u, cpu->gpr[24], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80035A24u); #endif @@ -376623,7 +377513,8 @@ label_BFC1DA78: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC1DA84: 31090010 andi $t1, $t0, 0x10 */ - cpu->gpr[9] = cpu->gpr[8] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x10u; + PGXP_ALU(0x31090010u, cpu->gpr[9], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80035A84u); #endif @@ -377295,7 +378186,8 @@ label_BFC1DB30: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC1DB3C: 304E0080 andi $t6, $v0, 0x80 */ - cpu->gpr[14] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x304E0080u, cpu->gpr[14], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80035B3Cu); #endif @@ -377535,7 +378427,8 @@ label_BFC1DB78: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC1DB84: 33280008 andi $t0, $t9, 0x8 */ - cpu->gpr[8] = cpu->gpr[25] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x8u; + PGXP_ALU(0x33280008u, cpu->gpr[8], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80035B84u); #endif @@ -377582,7 +378475,8 @@ label_BFC1DB90: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC1DB90: 30490040 andi $t1, $v0, 0x40 */ - cpu->gpr[9] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[9] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x30490040u, cpu->gpr[9], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80035B90u); #endif @@ -377597,7 +378491,8 @@ label_BFC1DB90: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC1DB98: 304B0080 andi $t3, $v0, 0x80 */ - cpu->gpr[11] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x304B0080u, cpu->gpr[11], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80035B98u); #endif @@ -377690,7 +378585,8 @@ label_BFC1DBAC: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC1DBAC: 304B0080 andi $t3, $v0, 0x80 */ - cpu->gpr[11] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x304B0080u, cpu->gpr[11], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80035BACu); #endif @@ -377788,7 +378684,8 @@ label_BFC1DBC4: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC1DBC4: 304C0010 andi $t4, $v0, 0x10 */ - cpu->gpr[12] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304C0010u, cpu->gpr[12], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80035BC4u); #endif @@ -380750,7 +381647,8 @@ label_BFC1DF94: psx_cyc_step(cpu, 0x2000006u); #endif /* 0xBFC1DFA4: 0059082B sltu $at, $v0, $t9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0059082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80035FA4u); #endif @@ -381184,7 +382082,8 @@ label_BFC1E024: psx_cyc_step(cpu, 0x802u); #endif /* 0xBFC1E030: 2D610095 sltiu $at, $t3, 149 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < 0x00000095u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < 0x00000095u ? 1 : 0); + PGXP_ALU(0x2D610095u, cpu->gpr[1], _pgx1, 0x0095u); } #ifdef PSX_COSIM cosim_instr(0x80036030u); #endif @@ -381367,7 +382266,8 @@ label_BFC1E058: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC1E064: 2CC10007 sltiu $at, $a2, 7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < 0x00000007u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < 0x00000007u ? 1 : 0); + PGXP_ALU(0x2CC10007u, cpu->gpr[1], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x80036064u); #endif @@ -381543,7 +382443,8 @@ label_BFC1E084: psx_cyc_step(cpu, 0x2002u); #endif /* 0xBFC1E090: 2DA10006 sltiu $at, $t5, 6 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < 0x00000006u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < 0x00000006u ? 1 : 0); + PGXP_ALU(0x2DA10006u, cpu->gpr[1], _pgx1, 0x0006u); } #ifdef PSX_COSIM cosim_instr(0x80036090u); #endif @@ -382773,7 +383674,8 @@ label_BFC1E1CC: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC1E1E0: 2DC10018 sltiu $at, $t6, 24 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000018u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000018u ? 1 : 0); + PGXP_ALU(0x2DC10018u, cpu->gpr[1], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0x800361E0u); #endif @@ -385607,7 +386509,8 @@ label_BFC1E3F0: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC1E404: 2DC10018 sltiu $at, $t6, 24 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000018u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000018u ? 1 : 0); + PGXP_ALU(0x2DC10018u, cpu->gpr[1], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0x80036404u); #endif @@ -386210,7 +387113,8 @@ label_BFC1E48C: psx_cyc_step(cpu, 0x802u); #endif /* 0xBFC1E4B4: 2D61000A sltiu $at, $t3, 10 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < 0x0000000Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < 0x0000000Au ? 1 : 0); + PGXP_ALU(0x2D61000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x800364B4u); #endif @@ -387155,7 +388059,8 @@ label_BFC1E5B8: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC1E5B8: 30A30003 andi $v1, $a1, 0x3 */ - cpu->gpr[3] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[3] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30A30003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x800365B8u); #endif @@ -388040,7 +388945,8 @@ label_BFC1E6BC: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC1E6C8: 33280080 andi $t0, $t9, 0x80 */ - cpu->gpr[8] = cpu->gpr[25] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x80u; + PGXP_ALU(0x33280080u, cpu->gpr[8], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x800366C8u); #endif @@ -388184,7 +389090,8 @@ label_BFC1E6E4: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1E6F8: 3084007F andi $a0, $a0, 0x7F */ - cpu->gpr[4] = cpu->gpr[4] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x7Fu; + PGXP_ALU(0x3084007Fu, cpu->gpr[4], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x800366F8u); #endif @@ -388356,7 +389263,8 @@ label_BFC1E718: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC1E72C: 3084007F andi $a0, $a0, 0x7F */ - cpu->gpr[4] = cpu->gpr[4] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x7Fu; + PGXP_ALU(0x3084007Fu, cpu->gpr[4], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x8003672Cu); #endif @@ -389041,7 +389949,8 @@ label_BFC1E7E0: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC1E7F4: 0043082A slt $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800367F4u); #endif @@ -389159,7 +390068,8 @@ label_BFC1E80C: psx_cyc_step(cpu, 0x2000Au); #endif /* 0xBFC1E818: 0223082A slt $at, $s1, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0223082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036818u); #endif @@ -389245,7 +390155,8 @@ label_BFC1E824: psx_cyc_step(cpu, 0x100Au); #endif /* 0xBFC1E834: 006C082B sltu $at, $v1, $t4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[12] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[12] ? 1 : 0); + PGXP_ALU(0x006C082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036834u); #endif @@ -389363,7 +390274,8 @@ label_BFC1E84C: psx_cyc_step(cpu, 0x22002u); #endif /* 0xBFC1E858: 022D082B sltu $at, $s1, $t5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)(cpu->gpr[17] < cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x022D082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036858u); #endif @@ -390399,7 +391311,8 @@ label_BFC1E974: psx_cyc_step(cpu, 0x406u); #endif /* 0xBFC1E980: 0142082A slt $at, $t2, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0142082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036980u); #endif @@ -391223,7 +392136,8 @@ label_BFC1EA60: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC1EA6C: 0050082B sltu $at, $v0, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0050082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036A6Cu); #endif @@ -392056,7 +392970,8 @@ label_BFC1EB50: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC1EB5C: 0050082B sltu $at, $v0, $s0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0050082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036B5Cu); #endif @@ -392193,7 +393108,8 @@ label_BFC1EB74: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC1EB88: 01CF082B sltu $at, $t6, $t7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x01CF082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036B88u); #endif @@ -393442,7 +394358,8 @@ label_BFC1ECE0: psx_cyc_step(cpu, 0x2000006u); #endif /* 0xBFC1ECF4: 0322082B sltu $at, $t9, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[25] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[25] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0322082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036CF4u); #endif @@ -393603,7 +394520,8 @@ label_BFC1ED1C: psx_cyc_step(cpu, 0x20202u); #endif /* 0xBFC1ED28: 0131082B sltu $at, $t1, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0131082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036D28u); #endif @@ -394184,7 +395102,8 @@ label_BFC1EDB4: psx_cyc_step(cpu, 0x806u); #endif /* 0xBFC1EDC8: 0162082B sltu $at, $t3, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0162082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036DC8u); #endif @@ -394348,7 +395267,8 @@ label_BFC1EDF0: psx_cyc_step(cpu, 0x24002u); #endif /* 0xBFC1EDFC: 01D1082B sltu $at, $t6, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x01D1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036DFCu); #endif @@ -395198,7 +396118,8 @@ label_BFC1EEE0: psx_cyc_step(cpu, 0x20006u); #endif /* 0xBFC1EEE0: 0051082A slt $at, $v0, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0051082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036EE0u); #endif @@ -395514,7 +396435,8 @@ label_BFC1EF40: psx_cyc_step(cpu, 0x20006u); #endif /* 0xBFC1EF40: 0051082A slt $at, $v0, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0051082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80036F40u); #endif @@ -395684,7 +396606,8 @@ label_BFC1EF5C: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC1EF78: 28810015 slti $at, $a0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (21) ? 1 : 0); + PGXP_ALU(0x28810015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x80036F78u); #endif @@ -397391,7 +398314,8 @@ label_BFC1F160: psx_cyc_step(cpu, 0x808u); #endif /* 0xBFC1F16C: 306B0010 andi $t3, $v1, 0x10 */ - cpu->gpr[11] = cpu->gpr[3] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[11] = cpu->gpr[3] & 0x10u; + PGXP_ALU(0x306B0010u, cpu->gpr[11], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8003716Cu); #endif @@ -398021,7 +398945,8 @@ label_BFC1F224: psx_cyc_step(cpu, 0x408u); #endif /* 0xBFC1F224: 306A0008 andi $t2, $v1, 0x8 */ - cpu->gpr[10] = cpu->gpr[3] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[10] = cpu->gpr[3] & 0x8u; + PGXP_ALU(0x306A0008u, cpu->gpr[10], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80037224u); #endif @@ -398081,7 +399006,8 @@ label_BFC1F230: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC1F238: 30680004 andi $t0, $v1, 0x4 */ - cpu->gpr[8] = cpu->gpr[3] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[8] = cpu->gpr[3] & 0x4u; + PGXP_ALU(0x30680004u, cpu->gpr[8], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80037238u); #endif @@ -398249,7 +399175,8 @@ label_BFC1F268: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC1F26C: 304C0080 andi $t4, $v0, 0x80 */ - cpu->gpr[12] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x304C0080u, cpu->gpr[12], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x8003726Cu); #endif @@ -398340,7 +399267,8 @@ label_BFC1F284: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC1F284: 304E0040 andi $t6, $v0, 0x40 */ - cpu->gpr[14] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x304E0040u, cpu->gpr[14], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80037284u); #endif @@ -398355,7 +399283,8 @@ label_BFC1F284: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC1F28C: 30590010 andi $t9, $v0, 0x10 */ - cpu->gpr[25] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30590010u, cpu->gpr[25], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8003728Cu); #endif @@ -398414,7 +399343,8 @@ label_BFC1F290: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC1F29C: 30590010 andi $t9, $v0, 0x10 */ - cpu->gpr[25] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30590010u, cpu->gpr[25], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8003729Cu); #endif @@ -398521,7 +399451,8 @@ label_BFC1F2B8: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC1F2B8: 30680004 andi $t0, $v1, 0x4 */ - cpu->gpr[8] = cpu->gpr[3] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[8] = cpu->gpr[3] & 0x4u; + PGXP_ALU(0x30680004u, cpu->gpr[8], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x800372B8u); #endif @@ -398582,7 +399513,8 @@ label_BFC1F2C4: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC1F2C4: 30490008 andi $t1, $v0, 0x8 */ - cpu->gpr[9] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[9] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30490008u, cpu->gpr[9], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x800372C4u); #endif @@ -399140,7 +400072,8 @@ label_BFC1F364: psx_cyc_step(cpu, 0x408u); #endif /* 0xBFC1F36C: 306A0001 andi $t2, $v1, 0x1 */ - cpu->gpr[10] = cpu->gpr[3] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[10] = cpu->gpr[3] & 0x1u; + PGXP_ALU(0x306A0001u, cpu->gpr[10], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8003736Cu); #endif @@ -399172,7 +400105,8 @@ label_BFC1F370: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC1F370: 30580040 andi $t8, $v0, 0x40 */ - cpu->gpr[24] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x30580040u, cpu->gpr[24], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80037370u); #endif @@ -399219,7 +400153,8 @@ label_BFC1F37C: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC1F37C: 30480020 andi $t0, $v0, 0x20 */ - cpu->gpr[8] = cpu->gpr[2] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x20u; + PGXP_ALU(0x30480020u, cpu->gpr[8], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x8003737Cu); #endif @@ -399269,7 +400204,8 @@ label_BFC1F388: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC1F388: 30490010 andi $t1, $v0, 0x10 */ - cpu->gpr[9] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[9] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x30490010u, cpu->gpr[9], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80037388u); #endif @@ -399287,7 +400223,8 @@ label_BFC1F388: psx_cyc_step(cpu, 0x408u); #endif /* 0xBFC1F390: 306A0001 andi $t2, $v1, 0x1 */ - cpu->gpr[10] = cpu->gpr[3] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[10] = cpu->gpr[3] & 0x1u; + PGXP_ALU(0x306A0001u, cpu->gpr[10], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80037390u); #endif @@ -399385,7 +400322,8 @@ label_BFC1F3A8: psx_cyc_step(cpu, 0x408u); #endif /* 0xBFC1F3A8: 306A0001 andi $t2, $v1, 0x1 */ - cpu->gpr[10] = cpu->gpr[3] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[10] = cpu->gpr[3] & 0x1u; + PGXP_ALU(0x306A0001u, cpu->gpr[10], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800373A8u); #endif @@ -399446,7 +400384,8 @@ label_BFC1F3B4: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC1F3B4: 304B0080 andi $t3, $v0, 0x80 */ - cpu->gpr[11] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x304B0080u, cpu->gpr[11], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x800373B4u); #endif @@ -400624,7 +401563,8 @@ label_BFC1F50C: psx_cyc_step(cpu, 0x28u); #endif /* 0xBFC1F50C: 30A30003 andi $v1, $a1, 0x3 */ - cpu->gpr[3] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[3] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30A30003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x8003750Cu); #endif @@ -401159,7 +402099,8 @@ label_BFC1F5B0: psx_cyc_step(cpu, 0x210u); #endif /* 0xBFC1F5B4: 308900FF andi $t1, $a0, 0xFF */ - cpu->gpr[9] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[9] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800375B4u); #endif @@ -403359,7 +404300,8 @@ label_BFC1F84C: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC1F84C: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003784Cu); #endif @@ -403377,7 +404319,8 @@ label_BFC1F84C: psx_cyc_step(cpu, 0x46u); #endif /* 0xBFC1F854: 00C2082B sltu $at, $a2, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[6] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x00C2082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80037854u); #endif @@ -409888,7 +410831,8 @@ label_BFC2020C: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC20220: 0043082A slt $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80038220u); #endif @@ -410016,7 +410960,8 @@ label_BFC20238: psx_cyc_step(cpu, 0x1000Au); #endif /* 0xBFC20244: 0203082A slt $at, $s0, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0203082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80038244u); #endif @@ -411583,7 +412528,8 @@ label_BFC203E4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC203E4: 28410002 slti $at, $v0, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (2) ? 1 : 0); + PGXP_ALU(0x28410002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x800383E4u); #endif @@ -411771,7 +412717,8 @@ label_BFC2041C: psx_cyc_step(cpu, 0x20006u); #endif /* 0xBFC2041C: 0222082A slt $at, $s1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0222082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003841Cu); #endif @@ -412513,7 +413460,8 @@ label_BFC204DC: psx_cyc_step(cpu, 0x2000006u); #endif /* 0xBFC204F0: 0059082B sltu $at, $v0, $t9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0059082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800384F0u); #endif @@ -414399,7 +415347,8 @@ label_BFC206D0: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC206DC: 004E082A slt $at, $v0, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x004E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800386DCu); #endif @@ -414954,7 +415903,8 @@ label_BFC20770: psx_cyc_step(cpu, 0x20006u); #endif /* 0xBFC20770: 0051082A slt $at, $v0, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0051082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80038770u); #endif @@ -415446,7 +416396,8 @@ label_BFC207F8: psx_cyc_step(cpu, 0x20006u); #endif /* 0xBFC207F8: 0051082A slt $at, $v0, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0051082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800387F8u); #endif @@ -415783,7 +416734,8 @@ label_BFC20860: psx_cyc_step(cpu, 0x20006u); #endif /* 0xBFC20860: 0051082A slt $at, $v0, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0051082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80038860u); #endif @@ -415983,7 +416935,8 @@ label_BFC20884: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC208A0: 28810015 slti $at, $a0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (21) ? 1 : 0); + PGXP_ALU(0x28810015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800388A0u); #endif @@ -416880,7 +417833,8 @@ label_BFC20990: psx_cyc_step(cpu, 0x2802u); #endif /* 0xBFC209A4: 016D082B sltu $at, $t3, $t5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x016D082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800389A4u); #endif @@ -417437,7 +418391,8 @@ label_BFC20A40: psx_cyc_step(cpu, 0x602u); #endif /* 0xBFC20A54: 012A082B sltu $at, $t1, $t2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x012A082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80038A54u); #endif @@ -422434,7 +423389,8 @@ label_BFC20F24: psx_cyc_step(cpu, 0x20010u); #endif /* 0xBFC20F34: 309100FF andi $s1, $a0, 0xFF */ - cpu->gpr[17] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[17] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x309100FFu, cpu->gpr[17], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80038F34u); #endif @@ -427368,7 +428324,8 @@ label_BFC213E8: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC213E8: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800393E8u); #endif @@ -427384,7 +428341,8 @@ label_BFC213E8: psx_cyc_step(cpu, 0x14u); #endif /* 0xBFC213F0: 3082000F andi $v0, $a0, 0xF */ - cpu->gpr[2] = cpu->gpr[4] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[2] = cpu->gpr[4] & 0xFu; + PGXP_ALU(0x3082000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x800393F0u); #endif @@ -427720,7 +428678,8 @@ label_BFC21438: psx_cyc_step(cpu, 0x50002u); #endif /* 0xBFC21448: 0212082A slt $at, $s0, $s2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0212082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039448u); #endif @@ -427785,7 +428744,8 @@ label_BFC2144C: psx_cyc_step(cpu, 0x50002u); #endif /* 0xBFC2145C: 0212082A slt $at, $s0, $s2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0212082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003945Cu); #endif @@ -427843,7 +428803,8 @@ label_BFC21468: psx_cyc_step(cpu, 0x50002u); #endif /* 0xBFC21468: 0212082A slt $at, $s0, $s2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0212082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039468u); #endif @@ -428370,7 +429331,8 @@ label_BFC214CC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC214DC: 2841003D slti $at, $v0, 61 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (61) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (61) ? 1 : 0); + PGXP_ALU(0x2841003Du, cpu->gpr[1], _pgx1, 0x003Du); } #ifdef PSX_COSIM cosim_instr(0x800394DCu); #endif @@ -428879,7 +429841,8 @@ label_BFC21564: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2156C: 28410003 slti $at, $v0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3) ? 1 : 0); + PGXP_ALU(0x28410003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x8003956Cu); #endif @@ -429382,7 +430345,8 @@ label_BFC21610: psx_cyc_step(cpu, 0x8006u); #endif /* 0xBFC2161C: 004F082A slt $at, $v0, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x004F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003961Cu); #endif @@ -432059,7 +433023,8 @@ label_BFC218E0: psx_cyc_step(cpu, 0x8012u); #endif /* 0xBFC218E8: 00817824 and $t7, $a0, $at */ - cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800398E8u); #endif @@ -432251,7 +433216,8 @@ label_BFC21914: psx_cyc_step(cpu, 0x1000012u); #endif /* 0xBFC21918: 0081C024 and $t8, $a0, $at */ - cpu->gpr[24] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x0081C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039918u); #endif @@ -434511,7 +435477,8 @@ label_BFC21B7C: psx_cyc_step(cpu, 0x1006u); #endif /* 0xBFC21B98: 0182082A slt $at, $t4, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0182082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039B98u); #endif @@ -435218,7 +436185,8 @@ label_BFC21C78: psx_cyc_step(cpu, 0x40102u); #endif /* 0xBFC21C84: 0248082A slt $at, $s2, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0248082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039C84u); #endif @@ -435637,7 +436605,8 @@ label_BFC21D18: psx_cyc_step(cpu, 0x40102u); #endif /* 0xBFC21D20: 0248082A slt $at, $s2, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0248082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039D20u); #endif @@ -435943,7 +436912,8 @@ label_BFC21D88: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC21D90: 28410011 slti $at, $v0, 17 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (17) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (17) ? 1 : 0); + PGXP_ALU(0x28410011u, cpu->gpr[1], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x80039D90u); #endif @@ -435958,7 +436928,8 @@ label_BFC21D88: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC21D98: 28410014 slti $at, $v0, 20 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (20) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (20) ? 1 : 0); + PGXP_ALU(0x28410014u, cpu->gpr[1], _pgx1, 0x0014u); } #ifdef PSX_COSIM cosim_instr(0x80039D98u); #endif @@ -436053,7 +437024,8 @@ label_BFC21DA4: psx_cyc_step(cpu, 0x42002u); #endif /* 0xBFC21DB0: 024D082A slt $at, $s2, $t5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x024D082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039DB0u); #endif @@ -436472,7 +437444,8 @@ label_BFC21E44: psx_cyc_step(cpu, 0x42002u); #endif /* 0xBFC21E4C: 024D082A slt $at, $s2, $t5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x024D082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039E4Cu); #endif @@ -436974,7 +437947,8 @@ label_BFC21EB8: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC21F0C: 28610010 slti $at, $v1, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (16) ? 1 : 0); + PGXP_ALU(0x28610010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80039F0Cu); #endif @@ -437063,7 +438037,8 @@ label_BFC21F18: psx_cyc_step(cpu, 0x42002u); #endif /* 0xBFC21F20: 024D082A slt $at, $s2, $t5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x024D082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039F20u); #endif @@ -437341,7 +438316,8 @@ label_BFC21F78: psx_cyc_step(cpu, 0x2040002u); #endif /* 0xBFC21F80: 0259082A slt $at, $s2, $t9 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0259082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80039F80u); #endif @@ -439363,7 +440339,8 @@ label_BFC221F4: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC22218: 2A61000F slti $at, $s3, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (15) ? 1 : 0); + PGXP_ALU(0x2A61000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003A218u); #endif @@ -439499,7 +440476,8 @@ label_BFC2223C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2223C: 28410020 slti $at, $v0, 32 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (32) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (32) ? 1 : 0); + PGXP_ALU(0x28410020u, cpu->gpr[1], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x8003A23Cu); #endif @@ -439882,7 +440860,8 @@ label_BFC222B0: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC222B0: 2A010041 slti $at, $s0, 65 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (65) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (65) ? 1 : 0); + PGXP_ALU(0x2A010041u, cpu->gpr[1], _pgx1, 0x0041u); } #ifdef PSX_COSIM cosim_instr(0x8003A2B0u); #endif @@ -440038,7 +441017,8 @@ label_BFC222D4: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC222D4: 2A010040 slti $at, $s0, 64 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (64) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (64) ? 1 : 0); + PGXP_ALU(0x2A010040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x8003A2D4u); #endif @@ -440171,7 +441151,8 @@ label_BFC222F4: psx_cyc_step(cpu, 0x2080002u); #endif /* 0xBFC222FC: 0279082A slt $at, $s3, $t9 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0279082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003A2FCu); #endif @@ -440222,7 +441203,8 @@ label_BFC22308: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC22308: 2A61000F slti $at, $s3, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (15) ? 1 : 0); + PGXP_ALU(0x2A61000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003A308u); #endif @@ -440430,7 +441412,8 @@ label_BFC2233C: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC22340: 2A61000F slti $at, $s3, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (15) ? 1 : 0); + PGXP_ALU(0x2A61000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003A340u); #endif @@ -442301,7 +443284,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC22618: 312900FF andi $t1, $t1, 0xFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFu; + PGXP_ALU(0x312900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A618u); #endif @@ -442321,7 +443305,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC22620: 310800FF andi $t0, $t0, 0xFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310800FFu, cpu->gpr[8], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A620u); #endif @@ -442338,7 +443323,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0xA0u); #endif /* 0xBFC22628: 30A700FF andi $a3, $a1, 0xFF */ - cpu->gpr[7] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[7] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A628u); #endif @@ -442358,7 +443344,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0xC0u); #endif /* 0xBFC22630: 30E600FF andi $a2, $a3, 0xFF */ - cpu->gpr[6] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[6] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30E600FFu, cpu->gpr[6], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A630u); #endif @@ -442375,7 +443362,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x500u); #endif /* 0xBFC22638: 310A00FF andi $t2, $t0, 0xFF */ - cpu->gpr[10] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[10] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310A00FFu, cpu->gpr[10], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A638u); #endif @@ -442395,7 +443383,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x1200u); #endif /* 0xBFC22640: 312C00FF andi $t4, $t1, 0xFF */ - cpu->gpr[12] = cpu->gpr[9] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[12] = cpu->gpr[9] & 0xFFu; + PGXP_ALU(0x312C00FFu, cpu->gpr[12], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A640u); #endif @@ -442403,7 +443392,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x810u); #endif /* 0xBFC22644: 308B00FF andi $t3, $a0, 0xFF */ - cpu->gpr[11] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[11] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308B00FFu, cpu->gpr[11], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A644u); #endif @@ -442491,7 +443481,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC2266C: 30E700FF andi $a3, $a3, 0xFF */ - cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30E700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A66Cu); #endif @@ -442511,7 +443502,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC22674: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A674u); #endif @@ -442528,7 +443520,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC2267C: 306400FF andi $a0, $v1, 0xFF */ - cpu->gpr[4] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[4] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A67Cu); #endif @@ -442548,7 +443541,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x50u); #endif /* 0xBFC22684: 308600FF andi $a2, $a0, 0xFF */ - cpu->gpr[6] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[6] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308600FFu, cpu->gpr[6], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A684u); #endif @@ -442565,7 +443559,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x420u); #endif /* 0xBFC2268C: 30AA00FF andi $t2, $a1, 0xFF */ - cpu->gpr[10] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[10] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30AA00FFu, cpu->gpr[10], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A68Cu); #endif @@ -442585,7 +443580,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x1080u); #endif /* 0xBFC22694: 30EC00FF andi $t4, $a3, 0xFF */ - cpu->gpr[12] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[12] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30EC00FFu, cpu->gpr[12], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A694u); #endif @@ -442593,7 +443589,8 @@ label_BFC225A8: psx_cyc_step(cpu, 0x80000800u); #endif /* 0xBFC22698: 33EB00FF andi $t3, $ra, 0xFF */ - cpu->gpr[11] = cpu->gpr[31] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[31]; cpu->gpr[11] = cpu->gpr[31] & 0xFFu; + PGXP_ALU(0x33EB00FFu, cpu->gpr[11], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003A698u); #endif @@ -442947,7 +443944,8 @@ label_BFC226E4: psx_cyc_step(cpu, 0x8012u); #endif /* 0xBFC226EC: 00817824 and $t7, $a0, $at */ - cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003A6ECu); #endif @@ -444048,7 +445046,8 @@ label_BFC227EC: psx_cyc_step(cpu, 0x2000012u); #endif /* 0xBFC227F0: 0081C824 and $t9, $a0, $at */ - cpu->gpr[25] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[25] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x0081C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003A7F0u); #endif @@ -444197,7 +445196,8 @@ label_BFC22810: psx_cyc_step(cpu, 0x112u); #endif /* 0xBFC22814: 00814024 and $t0, $a0, $at */ - cpu->gpr[8] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00814024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003A814u); #endif @@ -444254,7 +445254,8 @@ label_BFC22820: psx_cyc_step(cpu, 0x212u); #endif /* 0xBFC22824: 00814824 and $t1, $a0, $at */ - cpu->gpr[9] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00814824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003A824u); #endif @@ -444311,7 +445312,8 @@ label_BFC22830: psx_cyc_step(cpu, 0x412u); #endif /* 0xBFC22834: 00815024 and $t2, $a0, $at */ - cpu->gpr[10] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[10] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00815024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003A834u); #endif @@ -444368,7 +445370,8 @@ label_BFC22840: psx_cyc_step(cpu, 0x812u); #endif /* 0xBFC22844: 00815824 and $t3, $a0, $at */ - cpu->gpr[11] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[11] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00815824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003A844u); #endif @@ -447358,7 +448361,8 @@ label_BFC22B94: psx_cyc_step(cpu, 0x4012u); #endif /* 0xBFC22BA0: 00817024 and $t6, $a0, $at */ - cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003ABA0u); #endif @@ -447804,7 +448808,8 @@ label_BFC22C00: psx_cyc_step(cpu, 0x8012u); #endif /* 0xBFC22C08: 00817824 and $t7, $a0, $at */ - cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003AC08u); #endif @@ -448095,7 +449100,8 @@ label_BFC22C48: psx_cyc_step(cpu, 0x1000012u); #endif /* 0xBFC22C4C: 0081C024 and $t8, $a0, $at */ - cpu->gpr[24] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x0081C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003AC4Cu); #endif @@ -448615,7 +449621,8 @@ label_BFC22CC4: psx_cyc_step(cpu, 0x2000012u); #endif /* 0xBFC22CC8: 0081C824 and $t9, $a0, $at */ - cpu->gpr[25] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[25] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x0081C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003ACC8u); #endif @@ -449007,7 +450014,8 @@ label_BFC22D20: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC22D2C: 2901003C slti $at, $t0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (60) ? 1 : 0); + PGXP_ALU(0x2901003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003AD2Cu); #endif @@ -449377,7 +450385,8 @@ label_BFC22D80: psx_cyc_step(cpu, 0x412u); #endif /* 0xBFC22D84: 00815024 and $t2, $a0, $at */ - cpu->gpr[10] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[10] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00815024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003AD84u); #endif @@ -449392,7 +450401,8 @@ label_BFC22D80: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC22D8C: 2841003C slti $at, $v0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (60) ? 1 : 0); + PGXP_ALU(0x2841003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003AD8Cu); #endif @@ -449691,7 +450701,8 @@ label_BFC22DC8: psx_cyc_step(cpu, 0x812u); #endif /* 0xBFC22DD0: 00815824 and $t3, $a0, $at */ - cpu->gpr[11] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[11] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00815824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003ADD0u); #endif @@ -449706,7 +450717,8 @@ label_BFC22DC8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC22DD8: 2841003C slti $at, $v0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (60) ? 1 : 0); + PGXP_ALU(0x2841003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003ADD8u); #endif @@ -451442,7 +452454,8 @@ label_BFC22FF8: psx_cyc_step(cpu, 0x80002u); #endif /* 0xBFC22FF8: 2A610002 slti $at, $s3, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (2) ? 1 : 0); + PGXP_ALU(0x2A610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8003AFF8u); #endif @@ -451640,7 +452653,8 @@ label_BFC23020: psx_cyc_step(cpu, 0x400402u); #endif /* 0xBFC23030: 02CA082A slt $at, $s6, $t2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (int32_t)cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (int32_t)cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x02CA082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003B030u); #endif @@ -452221,7 +453235,8 @@ label_BFC230E4: psx_cyc_step(cpu, 0x20022u); #endif /* 0xBFC230E4: 00B1082A slt $at, $a1, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x00B1082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003B0E4u); #endif @@ -452312,7 +453327,8 @@ label_BFC230F8: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC230FC: 0211082A slt $at, $s0, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0211082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003B0FCu); #endif @@ -452719,7 +453735,8 @@ label_BFC2317C: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC23180: 2A21000F slti $at, $s1, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (15) ? 1 : 0); + PGXP_ALU(0x2A21000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003B180u); #endif @@ -453021,7 +454038,8 @@ label_BFC231DC: psx_cyc_step(cpu, 0x40002u); #endif /* 0xBFC231E0: 2A41000F slti $at, $s2, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (15) ? 1 : 0); + PGXP_ALU(0x2A41000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003B1E0u); #endif @@ -454125,7 +455143,8 @@ label_BFC2332C: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC23338: 28610002 slti $at, $v1, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (2) ? 1 : 0); + PGXP_ALU(0x28610002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8003B338u); #endif @@ -455822,7 +456841,8 @@ label_BFC23570: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC23578: 2881003C slti $at, $a0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (60) ? 1 : 0); + PGXP_ALU(0x2881003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003B578u); #endif @@ -455975,7 +456995,8 @@ label_BFC235A4: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC235A4: 2881003C slti $at, $a0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (60) ? 1 : 0); + PGXP_ALU(0x2881003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003B5A4u); #endif @@ -456311,7 +457332,8 @@ label_BFC235D0: psx_cyc_step(cpu, 0x20000u); #endif /* 0xBFC23614: 323100FF andi $s1, $s1, 0xFF */ - cpu->gpr[17] = cpu->gpr[17] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[17] = cpu->gpr[17] & 0xFFu; + PGXP_ALU(0x323100FFu, cpu->gpr[17], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003B614u); #endif @@ -456326,7 +457348,8 @@ label_BFC235D0: psx_cyc_step(cpu, 0x40004u); #endif /* 0xBFC2361C: 305200FF andi $s2, $v0, 0xFF */ - cpu->gpr[18] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[18] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305200FFu, cpu->gpr[18], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003B61Cu); #endif @@ -460735,7 +461758,8 @@ label_BFC23C4C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC23CC8: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003BCC8u); #endif @@ -460764,7 +461788,8 @@ label_BFC23C4C: psx_cyc_step(cpu, 0x50u); #endif /* 0xBFC23CD4: 30C400FF andi $a0, $a2, 0xFF */ - cpu->gpr[4] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[4] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30C400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003BCD4u); #endif @@ -460820,7 +461845,8 @@ label_BFC23C4C: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC23CEC: 312900FF andi $t1, $t1, 0xFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFu; + PGXP_ALU(0x312900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003BCECu); #endif @@ -460831,7 +461857,8 @@ label_BFC23C4C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC23CF0: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003BCF0u); #endif @@ -460839,7 +461866,8 @@ label_BFC23C4C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC23CF4: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003BCF4u); #endif @@ -460847,7 +461875,8 @@ label_BFC23C4C: psx_cyc_step(cpu, 0x108u); #endif /* 0xBFC23CF8: 310300FF andi $v1, $t0, 0xFF */ - cpu->gpr[3] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[3] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8003BCF8u); #endif @@ -462320,7 +463349,8 @@ label_BFC23E7C: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC23E80: 2A01000A slti $at, $s0, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (10) ? 1 : 0); + PGXP_ALU(0x2A01000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x8003BE80u); #endif @@ -463328,7 +464358,8 @@ label_BFC23FA4: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC23FA8: 2A01000A slti $at, $s0, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (10) ? 1 : 0); + PGXP_ALU(0x2A01000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x8003BFA8u); #endif @@ -463971,7 +465002,8 @@ label_BFC24064: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC24068: 2A01000A slti $at, $s0, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (10) ? 1 : 0); + PGXP_ALU(0x2A01000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x8003C068u); #endif @@ -464579,7 +465611,8 @@ label_BFC24114: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC24118: 2A01000A slti $at, $s0, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (10) ? 1 : 0); + PGXP_ALU(0x2A01000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x8003C118u); #endif @@ -465049,7 +466082,8 @@ label_BFC2418C: psx_cyc_step(cpu, 0x206u); #endif /* 0xBFC241AC: 0049082A slt $at, $v0, $t1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0049082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003C1ACu); #endif @@ -465523,7 +466557,8 @@ label_BFC24238: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC24244: 304A1FFF andi $t2, $v0, 0x1FFF */ - cpu->gpr[10] = cpu->gpr[2] & 0x1FFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x1FFFu; + PGXP_ALU(0x304A1FFFu, cpu->gpr[10], _pgx1, 0x1FFFu); } #ifdef PSX_COSIM cosim_instr(0x8003C244u); #endif @@ -466419,7 +467454,8 @@ label_BFC24314: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC24320: 28A1003C slti $at, $a1, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (60) ? 1 : 0); + PGXP_ALU(0x28A1003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003C320u); #endif @@ -467315,7 +468351,8 @@ label_BFC24418: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC2442C: 2A21003C slti $at, $s1, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (60) ? 1 : 0); + PGXP_ALU(0x2A21003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003C42Cu); #endif @@ -468129,7 +469166,8 @@ label_BFC244EC: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC2453C: 2A01000E slti $at, $s0, 14 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (14) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (14) ? 1 : 0); + PGXP_ALU(0x2A01000Eu, cpu->gpr[1], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x8003C53Cu); #endif @@ -468407,7 +469445,8 @@ label_BFC24598: psx_cyc_step(cpu, 0x40002u); #endif /* 0xBFC2459C: 2A41000E slti $at, $s2, 14 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (14) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (14) ? 1 : 0); + PGXP_ALU(0x2A41000Eu, cpu->gpr[1], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x8003C59Cu); #endif @@ -469118,7 +470157,8 @@ label_BFC24664: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC24670: 2861003C slti $at, $v1, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (60) ? 1 : 0); + PGXP_ALU(0x2861003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003C670u); #endif @@ -470086,7 +471126,8 @@ label_BFC24770: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC247C0: 29010010 slti $at, $t0, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (16) ? 1 : 0); + PGXP_ALU(0x29010010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8003C7C0u); #endif @@ -471356,7 +472397,8 @@ label_BFC24960: psx_cyc_step(cpu, 0x302u); #endif /* 0xBFC2496C: 0128082A slt $at, $t1, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0128082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003C96Cu); #endif @@ -471692,7 +472734,8 @@ label_BFC249B8: psx_cyc_step(cpu, 0x1802u); #endif /* 0xBFC249C4: 018B082A slt $at, $t4, $t3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x018B082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003C9C4u); #endif @@ -471870,7 +472913,8 @@ label_BFC249F0: psx_cyc_step(cpu, 0x100006u); #endif /* 0xBFC249F0: 0282082A slt $at, $s4, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0282082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003C9F0u); #endif @@ -472431,7 +473475,8 @@ label_BFC24A7C: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC24A88: 29C1003C slti $at, $t6, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (60) ? 1 : 0); + PGXP_ALU(0x29C1003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x8003CA88u); #endif @@ -473403,7 +474448,8 @@ label_BFC24BC4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC24BCC: 2841000F slti $at, $v0, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + PGXP_ALU(0x2841000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003CBCCu); #endif @@ -473526,7 +474572,8 @@ label_BFC24BDC: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC24BF4: 29C10010 slti $at, $t6, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (16) ? 1 : 0); + PGXP_ALU(0x29C10010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8003CBF4u); #endif @@ -475095,7 +476142,8 @@ label_BFC24DFC: psx_cyc_step(cpu, 0x2004002u); #endif /* 0xBFC24E08: 032E082A slt $at, $t9, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x032E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003CE08u); #endif @@ -475425,7 +476473,8 @@ label_BFC24E54: psx_cyc_step(cpu, 0x1000402u); #endif /* 0xBFC24E60: 0158082A slt $at, $t2, $t8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x0158082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003CE60u); #endif @@ -475609,7 +476658,8 @@ label_BFC24E8C: psx_cyc_step(cpu, 0x100006u); #endif /* 0xBFC24E8C: 0282082A slt $at, $s4, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0282082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003CE8Cu); #endif @@ -475786,7 +476836,8 @@ label_BFC24EB4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC24EBC: 2841000F slti $at, $v0, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + PGXP_ALU(0x2841000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8003CEBCu); #endif @@ -480786,7 +481837,8 @@ label_BFC253E4: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC253F8: 0050082A slt $at, $v0, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0050082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D3F8u); #endif @@ -480870,7 +481922,8 @@ label_BFC2540C: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC2540C: 0050082A slt $at, $v0, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0050082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D40Cu); #endif @@ -482219,7 +483272,8 @@ label_BFC255A0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC255B4: 38420001 xori $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] ^ 0x1u; + PGXP_ALU(0x38420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8003D5B4u); #endif @@ -483082,7 +484136,8 @@ label_BFC256E4: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC256F0: 29C10002 slti $at, $t6, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (2) ? 1 : 0); + PGXP_ALU(0x29C10002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8003D6F0u); #endif @@ -483155,7 +484210,8 @@ label_BFC256FC: psx_cyc_step(cpu, 0x8002u); #endif /* 0xBFC25708: 29E10002 slti $at, $t7, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (2) ? 1 : 0); + PGXP_ALU(0x29E10002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8003D708u); #endif @@ -483626,7 +484682,8 @@ label_BFC25788: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC25798: 2DC14000 sltiu $at, $t6, 16384 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00004000u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00004000u ? 1 : 0); + PGXP_ALU(0x2DC14000u, cpu->gpr[1], _pgx1, 0x4000u); } #ifdef PSX_COSIM cosim_instr(0x8003D798u); #endif @@ -483730,7 +484787,8 @@ label_BFC257A4: psx_cyc_step(cpu, 0x3000008u); #endif /* 0xBFC257BC: 0078C826 xor $t9, $v1, $t8 */ - cpu->gpr[25] = cpu->gpr[3] ^ cpu->gpr[24]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[3] ^ cpu->gpr[24]; + PGXP_ALU(0x0078C826u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D7BCu); #endif @@ -483750,7 +484808,8 @@ label_BFC257A4: psx_cyc_step(cpu, 0x304u); #endif /* 0xBFC257C4: 01024826 xor $t1, $t0, $v0 */ - cpu->gpr[9] = cpu->gpr[8] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[9] = cpu->gpr[8] ^ cpu->gpr[2]; + PGXP_ALU(0x01024826u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D7C4u); #endif @@ -484006,7 +485065,8 @@ label_BFC2580C: psx_cyc_step(cpu, 0xC004u); #endif /* 0xBFC25818: 01C27826 xor $t7, $t6, $v0 */ - cpu->gpr[15] = cpu->gpr[14] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[14] ^ cpu->gpr[2]; + PGXP_ALU(0x01C27826u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D818u); #endif @@ -484035,7 +485095,8 @@ label_BFC2580C: psx_cyc_step(cpu, 0x2000104u); #endif /* 0xBFC25824: 03224026 xor $t0, $t9, $v0 */ - cpu->gpr[8] = cpu->gpr[25] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[25] ^ cpu->gpr[2]; + PGXP_ALU(0x03224026u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D824u); #endif @@ -484133,7 +485194,8 @@ label_BFC25840: psx_cyc_step(cpu, 0x100600u); #endif /* 0xBFC25848: 01345024 and $t2, $t1, $s4 */ - cpu->gpr[10] = cpu->gpr[9] & cpu->gpr[20]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[10] = cpu->gpr[9] & cpu->gpr[20]; + PGXP_ALU(0x01345024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D848u); #endif @@ -484167,7 +485229,8 @@ label_BFC25840: psx_cyc_step(cpu, 0x1802u); #endif /* 0xBFC25858: 01616024 and $t4, $t3, $at */ - cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[1]; + PGXP_ALU(0x01616024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D858u); #endif @@ -484522,7 +485585,8 @@ label_BFC2592C: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC25938: 0082082A slt $at, $a0, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0082082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D938u); #endif @@ -484638,7 +485702,8 @@ label_BFC2594C: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC25958: 0044082A slt $at, $v0, $a0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0044082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D958u); #endif @@ -484733,7 +485798,8 @@ label_BFC25968: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC25974: 00A2082A slt $at, $a1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x00A2082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D974u); #endif @@ -484846,7 +485912,8 @@ label_BFC25988: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC25994: 0045082A slt $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003D994u); #endif @@ -485218,7 +486285,8 @@ label_BFC25A0C: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC25A14: 308300F0 andi $v1, $a0, 0xF0 */ - cpu->gpr[3] = cpu->gpr[4] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0xF0u; + PGXP_ALU(0x308300F0u, cpu->gpr[3], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x8003DA14u); #endif @@ -485419,7 +486487,8 @@ label_BFC25A2C: psx_cyc_step(cpu, 0x601u); #endif /* 0xBFC25A50: 01205027 nor $t2, $t1, $zero */ - cpu->gpr[10] = ~(cpu->gpr[9] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[10] = ~(cpu->gpr[9] | cpu->gpr[0]); + PGXP_ALU(0x01205027u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003DA50u); #endif @@ -485427,7 +486496,8 @@ label_BFC25A2C: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC25A54: 314B0008 andi $t3, $t2, 0x8 */ - cpu->gpr[11] = cpu->gpr[10] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x8u; + PGXP_ALU(0x314B0008u, cpu->gpr[11], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x8003DA54u); #endif @@ -485612,7 +486682,8 @@ label_BFC25A88: psx_cyc_step(cpu, 0x1008001u); #endif /* 0xBFC25A90: 01E0C027 nor $t8, $t7, $zero */ - cpu->gpr[24] = ~(cpu->gpr[15] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[24] = ~(cpu->gpr[15] | cpu->gpr[0]); + PGXP_ALU(0x01E0C027u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003DA90u); #endif @@ -485620,7 +486691,8 @@ label_BFC25A88: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC25A94: 33190004 andi $t9, $t8, 0x4 */ - cpu->gpr[25] = cpu->gpr[24] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x4u; + PGXP_ALU(0x33190004u, cpu->gpr[25], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x8003DA94u); #endif @@ -485737,7 +486809,8 @@ label_BFC25AB4: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC25ABC: 314BFFFF andi $t3, $t2, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8003DABCu); #endif @@ -485851,7 +486924,8 @@ label_BFC25AD4: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC25AE0: 306300F0 andi $v1, $v1, 0xF0 */ - cpu->gpr[3] = cpu->gpr[3] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xF0u; + PGXP_ALU(0x306300F0u, cpu->gpr[3], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x8003DAE0u); #endif @@ -486119,7 +487193,8 @@ label_BFC25B14: psx_cyc_step(cpu, 0x601u); #endif /* 0xBFC25B30: 01205027 nor $t2, $t1, $zero */ - cpu->gpr[10] = ~(cpu->gpr[9] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[10] = ~(cpu->gpr[9] | cpu->gpr[0]); + PGXP_ALU(0x01205027u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003DB30u); #endif @@ -486127,7 +487202,8 @@ label_BFC25B14: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC25B34: 314BFFFF andi $t3, $t2, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8003DB34u); #endif @@ -486160,7 +487236,8 @@ label_BFC25B14: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC25B44: 306300F0 andi $v1, $v1, 0xF0 */ - cpu->gpr[3] = cpu->gpr[3] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xF0u; + PGXP_ALU(0x306300F0u, cpu->gpr[3], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x8003DB44u); #endif @@ -489896,7 +490973,8 @@ label_BFC25F88: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC25F98: 2A0100B4 slti $at, $s0, 180 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (180) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (180) ? 1 : 0); + PGXP_ALU(0x2A0100B4u, cpu->gpr[1], _pgx1, 0x00B4u); } #ifdef PSX_COSIM cosim_instr(0x8003DF98u); #endif @@ -489978,7 +491056,8 @@ label_BFC25FA4: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC25FA8: 2A0101B5 slti $at, $s0, 437 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (437) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (437) ? 1 : 0); + PGXP_ALU(0x2A0101B5u, cpu->gpr[1], _pgx1, 0x01B5u); } #ifdef PSX_COSIM cosim_instr(0x8003DFA8u); #endif @@ -490089,7 +491168,8 @@ label_BFC25FC4: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC25FC4: 2A0101B5 slti $at, $s0, 437 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (437) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (437) ? 1 : 0); + PGXP_ALU(0x2A0101B5u, cpu->gpr[1], _pgx1, 0x01B5u); } #ifdef PSX_COSIM cosim_instr(0x8003DFC4u); #endif @@ -491130,7 +492210,8 @@ label_BFC26110: psx_cyc_step(cpu, 0x10022u); #endif /* 0xBFC26114: 00B0082A slt $at, $a1, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x00B0082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E114u); #endif @@ -491187,7 +492268,8 @@ label_BFC26120: psx_cyc_step(cpu, 0x18002u); #endif /* 0xBFC26124: 020F082A slt $at, $s0, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x020F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E124u); #endif @@ -491202,7 +492284,8 @@ label_BFC26120: psx_cyc_step(cpu, 0x20082u); #endif /* 0xBFC2612C: 00F1082A slt $at, $a3, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x00F1082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E12Cu); #endif @@ -491282,7 +492365,8 @@ label_BFC26138: psx_cyc_step(cpu, 0x1020002u); #endif /* 0xBFC2613C: 0238082A slt $at, $s1, $t8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x0238082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E13Cu); #endif @@ -491384,7 +492468,8 @@ label_BFC26150: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC26158: 332E0020 andi $t6, $t9, 0x20 */ - cpu->gpr[14] = cpu->gpr[25] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[14] = cpu->gpr[25] & 0x20u; + PGXP_ALU(0x332E0020u, cpu->gpr[14], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x8003E158u); #endif @@ -491812,7 +492897,8 @@ label_BFC261CC: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC261D4: 31F80020 andi $t8, $t7, 0x20 */ - cpu->gpr[24] = cpu->gpr[15] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x20u; + PGXP_ALU(0x31F80020u, cpu->gpr[24], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x8003E1D4u); #endif @@ -492149,7 +493235,8 @@ label_BFC2622C: psx_cyc_step(cpu, 0x1008002u); #endif /* 0xBFC26238: 01E1C024 and $t8, $t7, $at */ - cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[1]; + PGXP_ALU(0x01E1C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E238u); #endif @@ -492362,7 +493449,8 @@ label_BFC26264: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC26270: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E270u); #endif @@ -492687,7 +493775,8 @@ label_BFC262B4: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC262C4: 2A210072 slti $at, $s1, 114 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (114) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (114) ? 1 : 0); + PGXP_ALU(0x2A210072u, cpu->gpr[1], _pgx1, 0x0072u); } #ifdef PSX_COSIM cosim_instr(0x8003E2C4u); #endif @@ -492726,7 +493815,8 @@ label_BFC262C8: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC262CC: 2A21016B slti $at, $s1, 363 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (363) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (363) ? 1 : 0); + PGXP_ALU(0x2A21016Bu, cpu->gpr[1], _pgx1, 0x016Bu); } #ifdef PSX_COSIM cosim_instr(0x8003E2CCu); #endif @@ -492765,7 +493855,8 @@ label_BFC262D0: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC262D4: 2A010015 slti $at, $s0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (21) ? 1 : 0); + PGXP_ALU(0x2A010015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x8003E2D4u); #endif @@ -492804,7 +493895,8 @@ label_BFC262D8: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC262DC: 2A0100B3 slti $at, $s0, 179 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (179) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (179) ? 1 : 0); + PGXP_ALU(0x2A0100B3u, cpu->gpr[1], _pgx1, 0x00B3u); } #ifdef PSX_COSIM cosim_instr(0x8003E2DCu); #endif @@ -492843,7 +493935,8 @@ label_BFC262E0: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC262E4: 2A0101A7 slti $at, $s0, 423 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (423) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (423) ? 1 : 0); + PGXP_ALU(0x2A0101A7u, cpu->gpr[1], _pgx1, 0x01A7u); } #ifdef PSX_COSIM cosim_instr(0x8003E2E4u); #endif @@ -492949,7 +494042,8 @@ label_BFC262F8: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC262F8: 2A0101A7 slti $at, $s0, 423 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (423) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (423) ? 1 : 0); + PGXP_ALU(0x2A0101A7u, cpu->gpr[1], _pgx1, 0x01A7u); } #ifdef PSX_COSIM cosim_instr(0x8003E2F8u); #endif @@ -492977,7 +494071,8 @@ label_BFC262FC: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC26300: 2A010245 slti $at, $s0, 581 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (581) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (581) ? 1 : 0); + PGXP_ALU(0x2A010245u, cpu->gpr[1], _pgx1, 0x0245u); } #ifdef PSX_COSIM cosim_instr(0x8003E300u); #endif @@ -493929,7 +495024,8 @@ label_BFC263F0: psx_cyc_step(cpu, 0x8120u); #endif /* 0xBFC263F0: 01057824 and $t7, $t0, $a1 */ - cpu->gpr[15] = cpu->gpr[8] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[15] = cpu->gpr[8] & cpu->gpr[5]; + PGXP_ALU(0x01057824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E3F0u); #endif @@ -494094,7 +495190,8 @@ label_BFC26414: psx_cyc_step(cpu, 0x1000120u); #endif /* 0xBFC26414: 0105C024 and $t8, $t0, $a1 */ - cpu->gpr[24] = cpu->gpr[8] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[24] = cpu->gpr[8] & cpu->gpr[5]; + PGXP_ALU(0x0105C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E414u); #endif @@ -496980,7 +498077,8 @@ label_BFC26750: psx_cyc_step(cpu, 0x182u); #endif /* 0xBFC26754: 00E14024 and $t0, $a3, $at */ - cpu->gpr[8] = cpu->gpr[7] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[7] & cpu->gpr[1]; + PGXP_ALU(0x00E14024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E754u); #endif @@ -497585,7 +498683,8 @@ label_BFC267E8: psx_cyc_step(cpu, 0x1082u); #endif /* 0xBFC267F0: 00E16024 and $t4, $a3, $at */ - cpu->gpr[12] = cpu->gpr[7] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[7] & cpu->gpr[1]; + PGXP_ALU(0x00E16024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E7F0u); #endif @@ -498222,7 +499321,8 @@ label_BFC26894: psx_cyc_step(cpu, 0x1000082u); #endif /* 0xBFC268A4: 00E1C024 and $t8, $a3, $at */ - cpu->gpr[24] = cpu->gpr[7] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[7] & cpu->gpr[1]; + PGXP_ALU(0x00E1C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003E8A4u); #endif @@ -499451,7 +500551,8 @@ label_BFC26A0C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC26A20: 30A5007F andi $a1, $a1, 0x7F */ - cpu->gpr[5] = cpu->gpr[5] & 0x7Fu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x7Fu; + PGXP_ALU(0x30A5007Fu, cpu->gpr[5], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x8003EA20u); #endif @@ -502151,7 +503252,8 @@ label_BFC26D64: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC26D6C: 30420080 andi $v0, $v0, 0x80 */ - cpu->gpr[2] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30420080u, cpu->gpr[2], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x8003ED6Cu); #endif @@ -502218,7 +503320,8 @@ label_BFC26D78: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC26D80: 31F80080 andi $t8, $t7, 0x80 */ - cpu->gpr[24] = cpu->gpr[15] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x80u; + PGXP_ALU(0x31F80080u, cpu->gpr[24], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x8003ED80u); #endif @@ -502402,7 +503505,8 @@ label_BFC26DA8: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC26DB0: 33280010 andi $t0, $t9, 0x10 */ - cpu->gpr[8] = cpu->gpr[25] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x10u; + PGXP_ALU(0x33280010u, cpu->gpr[8], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8003EDB0u); #endif @@ -502520,7 +503624,8 @@ label_BFC26DCC: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC26DD0: 312A0010 andi $t2, $t1, 0x10 */ - cpu->gpr[10] = cpu->gpr[9] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x10u; + PGXP_ALU(0x312A0010u, cpu->gpr[10], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8003EDD0u); #endif @@ -507474,7 +508579,8 @@ label_BFC273A8: psx_cyc_step(cpu, 0x800002u); #endif /* 0xBFC273AC: 2AE1001E slti $at, $s7, 30 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[23] < (30) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[23]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[23] < (30) ? 1 : 0); + PGXP_ALU(0x2AE1001Eu, cpu->gpr[1], _pgx1, 0x001Eu); } #ifdef PSX_COSIM cosim_instr(0x8003F3ACu); #endif @@ -509609,7 +510715,8 @@ label_BFC275F0: psx_cyc_step(cpu, 0x40006u); #endif /* 0xBFC275F0: 0242082A slt $at, $s2, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0242082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003F5F0u); #endif @@ -511325,7 +512432,8 @@ label_BFC27828: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC27828: 2A810002 slti $at, $s4, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (2) ? 1 : 0); + PGXP_ALU(0x2A810002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8003F828u); #endif @@ -512262,7 +513370,8 @@ label_BFC27954: psx_cyc_step(cpu, 0x100000Au); #endif /* 0xBFC27968: 0303082B sltu $at, $t8, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0303082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003F968u); #endif @@ -512517,7 +513626,8 @@ label_BFC2799C: psx_cyc_step(cpu, 0x40Au); #endif /* 0xBFC279CC: 0143082B sltu $at, $t2, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[10] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[10] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0143082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003F9CCu); #endif @@ -513102,7 +514212,8 @@ label_BFC27A64: psx_cyc_step(cpu, 0x100000Au); #endif /* 0xBFC27A78: 0303082B sltu $at, $t8, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0303082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003FA78u); #endif @@ -513357,7 +514468,8 @@ label_BFC27AAC: psx_cyc_step(cpu, 0x40Au); #endif /* 0xBFC27ADC: 0143082B sltu $at, $t2, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[10] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[10] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0143082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8003FADCu); #endif @@ -516591,7 +517703,8 @@ label_BFC27EB4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC27EC0: 2C410007 sltiu $at, $v0, 7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000007u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000007u ? 1 : 0); + PGXP_ALU(0x2C410007u, cpu->gpr[1], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x8003FEC0u); #endif @@ -521711,7 +522824,8 @@ label_BFC2867C: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC2867C: 2A012329 slti $at, $s0, 9001 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (9001) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (9001) ? 1 : 0); + PGXP_ALU(0x2A012329u, cpu->gpr[1], _pgx1, 0x2329u); } #ifdef PSX_COSIM cosim_instr(0x8004067Cu); #endif @@ -523120,7 +524234,8 @@ label_BFC2884C: psx_cyc_step(cpu, 0x10802u); #endif /* 0xBFC28850: 020B082A slt $at, $s0, $t3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x020B082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80040850u); #endif @@ -525641,7 +526756,8 @@ label_BFC28B38: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC28B48: 2A810002 slti $at, $s4, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (2) ? 1 : 0); + PGXP_ALU(0x2A810002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80040B48u); #endif @@ -530141,7 +531257,8 @@ label_BFC29174: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC29188: 28410002 slti $at, $v0, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (2) ? 1 : 0); + PGXP_ALU(0x28410002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80041188u); #endif @@ -531641,7 +532758,8 @@ label_BFC2932C: psx_cyc_step(cpu, 0x82u); #endif /* 0xBFC29338: 28E11000 slti $at, $a3, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (4096) ? 1 : 0); + PGXP_ALU(0x28E11000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80041338u); #endif @@ -531751,7 +532869,8 @@ label_BFC29350: psx_cyc_step(cpu, 0x86u); #endif /* 0xBFC2935C: 0047082A slt $at, $v0, $a3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0047082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004135Cu); #endif @@ -535710,7 +536829,8 @@ label_BFC2986C: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC2986C: 29011000 slti $at, $t0, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4096) ? 1 : 0); + PGXP_ALU(0x29011000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x8004186Cu); #endif @@ -535728,7 +536848,8 @@ label_BFC2986C: psx_cyc_step(cpu, 0x182u); #endif /* 0xBFC29874: 00E8082A slt $at, $a3, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x00E8082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80041874u); #endif @@ -535769,7 +536890,8 @@ label_BFC29878: psx_cyc_step(cpu, 0x182u); #endif /* 0xBFC2987C: 00E8082A slt $at, $a3, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x00E8082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004187Cu); #endif @@ -536201,7 +537323,8 @@ label_BFC298EC: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC29908: 304E001F andi $t6, $v0, 0x1F */ - cpu->gpr[14] = cpu->gpr[2] & 0x1Fu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1Fu; + PGXP_ALU(0x304E001Fu, cpu->gpr[14], _pgx1, 0x001Fu); } #ifdef PSX_COSIM cosim_instr(0x80041908u); #endif @@ -536319,7 +537442,8 @@ label_BFC298EC: psx_cyc_step(cpu, 0x2000200u); #endif /* 0xBFC29934: 3329FFFF andi $t1, $t9, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[25] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[9] = cpu->gpr[25] & 0xFFFFu; + PGXP_ALU(0x3329FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80041934u); #endif @@ -536327,7 +537451,8 @@ label_BFC298EC: psx_cyc_step(cpu, 0x604u); #endif /* 0xBFC29938: 01225026 xor $t2, $t1, $v0 */ - cpu->gpr[10] = cpu->gpr[9] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[9] ^ cpu->gpr[2]; + PGXP_ALU(0x01225026u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80041938u); #endif @@ -536335,7 +537460,8 @@ label_BFC298EC: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC2993C: 314B001F andi $t3, $t2, 0x1F */ - cpu->gpr[11] = cpu->gpr[10] & 0x1Fu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x1Fu; + PGXP_ALU(0x314B001Fu, cpu->gpr[11], _pgx1, 0x001Fu); } #ifdef PSX_COSIM cosim_instr(0x8004193Cu); #endif @@ -536346,7 +537472,8 @@ label_BFC298EC: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC29940: 01621026 xor $v0, $t3, $v0 */ - cpu->gpr[2] = cpu->gpr[11] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[11] ^ cpu->gpr[2]; + PGXP_ALU(0x01621026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80041940u); #endif @@ -536354,7 +537481,8 @@ label_BFC298EC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC29944: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80041944u); #endif @@ -536803,7 +537931,8 @@ label_BFC299B0: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC299B8: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800419B8u); #endif @@ -536811,7 +537940,8 @@ label_BFC299B0: psx_cyc_step(cpu, 0x2000600u); #endif /* 0xBFC299BC: 03295026 xor $t2, $t9, $t1 */ - cpu->gpr[10] = cpu->gpr[25] ^ cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[25] ^ cpu->gpr[9]; + PGXP_ALU(0x03295026u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800419BCu); #endif @@ -536840,7 +537970,8 @@ label_BFC299B0: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC299C8: 01821026 xor $v0, $t4, $v0 */ - cpu->gpr[2] = cpu->gpr[12] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[12] ^ cpu->gpr[2]; + PGXP_ALU(0x01821026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800419C8u); #endif @@ -536848,7 +537979,8 @@ label_BFC299B0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC299CC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800419CCu); #endif @@ -537122,7 +538254,8 @@ label_BFC299F4: psx_cyc_step(cpu, 0x2000200u); #endif /* 0xBFC29A18: 3329FFFF andi $t1, $t9, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[25] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[9] = cpu->gpr[25] & 0xFFFFu; + PGXP_ALU(0x3329FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80041A18u); #endif @@ -537142,7 +538275,8 @@ label_BFC299F4: psx_cyc_step(cpu, 0xE00u); #endif /* 0xBFC29A20: 012A5826 xor $t3, $t1, $t2 */ - cpu->gpr[11] = cpu->gpr[9] ^ cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[9] ^ cpu->gpr[10]; + PGXP_ALU(0x012A5826u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80041A20u); #endif @@ -537168,7 +538302,8 @@ label_BFC299F4: psx_cyc_step(cpu, 0x2004u); #endif /* 0xBFC29A2C: 01A21026 xor $v0, $t5, $v0 */ - cpu->gpr[2] = cpu->gpr[13] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[13] ^ cpu->gpr[2]; + PGXP_ALU(0x01A21026u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80041A2Cu); #endif @@ -537179,7 +538314,8 @@ label_BFC299F4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC29A30: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80041A30u); #endif @@ -537517,7 +538653,8 @@ label_BFC29A88: psx_cyc_step(cpu, 0xA0002u); #endif /* 0xBFC29A8C: 0271082B sltu $at, $s3, $s1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0271082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80041A8Cu); #endif @@ -540043,7 +541180,8 @@ label_BFC29D84: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC29D90: 2841003C slti $at, $v0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (60) ? 1 : 0); + PGXP_ALU(0x2841003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x80041D90u); #endif @@ -540987,7 +542125,8 @@ label_BFC29EE0: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC29EE0: 29210400 slti $at, $t1, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (1024) ? 1 : 0); + PGXP_ALU(0x29210400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x80041EE0u); #endif @@ -541576,7 +542715,8 @@ label_BFC29F9C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC29FA4: 2841005B slti $at, $v0, 91 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (91) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (91) ? 1 : 0); + PGXP_ALU(0x2841005Bu, cpu->gpr[1], _pgx1, 0x005Bu); } #ifdef PSX_COSIM cosim_instr(0x80041FA4u); #endif @@ -542249,7 +543389,8 @@ label_BFC2A068: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2A094: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80042094u); #endif @@ -542275,7 +543416,8 @@ label_BFC2A068: psx_cyc_step(cpu, 0x300000u); #endif /* 0xBFC2A0A0: 32B4FFFF andi $s4, $s5, 0xFFFF */ - cpu->gpr[20] = cpu->gpr[21] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[21]; cpu->gpr[20] = cpu->gpr[21] & 0xFFFFu; + PGXP_ALU(0x32B4FFFFu, cpu->gpr[20], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800420A0u); #endif @@ -542364,7 +543506,8 @@ label_BFC2A068: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2A0C8: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800420C8u); #endif @@ -542462,7 +543605,8 @@ label_BFC2A068: psx_cyc_step(cpu, 0x40020u); #endif /* 0xBFC2A0F4: 3245FFFF andi $a1, $s2, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[18] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[5] = cpu->gpr[18] & 0xFFFFu; + PGXP_ALU(0x3245FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800420F4u); #endif @@ -542470,7 +543614,8 @@ label_BFC2A068: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2A0F8: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800420F8u); #endif @@ -542577,7 +543722,8 @@ label_BFC2A068: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2A128: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80042128u); #endif @@ -542809,7 +543955,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2A188: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80042188u); #endif @@ -542925,7 +544072,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2A1BC: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800421BCu); #endif @@ -543023,7 +544171,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0x200040u); #endif /* 0xBFC2A1E8: 32A6FFFF andi $a2, $s5, 0xFFFF */ - cpu->gpr[6] = cpu->gpr[21] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[21]; cpu->gpr[6] = cpu->gpr[21] & 0xFFFFu; + PGXP_ALU(0x32A6FFFFu, cpu->gpr[6], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800421E8u); #endif @@ -543031,7 +544180,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2A1EC: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800421ECu); #endif @@ -543093,7 +544243,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0x40020u); #endif /* 0xBFC2A208: 3245FFFF andi $a1, $s2, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[18] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[5] = cpu->gpr[18] & 0xFFFFu; + PGXP_ALU(0x3245FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80042208u); #endif @@ -543122,7 +544273,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0x80000080u); #endif /* 0xBFC2A214: 33E7FFFF andi $a3, $ra, 0xFFFF */ - cpu->gpr[7] = cpu->gpr[31] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[31]; cpu->gpr[7] = cpu->gpr[31] & 0xFFFFu; + PGXP_ALU(0x33E7FFFFu, cpu->gpr[7], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80042214u); #endif @@ -543211,7 +544363,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2A23C: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004223Cu); #endif @@ -543228,7 +544381,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2A244: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80042244u); #endif @@ -543245,7 +544399,8 @@ label_BFC2A158: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2A24C: 31D9FFFF andi $t9, $t6, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[25] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31D9FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004224Cu); #endif @@ -545231,7 +546386,8 @@ label_BFC2A578: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC2A57C: 2C810081 sltiu $at, $a0, 129 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000081u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000081u ? 1 : 0); + PGXP_ALU(0x2C810081u, cpu->gpr[1], _pgx1, 0x0081u); } #ifdef PSX_COSIM cosim_instr(0x8004257Cu); #endif @@ -545392,7 +546548,8 @@ label_BFC2A5A0: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC2A5A0: 2C810081 sltiu $at, $a0, 129 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000081u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000081u ? 1 : 0); + PGXP_ALU(0x2C810081u, cpu->gpr[1], _pgx1, 0x0081u); } #ifdef PSX_COSIM cosim_instr(0x800425A0u); #endif @@ -545417,7 +546574,8 @@ label_BFC2A5A4: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC2A5A8: 2C810099 sltiu $at, $a0, 153 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000099u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000099u ? 1 : 0); + PGXP_ALU(0x2C810099u, cpu->gpr[1], _pgx1, 0x0099u); } #ifdef PSX_COSIM cosim_instr(0x800425A8u); #endif @@ -545518,7 +546676,8 @@ label_BFC2A5B4: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC2A5C0: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800425C0u); #endif @@ -545602,7 +546761,8 @@ label_BFC2A5D4: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2A5D4: 3058FFFF andi $t8, $v0, 0xFFFF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3058FFFFu, cpu->gpr[24], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800425D4u); #endif @@ -545617,7 +546777,8 @@ label_BFC2A5D4: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC2A5DC: 3045FFFF andi $a1, $v0, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3045FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800425DCu); #endif @@ -545708,7 +546869,8 @@ label_BFC2A5EC: psx_cyc_step(cpu, 0x200022u); #endif /* 0xBFC2A5EC: 00B5082B sltu $at, $a1, $s5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[21] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[21]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[21] ? 1 : 0); + PGXP_ALU(0x00B5082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800425ECu); #endif @@ -545726,7 +546888,8 @@ label_BFC2A5EC: psx_cyc_step(cpu, 0x800022u); #endif /* 0xBFC2A5F4: 00B7082B sltu $at, $a1, $s7 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[23] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[23]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[23] ? 1 : 0); + PGXP_ALU(0x00B7082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800425F4u); #endif @@ -545898,7 +547061,8 @@ label_BFC2A61C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2A620: 00A1082B sltu $at, $a1, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x00A1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80042620u); #endif @@ -545946,7 +547110,8 @@ label_BFC2A62C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2A62C: 00A1082B sltu $at, $a1, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x00A1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004262Cu); #endif @@ -546327,7 +547492,8 @@ label_BFC2A690: psx_cyc_step(cpu, 0x400002u); #endif /* 0xBFC2A69C: 2AC10100 slti $at, $s6, 256 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (256) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (256) ? 1 : 0); + PGXP_ALU(0x2AC10100u, cpu->gpr[1], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x8004269Cu); #endif @@ -546519,7 +547685,8 @@ label_BFC2A6CC: psx_cyc_step(cpu, 0x80400002u); #endif /* 0xBFC2A6CC: 03F6082A slt $at, $ra, $s6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[31] < (int32_t)cpu->gpr[22] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[31]; uint32_t _pgx2 = cpu->gpr[22]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[31] < (int32_t)cpu->gpr[22] ? 1 : 0); + PGXP_ALU(0x03F6082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800426CCu); #endif @@ -546733,7 +547900,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC2A714: 30840001 andi $a0, $a0, 0x1 */ - cpu->gpr[4] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30840001u, cpu->gpr[4], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042714u); #endif @@ -546741,7 +547909,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC2A718: 316B0001 andi $t3, $t3, 0x1 */ - cpu->gpr[11] = cpu->gpr[11] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0x1u; + PGXP_ALU(0x316B0001u, cpu->gpr[11], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042718u); #endif @@ -546749,7 +547918,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC2A71C: 30630001 andi $v1, $v1, 0x1 */ - cpu->gpr[3] = cpu->gpr[3] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x1u; + PGXP_ALU(0x30630001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004271Cu); #endif @@ -546808,7 +547978,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC2A734: 30A50001 andi $a1, $a1, 0x1 */ - cpu->gpr[5] = cpu->gpr[5] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x1u; + PGXP_ALU(0x30A50001u, cpu->gpr[5], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042734u); #endif @@ -546864,7 +548035,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC2A74C: 30C60001 andi $a2, $a2, 0x1 */ - cpu->gpr[6] = cpu->gpr[6] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x1u; + PGXP_ALU(0x30C60001u, cpu->gpr[6], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004274Cu); #endif @@ -546953,7 +548125,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC2A770: 31080001 andi $t0, $t0, 0x1 */ - cpu->gpr[8] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31080001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042770u); #endif @@ -546961,7 +548134,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC2A774: 30E70001 andi $a3, $a3, 0x1 */ - cpu->gpr[7] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E70001u, cpu->gpr[7], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042774u); #endif @@ -547029,7 +548203,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC2A790: 31290001 andi $t1, $t1, 0x1 */ - cpu->gpr[9] = cpu->gpr[9] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0x1u; + PGXP_ALU(0x31290001u, cpu->gpr[9], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042790u); #endif @@ -547085,7 +548260,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC2A7A8: 304C0001 andi $t4, $v0, 0x1 */ - cpu->gpr[12] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304C0001u, cpu->gpr[12], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800427A8u); #endif @@ -547171,7 +548347,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC2A7CC: 30630001 andi $v1, $v1, 0x1 */ - cpu->gpr[3] = cpu->gpr[3] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x1u; + PGXP_ALU(0x30630001u, cpu->gpr[3], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800427CCu); #endif @@ -547182,7 +548359,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC2A7D0: 30840001 andi $a0, $a0, 0x1 */ - cpu->gpr[4] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30840001u, cpu->gpr[4], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800427D0u); #endif @@ -547247,7 +548425,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC2A7EC: 30A50001 andi $a1, $a1, 0x1 */ - cpu->gpr[5] = cpu->gpr[5] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x1u; + PGXP_ALU(0x30A50001u, cpu->gpr[5], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800427ECu); #endif @@ -547306,7 +548485,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC2A804: 30C60001 andi $a2, $a2, 0x1 */ - cpu->gpr[6] = cpu->gpr[6] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x1u; + PGXP_ALU(0x30C60001u, cpu->gpr[6], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042804u); #endif @@ -547401,7 +548581,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC2A82C: 30E70001 andi $a3, $a3, 0x1 */ - cpu->gpr[7] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E70001u, cpu->gpr[7], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004282Cu); #endif @@ -547412,7 +548593,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC2A830: 31080001 andi $t0, $t0, 0x1 */ - cpu->gpr[8] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31080001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042830u); #endif @@ -547477,7 +548659,8 @@ label_BFC2A700: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC2A84C: 31290001 andi $t1, $t1, 0x1 */ - cpu->gpr[9] = cpu->gpr[9] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0x1u; + PGXP_ALU(0x31290001u, cpu->gpr[9], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004284Cu); #endif @@ -547672,7 +548855,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2A894: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042894u); #endif @@ -547680,7 +548864,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2A898: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042898u); #endif @@ -547718,7 +548903,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2A8A8: 31F90001 andi $t9, $t7, 0x1 */ - cpu->gpr[25] = cpu->gpr[15] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[25] = cpu->gpr[15] & 0x1u; + PGXP_ALU(0x31F90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800428A8u); #endif @@ -547756,7 +548942,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2A8B8: 332E0001 andi $t6, $t9, 0x1 */ - cpu->gpr[14] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[14] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x332E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800428B8u); #endif @@ -547824,7 +549011,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2A8D4: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800428D4u); #endif @@ -547832,7 +549020,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2A8D8: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800428D8u); #endif @@ -547870,7 +549059,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2A8E8: 332F0001 andi $t7, $t9, 0x1 */ - cpu->gpr[15] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x332F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800428E8u); #endif @@ -547899,7 +549089,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2A8F4: 304F0001 andi $t7, $v0, 0x1 */ - cpu->gpr[15] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800428F4u); #endif @@ -547976,7 +549167,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2A914: 31F90001 andi $t9, $t7, 0x1 */ - cpu->gpr[25] = cpu->gpr[15] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[25] = cpu->gpr[15] & 0x1u; + PGXP_ALU(0x31F90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042914u); #endif @@ -547984,7 +549176,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x1004000u); #endif /* 0xBFC2A918: 330E0001 andi $t6, $t8, 0x1 */ - cpu->gpr[14] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[14] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x330E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042918u); #endif @@ -548022,7 +549215,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2A928: 31D90001 andi $t9, $t6, 0x1 */ - cpu->gpr[25] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[25] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31D90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042928u); #endif @@ -548060,7 +549254,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2A938: 33380001 andi $t8, $t9, 0x1 */ - cpu->gpr[24] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[24] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x33380001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042938u); #endif @@ -548137,7 +549332,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x1004000u); #endif /* 0xBFC2A958: 330E0001 andi $t6, $t8, 0x1 */ - cpu->gpr[14] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[14] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x330E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80042958u); #endif @@ -548145,7 +549341,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2A95C: 31F90001 andi $t9, $t7, 0x1 */ - cpu->gpr[25] = cpu->gpr[15] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[25] = cpu->gpr[15] & 0x1u; + PGXP_ALU(0x31F90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004295Cu); #endif @@ -548183,7 +549380,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2A96C: 332E0001 andi $t6, $t9, 0x1 */ - cpu->gpr[14] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[14] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x332E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004296Cu); #endif @@ -548221,7 +549419,8 @@ label_BFC2A884: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2A97C: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004297Cu); #endif @@ -548360,7 +549559,8 @@ label_BFC2A9A4: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC2A9A8: 2A210010 slti $at, $s1, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (16) ? 1 : 0); + PGXP_ALU(0x2A210010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x800429A8u); #endif @@ -548378,7 +549578,8 @@ label_BFC2A9A4: psx_cyc_step(cpu, 0x480002u); #endif /* 0xBFC2A9B0: 0276082A slt $at, $s3, $s6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[22] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[22]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[22] ? 1 : 0); + PGXP_ALU(0x0276082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800429B0u); #endif @@ -548417,7 +549618,8 @@ label_BFC2A9B4: psx_cyc_step(cpu, 0x400002u); #endif /* 0xBFC2A9B8: 2AC10010 slti $at, $s6, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (16) ? 1 : 0); + PGXP_ALU(0x2AC10010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x800429B8u); #endif @@ -548461,7 +549663,8 @@ label_BFC2A9BC: psx_cyc_step(cpu, 0x800002u); #endif /* 0xBFC2A9C0: 2AE10100 slti $at, $s7, 256 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[23] < (256) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[23]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[23] < (256) ? 1 : 0); + PGXP_ALU(0x2AE10100u, cpu->gpr[1], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x800429C0u); #endif @@ -548476,7 +549679,8 @@ label_BFC2A9BC: psx_cyc_step(cpu, 0x400002u); #endif /* 0xBFC2A9C8: 2AC10010 slti $at, $s6, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (16) ? 1 : 0); + PGXP_ALU(0x2AC10010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x800429C8u); #endif @@ -549186,7 +550390,8 @@ label_BFC2AA20: psx_cyc_step(cpu, 0x400002u); #endif /* 0xBFC2AAB0: 2AC10011 slti $at, $s6, 17 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (17) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (17) ? 1 : 0); + PGXP_ALU(0x2AC10011u, cpu->gpr[1], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x80042AB0u); #endif @@ -549290,7 +550495,8 @@ label_BFC2AAC8: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC2AACC: 3222000F andi $v0, $s1, 0xF */ - cpu->gpr[2] = cpu->gpr[17] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = cpu->gpr[17] & 0xFu; + PGXP_ALU(0x3222000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80042ACCu); #endif @@ -549450,7 +550656,8 @@ label_BFC2AAE4: psx_cyc_step(cpu, 0x400002u); #endif /* 0xBFC2AAF4: 2AC10010 slti $at, $s6, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (16) ? 1 : 0); + PGXP_ALU(0x2AC10010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80042AF4u); #endif @@ -549591,7 +550798,8 @@ label_BFC2AB18: psx_cyc_step(cpu, 0x2080000u); #endif /* 0xBFC2AB1C: 3279003F andi $t9, $s3, 0x3F */ - cpu->gpr[25] = cpu->gpr[19] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[19]; cpu->gpr[25] = cpu->gpr[19] & 0x3Fu; + PGXP_ALU(0x3279003Fu, cpu->gpr[25], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80042B1Cu); #endif @@ -549681,7 +550889,8 @@ label_BFC2AB2C: psx_cyc_step(cpu, 0x2000012u); #endif /* 0xBFC2AB2C: 0324082A slt $at, $t9, $a0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0324082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80042B2Cu); #endif @@ -550264,7 +551473,8 @@ label_BFC2ABD8: psx_cyc_step(cpu, 0x20006u); #endif /* 0xBFC2ABE8: 0222082A slt $at, $s1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0222082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80042BE8u); #endif @@ -550814,7 +552024,8 @@ label_BFC2ACEC: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC2ACFC: 2DC10004 sltiu $at, $t6, 4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000004u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000004u ? 1 : 0); + PGXP_ALU(0x2DC10004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80042CFCu); #endif @@ -550984,7 +552195,8 @@ label_BFC2AD24: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD2C: 2C410040 sltiu $at, $v0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C410040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80042D2Cu); #endif @@ -551002,7 +552214,8 @@ label_BFC2AD24: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD34: 2C41007F sltiu $at, $v0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x80042D34u); #endif @@ -551041,7 +552254,8 @@ label_BFC2AD38: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD3C: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80042D3Cu); #endif @@ -551113,7 +552327,8 @@ label_BFC2AD48: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD48: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80042D48u); #endif @@ -551141,7 +552356,8 @@ label_BFC2AD4C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD50: 2C4100AD sltiu $at, $v0, 173 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000ADu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000ADu ? 1 : 0); + PGXP_ALU(0x2C4100ADu, cpu->gpr[1], _pgx1, 0x00ADu); } #ifdef PSX_COSIM cosim_instr(0x80042D50u); #endif @@ -551180,7 +552396,8 @@ label_BFC2AD54: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD58: 2C4100B8 sltiu $at, $v0, 184 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B8u ? 1 : 0); + PGXP_ALU(0x2C4100B8u, cpu->gpr[1], _pgx1, 0x00B8u); } #ifdef PSX_COSIM cosim_instr(0x80042D58u); #endif @@ -551255,7 +552472,8 @@ label_BFC2AD64: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD64: 2C4100B8 sltiu $at, $v0, 184 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B8u ? 1 : 0); + PGXP_ALU(0x2C4100B8u, cpu->gpr[1], _pgx1, 0x00B8u); } #ifdef PSX_COSIM cosim_instr(0x80042D64u); #endif @@ -551280,7 +552498,8 @@ label_BFC2AD68: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD6C: 2C4100C0 sltiu $at, $v0, 192 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C0u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C0u ? 1 : 0); + PGXP_ALU(0x2C4100C0u, cpu->gpr[1], _pgx1, 0x00C0u); } #ifdef PSX_COSIM cosim_instr(0x80042D6Cu); #endif @@ -551319,7 +552538,8 @@ label_BFC2AD70: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD74: 2C4100C8 sltiu $at, $v0, 200 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C8u ? 1 : 0); + PGXP_ALU(0x2C4100C8u, cpu->gpr[1], _pgx1, 0x00C8u); } #ifdef PSX_COSIM cosim_instr(0x80042D74u); #endif @@ -551391,7 +552611,8 @@ label_BFC2AD80: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD80: 2C4100C8 sltiu $at, $v0, 200 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000C8u ? 1 : 0); + PGXP_ALU(0x2C4100C8u, cpu->gpr[1], _pgx1, 0x00C8u); } #ifdef PSX_COSIM cosim_instr(0x80042D80u); #endif @@ -551416,7 +552637,8 @@ label_BFC2AD84: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD88: 2C4100CF sltiu $at, $v0, 207 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000CFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000CFu ? 1 : 0); + PGXP_ALU(0x2C4100CFu, cpu->gpr[1], _pgx1, 0x00CFu); } #ifdef PSX_COSIM cosim_instr(0x80042D88u); #endif @@ -551458,7 +552680,8 @@ label_BFC2AD8C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD90: 2C4100DA sltiu $at, $v0, 218 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000DAu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000DAu ? 1 : 0); + PGXP_ALU(0x2C4100DAu, cpu->gpr[1], _pgx1, 0x00DAu); } #ifdef PSX_COSIM cosim_instr(0x80042D90u); #endif @@ -551530,7 +552753,8 @@ label_BFC2AD9C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AD9C: 2C4100DA sltiu $at, $v0, 218 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000DAu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000DAu ? 1 : 0); + PGXP_ALU(0x2C4100DAu, cpu->gpr[1], _pgx1, 0x00DAu); } #ifdef PSX_COSIM cosim_instr(0x80042D9Cu); #endif @@ -551555,7 +552779,8 @@ label_BFC2ADA0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2ADA4: 2C4100E9 sltiu $at, $v0, 233 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000E9u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000E9u ? 1 : 0); + PGXP_ALU(0x2C4100E9u, cpu->gpr[1], _pgx1, 0x00E9u); } #ifdef PSX_COSIM cosim_instr(0x80042DA4u); #endif @@ -551594,7 +552819,8 @@ label_BFC2ADA8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2ADAC: 2C4100F0 sltiu $at, $v0, 240 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F0u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F0u ? 1 : 0); + PGXP_ALU(0x2C4100F0u, cpu->gpr[1], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80042DACu); #endif @@ -551666,7 +552892,8 @@ label_BFC2ADB8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2ADB8: 2C4100F0 sltiu $at, $v0, 240 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F0u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F0u ? 1 : 0); + PGXP_ALU(0x2C4100F0u, cpu->gpr[1], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80042DB8u); #endif @@ -551694,7 +552921,8 @@ label_BFC2ADBC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2ADC0: 2C4100F8 sltiu $at, $v0, 248 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F8u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F8u ? 1 : 0); + PGXP_ALU(0x2C4100F8u, cpu->gpr[1], _pgx1, 0x00F8u); } #ifdef PSX_COSIM cosim_instr(0x80042DC0u); #endif @@ -552058,7 +553286,8 @@ label_BFC2AE18: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE20: 2C41004F sltiu $at, $v0, 79 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000004Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000004Fu ? 1 : 0); + PGXP_ALU(0x2C41004Fu, cpu->gpr[1], _pgx1, 0x004Fu); } #ifdef PSX_COSIM cosim_instr(0x80042E20u); #endif @@ -552073,7 +553302,8 @@ label_BFC2AE18: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE28: 2C410059 sltiu $at, $v0, 89 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000059u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000059u ? 1 : 0); + PGXP_ALU(0x2C410059u, cpu->gpr[1], _pgx1, 0x0059u); } #ifdef PSX_COSIM cosim_instr(0x80042E28u); #endif @@ -552115,7 +553345,8 @@ label_BFC2AE2C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE30: 2C410060 sltiu $at, $v0, 96 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000060u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000060u ? 1 : 0); + PGXP_ALU(0x2C410060u, cpu->gpr[1], _pgx1, 0x0060u); } #ifdef PSX_COSIM cosim_instr(0x80042E30u); #endif @@ -552187,7 +553418,8 @@ label_BFC2AE3C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE3C: 2C410060 sltiu $at, $v0, 96 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000060u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000060u ? 1 : 0); + PGXP_ALU(0x2C410060u, cpu->gpr[1], _pgx1, 0x0060u); } #ifdef PSX_COSIM cosim_instr(0x80042E3Cu); #endif @@ -552212,7 +553444,8 @@ label_BFC2AE40: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE44: 2C41007A sltiu $at, $v0, 122 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Au ? 1 : 0); + PGXP_ALU(0x2C41007Au, cpu->gpr[1], _pgx1, 0x007Au); } #ifdef PSX_COSIM cosim_instr(0x80042E44u); #endif @@ -552251,7 +553484,8 @@ label_BFC2AE48: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE4C: 2C410081 sltiu $at, $v0, 129 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000081u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000081u ? 1 : 0); + PGXP_ALU(0x2C410081u, cpu->gpr[1], _pgx1, 0x0081u); } #ifdef PSX_COSIM cosim_instr(0x80042E4Cu); #endif @@ -552323,7 +553557,8 @@ label_BFC2AE58: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE58: 2C410081 sltiu $at, $v0, 129 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000081u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000081u ? 1 : 0); + PGXP_ALU(0x2C410081u, cpu->gpr[1], _pgx1, 0x0081u); } #ifdef PSX_COSIM cosim_instr(0x80042E58u); #endif @@ -552351,7 +553586,8 @@ label_BFC2AE5C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE60: 2C41009B sltiu $at, $v0, 155 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Bu ? 1 : 0); + PGXP_ALU(0x2C41009Bu, cpu->gpr[1], _pgx1, 0x009Bu); } #ifdef PSX_COSIM cosim_instr(0x80042E60u); #endif @@ -552390,7 +553626,8 @@ label_BFC2AE64: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE68: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x80042E68u); #endif @@ -552465,7 +553702,8 @@ label_BFC2AE74: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE74: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x80042E74u); #endif @@ -552490,7 +553728,8 @@ label_BFC2AE78: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE7C: 2C4100F2 sltiu $at, $v0, 242 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F2u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F2u ? 1 : 0); + PGXP_ALU(0x2C4100F2u, cpu->gpr[1], _pgx1, 0x00F2u); } #ifdef PSX_COSIM cosim_instr(0x80042E7Cu); #endif @@ -552567,7 +553806,8 @@ label_BFC2AE8C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AE8C: 2C4100F2 sltiu $at, $v0, 242 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F2u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000F2u ? 1 : 0); + PGXP_ALU(0x2C4100F2u, cpu->gpr[1], _pgx1, 0x00F2u); } #ifdef PSX_COSIM cosim_instr(0x80042E8Cu); #endif @@ -552815,7 +554055,8 @@ label_BFC2AED0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AED8: 2C410040 sltiu $at, $v0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C410040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80042ED8u); #endif @@ -552833,7 +554074,8 @@ label_BFC2AED0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AEE0: 2C41007F sltiu $at, $v0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x80042EE0u); #endif @@ -552872,7 +554114,8 @@ label_BFC2AEE4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AEE8: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80042EE8u); #endif @@ -552947,7 +554190,8 @@ label_BFC2AEF4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AEF4: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80042EF4u); #endif @@ -552972,7 +554216,8 @@ label_BFC2AEF8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AEFC: 2C410097 sltiu $at, $v0, 151 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000097u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000097u ? 1 : 0); + PGXP_ALU(0x2C410097u, cpu->gpr[1], _pgx1, 0x0097u); } #ifdef PSX_COSIM cosim_instr(0x80042EFCu); #endif @@ -553011,7 +554256,8 @@ label_BFC2AF00: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF04: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x80042F04u); #endif @@ -553083,7 +554329,8 @@ label_BFC2AF10: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF10: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x80042F10u); #endif @@ -553108,7 +554355,8 @@ label_BFC2AF14: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF18: 2C4100B7 sltiu $at, $v0, 183 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B7u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000B7u ? 1 : 0); + PGXP_ALU(0x2C4100B7u, cpu->gpr[1], _pgx1, 0x00B7u); } #ifdef PSX_COSIM cosim_instr(0x80042F18u); #endif @@ -553150,7 +554398,8 @@ label_BFC2AF1C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF20: 2C4100BF sltiu $at, $v0, 191 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + PGXP_ALU(0x2C4100BFu, cpu->gpr[1], _pgx1, 0x00BFu); } #ifdef PSX_COSIM cosim_instr(0x80042F20u); #endif @@ -553222,7 +554471,8 @@ label_BFC2AF2C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF2C: 2C4100BF sltiu $at, $v0, 191 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + PGXP_ALU(0x2C4100BFu, cpu->gpr[1], _pgx1, 0x00BFu); } #ifdef PSX_COSIM cosim_instr(0x80042F2Cu); #endif @@ -553247,7 +554497,8 @@ label_BFC2AF30: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF34: 2C4100D7 sltiu $at, $v0, 215 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000D7u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000D7u ? 1 : 0); + PGXP_ALU(0x2C4100D7u, cpu->gpr[1], _pgx1, 0x00D7u); } #ifdef PSX_COSIM cosim_instr(0x80042F34u); #endif @@ -553327,7 +554578,8 @@ label_BFC2AF44: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF44: 2C4100D7 sltiu $at, $v0, 215 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000D7u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000D7u ? 1 : 0); + PGXP_ALU(0x2C4100D7u, cpu->gpr[1], _pgx1, 0x00D7u); } #ifdef PSX_COSIM cosim_instr(0x80042F44u); #endif @@ -553575,7 +554827,8 @@ label_BFC2AF88: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF90: 2C410040 sltiu $at, $v0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C410040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80042F90u); #endif @@ -553590,7 +554843,8 @@ label_BFC2AF88: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AF98: 2C410061 sltiu $at, $v0, 97 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000061u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000061u ? 1 : 0); + PGXP_ALU(0x2C410061u, cpu->gpr[1], _pgx1, 0x0061u); } #ifdef PSX_COSIM cosim_instr(0x80042F98u); #endif @@ -553632,7 +554886,8 @@ label_BFC2AF9C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFA0: 2C410070 sltiu $at, $v0, 112 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000070u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000070u ? 1 : 0); + PGXP_ALU(0x2C410070u, cpu->gpr[1], _pgx1, 0x0070u); } #ifdef PSX_COSIM cosim_instr(0x80042FA0u); #endif @@ -553704,7 +554959,8 @@ label_BFC2AFAC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFAC: 2C410070 sltiu $at, $v0, 112 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000070u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000070u ? 1 : 0); + PGXP_ALU(0x2C410070u, cpu->gpr[1], _pgx1, 0x0070u); } #ifdef PSX_COSIM cosim_instr(0x80042FACu); #endif @@ -553729,7 +554985,8 @@ label_BFC2AFB0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFB4: 2C41007F sltiu $at, $v0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x80042FB4u); #endif @@ -553768,7 +555025,8 @@ label_BFC2AFB8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFBC: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80042FBCu); #endif @@ -553840,7 +555098,8 @@ label_BFC2AFC8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFC8: 2C410080 sltiu $at, $v0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C410080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80042FC8u); #endif @@ -553868,7 +555127,8 @@ label_BFC2AFCC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFD0: 2C410092 sltiu $at, $v0, 146 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000092u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000092u ? 1 : 0); + PGXP_ALU(0x2C410092u, cpu->gpr[1], _pgx1, 0x0092u); } #ifdef PSX_COSIM cosim_instr(0x80042FD0u); #endif @@ -553907,7 +555167,8 @@ label_BFC2AFD4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFD8: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x80042FD8u); #endif @@ -553982,7 +555243,8 @@ label_BFC2AFE4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFE4: 2C41009F sltiu $at, $v0, 159 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000009Fu ? 1 : 0); + PGXP_ALU(0x2C41009Fu, cpu->gpr[1], _pgx1, 0x009Fu); } #ifdef PSX_COSIM cosim_instr(0x80042FE4u); #endif @@ -554007,7 +555269,8 @@ label_BFC2AFE8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFEC: 2C4100BF sltiu $at, $v0, 191 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + PGXP_ALU(0x2C4100BFu, cpu->gpr[1], _pgx1, 0x00BFu); } #ifdef PSX_COSIM cosim_instr(0x80042FECu); #endif @@ -554084,7 +555347,8 @@ label_BFC2AFFC: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2AFFC: 2C4100BF sltiu $at, $v0, 191 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x000000BFu ? 1 : 0); + PGXP_ALU(0x2C4100BFu, cpu->gpr[1], _pgx1, 0x00BFu); } #ifdef PSX_COSIM cosim_instr(0x80042FFCu); #endif @@ -554332,7 +555596,8 @@ label_BFC2B040: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2B048: 2C41007F sltiu $at, $v0, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2C41007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x80043048u); #endif @@ -554469,7 +555734,8 @@ label_BFC2B060: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC2B06C: 316C00FF andi $t4, $t3, 0xFF */ - cpu->gpr[12] = cpu->gpr[11] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0xFFu; + PGXP_ALU(0x316C00FFu, cpu->gpr[12], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004306Cu); #endif @@ -554737,7 +556003,8 @@ label_BFC2B0A8: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC2B0A8: 308500FF andi $a1, $a0, 0xFF */ - cpu->gpr[5] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[5] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800430A8u); #endif @@ -554757,7 +556024,8 @@ label_BFC2B0A8: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B0B0: 2CA10020 sltiu $at, $a1, 32 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000020u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000020u ? 1 : 0); + PGXP_ALU(0x2CA10020u, cpu->gpr[1], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x800430B0u); #endif @@ -554814,7 +556082,8 @@ label_BFC2B0C0: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B0C0: 2CA10030 sltiu $at, $a1, 48 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000030u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000030u ? 1 : 0); + PGXP_ALU(0x2CA10030u, cpu->gpr[1], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x800430C0u); #endif @@ -554829,7 +556098,8 @@ label_BFC2B0C0: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B0C8: 2CA10030 sltiu $at, $a1, 48 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000030u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000030u ? 1 : 0); + PGXP_ALU(0x2CA10030u, cpu->gpr[1], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x800430C8u); #endif @@ -554904,7 +556174,8 @@ label_BFC2B0D4: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B0D4: 2CA10030 sltiu $at, $a1, 48 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000030u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000030u ? 1 : 0); + PGXP_ALU(0x2CA10030u, cpu->gpr[1], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x800430D4u); #endif @@ -554929,7 +556200,8 @@ label_BFC2B0D8: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B0DC: 2CA1003A sltiu $at, $a1, 58 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000003Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000003Au ? 1 : 0); + PGXP_ALU(0x2CA1003Au, cpu->gpr[1], _pgx1, 0x003Au); } #ifdef PSX_COSIM cosim_instr(0x800430DCu); #endif @@ -554968,7 +556240,8 @@ label_BFC2B0E0: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B0E4: 2CA1003A sltiu $at, $a1, 58 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000003Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000003Au ? 1 : 0); + PGXP_ALU(0x2CA1003Au, cpu->gpr[1], _pgx1, 0x003Au); } #ifdef PSX_COSIM cosim_instr(0x800430E4u); #endif @@ -555040,7 +556313,8 @@ label_BFC2B0F0: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B0F0: 2CA1003A sltiu $at, $a1, 58 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000003Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000003Au ? 1 : 0); + PGXP_ALU(0x2CA1003Au, cpu->gpr[1], _pgx1, 0x003Au); } #ifdef PSX_COSIM cosim_instr(0x800430F0u); #endif @@ -555065,7 +556339,8 @@ label_BFC2B0F4: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B0F8: 2CA10041 sltiu $at, $a1, 65 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000041u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000041u ? 1 : 0); + PGXP_ALU(0x2CA10041u, cpu->gpr[1], _pgx1, 0x0041u); } #ifdef PSX_COSIM cosim_instr(0x800430F8u); #endif @@ -555107,7 +556382,8 @@ label_BFC2B0FC: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B100: 2CA10041 sltiu $at, $a1, 65 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000041u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000041u ? 1 : 0); + PGXP_ALU(0x2CA10041u, cpu->gpr[1], _pgx1, 0x0041u); } #ifdef PSX_COSIM cosim_instr(0x80043100u); #endif @@ -555179,7 +556455,8 @@ label_BFC2B10C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B10C: 2CA10041 sltiu $at, $a1, 65 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000041u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000041u ? 1 : 0); + PGXP_ALU(0x2CA10041u, cpu->gpr[1], _pgx1, 0x0041u); } #ifdef PSX_COSIM cosim_instr(0x8004310Cu); #endif @@ -555204,7 +556481,8 @@ label_BFC2B110: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B114: 2CA1005B sltiu $at, $a1, 91 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000005Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000005Bu ? 1 : 0); + PGXP_ALU(0x2CA1005Bu, cpu->gpr[1], _pgx1, 0x005Bu); } #ifdef PSX_COSIM cosim_instr(0x80043114u); #endif @@ -555243,7 +556521,8 @@ label_BFC2B118: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B11C: 2CA1005B sltiu $at, $a1, 91 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000005Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000005Bu ? 1 : 0); + PGXP_ALU(0x2CA1005Bu, cpu->gpr[1], _pgx1, 0x005Bu); } #ifdef PSX_COSIM cosim_instr(0x8004311Cu); #endif @@ -555324,7 +556603,8 @@ label_BFC2B12C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B12C: 2CA1005B sltiu $at, $a1, 91 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000005Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000005Bu ? 1 : 0); + PGXP_ALU(0x2CA1005Bu, cpu->gpr[1], _pgx1, 0x005Bu); } #ifdef PSX_COSIM cosim_instr(0x8004312Cu); #endif @@ -555349,7 +556629,8 @@ label_BFC2B130: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B134: 2CA10061 sltiu $at, $a1, 97 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000061u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000061u ? 1 : 0); + PGXP_ALU(0x2CA10061u, cpu->gpr[1], _pgx1, 0x0061u); } #ifdef PSX_COSIM cosim_instr(0x80043134u); #endif @@ -555388,7 +556669,8 @@ label_BFC2B138: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B13C: 2CA10061 sltiu $at, $a1, 97 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000061u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000061u ? 1 : 0); + PGXP_ALU(0x2CA10061u, cpu->gpr[1], _pgx1, 0x0061u); } #ifdef PSX_COSIM cosim_instr(0x8004313Cu); #endif @@ -555460,7 +556742,8 @@ label_BFC2B148: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B148: 2CA10061 sltiu $at, $a1, 97 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000061u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000061u ? 1 : 0); + PGXP_ALU(0x2CA10061u, cpu->gpr[1], _pgx1, 0x0061u); } #ifdef PSX_COSIM cosim_instr(0x80043148u); #endif @@ -555488,7 +556771,8 @@ label_BFC2B14C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B150: 2CA1007B sltiu $at, $a1, 123 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000007Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000007Bu ? 1 : 0); + PGXP_ALU(0x2CA1007Bu, cpu->gpr[1], _pgx1, 0x007Bu); } #ifdef PSX_COSIM cosim_instr(0x80043150u); #endif @@ -555527,7 +556811,8 @@ label_BFC2B154: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B158: 2CA1007B sltiu $at, $a1, 123 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000007Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000007Bu ? 1 : 0); + PGXP_ALU(0x2CA1007Bu, cpu->gpr[1], _pgx1, 0x007Bu); } #ifdef PSX_COSIM cosim_instr(0x80043158u); #endif @@ -555611,7 +556896,8 @@ label_BFC2B168: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B168: 2CA1007B sltiu $at, $a1, 123 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000007Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000007Bu ? 1 : 0); + PGXP_ALU(0x2CA1007Bu, cpu->gpr[1], _pgx1, 0x007Bu); } #ifdef PSX_COSIM cosim_instr(0x80043168u); #endif @@ -555639,7 +556925,8 @@ label_BFC2B16C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B170: 2CA1007F sltiu $at, $a1, 127 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000007Fu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000007Fu ? 1 : 0); + PGXP_ALU(0x2CA1007Fu, cpu->gpr[1], _pgx1, 0x007Fu); } #ifdef PSX_COSIM cosim_instr(0x80043170u); #endif @@ -557191,7 +558478,8 @@ label_BFC2B304: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC2B308: 2C810081 sltiu $at, $a0, 129 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000081u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000081u ? 1 : 0); + PGXP_ALU(0x2C810081u, cpu->gpr[1], _pgx1, 0x0081u); } #ifdef PSX_COSIM cosim_instr(0x80043308u); #endif @@ -557378,7 +558666,8 @@ label_BFC2B338: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC2B338: 2C810081 sltiu $at, $a0, 129 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000081u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000081u ? 1 : 0); + PGXP_ALU(0x2C810081u, cpu->gpr[1], _pgx1, 0x0081u); } #ifdef PSX_COSIM cosim_instr(0x80043338u); #endif @@ -557406,7 +558695,8 @@ label_BFC2B33C: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC2B340: 2C810099 sltiu $at, $a0, 153 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000099u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000099u ? 1 : 0); + PGXP_ALU(0x2C810099u, cpu->gpr[1], _pgx1, 0x0099u); } #ifdef PSX_COSIM cosim_instr(0x80043340u); #endif @@ -557504,7 +558794,8 @@ label_BFC2B34C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC2B358: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043358u); #endif @@ -557588,7 +558879,8 @@ label_BFC2B36C: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2B36C: 3058FFFF andi $t8, $v0, 0xFFFF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3058FFFFu, cpu->gpr[24], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004336Cu); #endif @@ -557606,7 +558898,8 @@ label_BFC2B36C: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC2B374: 3045FFFF andi $a1, $v0, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3045FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043374u); #endif @@ -557706,7 +558999,8 @@ label_BFC2B384: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B388: 00A1082B sltu $at, $a1, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x00A1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80043388u); #endif @@ -557757,7 +559051,8 @@ label_BFC2B394: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B394: 00A1082B sltu $at, $a1, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x00A1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80043394u); #endif @@ -557941,7 +559236,8 @@ label_BFC2B3CC: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B3D0: 00A1082B sltu $at, $a1, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x00A1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800433D0u); #endif @@ -557989,7 +559285,8 @@ label_BFC2B3DC: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC2B3DC: 00A1082B sltu $at, $a1, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x00A1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800433DCu); #endif @@ -558378,7 +559675,8 @@ label_BFC2B44C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2B44C: 28410093 slti $at, $v0, 147 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (147) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (147) ? 1 : 0); + PGXP_ALU(0x28410093u, cpu->gpr[1], _pgx1, 0x0093u); } #ifdef PSX_COSIM cosim_instr(0x8004344Cu); #endif @@ -558396,7 +559694,8 @@ label_BFC2B44C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC2B454: 284100D1 slti $at, $v0, 209 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (209) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (209) ? 1 : 0); + PGXP_ALU(0x284100D1u, cpu->gpr[1], _pgx1, 0x00D1u); } #ifdef PSX_COSIM cosim_instr(0x80043454u); #endif @@ -558666,7 +559965,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x8020u); #endif /* 0xBFC2B4B0: 30AF00FF andi $t7, $a1, 0xFF */ - cpu->gpr[15] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[15] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30AF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800434B0u); #endif @@ -558683,7 +559983,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2B4B8: 31D900FF andi $t9, $t6, 0xFF */ - cpu->gpr[25] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[25] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31D900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800434B8u); #endif @@ -558712,7 +560013,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B4C4: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800434C4u); #endif @@ -558729,7 +560031,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B4CC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800434CCu); #endif @@ -558740,7 +560043,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B4D0: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800434D0u); #endif @@ -558748,7 +560052,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2B4D4: 304F00FF andi $t7, $v0, 0xFF */ - cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800434D4u); #endif @@ -558765,7 +560070,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2B4DC: 331900FF andi $t9, $t8, 0xFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x331900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800434DCu); #endif @@ -558821,7 +560127,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x1000040u); #endif /* 0xBFC2B4F4: 30D800FF andi $t8, $a2, 0xFF */ - cpu->gpr[24] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[24] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30D800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800434F4u); #endif @@ -558838,7 +560145,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2B4FC: 332F00FF andi $t7, $t9, 0xFF */ - cpu->gpr[15] = cpu->gpr[25] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[25] & 0xFFu; + PGXP_ALU(0x332F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800434FCu); #endif @@ -558858,7 +560166,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B504: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043504u); #endif @@ -558875,7 +560184,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B50C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004350Cu); #endif @@ -558886,7 +560196,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B510: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043510u); #endif @@ -558894,7 +560205,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2B514: 305800FF andi $t8, $v0, 0xFF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043514u); #endif @@ -558911,7 +560223,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2B51C: 31CF00FF andi $t7, $t6, 0xFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004351Cu); #endif @@ -558967,7 +560280,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4080u); #endif /* 0xBFC2B534: 30EE00FF andi $t6, $a3, 0xFF */ - cpu->gpr[14] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[14] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30EE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043534u); #endif @@ -558984,7 +560298,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC2B53C: 31F800FF andi $t8, $t7, 0xFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004353Cu); #endif @@ -559004,7 +560319,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B544: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043544u); #endif @@ -559021,7 +560337,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B54C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004354Cu); #endif @@ -559032,7 +560349,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B550: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043550u); #endif @@ -559040,7 +560358,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC2B554: 304E00FF andi $t6, $v0, 0xFF */ - cpu->gpr[14] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043554u); #endif @@ -559057,7 +560376,8 @@ label_BFC2B4A4: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2B55C: 333800FF andi $t8, $t9, 0xFF */ - cpu->gpr[24] = cpu->gpr[25] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[24] = cpu->gpr[25] & 0xFFu; + PGXP_ALU(0x333800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004355Cu); #endif @@ -559138,7 +560458,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x2000010u); #endif /* 0xBFC2B57C: 309900FF andi $t9, $a0, 0xFF */ - cpu->gpr[25] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x309900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004357Cu); #endif @@ -559158,7 +560479,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x1004000u); #endif /* 0xBFC2B584: 330E00FF andi $t6, $t8, 0xFF */ - cpu->gpr[14] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[14] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x330E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043584u); #endif @@ -559187,7 +560509,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B590: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043590u); #endif @@ -559204,7 +560527,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B598: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043598u); #endif @@ -559212,7 +560536,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B59C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004359Cu); #endif @@ -559223,7 +560548,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC2B5A0: 305900FF andi $t9, $v0, 0xFF */ - cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800435A0u); #endif @@ -559240,7 +560566,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2B5A8: 31EE00FF andi $t6, $t7, 0xFF */ - cpu->gpr[14] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[14] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31EE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800435A8u); #endif @@ -559287,7 +560614,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x8020u); #endif /* 0xBFC2B5BC: 30AF00FF andi $t7, $a1, 0xFF */ - cpu->gpr[15] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[15] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30AF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800435BCu); #endif @@ -559307,7 +560635,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2B5C4: 31D900FF andi $t9, $t6, 0xFF */ - cpu->gpr[25] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[25] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31D900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800435C4u); #endif @@ -559324,7 +560653,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B5CC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800435CCu); #endif @@ -559344,7 +560674,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B5D4: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800435D4u); #endif @@ -559352,7 +560683,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B5D8: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800435D8u); #endif @@ -559360,7 +560692,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2B5DC: 304F00FF andi $t7, $v0, 0xFF */ - cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800435DCu); #endif @@ -559380,7 +560713,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2B5E4: 331900FF andi $t9, $t8, 0xFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x331900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800435E4u); #endif @@ -559433,7 +560767,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x1000040u); #endif /* 0xBFC2B5FC: 30D800FF andi $t8, $a2, 0xFF */ - cpu->gpr[24] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[24] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30D800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800435FCu); #endif @@ -559453,7 +560788,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2B604: 332F00FF andi $t7, $t9, 0xFF */ - cpu->gpr[15] = cpu->gpr[25] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[25] & 0xFFu; + PGXP_ALU(0x332F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043604u); #endif @@ -559470,7 +560806,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B60C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004360Cu); #endif @@ -559490,7 +560827,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B614: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043614u); #endif @@ -559498,7 +560836,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B618: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043618u); #endif @@ -559506,7 +560845,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2B61C: 305800FF andi $t8, $v0, 0xFF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004361Cu); #endif @@ -559526,7 +560866,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2B624: 31CF00FF andi $t7, $t6, 0xFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043624u); #endif @@ -559579,7 +560920,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4080u); #endif /* 0xBFC2B63C: 30EE00FF andi $t6, $a3, 0xFF */ - cpu->gpr[14] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[14] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30EE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004363Cu); #endif @@ -559599,7 +560941,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC2B644: 31F800FF andi $t8, $t7, 0xFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043644u); #endif @@ -559616,7 +560959,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B64C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004364Cu); #endif @@ -559636,7 +560980,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B654: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043654u); #endif @@ -559644,7 +560989,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B658: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043658u); #endif @@ -559652,7 +560998,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC2B65C: 304E00FF andi $t6, $v0, 0xFF */ - cpu->gpr[14] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004365Cu); #endif @@ -559672,7 +561019,8 @@ label_BFC2B574: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2B664: 333800FF andi $t8, $t9, 0xFF */ - cpu->gpr[24] = cpu->gpr[25] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[24] = cpu->gpr[25] & 0xFFu; + PGXP_ALU(0x333800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043664u); #endif @@ -560045,7 +561393,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x2000020u); #endif /* 0xBFC2B6DC: 30B900FF andi $t9, $a1, 0xFF */ - cpu->gpr[25] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[25] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30B900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800436DCu); #endif @@ -560065,7 +561414,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x1004000u); #endif /* 0xBFC2B6E4: 330E00FF andi $t6, $t8, 0xFF */ - cpu->gpr[14] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[14] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x330E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800436E4u); #endif @@ -560100,7 +561450,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B6F4: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800436F4u); #endif @@ -560117,7 +561468,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B6FC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800436FCu); #endif @@ -560128,7 +561480,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B700: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043700u); #endif @@ -560136,7 +561489,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC2B704: 305900FF andi $t9, $v0, 0xFF */ - cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043704u); #endif @@ -560153,7 +561507,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2B70C: 31EE00FF andi $t6, $t7, 0xFF */ - cpu->gpr[14] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[14] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31EE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004370Cu); #endif @@ -560209,7 +561564,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x8040u); #endif /* 0xBFC2B724: 30CF00FF andi $t7, $a2, 0xFF */ - cpu->gpr[15] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043724u); #endif @@ -560226,7 +561582,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2B72C: 31D900FF andi $t9, $t6, 0xFF */ - cpu->gpr[25] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[25] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31D900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004372Cu); #endif @@ -560246,7 +561603,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B734: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043734u); #endif @@ -560263,7 +561621,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B73C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004373Cu); #endif @@ -560274,7 +561633,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B740: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043740u); #endif @@ -560282,7 +561642,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2B744: 304F00FF andi $t7, $v0, 0xFF */ - cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043744u); #endif @@ -560299,7 +561660,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2B74C: 331900FF andi $t9, $t8, 0xFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x331900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004374Cu); #endif @@ -560355,7 +561717,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x1000080u); #endif /* 0xBFC2B764: 30F800FF andi $t8, $a3, 0xFF */ - cpu->gpr[24] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[24] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043764u); #endif @@ -560372,7 +561735,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2B76C: 332F00FF andi $t7, $t9, 0xFF */ - cpu->gpr[15] = cpu->gpr[25] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[25] & 0xFFu; + PGXP_ALU(0x332F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004376Cu); #endif @@ -560392,7 +561756,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B774: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043774u); #endif @@ -560409,7 +561774,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B77C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004377Cu); #endif @@ -560420,7 +561786,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B780: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043780u); #endif @@ -560428,7 +561795,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2B784: 305800FF andi $t8, $v0, 0xFF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043784u); #endif @@ -560445,7 +561813,8 @@ label_BFC2B6D0: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2B78C: 31CF00FF andi $t7, $t6, 0xFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004378Cu); #endif @@ -560526,7 +561895,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC2B7AC: 308E00FF andi $t6, $a0, 0xFF */ - cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800437ACu); #endif @@ -560546,7 +561916,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC2B7B4: 31F800FF andi $t8, $t7, 0xFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800437B4u); #endif @@ -560575,7 +561946,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B7C0: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800437C0u); #endif @@ -560592,7 +561964,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B7C8: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800437C8u); #endif @@ -560600,7 +561973,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B7CC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800437CCu); #endif @@ -560611,7 +561985,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC2B7D0: 304E00FF andi $t6, $v0, 0xFF */ - cpu->gpr[14] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800437D0u); #endif @@ -560628,7 +562003,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2B7D8: 333800FF andi $t8, $t9, 0xFF */ - cpu->gpr[24] = cpu->gpr[25] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[24] = cpu->gpr[25] & 0xFFu; + PGXP_ALU(0x333800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800437D8u); #endif @@ -560675,7 +562051,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x2000020u); #endif /* 0xBFC2B7EC: 30B900FF andi $t9, $a1, 0xFF */ - cpu->gpr[25] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[25] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30B900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800437ECu); #endif @@ -560695,7 +562072,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x1004000u); #endif /* 0xBFC2B7F4: 330E00FF andi $t6, $t8, 0xFF */ - cpu->gpr[14] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[14] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x330E00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800437F4u); #endif @@ -560712,7 +562090,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B7FC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800437FCu); #endif @@ -560732,7 +562111,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B804: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043804u); #endif @@ -560740,7 +562120,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B808: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043808u); #endif @@ -560748,7 +562129,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC2B80C: 305900FF andi $t9, $v0, 0xFF */ - cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004380Cu); #endif @@ -560768,7 +562150,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2B814: 31EE00FF andi $t6, $t7, 0xFF */ - cpu->gpr[14] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[14] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31EE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043814u); #endif @@ -560821,7 +562204,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x8040u); #endif /* 0xBFC2B82C: 30CF00FF andi $t7, $a2, 0xFF */ - cpu->gpr[15] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004382Cu); #endif @@ -560841,7 +562225,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2B834: 31D900FF andi $t9, $t6, 0xFF */ - cpu->gpr[25] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[25] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31D900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043834u); #endif @@ -560858,7 +562243,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B83C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004383Cu); #endif @@ -560878,7 +562264,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B844: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043844u); #endif @@ -560886,7 +562273,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B848: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043848u); #endif @@ -560894,7 +562282,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2B84C: 304F00FF andi $t7, $v0, 0xFF */ - cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004384Cu); #endif @@ -560914,7 +562303,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2B854: 331900FF andi $t9, $t8, 0xFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x331900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043854u); #endif @@ -560967,7 +562357,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x1000080u); #endif /* 0xBFC2B86C: 30F800FF andi $t8, $a3, 0xFF */ - cpu->gpr[24] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[24] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004386Cu); #endif @@ -560987,7 +562378,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2B874: 332F00FF andi $t7, $t9, 0xFF */ - cpu->gpr[15] = cpu->gpr[25] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[25] & 0xFFu; + PGXP_ALU(0x332F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043874u); #endif @@ -561004,7 +562396,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B87C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004387Cu); #endif @@ -561024,7 +562417,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B884: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043884u); #endif @@ -561032,7 +562426,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2B888: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80043888u); #endif @@ -561040,7 +562435,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2B88C: 305800FF andi $t8, $v0, 0xFF */ - cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004388Cu); #endif @@ -561060,7 +562456,8 @@ label_BFC2B7A4: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2B894: 31CF00FF andi $t7, $t6, 0xFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80043894u); #endif @@ -561404,7 +562801,8 @@ label_BFC2B8F4: psx_cyc_step(cpu, 0x1000002u); #endif /* 0xBFC2B8FC: 2B010100 slti $at, $t8, 256 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (256) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (256) ? 1 : 0); + PGXP_ALU(0x2B010100u, cpu->gpr[1], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x800438FCu); #endif @@ -561592,7 +562990,8 @@ label_BFC2B938: psx_cyc_step(cpu, 0x80000012u); #endif /* 0xBFC2B938: 03E4082A slt $at, $ra, $a0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[31] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[31]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[31] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x03E4082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80043938u); #endif @@ -561837,7 +563236,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC2B984: 30A50001 andi $a1, $a1, 0x1 */ - cpu->gpr[5] = cpu->gpr[5] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x1u; + PGXP_ALU(0x30A50001u, cpu->gpr[5], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043984u); #endif @@ -561845,7 +563245,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC2B988: 316B0001 andi $t3, $t3, 0x1 */ - cpu->gpr[11] = cpu->gpr[11] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0x1u; + PGXP_ALU(0x316B0001u, cpu->gpr[11], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043988u); #endif @@ -561853,7 +563254,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC2B98C: 30840001 andi $a0, $a0, 0x1 */ - cpu->gpr[4] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30840001u, cpu->gpr[4], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004398Cu); #endif @@ -561921,7 +563323,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC2B9A8: 30C60001 andi $a2, $a2, 0x1 */ - cpu->gpr[6] = cpu->gpr[6] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x1u; + PGXP_ALU(0x30C60001u, cpu->gpr[6], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800439A8u); #endif @@ -561980,7 +563383,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC2B9C0: 30E70001 andi $a3, $a3, 0x1 */ - cpu->gpr[7] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E70001u, cpu->gpr[7], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800439C0u); #endif @@ -562075,7 +563479,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC2B9E8: 31290001 andi $t1, $t1, 0x1 */ - cpu->gpr[9] = cpu->gpr[9] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0x1u; + PGXP_ALU(0x31290001u, cpu->gpr[9], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800439E8u); #endif @@ -562083,7 +563488,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC2B9EC: 31080001 andi $t0, $t0, 0x1 */ - cpu->gpr[8] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31080001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800439ECu); #endif @@ -562151,7 +563557,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x400u); #endif /* 0xBFC2BA08: 314A0001 andi $t2, $t2, 0x1 */ - cpu->gpr[10] = cpu->gpr[10] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[10] & 0x1u; + PGXP_ALU(0x314A0001u, cpu->gpr[10], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043A08u); #endif @@ -562210,7 +563617,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC2BA20: 304C0001 andi $t4, $v0, 0x1 */ - cpu->gpr[12] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304C0001u, cpu->gpr[12], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043A20u); #endif @@ -562296,7 +563704,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC2BA44: 30840001 andi $a0, $a0, 0x1 */ - cpu->gpr[4] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30840001u, cpu->gpr[4], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043A44u); #endif @@ -562304,7 +563713,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC2BA48: 30A50001 andi $a1, $a1, 0x1 */ - cpu->gpr[5] = cpu->gpr[5] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x1u; + PGXP_ALU(0x30A50001u, cpu->gpr[5], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043A48u); #endif @@ -562372,7 +563782,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC2BA64: 30C60001 andi $a2, $a2, 0x1 */ - cpu->gpr[6] = cpu->gpr[6] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x1u; + PGXP_ALU(0x30C60001u, cpu->gpr[6], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043A64u); #endif @@ -562428,7 +563839,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC2BA7C: 30E70001 andi $a3, $a3, 0x1 */ - cpu->gpr[7] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E70001u, cpu->gpr[7], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043A7Cu); #endif @@ -562526,7 +563938,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC2BAA4: 31080001 andi $t0, $t0, 0x1 */ - cpu->gpr[8] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31080001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043AA4u); #endif @@ -562534,7 +563947,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC2BAA8: 31290001 andi $t1, $t1, 0x1 */ - cpu->gpr[9] = cpu->gpr[9] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0x1u; + PGXP_ALU(0x31290001u, cpu->gpr[9], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043AA8u); #endif @@ -562602,7 +564016,8 @@ label_BFC2B970: psx_cyc_step(cpu, 0x400u); #endif /* 0xBFC2BAC4: 314A0001 andi $t2, $t2, 0x1 */ - cpu->gpr[10] = cpu->gpr[10] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[10] & 0x1u; + PGXP_ALU(0x314A0001u, cpu->gpr[10], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043AC4u); #endif @@ -562851,7 +564266,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x1004000u); #endif /* 0xBFC2BB24: 31D80001 andi $t8, $t6, 0x1 */ - cpu->gpr[24] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[24] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31D80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043B24u); #endif @@ -562859,7 +564275,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2BB28: 332F0001 andi $t7, $t9, 0x1 */ - cpu->gpr[15] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x332F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043B28u); #endif @@ -562897,7 +564314,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC2BB38: 31F80001 andi $t8, $t7, 0x1 */ - cpu->gpr[24] = cpu->gpr[15] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x1u; + PGXP_ALU(0x31F80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043B38u); #endif @@ -562935,7 +564353,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2BB48: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043B48u); #endif @@ -563012,7 +564431,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2BB68: 332F0001 andi $t7, $t9, 0x1 */ - cpu->gpr[15] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x332F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043B68u); #endif @@ -563020,7 +564440,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x1004000u); #endif /* 0xBFC2BB6C: 31D80001 andi $t8, $t6, 0x1 */ - cpu->gpr[24] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[24] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31D80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043B6Cu); #endif @@ -563058,7 +564479,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC2BB7C: 330F0001 andi $t7, $t8, 0x1 */ - cpu->gpr[15] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[15] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x330F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043B7Cu); #endif @@ -563087,7 +564509,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2BB88: 304F0001 andi $t7, $v0, 0x1 */ - cpu->gpr[15] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043B88u); #endif @@ -563164,7 +564587,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC2BBA8: 31F80001 andi $t8, $t7, 0x1 */ - cpu->gpr[24] = cpu->gpr[15] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x1u; + PGXP_ALU(0x31F80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043BA8u); #endif @@ -563172,7 +564596,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2BBAC: 31D90001 andi $t9, $t6, 0x1 */ - cpu->gpr[25] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[25] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31D90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043BACu); #endif @@ -563210,7 +564635,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2BBBC: 33380001 andi $t8, $t9, 0x1 */ - cpu->gpr[24] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[24] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x33380001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043BBCu); #endif @@ -563248,7 +564674,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x1004000u); #endif /* 0xBFC2BBCC: 330E0001 andi $t6, $t8, 0x1 */ - cpu->gpr[14] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[14] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x330E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043BCCu); #endif @@ -563325,7 +564752,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x2004000u); #endif /* 0xBFC2BBEC: 31D90001 andi $t9, $t6, 0x1 */ - cpu->gpr[25] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[25] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31D90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043BECu); #endif @@ -563336,7 +564764,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC2BBF0: 31F80001 andi $t8, $t7, 0x1 */ - cpu->gpr[24] = cpu->gpr[15] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x1u; + PGXP_ALU(0x31F80001u, cpu->gpr[24], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043BF0u); #endif @@ -563374,7 +564803,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2BC00: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043C00u); #endif @@ -563412,7 +564842,8 @@ label_BFC2BB04: psx_cyc_step(cpu, 0x2008000u); #endif /* 0xBFC2BC10: 332F0001 andi $t7, $t9, 0x1 */ - cpu->gpr[15] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x332F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80043C10u); #endif @@ -563623,7 +565054,8 @@ label_BFC2BC54: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC2BC58: 2A810010 slti $at, $s4, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (16) ? 1 : 0); + PGXP_ALU(0x2A810010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80043C58u); #endif @@ -563674,7 +565106,8 @@ label_BFC2BC64: psx_cyc_step(cpu, 0x200012u); #endif /* 0xBFC2BC64: 02A4082A slt $at, $s5, $a0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[21] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[21]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[21] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x02A4082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80043C64u); #endif @@ -563689,7 +565122,8 @@ label_BFC2BC64: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC2BC6C: 28810010 slti $at, $a0, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (16) ? 1 : 0); + PGXP_ALU(0x28810010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80043C6Cu); #endif @@ -563744,7 +565178,8 @@ label_BFC2BC70: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC2BC7C: 29C10100 slti $at, $t6, 256 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (256) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (256) ? 1 : 0); + PGXP_ALU(0x29C10100u, cpu->gpr[1], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x80043C7Cu); #endif @@ -563795,7 +565230,8 @@ label_BFC2BC88: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC2BC88: 28810010 slti $at, $a0, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (16) ? 1 : 0); + PGXP_ALU(0x28810010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80043C88u); #endif @@ -564527,7 +565963,8 @@ label_BFC2BCEC: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC2BD80: 28610011 slti $at, $v1, 17 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (17) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (17) ? 1 : 0); + PGXP_ALU(0x28610011u, cpu->gpr[1], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x80043D80u); #endif @@ -564631,7 +566068,8 @@ label_BFC2BD98: psx_cyc_step(cpu, 0x20004u); #endif /* 0xBFC2BD9C: 3222000F andi $v0, $s1, 0xF */ - cpu->gpr[2] = cpu->gpr[17] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[2] = cpu->gpr[17] & 0xFu; + PGXP_ALU(0x3222000Fu, cpu->gpr[2], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80043D9Cu); #endif @@ -564791,7 +566229,8 @@ label_BFC2BDB4: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC2BDC4: 28610010 slti $at, $v1, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (16) ? 1 : 0); + PGXP_ALU(0x28610010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80043DC4u); #endif @@ -564932,7 +566371,8 @@ label_BFC2BDE8: psx_cyc_step(cpu, 0x208000u); #endif /* 0xBFC2BDEC: 32AF003F andi $t7, $s5, 0x3F */ - cpu->gpr[15] = cpu->gpr[21] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[21]; cpu->gpr[15] = cpu->gpr[21] & 0x3Fu; + PGXP_ALU(0x32AF003Fu, cpu->gpr[15], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80043DECu); #endif @@ -565022,7 +566462,8 @@ label_BFC2BDFC: psx_cyc_step(cpu, 0x8012u); #endif /* 0xBFC2BDFC: 01E4082A slt $at, $t7, $a0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x01E4082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80043DFCu); #endif @@ -565605,7 +567046,8 @@ label_BFC2BEA8: psx_cyc_step(cpu, 0x100006u); #endif /* 0xBFC2BEB8: 0282082A slt $at, $s4, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0282082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80043EB8u); #endif @@ -566443,7 +567885,8 @@ label_BFC2BFAC: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2BFB4: 304F0008 andi $t7, $v0, 0x8 */ - cpu->gpr[15] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304F0008u, cpu->gpr[15], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80043FB4u); #endif @@ -566458,7 +567901,8 @@ label_BFC2BFAC: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2BFBC: 30580003 andi $t8, $v0, 0x3 */ - cpu->gpr[24] = cpu->gpr[2] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x3u; + PGXP_ALU(0x30580003u, cpu->gpr[24], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80043FBCu); #endif @@ -566514,7 +567958,8 @@ label_BFC2BFC0: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2BFCC: 30580003 andi $t8, $v0, 0x3 */ - cpu->gpr[24] = cpu->gpr[2] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x3u; + PGXP_ALU(0x30580003u, cpu->gpr[24], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80043FCCu); #endif @@ -567088,7 +568533,8 @@ label_BFC2C074: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC2C08C: 30840007 andi $a0, $a0, 0x7 */ - cpu->gpr[4] = cpu->gpr[4] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0x7u; + PGXP_ALU(0x30840007u, cpu->gpr[4], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x8004408Cu); #endif @@ -567172,7 +568618,8 @@ label_BFC2C090: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC2C0AC: 31AE003F andi $t6, $t5, 0x3F */ - cpu->gpr[14] = cpu->gpr[13] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x3Fu; + PGXP_ALU(0x31AE003Fu, cpu->gpr[14], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x800440ACu); #endif @@ -567306,7 +568753,8 @@ label_BFC2C0BC: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC2C0D0: 31F800FF andi $t8, $t7, 0xFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800440D0u); #endif @@ -567419,7 +568867,8 @@ label_BFC2C0E0: psx_cyc_step(cpu, 0x2000002u); #endif /* 0xBFC2C0EC: 2F210002 sltiu $at, $t9, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[25] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[25] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2F210002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x800440ECu); #endif @@ -567722,7 +569171,8 @@ label_BFC2C158: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC2C160: 2DC10002 sltiu $at, $t6, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2DC10002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80044160u); #endif @@ -568070,7 +569520,8 @@ label_BFC2C1C4: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2C1DC: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800441DCu); #endif @@ -568135,7 +569586,8 @@ label_BFC2C1E8: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC2C1F0: 316CFFFF andi $t4, $t3, 0xFFFF */ - cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316CFFFFu, cpu->gpr[12], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800441F0u); #endif @@ -568179,7 +569631,8 @@ label_BFC2C1E8: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2C204: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80044204u); #endif @@ -568214,7 +569667,8 @@ label_BFC2C1E8: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2C214: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80044214u); #endif @@ -568288,7 +569742,8 @@ label_BFC2C1E8: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC2C234: 312AFFFF andi $t2, $t1, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x312AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80044234u); #endif @@ -568341,7 +569796,8 @@ label_BFC2C1E8: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC2C24C: 316CFFFF andi $t4, $t3, 0xFFFF */ - cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316CFFFFu, cpu->gpr[12], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004424Cu); #endif @@ -568388,7 +569844,8 @@ label_BFC2C1E8: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2C260: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80044260u); #endif @@ -568423,7 +569880,8 @@ label_BFC2C1E8: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2C270: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80044270u); #endif @@ -568467,7 +569925,8 @@ label_BFC2C1E8: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC2C284: 312AFFFF andi $t2, $t1, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x312AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80044284u); #endif @@ -568522,7 +569981,8 @@ label_BFC2C290: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC2C298: 316CFFFF andi $t4, $t3, 0xFFFF */ - cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316CFFFFu, cpu->gpr[12], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80044298u); #endif @@ -568566,7 +570026,8 @@ label_BFC2C290: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC2C2AC: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800442ACu); #endif @@ -568601,7 +570062,8 @@ label_BFC2C290: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2C2BC: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800442BCu); #endif @@ -568648,7 +570110,8 @@ label_BFC2C290: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC2C2D0: 312AFFFF andi $t2, $t1, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x312AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800442D0u); #endif @@ -568974,7 +570437,8 @@ label_BFC2C328: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC2C33C: 0048082B sltu $at, $v0, $t0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0048082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004433Cu); #endif @@ -569095,7 +570559,8 @@ label_BFC2C364: psx_cyc_step(cpu, 0x32u); #endif /* 0xBFC2C364: 0085082B sltu $at, $a0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0085082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80044364u); #endif @@ -569211,7 +570676,8 @@ label_BFC2C370: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC2C390: 0045082B sltu $at, $v0, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0045082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80044390u); #endif @@ -569313,7 +570779,8 @@ label_BFC2C3AC: psx_cyc_step(cpu, 0x182u); #endif /* 0xBFC2C3B0: 00E8082B sltu $at, $a3, $t0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[7] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[7] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x00E8082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800443B0u); #endif @@ -570119,7 +571586,8 @@ label_BFC2C494: psx_cyc_step(cpu, 0x808u); #endif /* 0xBFC2C494: 306BFFFF andi $t3, $v1, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[3] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[11] = cpu->gpr[3] & 0xFFFFu; + PGXP_ALU(0x306BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80044494u); #endif @@ -570837,7 +572305,8 @@ label_BFC2C4E4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC2C59C: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004459Cu); #endif @@ -580616,7 +582085,8 @@ label_BFC2D154: psx_cyc_step(cpu, 0x4018u); #endif /* 0xBFC2D194: 01C32026 xor $a0, $t6, $v1 */ - cpu->gpr[4] = cpu->gpr[14] ^ cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[4] = cpu->gpr[14] ^ cpu->gpr[3]; + PGXP_ALU(0x01C32026u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045194u); #endif @@ -580624,7 +582094,8 @@ label_BFC2D154: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC2D198: 2C840001 sltiu $a0, $a0, 1 */ - cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x00000001u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = (uint32_t)(cpu->gpr[4] < 0x00000001u ? 1 : 0); + PGXP_ALU(0x2C840001u, cpu->gpr[4], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80045198u); #endif @@ -580819,7 +582290,8 @@ label_BFC2D1CC: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC2D1D4: 304B00F0 andi $t3, $v0, 0xF0 */ - cpu->gpr[11] = cpu->gpr[2] & 0xF0u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0xF0u; + PGXP_ALU(0x304B00F0u, cpu->gpr[11], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x800451D4u); #endif @@ -580866,7 +582338,8 @@ label_BFC2D1E0: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC2D1E0: 304C0004 andi $t4, $v0, 0x4 */ - cpu->gpr[12] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x304C0004u, cpu->gpr[12], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x800451E0u); #endif @@ -581166,7 +582639,8 @@ label_BFC2D230: psx_cyc_step(cpu, 0x2008002u); #endif /* 0xBFC2D234: 032F082A slt $at, $t9, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x032F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045234u); #endif @@ -581438,7 +582912,8 @@ label_BFC2D240: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC2D2A0: 0062082A slt $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800452A0u); #endif @@ -581767,7 +583242,8 @@ label_BFC2D310: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC2D310: 304A0002 andi $t2, $v0, 0x2 */ - cpu->gpr[10] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x304A0002u, cpu->gpr[10], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80045310u); #endif @@ -581782,7 +583258,8 @@ label_BFC2D310: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2D318: 304F0001 andi $t7, $v0, 0x1 */ - cpu->gpr[15] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80045318u); #endif @@ -582060,7 +583537,8 @@ label_BFC2D370: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC2D380: 304F0001 andi $t7, $v0, 0x1 */ - cpu->gpr[15] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304F0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80045380u); #endif @@ -582085,7 +583563,8 @@ label_BFC2D384: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC2D388: 304C0008 andi $t4, $v0, 0x8 */ - cpu->gpr[12] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304C0008u, cpu->gpr[12], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80045388u); #endif @@ -582451,7 +583930,8 @@ label_BFC2D400: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC2D410: 304C0008 andi $t4, $v0, 0x8 */ - cpu->gpr[12] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304C0008u, cpu->gpr[12], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80045410u); #endif @@ -582604,7 +584084,8 @@ label_BFC2D41C: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC2D444: 30430080 andi $v1, $v0, 0x80 */ - cpu->gpr[3] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30430080u, cpu->gpr[3], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80045444u); #endif @@ -583087,7 +584568,8 @@ label_BFC2D4CC: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC2D4D4: 30490004 andi $t1, $v0, 0x4 */ - cpu->gpr[9] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[9] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30490004u, cpu->gpr[9], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x800454D4u); #endif @@ -583102,7 +584584,8 @@ label_BFC2D4CC: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC2D4DC: 304B0010 andi $t3, $v0, 0x10 */ - cpu->gpr[11] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304B0010u, cpu->gpr[11], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x800454DCu); #endif @@ -583477,7 +584960,8 @@ label_BFC2D54C: psx_cyc_step(cpu, 0x1000102u); #endif /* 0xBFC2D550: 0118082A slt $at, $t0, $t8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x0118082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045550u); #endif @@ -583749,7 +585233,8 @@ label_BFC2D55C: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC2D5BC: 0062082A slt $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800455BCu); #endif @@ -584259,7 +585744,8 @@ label_BFC2D658: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC2D668: 304B0010 andi $t3, $v0, 0x10 */ - cpu->gpr[11] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304B0010u, cpu->gpr[11], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80045668u); #endif @@ -584878,7 +586364,8 @@ label_BFC2D6E4: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC2D724: 2A01003C slti $at, $s0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (60) ? 1 : 0); + PGXP_ALU(0x2A01003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x80045724u); #endif @@ -585057,7 +586544,8 @@ label_BFC2D758: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC2D758: 0050082A slt $at, $v0, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0050082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045758u); #endif @@ -585154,7 +586642,8 @@ label_BFC2D76C: psx_cyc_step(cpu, 0x30002u); #endif /* 0xBFC2D770: 0230082A slt $at, $s1, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0230082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045770u); #endif @@ -585290,7 +586779,8 @@ label_BFC2D78C: psx_cyc_step(cpu, 0x18002u); #endif /* 0xBFC2D798: 020F082A slt $at, $s0, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x020F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045798u); #endif @@ -585831,7 +587321,8 @@ label_BFC2D7CC: psx_cyc_step(cpu, 0x412u); #endif /* 0xBFC2D854: 008A082A slt $at, $a0, $t2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x008A082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045854u); #endif @@ -586000,7 +587491,8 @@ label_BFC2D87C: psx_cyc_step(cpu, 0x2802u); #endif /* 0xBFC2D888: 01AB082A slt $at, $t5, $t3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x01AB082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045888u); #endif @@ -586124,7 +587616,8 @@ label_BFC2D8A0: psx_cyc_step(cpu, 0x90002u); #endif /* 0xBFC2D8A8: 0213082A slt $at, $s0, $s3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0213082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800458A8u); #endif @@ -586212,7 +587705,8 @@ label_BFC2D8BC: psx_cyc_step(cpu, 0x28002u); #endif /* 0xBFC2D8C0: 022F082A slt $at, $s1, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x022F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800458C0u); #endif @@ -586983,7 +588477,8 @@ label_BFC2D99C: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC2D9C0: 30590020 andi $t9, $v0, 0x20 */ - cpu->gpr[25] = cpu->gpr[2] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x20u; + PGXP_ALU(0x30590020u, cpu->gpr[25], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x800459C0u); #endif @@ -587453,7 +588948,8 @@ label_BFC2DA38: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC2DA50: 2A01003C slti $at, $s0, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (60) ? 1 : 0); + PGXP_ALU(0x2A01003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x80045A50u); #endif @@ -588069,7 +589565,8 @@ label_BFC2DB00: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC2DB08: 33190020 andi $t9, $t8, 0x20 */ - cpu->gpr[25] = cpu->gpr[24] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x20u; + PGXP_ALU(0x33190020u, cpu->gpr[25], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80045B08u); #endif @@ -588157,7 +589654,8 @@ label_BFC2DB18: psx_cyc_step(cpu, 0x40002u); #endif /* 0xBFC2DB20: 2A41000F slti $at, $s2, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (15) ? 1 : 0); + PGXP_ALU(0x2A41000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80045B20u); #endif @@ -588351,7 +589849,8 @@ label_BFC2DB50: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC2DB54: 2A210010 slti $at, $s1, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (16) ? 1 : 0); + PGXP_ALU(0x2A210010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80045B54u); #endif @@ -589409,7 +590908,8 @@ label_BFC2DCA8: psx_cyc_step(cpu, 0x206u); #endif /* 0xBFC2DCB4: 0122082A slt $at, $t1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0122082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045CB4u); #endif @@ -589518,7 +591018,8 @@ label_BFC2DCC8: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC2DCD4: 0102082A slt $at, $t0, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0102082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045CD4u); #endif @@ -589718,7 +591219,8 @@ label_BFC2DD08: psx_cyc_step(cpu, 0x1006u); #endif /* 0xBFC2DD14: 0182082A slt $at, $t4, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0182082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045D14u); #endif @@ -589827,7 +591329,8 @@ label_BFC2DD28: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC2DD34: 01C2082A slt $at, $t6, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01C2082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045D34u); #endif @@ -589919,7 +591422,8 @@ label_BFC2DD40: psx_cyc_step(cpu, 0x1008002u); #endif /* 0xBFC2DD54: 01E1C024 and $t8, $t7, $at */ - cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[1]; + PGXP_ALU(0x01E1C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045D54u); #endif @@ -590853,7 +592357,8 @@ label_BFC2DEA8: psx_cyc_step(cpu, 0x24002u); #endif /* 0xBFC2DEB0: 022E082A slt $at, $s1, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x022E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045EB0u); #endif @@ -591061,7 +592566,8 @@ label_BFC2DEE8: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC2DEE8: 30580040 andi $t8, $v0, 0x40 */ - cpu->gpr[24] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x30580040u, cpu->gpr[24], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80045EE8u); #endif @@ -591438,7 +592944,8 @@ label_BFC2DF60: psx_cyc_step(cpu, 0x8006u); #endif /* 0xBFC2DF6C: 01E2082A slt $at, $t7, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01E2082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045F6Cu); #endif @@ -591547,7 +593054,8 @@ label_BFC2DF80: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC2DF8C: 0302082A slt $at, $t8, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0302082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045F8Cu); #endif @@ -591750,7 +593258,8 @@ label_BFC2DFC0: psx_cyc_step(cpu, 0x406u); #endif /* 0xBFC2DFCC: 0142082A slt $at, $t2, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0142082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045FCCu); #endif @@ -591859,7 +593368,8 @@ label_BFC2DFE0: psx_cyc_step(cpu, 0x806u); #endif /* 0xBFC2DFEC: 0162082A slt $at, $t3, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0162082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80045FECu); #endif @@ -591972,7 +593482,8 @@ label_BFC2DFF8: psx_cyc_step(cpu, 0x3002u); #endif /* 0xBFC2E014: 01A16024 and $t4, $t5, $at */ - cpu->gpr[12] = cpu->gpr[13] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[13] & cpu->gpr[1]; + PGXP_ALU(0x01A16024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046014u); #endif @@ -592621,7 +594132,8 @@ label_BFC2E0FC: psx_cyc_step(cpu, 0x24002u); #endif /* 0xBFC2E104: 022E082A slt $at, $s1, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x022E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046104u); #endif @@ -593908,7 +595420,8 @@ label_BFC2E2B0: psx_cyc_step(cpu, 0x42002u); #endif /* 0xBFC2E2BC: 024D082A slt $at, $s2, $t5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x024D082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800462BCu); #endif @@ -594021,7 +595534,8 @@ label_BFC2E2D4: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC2E2DC: 29C10060 slti $at, $t6, 96 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (96) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (96) ? 1 : 0); + PGXP_ALU(0x29C10060u, cpu->gpr[1], _pgx1, 0x0060u); } #ifdef PSX_COSIM cosim_instr(0x800462DCu); #endif @@ -594791,7 +596305,8 @@ label_BFC2E3C4: psx_cyc_step(cpu, 0x2Au); #endif /* 0xBFC2E3E0: 0065082A slt $at, $v1, $a1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0065082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800463E0u); #endif @@ -594918,7 +596433,8 @@ label_BFC2E3F4: psx_cyc_step(cpu, 0x200000Au); #endif /* 0xBFC2E404: 0323082A slt $at, $t9, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0323082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046404u); #endif @@ -597103,7 +598619,8 @@ label_BFC2E6B8: psx_cyc_step(cpu, 0x1008020u); #endif /* 0xBFC2E6F8: 00AFC024 and $t8, $a1, $t7 */ - cpu->gpr[24] = cpu->gpr[5] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[5] & cpu->gpr[15]; + PGXP_ALU(0x00AFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800466F8u); #endif @@ -597406,7 +598923,8 @@ label_BFC2E750: psx_cyc_step(cpu, 0x822u); #endif /* 0xBFC2E754: 00A15824 and $t3, $a1, $at */ - cpu->gpr[11] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[11] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A15824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046754u); #endif @@ -597696,7 +599214,8 @@ label_BFC2E7B4: psx_cyc_step(cpu, 0x8022u); #endif /* 0xBFC2E7B8: 00A17824 and $t7, $a1, $at */ - cpu->gpr[15] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800467B8u); #endif @@ -597986,7 +599505,8 @@ label_BFC2E814: psx_cyc_step(cpu, 0x122u); #endif /* 0xBFC2E818: 00A14024 and $t0, $a1, $at */ - cpu->gpr[8] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A14024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046818u); #endif @@ -598276,7 +599796,8 @@ label_BFC2E874: psx_cyc_step(cpu, 0x822u); #endif /* 0xBFC2E878: 00A15824 and $t3, $a1, $at */ - cpu->gpr[11] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[11] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A15824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046878u); #endif @@ -598658,7 +600179,8 @@ label_BFC2E8CC: psx_cyc_step(cpu, 0x4022u); #endif /* 0xBFC2E8E4: 00A17024 and $t6, $a1, $at */ - cpu->gpr[14] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A17024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800468E4u); #endif @@ -599124,7 +600646,8 @@ label_BFC2E97C: psx_cyc_step(cpu, 0x422u); #endif /* 0xBFC2E980: 00A15024 and $t2, $a1, $at */ - cpu->gpr[10] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[10] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A15024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046980u); #endif @@ -599417,7 +600940,8 @@ label_BFC2E9DC: psx_cyc_step(cpu, 0x2022u); #endif /* 0xBFC2E9E0: 00A16824 and $t5, $a1, $at */ - cpu->gpr[13] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[13] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A16824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800469E0u); #endif @@ -599710,7 +601234,8 @@ label_BFC2EA3C: psx_cyc_step(cpu, 0x1000022u); #endif /* 0xBFC2EA40: 00A1C024 and $t8, $a1, $at */ - cpu->gpr[24] = cpu->gpr[5] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[5] & cpu->gpr[1]; + PGXP_ALU(0x00A1C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046A40u); #endif @@ -602332,7 +603857,8 @@ label_BFC2EE90: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC2EE94: 00A2082A slt $at, $a1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x00A2082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80046E94u); #endif @@ -603672,7 +605198,8 @@ label_BFC2F014: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC2F014: 2A81003C slti $at, $s4, 60 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (60) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (60) ? 1 : 0); + PGXP_ALU(0x2A81003Cu, cpu->gpr[1], _pgx1, 0x003Cu); } #ifdef PSX_COSIM cosim_instr(0x80047014u); #endif @@ -603915,7 +605442,8 @@ label_BFC2F03C: psx_cyc_step(cpu, 0x20802u); #endif /* 0xBFC2F064: 022B082A slt $at, $s1, $t3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x022B082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80047064u); #endif @@ -609188,7 +610716,8 @@ label_BFC2F830: psx_cyc_step(cpu, 0x800Cu); #endif /* 0xBFC2F83C: 006F1024 and $v0, $v1, $t7 */ - cpu->gpr[2] = cpu->gpr[3] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[2] = cpu->gpr[3] & cpu->gpr[15]; + PGXP_ALU(0x006F1024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004783Cu); #endif @@ -610976,7 +612505,8 @@ label_BFC2FA18: psx_cyc_step(cpu, 0x180002u); #endif /* 0xBFC2FA1C: 0293082A slt $at, $s4, $s3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (int32_t)cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (int32_t)cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0293082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80047A1Cu); #endif @@ -614437,7 +615967,8 @@ label_BFC2FEC4: psx_cyc_step(cpu, 0x2402u); #endif /* 0xBFC2FED4: 014D082A slt $at, $t2, $t5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (int32_t)cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x014D082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80047ED4u); #endif @@ -614603,7 +616134,8 @@ label_BFC2FEEC: psx_cyc_step(cpu, 0x602u); #endif /* 0xBFC2FF10: 012A082A slt $at, $t1, $t2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x012A082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80047F10u); #endif @@ -617814,7 +619346,8 @@ label_BFC3041C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC30430: 2C410004 sltiu $at, $v0, 4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000004u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000004u ? 1 : 0); + PGXP_ALU(0x2C410004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80048430u); #endif @@ -618735,7 +620268,8 @@ label_BFC30514: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC30528: 2C410004 sltiu $at, $v0, 4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000004u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000004u ? 1 : 0); + PGXP_ALU(0x2C410004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80048528u); #endif @@ -628301,7 +629835,8 @@ label_BFC31128: psx_cyc_step(cpu, 0x420002u); #endif /* 0xBFC3112C: 0236082A slt $at, $s1, $s6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[22] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; uint32_t _pgx2 = cpu->gpr[22]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (int32_t)cpu->gpr[22] ? 1 : 0); + PGXP_ALU(0x0236082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004912Cu); #endif @@ -630229,7 +631764,8 @@ label_BFC313B8: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC313C4: 2A211000 slti $at, $s1, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (4096) ? 1 : 0); + PGXP_ALU(0x2A211000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x800493C4u); #endif @@ -630521,7 +632057,8 @@ label_BFC31418: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC31424: 2A211000 slti $at, $s1, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (4096) ? 1 : 0); + PGXP_ALU(0x2A211000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80049424u); #endif @@ -631210,7 +632747,8 @@ label_BFC31530: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC31534: 2A011000 slti $at, $s0, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (4096) ? 1 : 0); + PGXP_ALU(0x2A011000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80049534u); #endif @@ -631768,7 +633306,8 @@ label_BFC315FC: psx_cyc_step(cpu, 0x20002u); #endif /* 0xBFC31608: 2A211000 slti $at, $s1, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[17] < (4096) ? 1 : 0); + PGXP_ALU(0x2A211000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80049608u); #endif @@ -633319,7 +634858,8 @@ label_BFC3182C: psx_cyc_step(cpu, 0x500u); #endif /* 0xBFC31854: 310A003F andi $t2, $t0, 0x3F */ - cpu->gpr[10] = cpu->gpr[8] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[10] = cpu->gpr[8] & 0x3Fu; + PGXP_ALU(0x310A003Fu, cpu->gpr[10], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80049854u); #endif @@ -633922,7 +635462,8 @@ label_BFC318E4: psx_cyc_step(cpu, 0x408u); #endif /* 0xBFC3190C: 306A003F andi $t2, $v1, 0x3F */ - cpu->gpr[10] = cpu->gpr[3] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[10] = cpu->gpr[3] & 0x3Fu; + PGXP_ALU(0x306A003Fu, cpu->gpr[10], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x8004990Cu); #endif @@ -634931,7 +636472,8 @@ label_BFC319EC: psx_cyc_step(cpu, 0x4008u); #endif /* 0xBFC31A14: 306E003F andi $t6, $v1, 0x3F */ - cpu->gpr[14] = cpu->gpr[3] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[14] = cpu->gpr[3] & 0x3Fu; + PGXP_ALU(0x306E003Fu, cpu->gpr[14], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80049A14u); #endif @@ -635863,7 +637405,8 @@ label_BFC31B38: psx_cyc_step(cpu, 0x11000u); #endif /* 0xBFC31B3C: 320C003F andi $t4, $s0, 0x3F */ - cpu->gpr[12] = cpu->gpr[16] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[12] = cpu->gpr[16] & 0x3Fu; + PGXP_ALU(0x320C003Fu, cpu->gpr[12], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80049B3Cu); #endif @@ -636767,7 +638310,8 @@ label_BFC31C50: psx_cyc_step(cpu, 0x10Cu); #endif /* 0xBFC31C60: 01031024 and $v0, $t0, $v1 */ - cpu->gpr[2] = cpu->gpr[8] & cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[8] & cpu->gpr[3]; + PGXP_ALU(0x01031024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80049C60u); #endif @@ -637023,7 +638567,8 @@ label_BFC31C88: psx_cyc_step(cpu, 0x2000080u); #endif /* 0xBFC31CAC: 30F9003F andi $t9, $a3, 0x3F */ - cpu->gpr[25] = cpu->gpr[7] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[25] = cpu->gpr[7] & 0x3Fu; + PGXP_ALU(0x30F9003Fu, cpu->gpr[25], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80049CACu); #endif @@ -637666,7 +639211,8 @@ label_BFC31D38: psx_cyc_step(cpu, 0x2000080u); #endif /* 0xBFC31D5C: 30F9003F andi $t9, $a3, 0x3F */ - cpu->gpr[25] = cpu->gpr[7] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[25] = cpu->gpr[7] & 0x3Fu; + PGXP_ALU(0x30F9003Fu, cpu->gpr[25], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80049D5Cu); #endif @@ -638309,7 +639855,8 @@ label_BFC31DE8: psx_cyc_step(cpu, 0x2000080u); #endif /* 0xBFC31E0C: 30F9003F andi $t9, $a3, 0x3F */ - cpu->gpr[25] = cpu->gpr[7] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[25] = cpu->gpr[7] & 0x3Fu; + PGXP_ALU(0x30F9003Fu, cpu->gpr[25], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80049E0Cu); #endif @@ -638952,7 +640499,8 @@ label_BFC31E98: psx_cyc_step(cpu, 0x2000080u); #endif /* 0xBFC31EBC: 30F9003F andi $t9, $a3, 0x3F */ - cpu->gpr[25] = cpu->gpr[7] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[25] = cpu->gpr[7] & 0x3Fu; + PGXP_ALU(0x30F9003Fu, cpu->gpr[25], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80049EBCu); #endif @@ -639653,7 +641201,8 @@ label_BFC32054: psx_cyc_step(cpu, 0xC001u); #endif /* 0xBFC3205C: 01C07827 nor $t7, $t6, $zero */ - cpu->gpr[15] = ~(cpu->gpr[14] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[15] = ~(cpu->gpr[14] | cpu->gpr[0]); + PGXP_ALU(0x01C07827u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A05Cu); #endif @@ -640083,7 +641632,8 @@ label_BFC320D0: psx_cyc_step(cpu, 0x100C000u); #endif /* 0xBFC320DC: 01CFC024 and $t8, $t6, $t7 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + PGXP_ALU(0x01CFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A0DCu); #endif @@ -640372,7 +641922,8 @@ label_BFC3211C: psx_cyc_step(cpu, 0x4022u); #endif /* 0xBFC32124: 00AE082A slt $at, $a1, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x00AE082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A124u); #endif @@ -640433,7 +641984,8 @@ label_BFC32130: psx_cyc_step(cpu, 0x8042u); #endif /* 0xBFC32138: 00CF082A slt $at, $a2, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x00CF082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A138u); #endif @@ -640796,7 +642348,8 @@ label_BFC3214C: psx_cyc_step(cpu, 0x2008400u); #endif /* 0xBFC321BC: 032A7824 and $t7, $t9, $t2 */ - cpu->gpr[15] = cpu->gpr[25] & cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[15] = cpu->gpr[25] & cpu->gpr[10]; + PGXP_ALU(0x032A7824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A1BCu); #endif @@ -641193,7 +642746,8 @@ label_BFC32210: psx_cyc_step(cpu, 0x4022u); #endif /* 0xBFC32218: 00AE082A slt $at, $a1, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x00AE082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A218u); #endif @@ -641257,7 +642811,8 @@ label_BFC32224: psx_cyc_step(cpu, 0x8042u); #endif /* 0xBFC3222C: 00CF082A slt $at, $a2, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x00CF082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A22Cu); #endif @@ -641542,7 +643097,8 @@ label_BFC32238: psx_cyc_step(cpu, 0x1000201u); #endif /* 0xBFC32294: 0120C027 nor $t8, $t1, $zero */ - cpu->gpr[24] = ~(cpu->gpr[9] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[24] = ~(cpu->gpr[9] | cpu->gpr[0]); + PGXP_ALU(0x0120C027u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A294u); #endif @@ -641597,7 +643153,8 @@ label_BFC32238: psx_cyc_step(cpu, 0x1006000u); #endif /* 0xBFC322AC: 01B87024 and $t6, $t5, $t8 */ - cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[24]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[24]; + PGXP_ALU(0x01B87024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A2ACu); #endif @@ -643698,7 +645255,8 @@ label_BFC324F8: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC32508: 0202082A slt $at, $s0, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0202082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A508u); #endif @@ -643802,7 +645360,8 @@ label_BFC3251C: psx_cyc_step(cpu, 0x8000Au); #endif /* 0xBFC32528: 0263082A slt $at, $s3, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0263082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A528u); #endif @@ -644122,7 +645681,8 @@ label_BFC3255C: psx_cyc_step(cpu, 0x10Au); #endif /* 0xBFC32580: 0068082A slt $at, $v1, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0068082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A580u); #endif @@ -644203,7 +645763,8 @@ label_BFC3258C: psx_cyc_step(cpu, 0x8006u); #endif /* 0xBFC3259C: 01E2082A slt $at, $t7, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01E2082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A59Cu); #endif @@ -644313,7 +645874,8 @@ label_BFC325B0: psx_cyc_step(cpu, 0xA2u); #endif /* 0xBFC325BC: 00E5082A slt $at, $a3, $a1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x00E5082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A5BCu); #endif @@ -644396,7 +645958,8 @@ label_BFC325C8: psx_cyc_step(cpu, 0x2000012u); #endif /* 0xBFC325D8: 0324082A slt $at, $t9, $a0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0324082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A5D8u); #endif @@ -644512,7 +646075,8 @@ label_BFC325EC: psx_cyc_step(cpu, 0xA02u); #endif /* 0xBFC325F8: 0169082A slt $at, $t3, $t1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0169082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A5F8u); #endif @@ -644628,7 +646192,8 @@ label_BFC3260C: psx_cyc_step(cpu, 0x2102u); #endif /* 0xBFC32618: 01A8082A slt $at, $t5, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x01A8082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A618u); #endif @@ -644748,7 +646313,8 @@ label_BFC3262C: psx_cyc_step(cpu, 0x40012u); #endif /* 0xBFC32638: 0244082A slt $at, $s2, $a0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0244082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A638u); #endif @@ -644838,7 +646404,8 @@ label_BFC3264C: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC32650: 0202082A slt $at, $s0, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0202082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A650u); #endif @@ -645197,7 +646764,8 @@ label_BFC3269C: psx_cyc_step(cpu, 0x10006u); #endif /* 0xBFC326B4: 0202082A slt $at, $s0, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0202082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A6B4u); #endif @@ -645311,7 +646879,8 @@ label_BFC326D0: psx_cyc_step(cpu, 0x40012u); #endif /* 0xBFC326DC: 0244082A slt $at, $s2, $a0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0244082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A6DCu); #endif @@ -646711,7 +648280,8 @@ label_BFC32874: psx_cyc_step(cpu, 0x11002u); #endif /* 0xBFC328B0: 020C082A slt $at, $s0, $t4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[12] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[12] ? 1 : 0); + PGXP_ALU(0x020C082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004A8B0u); #endif @@ -648069,7 +649639,8 @@ label_BFC32A5C: psx_cyc_step(cpu, 0x180002u); #endif /* 0xBFC32A60: 0274082B sltu $at, $s3, $s4 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < cpu->gpr[20] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < cpu->gpr[20] ? 1 : 0); + PGXP_ALU(0x0274082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004AA60u); #endif @@ -649460,7 +651031,8 @@ label_BFC32C50: psx_cyc_step(cpu, 0x6002u); #endif /* 0xBFC32C70: 01AE082B sltu $at, $t5, $t6 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x01AE082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004AC70u); #endif @@ -654860,7 +656432,8 @@ label_BFC331A0: psx_cyc_step(cpu, 0x200082u); #endif /* 0xBFC331D0: 02A7082A slt $at, $s5, $a3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[21] < (int32_t)cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[21]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[21] < (int32_t)cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x02A7082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B1D0u); #endif @@ -655011,7 +656584,8 @@ label_BFC331F4: psx_cyc_step(cpu, 0x40000Au); #endif /* 0xBFC331FC: 02C3082A slt $at, $s6, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[22]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[22] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x02C3082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B1FCu); #endif @@ -655340,7 +656914,8 @@ label_BFC33244: psx_cyc_step(cpu, 0xC0002u); #endif /* 0xBFC33244: 0253082A slt $at, $s2, $s3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0253082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B244u); #endif @@ -655547,7 +657122,8 @@ label_BFC3327C: psx_cyc_step(cpu, 0x90002u); #endif /* 0xBFC33280: 0270082A slt $at, $s3, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0270082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B280u); #endif @@ -655673,7 +657249,8 @@ label_BFC3329C: psx_cyc_step(cpu, 0xA0002u); #endif /* 0xBFC332A8: 0271082A slt $at, $s3, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0271082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B2A8u); #endif @@ -655936,7 +657513,8 @@ label_BFC332EC: psx_cyc_step(cpu, 0x50002u); #endif /* 0xBFC332F0: 0250082A slt $at, $s2, $s0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[16] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[16] ? 1 : 0); + PGXP_ALU(0x0250082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B2F0u); #endif @@ -656062,7 +657640,8 @@ label_BFC3330C: psx_cyc_step(cpu, 0x60002u); #endif /* 0xBFC33318: 0251082A slt $at, $s2, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0251082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B318u); #endif @@ -656374,7 +657953,8 @@ label_BFC33358: psx_cyc_step(cpu, 0x18002u); #endif /* 0xBFC33388: 020F082A slt $at, $s0, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x020F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B388u); #endif @@ -656585,7 +658165,8 @@ label_BFC333BC: psx_cyc_step(cpu, 0x10202u); #endif /* 0xBFC333D4: 0209082A slt $at, $s0, $t1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0209082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B3D4u); #endif @@ -656844,7 +658425,8 @@ label_BFC33400: psx_cyc_step(cpu, 0x8002u); #endif /* 0xBFC3342C: 29E10002 slti $at, $t7, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (2) ? 1 : 0); + PGXP_ALU(0x29E10002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8004B42Cu); #endif @@ -656979,7 +658561,8 @@ label_BFC33438: psx_cyc_step(cpu, 0x40000002u); #endif /* 0xBFC3345C: 2BC10002 slti $at, $fp, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[30] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[30]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[30] < (2) ? 1 : 0); + PGXP_ALU(0x2BC10002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8004B45Cu); #endif @@ -657233,7 +658816,8 @@ label_BFC3349C: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC334A0: 2A810002 slti $at, $s4, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[20] < (2) ? 1 : 0); + PGXP_ALU(0x2A810002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8004B4A0u); #endif @@ -657499,7 +659083,8 @@ label_BFC334E0: psx_cyc_step(cpu, 0x40080002u); #endif /* 0xBFC334E4: 027E082A slt $at, $s3, $fp */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[30] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[30]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[19] < (int32_t)cpu->gpr[30] ? 1 : 0); + PGXP_ALU(0x027E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B4E4u); #endif @@ -657561,7 +659146,8 @@ label_BFC334F0: psx_cyc_step(cpu, 0x1800002u); #endif /* 0xBFC334F8: 02F8082A slt $at, $s7, $t8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[23] < (int32_t)cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[23]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[23] < (int32_t)cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x02F8082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004B4F8u); #endif @@ -657579,7 +659165,8 @@ label_BFC334F0: psx_cyc_step(cpu, 0x40000002u); #endif /* 0xBFC33500: 2BC10002 slti $at, $fp, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[30] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[30]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[30] < (2) ? 1 : 0); + PGXP_ALU(0x2BC10002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8004B500u); #endif @@ -660326,7 +661913,8 @@ label_BFC33800: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC3380C: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B80Cu); #endif @@ -660337,7 +661925,8 @@ label_BFC33800: psx_cyc_step(cpu, 0x400u); #endif /* 0xBFC33810: 314AFFFF andi $t2, $t2, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B810u); #endif @@ -660440,7 +662029,8 @@ label_BFC33800: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC33838: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B838u); #endif @@ -660448,7 +662038,8 @@ label_BFC33800: psx_cyc_step(cpu, 0x400u); #endif /* 0xBFC3383C: 314AFFFF andi $t2, $t2, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B83Cu); #endif @@ -660585,7 +662176,8 @@ label_BFC33800: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC33868: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B868u); #endif @@ -660718,7 +662310,8 @@ label_BFC3388C: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC33898: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B898u); #endif @@ -660726,7 +662319,8 @@ label_BFC3388C: psx_cyc_step(cpu, 0x400u); #endif /* 0xBFC3389C: 314AFFFF andi $t2, $t2, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B89Cu); #endif @@ -660832,7 +662426,8 @@ label_BFC3388C: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC338C4: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B8C4u); #endif @@ -660840,7 +662435,8 @@ label_BFC3388C: psx_cyc_step(cpu, 0x400u); #endif /* 0xBFC338C8: 314AFFFF andi $t2, $t2, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B8C8u); #endif @@ -660977,7 +662573,8 @@ label_BFC3388C: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC338F4: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004B8F4u); #endif @@ -662885,7 +664482,8 @@ label_BFC33B9C: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC33B9C: 30480001 andi $t0, $v0, 0x1 */ - cpu->gpr[8] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30480001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004BB9Cu); #endif @@ -662905,7 +664503,8 @@ label_BFC33B9C: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC33BA4: 004A5024 and $t2, $v0, $t2 */ - cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[10]; + PGXP_ALU(0x004A5024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004BBA4u); #endif @@ -663344,7 +664943,8 @@ label_BFC33C20: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC33C20: 30480001 andi $t0, $v0, 0x1 */ - cpu->gpr[8] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30480001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004BC20u); #endif @@ -663361,7 +664961,8 @@ label_BFC33C20: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC33C28: 004A5024 and $t2, $v0, $t2 */ - cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[10]; + PGXP_ALU(0x004A5024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004BC28u); #endif @@ -663922,7 +665523,8 @@ label_BFC33CBC: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC33CBC: 30480001 andi $t0, $v0, 0x1 */ - cpu->gpr[8] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30480001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x8004BCBCu); #endif @@ -663978,7 +665580,8 @@ label_BFC33CC0: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC33CC4: 004A5024 and $t2, $v0, $t2 */ - cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[10]; + PGXP_ALU(0x004A5024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004BCC4u); #endif @@ -664386,7 +665989,8 @@ label_BFC33D30: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC33D3C: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004BD3Cu); #endif @@ -664487,7 +666091,8 @@ label_BFC33D30: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC33D64: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004BD64u); #endif @@ -664957,7 +666562,8 @@ label_BFC33DA4: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC33E04: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004BE04u); #endif @@ -667441,7 +669047,8 @@ label_BFC3409C: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC340A4: 3109001F andi $t1, $t0, 0x1F */ - cpu->gpr[9] = cpu->gpr[8] & 0x1Fu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x1Fu; + PGXP_ALU(0x3109001Fu, cpu->gpr[9], _pgx1, 0x001Fu); } #ifdef PSX_COSIM cosim_instr(0x8004C0A4u); #endif @@ -667458,7 +669065,8 @@ label_BFC3409C: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC340AC: 310903E0 andi $t1, $t0, 0x3E0 */ - cpu->gpr[9] = cpu->gpr[8] & 0x3E0u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x3E0u; + PGXP_ALU(0x310903E0u, cpu->gpr[9], _pgx1, 0x03E0u); } #ifdef PSX_COSIM cosim_instr(0x8004C0ACu); #endif @@ -667487,7 +669095,8 @@ label_BFC3409C: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC340B8: 31097C00 andi $t1, $t0, 0x7C00 */ - cpu->gpr[9] = cpu->gpr[8] & 0x7C00u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x7C00u; + PGXP_ALU(0x31097C00u, cpu->gpr[9], _pgx1, 0x7C00u); } #ifdef PSX_COSIM cosim_instr(0x8004C0B8u); #endif @@ -668017,7 +669626,8 @@ label_BFC34148: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3414C: 28410003 slti $at, $v0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3) ? 1 : 0); + PGXP_ALU(0x28410003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x8004C14Cu); #endif @@ -673303,7 +674913,8 @@ label_BFC348A8: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC348B0: 30630FFF andi $v1, $v1, 0xFFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFFu; + PGXP_ALU(0x30630FFFu, cpu->gpr[3], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004C8B0u); #endif @@ -673474,7 +675085,8 @@ label_BFC348D0: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC348D4: 30630FFF andi $v1, $v1, 0xFFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFFu; + PGXP_ALU(0x30630FFFu, cpu->gpr[3], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004C8D4u); #endif @@ -673679,7 +675291,8 @@ label_BFC348FC: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34900: 28810400 slti $at, $a0, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + PGXP_ALU(0x28810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004C900u); #endif @@ -673718,7 +675331,8 @@ label_BFC34904: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34908: 28810400 slti $at, $a0, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + PGXP_ALU(0x28810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004C908u); #endif @@ -673828,7 +675442,8 @@ label_BFC34924: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34924: 28810400 slti $at, $a0, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + PGXP_ALU(0x28810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004C924u); #endif @@ -673880,7 +675495,8 @@ label_BFC34928: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC3492C: 28810800 slti $at, $a0, 2048 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + PGXP_ALU(0x28810800u, cpu->gpr[1], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0x8004C92Cu); #endif @@ -673919,7 +675535,8 @@ label_BFC34930: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34934: 28810800 slti $at, $a0, 2048 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + PGXP_ALU(0x28810800u, cpu->gpr[1], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0x8004C934u); #endif @@ -674038,7 +675655,8 @@ label_BFC34954: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34954: 28810800 slti $at, $a0, 2048 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + PGXP_ALU(0x28810800u, cpu->gpr[1], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0x8004C954u); #endif @@ -674090,7 +675708,8 @@ label_BFC34958: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC3495C: 28810C00 slti $at, $a0, 3072 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + PGXP_ALU(0x28810C00u, cpu->gpr[1], _pgx1, 0x0C00u); } #ifdef PSX_COSIM cosim_instr(0x8004C95Cu); #endif @@ -674129,7 +675748,8 @@ label_BFC34960: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34964: 28810C00 slti $at, $a0, 3072 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + PGXP_ALU(0x28810C00u, cpu->gpr[1], _pgx1, 0x0C00u); } #ifdef PSX_COSIM cosim_instr(0x8004C964u); #endif @@ -674237,7 +675857,8 @@ label_BFC34980: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34980: 28810C00 slti $at, $a0, 3072 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + PGXP_ALU(0x28810C00u, cpu->gpr[1], _pgx1, 0x0C00u); } #ifdef PSX_COSIM cosim_instr(0x8004C980u); #endif @@ -674290,7 +675911,8 @@ label_BFC34984: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34988: 28811000 slti $at, $a0, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (4096) ? 1 : 0); + PGXP_ALU(0x28811000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x8004C988u); #endif @@ -674565,7 +676187,8 @@ label_BFC349C4: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC349C8: 30840FFF andi $a0, $a0, 0xFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFu; + PGXP_ALU(0x30840FFFu, cpu->gpr[4], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004C9C8u); #endif @@ -674665,7 +676288,8 @@ label_BFC349D8: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC349DC: 28810400 slti $at, $a0, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + PGXP_ALU(0x28810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004C9DCu); #endif @@ -674704,7 +676328,8 @@ label_BFC349E0: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC349E4: 28810400 slti $at, $a0, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + PGXP_ALU(0x28810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004C9E4u); #endif @@ -674823,7 +676448,8 @@ label_BFC34A04: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34A04: 28810400 slti $at, $a0, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + PGXP_ALU(0x28810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004CA04u); #endif @@ -674875,7 +676501,8 @@ label_BFC34A08: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34A0C: 28810800 slti $at, $a0, 2048 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + PGXP_ALU(0x28810800u, cpu->gpr[1], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0x8004CA0Cu); #endif @@ -674914,7 +676541,8 @@ label_BFC34A10: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34A14: 28810800 slti $at, $a0, 2048 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + PGXP_ALU(0x28810800u, cpu->gpr[1], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0x8004CA14u); #endif @@ -675022,7 +676650,8 @@ label_BFC34A30: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34A30: 28810800 slti $at, $a0, 2048 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (2048) ? 1 : 0); + PGXP_ALU(0x28810800u, cpu->gpr[1], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0x8004CA30u); #endif @@ -675074,7 +676703,8 @@ label_BFC34A34: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34A38: 28810C00 slti $at, $a0, 3072 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + PGXP_ALU(0x28810C00u, cpu->gpr[1], _pgx1, 0x0C00u); } #ifdef PSX_COSIM cosim_instr(0x8004CA38u); #endif @@ -675116,7 +676746,8 @@ label_BFC34A3C: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34A40: 28810C00 slti $at, $a0, 3072 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + PGXP_ALU(0x28810C00u, cpu->gpr[1], _pgx1, 0x0C00u); } #ifdef PSX_COSIM cosim_instr(0x8004CA40u); #endif @@ -675233,7 +676864,8 @@ label_BFC34A60: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34A60: 28810C00 slti $at, $a0, 3072 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3072) ? 1 : 0); + PGXP_ALU(0x28810C00u, cpu->gpr[1], _pgx1, 0x0C00u); } #ifdef PSX_COSIM cosim_instr(0x8004CA60u); #endif @@ -675286,7 +676918,8 @@ label_BFC34A64: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC34A68: 28811000 slti $at, $a0, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (4096) ? 1 : 0); + PGXP_ALU(0x28811000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x8004CA68u); #endif @@ -677449,7 +679082,8 @@ label_BFC34CF4: psx_cyc_step(cpu, 0x222u); #endif /* 0xBFC34CF8: 0125082B sltu $at, $t1, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0125082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004CCF8u); #endif @@ -677627,7 +679261,8 @@ label_BFC34D2C: psx_cyc_step(cpu, 0x1000022u); #endif /* 0xBFC34D34: 00B8082A slt $at, $a1, $t8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x00B8082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004CD34u); #endif @@ -677787,7 +679422,8 @@ label_BFC34D60: psx_cyc_step(cpu, 0x602u); #endif /* 0xBFC34D64: 012A082B sltu $at, $t1, $t2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)(cpu->gpr[9] < cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x012A082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004CD64u); #endif @@ -677844,7 +679480,8 @@ label_BFC34D70: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC34D74: 2C410009 sltiu $at, $v0, 9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000009u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000009u ? 1 : 0); + PGXP_ALU(0x2C410009u, cpu->gpr[1], _pgx1, 0x0009u); } #ifdef PSX_COSIM cosim_instr(0x8004CD74u); #endif @@ -679347,7 +680984,8 @@ label_BFC34F70: psx_cyc_step(cpu, 0x122u); #endif /* 0xBFC34F74: 00A8082B sltu $at, $a1, $t0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x00A8082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004CF74u); #endif @@ -679362,7 +681000,8 @@ label_BFC34F70: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC34F7C: 28410014 slti $at, $v0, 20 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (20) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (20) ? 1 : 0); + PGXP_ALU(0x28410014u, cpu->gpr[1], _pgx1, 0x0014u); } #ifdef PSX_COSIM cosim_instr(0x8004CF7Cu); #endif @@ -679699,7 +681338,8 @@ label_BFC34FA0: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC34FE4: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004CFE4u); #endif @@ -679933,7 +681573,8 @@ label_BFC34FA0: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC35040: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D040u); #endif @@ -680050,7 +681691,8 @@ label_BFC34FA0: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC35068: 316BFFFF andi $t3, $t3, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D068u); #endif @@ -680088,7 +681730,8 @@ label_BFC34FA0: psx_cyc_step(cpu, 0x2000u); #endif /* 0xBFC35078: 31ADFFFF andi $t5, $t5, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31ADFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D078u); #endif @@ -680312,7 +681955,8 @@ label_BFC34FA0: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC350CC: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D0CCu); #endif @@ -680341,7 +681985,8 @@ label_BFC34FA0: psx_cyc_step(cpu, 0x8000u); #endif /* 0xBFC350D8: 31EFFFFF andi $t7, $t7, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31EFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D0D8u); #endif @@ -680729,7 +682374,8 @@ label_BFC35128: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC3516C: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D16Cu); #endif @@ -680963,7 +682609,8 @@ label_BFC35128: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC351C8: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D1C8u); #endif @@ -681083,7 +682730,8 @@ label_BFC35128: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC351F0: 316BFFFF andi $t3, $t3, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D1F0u); #endif @@ -681121,7 +682769,8 @@ label_BFC35128: psx_cyc_step(cpu, 0x2000u); #endif /* 0xBFC35200: 31ADFFFF andi $t5, $t5, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31ADFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D200u); #endif @@ -681198,7 +682847,8 @@ label_BFC35128: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC3521C: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D21Cu); #endif @@ -681236,7 +682886,8 @@ label_BFC35128: psx_cyc_step(cpu, 0x8000u); #endif /* 0xBFC3522C: 31EFFFFF andi $t7, $t7, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31EFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D22Cu); #endif @@ -681407,7 +683058,8 @@ label_BFC3524C: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC35268: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D268u); #endif @@ -681641,7 +683293,8 @@ label_BFC3524C: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC352C4: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D2C4u); #endif @@ -681758,7 +683411,8 @@ label_BFC3524C: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC352EC: 316BFFFF andi $t3, $t3, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D2ECu); #endif @@ -681796,7 +683450,8 @@ label_BFC3524C: psx_cyc_step(cpu, 0x2000u); #endif /* 0xBFC352FC: 31ADFFFF andi $t5, $t5, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31ADFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D2FCu); #endif @@ -681876,7 +683531,8 @@ label_BFC3524C: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC35318: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D318u); #endif @@ -681914,7 +683570,8 @@ label_BFC3524C: psx_cyc_step(cpu, 0x8000u); #endif /* 0xBFC35328: 31EFFFFF andi $t7, $t7, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31EFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D328u); #endif @@ -682196,7 +683853,8 @@ label_BFC35348: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC35390: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D390u); #endif @@ -682427,7 +684085,8 @@ label_BFC35348: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC353EC: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D3ECu); #endif @@ -682547,7 +684206,8 @@ label_BFC35348: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC35414: 316BFFFF andi $t3, $t3, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D414u); #endif @@ -682585,7 +684245,8 @@ label_BFC35348: psx_cyc_step(cpu, 0x2000u); #endif /* 0xBFC35424: 31ADFFFF andi $t5, $t5, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31ADFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D424u); #endif @@ -682665,7 +684326,8 @@ label_BFC35348: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC35440: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D440u); #endif @@ -682703,7 +684365,8 @@ label_BFC35348: psx_cyc_step(cpu, 0x8000u); #endif /* 0xBFC35450: 31EFFFFF andi $t7, $t7, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31EFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D450u); #endif @@ -682979,7 +684642,8 @@ label_BFC35470: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC354B8: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D4B8u); #endif @@ -683213,7 +684877,8 @@ label_BFC35470: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC35514: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D514u); #endif @@ -683330,7 +684995,8 @@ label_BFC35470: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC3553C: 316BFFFF andi $t3, $t3, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D53Cu); #endif @@ -683368,7 +685034,8 @@ label_BFC35470: psx_cyc_step(cpu, 0x2000u); #endif /* 0xBFC3554C: 31ADFFFF andi $t5, $t5, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31ADFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D54Cu); #endif @@ -683448,7 +685115,8 @@ label_BFC35470: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC35568: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D568u); #endif @@ -683486,7 +685154,8 @@ label_BFC35470: psx_cyc_step(cpu, 0x8000u); #endif /* 0xBFC35578: 31EFFFFF andi $t7, $t7, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31EFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D578u); #endif @@ -683648,7 +685317,8 @@ label_BFC35598: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC355B0: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D5B0u); #endif @@ -683665,7 +685335,8 @@ label_BFC35598: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC355B8: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D5B8u); #endif @@ -683899,7 +685570,8 @@ label_BFC35598: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC35614: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D614u); #endif @@ -684016,7 +685688,8 @@ label_BFC35598: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC3563C: 316BFFFF andi $t3, $t3, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D63Cu); #endif @@ -684054,7 +685727,8 @@ label_BFC35598: psx_cyc_step(cpu, 0x2000u); #endif /* 0xBFC3564C: 31ADFFFF andi $t5, $t5, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31ADFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D64Cu); #endif @@ -684134,7 +685808,8 @@ label_BFC35598: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC35668: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D668u); #endif @@ -684172,7 +685847,8 @@ label_BFC35598: psx_cyc_step(cpu, 0x8000u); #endif /* 0xBFC35678: 31EFFFFF andi $t7, $t7, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31EFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D678u); #endif @@ -684454,7 +686130,8 @@ label_BFC35698: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC356E0: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D6E0u); #endif @@ -684685,7 +686362,8 @@ label_BFC35698: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC3573C: 01214824 and $t1, $t1, $at */ - cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[9] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01214824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004D73Cu); #endif @@ -684805,7 +686483,8 @@ label_BFC35698: psx_cyc_step(cpu, 0x800u); #endif /* 0xBFC35764: 316BFFFF andi $t3, $t3, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[11] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D764u); #endif @@ -684834,7 +686513,8 @@ label_BFC35698: psx_cyc_step(cpu, 0x2000u); #endif /* 0xBFC35770: 31ADFFFF andi $t5, $t5, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[13] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31ADFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D770u); #endif @@ -684915,7 +686595,8 @@ label_BFC35698: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC3578C: 3108FFFF andi $t0, $t0, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3108FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D78Cu); #endif @@ -684944,7 +686625,8 @@ label_BFC35698: psx_cyc_step(cpu, 0x8000u); #endif /* 0xBFC35798: 31EFFFFF andi $t7, $t7, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[15] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31EFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D798u); #endif @@ -685694,7 +687376,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC35898: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D898u); #endif @@ -685798,7 +687481,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC358C4: 3129FFFF andi $t1, $t1, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x3129FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D8C4u); #endif @@ -685872,7 +687556,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC358E0: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D8E0u); #endif @@ -685952,7 +687637,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC35900: 3129FFFF andi $t1, $t1, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x3129FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D900u); #endif @@ -686023,7 +687709,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3591C: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D91Cu); #endif @@ -686103,7 +687790,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC3593C: 3129FFFF andi $t1, $t1, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x3129FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D93Cu); #endif @@ -686177,7 +687865,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC35958: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D958u); #endif @@ -686257,7 +687946,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC35978: 3129FFFF andi $t1, $t1, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x3129FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D978u); #endif @@ -686331,7 +688021,8 @@ label_BFC35890: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC35994: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D994u); #endif @@ -686449,7 +688140,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC359BC: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D9BCu); #endif @@ -686553,7 +688245,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC359E8: 3129FFFF andi $t1, $t1, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x3129FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004D9E8u); #endif @@ -686627,7 +688320,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC35A04: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004DA04u); #endif @@ -686707,7 +688401,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC35A24: 3129FFFF andi $t1, $t1, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x3129FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004DA24u); #endif @@ -686781,7 +688476,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC35A40: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004DA40u); #endif @@ -686861,7 +688557,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC35A60: 3129FFFF andi $t1, $t1, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x3129FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004DA60u); #endif @@ -686932,7 +688629,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC35A7C: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004DA7Cu); #endif @@ -687012,7 +688710,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x200u); #endif /* 0xBFC35A9C: 3129FFFF andi $t1, $t1, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[9] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x3129FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004DA9Cu); #endif @@ -687086,7 +688785,8 @@ label_BFC359B4: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC35AB8: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004DAB8u); #endif @@ -687747,7 +689447,8 @@ label_BFC35B88: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC35B94: 29C10280 slti $at, $t6, 640 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (640) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (640) ? 1 : 0); + PGXP_ALU(0x29C10280u, cpu->gpr[1], _pgx1, 0x0280u); } #ifdef PSX_COSIM cosim_instr(0x8004DB94u); #endif @@ -701700,7 +703401,8 @@ label_BFC36CF0: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC36D08: 00612024 and $a0, $v1, $at */ - cpu->gpr[4] = cpu->gpr[3] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[4] = cpu->gpr[3] & cpu->gpr[1]; + PGXP_ALU(0x00612024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004ED08u); #endif @@ -701821,7 +703523,8 @@ label_BFC36D1C: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC36D2C: 30630003 andi $v1, $v1, 0x3 */ - cpu->gpr[3] = cpu->gpr[3] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0x3u; + PGXP_ALU(0x30630003u, cpu->gpr[3], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x8004ED2Cu); #endif @@ -702871,7 +704574,8 @@ label_BFC36E54: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC36E5C: 33280008 andi $t0, $t9, 0x8 */ - cpu->gpr[8] = cpu->gpr[25] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x8u; + PGXP_ALU(0x33280008u, cpu->gpr[8], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x8004EE5Cu); #endif @@ -704736,7 +706440,8 @@ label_BFC370A0: psx_cyc_step(cpu, 0x140u); #endif /* 0xBFC370B4: 30C800FF andi $t0, $a2, 0xFF */ - cpu->gpr[8] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[8] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30C800FFu, cpu->gpr[8], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004F0B4u); #endif @@ -704744,7 +706449,8 @@ label_BFC370A0: psx_cyc_step(cpu, 0x88u); #endif /* 0xBFC370B8: 30E300FF andi $v1, $a3, 0xFF */ - cpu->gpr[3] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[3] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30E300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004F0B8u); #endif @@ -704761,7 +706467,8 @@ label_BFC370A0: psx_cyc_step(cpu, 0x220u); #endif /* 0xBFC370C0: 30A900FF andi $t1, $a1, 0xFF */ - cpu->gpr[9] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[9] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004F0C0u); #endif @@ -705390,7 +707097,8 @@ label_BFC3716C: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC3719C: 312AFFFF andi $t2, $t1, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x312AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004F19Cu); #endif @@ -706013,7 +707721,8 @@ label_BFC373AC: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC373C4: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004F3C4u); #endif @@ -706554,7 +708263,8 @@ label_BFC37458: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC37460: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004F460u); #endif @@ -707290,7 +709000,8 @@ label_BFC37518: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC37524: 304B0FFF andi $t3, $v0, 0xFFF */ - cpu->gpr[11] = cpu->gpr[2] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0xFFFu; + PGXP_ALU(0x304B0FFFu, cpu->gpr[11], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004F524u); #endif @@ -707298,7 +709009,8 @@ label_BFC37518: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC37528: 31F80FFF andi $t8, $t7, 0xFFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFFu; + PGXP_ALU(0x31F80FFFu, cpu->gpr[24], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004F528u); #endif @@ -707373,7 +709085,8 @@ label_BFC37538: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC37540: 318D01FF andi $t5, $t4, 0x1FF */ - cpu->gpr[13] = cpu->gpr[12] & 0x1FFu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x1FFu; + PGXP_ALU(0x318D01FFu, cpu->gpr[13], _pgx1, 0x01FFu); } #ifdef PSX_COSIM cosim_instr(0x8004F540u); #endif @@ -707390,7 +709103,8 @@ label_BFC37538: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC37548: 31F803FF andi $t8, $t7, 0x3FF */ - cpu->gpr[24] = cpu->gpr[15] & 0x3FFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x3FFu; + PGXP_ALU(0x31F803FFu, cpu->gpr[24], _pgx1, 0x03FFu); } #ifdef PSX_COSIM cosim_instr(0x8004F548u); #endif @@ -707821,7 +709535,8 @@ label_BFC375D0: psx_cyc_step(cpu, 0x82u); #endif /* 0xBFC375D0: 28E101F4 slti $at, $a3, 500 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (500) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (500) ? 1 : 0); + PGXP_ALU(0x28E101F4u, cpu->gpr[1], _pgx1, 0x01F4u); } #ifdef PSX_COSIM cosim_instr(0x8004F5D0u); #endif @@ -707912,7 +709627,8 @@ label_BFC375E4: psx_cyc_step(cpu, 0x82u); #endif /* 0xBFC375E4: 28E10CDB slti $at, $a3, 3291 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (3291) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (3291) ? 1 : 0); + PGXP_ALU(0x28E10CDBu, cpu->gpr[1], _pgx1, 0x0CDBu); } #ifdef PSX_COSIM cosim_instr(0x8004F5E4u); #endif @@ -708047,7 +709763,8 @@ label_BFC37600: psx_cyc_step(cpu, 0x206u); #endif /* 0xBFC37604: 0122082A slt $at, $t1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0122082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004F604u); #endif @@ -708062,7 +709779,8 @@ label_BFC37600: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC3760C: 29210CDB slti $at, $t1, 3291 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (3291) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (3291) ? 1 : 0); + PGXP_ALU(0x29210CDBu, cpu->gpr[1], _pgx1, 0x0CDBu); } #ifdef PSX_COSIM cosim_instr(0x8004F60Cu); #endif @@ -708134,7 +709852,8 @@ label_BFC37618: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC37618: 29210CDB slti $at, $t1, 3291 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (3291) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (3291) ? 1 : 0); + PGXP_ALU(0x29210CDBu, cpu->gpr[1], _pgx1, 0x0CDBu); } #ifdef PSX_COSIM cosim_instr(0x8004F618u); #endif @@ -708280,7 +709999,8 @@ label_BFC37634: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC37638: 28C10138 slti $at, $a2, 312 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (312) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (312) ? 1 : 0); + PGXP_ALU(0x28C10138u, cpu->gpr[1], _pgx1, 0x0138u); } #ifdef PSX_COSIM cosim_instr(0x8004F638u); #endif @@ -708355,7 +710075,8 @@ label_BFC37644: psx_cyc_step(cpu, 0x42u); #endif /* 0xBFC37644: 28C10138 slti $at, $a2, 312 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (312) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (312) ? 1 : 0); + PGXP_ALU(0x28C10138u, cpu->gpr[1], _pgx1, 0x0138u); } #ifdef PSX_COSIM cosim_instr(0x8004F644u); #endif @@ -708491,7 +710212,8 @@ label_BFC37660: psx_cyc_step(cpu, 0x142u); #endif /* 0xBFC37660: 0106082A slt $at, $t0, $a2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0106082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004F660u); #endif @@ -708506,7 +710228,8 @@ label_BFC37660: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC37668: 29010138 slti $at, $t0, 312 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (312) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (312) ? 1 : 0); + PGXP_ALU(0x29010138u, cpu->gpr[1], _pgx1, 0x0138u); } #ifdef PSX_COSIM cosim_instr(0x8004F668u); #endif @@ -708581,7 +710304,8 @@ label_BFC37674: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC37674: 29010138 slti $at, $t0, 312 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (312) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (312) ? 1 : 0); + PGXP_ALU(0x29010138u, cpu->gpr[1], _pgx1, 0x0138u); } #ifdef PSX_COSIM cosim_instr(0x8004F674u); #endif @@ -708732,7 +710456,8 @@ label_BFC37690: psx_cyc_step(cpu, 0x2200u); #endif /* 0xBFC37698: 312D0FFF andi $t5, $t1, 0xFFF */ - cpu->gpr[13] = cpu->gpr[9] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[13] = cpu->gpr[9] & 0xFFFu; + PGXP_ALU(0x312D0FFFu, cpu->gpr[13], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004F698u); #endif @@ -708815,7 +710540,8 @@ label_BFC37690: psx_cyc_step(cpu, 0x1000080u); #endif /* 0xBFC376BC: 30F80FFF andi $t8, $a3, 0xFFF */ - cpu->gpr[24] = cpu->gpr[7] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[24] = cpu->gpr[7] & 0xFFFu; + PGXP_ALU(0x30F80FFFu, cpu->gpr[24], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004F6BCu); #endif @@ -708891,7 +710617,8 @@ label_BFC376C8: psx_cyc_step(cpu, 0x1100u); #endif /* 0xBFC376D8: 310C03FF andi $t4, $t0, 0x3FF */ - cpu->gpr[12] = cpu->gpr[8] & 0x3FFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[12] = cpu->gpr[8] & 0x3FFu; + PGXP_ALU(0x310C03FFu, cpu->gpr[12], _pgx1, 0x03FFu); } #ifdef PSX_COSIM cosim_instr(0x8004F6D8u); #endif @@ -708950,7 +710677,8 @@ label_BFC376C8: psx_cyc_step(cpu, 0x4040u); #endif /* 0xBFC376F4: 30CE03FF andi $t6, $a2, 0x3FF */ - cpu->gpr[14] = cpu->gpr[6] & 0x3FFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[14] = cpu->gpr[6] & 0x3FFu; + PGXP_ALU(0x30CE03FFu, cpu->gpr[14], _pgx1, 0x03FFu); } #ifdef PSX_COSIM cosim_instr(0x8004F6F4u); #endif @@ -709335,7 +711063,8 @@ label_BFC37760: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC37768: 28410119 slti $at, $v0, 281 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (281) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (281) ? 1 : 0); + PGXP_ALU(0x28410119u, cpu->gpr[1], _pgx1, 0x0119u); } #ifdef PSX_COSIM cosim_instr(0x8004F768u); #endif @@ -709353,7 +711082,8 @@ label_BFC37760: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC37770: 28410161 slti $at, $v0, 353 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (353) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (353) ? 1 : 0); + PGXP_ALU(0x28410161u, cpu->gpr[1], _pgx1, 0x0161u); } #ifdef PSX_COSIM cosim_instr(0x8004F770u); #endif @@ -709424,7 +711154,8 @@ label_BFC3777C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3777C: 28410161 slti $at, $v0, 353 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (353) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (353) ? 1 : 0); + PGXP_ALU(0x28410161u, cpu->gpr[1], _pgx1, 0x0161u); } #ifdef PSX_COSIM cosim_instr(0x8004F77Cu); #endif @@ -709449,7 +711180,8 @@ label_BFC37780: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC37784: 28410191 slti $at, $v0, 401 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (401) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (401) ? 1 : 0); + PGXP_ALU(0x28410191u, cpu->gpr[1], _pgx1, 0x0191u); } #ifdef PSX_COSIM cosim_instr(0x8004F784u); #endif @@ -709521,7 +711253,8 @@ label_BFC37790: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC37790: 28410191 slti $at, $v0, 401 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (401) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (401) ? 1 : 0); + PGXP_ALU(0x28410191u, cpu->gpr[1], _pgx1, 0x0191u); } #ifdef PSX_COSIM cosim_instr(0x8004F790u); #endif @@ -709546,7 +711279,8 @@ label_BFC37794: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC37798: 28410231 slti $at, $v0, 561 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (561) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (561) ? 1 : 0); + PGXP_ALU(0x28410231u, cpu->gpr[1], _pgx1, 0x0231u); } #ifdef PSX_COSIM cosim_instr(0x8004F798u); #endif @@ -709621,7 +711355,8 @@ label_BFC377A4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC377A4: 28410231 slti $at, $v0, 561 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (561) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (561) ? 1 : 0); + PGXP_ALU(0x28410231u, cpu->gpr[1], _pgx1, 0x0231u); } #ifdef PSX_COSIM cosim_instr(0x8004F7A4u); #endif @@ -709853,7 +711588,8 @@ label_BFC377D0: psx_cyc_step(cpu, 0x800Au); #endif /* 0xBFC377D8: 006F082A slt $at, $v1, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x006F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004F7D8u); #endif @@ -710443,7 +712179,8 @@ label_BFC37888: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC3788C: 0041C024 and $t8, $v0, $at */ - cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x0041C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004F88Cu); #endif @@ -710675,7 +712412,8 @@ label_BFC378B4: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC378CC: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004F8CCu); #endif @@ -710920,7 +712658,8 @@ label_BFC37908: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC37920: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004F920u); #endif @@ -711298,7 +713037,8 @@ label_BFC37998: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC379B0: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004F9B0u); #endif @@ -711555,7 +713295,8 @@ label_BFC37A4C: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC37A64: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004FA64u); #endif @@ -711632,7 +713373,8 @@ label_BFC37A4C: psx_cyc_step(cpu, 0xC0u); #endif /* 0xBFC37A84: 30E6FFFF andi $a2, $a3, 0xFFFF */ - cpu->gpr[6] = cpu->gpr[7] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[6] = cpu->gpr[7] & 0xFFFFu; + PGXP_ALU(0x30E6FFFFu, cpu->gpr[6], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004FA84u); #endif @@ -712703,7 +714445,8 @@ label_BFC37BEC: psx_cyc_step(cpu, 0x1000002u); #endif /* 0xBFC37BF0: 2B010400 slti $at, $t8, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (1024) ? 1 : 0); + PGXP_ALU(0x2B010400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004FBF0u); #endif @@ -713082,7 +714825,8 @@ label_BFC37C48: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC37C50: 0048082A slt $at, $v0, $t0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0048082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004FC50u); #endif @@ -713328,7 +715072,8 @@ label_BFC37C84: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC37C8C: 312A003F andi $t2, $t1, 0x3F */ - cpu->gpr[10] = cpu->gpr[9] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x3Fu; + PGXP_ALU(0x312A003Fu, cpu->gpr[10], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x8004FC8Cu); #endif @@ -713393,7 +715138,8 @@ label_BFC37C98: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC37CA0: 316C003F andi $t4, $t3, 0x3F */ - cpu->gpr[12] = cpu->gpr[11] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x3Fu; + PGXP_ALU(0x316C003Fu, cpu->gpr[12], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x8004FCA0u); #endif @@ -713983,7 +715729,8 @@ label_BFC37D90: psx_cyc_step(cpu, 0x28000u); #endif /* 0xBFC37D94: 322F00FF andi $t7, $s1, 0xFF */ - cpu->gpr[15] = cpu->gpr[17] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[15] = cpu->gpr[17] & 0xFFu; + PGXP_ALU(0x322F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8004FD94u); #endif @@ -714012,7 +715759,8 @@ label_BFC37D90: psx_cyc_step(cpu, 0x3000100u); #endif /* 0xBFC37DA0: 0308C826 xor $t9, $t8, $t0 */ - cpu->gpr[25] = cpu->gpr[24] ^ cpu->gpr[8]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[25] = cpu->gpr[24] ^ cpu->gpr[8]; + PGXP_ALU(0x0308C826u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004FDA0u); #endif @@ -714029,7 +715777,8 @@ label_BFC37D90: psx_cyc_step(cpu, 0x604u); #endif /* 0xBFC37DA8: 01225026 xor $t2, $t1, $v0 */ - cpu->gpr[10] = cpu->gpr[9] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[9] ^ cpu->gpr[2]; + PGXP_ALU(0x01225026u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004FDA8u); #endif @@ -714175,7 +715924,8 @@ label_BFC37DC8: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC37DD0: 30C6FFFF andi $a2, $a2, 0xFFFF */ - cpu->gpr[6] = cpu->gpr[6] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0xFFFFu; + PGXP_ALU(0x30C6FFFFu, cpu->gpr[6], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8004FDD0u); #endif @@ -714453,7 +716203,8 @@ label_BFC37E04: psx_cyc_step(cpu, 0x2000040u); #endif /* 0xBFC37E10: 30D927FF andi $t9, $a2, 0x27FF */ - cpu->gpr[25] = cpu->gpr[6] & 0x27FFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[25] = cpu->gpr[6] & 0x27FFu; + PGXP_ALU(0x30D927FFu, cpu->gpr[25], _pgx1, 0x27FFu); } #ifdef PSX_COSIM cosim_instr(0x8004FE10u); #endif @@ -714724,7 +716475,8 @@ label_BFC37E44: psx_cyc_step(cpu, 0x440u); #endif /* 0xBFC37E50: 30CA01FF andi $t2, $a2, 0x1FF */ - cpu->gpr[10] = cpu->gpr[6] & 0x1FFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[10] = cpu->gpr[6] & 0x1FFu; + PGXP_ALU(0x30CA01FFu, cpu->gpr[10], _pgx1, 0x01FFu); } #ifdef PSX_COSIM cosim_instr(0x8004FE50u); #endif @@ -714945,7 +716697,8 @@ label_BFC37E7C: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC37E7C: 28810400 slti $at, $a0, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + PGXP_ALU(0x28810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004FE7Cu); #endif @@ -715308,7 +717061,8 @@ label_BFC37ED4: psx_cyc_step(cpu, 0x2Au); #endif /* 0xBFC37ED4: 0065082A slt $at, $v1, $a1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0065082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004FED4u); #endif @@ -715549,7 +717303,8 @@ label_BFC37F08: psx_cyc_step(cpu, 0x120u); #endif /* 0xBFC37F0C: 30A803FF andi $t0, $a1, 0x3FF */ - cpu->gpr[8] = cpu->gpr[5] & 0x3FFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[8] = cpu->gpr[5] & 0x3FFu; + PGXP_ALU(0x30A803FFu, cpu->gpr[8], _pgx1, 0x03FFu); } #ifdef PSX_COSIM cosim_instr(0x8004FF0Cu); #endif @@ -715581,7 +717336,8 @@ label_BFC37F10: psx_cyc_step(cpu, 0x4020u); #endif /* 0xBFC37F10: 30AE0FFF andi $t6, $a1, 0xFFF */ - cpu->gpr[14] = cpu->gpr[5] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[14] = cpu->gpr[5] & 0xFFFu; + PGXP_ALU(0x30AE0FFFu, cpu->gpr[14], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004FF10u); #endif @@ -715619,7 +717375,8 @@ label_BFC37F10: psx_cyc_step(cpu, 0x2000010u); #endif /* 0xBFC37F20: 30990FFF andi $t9, $a0, 0xFFF */ - cpu->gpr[25] = cpu->gpr[4] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[4] & 0xFFFu; + PGXP_ALU(0x30990FFFu, cpu->gpr[25], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004FF20u); #endif @@ -715686,7 +717443,8 @@ label_BFC37F30: psx_cyc_step(cpu, 0x810u); #endif /* 0xBFC37F3C: 308B03FF andi $t3, $a0, 0x3FF */ - cpu->gpr[11] = cpu->gpr[4] & 0x3FFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[11] = cpu->gpr[4] & 0x3FFu; + PGXP_ALU(0x308B03FFu, cpu->gpr[11], _pgx1, 0x03FFu); } #ifdef PSX_COSIM cosim_instr(0x8004FF3Cu); #endif @@ -715910,7 +717668,8 @@ label_BFC37F68: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC37F68: 28810400 slti $at, $a0, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (1024) ? 1 : 0); + PGXP_ALU(0x28810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8004FF68u); #endif @@ -716267,7 +718026,8 @@ label_BFC37FC0: psx_cyc_step(cpu, 0x2Au); #endif /* 0xBFC37FC0: 0065082A slt $at, $v1, $a1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0065082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8004FFC0u); #endif @@ -716514,7 +718274,8 @@ label_BFC37FF4: psx_cyc_step(cpu, 0x120u); #endif /* 0xBFC37FF8: 30A801FF andi $t0, $a1, 0x1FF */ - cpu->gpr[8] = cpu->gpr[5] & 0x1FFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[8] = cpu->gpr[5] & 0x1FFu; + PGXP_ALU(0x30A801FFu, cpu->gpr[8], _pgx1, 0x01FFu); } #ifdef PSX_COSIM cosim_instr(0x8004FFF8u); #endif @@ -716546,7 +718307,8 @@ label_BFC37FFC: psx_cyc_step(cpu, 0x4020u); #endif /* 0xBFC37FFC: 30AE0FFF andi $t6, $a1, 0xFFF */ - cpu->gpr[14] = cpu->gpr[5] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[14] = cpu->gpr[5] & 0xFFFu; + PGXP_ALU(0x30AE0FFFu, cpu->gpr[14], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8004FFFCu); #endif @@ -716584,7 +718346,8 @@ label_BFC37FFC: psx_cyc_step(cpu, 0x2000010u); #endif /* 0xBFC3800C: 30990FFF andi $t9, $a0, 0xFFF */ - cpu->gpr[25] = cpu->gpr[4] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[4] & 0xFFFu; + PGXP_ALU(0x30990FFFu, cpu->gpr[25], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x8005000Cu); #endif @@ -716657,7 +718420,8 @@ label_BFC3801C: psx_cyc_step(cpu, 0x810u); #endif /* 0xBFC38028: 308B03FF andi $t3, $a0, 0x3FF */ - cpu->gpr[11] = cpu->gpr[4] & 0x3FFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[11] = cpu->gpr[4] & 0x3FFu; + PGXP_ALU(0x308B03FFu, cpu->gpr[11], _pgx1, 0x03FFu); } #ifdef PSX_COSIM cosim_instr(0x80050028u); #endif @@ -716817,7 +718581,8 @@ label_BFC38054: psx_cyc_step(cpu, 0x8020u); #endif /* 0xBFC38054: 30AF0FFF andi $t7, $a1, 0xFFF */ - cpu->gpr[15] = cpu->gpr[5] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[15] = cpu->gpr[5] & 0xFFFu; + PGXP_ALU(0x30AF0FFFu, cpu->gpr[15], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x80050054u); #endif @@ -716855,7 +718620,8 @@ label_BFC38054: psx_cyc_step(cpu, 0x110u); #endif /* 0xBFC38064: 30880FFF andi $t0, $a0, 0xFFF */ - cpu->gpr[8] = cpu->gpr[4] & 0xFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[8] = cpu->gpr[4] & 0xFFFu; + PGXP_ALU(0x30880FFFu, cpu->gpr[8], _pgx1, 0x0FFFu); } #ifdef PSX_COSIM cosim_instr(0x80050064u); #endif @@ -716895,7 +718661,8 @@ label_BFC38070: psx_cyc_step(cpu, 0x220u); #endif /* 0xBFC38070: 30A907FF andi $t1, $a1, 0x7FF */ - cpu->gpr[9] = cpu->gpr[5] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[9] = cpu->gpr[5] & 0x7FFu; + PGXP_ALU(0x30A907FFu, cpu->gpr[9], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80050070u); #endif @@ -716933,7 +718700,8 @@ label_BFC38070: psx_cyc_step(cpu, 0x1010u); #endif /* 0xBFC38080: 308C07FF andi $t4, $a0, 0x7FF */ - cpu->gpr[12] = cpu->gpr[4] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[12] = cpu->gpr[4] & 0x7FFu; + PGXP_ALU(0x308C07FFu, cpu->gpr[12], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80050080u); #endif @@ -717069,7 +718837,8 @@ label_BFC38098: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC380A8: 30C600FF andi $a2, $a2, 0xFF */ - cpu->gpr[6] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30C600FFu, cpu->gpr[6], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800500A8u); #endif @@ -717098,7 +718867,8 @@ label_BFC38098: psx_cyc_step(cpu, 0x81u); #endif /* 0xBFC380B4: 00E03827 nor $a3, $a3, $zero */ - cpu->gpr[7] = ~(cpu->gpr[7] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[7] = ~(cpu->gpr[7] | cpu->gpr[0]); + PGXP_ALU(0x00E03827u, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800500B4u); #endif @@ -717106,7 +718876,8 @@ label_BFC38098: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC380B8: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800500B8u); #endif @@ -717126,7 +718897,8 @@ label_BFC38098: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC380C0: 30E700FF andi $a3, $a3, 0xFF */ - cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xFFu; + PGXP_ALU(0x30E700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800500C0u); #endif @@ -717164,7 +718936,8 @@ label_BFC38098: psx_cyc_step(cpu, 0x21u); #endif /* 0xBFC380D0: 00A02827 nor $a1, $a1, $zero */ - cpu->gpr[5] = ~(cpu->gpr[5] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[5] = ~(cpu->gpr[5] | cpu->gpr[0]); + PGXP_ALU(0x00A02827u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800500D0u); #endif @@ -717202,7 +718975,8 @@ label_BFC38098: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC380E0: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800500E0u); #endif @@ -718513,7 +720287,8 @@ label_BFC38270: psx_cyc_step(cpu, 0x16000u); #endif /* 0xBFC38284: 01B07024 and $t6, $t5, $s0 */ - cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[16]; + PGXP_ALU(0x01B07024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050284u); #endif @@ -718710,7 +720485,8 @@ label_BFC382A8: psx_cyc_step(cpu, 0x3010000u); #endif /* 0xBFC382BC: 0310C824 and $t9, $t8, $s0 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[16]; + PGXP_ALU(0x0310C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800502BCu); #endif @@ -719139,7 +720915,8 @@ label_BFC3832C: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC38330: 29210400 slti $at, $t1, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (1024) ? 1 : 0); + PGXP_ALU(0x29210400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x80050330u); #endif @@ -719518,7 +721295,8 @@ label_BFC38388: psx_cyc_step(cpu, 0x806u); #endif /* 0xBFC38390: 004B082A slt $at, $v0, $t3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x004B082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050390u); #endif @@ -719764,7 +721542,8 @@ label_BFC383C4: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC383CC: 318D003F andi $t5, $t4, 0x3F */ - cpu->gpr[13] = cpu->gpr[12] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x3Fu; + PGXP_ALU(0x318D003Fu, cpu->gpr[13], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x800503CCu); #endif @@ -719832,7 +721611,8 @@ label_BFC383D8: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC383E0: 31CF003F andi $t7, $t6, 0x3F */ - cpu->gpr[15] = cpu->gpr[14] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x3Fu; + PGXP_ALU(0x31CF003Fu, cpu->gpr[15], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x800503E0u); #endif @@ -719926,7 +721706,8 @@ label_BFC383F0: psx_cyc_step(cpu, 0x3000004u); #endif /* 0xBFC383FC: 0302C824 and $t9, $t8, $v0 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[2]; + PGXP_ALU(0x0302C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800503FCu); #endif @@ -720093,7 +721874,8 @@ label_BFC383F0: psx_cyc_step(cpu, 0x2024u); #endif /* 0xBFC38440: 00A26824 and $t5, $a1, $v0 */ - cpu->gpr[13] = cpu->gpr[5] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[5] & cpu->gpr[2]; + PGXP_ALU(0x00A26824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050440u); #endif @@ -720562,7 +722344,8 @@ label_BFC384C4: psx_cyc_step(cpu, 0x2024u); #endif /* 0xBFC384E4: 00A26824 and $t5, $a1, $v0 */ - cpu->gpr[13] = cpu->gpr[5] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[5] & cpu->gpr[2]; + PGXP_ALU(0x00A26824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800504E4u); #endif @@ -721106,7 +722889,8 @@ label_BFC38578: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC3857C: 29210400 slti $at, $t1, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (1024) ? 1 : 0); + PGXP_ALU(0x29210400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x8005057Cu); #endif @@ -721485,7 +723269,8 @@ label_BFC385D4: psx_cyc_step(cpu, 0x806u); #endif /* 0xBFC385DC: 004B082A slt $at, $v0, $t3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x004B082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800505DCu); #endif @@ -721734,7 +723519,8 @@ label_BFC38610: psx_cyc_step(cpu, 0x1002u); #endif /* 0xBFC38618: 29810400 slti $at, $t4, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (1024) ? 1 : 0); + PGXP_ALU(0x29810400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x80050618u); #endif @@ -722090,7 +723876,8 @@ label_BFC38670: psx_cyc_step(cpu, 0x11800u); #endif /* 0xBFC38684: 01706024 and $t4, $t3, $s0 */ - cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[16]; + PGXP_ALU(0x01706024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050684u); #endif @@ -722249,7 +724036,8 @@ label_BFC386A0: psx_cyc_step(cpu, 0x1C000u); #endif /* 0xBFC386B4: 01D07824 and $t7, $t6, $s0 */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[16]; + PGXP_ALU(0x01D07824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800506B4u); #endif @@ -722538,7 +724326,8 @@ label_BFC386F4: psx_cyc_step(cpu, 0x50u); #endif /* 0xBFC38714: 30C4000F andi $a0, $a2, 0xF */ - cpu->gpr[4] = cpu->gpr[6] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[4] = cpu->gpr[6] & 0xFu; + PGXP_ALU(0x30C4000Fu, cpu->gpr[4], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80050714u); #endif @@ -723479,7 +725268,8 @@ label_BFC38824: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC38828: 29210400 slti $at, $t1, 1024 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (1024) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (1024) ? 1 : 0); + PGXP_ALU(0x29210400u, cpu->gpr[1], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x80050828u); #endif @@ -723855,7 +725645,8 @@ label_BFC38880: psx_cyc_step(cpu, 0x806u); #endif /* 0xBFC38888: 004B082A slt $at, $v0, $t3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x004B082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050888u); #endif @@ -724341,7 +726132,8 @@ label_BFC388F4: psx_cyc_step(cpu, 0x1C000u); #endif /* 0xBFC38908: 01D07824 and $t7, $t6, $s0 */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[16]; + PGXP_ALU(0x01D07824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050908u); #endif @@ -724594,7 +726386,8 @@ label_BFC38940: psx_cyc_step(cpu, 0x3010000u); #endif /* 0xBFC38954: 0310C824 and $t9, $t8, $s0 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[16]; + PGXP_ALU(0x0310C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050954u); #endif @@ -724787,7 +726580,8 @@ label_BFC38968: psx_cyc_step(cpu, 0x3004u); #endif /* 0xBFC389A0: 01826824 and $t5, $t4, $v0 */ - cpu->gpr[13] = cpu->gpr[12] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[12] & cpu->gpr[2]; + PGXP_ALU(0x01826824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800509A0u); #endif @@ -724851,7 +726645,8 @@ label_BFC389AC: psx_cyc_step(cpu, 0xC004u); #endif /* 0xBFC389B4: 01C27824 and $t7, $t6, $v0 */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[2]; + PGXP_ALU(0x01C27824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800509B4u); #endif @@ -724905,7 +726700,8 @@ label_BFC389C0: psx_cyc_step(cpu, 0x90u); #endif /* 0xBFC389C4: 30E4000F andi $a0, $a3, 0xF */ - cpu->gpr[4] = cpu->gpr[7] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[4] = cpu->gpr[7] & 0xFu; + PGXP_ALU(0x30E4000Fu, cpu->gpr[4], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x800509C4u); #endif @@ -725684,7 +727480,8 @@ label_BFC38AA4: psx_cyc_step(cpu, 0x8012u); #endif /* 0xBFC38AB4: 00817824 and $t7, $a0, $at */ - cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00817824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050AB4u); #endif @@ -726396,7 +728193,8 @@ label_BFC38B80: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC38BAC: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050BACu); #endif @@ -726916,7 +728714,8 @@ label_BFC38C68: psx_cyc_step(cpu, 0x10000u); #endif /* 0xBFC38C90: 3210003F andi $s0, $s0, 0x3F */ - cpu->gpr[16] = cpu->gpr[16] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[16] = cpu->gpr[16] & 0x3Fu; + PGXP_ALU(0x3210003Fu, cpu->gpr[16], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80050C90u); #endif @@ -727538,7 +729337,8 @@ label_BFC38CD8: psx_cyc_step(cpu, 0xA02u); #endif /* 0xBFC38D6C: 01215824 and $t3, $t1, $at */ - cpu->gpr[11] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[11] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01215824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050D6Cu); #endif @@ -727671,7 +729471,8 @@ label_BFC38D80: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC38D98: 3042003F andi $v0, $v0, 0x3F */ - cpu->gpr[2] = cpu->gpr[2] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x3Fu; + PGXP_ALU(0x3042003Fu, cpu->gpr[2], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80050D98u); #endif @@ -728100,7 +729901,8 @@ label_BFC38DFC: psx_cyc_step(cpu, 0x2040100u); #endif /* 0xBFC38E10: 03324024 and $t0, $t9, $s2 */ - cpu->gpr[8] = cpu->gpr[25] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[8] = cpu->gpr[25] & cpu->gpr[18]; + PGXP_ALU(0x03324024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050E10u); #endif @@ -728350,7 +730152,8 @@ label_BFC38E48: psx_cyc_step(cpu, 0x13000u); #endif /* 0xBFC38E5C: 01906824 and $t5, $t4, $s0 */ - cpu->gpr[13] = cpu->gpr[12] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[13] = cpu->gpr[12] & cpu->gpr[16]; + PGXP_ALU(0x01906824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050E5Cu); #endif @@ -728512,7 +730315,8 @@ label_BFC38E78: psx_cyc_step(cpu, 0x1018000u); #endif /* 0xBFC38E8C: 01F0C024 and $t8, $t7, $s0 */ - cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[16]; + PGXP_ALU(0x01F0C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80050E8Cu); #endif @@ -728921,7 +730725,8 @@ label_BFC38F20: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC38F30: 312A003F andi $t2, $t1, 0x3F */ - cpu->gpr[10] = cpu->gpr[9] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x3Fu; + PGXP_ALU(0x312A003Fu, cpu->gpr[10], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80050F30u); #endif @@ -729811,7 +731616,8 @@ label_BFC39034: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC39048: 31AE3FFF andi $t6, $t5, 0x3FFF */ - cpu->gpr[14] = cpu->gpr[13] & 0x3FFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x3FFFu; + PGXP_ALU(0x31AE3FFFu, cpu->gpr[14], _pgx1, 0x3FFFu); } #ifdef PSX_COSIM cosim_instr(0x80051048u); #endif @@ -729862,7 +731668,8 @@ label_BFC39034: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC39060: 33191000 andi $t9, $t8, 0x1000 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1000u; + PGXP_ALU(0x33191000u, cpu->gpr[25], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80051060u); #endif @@ -730557,7 +732364,8 @@ label_BFC390F0: psx_cyc_step(cpu, 0x2010100u); #endif /* 0xBFC39104: 03304024 and $t0, $t9, $s0 */ - cpu->gpr[8] = cpu->gpr[25] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[8] = cpu->gpr[25] & cpu->gpr[16]; + PGXP_ALU(0x03304024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051104u); #endif @@ -730924,7 +732732,8 @@ label_BFC39160: psx_cyc_step(cpu, 0x21800u); #endif /* 0xBFC39174: 01716024 and $t4, $t3, $s1 */ - cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[17]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[12] = cpu->gpr[11] & cpu->gpr[17]; + PGXP_ALU(0x01716024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051174u); #endif @@ -730985,7 +732794,8 @@ label_BFC39180: psx_cyc_step(cpu, 0x46000u); #endif /* 0xBFC39188: 01B27024 and $t6, $t5, $s2 */ - cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[18]; + PGXP_ALU(0x01B27024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051188u); #endif @@ -731118,7 +732928,8 @@ label_BFC3919C: psx_cyc_step(cpu, 0x3010000u); #endif /* 0xBFC391B0: 0310C824 and $t9, $t8, $s0 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[16]; + PGXP_ALU(0x0310C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800511B0u); #endif @@ -731234,7 +733045,8 @@ label_BFC391C8: psx_cyc_step(cpu, 0x10300u); #endif /* 0xBFC391D0: 01104824 and $t1, $t0, $s0 */ - cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[16]; + PGXP_ALU(0x01104824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800511D0u); #endif @@ -731457,7 +733269,8 @@ label_BFC39200: psx_cyc_step(cpu, 0x10C00u); #endif /* 0xBFC39214: 01505824 and $t3, $t2, $s0 */ - cpu->gpr[11] = cpu->gpr[10] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[11] = cpu->gpr[10] & cpu->gpr[16]; + PGXP_ALU(0x01505824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051214u); #endif @@ -731684,7 +733497,8 @@ label_BFC39244: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC39260: 3042003F andi $v0, $v0, 0x3F */ - cpu->gpr[2] = cpu->gpr[2] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x3Fu; + PGXP_ALU(0x3042003Fu, cpu->gpr[2], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80051260u); #endif @@ -731758,7 +733572,8 @@ label_BFC39264: psx_cyc_step(cpu, 0x3040000u); #endif /* 0xBFC39278: 0312C824 and $t9, $t8, $s2 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[18]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[18]; + PGXP_ALU(0x0312C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051278u); #endif @@ -731878,7 +733693,8 @@ label_BFC39290: psx_cyc_step(cpu, 0x10300u); #endif /* 0xBFC3929C: 01104824 and $t1, $t0, $s0 */ - cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[9] = cpu->gpr[8] & cpu->gpr[16]; + PGXP_ALU(0x01104824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005129Cu); #endif @@ -732304,7 +734120,8 @@ label_BFC39300: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC39314: 01CF082A slt $at, $t6, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x01CF082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051314u); #endif @@ -732393,7 +734210,8 @@ label_BFC39320: psx_cyc_step(cpu, 0x2000006u); #endif /* 0xBFC39334: 0041C824 and $t9, $v0, $at */ - cpu->gpr[25] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[25] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x0041C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051334u); #endif @@ -732544,7 +734362,8 @@ label_BFC3934C: psx_cyc_step(cpu, 0x602u); #endif /* 0xBFC39360: 01215024 and $t2, $t1, $at */ - cpu->gpr[10] = cpu->gpr[9] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[10] = cpu->gpr[9] & cpu->gpr[1]; + PGXP_ALU(0x01215024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051360u); #endif @@ -735002,7 +736821,8 @@ label_BFC3964C: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC39660: 308E0003 andi $t6, $a0, 0x3 */ - cpu->gpr[14] = cpu->gpr[4] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0x3u; + PGXP_ALU(0x308E0003u, cpu->gpr[14], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051660u); #endif @@ -735034,7 +736854,8 @@ label_BFC39664: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC39664: 308E0003 andi $t6, $a0, 0x3 */ - cpu->gpr[14] = cpu->gpr[4] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0x3u; + PGXP_ALU(0x308E0003u, cpu->gpr[14], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051664u); #endif @@ -735042,7 +736863,8 @@ label_BFC39664: psx_cyc_step(cpu, 0x1000020u); #endif /* 0xBFC39668: 30B80003 andi $t8, $a1, 0x3 */ - cpu->gpr[24] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[24] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30B80003u, cpu->gpr[24], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051668u); #endif @@ -735071,7 +736893,8 @@ label_BFC39664: psx_cyc_step(cpu, 0x240u); #endif /* 0xBFC39674: 30C90300 andi $t1, $a2, 0x300 */ - cpu->gpr[9] = cpu->gpr[6] & 0x300u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[9] = cpu->gpr[6] & 0x300u; + PGXP_ALU(0x30C90300u, cpu->gpr[9], _pgx1, 0x0300u); } #ifdef PSX_COSIM cosim_instr(0x80051674u); #endif @@ -735100,7 +736923,8 @@ label_BFC39664: psx_cyc_step(cpu, 0x1080u); #endif /* 0xBFC39680: 30EC03FF andi $t4, $a3, 0x3FF */ - cpu->gpr[12] = cpu->gpr[7] & 0x3FFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[12] = cpu->gpr[7] & 0x3FFu; + PGXP_ALU(0x30EC03FFu, cpu->gpr[12], _pgx1, 0x03FFu); } #ifdef PSX_COSIM cosim_instr(0x80051680u); #endif @@ -735169,7 +736993,8 @@ label_BFC39694: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC39694: 308E0003 andi $t6, $a0, 0x3 */ - cpu->gpr[14] = cpu->gpr[4] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0x3u; + PGXP_ALU(0x308E0003u, cpu->gpr[14], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051694u); #endif @@ -735187,7 +737012,8 @@ label_BFC39698: psx_cyc_step(cpu, 0x8020u); #endif /* 0xBFC39698: 30AF0003 andi $t7, $a1, 0x3 */ - cpu->gpr[15] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[15] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30AF0003u, cpu->gpr[15], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051698u); #endif @@ -735216,7 +737042,8 @@ label_BFC39698: psx_cyc_step(cpu, 0x140u); #endif /* 0xBFC396A4: 30C80100 andi $t0, $a2, 0x100 */ - cpu->gpr[8] = cpu->gpr[6] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[8] = cpu->gpr[6] & 0x100u; + PGXP_ALU(0x30C80100u, cpu->gpr[8], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x800516A4u); #endif @@ -735245,7 +737072,8 @@ label_BFC39698: psx_cyc_step(cpu, 0x880u); #endif /* 0xBFC396B0: 30EB03FF andi $t3, $a3, 0x3FF */ - cpu->gpr[11] = cpu->gpr[7] & 0x3FFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[11] = cpu->gpr[7] & 0x3FFu; + PGXP_ALU(0x30EB03FFu, cpu->gpr[11], _pgx1, 0x03FFu); } #ifdef PSX_COSIM cosim_instr(0x800516B0u); #endif @@ -735310,7 +737138,8 @@ label_BFC396C0: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC396CC: 3062FFFF andi $v0, $v1, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[3] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[2] = cpu->gpr[3] & 0xFFFFu; + PGXP_ALU(0x3062FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800516CCu); #endif @@ -735354,7 +737183,8 @@ label_BFC396D0: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC396D4: 31F8003F andi $t8, $t7, 0x3F */ - cpu->gpr[24] = cpu->gpr[15] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x3Fu; + PGXP_ALU(0x31F8003Fu, cpu->gpr[24], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x800516D4u); #endif @@ -735388,7 +737218,8 @@ label_BFC396D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC396E4: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800516E4u); #endif @@ -735464,7 +737295,8 @@ label_BFC396E8: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC396F0: 3083FFFF andi $v1, $a0, 0xFFFF */ - cpu->gpr[3] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3083FFFFu, cpu->gpr[3], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800516F0u); #endif @@ -735581,7 +737413,8 @@ label_BFC39708: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC39714: 31CF0300 andi $t7, $t6, 0x300 */ - cpu->gpr[15] = cpu->gpr[14] & 0x300u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x300u; + PGXP_ALU(0x31CF0300u, cpu->gpr[15], _pgx1, 0x0300u); } #ifdef PSX_COSIM cosim_instr(0x80051714u); #endif @@ -735628,7 +737461,8 @@ label_BFC39708: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC39728: 30E707C0 andi $a3, $a3, 0x7C0 */ - cpu->gpr[7] = cpu->gpr[7] & 0x7C0u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x7C0u; + PGXP_ALU(0x30E707C0u, cpu->gpr[7], _pgx1, 0x07C0u); } #ifdef PSX_COSIM cosim_instr(0x80051728u); #endif @@ -735636,7 +737470,8 @@ label_BFC39708: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC3972C: 30C60003 andi $a2, $a2, 0x3 */ - cpu->gpr[6] = cpu->gpr[6] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x3u; + PGXP_ALU(0x30C60003u, cpu->gpr[6], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x8005172Cu); #endif @@ -735647,7 +737482,8 @@ label_BFC39708: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC39730: 30A50003 andi $a1, $a1, 0x3 */ - cpu->gpr[5] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30A50003u, cpu->gpr[5], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051730u); #endif @@ -735763,7 +737599,8 @@ label_BFC39748: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC39754: 33280100 andi $t0, $t9, 0x100 */ - cpu->gpr[8] = cpu->gpr[25] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x100u; + PGXP_ALU(0x33280100u, cpu->gpr[8], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x80051754u); #endif @@ -735810,7 +737647,8 @@ label_BFC39748: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC39768: 30E707C0 andi $a3, $a3, 0x7C0 */ - cpu->gpr[7] = cpu->gpr[7] & 0x7C0u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x7C0u; + PGXP_ALU(0x30E707C0u, cpu->gpr[7], _pgx1, 0x07C0u); } #ifdef PSX_COSIM cosim_instr(0x80051768u); #endif @@ -735818,7 +737656,8 @@ label_BFC39748: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC3976C: 30C60003 andi $a2, $a2, 0x3 */ - cpu->gpr[6] = cpu->gpr[6] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x3u; + PGXP_ALU(0x30C60003u, cpu->gpr[6], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x8005176Cu); #endif @@ -735829,7 +737668,8 @@ label_BFC39748: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC39770: 30A50003 andi $a1, $a1, 0x3 */ - cpu->gpr[5] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30A50003u, cpu->gpr[5], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051770u); #endif @@ -735979,7 +737819,8 @@ label_BFC39804: psx_cyc_step(cpu, 0x3000008u); #endif /* 0xBFC39814: 0303C826 xor $t9, $t8, $v1 */ - cpu->gpr[25] = cpu->gpr[24] ^ cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[25] = cpu->gpr[24] ^ cpu->gpr[3]; + PGXP_ALU(0x0303C826u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051814u); #endif @@ -736008,7 +737849,8 @@ label_BFC39804: psx_cyc_step(cpu, 0x608u); #endif /* 0xBFC39820: 01235026 xor $t2, $t1, $v1 */ - cpu->gpr[10] = cpu->gpr[9] ^ cpu->gpr[3]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[10] = cpu->gpr[9] ^ cpu->gpr[3]; + PGXP_ALU(0x01235026u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051820u); #endif @@ -736042,7 +737884,8 @@ label_BFC39804: psx_cyc_step(cpu, 0x824u); #endif /* 0xBFC39830: 00A25826 xor $t3, $a1, $v0 */ - cpu->gpr[11] = cpu->gpr[5] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[5] ^ cpu->gpr[2]; + PGXP_ALU(0x00A25826u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051830u); #endif @@ -736068,7 +737911,8 @@ label_BFC39804: psx_cyc_step(cpu, 0x6004u); #endif /* 0xBFC3983C: 01A27026 xor $t6, $t5, $v0 */ - cpu->gpr[14] = cpu->gpr[13] ^ cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[13] ^ cpu->gpr[2]; + PGXP_ALU(0x01A27026u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005183Cu); #endif @@ -736197,7 +738041,8 @@ label_BFC398DC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC398E8: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800518E8u); #endif @@ -736255,7 +738100,8 @@ label_BFC398F4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC398FC: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800518FCu); #endif @@ -736266,7 +738112,8 @@ label_BFC398F4: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC39900: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80051900u); #endif @@ -736400,7 +738247,8 @@ label_BFC39918: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC39924: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80051924u); #endif @@ -736455,7 +738303,8 @@ label_BFC39930: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC39938: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051938u); #endif @@ -736463,7 +738312,8 @@ label_BFC39930: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3993C: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005193Cu); #endif @@ -736550,7 +738400,8 @@ label_BFC3994C: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC39958: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051958u); #endif @@ -736668,7 +738519,8 @@ label_BFC3999C: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC399A8: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800519A8u); #endif @@ -736786,7 +738638,8 @@ label_BFC399EC: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC399F8: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800519F8u); #endif @@ -736904,7 +738757,8 @@ label_BFC39A14: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC39A20: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051A20u); #endif @@ -737019,7 +738873,8 @@ label_BFC39A3C: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC39A48: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051A48u); #endif @@ -737137,7 +738992,8 @@ label_BFC39ADC: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC39AE8: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051AE8u); #endif @@ -737255,7 +739111,8 @@ label_BFC39BA4: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC39BB0: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051BB0u); #endif @@ -737370,7 +739227,8 @@ label_BFC39BCC: psx_cyc_step(cpu, 0xC002u); #endif /* 0xBFC39BD8: 01C17824 and $t7, $t6, $at */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C17824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80051BD8u); #endif @@ -738050,7 +739908,8 @@ label_BFC39DF4: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC39E04: 316C0300 andi $t4, $t3, 0x300 */ - cpu->gpr[12] = cpu->gpr[11] & 0x300u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x300u; + PGXP_ALU(0x316C0300u, cpu->gpr[12], _pgx1, 0x0300u); } #ifdef PSX_COSIM cosim_instr(0x80051E04u); #endif @@ -738097,7 +739956,8 @@ label_BFC39DF4: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC39E18: 30E707C0 andi $a3, $a3, 0x7C0 */ - cpu->gpr[7] = cpu->gpr[7] & 0x7C0u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x7C0u; + PGXP_ALU(0x30E707C0u, cpu->gpr[7], _pgx1, 0x07C0u); } #ifdef PSX_COSIM cosim_instr(0x80051E18u); #endif @@ -738105,7 +739965,8 @@ label_BFC39DF4: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC39E1C: 30C60003 andi $a2, $a2, 0x3 */ - cpu->gpr[6] = cpu->gpr[6] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x3u; + PGXP_ALU(0x30C60003u, cpu->gpr[6], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051E1Cu); #endif @@ -738116,7 +739977,8 @@ label_BFC39DF4: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC39E20: 30A50003 andi $a1, $a1, 0x3 */ - cpu->gpr[5] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30A50003u, cpu->gpr[5], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051E20u); #endif @@ -738238,7 +740100,8 @@ label_BFC39E38: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC39E48: 31CF0100 andi $t7, $t6, 0x100 */ - cpu->gpr[15] = cpu->gpr[14] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x100u; + PGXP_ALU(0x31CF0100u, cpu->gpr[15], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x80051E48u); #endif @@ -738285,7 +740148,8 @@ label_BFC39E38: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC39E5C: 30E707C0 andi $a3, $a3, 0x7C0 */ - cpu->gpr[7] = cpu->gpr[7] & 0x7C0u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x7C0u; + PGXP_ALU(0x30E707C0u, cpu->gpr[7], _pgx1, 0x07C0u); } #ifdef PSX_COSIM cosim_instr(0x80051E5Cu); #endif @@ -738296,7 +740160,8 @@ label_BFC39E38: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC39E60: 30C60003 andi $a2, $a2, 0x3 */ - cpu->gpr[6] = cpu->gpr[6] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x3u; + PGXP_ALU(0x30C60003u, cpu->gpr[6], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051E60u); #endif @@ -738304,7 +740169,8 @@ label_BFC39E38: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC39E64: 30A50003 andi $a1, $a1, 0x3 */ - cpu->gpr[5] = cpu->gpr[5] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0x3u; + PGXP_ALU(0x30A50003u, cpu->gpr[5], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80051E64u); #endif @@ -738893,7 +740759,8 @@ label_BFC39F30: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC39F30: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80051F30u); #endif @@ -738917,7 +740784,8 @@ label_BFC39F30: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC39F3C: 2C810020 sltiu $at, $a0, 32 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000020u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000020u ? 1 : 0); + PGXP_ALU(0x2C810020u, cpu->gpr[1], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80051F3Cu); #endif @@ -738997,7 +740865,8 @@ label_BFC39F50: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC39F54: 2C810080 sltiu $at, $a0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C810080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80051F54u); #endif @@ -739232,7 +741101,8 @@ label_BFC39F90: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC39F90: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80051F90u); #endif @@ -739256,7 +741126,8 @@ label_BFC39F90: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC39F9C: 2C810020 sltiu $at, $a0, 32 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000020u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000020u ? 1 : 0); + PGXP_ALU(0x2C810020u, cpu->gpr[1], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80051F9Cu); #endif @@ -739330,7 +741201,8 @@ label_BFC39FAC: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC39FB0: 2C810080 sltiu $at, $a0, 128 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000080u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000080u ? 1 : 0); + PGXP_ALU(0x2C810080u, cpu->gpr[1], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80051FB0u); #endif @@ -739743,7 +741615,8 @@ label_BFC3A020: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3A020: 31CF00FF andi $t7, $t6, 0xFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052020u); #endif @@ -739989,7 +741862,8 @@ label_BFC3A06C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3A06C: 331900FF andi $t9, $t8, 0xFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x331900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005206Cu); #endif @@ -740539,7 +742413,8 @@ label_BFC3A114: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3A114: 31F800FF andi $t8, $t7, 0xFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052114u); #endif @@ -740621,7 +742496,8 @@ label_BFC3A120: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3A130: 310900FF andi $t1, $t0, 0xFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052130u); #endif @@ -741569,7 +743445,8 @@ label_BFC3A250: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3A25C: 31F800FF andi $t8, $t7, 0xFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFu; + PGXP_ALU(0x31F800FFu, cpu->gpr[24], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005225Cu); #endif @@ -741702,7 +743579,8 @@ label_BFC3A274: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3A288: 310900FF andi $t1, $t0, 0xFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052288u); #endif @@ -742170,7 +744048,8 @@ label_BFC3A308: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC3A310: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052310u); #endif @@ -742235,7 +744114,8 @@ label_BFC3A31C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3A324: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052324u); #endif @@ -742243,7 +744123,8 @@ label_BFC3A31C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3A328: 2C410018 sltiu $at, $v0, 24 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000018u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000018u ? 1 : 0); + PGXP_ALU(0x2C410018u, cpu->gpr[1], _pgx1, 0x0018u); } #ifdef PSX_COSIM cosim_instr(0x80052328u); #endif @@ -742647,7 +744528,8 @@ label_BFC3A36C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC3A3A8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800523A8u); #endif @@ -742655,7 +744537,8 @@ label_BFC3A36C: psx_cyc_step(cpu, 0x92u); #endif /* 0xBFC3A3AC: 0087082B sltu $at, $a0, $a3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0087082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800523ACu); #endif @@ -742804,7 +744687,8 @@ label_BFC3A3CC: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC3A3D8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800523D8u); #endif @@ -742824,7 +744708,8 @@ label_BFC3A3CC: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC3A3E0: 2C810021 sltiu $at, $a0, 33 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000021u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00000021u ? 1 : 0); + PGXP_ALU(0x2C810021u, cpu->gpr[1], _pgx1, 0x0021u); } #ifdef PSX_COSIM cosim_instr(0x800523E0u); #endif @@ -743698,7 +745583,8 @@ label_BFC3A4E4: psx_cyc_step(cpu, 0x1006u); #endif /* 0xBFC3A4EC: 0182082B sltu $at, $t4, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[12] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[12] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0182082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800524ECu); #endif @@ -743748,7 +745634,8 @@ label_BFC3A4F8: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3A4F8: 3182FFFF andi $v0, $t4, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[12] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[2] = cpu->gpr[12] & 0xFFFFu; + PGXP_ALU(0x3182FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800524F8u); #endif @@ -743756,7 +745643,8 @@ label_BFC3A4F8: psx_cyc_step(cpu, 0x810u); #endif /* 0xBFC3A4FC: 3164FFFF andi $a0, $t3, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[4] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x3164FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800524FCu); #endif @@ -743774,7 +745662,8 @@ label_BFC3A4F8: psx_cyc_step(cpu, 0x140u); #endif /* 0xBFC3A504: 310600FF andi $a2, $t0, 0xFF */ - cpu->gpr[6] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[6] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310600FFu, cpu->gpr[6], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052504u); #endif @@ -743813,7 +745702,8 @@ label_BFC3A508: psx_cyc_step(cpu, 0x812u); #endif /* 0xBFC3A50C: 0164082B sltu $at, $t3, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0164082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005250Cu); #endif @@ -743884,7 +745774,8 @@ label_BFC3A518: psx_cyc_step(cpu, 0x810u); #endif /* 0xBFC3A518: 3164FFFF andi $a0, $t3, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[4] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x3164FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052518u); #endif @@ -743902,7 +745793,8 @@ label_BFC3A518: psx_cyc_step(cpu, 0x140u); #endif /* 0xBFC3A520: 310600FF andi $a2, $t0, 0xFF */ - cpu->gpr[6] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[6] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310600FFu, cpu->gpr[6], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052520u); #endif @@ -743990,7 +745882,8 @@ label_BFC3A52C: psx_cyc_step(cpu, 0x2802u); #endif /* 0xBFC3A534: 01AB082A slt $at, $t5, $t3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x01AB082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052534u); #endif @@ -744046,7 +745939,8 @@ label_BFC3A540: psx_cyc_step(cpu, 0x100Au); #endif /* 0xBFC3A544: 0183082B sltu $at, $t4, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[12] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[12] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0183082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052544u); #endif @@ -744099,7 +745993,8 @@ label_BFC3A550: psx_cyc_step(cpu, 0x1008u); #endif /* 0xBFC3A554: 3183FFFF andi $v1, $t4, 0xFFFF */ - cpu->gpr[3] = cpu->gpr[12] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[3] = cpu->gpr[12] & 0xFFFFu; + PGXP_ALU(0x3183FFFFu, cpu->gpr[3], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052554u); #endif @@ -744114,7 +746009,8 @@ label_BFC3A550: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC3A55C: 310700FF andi $a3, $t0, 0xFF */ - cpu->gpr[7] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[7] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005255Cu); #endif @@ -744202,7 +746098,8 @@ label_BFC3A568: psx_cyc_step(cpu, 0x822u); #endif /* 0xBFC3A570: 0165082B sltu $at, $t3, $a1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0165082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052570u); #endif @@ -744249,7 +746146,8 @@ label_BFC3A57C: psx_cyc_step(cpu, 0x820u); #endif /* 0xBFC3A57C: 3165FFFF andi $a1, $t3, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[5] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x3165FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005257Cu); #endif @@ -744260,7 +746158,8 @@ label_BFC3A57C: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC3A580: 310700FF andi $a3, $t0, 0xFF */ - cpu->gpr[7] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[7] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052580u); #endif @@ -744293,7 +746192,8 @@ label_BFC3A584: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC3A58C: 310800FF andi $t0, $t0, 0xFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310800FFu, cpu->gpr[8], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005258Cu); #endif @@ -744304,7 +746204,8 @@ label_BFC3A584: psx_cyc_step(cpu, 0x302u); #endif /* 0xBFC3A590: 0109082B sltu $at, $t0, $t1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0109082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052590u); #endif @@ -744539,7 +746440,8 @@ label_BFC3A5C4: psx_cyc_step(cpu, 0x280u); #endif /* 0xBFC3A5C4: 312700FF andi $a3, $t1, 0xFF */ - cpu->gpr[7] = cpu->gpr[9] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[7] = cpu->gpr[9] & 0xFFu; + PGXP_ALU(0x312700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800525C4u); #endif @@ -744650,7 +746552,8 @@ label_BFC3A5D4: psx_cyc_step(cpu, 0xA002u); #endif /* 0xBFC3A5E8: 01AF082A slt $at, $t5, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x01AF082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800525E8u); #endif @@ -744714,7 +746617,8 @@ label_BFC3A5F4: psx_cyc_step(cpu, 0x26u); #endif /* 0xBFC3A5FC: 00A2082B sltu $at, $a1, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x00A2082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800525FCu); #endif @@ -744764,7 +746668,8 @@ label_BFC3A608: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC3A608: 3045FFFF andi $a1, $v0, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3045FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052608u); #endif @@ -744772,7 +746677,8 @@ label_BFC3A608: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC3A60C: 310700FF andi $a3, $t0, 0xFF */ - cpu->gpr[7] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[7] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310700FFu, cpu->gpr[7], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005260Cu); #endif @@ -744799,7 +746705,8 @@ label_BFC3A610: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC3A614: 310800FF andi $t0, $t0, 0xFF */ - cpu->gpr[8] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310800FFu, cpu->gpr[8], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052614u); #endif @@ -744807,7 +746714,8 @@ label_BFC3A610: psx_cyc_step(cpu, 0x302u); #endif /* 0xBFC3A618: 0109082B sltu $at, $t0, $t1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0109082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052618u); #endif @@ -745177,7 +747085,8 @@ label_BFC3A638: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3A68C: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005268Cu); #endif @@ -745498,7 +747407,8 @@ label_BFC3A638: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC3A704: 2D010040 sltiu $at, $t0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2D010040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80052704u); #endif @@ -745771,7 +747681,8 @@ label_BFC3A74C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3A758: 2C410040 sltiu $at, $v0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C410040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80052758u); #endif @@ -745996,7 +747907,8 @@ label_BFC3A78C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3A798: 2C410040 sltiu $at, $v0, 64 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000040u ? 1 : 0); + PGXP_ALU(0x2C410040u, cpu->gpr[1], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80052798u); #endif @@ -746229,7 +748141,8 @@ label_BFC3A7CC: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC3A7DC: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800527DCu); #endif @@ -746425,7 +748338,8 @@ label_BFC3A7F4: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC3A810: 30E7FFFF andi $a3, $a3, 0xFFFF */ - cpu->gpr[7] = cpu->gpr[7] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xFFFFu; + PGXP_ALU(0x30E7FFFFu, cpu->gpr[7], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052810u); #endif @@ -746695,7 +748609,8 @@ label_BFC3A7F4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3A87C: 28410010 slti $at, $v0, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (16) ? 1 : 0); + PGXP_ALU(0x28410010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8005287Cu); #endif @@ -746797,7 +748712,8 @@ label_BFC3A894: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC3A89C: 3063FFFF andi $v1, $v1, 0xFFFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + PGXP_ALU(0x3063FFFFu, cpu->gpr[3], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005289Cu); #endif @@ -746887,7 +748803,8 @@ label_BFC3A8A8: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC3A8B8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800528B8u); #endif @@ -746931,7 +748848,8 @@ label_BFC3A8BC: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC3A8C8: 318D0004 andi $t5, $t4, 0x4 */ - cpu->gpr[13] = cpu->gpr[12] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x4u; + PGXP_ALU(0x318D0004u, cpu->gpr[13], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x800528C8u); #endif @@ -747117,7 +749035,8 @@ label_BFC3A900: psx_cyc_step(cpu, 0x809u); #endif /* 0xBFC3A908: 00605827 nor $t3, $v1, $zero */ - cpu->gpr[11] = ~(cpu->gpr[3] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[11] = ~(cpu->gpr[3] | cpu->gpr[0]); + PGXP_ALU(0x00605827u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052908u); #endif @@ -747152,7 +749071,8 @@ label_BFC3A900: psx_cyc_step(cpu, 0xE00u); #endif /* 0xBFC3A918: 012B5024 and $t2, $t1, $t3 */ - cpu->gpr[10] = cpu->gpr[9] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[10] = cpu->gpr[9] & cpu->gpr[11]; + PGXP_ALU(0x012B5024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052918u); #endif @@ -747172,7 +749092,8 @@ label_BFC3A900: psx_cyc_step(cpu, 0x2011u); #endif /* 0xBFC3A920: 00806827 nor $t5, $a0, $zero */ - cpu->gpr[13] = ~(cpu->gpr[4] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[13] = ~(cpu->gpr[4] | cpu->gpr[0]); + PGXP_ALU(0x00806827u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052920u); #endif @@ -747189,7 +749110,8 @@ label_BFC3A900: psx_cyc_step(cpu, 0x7000u); #endif /* 0xBFC3A928: 018D7024 and $t6, $t4, $t5 */ - cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + PGXP_ALU(0x018D7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052928u); #endif @@ -747380,7 +749302,8 @@ label_BFC3A95C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3A968: 2C410010 sltiu $at, $v0, 16 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000010u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < 0x00000010u ? 1 : 0); + PGXP_ALU(0x2C410010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80052968u); #endif @@ -747449,7 +749372,8 @@ label_BFC3A974: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC3A97C: 3063FFFF andi $v1, $v1, 0xFFFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFFFu; + PGXP_ALU(0x3063FFFFu, cpu->gpr[3], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005297Cu); #endif @@ -747549,7 +749473,8 @@ label_BFC3A98C: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC3A998: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052998u); #endif @@ -748006,7 +749931,8 @@ label_BFC3AA24: psx_cyc_step(cpu, 0x4020u); #endif /* 0xBFC3AA34: 30AEFFFF andi $t6, $a1, 0xFFFF */ - cpu->gpr[14] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[14] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30AEFFFFu, cpu->gpr[14], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052A34u); #endif @@ -748023,7 +749949,8 @@ label_BFC3AA24: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC3AA3C: 2DC10010 sltiu $at, $t6, 16 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000010u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[14] < 0x00000010u ? 1 : 0); + PGXP_ALU(0x2DC10010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80052A3Cu); #endif @@ -748034,7 +749961,8 @@ label_BFC3AA24: psx_cyc_step(cpu, 0x30u); #endif /* 0xBFC3AA40: 30A4FFFF andi $a0, $a1, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[4] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A4FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052A40u); #endif @@ -748327,7 +750255,8 @@ label_BFC3AA9C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3AAA4: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052AA4u); #endif @@ -748416,7 +750345,8 @@ label_BFC3AAB0: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3AAB8: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052AB8u); #endif @@ -748707,7 +750637,8 @@ label_BFC3AAF4: psx_cyc_step(cpu, 0x482u); #endif /* 0xBFC3AB14: 00EA082B sltu $at, $a3, $t2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[7] < cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)(cpu->gpr[7] < cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x00EA082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052B14u); #endif @@ -748768,7 +750699,8 @@ label_BFC3AB20: psx_cyc_step(cpu, 0x882u); #endif /* 0xBFC3AB28: 0167082B sltu $at, $t3, $a3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)(cpu->gpr[11] < cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x0167082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052B28u); #endif @@ -748872,7 +750804,8 @@ label_BFC3AB34: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC3AB4C: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052B4Cu); #endif @@ -748917,7 +750850,8 @@ label_BFC3AB50: psx_cyc_step(cpu, 0x46u); #endif /* 0xBFC3AB5C: 0046082A slt $at, $v0, $a2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0046082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052B5Cu); #endif @@ -749135,7 +751069,8 @@ label_BFC3AB70: psx_cyc_step(cpu, 0x2000010u); #endif /* 0xBFC3ABA0: 30990001 andi $t9, $a0, 0x1 */ - cpu->gpr[25] = cpu->gpr[4] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[4] & 0x1u; + PGXP_ALU(0x30990001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80052BA0u); #endif @@ -750075,7 +752010,8 @@ label_BFC3ACD0: psx_cyc_step(cpu, 0x8022u); #endif /* 0xBFC3ACDC: 00AF082A slt $at, $a1, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x00AF082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052CDCu); #endif @@ -750600,7 +752536,8 @@ label_BFC3AD68: psx_cyc_step(cpu, 0x40080u); #endif /* 0xBFC3AD90: 30F2FFFF andi $s2, $a3, 0xFFFF */ - cpu->gpr[18] = cpu->gpr[7] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[18] = cpu->gpr[7] & 0xFFFFu; + PGXP_ALU(0x30F2FFFFu, cpu->gpr[18], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052D90u); #endif @@ -750991,7 +752928,8 @@ label_BFC3ADB0: psx_cyc_step(cpu, 0x80802u); #endif /* 0xBFC3AE28: 026B082B sltu $at, $s3, $t3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < cpu->gpr[11] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[19]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[1] = (uint32_t)(cpu->gpr[19] < cpu->gpr[11] ? 1 : 0); + PGXP_ALU(0x026B082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052E28u); #endif @@ -751290,7 +753228,8 @@ label_BFC3AE74: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3AE74: 304C00FF andi $t4, $v0, 0xFF */ - cpu->gpr[12] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304C00FFu, cpu->gpr[12], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052E74u); #endif @@ -751298,7 +753237,8 @@ label_BFC3AE74: psx_cyc_step(cpu, 0x40004u); #endif /* 0xBFC3AE78: 305200FF andi $s2, $v0, 0xFF */ - cpu->gpr[18] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[18] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x305200FFu, cpu->gpr[18], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80052E78u); #endif @@ -751545,7 +753485,8 @@ label_BFC3AEB0: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC3AED8: 312AFFFF andi $t2, $t1, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x312AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052ED8u); #endif @@ -751849,7 +753790,8 @@ label_BFC3AF44: psx_cyc_step(cpu, 0x1802u); #endif /* 0xBFC3AF5C: 016C082A slt $at, $t3, $t4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (int32_t)cpu->gpr[12] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (int32_t)cpu->gpr[12] ? 1 : 0); + PGXP_ALU(0x016C082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80052F5Cu); #endif @@ -752241,7 +754183,8 @@ label_BFC3AFE0: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC3AFE8: 3045FFFF andi $a1, $v0, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3045FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80052FE8u); #endif @@ -752341,7 +754284,8 @@ label_BFC3B004: psx_cyc_step(cpu, 0x10000u); #endif /* 0xBFC3B008: 321000FF andi $s0, $s0, 0xFF */ - cpu->gpr[16] = cpu->gpr[16] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[16] = cpu->gpr[16] & 0xFFu; + PGXP_ALU(0x321000FFu, cpu->gpr[16], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80053008u); #endif @@ -752349,7 +754293,8 @@ label_BFC3B004: psx_cyc_step(cpu, 0x50002u); #endif /* 0xBFC3B00C: 0212082B sltu $at, $s0, $s2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0212082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005300Cu); #endif @@ -752751,7 +754696,8 @@ label_BFC3B054: psx_cyc_step(cpu, 0x100080u); #endif /* 0xBFC3B094: 30F4FFFF andi $s4, $a3, 0xFFFF */ - cpu->gpr[20] = cpu->gpr[7] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[20] = cpu->gpr[7] & 0xFFFFu; + PGXP_ALU(0x30F4FFFFu, cpu->gpr[20], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80053094u); #endif @@ -753176,7 +755122,8 @@ label_BFC3B110: psx_cyc_step(cpu, 0x20000u); #endif /* 0xBFC3B114: 323100FF andi $s1, $s1, 0xFF */ - cpu->gpr[17] = cpu->gpr[17] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[17]; cpu->gpr[17] = cpu->gpr[17] & 0xFFu; + PGXP_ALU(0x323100FFu, cpu->gpr[17], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80053114u); #endif @@ -753203,7 +755150,8 @@ label_BFC3B118: psx_cyc_step(cpu, 0x10000u); #endif /* 0xBFC3B11C: 321000FF andi $s0, $s0, 0xFF */ - cpu->gpr[16] = cpu->gpr[16] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[16] = cpu->gpr[16] & 0xFFu; + PGXP_ALU(0x321000FFu, cpu->gpr[16], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005311Cu); #endif @@ -753214,7 +755162,8 @@ label_BFC3B118: psx_cyc_step(cpu, 0x50002u); #endif /* 0xBFC3B120: 0212082B sltu $at, $s0, $s2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[18] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)(cpu->gpr[16] < cpu->gpr[18] ? 1 : 0); + PGXP_ALU(0x0212082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80053120u); #endif @@ -753594,7 +755543,8 @@ label_BFC3B17C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3B1A4: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800531A4u); #endif @@ -753611,7 +755561,8 @@ label_BFC3B17C: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC3B1AC: 0043082B sltu $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[2] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800531ACu); #endif @@ -753722,7 +755673,8 @@ label_BFC3B1B8: psx_cyc_step(cpu, 0x3001u); #endif /* 0xBFC3B1D4: 01806827 nor $t5, $t4, $zero */ - cpu->gpr[13] = ~(cpu->gpr[12] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[13] = ~(cpu->gpr[12] | cpu->gpr[0]); + PGXP_ALU(0x01806827u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800531D4u); #endif @@ -753748,7 +755700,8 @@ label_BFC3B1B8: psx_cyc_step(cpu, 0xA800u); #endif /* 0xBFC3B1E0: 016D7824 and $t7, $t3, $t5 */ - cpu->gpr[15] = cpu->gpr[11] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[15] = cpu->gpr[11] & cpu->gpr[13]; + PGXP_ALU(0x016D7824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800531E0u); #endif @@ -753774,7 +755727,8 @@ label_BFC3B1B8: psx_cyc_step(cpu, 0x3000001u); #endif /* 0xBFC3B1EC: 0300C827 nor $t9, $t8, $zero */ - cpu->gpr[25] = ~(cpu->gpr[24] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[25] = ~(cpu->gpr[24] | cpu->gpr[0]); + PGXP_ALU(0x0300C827u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800531ECu); #endif @@ -753800,7 +755754,8 @@ label_BFC3B1B8: psx_cyc_step(cpu, 0x2004200u); #endif /* 0xBFC3B1F8: 01D94824 and $t1, $t6, $t9 */ - cpu->gpr[9] = cpu->gpr[14] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[9] = cpu->gpr[14] & cpu->gpr[25]; + PGXP_ALU(0x01D94824u, cpu->gpr[9], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800531F8u); #endif @@ -753820,7 +755775,8 @@ label_BFC3B1B8: psx_cyc_step(cpu, 0x8100u); #endif /* 0xBFC3B200: 31E8FFFF andi $t0, $t7, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[8] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31E8FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80053200u); #endif @@ -756201,7 +758157,8 @@ label_BFC3B530: psx_cyc_step(cpu, 0x2000002u); #endif /* 0xBFC3B538: 2B210005 slti $at, $t9, 5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (5) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (5) ? 1 : 0); + PGXP_ALU(0x2B210005u, cpu->gpr[1], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0x80053538u); #endif @@ -756402,7 +758359,8 @@ label_BFC3B560: psx_cyc_step(cpu, 0x16u); #endif /* 0xBFC3B570: 0082082B sltu $at, $a0, $v0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0082082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80053570u); #endif @@ -756937,7 +758895,8 @@ label_BFC3B614: psx_cyc_step(cpu, 0x200000Au); #endif /* 0xBFC3B620: 0079082A slt $at, $v1, $t9 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0079082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80053620u); #endif @@ -757143,7 +759102,8 @@ label_BFC3B668: psx_cyc_step(cpu, 0x10Au); #endif /* 0xBFC3B668: 0103082B sltu $at, $t0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0103082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80053668u); #endif @@ -757241,7 +759201,8 @@ label_BFC3B674: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC3B68C: 29C10005 slti $at, $t6, 5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (5) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (5) ? 1 : 0); + PGXP_ALU(0x29C10005u, cpu->gpr[1], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0x8005368Cu); #endif @@ -757833,7 +759794,8 @@ label_BFC3B738: psx_cyc_step(cpu, 0x2002u); #endif /* 0xBFC3B744: 01A1082B sltu $at, $t5, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[13] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x01A1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80053744u); #endif @@ -758137,7 +760099,8 @@ label_BFC3B798: psx_cyc_step(cpu, 0x2008u); #endif /* 0xBFC3B7A8: 306D0001 andi $t5, $v1, 0x1 */ - cpu->gpr[13] = cpu->gpr[3] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[13] = cpu->gpr[3] & 0x1u; + PGXP_ALU(0x306D0001u, cpu->gpr[13], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800537A8u); #endif @@ -758590,7 +760553,8 @@ label_BFC3B81C: psx_cyc_step(cpu, 0x10Au); #endif /* 0xBFC3B820: 0103082B sltu $at, $t0, $v1 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0103082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80053820u); #endif @@ -758860,7 +760824,8 @@ label_BFC3B85C: psx_cyc_step(cpu, 0x10002u); #endif /* 0xBFC3B86C: 2A010002 slti $at, $s0, 2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (2) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[16]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[16] < (2) ? 1 : 0); + PGXP_ALU(0x2A010002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x8005386Cu); #endif @@ -759851,7 +761816,8 @@ label_BFC3B964: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3B998: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80053998u); #endif @@ -759898,7 +761864,8 @@ label_BFC3B964: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3B9AC: 28410010 slti $at, $v0, 16 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (16) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (16) ? 1 : 0); + PGXP_ALU(0x28410010u, cpu->gpr[1], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x800539ACu); #endif @@ -759909,7 +761876,8 @@ label_BFC3B964: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC3B9B0: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800539B0u); #endif @@ -760358,7 +762326,8 @@ label_BFC3BA4C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3BA54: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80053A54u); #endif @@ -760447,7 +762416,8 @@ label_BFC3BA60: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3BA68: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80053A68u); #endif @@ -760963,7 +762933,8 @@ label_BFC3BAF0: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC3BAF0: 0062082A slt $at, $v1, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x0062082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80053AF0u); #endif @@ -762778,7 +764749,8 @@ label_BFC3BDCC: psx_cyc_step(cpu, 0xAu); #endif /* 0xBFC3BDCC: 2861000A slti $at, $v1, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (10) ? 1 : 0); + PGXP_ALU(0x2861000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x80053DCCu); #endif @@ -765688,7 +767660,8 @@ label_BFC3C140: psx_cyc_step(cpu, 0x4002u); #endif /* 0xBFC3C150: 29C100F0 slti $at, $t6, 240 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (240) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (240) ? 1 : 0); + PGXP_ALU(0x29C100F0u, cpu->gpr[1], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80054150u); #endif @@ -765838,7 +767811,8 @@ label_BFC3C160: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC3C188: 292100F0 slti $at, $t1, 240 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (240) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (240) ? 1 : 0); + PGXP_ALU(0x292100F0u, cpu->gpr[1], _pgx1, 0x00F0u); } #ifdef PSX_COSIM cosim_instr(0x80054188u); #endif @@ -766197,7 +768171,8 @@ label_BFC3C1EC: psx_cyc_step(cpu, 0x2000400u); #endif /* 0xBFC3C1F4: 332A07FF andi $t2, $t9, 0x7FF */ - cpu->gpr[10] = cpu->gpr[25] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[10] = cpu->gpr[25] & 0x7FFu; + PGXP_ALU(0x332A07FFu, cpu->gpr[10], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x800541F4u); #endif @@ -766294,7 +768269,8 @@ label_BFC3C208: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3C20C: 28411389 slti $at, $v0, 5001 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (5001) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (5001) ? 1 : 0); + PGXP_ALU(0x28411389u, cpu->gpr[1], _pgx1, 0x1389u); } #ifdef PSX_COSIM cosim_instr(0x8005420Cu); #endif @@ -766487,7 +768463,8 @@ label_BFC3C240: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC3C248: 316C07FF andi $t4, $t3, 0x7FF */ - cpu->gpr[12] = cpu->gpr[11] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x7FFu; + PGXP_ALU(0x316C07FFu, cpu->gpr[12], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80054248u); #endif @@ -767974,7 +769951,8 @@ label_BFC3C428: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC3C448: 30C607FF andi $a2, $a2, 0x7FF */ - cpu->gpr[6] = cpu->gpr[6] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0x7FFu; + PGXP_ALU(0x30C607FFu, cpu->gpr[6], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80054448u); #endif @@ -767982,7 +769960,8 @@ label_BFC3C428: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C44C: 3042FFCF andi $v0, $v0, 0xFFCF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFCFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFCFu; + PGXP_ALU(0x3042FFCFu, cpu->gpr[2], _pgx1, 0xFFCFu); } #ifdef PSX_COSIM cosim_instr(0x8005444Cu); #endif @@ -767993,7 +769972,8 @@ label_BFC3C428: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C450: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054450u); #endif @@ -768016,7 +769996,8 @@ label_BFC3C428: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC3C45C: 30C6FFFF andi $a2, $a2, 0xFFFF */ - cpu->gpr[6] = cpu->gpr[6] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0xFFFFu; + PGXP_ALU(0x30C6FFFFu, cpu->gpr[6], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005445Cu); #endif @@ -768027,7 +770008,8 @@ label_BFC3C428: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3C460: 31CF07FF andi $t7, $t6, 0x7FF */ - cpu->gpr[15] = cpu->gpr[14] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x7FFu; + PGXP_ALU(0x31CF07FFu, cpu->gpr[15], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80054460u); #endif @@ -768136,7 +770118,8 @@ label_BFC3C478: psx_cyc_step(cpu, 0x82u); #endif /* 0xBFC3C47C: 28E11389 slti $at, $a3, 5001 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (5001) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (5001) ? 1 : 0); + PGXP_ALU(0x28E11389u, cpu->gpr[1], _pgx1, 0x1389u); } #ifdef PSX_COSIM cosim_instr(0x8005447Cu); #endif @@ -768314,7 +770297,8 @@ label_BFC3C4A8: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3C4B0: 331907FF andi $t9, $t8, 0x7FF */ - cpu->gpr[25] = cpu->gpr[24] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x7FFu; + PGXP_ALU(0x331907FFu, cpu->gpr[25], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x800544B0u); #endif @@ -768684,7 +770668,8 @@ label_BFC3C4E0: psx_cyc_step(cpu, 0x200000u); #endif /* 0xBFC3C510: 32B507FF andi $s5, $s5, 0x7FF */ - cpu->gpr[21] = cpu->gpr[21] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[21]; cpu->gpr[21] = cpu->gpr[21] & 0x7FFu; + PGXP_ALU(0x32B507FFu, cpu->gpr[21], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80054510u); #endif @@ -768701,7 +770686,8 @@ label_BFC3C4E0: psx_cyc_step(cpu, 0x200000u); #endif /* 0xBFC3C518: 32B5FFFF andi $s5, $s5, 0xFFFF */ - cpu->gpr[21] = cpu->gpr[21] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[21]; cpu->gpr[21] = cpu->gpr[21] & 0xFFFFu; + PGXP_ALU(0x32B5FFFFu, cpu->gpr[21], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054518u); #endif @@ -768773,7 +770759,8 @@ label_BFC3C528: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3C530: 31F807FF andi $t8, $t7, 0x7FF */ - cpu->gpr[24] = cpu->gpr[15] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x7FFu; + PGXP_ALU(0x31F807FFu, cpu->gpr[24], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80054530u); #endif @@ -768839,7 +770826,8 @@ label_BFC3C540: psx_cyc_step(cpu, 0x40002u); #endif /* 0xBFC3C540: 2A411389 slti $at, $s2, 5001 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (5001) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (5001) ? 1 : 0); + PGXP_ALU(0x2A411389u, cpu->gpr[1], _pgx1, 0x1389u); } #ifdef PSX_COSIM cosim_instr(0x80054540u); #endif @@ -769035,7 +771023,8 @@ label_BFC3C574: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC3C57C: 332807FF andi $t0, $t9, 0x7FF */ - cpu->gpr[8] = cpu->gpr[25] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x7FFu; + PGXP_ALU(0x332807FFu, cpu->gpr[8], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x8005457Cu); #endif @@ -769156,7 +771145,8 @@ label_BFC3C594: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC3C598: 2E810041 sltiu $at, $s4, 65 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[20] < 0x00000041u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)(cpu->gpr[20] < 0x00000041u ? 1 : 0); + PGXP_ALU(0x2E810041u, cpu->gpr[1], _pgx1, 0x0041u); } #ifdef PSX_COSIM cosim_instr(0x80054598u); #endif @@ -769333,7 +771323,8 @@ label_BFC3C5B8: psx_cyc_step(cpu, 0x8000Au); #endif /* 0xBFC3C5C0: 0073082A slt $at, $v1, $s3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[19] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[3] < (int32_t)cpu->gpr[19] ? 1 : 0); + PGXP_ALU(0x0073082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800545C0u); #endif @@ -769404,7 +771395,8 @@ label_BFC3C5D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C5D8: 3042FFCF andi $v0, $v0, 0xFFCF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFCFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFCFu; + PGXP_ALU(0x3042FFCFu, cpu->gpr[2], _pgx1, 0xFFCFu); } #ifdef PSX_COSIM cosim_instr(0x800545D8u); #endif @@ -769412,7 +771404,8 @@ label_BFC3C5D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C5DC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800545DCu); #endif @@ -769432,7 +771425,8 @@ label_BFC3C5D0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C5E4: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800545E4u); #endif @@ -769488,7 +771482,8 @@ label_BFC3C5F0: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC3C5F8: 312A0400 andi $t2, $t1, 0x400 */ - cpu->gpr[10] = cpu->gpr[9] & 0x400u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x400u; + PGXP_ALU(0x312A0400u, cpu->gpr[10], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x800545F8u); #endif @@ -769557,7 +771552,8 @@ label_BFC3C608: psx_cyc_step(cpu, 0x40002u); #endif /* 0xBFC3C608: 2A411389 slti $at, $s2, 5001 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (5001) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (5001) ? 1 : 0); + PGXP_ALU(0x2A411389u, cpu->gpr[1], _pgx1, 0x1389u); } #ifdef PSX_COSIM cosim_instr(0x80054608u); #endif @@ -769756,7 +771752,8 @@ label_BFC3C63C: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC3C644: 316C0400 andi $t4, $t3, 0x400 */ - cpu->gpr[12] = cpu->gpr[11] & 0x400u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x400u; + PGXP_ALU(0x316C0400u, cpu->gpr[12], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x80054644u); #endif @@ -769908,7 +771905,8 @@ label_BFC3C664: psx_cyc_step(cpu, 0x100002u); #endif /* 0xBFC3C66C: 2E810041 sltiu $at, $s4, 65 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[20] < 0x00000041u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[20]; cpu->gpr[1] = (uint32_t)(cpu->gpr[20] < 0x00000041u ? 1 : 0); + PGXP_ALU(0x2E810041u, cpu->gpr[1], _pgx1, 0x0041u); } #ifdef PSX_COSIM cosim_instr(0x8005466Cu); #endif @@ -769981,7 +771979,8 @@ label_BFC3C678: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C680: 3042FFCF andi $v0, $v0, 0xFFCF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFCFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFCFu; + PGXP_ALU(0x3042FFCFu, cpu->gpr[2], _pgx1, 0xFFCFu); } #ifdef PSX_COSIM cosim_instr(0x80054680u); #endif @@ -769989,7 +771988,8 @@ label_BFC3C678: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C684: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054684u); #endif @@ -770023,7 +772023,8 @@ label_BFC3C678: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC3C694: 31AE07FF andi $t6, $t5, 0x7FF */ - cpu->gpr[14] = cpu->gpr[13] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x7FFu; + PGXP_ALU(0x31AE07FFu, cpu->gpr[14], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80054694u); #endif @@ -770120,7 +772121,8 @@ label_BFC3C6A8: psx_cyc_step(cpu, 0x40002u); #endif /* 0xBFC3C6AC: 2A411389 slti $at, $s2, 5001 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (5001) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[18]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[18] < (5001) ? 1 : 0); + PGXP_ALU(0x2A411389u, cpu->gpr[1], _pgx1, 0x1389u); } #ifdef PSX_COSIM cosim_instr(0x800546ACu); #endif @@ -770298,7 +772300,8 @@ label_BFC3C6D8: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3C6E0: 31F807FF andi $t8, $t7, 0x7FF */ - cpu->gpr[24] = cpu->gpr[15] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x7FFu; + PGXP_ALU(0x31F807FFu, cpu->gpr[24], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x800546E0u); #endif @@ -770929,7 +772932,8 @@ label_BFC3C710: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC3C72C: 30E707FF andi $a3, $a3, 0x7FF */ - cpu->gpr[7] = cpu->gpr[7] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0x7FFu; + PGXP_ALU(0x30E707FFu, cpu->gpr[7], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x8005472Cu); #endif @@ -770940,7 +772944,8 @@ label_BFC3C710: psx_cyc_step(cpu, 0x100u); #endif /* 0xBFC3C730: 3108000E andi $t0, $t0, 0xE */ - cpu->gpr[8] = cpu->gpr[8] & 0xEu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[8] = cpu->gpr[8] & 0xEu; + PGXP_ALU(0x3108000Eu, cpu->gpr[8], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x80054730u); #endif @@ -770948,7 +772953,8 @@ label_BFC3C710: psx_cyc_step(cpu, 0x80u); #endif /* 0xBFC3C734: 30E7FFFF andi $a3, $a3, 0xFFFF */ - cpu->gpr[7] = cpu->gpr[7] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[7] = cpu->gpr[7] & 0xFFFFu; + PGXP_ALU(0x30E7FFFFu, cpu->gpr[7], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054734u); #endif @@ -771188,7 +773194,8 @@ label_BFC3C76C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3C774: 3319BFFF andi $t9, $t8, 0xBFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xBFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xBFFFu; + PGXP_ALU(0x3319BFFFu, cpu->gpr[25], _pgx1, 0xBFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054774u); #endif @@ -771250,7 +773257,8 @@ label_BFC3C780: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC3C788: 312A4000 andi $t2, $t1, 0x4000 */ - cpu->gpr[10] = cpu->gpr[9] & 0x4000u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x4000u; + PGXP_ALU(0x312A4000u, cpu->gpr[10], _pgx1, 0x4000u); } #ifdef PSX_COSIM cosim_instr(0x80054788u); #endif @@ -771453,7 +773461,8 @@ label_BFC3C7B0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C7B8: 3042FFBF andi $v0, $v0, 0xFFBF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFBFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFBFu; + PGXP_ALU(0x3042FFBFu, cpu->gpr[2], _pgx1, 0xFFBFu); } #ifdef PSX_COSIM cosim_instr(0x800547B8u); #endif @@ -771461,7 +773470,8 @@ label_BFC3C7B0: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C7BC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800547BCu); #endif @@ -771538,7 +773548,8 @@ label_BFC3C7C8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C7D4: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800547D4u); #endif @@ -771600,7 +773611,8 @@ label_BFC3C7E0: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC3C7E8: 318D0040 andi $t5, $t4, 0x40 */ - cpu->gpr[13] = cpu->gpr[12] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x40u; + PGXP_ALU(0x318D0040u, cpu->gpr[13], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x800547E8u); #endif @@ -771757,7 +773769,8 @@ label_BFC3C808: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3C810: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054810u); #endif @@ -771765,7 +773778,8 @@ label_BFC3C808: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3C814: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054814u); #endif @@ -771927,7 +773941,8 @@ label_BFC3C83C: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3C850: 31F807FF andi $t8, $t7, 0x7FF */ - cpu->gpr[24] = cpu->gpr[15] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x7FFu; + PGXP_ALU(0x31F807FFu, cpu->gpr[24], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80054850u); #endif @@ -772027,7 +774042,8 @@ label_BFC3C864: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3C868: 28411389 slti $at, $v0, 5001 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (5001) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (5001) ? 1 : 0); + PGXP_ALU(0x28411389u, cpu->gpr[1], _pgx1, 0x1389u); } #ifdef PSX_COSIM cosim_instr(0x80054868u); #endif @@ -772205,7 +774221,8 @@ label_BFC3C894: psx_cyc_step(cpu, 0x2000200u); #endif /* 0xBFC3C89C: 332907FF andi $t1, $t9, 0x7FF */ - cpu->gpr[9] = cpu->gpr[25] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[9] = cpu->gpr[25] & 0x7FFu; + PGXP_ALU(0x332907FFu, cpu->gpr[9], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x8005489Cu); #endif @@ -772612,7 +774629,8 @@ label_BFC3C8F8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3C8FC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800548FCu); #endif @@ -772623,7 +774641,8 @@ label_BFC3C8F8: psx_cyc_step(cpu, 0x24u); #endif /* 0xBFC3C900: 3045FFFF andi $a1, $v0, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[5] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3045FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054900u); #endif @@ -772848,7 +774867,8 @@ label_BFC3C940: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC3C954: 318D07FF andi $t5, $t4, 0x7FF */ - cpu->gpr[13] = cpu->gpr[12] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0x7FFu; + PGXP_ALU(0x318D07FFu, cpu->gpr[13], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x80054954u); #endif @@ -772945,7 +774965,8 @@ label_BFC3C968: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3C96C: 28411389 slti $at, $v0, 5001 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (5001) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (5001) ? 1 : 0); + PGXP_ALU(0x28411389u, cpu->gpr[1], _pgx1, 0x1389u); } #ifdef PSX_COSIM cosim_instr(0x8005496Cu); #endif @@ -773123,7 +775144,8 @@ label_BFC3C998: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3C9A0: 31CF07FF andi $t7, $t6, 0x7FF */ - cpu->gpr[15] = cpu->gpr[14] & 0x7FFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x7FFu; + PGXP_ALU(0x31CF07FFu, cpu->gpr[15], _pgx1, 0x07FFu); } #ifdef PSX_COSIM cosim_instr(0x800549A0u); #endif @@ -773530,7 +775552,8 @@ label_BFC3C9FC: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3CA00: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054A00u); #endif @@ -773538,7 +775561,8 @@ label_BFC3C9FC: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC3CA04: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054A04u); #endif @@ -773865,7 +775889,8 @@ label_BFC3CA5C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CA64: 3042FFCF andi $v0, $v0, 0xFFCF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFCFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFCFu; + PGXP_ALU(0x3042FFCFu, cpu->gpr[2], _pgx1, 0xFFCFu); } #ifdef PSX_COSIM cosim_instr(0x80054A64u); #endif @@ -773873,7 +775898,8 @@ label_BFC3CA5C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CA68: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054A68u); #endif @@ -773970,7 +775996,8 @@ label_BFC3CA7C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CA84: 3042000E andi $v0, $v0, 0xE */ - cpu->gpr[2] = cpu->gpr[2] & 0xEu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xEu; + PGXP_ALU(0x3042000Eu, cpu->gpr[2], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x80054A84u); #endif @@ -773987,7 +776014,8 @@ label_BFC3CA7C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CA8C: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054A8Cu); #endif @@ -774053,7 +776081,8 @@ label_BFC3CA98: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CAA0: 30420001 andi $v0, $v0, 0x1 */ - cpu->gpr[2] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x30420001u, cpu->gpr[2], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80054AA0u); #endif @@ -774061,7 +776090,8 @@ label_BFC3CA98: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CAA4: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054AA4u); #endif @@ -774135,7 +776165,8 @@ label_BFC3CAB4: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3CABC: 31F8000E andi $t8, $t7, 0xE */ - cpu->gpr[24] = cpu->gpr[15] & 0xEu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xEu; + PGXP_ALU(0x31F8000Eu, cpu->gpr[24], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x80054ABCu); #endif @@ -774210,7 +776241,8 @@ label_BFC3CACC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CAD4: 3042FF7F andi $v0, $v0, 0xFF7F */ - cpu->gpr[2] = cpu->gpr[2] & 0xFF7Fu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFF7Fu; + PGXP_ALU(0x3042FF7Fu, cpu->gpr[2], _pgx1, 0xFF7Fu); } #ifdef PSX_COSIM cosim_instr(0x80054AD4u); #endif @@ -774218,7 +776250,8 @@ label_BFC3CACC: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC3CAD8: 312A0001 andi $t2, $t1, 0x1 */ - cpu->gpr[10] = cpu->gpr[9] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0x1u; + PGXP_ALU(0x312A0001u, cpu->gpr[10], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80054AD8u); #endif @@ -774226,7 +776259,8 @@ label_BFC3CACC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CADC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054ADCu); #endif @@ -774255,7 +776289,8 @@ label_BFC3CACC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CAE8: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054AE8u); #endif @@ -774320,7 +776355,8 @@ label_BFC3CAF4: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3CAFC: 304C0080 andi $t4, $v0, 0x80 */ - cpu->gpr[12] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x304C0080u, cpu->gpr[12], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80054AFCu); #endif @@ -774479,7 +776515,8 @@ label_BFC3CB1C: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3CB24: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054B24u); #endif @@ -774843,7 +776880,8 @@ label_BFC3CB78: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC3CB7C: 312AFFFF andi $t2, $t1, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x312AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054B7Cu); #endif @@ -774911,7 +776949,8 @@ label_BFC3CB88: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC3CB90: 316CFFFF andi $t4, $t3, 0xFFFF */ - cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316CFFFFu, cpu->gpr[12], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054B90u); #endif @@ -774977,7 +777016,8 @@ label_BFC3CB9C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CBA4: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054BA4u); #endif @@ -774985,7 +777025,8 @@ label_BFC3CB9C: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CBA8: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054BA8u); #endif @@ -775131,7 +777172,8 @@ label_BFC3CBC8: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3CBD0: 31F8FFFF andi $t8, $t7, 0xFFFF */ - cpu->gpr[24] = cpu->gpr[15] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xFFFFu; + PGXP_ALU(0x31F8FFFFu, cpu->gpr[24], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054BD0u); #endif @@ -775139,7 +777181,8 @@ label_BFC3CBC8: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3CBD4: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054BD4u); #endif @@ -775156,7 +777199,8 @@ label_BFC3CBC8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CBDC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054BDCu); #endif @@ -775200,7 +777244,8 @@ label_BFC3CBC8: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC3CBF0: 314B00FF andi $t3, $t2, 0xFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFu; + PGXP_ALU(0x314B00FFu, cpu->gpr[11], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80054BF0u); #endif @@ -775208,7 +777253,8 @@ label_BFC3CBC8: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC3CBF4: 316CFFFF andi $t4, $t3, 0xFFFF */ - cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0xFFFFu; + PGXP_ALU(0x316CFFFFu, cpu->gpr[12], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054BF4u); #endif @@ -775225,7 +777271,8 @@ label_BFC3CBC8: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CBFC: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054BFCu); #endif @@ -775291,7 +777338,8 @@ label_BFC3CC08: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC3CC10: 31AE00FF andi $t6, $t5, 0xFF */ - cpu->gpr[14] = cpu->gpr[13] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0xFFu; + PGXP_ALU(0x31AE00FFu, cpu->gpr[14], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80054C10u); #endif @@ -775308,7 +777356,8 @@ label_BFC3CC08: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3CC18: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054C18u); #endif @@ -775383,7 +777432,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC3CC30: 314BFFFF andi $t3, $t2, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054C30u); #endif @@ -775391,7 +777441,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x1801u); #endif /* 0xBFC3CC34: 01606027 nor $t4, $t3, $zero */ - cpu->gpr[12] = ~(cpu->gpr[11] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[12] = ~(cpu->gpr[11] | cpu->gpr[0]); + PGXP_ALU(0x01606027u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80054C34u); #endif @@ -775399,7 +777450,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC3CC38: 318DFFFF andi $t5, $t4, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[12] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0xFFFFu; + PGXP_ALU(0x318DFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054C38u); #endif @@ -775407,7 +777459,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x2004u); #endif /* 0xBFC3CC3C: 004D1024 and $v0, $v0, $t5 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[13]; + PGXP_ALU(0x004D1024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80054C3Cu); #endif @@ -775418,7 +777471,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CC40: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054C40u); #endif @@ -775459,7 +777513,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3CC54: 330F00FF andi $t7, $t8, 0xFF */ - cpu->gpr[15] = cpu->gpr[24] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[15] = cpu->gpr[24] & 0xFFu; + PGXP_ALU(0x330F00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80054C54u); #endif @@ -775467,7 +777522,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x2008001u); #endif /* 0xBFC3CC58: 01E0C827 nor $t9, $t7, $zero */ - cpu->gpr[25] = ~(cpu->gpr[15] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[25] = ~(cpu->gpr[15] | cpu->gpr[0]); + PGXP_ALU(0x01E0C827u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80054C58u); #endif @@ -775475,7 +777531,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x2000200u); #endif /* 0xBFC3CC5C: 3329FFFF andi $t1, $t9, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[25] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[9] = cpu->gpr[25] & 0xFFFFu; + PGXP_ALU(0x3329FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054C5Cu); #endif @@ -775486,7 +777543,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x204u); #endif /* 0xBFC3CC60: 00491024 and $v0, $v0, $t1 */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[9]; + PGXP_ALU(0x00491024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80054C60u); #endif @@ -775494,7 +777552,8 @@ label_BFC3CC28: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC3CC64: 3042FFFF andi $v0, $v0, 0xFFFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x3042FFFFu, cpu->gpr[2], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80054C64u); #endif @@ -775700,7 +777759,8 @@ label_BFC3CC90: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CC98: 2CA1002E sltiu $at, $a1, 46 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000002Eu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000002Eu ? 1 : 0); + PGXP_ALU(0x2CA1002Eu, cpu->gpr[1], _pgx1, 0x002Eu); } #ifdef PSX_COSIM cosim_instr(0x80054C98u); #endif @@ -775782,7 +777842,8 @@ label_BFC3CCA4: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CCA8: 2CA10023 sltiu $at, $a1, 35 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000023u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000023u ? 1 : 0); + PGXP_ALU(0x2CA10023u, cpu->gpr[1], _pgx1, 0x0023u); } #ifdef PSX_COSIM cosim_instr(0x80054CA8u); #endif @@ -775864,7 +777925,8 @@ label_BFC3CCB4: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CCB8: 2CA10011 sltiu $at, $a1, 17 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000011u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000011u ? 1 : 0); + PGXP_ALU(0x2CA10011u, cpu->gpr[1], _pgx1, 0x0011u); } #ifdef PSX_COSIM cosim_instr(0x80054CB8u); #endif @@ -775946,7 +778008,8 @@ label_BFC3CCC4: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CCC8: 2CA10002 sltiu $at, $a1, 2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000002u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000002u ? 1 : 0); + PGXP_ALU(0x2CA10002u, cpu->gpr[1], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80054CC8u); #endif @@ -776259,7 +778322,8 @@ label_BFC3CD04: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CD0C: 2CA10021 sltiu $at, $a1, 33 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000021u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000021u ? 1 : 0); + PGXP_ALU(0x2CA10021u, cpu->gpr[1], _pgx1, 0x0021u); } #ifdef PSX_COSIM cosim_instr(0x80054D0Cu); #endif @@ -776518,7 +778582,8 @@ label_BFC3CD3C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CD44: 2CA1002A sltiu $at, $a1, 42 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000002Au ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000002Au ? 1 : 0); + PGXP_ALU(0x2CA1002Au, cpu->gpr[1], _pgx1, 0x002Au); } #ifdef PSX_COSIM cosim_instr(0x80054D44u); #endif @@ -776597,7 +778662,8 @@ label_BFC3CD50: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CD54: 2CA10026 sltiu $at, $a1, 38 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000026u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000026u ? 1 : 0); + PGXP_ALU(0x2CA10026u, cpu->gpr[1], _pgx1, 0x0026u); } #ifdef PSX_COSIM cosim_instr(0x80054D54u); #endif @@ -776853,7 +778919,8 @@ label_BFC3CD84: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CD8C: 2CA1002C sltiu $at, $a1, 44 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000002Cu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000002Cu ? 1 : 0); + PGXP_ALU(0x2CA1002Cu, cpu->gpr[1], _pgx1, 0x002Cu); } #ifdef PSX_COSIM cosim_instr(0x80054D8Cu); #endif @@ -777112,7 +779179,8 @@ label_BFC3CDBC: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CDC4: 2CA10067 sltiu $at, $a1, 103 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000067u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000067u ? 1 : 0); + PGXP_ALU(0x2CA10067u, cpu->gpr[1], _pgx1, 0x0067u); } #ifdef PSX_COSIM cosim_instr(0x80054DC4u); #endif @@ -777191,7 +779259,8 @@ label_BFC3CDD0: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CDD4: 2CA10062 sltiu $at, $a1, 98 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000062u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000062u ? 1 : 0); + PGXP_ALU(0x2CA10062u, cpu->gpr[1], _pgx1, 0x0062u); } #ifdef PSX_COSIM cosim_instr(0x80054DD4u); #endif @@ -777270,7 +779339,8 @@ label_BFC3CDE0: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CDE4: 2CA10030 sltiu $at, $a1, 48 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000030u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000030u ? 1 : 0); + PGXP_ALU(0x2CA10030u, cpu->gpr[1], _pgx1, 0x0030u); } #ifdef PSX_COSIM cosim_instr(0x80054DE4u); #endif @@ -777526,7 +779596,8 @@ label_BFC3CE14: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CE1C: 2CA10064 sltiu $at, $a1, 100 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000064u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000064u ? 1 : 0); + PGXP_ALU(0x2CA10064u, cpu->gpr[1], _pgx1, 0x0064u); } #ifdef PSX_COSIM cosim_instr(0x80054E1Cu); #endif @@ -777785,7 +779856,8 @@ label_BFC3CE4C: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CE54: 2CA1006B sltiu $at, $a1, 107 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000006Bu ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x0000006Bu ? 1 : 0); + PGXP_ALU(0x2CA1006Bu, cpu->gpr[1], _pgx1, 0x006Bu); } #ifdef PSX_COSIM cosim_instr(0x80054E54u); #endif @@ -777864,7 +779936,8 @@ label_BFC3CE60: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CE64: 2CA10069 sltiu $at, $a1, 105 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000069u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000069u ? 1 : 0); + PGXP_ALU(0x2CA10069u, cpu->gpr[1], _pgx1, 0x0069u); } #ifdef PSX_COSIM cosim_instr(0x80054E64u); #endif @@ -778120,7 +780193,8 @@ label_BFC3CE94: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3CE9C: 2CA10102 sltiu $at, $a1, 258 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000102u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < 0x00000102u ? 1 : 0); + PGXP_ALU(0x2CA10102u, cpu->gpr[1], _pgx1, 0x0102u); } #ifdef PSX_COSIM cosim_instr(0x80054E9Cu); #endif @@ -778735,7 +780809,8 @@ label_BFC3CEEC: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC3CEEC: 304E0001 andi $t6, $v0, 0x1 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80054EECu); #endif @@ -778935,7 +781010,8 @@ label_BFC3CF24: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3CF24: 30580002 andi $t8, $v0, 0x2 */ - cpu->gpr[24] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30580002u, cpu->gpr[24], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80054F24u); #endif @@ -779057,7 +781133,8 @@ label_BFC3CF44: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC3CF44: 30480004 andi $t0, $v0, 0x4 */ - cpu->gpr[8] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30480004u, cpu->gpr[8], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80054F44u); #endif @@ -779179,7 +781256,8 @@ label_BFC3CF64: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC3CF64: 304A0008 andi $t2, $v0, 0x8 */ - cpu->gpr[10] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304A0008u, cpu->gpr[10], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80054F64u); #endif @@ -779301,7 +781379,8 @@ label_BFC3CF84: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3CF84: 304C0010 andi $t4, $v0, 0x10 */ - cpu->gpr[12] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304C0010u, cpu->gpr[12], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80054F84u); #endif @@ -779423,7 +781502,8 @@ label_BFC3CFA4: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC3CFA4: 304E0020 andi $t6, $v0, 0x20 */ - cpu->gpr[14] = cpu->gpr[2] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x20u; + PGXP_ALU(0x304E0020u, cpu->gpr[14], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80054FA4u); #endif @@ -779545,7 +781625,8 @@ label_BFC3CFC4: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3CFC4: 30580040 andi $t8, $v0, 0x40 */ - cpu->gpr[24] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x30580040u, cpu->gpr[24], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80054FC4u); #endif @@ -779667,7 +781748,8 @@ label_BFC3CFE4: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC3CFE4: 30480080 andi $t0, $v0, 0x80 */ - cpu->gpr[8] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x30480080u, cpu->gpr[8], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x80054FE4u); #endif @@ -779789,7 +781871,8 @@ label_BFC3D004: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC3D004: 304A0100 andi $t2, $v0, 0x100 */ - cpu->gpr[10] = cpu->gpr[2] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x100u; + PGXP_ALU(0x304A0100u, cpu->gpr[10], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x80055004u); #endif @@ -779911,7 +781994,8 @@ label_BFC3D024: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3D024: 304C0200 andi $t4, $v0, 0x200 */ - cpu->gpr[12] = cpu->gpr[2] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x200u; + PGXP_ALU(0x304C0200u, cpu->gpr[12], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0x80055024u); #endif @@ -780033,7 +782117,8 @@ label_BFC3D044: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC3D044: 304E0400 andi $t6, $v0, 0x400 */ - cpu->gpr[14] = cpu->gpr[2] & 0x400u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x400u; + PGXP_ALU(0x304E0400u, cpu->gpr[14], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x80055044u); #endif @@ -780155,7 +782240,8 @@ label_BFC3D064: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3D064: 30580800 andi $t8, $v0, 0x800 */ - cpu->gpr[24] = cpu->gpr[2] & 0x800u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x800u; + PGXP_ALU(0x30580800u, cpu->gpr[24], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0x80055064u); #endif @@ -780277,7 +782363,8 @@ label_BFC3D084: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC3D084: 30481000 andi $t0, $v0, 0x1000 */ - cpu->gpr[8] = cpu->gpr[2] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x1000u; + PGXP_ALU(0x30481000u, cpu->gpr[8], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80055084u); #endif @@ -780399,7 +782486,8 @@ label_BFC3D0A4: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC3D0A4: 304A2000 andi $t2, $v0, 0x2000 */ - cpu->gpr[10] = cpu->gpr[2] & 0x2000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x2000u; + PGXP_ALU(0x304A2000u, cpu->gpr[10], _pgx1, 0x2000u); } #ifdef PSX_COSIM cosim_instr(0x800550A4u); #endif @@ -780521,7 +782609,8 @@ label_BFC3D0C4: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3D0C4: 304C4000 andi $t4, $v0, 0x4000 */ - cpu->gpr[12] = cpu->gpr[2] & 0x4000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x4000u; + PGXP_ALU(0x304C4000u, cpu->gpr[12], _pgx1, 0x4000u); } #ifdef PSX_COSIM cosim_instr(0x800550C4u); #endif @@ -780643,7 +782732,8 @@ label_BFC3D0E4: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC3D0E4: 304E8000 andi $t6, $v0, 0x8000 */ - cpu->gpr[14] = cpu->gpr[2] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x8000u; + PGXP_ALU(0x304E8000u, cpu->gpr[14], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0x800550E4u); #endif @@ -780766,7 +782856,8 @@ label_BFC3D104: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC3D104: 0041C024 and $t8, $v0, $at */ - cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x0041C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055104u); #endif @@ -780889,7 +782980,8 @@ label_BFC3D124: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC3D124: 00414024 and $t0, $v0, $at */ - cpu->gpr[8] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00414024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055124u); #endif @@ -781012,7 +783104,8 @@ label_BFC3D144: psx_cyc_step(cpu, 0x406u); #endif /* 0xBFC3D144: 00415024 and $t2, $v0, $at */ - cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00415024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055144u); #endif @@ -781135,7 +783228,8 @@ label_BFC3D164: psx_cyc_step(cpu, 0x1006u); #endif /* 0xBFC3D164: 00416024 and $t4, $v0, $at */ - cpu->gpr[12] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00416024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055164u); #endif @@ -781258,7 +783352,8 @@ label_BFC3D184: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC3D184: 00417024 and $t6, $v0, $at */ - cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00417024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055184u); #endif @@ -781381,7 +783476,8 @@ label_BFC3D1A4: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC3D1A4: 0041C024 and $t8, $v0, $at */ - cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x0041C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800551A4u); #endif @@ -781504,7 +783600,8 @@ label_BFC3D1C4: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC3D1C4: 00414024 and $t0, $v0, $at */ - cpu->gpr[8] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00414024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800551C4u); #endif @@ -781627,7 +783724,8 @@ label_BFC3D1E4: psx_cyc_step(cpu, 0x406u); #endif /* 0xBFC3D1E4: 00415024 and $t2, $v0, $at */ - cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00415024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800551E4u); #endif @@ -781750,7 +783848,8 @@ label_BFC3D204: psx_cyc_step(cpu, 0x1006u); #endif /* 0xBFC3D204: 00416024 and $t4, $v0, $at */ - cpu->gpr[12] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00416024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055204u); #endif @@ -781873,7 +783972,8 @@ label_BFC3D224: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC3D224: 00417024 and $t6, $v0, $at */ - cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00417024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055224u); #endif @@ -781996,7 +784096,8 @@ label_BFC3D244: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC3D244: 0041C024 and $t8, $v0, $at */ - cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x0041C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055244u); #endif @@ -782119,7 +784220,8 @@ label_BFC3D264: psx_cyc_step(cpu, 0x106u); #endif /* 0xBFC3D264: 00414024 and $t0, $v0, $at */ - cpu->gpr[8] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00414024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055264u); #endif @@ -782242,7 +784344,8 @@ label_BFC3D284: psx_cyc_step(cpu, 0x406u); #endif /* 0xBFC3D284: 00415024 and $t2, $v0, $at */ - cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[10] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00415024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055284u); #endif @@ -782365,7 +784468,8 @@ label_BFC3D2A4: psx_cyc_step(cpu, 0x1006u); #endif /* 0xBFC3D2A4: 00416024 and $t4, $v0, $at */ - cpu->gpr[12] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00416024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800552A4u); #endif @@ -782488,7 +784592,8 @@ label_BFC3D2C4: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC3D2C4: 00417024 and $t6, $v0, $at */ - cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00417024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800552C4u); #endif @@ -782611,7 +784716,8 @@ label_BFC3D2E4: psx_cyc_step(cpu, 0x1000006u); #endif /* 0xBFC3D2E4: 0041C024 and $t8, $v0, $at */ - cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x0041C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800552E4u); #endif @@ -783043,7 +785149,8 @@ label_BFC3D328: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC3D328: 304E0001 andi $t6, $v0, 0x1 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1u; + PGXP_ALU(0x304E0001u, cpu->gpr[14], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80055328u); #endif @@ -783240,7 +785347,8 @@ label_BFC3D360: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3D360: 30580002 andi $t8, $v0, 0x2 */ - cpu->gpr[24] = cpu->gpr[2] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x2u; + PGXP_ALU(0x30580002u, cpu->gpr[24], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80055360u); #endif @@ -783362,7 +785470,8 @@ label_BFC3D380: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC3D380: 30480004 andi $t0, $v0, 0x4 */ - cpu->gpr[8] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30480004u, cpu->gpr[8], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80055380u); #endif @@ -783484,7 +785593,8 @@ label_BFC3D3A0: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC3D3A0: 304A0008 andi $t2, $v0, 0x8 */ - cpu->gpr[10] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304A0008u, cpu->gpr[10], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x800553A0u); #endif @@ -783606,7 +785716,8 @@ label_BFC3D3C0: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3D3C0: 304C0010 andi $t4, $v0, 0x10 */ - cpu->gpr[12] = cpu->gpr[2] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x10u; + PGXP_ALU(0x304C0010u, cpu->gpr[12], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x800553C0u); #endif @@ -783728,7 +785839,8 @@ label_BFC3D3E0: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC3D3E0: 304E0020 andi $t6, $v0, 0x20 */ - cpu->gpr[14] = cpu->gpr[2] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x20u; + PGXP_ALU(0x304E0020u, cpu->gpr[14], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x800553E0u); #endif @@ -783850,7 +785962,8 @@ label_BFC3D400: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3D400: 30580100 andi $t8, $v0, 0x100 */ - cpu->gpr[24] = cpu->gpr[2] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x100u; + PGXP_ALU(0x30580100u, cpu->gpr[24], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x80055400u); #endif @@ -783970,7 +786083,8 @@ label_BFC3D41C: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3D424: 3109FFFB andi $t1, $t0, 0xFFFB */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFBu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFBu; + PGXP_ALU(0x3109FFFBu, cpu->gpr[9], _pgx1, 0xFFFBu); } #ifdef PSX_COSIM cosim_instr(0x80055424u); #endif @@ -784099,7 +786213,8 @@ label_BFC3D448: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3D448: 304C0400 andi $t4, $v0, 0x400 */ - cpu->gpr[12] = cpu->gpr[2] & 0x400u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x400u; + PGXP_ALU(0x304C0400u, cpu->gpr[12], _pgx1, 0x0400u); } #ifdef PSX_COSIM cosim_instr(0x80055448u); #endif @@ -784219,7 +786334,8 @@ label_BFC3D464: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3D46C: 31CFFFFE andi $t7, $t6, 0xFFFE */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFEu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFEu; + PGXP_ALU(0x31CFFFFEu, cpu->gpr[15], _pgx1, 0xFFFEu); } #ifdef PSX_COSIM cosim_instr(0x8005546Cu); #endif @@ -784354,7 +786470,8 @@ label_BFC3D490: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC3D490: 30480040 andi $t0, $v0, 0x40 */ - cpu->gpr[8] = cpu->gpr[2] & 0x40u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x40u; + PGXP_ALU(0x30480040u, cpu->gpr[8], _pgx1, 0x0040u); } #ifdef PSX_COSIM cosim_instr(0x80055490u); #endif @@ -784476,7 +786593,8 @@ label_BFC3D4B0: psx_cyc_step(cpu, 0x404u); #endif /* 0xBFC3D4B0: 304A0080 andi $t2, $v0, 0x80 */ - cpu->gpr[10] = cpu->gpr[2] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[10] = cpu->gpr[2] & 0x80u; + PGXP_ALU(0x304A0080u, cpu->gpr[10], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x800554B0u); #endif @@ -784598,7 +786716,8 @@ label_BFC3D4D0: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3D4D0: 304C0200 andi $t4, $v0, 0x200 */ - cpu->gpr[12] = cpu->gpr[2] & 0x200u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x200u; + PGXP_ALU(0x304C0200u, cpu->gpr[12], _pgx1, 0x0200u); } #ifdef PSX_COSIM cosim_instr(0x800554D0u); #endif @@ -784718,7 +786837,8 @@ label_BFC3D4EC: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3D4F4: 31CFFFF7 andi $t7, $t6, 0xFFF7 */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFF7u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFF7u; + PGXP_ALU(0x31CFFFF7u, cpu->gpr[15], _pgx1, 0xFFF7u); } #ifdef PSX_COSIM cosim_instr(0x800554F4u); #endif @@ -784847,7 +786967,8 @@ label_BFC3D518: psx_cyc_step(cpu, 0x104u); #endif /* 0xBFC3D518: 30480800 andi $t0, $v0, 0x800 */ - cpu->gpr[8] = cpu->gpr[2] & 0x800u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[8] = cpu->gpr[2] & 0x800u; + PGXP_ALU(0x30480800u, cpu->gpr[8], _pgx1, 0x0800u); } #ifdef PSX_COSIM cosim_instr(0x80055518u); #endif @@ -784967,7 +787088,8 @@ label_BFC3D534: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC3D53C: 314BFFFD andi $t3, $t2, 0xFFFD */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFFDu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFFDu; + PGXP_ALU(0x314BFFFDu, cpu->gpr[11], _pgx1, 0xFFFDu); } #ifdef PSX_COSIM cosim_instr(0x8005553Cu); #endif @@ -785102,7 +787224,8 @@ label_BFC3D560: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC3D560: 304E1000 andi $t6, $v0, 0x1000 */ - cpu->gpr[14] = cpu->gpr[2] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0x1000u; + PGXP_ALU(0x304E1000u, cpu->gpr[14], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80055560u); #endif @@ -785166,7 +787289,8 @@ label_BFC3D56C: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC3D574: 31F8C0FF andi $t8, $t7, 0xC0FF */ - cpu->gpr[24] = cpu->gpr[15] & 0xC0FFu; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0xC0FFu; + PGXP_ALU(0x31F8C0FFu, cpu->gpr[24], _pgx1, 0xC0FFu); } #ifdef PSX_COSIM cosim_instr(0x80055574u); #endif @@ -785198,7 +787322,8 @@ label_BFC3D56C: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3D584: 3109003F andi $t1, $t0, 0x3F */ - cpu->gpr[9] = cpu->gpr[8] & 0x3Fu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x3Fu; + PGXP_ALU(0x3109003Fu, cpu->gpr[9], _pgx1, 0x003Fu); } #ifdef PSX_COSIM cosim_instr(0x80055584u); #endif @@ -785215,7 +787340,8 @@ label_BFC3D56C: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC3D58C: 314BFFFF andi $t3, $t2, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005558Cu); #endif @@ -785293,7 +787419,8 @@ label_BFC3D5A0: psx_cyc_step(cpu, 0x2004u); #endif /* 0xBFC3D5A0: 304D2000 andi $t5, $v0, 0x2000 */ - cpu->gpr[13] = cpu->gpr[2] & 0x2000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[13] = cpu->gpr[2] & 0x2000u; + PGXP_ALU(0x304D2000u, cpu->gpr[13], _pgx1, 0x2000u); } #ifdef PSX_COSIM cosim_instr(0x800555A0u); #endif @@ -785357,7 +787484,8 @@ label_BFC3D5AC: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3D5B4: 31CFFF7F andi $t7, $t6, 0xFF7F */ - cpu->gpr[15] = cpu->gpr[14] & 0xFF7Fu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFF7Fu; + PGXP_ALU(0x31CFFF7Fu, cpu->gpr[15], _pgx1, 0xFF7Fu); } #ifdef PSX_COSIM cosim_instr(0x800555B4u); #endif @@ -785389,7 +787517,8 @@ label_BFC3D5AC: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3D5C4: 31090001 andi $t1, $t0, 0x1 */ - cpu->gpr[9] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31090001u, cpu->gpr[9], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800555C4u); #endif @@ -785406,7 +787535,8 @@ label_BFC3D5AC: psx_cyc_step(cpu, 0x2000400u); #endif /* 0xBFC3D5CC: 3159FFFF andi $t9, $t2, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[25] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x3159FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800555CCu); #endif @@ -785484,7 +787614,8 @@ label_BFC3D5E0: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC3D5E0: 304C4000 andi $t4, $v0, 0x4000 */ - cpu->gpr[12] = cpu->gpr[2] & 0x4000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x4000u; + PGXP_ALU(0x304C4000u, cpu->gpr[12], _pgx1, 0x4000u); } #ifdef PSX_COSIM cosim_instr(0x800555E0u); #endif @@ -785548,7 +787679,8 @@ label_BFC3D5EC: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC3D5F4: 31AEFFF1 andi $t6, $t5, 0xFFF1 */ - cpu->gpr[14] = cpu->gpr[13] & 0xFFF1u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0xFFF1u; + PGXP_ALU(0x31AEFFF1u, cpu->gpr[14], _pgx1, 0xFFF1u); } #ifdef PSX_COSIM cosim_instr(0x800555F4u); #endif @@ -785580,7 +787712,8 @@ label_BFC3D5EC: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3D604: 31090007 andi $t1, $t0, 0x7 */ - cpu->gpr[9] = cpu->gpr[8] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x7u; + PGXP_ALU(0x31090007u, cpu->gpr[9], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x80055604u); #endif @@ -785597,7 +787730,8 @@ label_BFC3D5EC: psx_cyc_step(cpu, 0x1000400u); #endif /* 0xBFC3D60C: 3158FFFF andi $t8, $t2, 0xFFFF */ - cpu->gpr[24] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[24] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x3158FFFFu, cpu->gpr[24], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005560Cu); #endif @@ -785675,7 +787809,8 @@ label_BFC3D620: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC3D620: 304B8000 andi $t3, $v0, 0x8000 */ - cpu->gpr[11] = cpu->gpr[2] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x8000u; + PGXP_ALU(0x304B8000u, cpu->gpr[11], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0x80055620u); #endif @@ -785739,7 +787874,8 @@ label_BFC3D62C: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC3D634: 318DFFFE andi $t5, $t4, 0xFFFE */ - cpu->gpr[13] = cpu->gpr[12] & 0xFFFEu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0xFFFEu; + PGXP_ALU(0x318DFFFEu, cpu->gpr[13], _pgx1, 0xFFFEu); } #ifdef PSX_COSIM cosim_instr(0x80055634u); #endif @@ -785771,7 +787907,8 @@ label_BFC3D62C: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3D644: 31090001 andi $t1, $t0, 0x1 */ - cpu->gpr[9] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31090001u, cpu->gpr[9], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80055644u); #endif @@ -785779,7 +787916,8 @@ label_BFC3D62C: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC3D648: 312AFFFF andi $t2, $t1, 0xFFFF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFFFFu; + PGXP_ALU(0x312AFFFFu, cpu->gpr[10], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80055648u); #endif @@ -785951,7 +788089,8 @@ label_BFC3D65C: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3D670: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80055670u); #endif @@ -785985,7 +788124,8 @@ label_BFC3D65C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3D680: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80055680u); #endif @@ -786019,7 +788159,8 @@ label_BFC3D65C: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3D690: 3109FFFF andi $t1, $t0, 0xFFFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFFFu; + PGXP_ALU(0x3109FFFFu, cpu->gpr[9], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80055690u); #endif @@ -786053,7 +788194,8 @@ label_BFC3D65C: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC3D6A0: 314BFFFF andi $t3, $t2, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800556A0u); #endif @@ -786087,7 +788229,8 @@ label_BFC3D65C: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC3D6B0: 318DFFFF andi $t5, $t4, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[12] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0xFFFFu; + PGXP_ALU(0x318DFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800556B0u); #endif @@ -786121,7 +788264,8 @@ label_BFC3D65C: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3D6C0: 31CFFFFF andi $t7, $t6, 0xFFFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFFFu; + PGXP_ALU(0x31CFFFFFu, cpu->gpr[15], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800556C0u); #endif @@ -786155,7 +788299,8 @@ label_BFC3D65C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3D6D0: 33190004 andi $t9, $t8, 0x4 */ - cpu->gpr[25] = cpu->gpr[24] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x4u; + PGXP_ALU(0x33190004u, cpu->gpr[25], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x800556D0u); #endif @@ -786296,7 +788441,8 @@ label_BFC3D6F0: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3D6F8: 31090001 andi $t1, $t0, 0x1 */ - cpu->gpr[9] = cpu->gpr[8] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x1u; + PGXP_ALU(0x31090001u, cpu->gpr[9], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800556F8u); #endif @@ -786419,7 +788565,8 @@ label_BFC3D710: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC3D718: 314BFFFF andi $t3, $t2, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80055718u); #endif @@ -786453,7 +788600,8 @@ label_BFC3D710: psx_cyc_step(cpu, 0x3000u); #endif /* 0xBFC3D728: 318DFFFF andi $t5, $t4, 0xFFFF */ - cpu->gpr[13] = cpu->gpr[12] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[12] & 0xFFFFu; + PGXP_ALU(0x318DFFFFu, cpu->gpr[13], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80055728u); #endif @@ -786487,7 +788635,8 @@ label_BFC3D710: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3D738: 31CF0008 andi $t7, $t6, 0x8 */ - cpu->gpr[15] = cpu->gpr[14] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x8u; + PGXP_ALU(0x31CF0008u, cpu->gpr[15], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80055738u); #endif @@ -786610,7 +788759,8 @@ label_BFC3D750: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3D758: 33190002 andi $t9, $t8, 0x2 */ - cpu->gpr[25] = cpu->gpr[24] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x2u; + PGXP_ALU(0x33190002u, cpu->gpr[25], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80055758u); #endif @@ -786733,7 +788883,8 @@ label_BFC3D770: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3D778: 31093F00 andi $t1, $t0, 0x3F00 */ - cpu->gpr[9] = cpu->gpr[8] & 0x3F00u; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0x3F00u; + PGXP_ALU(0x31093F00u, cpu->gpr[9], _pgx1, 0x3F00u); } #ifdef PSX_COSIM cosim_instr(0x80055778u); #endif @@ -786776,7 +788927,8 @@ label_BFC3D770: psx_cyc_step(cpu, 0x1800u); #endif /* 0xBFC3D78C: 316C0080 andi $t4, $t3, 0x80 */ - cpu->gpr[12] = cpu->gpr[11] & 0x80u; + { uint32_t _pgx1 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[11] & 0x80u; + PGXP_ALU(0x316C0080u, cpu->gpr[12], _pgx1, 0x0080u); } #ifdef PSX_COSIM cosim_instr(0x8005578Cu); #endif @@ -786914,7 +789066,8 @@ label_BFC3D7A8: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3D7B0: 31CF000E andi $t7, $t6, 0xE */ - cpu->gpr[15] = cpu->gpr[14] & 0xEu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xEu; + PGXP_ALU(0x31CF000Eu, cpu->gpr[15], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x800557B0u); #endif @@ -786957,7 +789110,8 @@ label_BFC3D7A8: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC3D7C4: 33280001 andi $t0, $t9, 0x1 */ - cpu->gpr[8] = cpu->gpr[25] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x1u; + PGXP_ALU(0x33280001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x800557C4u); #endif @@ -787084,7 +789238,8 @@ label_BFC3D7E0: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC3D7E8: 314BFFFF andi $t3, $t2, 0xFFFF */ - cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0xFFFFu; + PGXP_ALU(0x314BFFFFu, cpu->gpr[11], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800557E8u); #endif @@ -787104,7 +789259,8 @@ label_BFC3D7E0: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC3D7F0: 31AEFFFF andi $t6, $t5, 0xFFFF */ - cpu->gpr[14] = cpu->gpr[13] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0xFFFFu; + PGXP_ALU(0x31AEFFFFu, cpu->gpr[14], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x800557F0u); #endif @@ -787148,7 +789304,8 @@ label_BFC3D7E0: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3D804: 3319FFFF andi $t9, $t8, 0xFFFF */ - cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0xFFFFu; + PGXP_ALU(0x3319FFFFu, cpu->gpr[25], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80055804u); #endif @@ -787299,7 +789456,8 @@ label_BFC3D828: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC3D830: 31CF0001 andi $t7, $t6, 0x1 */ - cpu->gpr[15] = cpu->gpr[14] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x1u; + PGXP_ALU(0x31CF0001u, cpu->gpr[15], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80055830u); #endif @@ -788102,7 +790260,8 @@ label_BFC3D8E8: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC3D908: 3063000E andi $v1, $v1, 0xE */ - cpu->gpr[3] = cpu->gpr[3] & 0xEu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xEu; + PGXP_ALU(0x3063000Eu, cpu->gpr[3], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x80055908u); #endif @@ -788493,7 +790652,8 @@ label_BFC3D98C: psx_cyc_step(cpu, 0x3000000u); #endif /* 0xBFC3D994: 33190001 andi $t9, $t8, 0x1 */ - cpu->gpr[25] = cpu->gpr[24] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[25] = cpu->gpr[24] & 0x1u; + PGXP_ALU(0x33190001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80055994u); #endif @@ -788583,7 +790743,8 @@ label_BFC3D9A4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3D9B0: 2841000A slti $at, $v0, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (10) ? 1 : 0); + PGXP_ALU(0x2841000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x800559B0u); #endif @@ -789771,7 +791932,8 @@ label_BFC3DB20: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC3DB28: 314B0008 andi $t3, $t2, 0x8 */ - cpu->gpr[11] = cpu->gpr[10] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x8u; + PGXP_ALU(0x314B0008u, cpu->gpr[11], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80055B28u); #endif @@ -790617,7 +792779,8 @@ label_BFC3DC38: psx_cyc_step(cpu, 0xA00u); #endif /* 0xBFC3DC40: 312B0010 andi $t3, $t1, 0x10 */ - cpu->gpr[11] = cpu->gpr[9] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[11] = cpu->gpr[9] & 0x10u; + PGXP_ALU(0x312B0010u, cpu->gpr[11], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80055C40u); #endif @@ -791723,7 +793886,8 @@ label_BFC3DD8C: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC3DD94: 31AE0002 andi $t6, $t5, 0x2 */ - cpu->gpr[14] = cpu->gpr[13] & 0x2u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x2u; + PGXP_ALU(0x31AE0002u, cpu->gpr[14], _pgx1, 0x0002u); } #ifdef PSX_COSIM cosim_instr(0x80055D94u); #endif @@ -791913,7 +794077,8 @@ label_BFC3DDD0: psx_cyc_step(cpu, 0xA00u); #endif /* 0xBFC3DDD8: 312B0004 andi $t3, $t1, 0x4 */ - cpu->gpr[11] = cpu->gpr[9] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[11] = cpu->gpr[9] & 0x4u; + PGXP_ALU(0x312B0004u, cpu->gpr[11], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80055DD8u); #endif @@ -792260,7 +794425,8 @@ label_BFC3DED0: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3DEDC: 00A1082B sltu $at, $a1, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x00A1082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055EDCu); #endif @@ -792941,7 +795107,8 @@ label_BFC3DF90: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC3DF9C: 0081082B sltu $at, $a0, $at */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[1] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[1] ? 1 : 0); + PGXP_ALU(0x0081082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055F9Cu); #endif @@ -793032,7 +795199,8 @@ label_BFC3DFB0: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC3DFB0: 2C811000 sltiu $at, $a0, 4096 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00001000u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < 0x00001000u ? 1 : 0); + PGXP_ALU(0x2C811000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80055FB0u); #endif @@ -793047,7 +795215,8 @@ label_BFC3DFB0: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC3DFB8: 308E0007 andi $t6, $a0, 0x7 */ - cpu->gpr[14] = cpu->gpr[4] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0x7u; + PGXP_ALU(0x308E0007u, cpu->gpr[14], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x80055FB8u); #endif @@ -793122,7 +795291,8 @@ label_BFC3DFC4: psx_cyc_step(cpu, 0x4010u); #endif /* 0xBFC3DFC4: 308E0007 andi $t6, $a0, 0x7 */ - cpu->gpr[14] = cpu->gpr[4] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[4] & 0x7u; + PGXP_ALU(0x308E0007u, cpu->gpr[14], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x80055FC4u); #endif @@ -793240,7 +795410,8 @@ label_BFC3DFD8: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC3DFE0: 00812024 and $a0, $a0, $at */ - cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[4] = cpu->gpr[4] & cpu->gpr[1]; + PGXP_ALU(0x00812024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80055FE0u); #endif @@ -794720,7 +796891,8 @@ label_BFC3E164: psx_cyc_step(cpu, 0x4840u); #endif /* 0xBFC3E16C: 00CB7024 and $t6, $a2, $t3 */ - cpu->gpr[14] = cpu->gpr[6] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[14] = cpu->gpr[6] & cpu->gpr[11]; + PGXP_ALU(0x00CB7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005616Cu); #endif @@ -794834,7 +797006,8 @@ label_BFC3E184: psx_cyc_step(cpu, 0x1000C00u); #endif /* 0xBFC3E190: 014BC024 and $t8, $t2, $t3 */ - cpu->gpr[24] = cpu->gpr[10] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[24] = cpu->gpr[10] & cpu->gpr[11]; + PGXP_ALU(0x014BC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056190u); #endif @@ -794906,7 +797079,8 @@ label_BFC3E19C: psx_cyc_step(cpu, 0x1000C00u); #endif /* 0xBFC3E19C: 014BC024 and $t8, $t2, $t3 */ - cpu->gpr[24] = cpu->gpr[10] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[24] = cpu->gpr[10] & cpu->gpr[11]; + PGXP_ALU(0x014BC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005619Cu); #endif @@ -794969,7 +797143,8 @@ label_BFC3E1A8: psx_cyc_step(cpu, 0x2002040u); #endif /* 0xBFC3E1AC: 00CDC824 and $t9, $a2, $t5 */ - cpu->gpr[25] = cpu->gpr[6] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[25] = cpu->gpr[6] & cpu->gpr[13]; + PGXP_ALU(0x00CDC824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800561ACu); #endif @@ -794980,7 +797155,8 @@ label_BFC3E1A8: psx_cyc_step(cpu, 0x1002400u); #endif /* 0xBFC3E1B0: 014DC024 and $t8, $t2, $t5 */ - cpu->gpr[24] = cpu->gpr[10] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[24] = cpu->gpr[10] & cpu->gpr[13]; + PGXP_ALU(0x014DC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800561B0u); #endif @@ -795148,7 +797324,8 @@ label_BFC3E1E4: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC3E1E4: 0043082A slt $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800561E4u); #endif @@ -795352,7 +797529,8 @@ label_BFC3E20C: psx_cyc_step(cpu, 0x3010000u); #endif /* 0xBFC3E214: 0310C824 and $t9, $t8, $s0 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[16]; + PGXP_ALU(0x0310C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056214u); #endif @@ -795459,7 +797637,8 @@ label_BFC3E22C: psx_cyc_step(cpu, 0x4006u); #endif /* 0xBFC3E22C: 004E082A slt $at, $v0, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x004E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005622Cu); #endif @@ -795564,7 +797743,8 @@ label_BFC3E244: psx_cyc_step(cpu, 0x1010400u); #endif /* 0xBFC3E24C: 0150C024 and $t8, $t2, $s0 */ - cpu->gpr[24] = cpu->gpr[10] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[24] = cpu->gpr[10] & cpu->gpr[16]; + PGXP_ALU(0x0150C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005624Cu); #endif @@ -795621,7 +797801,8 @@ label_BFC3E258: psx_cyc_step(cpu, 0x2002400u); #endif /* 0xBFC3E25C: 014DC824 and $t9, $t2, $t5 */ - cpu->gpr[25] = cpu->gpr[10] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[25] = cpu->gpr[10] & cpu->gpr[13]; + PGXP_ALU(0x014DC824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005625Cu); #endif @@ -795632,7 +797813,8 @@ label_BFC3E258: psx_cyc_step(cpu, 0x6040u); #endif /* 0xBFC3E260: 00CD7024 and $t6, $a2, $t5 */ - cpu->gpr[14] = cpu->gpr[6] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[6] & cpu->gpr[13]; + PGXP_ALU(0x00CD7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056260u); #endif @@ -795640,7 +797822,8 @@ label_BFC3E258: psx_cyc_step(cpu, 0x2004002u); #endif /* 0xBFC3E264: 032E082B sltu $at, $t9, $t6 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[25] < cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)(cpu->gpr[25] < cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x032E082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056264u); #endif @@ -795769,7 +797952,8 @@ label_BFC3E28C: psx_cyc_step(cpu, 0x8Au); #endif /* 0xBFC3E290: 00E3082A slt $at, $a3, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x00E3082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056290u); #endif @@ -795836,7 +798020,8 @@ label_BFC3E2A0: psx_cyc_step(cpu, 0xEu); #endif /* 0xBFC3E2A0: 0043082A slt $at, $v0, $v1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[3]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (int32_t)cpu->gpr[3] ? 1 : 0); + PGXP_ALU(0x0043082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800562A0u); #endif @@ -795978,7 +798163,8 @@ label_BFC3E2BC: psx_cyc_step(cpu, 0x1010040u); #endif /* 0xBFC3E2C4: 00D0C024 and $t8, $a2, $s0 */ - cpu->gpr[24] = cpu->gpr[6] & cpu->gpr[16]; + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[16]; cpu->gpr[24] = cpu->gpr[6] & cpu->gpr[16]; + PGXP_ALU(0x00D0C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800562C4u); #endif @@ -796466,7 +798652,8 @@ label_BFC3E32C: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC3E35C: 3063000E andi $v1, $v1, 0xE */ - cpu->gpr[3] = cpu->gpr[3] & 0xEu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xEu; + PGXP_ALU(0x3063000Eu, cpu->gpr[3], _pgx1, 0x000Eu); } #ifdef PSX_COSIM cosim_instr(0x8005635Cu); #endif @@ -796997,7 +799184,8 @@ label_BFC3E3F0: psx_cyc_step(cpu, 0x2000005u); #endif /* 0xBFC3E3F4: 0040C827 nor $t9, $v0, $zero */ - cpu->gpr[25] = ~(cpu->gpr[2] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[25] = ~(cpu->gpr[2] | cpu->gpr[0]); + PGXP_ALU(0x0040C827u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800563F4u); #endif @@ -797005,7 +799193,8 @@ label_BFC3E3F0: psx_cyc_step(cpu, 0x2008100u); #endif /* 0xBFC3E3F8: 01197824 and $t7, $t0, $t9 */ - cpu->gpr[15] = cpu->gpr[8] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[15] = cpu->gpr[8] & cpu->gpr[25]; + PGXP_ALU(0x01197824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800563F8u); #endif @@ -797166,7 +799355,8 @@ label_BFC3E410: psx_cyc_step(cpu, 0x1004040u); #endif /* 0xBFC3E428: 01C6C024 and $t8, $t6, $a2 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[6]; + PGXP_ALU(0x01C6C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056428u); #endif @@ -797554,7 +799744,8 @@ label_BFC3E49C: psx_cyc_step(cpu, 0x8044u); #endif /* 0xBFC3E4A4: 00467824 and $t7, $v0, $a2 */ - cpu->gpr[15] = cpu->gpr[2] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[2] & cpu->gpr[6]; + PGXP_ALU(0x00467824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800564A4u); #endif @@ -797601,7 +799792,8 @@ label_BFC3E4B0: psx_cyc_step(cpu, 0x4014u); #endif /* 0xBFC3E4B0: 00447024 and $t6, $v0, $a0 */ - cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[4]; + PGXP_ALU(0x00447024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800564B0u); #endif @@ -797665,7 +799857,8 @@ label_BFC3E4BC: psx_cyc_step(cpu, 0x1000102u); #endif /* 0xBFC3E4C4: 0308082B sltu $at, $t8, $t0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0308082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800564C4u); #endif @@ -797801,7 +799994,8 @@ label_BFC3E4E0: psx_cyc_step(cpu, 0x422u); #endif /* 0xBFC3E4E4: 00AA082A slt $at, $a1, $t2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (int32_t)cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x00AA082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800564E4u); #endif @@ -797996,7 +800190,8 @@ label_BFC3E508: psx_cyc_step(cpu, 0x8240u); #endif /* 0xBFC3E514: 01267824 and $t7, $t1, $a2 */ - cpu->gpr[15] = cpu->gpr[9] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[9] & cpu->gpr[6]; + PGXP_ALU(0x01267824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056514u); #endif @@ -798011,7 +800206,8 @@ label_BFC3E508: psx_cyc_step(cpu, 0xC02u); #endif /* 0xBFC3E51C: 016A082A slt $at, $t3, $t2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (int32_t)cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[11] < (int32_t)cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x016A082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005651Cu); #endif @@ -798108,7 +800304,8 @@ label_BFC3E528: psx_cyc_step(cpu, 0x1000102u); #endif /* 0xBFC3E534: 0308082B sltu $at, $t8, $t0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[8] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)(cpu->gpr[24] < cpu->gpr[8] ? 1 : 0); + PGXP_ALU(0x0308082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056534u); #endif @@ -798182,7 +800379,8 @@ label_BFC3E540: psx_cyc_step(cpu, 0x8210u); #endif /* 0xBFC3E54C: 01247824 and $t7, $t1, $a0 */ - cpu->gpr[15] = cpu->gpr[9] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[15] = cpu->gpr[9] & cpu->gpr[4]; + PGXP_ALU(0x01247824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005654Cu); #endif @@ -798292,7 +800490,8 @@ label_BFC3E540: psx_cyc_step(cpu, 0x1004010u); #endif /* 0xBFC3E57C: 01C4C024 and $t8, $t6, $a0 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[4]; + PGXP_ALU(0x01C4C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005657Cu); #endif @@ -798452,7 +800651,8 @@ label_BFC3E5A0: psx_cyc_step(cpu, 0x142u); #endif /* 0xBFC3E5A8: 0106082B sltu $at, $t0, $a2 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)(cpu->gpr[8] < cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x0106082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800565A8u); #endif @@ -798529,7 +800729,8 @@ label_BFC3E5B4: psx_cyc_step(cpu, 0x482u); #endif /* 0xBFC3E5C0: 00EA082A slt $at, $a3, $t2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[10] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[7] < (int32_t)cpu->gpr[10] ? 1 : 0); + PGXP_ALU(0x00EA082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800565C0u); #endif @@ -798752,7 +800953,8 @@ label_BFC3E610: psx_cyc_step(cpu, 0x2000210u); #endif /* 0xBFC3E614: 0124C824 and $t9, $t1, $a0 */ - cpu->gpr[25] = cpu->gpr[9] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[9] & cpu->gpr[4]; + PGXP_ALU(0x0124C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056614u); #endif @@ -799229,7 +801431,8 @@ label_BFC3E694: psx_cyc_step(cpu, 0x100Au); #endif /* 0xBFC3E698: 00616024 and $t4, $v1, $at */ - cpu->gpr[12] = cpu->gpr[3] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[12] = cpu->gpr[3] & cpu->gpr[1]; + PGXP_ALU(0x00616024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056698u); #endif @@ -799289,7 +801492,8 @@ label_BFC3E6A4: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC3E6A8: 00612024 and $a0, $v1, $at */ - cpu->gpr[4] = cpu->gpr[3] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[4] = cpu->gpr[3] & cpu->gpr[1]; + PGXP_ALU(0x00612024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800566A8u); #endif @@ -799394,7 +801598,8 @@ label_BFC3E6C4: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC3E6CC: 00612024 and $a0, $v1, $at */ - cpu->gpr[4] = cpu->gpr[3] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[4] = cpu->gpr[3] & cpu->gpr[1]; + PGXP_ALU(0x00612024u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800566CCu); #endif @@ -799459,7 +801664,8 @@ label_BFC3E6E4: psx_cyc_step(cpu, 0x2042u); #endif /* 0xBFC3E6E4: 01A6082A slt $at, $t5, $a2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x01A6082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800566E4u); #endif @@ -799666,7 +801872,8 @@ label_BFC3E708: psx_cyc_step(cpu, 0x8202u); #endif /* 0xBFC3E71C: 01E9082A slt $at, $t7, $t1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x01E9082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005671Cu); #endif @@ -799812,7 +802019,8 @@ label_BFC3E734: psx_cyc_step(cpu, 0x3000002u); #endif /* 0xBFC3E744: 0301C824 and $t9, $t8, $at */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[1]; + PGXP_ALU(0x0301C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056744u); #endif @@ -800009,7 +802217,8 @@ label_BFC3E77C: psx_cyc_step(cpu, 0x2000202u); #endif /* 0xBFC3E790: 0139082A slt $at, $t1, $t9 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0139082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056790u); #endif @@ -800155,7 +802364,8 @@ label_BFC3E7A8: psx_cyc_step(cpu, 0x1004002u); #endif /* 0xBFC3E7B8: 01C1C024 and $t8, $t6, $at */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[1]; + PGXP_ALU(0x01C1C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800567B8u); #endif @@ -800346,7 +802556,8 @@ label_BFC3E7F8: psx_cyc_step(cpu, 0x2042u); #endif /* 0xBFC3E7FC: 00CD082A slt $at, $a2, $t5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x00CD082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800567FCu); #endif @@ -800459,7 +802670,8 @@ label_BFC3E808: psx_cyc_step(cpu, 0x4202u); #endif /* 0xBFC3E81C: 01C9082A slt $at, $t6, $t1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[14] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x01C9082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005681Cu); #endif @@ -800591,7 +802803,8 @@ label_BFC3E830: psx_cyc_step(cpu, 0x1000202u); #endif /* 0xBFC3E844: 0138082A slt $at, $t1, $t8 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[24] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[24] ? 1 : 0); + PGXP_ALU(0x0138082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056844u); #endif @@ -800743,7 +802956,8 @@ label_BFC3E85C: psx_cyc_step(cpu, 0x2042u); #endif /* 0xBFC3E870: 01A6082A slt $at, $t5, $a2 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[6] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[13] < (int32_t)cpu->gpr[6] ? 1 : 0); + PGXP_ALU(0x01A6082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056870u); #endif @@ -801054,7 +803268,8 @@ label_BFC3E8D8: psx_cyc_step(cpu, 0x2042u); #endif /* 0xBFC3E8D8: 00CD082A slt $at, $a2, $t5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x00CD082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800568D8u); #endif @@ -801213,7 +803428,8 @@ label_BFC3E8F4: psx_cyc_step(cpu, 0x8202u); #endif /* 0xBFC3E908: 012F082A slt $at, $t1, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x012F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056908u); #endif @@ -801332,7 +803548,8 @@ label_BFC3E920: psx_cyc_step(cpu, 0x4082u); #endif /* 0xBFC3E924: 00E17024 and $t6, $a3, $at */ - cpu->gpr[14] = cpu->gpr[7] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = cpu->gpr[7] & cpu->gpr[1]; + PGXP_ALU(0x00E17024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056924u); #endif @@ -801340,7 +803557,8 @@ label_BFC3E920: psx_cyc_step(cpu, 0x2042u); #endif /* 0xBFC3E928: 00CD082A slt $at, $a2, $t5 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[13] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[6]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[6] < (int32_t)cpu->gpr[13] ? 1 : 0); + PGXP_ALU(0x00CD082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056928u); #endif @@ -802012,7 +804230,8 @@ label_BFC3E9DC: psx_cyc_step(cpu, 0x19u); #endif /* 0xBFC3E9E0: 00602027 nor $a0, $v1, $zero */ - cpu->gpr[4] = ~(cpu->gpr[3] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[4] = ~(cpu->gpr[3] | cpu->gpr[0]); + PGXP_ALU(0x00602027u, cpu->gpr[4], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800569E0u); #endif @@ -802020,7 +804239,8 @@ label_BFC3E9DC: psx_cyc_step(cpu, 0x1000210u); #endif /* 0xBFC3E9E4: 0124C024 and $t8, $t1, $a0 */ - cpu->gpr[24] = cpu->gpr[9] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[24] = cpu->gpr[9] & cpu->gpr[4]; + PGXP_ALU(0x0124C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800569E4u); #endif @@ -802148,7 +804368,8 @@ label_BFC3E9FC: psx_cyc_step(cpu, 0x2000090u); #endif /* 0xBFC3EA04: 00E4C824 and $t9, $a3, $a0 */ - cpu->gpr[25] = cpu->gpr[7] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[7]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[7] & cpu->gpr[4]; + PGXP_ALU(0x00E4C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056A04u); #endif @@ -802294,7 +804515,8 @@ label_BFC3EA20: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3EA2C: 28A11000 slti $at, $a1, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (4096) ? 1 : 0); + PGXP_ALU(0x28A11000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80056A2Cu); #endif @@ -802434,7 +804656,8 @@ label_BFC3EA44: psx_cyc_step(cpu, 0x8006u); #endif /* 0xBFC3EA50: 01E2082A slt $at, $t7, $v0 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[2] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[2] ? 1 : 0); + PGXP_ALU(0x01E2082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056A50u); #endif @@ -802565,7 +804788,8 @@ label_BFC3EA64: psx_cyc_step(cpu, 0x3000040u); #endif /* 0xBFC3EA78: 0306C824 and $t9, $t8, $a2 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[6]; + PGXP_ALU(0x0306C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056A78u); #endif @@ -802621,7 +804845,8 @@ label_BFC3EA84: psx_cyc_step(cpu, 0x22u); #endif /* 0xBFC3EA88: 28A11001 slti $at, $a1, 4097 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (4097) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[5] < (4097) ? 1 : 0); + PGXP_ALU(0x28A11001u, cpu->gpr[1], _pgx1, 0x1001u); } #ifdef PSX_COSIM cosim_instr(0x80056A88u); #endif @@ -802735,7 +804960,8 @@ label_BFC3EA9C: psx_cyc_step(cpu, 0x2008002u); #endif /* 0xBFC3EAB0: 032F082A slt $at, $t9, $t7 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[15] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[15] ? 1 : 0); + PGXP_ALU(0x032F082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056AB0u); #endif @@ -803032,7 +805258,8 @@ label_BFC3EB00: psx_cyc_step(cpu, 0x2004002u); #endif /* 0xBFC3EB14: 032E082A slt $at, $t9, $t6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[14] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[25] < (int32_t)cpu->gpr[14] ? 1 : 0); + PGXP_ALU(0x032E082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056B14u); #endif @@ -803442,7 +805669,8 @@ label_BFC3EB90: psx_cyc_step(cpu, 0x8408u); #endif /* 0xBFC3EB98: 006A7824 and $t7, $v1, $t2 */ - cpu->gpr[15] = cpu->gpr[3] & cpu->gpr[10]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[10]; cpu->gpr[15] = cpu->gpr[3] & cpu->gpr[10]; + PGXP_ALU(0x006A7824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056B98u); #endif @@ -803460,7 +805688,8 @@ label_BFC3EB90: psx_cyc_step(cpu, 0x8048u); #endif /* 0xBFC3EBA0: 00667824 and $t7, $v1, $a2 */ - cpu->gpr[15] = cpu->gpr[3] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[3] & cpu->gpr[6]; + PGXP_ALU(0x00667824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056BA0u); #endif @@ -803492,7 +805721,8 @@ label_BFC3EBA4: psx_cyc_step(cpu, 0x888u); #endif /* 0xBFC3EBA4: 006B3824 and $a3, $v1, $t3 */ - cpu->gpr[7] = cpu->gpr[3] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[7] = cpu->gpr[3] & cpu->gpr[11]; + PGXP_ALU(0x006B3824u, cpu->gpr[7], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056BA4u); #endif @@ -803500,7 +805730,8 @@ label_BFC3EBA4: psx_cyc_step(cpu, 0xA2u); #endif /* 0xBFC3EBA8: 00A7082B sltu $at, $a1, $a3 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[7] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[7] ? 1 : 0); + PGXP_ALU(0x00A7082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056BA8u); #endif @@ -803576,7 +805807,8 @@ label_BFC3EBB4: psx_cyc_step(cpu, 0x2000022u); #endif /* 0xBFC3EBC0: 00B9082B sltu $at, $a1, $t9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x00B9082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056BC0u); #endif @@ -803641,7 +805873,8 @@ label_BFC3EBCC: psx_cyc_step(cpu, 0x6040u); #endif /* 0xBFC3EBD4: 01C66824 and $t5, $t6, $a2 */ - cpu->gpr[13] = cpu->gpr[14] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[13] = cpu->gpr[14] & cpu->gpr[6]; + PGXP_ALU(0x01C66824u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056BD4u); #endif @@ -803766,7 +805999,8 @@ label_BFC3EBF0: psx_cyc_step(cpu, 0x212u); #endif /* 0xBFC3EBF4: 0089082A slt $at, $a0, $t1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0089082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056BF4u); #endif @@ -803970,7 +806204,8 @@ label_BFC3EC20: psx_cyc_step(cpu, 0x212u); #endif /* 0xBFC3EC28: 0089082A slt $at, $a0, $t1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0089082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056C28u); #endif @@ -804172,7 +806407,8 @@ label_BFC3EC58: psx_cyc_step(cpu, 0x8048u); #endif /* 0xBFC3EC58: 00667824 and $t7, $v1, $a2 */ - cpu->gpr[15] = cpu->gpr[3] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[3] & cpu->gpr[6]; + PGXP_ALU(0x00667824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056C58u); #endif @@ -804304,7 +806540,8 @@ label_BFC3EC70: psx_cyc_step(cpu, 0x212u); #endif /* 0xBFC3EC7C: 0089082A slt $at, $a0, $t1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[9] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (int32_t)cpu->gpr[9] ? 1 : 0); + PGXP_ALU(0x0089082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056C7Cu); #endif @@ -804414,7 +806651,8 @@ label_BFC3EC94: psx_cyc_step(cpu, 0x828u); #endif /* 0xBFC3EC94: 006B2824 and $a1, $v1, $t3 */ - cpu->gpr[5] = cpu->gpr[3] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[5] = cpu->gpr[3] & cpu->gpr[11]; + PGXP_ALU(0x006B2824u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056C94u); #endif @@ -804669,7 +806907,8 @@ label_BFC3ECD4: psx_cyc_step(cpu, 0x4044u); #endif /* 0xBFC3ECDC: 00467024 and $t6, $v0, $a2 */ - cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[6]; + PGXP_ALU(0x00467024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056CDCu); #endif @@ -804719,7 +806958,8 @@ label_BFC3ECE8: psx_cyc_step(cpu, 0x8084u); #endif /* 0xBFC3ECE8: 00477824 and $t7, $v0, $a3 */ - cpu->gpr[15] = cpu->gpr[2] & cpu->gpr[7]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[7]; cpu->gpr[15] = cpu->gpr[2] & cpu->gpr[7]; + PGXP_ALU(0x00477824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056CE8u); #endif @@ -804769,7 +807009,8 @@ label_BFC3ECF4: psx_cyc_step(cpu, 0x124u); #endif /* 0xBFC3ECF4: 00482824 and $a1, $v0, $t0 */ - cpu->gpr[5] = cpu->gpr[2] & cpu->gpr[8]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[8]; cpu->gpr[5] = cpu->gpr[2] & cpu->gpr[8]; + PGXP_ALU(0x00482824u, cpu->gpr[5], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056CF4u); #endif @@ -804777,7 +807018,8 @@ label_BFC3ECF4: psx_cyc_step(cpu, 0x32u); #endif /* 0xBFC3ECF8: 00A4082B sltu $at, $a1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[5]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[5] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x00A4082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056CF8u); #endif @@ -804885,7 +807127,8 @@ label_BFC3ED0C: psx_cyc_step(cpu, 0x2000012u); #endif /* 0xBFC3ED18: 0099082B sltu $at, $a0, $t9 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[25] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[1] = (uint32_t)(cpu->gpr[4] < cpu->gpr[25] ? 1 : 0); + PGXP_ALU(0x0099082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056D18u); #endif @@ -805223,7 +807466,8 @@ label_BFC3ED68: psx_cyc_step(cpu, 0x4014u); #endif /* 0xBFC3ED70: 00447024 and $t6, $v0, $a0 */ - cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[4]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[14] = cpu->gpr[2] & cpu->gpr[4]; + PGXP_ALU(0x00447024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056D70u); #endif @@ -805845,7 +808089,8 @@ label_BFC3EE0C: psx_cyc_step(cpu, 0x2080100u); #endif /* 0xBFC3EE24: 03334024 and $t0, $t9, $s3 */ - cpu->gpr[8] = cpu->gpr[25] & cpu->gpr[19]; + { uint32_t _pgx1 = cpu->gpr[25]; uint32_t _pgx2 = cpu->gpr[19]; cpu->gpr[8] = cpu->gpr[25] & cpu->gpr[19]; + PGXP_ALU(0x03334024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056E24u); #endif @@ -805977,7 +808222,8 @@ label_BFC3EE44: psx_cyc_step(cpu, 0x20202u); #endif /* 0xBFC3EE50: 0131082A slt $at, $t1, $s1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[17] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (int32_t)cpu->gpr[17] ? 1 : 0); + PGXP_ALU(0x0131082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80056E50u); #endif @@ -806656,7 +808902,8 @@ label_BFC3EF24: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC3EF30: 30430007 andi $v1, $v0, 0x7 */ - cpu->gpr[3] = cpu->gpr[2] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x7u; + PGXP_ALU(0x30430007u, cpu->gpr[3], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x80056F30u); #endif @@ -807055,7 +809302,8 @@ label_BFC3EF98: psx_cyc_step(cpu, 0xCu); #endif /* 0xBFC3EFA4: 30430007 andi $v1, $v0, 0x7 */ - cpu->gpr[3] = cpu->gpr[2] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[3] = cpu->gpr[2] & 0x7u; + PGXP_ALU(0x30430007u, cpu->gpr[3], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x80056FA4u); #endif @@ -807661,7 +809909,8 @@ label_BFC3F040: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC3F044: 3059001D andi $t9, $v0, 0x1D */ - cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + PGXP_ALU(0x3059001Du, cpu->gpr[25], _pgx1, 0x001Du); } #ifdef PSX_COSIM cosim_instr(0x80057044u); #endif @@ -807766,7 +810015,8 @@ label_BFC3F058: psx_cyc_step(cpu, 0x2000004u); #endif /* 0xBFC3F058: 3059001D andi $t9, $v0, 0x1D */ - cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[2] & 0x1Du; + PGXP_ALU(0x3059001Du, cpu->gpr[25], _pgx1, 0x001Du); } #ifdef PSX_COSIM cosim_instr(0x80057058u); #endif @@ -808148,7 +810398,8 @@ label_BFC3F090: psx_cyc_step(cpu, 0xC040u); #endif /* 0xBFC3F0C8: 01C67824 and $t7, $t6, $a2 */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[6]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[6]; + PGXP_ALU(0x01C67824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800570C8u); #endif @@ -808183,7 +810434,8 @@ label_BFC3F090: psx_cyc_step(cpu, 0x3000020u); #endif /* 0xBFC3F0D8: 0305C824 and $t9, $t8, $a1 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[5]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[5]; + PGXP_ALU(0x0305C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x800570D8u); #endif @@ -808284,7 +810536,8 @@ label_BFC3F090: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC3F104: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80057104u); #endif @@ -809226,7 +811479,8 @@ label_BFC3F210: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3F224: 30580008 andi $t8, $v0, 0x8 */ - cpu->gpr[24] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30580008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80057224u); #endif @@ -810287,7 +812541,8 @@ label_BFC3F324: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3F338: 30580008 andi $t8, $v0, 0x8 */ - cpu->gpr[24] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30580008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80057338u); #endif @@ -812136,7 +814391,8 @@ label_BFC3F5D8: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC3F5F0: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800575F0u); #endif @@ -812357,7 +814613,8 @@ label_BFC3F608: psx_cyc_step(cpu, 0x8040u); #endif /* 0xBFC3F62C: 30CF0010 andi $t7, $a2, 0x10 */ - cpu->gpr[15] = cpu->gpr[6] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[15] = cpu->gpr[6] & 0x10u; + PGXP_ALU(0x30CF0010u, cpu->gpr[15], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x8005762Cu); #endif @@ -812469,7 +814726,8 @@ label_BFC3F648: psx_cyc_step(cpu, 0x2000040u); #endif /* 0xBFC3F648: 30D90020 andi $t9, $a2, 0x20 */ - cpu->gpr[25] = cpu->gpr[6] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[25] = cpu->gpr[6] & 0x20u; + PGXP_ALU(0x30D90020u, cpu->gpr[25], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80057648u); #endif @@ -812669,7 +814927,8 @@ label_BFC3F670: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC3F684: 304B0008 andi $t3, $v0, 0x8 */ - cpu->gpr[11] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304B0008u, cpu->gpr[11], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80057684u); #endif @@ -812838,7 +815097,8 @@ label_BFC3F6A0: psx_cyc_step(cpu, 0x2040u); #endif /* 0xBFC3F6B8: 30CD00FF andi $t5, $a2, 0xFF */ - cpu->gpr[13] = cpu->gpr[6] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[13] = cpu->gpr[6] & 0xFFu; + PGXP_ALU(0x30CD00FFu, cpu->gpr[13], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800576B8u); #endif @@ -813195,7 +815455,8 @@ label_BFC3F710: psx_cyc_step(cpu, 0x8010u); #endif /* 0xBFC3F724: 308F0010 andi $t7, $a0, 0x10 */ - cpu->gpr[15] = cpu->gpr[4] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[15] = cpu->gpr[4] & 0x10u; + PGXP_ALU(0x308F0010u, cpu->gpr[15], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80057724u); #endif @@ -813301,7 +815562,8 @@ label_BFC3F740: psx_cyc_step(cpu, 0x2000010u); #endif /* 0xBFC3F740: 30990020 andi $t9, $a0, 0x20 */ - cpu->gpr[25] = cpu->gpr[4] & 0x20u; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[4] & 0x20u; + PGXP_ALU(0x30990020u, cpu->gpr[25], _pgx1, 0x0020u); } #ifdef PSX_COSIM cosim_instr(0x80057740u); #endif @@ -813498,7 +815760,8 @@ label_BFC3F768: psx_cyc_step(cpu, 0x804u); #endif /* 0xBFC3F77C: 304B0008 andi $t3, $v0, 0x8 */ - cpu->gpr[11] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304B0008u, cpu->gpr[11], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x8005777Cu); #endif @@ -813673,7 +815936,8 @@ label_BFC3F798: psx_cyc_step(cpu, 0x2010u); #endif /* 0xBFC3F7B0: 308D00FF andi $t5, $a0, 0xFF */ - cpu->gpr[13] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[13] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308D00FFu, cpu->gpr[13], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800577B0u); #endif @@ -814900,7 +817164,8 @@ label_BFC3F910: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC3F928: 304F0008 andi $t7, $v0, 0x8 */ - cpu->gpr[15] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304F0008u, cpu->gpr[15], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80057928u); #endif @@ -815111,7 +817376,8 @@ label_BFC3F94C: psx_cyc_step(cpu, 0x2000010u); #endif /* 0xBFC3F96C: 309900FF andi $t9, $a0, 0xFF */ - cpu->gpr[25] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[25] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x309900FFu, cpu->gpr[25], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005796Cu); #endif @@ -820246,7 +822512,8 @@ label_BFC3FE84: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3FE98: 30580008 andi $t8, $v0, 0x8 */ - cpu->gpr[24] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30580008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80057E98u); #endif @@ -820955,7 +823222,8 @@ label_BFC3FF64: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC3FF78: 30580008 andi $t8, $v0, 0x8 */ - cpu->gpr[24] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30580008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80057F78u); #endif @@ -821353,7 +823621,8 @@ label_BFC3FFE4: psx_cyc_step(cpu, 0x300u); #endif /* 0xBFC3FFFC: 310900FF andi $t1, $t0, 0xFF */ - cpu->gpr[9] = cpu->gpr[8] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[9] = cpu->gpr[8] & 0xFFu; + PGXP_ALU(0x310900FFu, cpu->gpr[9], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80057FFCu); #endif @@ -822917,7 +825186,8 @@ label_BFC40184: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC40190: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80058190u); #endif @@ -824316,7 +826586,8 @@ label_BFC40300: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC40314: 30580008 andi $t8, $v0, 0x8 */ - cpu->gpr[24] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30580008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80058314u); #endif @@ -824651,7 +826922,8 @@ label_BFC40378: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC40384: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80058384u); #endif @@ -825633,7 +827905,8 @@ label_BFC40484: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC4049C: 31CF0004 andi $t7, $t6, 0x4 */ - cpu->gpr[15] = cpu->gpr[14] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x4u; + PGXP_ALU(0x31CF0004u, cpu->gpr[15], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x8005849Cu); #endif @@ -825738,7 +828011,8 @@ label_BFC404B0: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC404B8: 30580004 andi $t8, $v0, 0x4 */ - cpu->gpr[24] = cpu->gpr[2] & 0x4u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x4u; + PGXP_ALU(0x30580004u, cpu->gpr[24], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x800584B8u); #endif @@ -825874,7 +828148,8 @@ label_BFC404CC: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC404E0: 33280003 andi $t0, $t9, 0x3 */ - cpu->gpr[8] = cpu->gpr[25] & 0x3u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x3u; + PGXP_ALU(0x33280003u, cpu->gpr[8], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x800584E0u); #endif @@ -825933,7 +828208,8 @@ label_BFC404CC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC404FC: 30420007 andi $v0, $v0, 0x7 */ - cpu->gpr[2] = cpu->gpr[2] & 0x7u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0x7u; + PGXP_ALU(0x30420007u, cpu->gpr[2], _pgx1, 0x0007u); } #ifdef PSX_COSIM cosim_instr(0x800584FCu); #endif @@ -825944,7 +828220,8 @@ label_BFC404CC: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC40500: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80058500u); #endif @@ -825970,7 +828247,8 @@ label_BFC404CC: psx_cyc_step(cpu, 0x1002u); #endif /* 0xBFC4050C: 2D810005 sltiu $at, $t4, 5 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[12] < 0x00000005u ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)(cpu->gpr[12] < 0x00000005u ? 1 : 0); + PGXP_ALU(0x2D810005u, cpu->gpr[1], _pgx1, 0x0005u); } #ifdef PSX_COSIM cosim_instr(0x8005850Cu); #endif @@ -826683,7 +828961,8 @@ label_BFC405B0: psx_cyc_step(cpu, 0x1000002u); #endif /* 0xBFC405D0: 2B010004 slti $at, $t8, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[24]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[24] < (4) ? 1 : 0); + PGXP_ALU(0x2B010004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x800585D0u); #endif @@ -826813,7 +829092,8 @@ label_BFC405E0: psx_cyc_step(cpu, 0x402u); #endif /* 0xBFC40600: 29410004 slti $at, $t2, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[10] < (4) ? 1 : 0); + PGXP_ALU(0x29410004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80058600u); #endif @@ -827038,7 +829318,8 @@ label_BFC40628: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC40640: 31CF0008 andi $t7, $t6, 0x8 */ - cpu->gpr[15] = cpu->gpr[14] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x8u; + PGXP_ALU(0x31CF0008u, cpu->gpr[15], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80058640u); #endif @@ -827143,7 +829424,8 @@ label_BFC40654: psx_cyc_step(cpu, 0x1000004u); #endif /* 0xBFC4065C: 30580008 andi $t8, $v0, 0x8 */ - cpu->gpr[24] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[24] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x30580008u, cpu->gpr[24], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x8005865Cu); #endif @@ -827312,7 +829594,8 @@ label_BFC40670: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40694: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80058694u); #endif @@ -828013,7 +830296,8 @@ label_BFC40744: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC40774: 29010004 slti $at, $t0, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4) ? 1 : 0); + PGXP_ALU(0x29010004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80058774u); #endif @@ -828145,7 +830429,8 @@ label_BFC40784: psx_cyc_step(cpu, 0x1002u); #endif /* 0xBFC407A4: 29810004 slti $at, $t4, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (4) ? 1 : 0); + PGXP_ALU(0x29810004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x800587A4u); #endif @@ -830011,7 +832296,8 @@ label_BFC4090C: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40914: 2841001A slti $at, $v0, 26 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (26) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (26) ? 1 : 0); + PGXP_ALU(0x2841001Au, cpu->gpr[1], _pgx1, 0x001Au); } #ifdef PSX_COSIM cosim_instr(0x80058914u); #endif @@ -830090,7 +832376,8 @@ label_BFC40920: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40924: 2841000F slti $at, $v0, 15 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (15) ? 1 : 0); + PGXP_ALU(0x2841000Fu, cpu->gpr[1], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80058924u); #endif @@ -830169,7 +832456,8 @@ label_BFC40930: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40934: 28410009 slti $at, $v0, 9 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (9) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (9) ? 1 : 0); + PGXP_ALU(0x28410009u, cpu->gpr[1], _pgx1, 0x0009u); } #ifdef PSX_COSIM cosim_instr(0x80058934u); #endif @@ -830248,7 +832536,8 @@ label_BFC40940: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40944: 28410006 slti $at, $v0, 6 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (6) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (6) ? 1 : 0); + PGXP_ALU(0x28410006u, cpu->gpr[1], _pgx1, 0x0006u); } #ifdef PSX_COSIM cosim_instr(0x80058944u); #endif @@ -830327,7 +832616,8 @@ label_BFC40950: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40954: 28410004 slti $at, $v0, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4) ? 1 : 0); + PGXP_ALU(0x28410004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80058954u); #endif @@ -830666,7 +832956,8 @@ label_BFC40998: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC409A0: 2841000C slti $at, $v0, 12 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (12) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (12) ? 1 : 0); + PGXP_ALU(0x2841000Cu, cpu->gpr[1], _pgx1, 0x000Cu); } #ifdef PSX_COSIM cosim_instr(0x800589A0u); #endif @@ -830919,7 +833210,8 @@ label_BFC409D0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC409D8: 28410015 slti $at, $v0, 21 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (21) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (21) ? 1 : 0); + PGXP_ALU(0x28410015u, cpu->gpr[1], _pgx1, 0x0015u); } #ifdef PSX_COSIM cosim_instr(0x800589D8u); #endif @@ -831001,7 +833293,8 @@ label_BFC409E4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC409E8: 28410013 slti $at, $v0, 19 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (19) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (19) ? 1 : 0); + PGXP_ALU(0x28410013u, cpu->gpr[1], _pgx1, 0x0013u); } #ifdef PSX_COSIM cosim_instr(0x800589E8u); #endif @@ -831259,7 +833552,8 @@ label_BFC40A18: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40A20: 28410017 slti $at, $v0, 23 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (23) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (23) ? 1 : 0); + PGXP_ALU(0x28410017u, cpu->gpr[1], _pgx1, 0x0017u); } #ifdef PSX_COSIM cosim_instr(0x80058A20u); #endif @@ -831512,7 +833806,8 @@ label_BFC40A50: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40A58: 284100F7 slti $at, $v0, 247 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (247) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (247) ? 1 : 0); + PGXP_ALU(0x284100F7u, cpu->gpr[1], _pgx1, 0x00F7u); } #ifdef PSX_COSIM cosim_instr(0x80058A58u); #endif @@ -831594,7 +833889,8 @@ label_BFC40A64: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40A68: 284100E7 slti $at, $v0, 231 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (231) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (231) ? 1 : 0); + PGXP_ALU(0x284100E7u, cpu->gpr[1], _pgx1, 0x00E7u); } #ifdef PSX_COSIM cosim_instr(0x80058A68u); #endif @@ -831676,7 +833972,8 @@ label_BFC40A74: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40A78: 28410051 slti $at, $v0, 81 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (81) ? 1 : 0); + PGXP_ALU(0x28410051u, cpu->gpr[1], _pgx1, 0x0051u); } #ifdef PSX_COSIM cosim_instr(0x80058A78u); #endif @@ -831932,7 +834229,8 @@ label_BFC40AA8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40AB0: 284100EF slti $at, $v0, 239 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (239) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (239) ? 1 : 0); + PGXP_ALU(0x284100EFu, cpu->gpr[1], _pgx1, 0x00EFu); } #ifdef PSX_COSIM cosim_instr(0x80058AB0u); #endif @@ -832188,7 +834486,8 @@ label_BFC40AE0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40AE8: 28410DDE slti $at, $v0, 3550 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3550) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3550) ? 1 : 0); + PGXP_ALU(0x28410DDEu, cpu->gpr[1], _pgx1, 0x0DDEu); } #ifdef PSX_COSIM cosim_instr(0x80058AE8u); #endif @@ -832270,7 +834569,8 @@ label_BFC40AF4: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40AF8: 284100FF slti $at, $v0, 255 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (255) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (255) ? 1 : 0); + PGXP_ALU(0x284100FFu, cpu->gpr[1], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80058AF8u); #endif @@ -832527,7 +834827,8 @@ label_BFC40B28: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40B30: 28411000 slti $at, $v0, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4096) ? 1 : 0); + PGXP_ALU(0x28411000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80058B30u); #endif @@ -834354,7 +836655,8 @@ label_BFC40D18: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40D1C: 28410CCD slti $at, $v0, 3277 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3277) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (3277) ? 1 : 0); + PGXP_ALU(0x28410CCDu, cpu->gpr[1], _pgx1, 0x0CCDu); } #ifdef PSX_COSIM cosim_instr(0x80058D1Cu); #endif @@ -834433,7 +836735,8 @@ label_BFC40D28: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40D2C: 28410017 slti $at, $v0, 23 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (23) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (23) ? 1 : 0); + PGXP_ALU(0x28410017u, cpu->gpr[1], _pgx1, 0x0017u); } #ifdef PSX_COSIM cosim_instr(0x80058D2Cu); #endif @@ -834512,7 +836815,8 @@ label_BFC40D38: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40D3C: 2841000A slti $at, $v0, 10 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (10) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (10) ? 1 : 0); + PGXP_ALU(0x2841000Au, cpu->gpr[1], _pgx1, 0x000Au); } #ifdef PSX_COSIM cosim_instr(0x80058D3Cu); #endif @@ -834972,7 +837276,8 @@ label_BFC40DA0: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC40DA8: 28411000 slti $at, $v0, 4096 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4096) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[2] < (4096) ? 1 : 0); + PGXP_ALU(0x28411000u, cpu->gpr[1], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80058DA8u); #endif @@ -835579,7 +837884,8 @@ label_BFC40E24: psx_cyc_step(cpu, 0x202u); #endif /* 0xBFC40E54: 29210004 slti $at, $t1, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[9] < (4) ? 1 : 0); + PGXP_ALU(0x29210004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80058E54u); #endif @@ -835717,7 +838023,8 @@ label_BFC40E60: psx_cyc_step(cpu, 0x8002u); #endif /* 0xBFC40E8C: 29E10004 slti $at, $t7, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (4) ? 1 : 0); + PGXP_ALU(0x29E10004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80058E8Cu); #endif @@ -840689,7 +842996,8 @@ label_BFC413B0: psx_cyc_step(cpu, 0x18u); #endif /* 0xBFC413BC: 308300FF andi $v1, $a0, 0xFF */ - cpu->gpr[3] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[3] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800593BCu); #endif @@ -841309,7 +843617,8 @@ label_BFC41468: psx_cyc_step(cpu, 0x1008000u); #endif /* 0xBFC41480: 31F80100 andi $t8, $t7, 0x100 */ - cpu->gpr[24] = cpu->gpr[15] & 0x100u; + { uint32_t _pgx1 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[15] & 0x100u; + PGXP_ALU(0x31F80100u, cpu->gpr[24], _pgx1, 0x0100u); } #ifdef PSX_COSIM cosim_instr(0x80059480u); #endif @@ -842906,7 +845215,8 @@ label_BFC41670: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC4167C: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005967Cu); #endif @@ -843344,7 +845654,8 @@ label_BFC41708: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC41718: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80059718u); #endif @@ -843397,7 +845708,8 @@ label_BFC41708: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC41730: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80059730u); #endif @@ -843488,7 +845800,8 @@ label_BFC41740: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC4174C: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005974Cu); #endif @@ -844362,7 +846675,8 @@ label_BFC41848: psx_cyc_step(cpu, 0x8004u); #endif /* 0xBFC41860: 304F0008 andi $t7, $v0, 0x8 */ - cpu->gpr[15] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[15] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304F0008u, cpu->gpr[15], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80059860u); #endif @@ -845100,7 +847414,8 @@ label_BFC4192C: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC41958: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80059958u); #endif @@ -845108,7 +847423,8 @@ label_BFC4192C: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC4195C: 304E000F andi $t6, $v0, 0xF */ - cpu->gpr[14] = cpu->gpr[2] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0xFu; + PGXP_ALU(0x304E000Fu, cpu->gpr[14], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x8005995Cu); #endif @@ -845128,7 +847444,8 @@ label_BFC4192C: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC41964: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80059964u); #endif @@ -845217,7 +847534,8 @@ label_BFC4192C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC4198C: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005998Cu); #endif @@ -845228,7 +847546,8 @@ label_BFC4192C: psx_cyc_step(cpu, 0x8010u); #endif /* 0xBFC41990: 308F000F andi $t7, $a0, 0xF */ - cpu->gpr[15] = cpu->gpr[4] & 0xFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[15] = cpu->gpr[4] & 0xFu; + PGXP_ALU(0x308F000Fu, cpu->gpr[15], _pgx1, 0x000Fu); } #ifdef PSX_COSIM cosim_instr(0x80059990u); #endif @@ -845251,7 +847570,8 @@ label_BFC4192C: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC4199C: 30A500FF andi $a1, $a1, 0xFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFu; + PGXP_ALU(0x30A500FFu, cpu->gpr[5], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x8005999Cu); #endif @@ -845289,7 +847609,8 @@ label_BFC4192C: psx_cyc_step(cpu, 0x2000040u); #endif /* 0xBFC419AC: 30D90008 andi $t9, $a2, 0x8 */ - cpu->gpr[25] = cpu->gpr[6] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[25] = cpu->gpr[6] & 0x8u; + PGXP_ALU(0x30D90008u, cpu->gpr[25], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x800599ACu); #endif @@ -845444,7 +847765,8 @@ label_BFC419C8: psx_cyc_step(cpu, 0x8u); #endif /* 0xBFC419D4: 306300FF andi $v1, $v1, 0xFF */ - cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[3]; cpu->gpr[3] = cpu->gpr[3] & 0xFFu; + PGXP_ALU(0x306300FFu, cpu->gpr[3], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800599D4u); #endif @@ -845494,7 +847816,8 @@ label_BFC419C8: psx_cyc_step(cpu, 0x600u); #endif /* 0xBFC419E8: 312A00FF andi $t2, $t1, 0xFF */ - cpu->gpr[10] = cpu->gpr[9] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[9] & 0xFFu; + PGXP_ALU(0x312A00FFu, cpu->gpr[10], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x800599E8u); #endif @@ -846117,7 +848440,8 @@ label_BFC41ABC: psx_cyc_step(cpu, 0x1Au); #endif /* 0xBFC41AC0: 0064082B sltu $at, $v1, $a0 */ - cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)(cpu->gpr[3] < cpu->gpr[4] ? 1 : 0); + PGXP_ALU(0x0064082Bu, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059AC0u); #endif @@ -846327,7 +848651,8 @@ label_BFC41AF0: psx_cyc_step(cpu, 0x1004u); #endif /* 0xBFC41B04: 304C0008 andi $t4, $v0, 0x8 */ - cpu->gpr[12] = cpu->gpr[2] & 0x8u; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[12] = cpu->gpr[2] & 0x8u; + PGXP_ALU(0x304C0008u, cpu->gpr[12], _pgx1, 0x0008u); } #ifdef PSX_COSIM cosim_instr(0x80059B04u); #endif @@ -846500,7 +848825,8 @@ label_BFC41B24: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC41B30: 31CF00FF andi $t7, $t6, 0xFF */ - cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0xFFu; + PGXP_ALU(0x31CF00FFu, cpu->gpr[15], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80059B30u); #endif @@ -846539,7 +848865,8 @@ label_BFC41B24: psx_cyc_step(cpu, 0x4u); #endif /* 0xBFC41B40: 304200FF andi $v0, $v0, 0xFF */ - cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[2] = cpu->gpr[2] & 0xFFu; + PGXP_ALU(0x304200FFu, cpu->gpr[2], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80059B40u); #endif @@ -846599,7 +848926,8 @@ label_BFC41B48: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC41B4C: 308400FF andi $a0, $a0, 0xFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFu; + PGXP_ALU(0x308400FFu, cpu->gpr[4], _pgx1, 0x00FFu); } #ifdef PSX_COSIM cosim_instr(0x80059B4Cu); #endif @@ -846907,7 +849235,8 @@ label_BFC41BA8: psx_cyc_step(cpu, 0x6u); #endif /* 0xBFC41BC0: 00411024 and $v0, $v0, $at */ - cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[2] = cpu->gpr[2] & cpu->gpr[1]; + PGXP_ALU(0x00411024u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059BC0u); #endif @@ -847246,7 +849575,8 @@ label_BFC41C0C: psx_cyc_step(cpu, 0x102u); #endif /* 0xBFC41C3C: 29010004 slti $at, $t0, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (4) ? 1 : 0); + PGXP_ALU(0x29010004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80059C3Cu); #endif @@ -847381,7 +849711,8 @@ label_BFC41C4C: psx_cyc_step(cpu, 0x1002u); #endif /* 0xBFC41C6C: 29810004 slti $at, $t4, 4 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (4) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[12]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[12] < (4) ? 1 : 0); + PGXP_ALU(0x29810004u, cpu->gpr[1], _pgx1, 0x0004u); } #ifdef PSX_COSIM cosim_instr(0x80059C6Cu); #endif @@ -847599,7 +849930,8 @@ label_BFC41C80: psx_cyc_step(cpu, 0x40u); #endif /* 0xBFC41CB4: 30C6FFFF andi $a2, $a2, 0xFFFF */ - cpu->gpr[6] = cpu->gpr[6] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[6]; cpu->gpr[6] = cpu->gpr[6] & 0xFFFFu; + PGXP_ALU(0x30C6FFFFu, cpu->gpr[6], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80059CB4u); #endif @@ -847992,7 +850324,8 @@ label_BFC41D18: psx_cyc_step(cpu, 0x10Au); #endif /* 0xBFC41D24: 00614024 and $t0, $v1, $at */ - cpu->gpr[8] = cpu->gpr[3] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[8] = cpu->gpr[3] & cpu->gpr[1]; + PGXP_ALU(0x00614024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059D24u); #endif @@ -848080,7 +850413,8 @@ label_BFC41D30: psx_cyc_step(cpu, 0x608u); #endif /* 0xBFC41D44: 00695026 xor $t2, $v1, $t1 */ - cpu->gpr[10] = cpu->gpr[3] ^ cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[3] ^ cpu->gpr[9]; + PGXP_ALU(0x00695026u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059D44u); #endif @@ -848088,7 +850422,8 @@ label_BFC41D30: psx_cyc_step(cpu, 0xC04u); #endif /* 0xBFC41D48: 01425824 and $t3, $t2, $v0 */ - cpu->gpr[11] = cpu->gpr[10] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[11] = cpu->gpr[10] & cpu->gpr[2]; + PGXP_ALU(0x01425824u, cpu->gpr[11], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059D48u); #endif @@ -848152,7 +850487,8 @@ label_BFC41D54: psx_cyc_step(cpu, 0x3008u); #endif /* 0xBFC41D5C: 006C6826 xor $t5, $v1, $t4 */ - cpu->gpr[13] = cpu->gpr[3] ^ cpu->gpr[12]; + { uint32_t _pgx1 = cpu->gpr[3]; uint32_t _pgx2 = cpu->gpr[12]; cpu->gpr[13] = cpu->gpr[3] ^ cpu->gpr[12]; + PGXP_ALU(0x006C6826u, cpu->gpr[13], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059D5Cu); #endif @@ -848163,7 +850499,8 @@ label_BFC41D54: psx_cyc_step(cpu, 0x6004u); #endif /* 0xBFC41D60: 01A27024 and $t6, $t5, $v0 */ - cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[2]; + PGXP_ALU(0x01A27024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059D60u); #endif @@ -848433,7 +850770,8 @@ label_BFC41DA4: psx_cyc_step(cpu, 0x8022u); #endif /* 0xBFC41DBC: 01E5082A slt $at, $t7, $a1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[15] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x01E5082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059DBCu); #endif @@ -848722,7 +851060,8 @@ label_BFC41DFC: psx_cyc_step(cpu, 0x122u); #endif /* 0xBFC41E08: 0105082A slt $at, $t0, $a1 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[5] ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[5]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[8] < (int32_t)cpu->gpr[5] ? 1 : 0); + PGXP_ALU(0x0105082Au, cpu->gpr[1], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059E08u); #endif @@ -848903,7 +851242,8 @@ label_BFC41E30: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC41E30: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80059E30u); #endif @@ -848911,7 +851251,8 @@ label_BFC41E30: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC41E34: 28810003 slti $at, $a0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + PGXP_ALU(0x28810003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80059E34u); #endif @@ -848919,7 +851260,8 @@ label_BFC41E30: psx_cyc_step(cpu, 0x20u); #endif /* 0xBFC41E38: 30A5FFFF andi $a1, $a1, 0xFFFF */ - cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[5]; cpu->gpr[5] = cpu->gpr[5] & 0xFFFFu; + PGXP_ALU(0x30A5FFFFu, cpu->gpr[5], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80059E38u); #endif @@ -849151,7 +851493,8 @@ label_BFC41E78: psx_cyc_step(cpu, 0x1000080u); #endif /* 0xBFC41E78: 30F80010 andi $t8, $a3, 0x10 */ - cpu->gpr[24] = cpu->gpr[7] & 0x10u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[24] = cpu->gpr[7] & 0x10u; + PGXP_ALU(0x30F80010u, cpu->gpr[24], _pgx1, 0x0010u); } #ifdef PSX_COSIM cosim_instr(0x80059E78u); #endif @@ -849169,7 +851512,8 @@ label_BFC41E78: psx_cyc_step(cpu, 0x2000080u); #endif /* 0xBFC41E80: 30F90001 andi $t9, $a3, 0x1 */ - cpu->gpr[25] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[25] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30F90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80059E80u); #endif @@ -849210,7 +851554,8 @@ label_BFC41E84: psx_cyc_step(cpu, 0x2000080u); #endif /* 0xBFC41E88: 30F90001 andi $t9, $a3, 0x1 */ - cpu->gpr[25] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[25] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30F90001u, cpu->gpr[25], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80059E88u); #endif @@ -849238,7 +851583,8 @@ label_BFC41E8C: psx_cyc_step(cpu, 0x280u); #endif /* 0xBFC41E90: 30E91000 andi $t1, $a3, 0x1000 */ - cpu->gpr[9] = cpu->gpr[7] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[9] = cpu->gpr[7] & 0x1000u; + PGXP_ALU(0x30E91000u, cpu->gpr[9], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80059E90u); #endif @@ -849336,7 +851682,8 @@ label_BFC41EA0: psx_cyc_step(cpu, 0x280u); #endif /* 0xBFC41EA4: 30E91000 andi $t1, $a3, 0x1000 */ - cpu->gpr[9] = cpu->gpr[7] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[9] = cpu->gpr[7] & 0x1000u; + PGXP_ALU(0x30E91000u, cpu->gpr[9], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80059EA4u); #endif @@ -849368,7 +851715,8 @@ label_BFC41EA8: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC41EA8: 30E80001 andi $t0, $a3, 0x1 */ - cpu->gpr[8] = cpu->gpr[7] & 0x1u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[8] = cpu->gpr[7] & 0x1u; + PGXP_ALU(0x30E80001u, cpu->gpr[8], _pgx1, 0x0001u); } #ifdef PSX_COSIM cosim_instr(0x80059EA8u); #endif @@ -849386,7 +851734,8 @@ label_BFC41EA8: psx_cyc_step(cpu, 0x280u); #endif /* 0xBFC41EB0: 30E91000 andi $t1, $a3, 0x1000 */ - cpu->gpr[9] = cpu->gpr[7] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[9] = cpu->gpr[7] & 0x1000u; + PGXP_ALU(0x30E91000u, cpu->gpr[9], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80059EB0u); #endif @@ -849437,7 +851786,8 @@ label_BFC41EB8: psx_cyc_step(cpu, 0x280u); #endif /* 0xBFC41EB8: 30E91000 andi $t1, $a3, 0x1000 */ - cpu->gpr[9] = cpu->gpr[7] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[9] = cpu->gpr[7] & 0x1000u; + PGXP_ALU(0x30E91000u, cpu->gpr[9], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x80059EB8u); #endif @@ -849589,7 +851939,8 @@ label_BFC41ED8: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC41ED8: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80059ED8u); #endif @@ -849597,7 +851948,8 @@ label_BFC41ED8: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC41EDC: 28810003 slti $at, $a0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + PGXP_ALU(0x28810003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80059EDCu); #endif @@ -849790,7 +852142,8 @@ label_BFC41F10: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC41F14: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80059F14u); #endif @@ -849849,7 +852202,8 @@ label_BFC41F10: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC41F30: 28810003 slti $at, $a0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + PGXP_ALU(0x28810003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80059F30u); #endif @@ -849990,7 +852344,8 @@ label_BFC41F54: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC41F54: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80059F54u); #endif @@ -850058,7 +852413,8 @@ label_BFC41F54: psx_cyc_step(cpu, 0x3000001u); #endif /* 0xBFC41F74: 0300C827 nor $t9, $t8, $zero */ - cpu->gpr[25] = ~(cpu->gpr[24] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[25] = ~(cpu->gpr[24] | cpu->gpr[0]); + PGXP_ALU(0x0300C827u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059F74u); #endif @@ -850066,7 +852422,8 @@ label_BFC41F54: psx_cyc_step(cpu, 0x2004100u); #endif /* 0xBFC41F78: 01D94024 and $t0, $t6, $t9 */ - cpu->gpr[8] = cpu->gpr[14] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[14] & cpu->gpr[25]; + PGXP_ALU(0x01D94024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x80059F78u); #endif @@ -850139,7 +852496,8 @@ label_BFC41F88: psx_cyc_step(cpu, 0x10u); #endif /* 0xBFC41F88: 3084FFFF andi $a0, $a0, 0xFFFF */ - cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[4] = cpu->gpr[4] & 0xFFFFu; + PGXP_ALU(0x3084FFFFu, cpu->gpr[4], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x80059F88u); #endif @@ -850147,7 +852505,8 @@ label_BFC41F88: psx_cyc_step(cpu, 0x12u); #endif /* 0xBFC41F8C: 28810003 slti $at, $a0, 3 */ - cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + { uint32_t _pgx1 = cpu->gpr[4]; cpu->gpr[1] = (uint32_t)((int32_t)cpu->gpr[4] < (3) ? 1 : 0); + PGXP_ALU(0x28810003u, cpu->gpr[1], _pgx1, 0x0003u); } #ifdef PSX_COSIM cosim_instr(0x80059F8Cu); #endif @@ -850709,7 +853068,8 @@ label_BFC42024: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC42038: 00401027 nor $v0, $v0, $zero */ - cpu->gpr[2] = ~(cpu->gpr[2] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[2] = ~(cpu->gpr[2] | cpu->gpr[0]); + PGXP_ALU(0x00401027u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A038u); #endif @@ -852183,7 +854543,8 @@ label_BFC421E0: psx_cyc_step(cpu, 0x3000100u); #endif /* 0xBFC42210: 03194024 and $t0, $t8, $t9 */ - cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[24] & cpu->gpr[25]; + PGXP_ALU(0x03194024u, cpu->gpr[8], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A210u); #endif @@ -852191,7 +854552,8 @@ label_BFC421E0: psx_cyc_step(cpu, 0x700u); #endif /* 0xBFC42214: 01095024 and $t2, $t0, $t1 */ - cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + PGXP_ALU(0x01095024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A214u); #endif @@ -852554,7 +854916,8 @@ label_BFC4226C: psx_cyc_step(cpu, 0x11800u); #endif /* 0xBFC4227C: 020B6024 and $t4, $s0, $t3 */ - cpu->gpr[12] = cpu->gpr[16] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[16] & cpu->gpr[11]; + PGXP_ALU(0x020B6024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A27Cu); #endif @@ -852565,7 +854928,8 @@ label_BFC4226C: psx_cyc_step(cpu, 0x7000u); #endif /* 0xBFC42280: 018D7024 and $t6, $t4, $t5 */ - cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + PGXP_ALU(0x018D7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A280u); #endif @@ -852573,7 +854937,8 @@ label_BFC4226C: psx_cyc_step(cpu, 0x100C000u); #endif /* 0xBFC42284: 01CFC024 and $t8, $t6, $t7 */ - cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[15]; cpu->gpr[24] = cpu->gpr[14] & cpu->gpr[15]; + PGXP_ALU(0x01CFC024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A284u); #endif @@ -852620,7 +854985,8 @@ label_BFC42290: psx_cyc_step(cpu, 0x2010001u); #endif /* 0xBFC42290: 0200C827 nor $t9, $s0, $zero */ - cpu->gpr[25] = ~(cpu->gpr[16] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[16]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[25] = ~(cpu->gpr[16] | cpu->gpr[0]); + PGXP_ALU(0x0200C827u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A290u); #endif @@ -852875,7 +855241,8 @@ label_BFC422D8: psx_cyc_step(cpu, 0x1C00u); #endif /* 0xBFC422E8: 014B6024 and $t4, $t2, $t3 */ - cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + { uint32_t _pgx1 = cpu->gpr[10]; uint32_t _pgx2 = cpu->gpr[11]; cpu->gpr[12] = cpu->gpr[10] & cpu->gpr[11]; + PGXP_ALU(0x014B6024u, cpu->gpr[12], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A2E8u); #endif @@ -852883,7 +855250,8 @@ label_BFC422D8: psx_cyc_step(cpu, 0x7000u); #endif /* 0xBFC422EC: 018D7024 and $t6, $t4, $t5 */ - cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + { uint32_t _pgx1 = cpu->gpr[12]; uint32_t _pgx2 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[12] & cpu->gpr[13]; + PGXP_ALU(0x018D7024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A2ECu); #endif @@ -853633,7 +856001,8 @@ label_BFC423A8: psx_cyc_step(cpu, 0x180u); #endif /* 0xBFC423C0: 30E8FFFF andi $t0, $a3, 0xFFFF */ - cpu->gpr[8] = cpu->gpr[7] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[7]; cpu->gpr[8] = cpu->gpr[7] & 0xFFFFu; + PGXP_ALU(0x30E8FFFFu, cpu->gpr[8], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005A3C0u); #endif @@ -853780,7 +856149,8 @@ label_BFC423E4: psx_cyc_step(cpu, 0x5u); #endif /* 0xBFC423F8: 00401027 nor $v0, $v0, $zero */ - cpu->gpr[2] = ~(cpu->gpr[2] | cpu->gpr[0]); + { uint32_t _pgx1 = cpu->gpr[2]; uint32_t _pgx2 = cpu->gpr[0]; cpu->gpr[2] = ~(cpu->gpr[2] | cpu->gpr[0]); + PGXP_ALU(0x00401027u, cpu->gpr[2], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A3F8u); #endif @@ -853788,7 +856158,8 @@ label_BFC423E4: psx_cyc_step(cpu, 0x4004u); #endif /* 0xBFC423FC: 304EFFFF andi $t6, $v0, 0xFFFF */ - cpu->gpr[14] = cpu->gpr[2] & 0xFFFFu; + { uint32_t _pgx1 = cpu->gpr[2]; cpu->gpr[14] = cpu->gpr[2] & 0xFFFFu; + PGXP_ALU(0x304EFFFFu, cpu->gpr[14], _pgx1, 0xFFFFu); } #ifdef PSX_COSIM cosim_instr(0x8005A3FCu); #endif @@ -853799,7 +856170,8 @@ label_BFC423E4: psx_cyc_step(cpu, 0xE000u); #endif /* 0xBFC42400: 01AE7824 and $t7, $t5, $t6 */ - cpu->gpr[15] = cpu->gpr[13] & cpu->gpr[14]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[13] & cpu->gpr[14]; + PGXP_ALU(0x01AE7824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A400u); #endif @@ -853843,7 +856215,8 @@ label_BFC423E4: psx_cyc_step(cpu, 0x3000004u); #endif /* 0xBFC42414: 0302C824 and $t9, $t8, $v0 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[2]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[2]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[2]; + PGXP_ALU(0x0302C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A414u); #endif @@ -854416,7 +856789,8 @@ label_BFC424A8: psx_cyc_step(cpu, 0xC000u); #endif /* 0xBFC424C8: 31CF3FFF andi $t7, $t6, 0x3FFF */ - cpu->gpr[15] = cpu->gpr[14] & 0x3FFFu; + { uint32_t _pgx1 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[14] & 0x3FFFu; + PGXP_ALU(0x31CF3FFFu, cpu->gpr[15], _pgx1, 0x3FFFu); } #ifdef PSX_COSIM cosim_instr(0x8005A4C8u); #endif @@ -854471,7 +856845,8 @@ label_BFC424A8: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC424E0: 33283FFF andi $t0, $t9, 0x3FFF */ - cpu->gpr[8] = cpu->gpr[25] & 0x3FFFu; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x3FFFu; + PGXP_ALU(0x33283FFFu, cpu->gpr[8], _pgx1, 0x3FFFu); } #ifdef PSX_COSIM cosim_instr(0x8005A4E0u); #endif @@ -854514,7 +856889,8 @@ label_BFC424A8: psx_cyc_step(cpu, 0xC00u); #endif /* 0xBFC424F4: 314B3FFF andi $t3, $t2, 0x3FFF */ - cpu->gpr[11] = cpu->gpr[10] & 0x3FFFu; + { uint32_t _pgx1 = cpu->gpr[10]; cpu->gpr[11] = cpu->gpr[10] & 0x3FFFu; + PGXP_ALU(0x314B3FFFu, cpu->gpr[11], _pgx1, 0x3FFFu); } #ifdef PSX_COSIM cosim_instr(0x8005A4F4u); #endif @@ -854557,7 +856933,8 @@ label_BFC424A8: psx_cyc_step(cpu, 0x6000u); #endif /* 0xBFC42508: 31AE1000 andi $t6, $t5, 0x1000 */ - cpu->gpr[14] = cpu->gpr[13] & 0x1000u; + { uint32_t _pgx1 = cpu->gpr[13]; cpu->gpr[14] = cpu->gpr[13] & 0x1000u; + PGXP_ALU(0x31AE1000u, cpu->gpr[14], _pgx1, 0x1000u); } #ifdef PSX_COSIM cosim_instr(0x8005A508u); #endif @@ -856355,7 +858732,8 @@ label_BFC4270C: psx_cyc_step(cpu, 0x40C000u); #endif /* 0xBFC42728: 01D67824 and $t7, $t6, $s6 */ - cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[22]; + { uint32_t _pgx1 = cpu->gpr[14]; uint32_t _pgx2 = cpu->gpr[22]; cpu->gpr[15] = cpu->gpr[14] & cpu->gpr[22]; + PGXP_ALU(0x01D67824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A728u); #endif @@ -856577,7 +858955,8 @@ label_BFC4276C: psx_cyc_step(cpu, 0x3020000u); #endif /* 0xBFC42774: 0311C824 and $t9, $t8, $s1 */ - cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[17]; + { uint32_t _pgx1 = cpu->gpr[24]; uint32_t _pgx2 = cpu->gpr[17]; cpu->gpr[25] = cpu->gpr[24] & cpu->gpr[17]; + PGXP_ALU(0x0311C824u, cpu->gpr[25], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A774u); #endif @@ -856648,7 +859027,8 @@ label_BFC42780: psx_cyc_step(cpu, 0x700u); #endif /* 0xBFC4278C: 01095024 and $t2, $t0, $t1 */ - cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + { uint32_t _pgx1 = cpu->gpr[8]; uint32_t _pgx2 = cpu->gpr[9]; cpu->gpr[10] = cpu->gpr[8] & cpu->gpr[9]; + PGXP_ALU(0x01095024u, cpu->gpr[10], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A78Cu); #endif @@ -856866,7 +859246,8 @@ label_BFC427C8: psx_cyc_step(cpu, 0x406000u); #endif /* 0xBFC427D0: 01B67024 and $t6, $t5, $s6 */ - cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[22]; + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[22]; cpu->gpr[14] = cpu->gpr[13] & cpu->gpr[22]; + PGXP_ALU(0x01B67024u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A7D0u); #endif @@ -856992,7 +859373,8 @@ label_BFC427F8: psx_cyc_step(cpu, 0x1008002u); #endif /* 0xBFC42800: 01E1C024 and $t8, $t7, $at */ - cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[1]; + { uint32_t _pgx1 = cpu->gpr[15]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[24] = cpu->gpr[15] & cpu->gpr[1]; + PGXP_ALU(0x01E1C024u, cpu->gpr[24], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A800u); #endif @@ -857062,7 +859444,8 @@ label_BFC42810: psx_cyc_step(cpu, 0x2000100u); #endif /* 0xBFC42818: 33288000 andi $t0, $t9, 0x8000 */ - cpu->gpr[8] = cpu->gpr[25] & 0x8000u; + { uint32_t _pgx1 = cpu->gpr[25]; cpu->gpr[8] = cpu->gpr[25] & 0x8000u; + PGXP_ALU(0x33288000u, cpu->gpr[8], _pgx1, 0x8000u); } #ifdef PSX_COSIM cosim_instr(0x8005A818u); #endif @@ -857558,7 +859941,8 @@ label_BFC42898: psx_cyc_step(cpu, 0x6002u); #endif /* 0xBFC428B0: 01A17027 nor $t6, $t5, $at */ - cpu->gpr[14] = ~(cpu->gpr[13] | cpu->gpr[1]); + { uint32_t _pgx1 = cpu->gpr[13]; uint32_t _pgx2 = cpu->gpr[1]; cpu->gpr[14] = ~(cpu->gpr[13] | cpu->gpr[1]); + PGXP_ALU(0x01A17027u, cpu->gpr[14], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A8B0u); #endif @@ -857566,7 +859950,8 @@ label_BFC42898: psx_cyc_step(cpu, 0xC800u); #endif /* 0xBFC428B4: 016E7824 and $t7, $t3, $t6 */ - cpu->gpr[15] = cpu->gpr[11] & cpu->gpr[14]; + { uint32_t _pgx1 = cpu->gpr[11]; uint32_t _pgx2 = cpu->gpr[14]; cpu->gpr[15] = cpu->gpr[11] & cpu->gpr[14]; + PGXP_ALU(0x016E7824u, cpu->gpr[15], _pgx1, _pgx2); } #ifdef PSX_COSIM cosim_instr(0x8005A8B4u); #endif From d240180943972997516403aa3a05e894a14f795a Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sun, 4 Oct 2026 10:41:15 -0700 Subject: [PATCH 46/52] Revert #487: recomp-net header block and update_cmake tool #479 guards the host_relay.h include, so offline title builds no longer need recomp-net's include dir; the tool had no other managed block. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../project_studio/bulkops.py | 60 ------------- .../new_project_layout/project_studio/cli.py | 40 --------- .../new_project_layout/project_studio/gui.py | 37 -------- .../templates/CMakeLists.txt.in | 10 --- tools/update_cmake.ps1 | 14 --- tools/update_cmake.py | 89 ------------------- tools/update_cmake.sh | 12 --- 7 files changed, 262 deletions(-) delete mode 100644 tools/update_cmake.ps1 delete mode 100755 tools/update_cmake.py delete mode 100755 tools/update_cmake.sh diff --git a/tools/new_project_layout/project_studio/bulkops.py b/tools/new_project_layout/project_studio/bulkops.py index f69889e4..7a395c53 100644 --- a/tools/new_project_layout/project_studio/bulkops.py +++ b/tools/new_project_layout/project_studio/bulkops.py @@ -21,7 +21,6 @@ from .gitops import ( push, push_modules, push_psxrecomp, - _git, repo_status, run_release_workflow, switch_branch, @@ -239,65 +238,6 @@ def bulk_migrate_bundled( return map_repos(repos, one, jobs=jobs, on_repo=on_repo) -def _load_update_cmake(): - """Import tools/update_cmake.py from the framework running this tool, so - projects pinned to an older psxrecomp still get the current blocks.""" - import importlib.util - - path = Path(__file__).resolve().parents[2] / "update_cmake.py" - spec = importlib.util.spec_from_file_location("psx_update_cmake", path) - if spec is None or spec.loader is None or not path.is_file(): - raise FileNotFoundError(f"update_cmake.py not found at {path}") - mod = importlib.util.module_from_spec(spec) - spec.loader.exec_module(mod) - return mod - - -def bulk_update_cmake( - repos: list[tuple[str, Path]], - *, - commit: bool = True, - push_remote: bool = False, - dry_run: bool = False, - jobs: int = 1, - on_repo: OnRepoResults | None = None, -) -> list[CmdResult]: - """Sync each repo's CMakeLists.txt with the scaffold template's managed - blocks (tools/update_cmake.py), committing only CMakeLists.txt.""" - um = _load_update_cmake() - - def one(label: str, root: Path) -> list[CmdResult]: - path = root / "CMakeLists.txt" - if not path.is_file(): - return [CmdResult(False, f"{label}: no CMakeLists.txt")] - try: - old = path.read_text(encoding="utf-8") - new = um.sync(old) - except (OSError, SystemExit) as exc: - return [CmdResult(False, f"{label}: {exc}")] - if new == old: - return [CmdResult(True, f"{label}: CMakeLists.txt up to date")] - if dry_run: - return [CmdResult(True, f"{label}: would update CMakeLists.txt")] - path.write_text(new, encoding="utf-8", newline="") - if not commit: - return [CmdResult(True, f"{label}: updated CMakeLists.txt (uncommitted)")] - msg = "CMake: sync managed blocks (update_cmake)" - code, out, err = _git(root, "add", "--", "CMakeLists.txt") - if code == 0: - code, out, err = _git(root, "commit", "-m", msg, "--", "CMakeLists.txt") - if code != 0: - return [CmdResult(False, f"{label}: updated but commit failed", err or out)] - if push_remote: - r = push(root) - if not r.ok: - return [CmdResult(False, f"{label}: committed, push failed", r.detail)] - return [CmdResult(True, f"{label}: updated, committed, pushed")] - return [CmdResult(True, f"{label}: updated + committed")] - - return map_repos(repos, one, jobs=jobs, on_repo=on_repo) - - def bulk_pull( repos: list[tuple[str, Path]], *, diff --git a/tools/new_project_layout/project_studio/cli.py b/tools/new_project_layout/project_studio/cli.py index e680ad9b..3d449bf8 100644 --- a/tools/new_project_layout/project_studio/cli.py +++ b/tools/new_project_layout/project_studio/cli.py @@ -1337,35 +1337,6 @@ def cmd_git_bulk_migrate_bundled(args: argparse.Namespace) -> int: return 1 if failed else 0 -def cmd_git_bulk_update_cmake(args: argparse.Namespace) -> int: - from project_studio.bulkops import bulk_update_cmake - from project_studio.repo_index import load_index - - repos = _bulk_repos_or_die(args) - if repos is None: - return 2 - jobs = int(getattr(args, "jobs", 0) or 0) or int(getattr(load_index(), "bulk_jobs", 1) or 1) - - def on_repo(label: str, results: list) -> None: - for r in results: - print(f" [{'OK' if r.ok else 'FAIL'}] {r.message}", flush=True) - if r.detail: - for ln in r.detail.splitlines(): - print(f" {ln}", flush=True) - - results = bulk_update_cmake( - repos, - commit=not bool(getattr(args, "no_commit", False)), - push_remote=bool(getattr(args, "push", False)), - dry_run=bool(getattr(args, "dry_run", False)), - jobs=jobs, - on_repo=on_repo, - ) - failed = sum(1 for r in results if not r.ok) - print(f"bulk update-cmake: {len(results) - failed} ok, {failed} failed", flush=True) - return 1 if failed else 0 - - def cmd_git_migrate_bundled(args: argparse.Namespace) -> int: from project_studio.migrate_bundled import BundledMigrateOptions, migrate_to_bundled_release @@ -2329,17 +2300,6 @@ def build_parser() -> argparse.ArgumentParser: p_gbmb.add_argument("--jobs", type=int, default=0, help="Parallel repos (default: index setting)") p_gbmb.set_defaults(func=cmd_git_bulk_migrate_bundled) - p_gbuc = git_sub.add_parser( - "bulk-update-cmake", - help="Sync selected repos' CMakeLists.txt with the scaffold template " - "(tools/update_cmake.py); commits CMakeLists.txt only", - ) - add_bulk_select(p_gbuc) - p_gbuc.add_argument("--no-commit", action="store_true", help="Edit CMakeLists.txt but do not commit") - p_gbuc.add_argument("--push", action="store_true", help="Push after committing") - p_gbuc.add_argument("--jobs", type=int, default=0, help="Parallel repos (default: index setting)") - p_gbuc.set_defaults(func=cmd_git_bulk_update_cmake) - p_gmb = git_sub.add_parser( "migrate-bundled", help="Move one game repo onto bundled releases", diff --git a/tools/new_project_layout/project_studio/gui.py b/tools/new_project_layout/project_studio/gui.py index a2bfd28a..67d412a3 100644 --- a/tools/new_project_layout/project_studio/gui.py +++ b/tools/new_project_layout/project_studio/gui.py @@ -2241,13 +2241,6 @@ class ProjectStudioApp: height=34, command=self._bulk_install_ci, ).pack(side="left", padx=8) - ctk.CTkButton( - relb, - text="Update CMake", - width=120, - height=34, - command=self._bulk_update_cmake, - ).pack(side="left") ctk.CTkLabel( relb, text="Dispatches release.yml per selected game repo (gh). " @@ -4547,36 +4540,6 @@ class ProjectStudioApp: done_warn_prefix="Release dispatch finished with failures.", ) - def _bulk_update_cmake(self) -> None: - from .bulkops import bulk_update_cmake - - repos = self._bulk_require_selection() - if repos is None: - return - dry = self._git_dry() - if not dry: - names = "\n".join(f"* {lab}" for lab, _ in repos) - if not messagebox.askyesno( - "Project Studio", - f"Sync CMakeLists.txt with the psxrecomp template and commit it " - f"(CMakeLists.txt only, not pushed) for {len(repos)} repo(s)?\n\n{names}", - parent=self.root, - ): - return - - def run(*, jobs: int, on_repo) -> list: - return bulk_update_cmake( - repos, commit=True, push_remote=False, dry_run=dry, jobs=jobs, on_repo=on_repo - ) - - self._bulk_run_bg( - f"Bulk update CMake ({len(repos)} repos)", - run, - refresh_git=True, - done_info="Update CMake finished — see activity log.", - done_warn_prefix="Update CMake finished with failures.", - ) - def _bulk_install_ci(self) -> None: from .bulkops import bulk_install_ci diff --git a/tools/new_project_layout/templates/CMakeLists.txt.in b/tools/new_project_layout/templates/CMakeLists.txt.in index a412c646..f984ea95 100644 --- a/tools/new_project_layout/templates/CMakeLists.txt.in +++ b/tools/new_project_layout/templates/CMakeLists.txt.in @@ -49,16 +49,6 @@ psxrecomp_add_game_runtime(psx-runtime @CODEGEN_SETUP_ARG@ ) -# >>> psxrecomp:recomp-net-headers (managed by tools/update_cmake.{sh,ps1}) -# runtime/src/main.cpp includes recomp_net/host_relay.h unconditionally (a -# plain-C types header). With PSX_NETPLAY off nothing adds recomp-net's include -# dir, so expose it whenever the submodule is checked out. -if(EXISTS "${PSXRECOMP_ROOT}/lib/recomp-net/include/recomp_net/host_relay.h") - target_include_directories(psx-runtime PRIVATE - "${PSXRECOMP_ROOT}/lib/recomp-net/include") -endif() -# <<< psxrecomp:recomp-net-headers - # Stage runtime configs next to the exe for direct build/ launches. Only copy # files that exist — never fail POST_BUILD when game_options.toml is absent. foreach(_PSX_RUNTIME_CONFIG game.toml game_options.toml) diff --git a/tools/update_cmake.ps1 b/tools/update_cmake.ps1 deleted file mode 100644 index e1167d72..00000000 --- a/tools/update_cmake.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -# update_cmake.ps1 — sync a game project's CMakeLists.txt with the scaffold -# template's managed blocks (implementation: tools/update_cmake.py). -# Usage: update_cmake.ps1 [--project DIR] [--check] [--dry-run] -$ErrorActionPreference = 'Stop' -$Root = Split-Path -Parent $PSScriptRoot -$Py = $env:PYTHON -if (-not $Py) { - foreach ($c in 'python3', 'python', 'py') { - if (Get-Command $c -ErrorAction SilentlyContinue) { $Py = $c; break } - } -} -if (-not $Py) { Write-Error 'update_cmake: python not found on PATH'; exit 1 } -& $Py (Join-Path $Root 'tools/update_cmake.py') @args -exit $LASTEXITCODE diff --git a/tools/update_cmake.py b/tools/update_cmake.py deleted file mode 100755 index 6ca1cf10..00000000 --- a/tools/update_cmake.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python3 -"""Idempotently sync a game project's CMakeLists.txt with the scaffold template. - -The managed block lives in tools/new_project_layout/templates/CMakeLists.txt.in -between `# >>> psxrecomp:` / `# <<< psxrecomp:` markers (single -source of truth). For each block this inserts it after the project's -psxrecomp_add_game_runtime(...) call, or replaces it in place if the markers are -already present. Run via tools/update_cmake.sh or tools/update_cmake.ps1. - - update_cmake.py [--project DIR] [--check] [--dry-run] - --check exit 1 if the project is out of date (writes nothing; for CI) - --dry-run print the unified diff, write nothing -""" -import argparse, difflib, re, sys -from pathlib import Path - -ROOT = Path(__file__).resolve().parent.parent -TEMPLATE = ROOT / "tools/new_project_layout/templates/CMakeLists.txt.in" -BLOCK_RE = re.compile( - r"^# >>> psxrecomp:(?P[\w-]+).*?\n.*?^# <<< psxrecomp:(?P=n)[ \t]*\n", - re.M | re.S) - - -def template_blocks(): - return {m["n"]: m.group(0) for m in BLOCK_RE.finditer(TEMPLATE.read_text(encoding="utf-8"))} - - -def add_runtime_end(text): - """Index just past the closing ')' of psxrecomp_add_game_runtime(...).""" - m = re.search(r"^\s*psxrecomp_add_game_runtime\s*\(", text, re.M) - if not m: - return None - depth, i, in_str = 0, m.end() - 1, False - while i < len(text): - c = text[i] - if c == '"' and text[i - 1] != "\\": - in_str = not in_str - elif not in_str: - if c == "#": - i = text.find("\n", i) - if i < 0: - return None - continue - depth += c == "(" - depth -= c == ")" - if depth == 0: - nl = text.find("\n", i) - return len(text) if nl < 0 else nl + 1 - i += 1 - return None - - -def sync(text): - for name, block in template_blocks().items(): - m = re.search(r"^# >>> psxrecomp:%s.*?\n.*?^# <<< psxrecomp:%s[ \t]*\n" % (re.escape(name), re.escape(name)), text, re.M | re.S) - if m: - text = text[:m.start()] + block + text[m.end():] - continue - end = add_runtime_end(text) - if end is None: - sys.exit("update_cmake: no psxrecomp_add_game_runtime(...) call found") - text = text[:end] + "\n" + block + text[end:] - return text - - -def main(): - ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) - ap.add_argument("--project", default=".", help="game project dir (default: cwd)") - ap.add_argument("--check", action="store_true") - ap.add_argument("--dry-run", action="store_true") - a = ap.parse_args() - path = Path(a.project).resolve() / "CMakeLists.txt" - if not path.is_file(): - sys.exit(f"update_cmake: {path} not found") - old = path.read_text(encoding="utf-8") - new = sync(old) - if new == old: - print("update_cmake: up to date") - return 0 - if a.check or a.dry_run: - sys.stdout.writelines(difflib.unified_diff(old.splitlines(True), new.splitlines(True), "CMakeLists.txt", "CMakeLists.txt (updated)")) - return 1 if a.check else 0 - path.write_text(new, encoding="utf-8", newline="") - print(f"update_cmake: updated {path}") - return 0 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/tools/update_cmake.sh b/tools/update_cmake.sh deleted file mode 100755 index 2dc38f32..00000000 --- a/tools/update_cmake.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# update_cmake.sh — sync a game project's CMakeLists.txt with the scaffold -# template's managed blocks (implementation: tools/update_cmake.py). -# Usage: update_cmake.sh [--project DIR] [--check] [--dry-run] -set -eu -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -PY="${PYTHON:-}" -if [ -z "$PY" ]; then - for c in python3 python; do command -v "$c" >/dev/null 2>&1 && { PY="$c"; break; }; done -fi -[ -n "$PY" ] || { echo "update_cmake: python not found on PATH" >&2; exit 1; } -exec "$PY" "$ROOT/tools/update_cmake.py" "$@" From 6426b25f3de3da699bf5d8c8c0917e793093e648 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sun, 4 Oct 2026 17:51:23 -0700 Subject: [PATCH 47/52] Preserve restored handoff and snapshot host-call continuations --- runtime/CMakeLists.txt | 9 +++++ runtime/include/boot_state.h | 1 + runtime/include/fntrace.h | 3 ++ runtime/include/interrupts.h | 6 ++++ runtime/include/mod_packages.h | 2 ++ runtime/include/mod_plugins.h | 4 +++ runtime/src/boot_state.c | 25 +++++++++++-- runtime/src/fntrace.c | 9 +++++ runtime/src/interrupts.c | 8 +++++ runtime/src/memory.c | 10 ++++++ runtime/src/mod_packages.cpp | 23 +++++++++++- runtime/src/mod_runtime.cpp | 5 +++ runtime/src/traps.c | 2 ++ runtime/tests/test_fntrace_restore_handoff.c | 37 ++++++++++++++++++++ runtime/tests/test_host_snapshot_guard.c | 36 +++++++++++++++++++ runtime/tests/test_mod_runtime.cpp | 15 ++++++++ 16 files changed, 192 insertions(+), 3 deletions(-) create mode 100644 runtime/tests/test_fntrace_restore_handoff.c create mode 100644 runtime/tests/test_host_snapshot_guard.c diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index d39d56e1..603b982d 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -30,6 +30,15 @@ if(BUILD_TESTING) target_include_directories(mod_texture_banks_test PRIVATE include) add_test(NAME mod_texture_banks_test COMMAND mod_texture_banks_test) if(NOT MSVC) + add_executable(host_snapshot_guard_test tests/test_host_snapshot_guard.c) + add_executable(fntrace_restore_handoff_test + tests/test_fntrace_restore_handoff.c src/fntrace.c) + foreach(test_target host_snapshot_guard_test fntrace_restore_handoff_test) + target_include_directories(${test_target} PRIVATE include src) + target_compile_options(${test_target} PRIVATE -O2 -flto -ffunction-sections -fdata-sections) + target_link_options(${test_target} PRIVATE -flto -Wl,--gc-sections) + add_test(NAME ${test_target} COMMAND ${test_target}) + endforeach() add_executable(ws_world_scene_test tests/test_ws_world_scene.c) target_include_directories(ws_world_scene_test PRIVATE include src) target_compile_options(ws_world_scene_test PRIVATE -O2 -flto -ffunction-sections -fdata-sections) diff --git a/runtime/include/boot_state.h b/runtime/include/boot_state.h index 3ee203e1..6a74c689 100644 --- a/runtime/include/boot_state.h +++ b/runtime/include/boot_state.h @@ -84,6 +84,7 @@ typedef struct { * never allowed) -> normal boot + recapture. */ enum { + BS_SEC_HANDOFF = 0x12, /* game-start latch; optional for legacy snapshots */ BS_SEC_MODMEM = 0x11, /* allocated opt-in CPU/GPU enhancement arenas */ BS_SEC_CPU = 0x01, /* CPUState: gpr/pc/hi/lo/cop0/gte_data/gte_ctrl */ BS_SEC_RAM = 0x02, /* 2 MB main RAM */ diff --git a/runtime/include/fntrace.h b/runtime/include/fntrace.h index 35867c05..1e18bffd 100644 --- a/runtime/include/fntrace.h +++ b/runtime/include/fntrace.h @@ -89,6 +89,9 @@ void fntrace_record(CPUState* cpu, uint32_t target); * First dispatch into [lo, hi) calls cdrom_notify_game_started(). */ void fntrace_set_game_range(uint32_t lo, uint32_t hi); int fntrace_is_game_started(void); +/* Restore the handoff latch without repeating boot-only RAM/CD mutations. + * -1 infers legacy snapshots from the registered entry's live bytes. */ +void fntrace_restore_game_started(int started); /* One-shot game-start handoff. Idempotent — safe to call from any path * (compiled dispatch, dirty-RAM interpreter, generated entry function). * Performs dirty-image baseline clear, low-boot scratch clear, CD speed diff --git a/runtime/include/interrupts.h b/runtime/include/interrupts.h index 9dd87ce0..2bac2588 100644 --- a/runtime/include/interrupts.h +++ b/runtime/include/interrupts.h @@ -8,6 +8,12 @@ extern "C" { #endif struct CPUState; +/* A host adapter that preserves registers outside guest RAM is not a + * serializable continuation. Defer snapshots until it returns; scheduler + * escapes discard the scope with the abandoned host stack. */ +void psx_snapshot_host_call_begin(void); +void psx_snapshot_host_call_end(void); +void psx_snapshot_host_call_reset(void); /* IRQ bit positions in I_STAT/I_MASK */ #define IRQ_VBLANK 0 diff --git a/runtime/include/mod_packages.h b/runtime/include/mod_packages.h index b4860c92..fb4ce010 100644 --- a/runtime/include/mod_packages.h +++ b/runtime/include/mod_packages.h @@ -454,9 +454,11 @@ bool mod_register_builtin_resolver(const std::string& id, ModBuiltinResolver res void mod_clear_builtin_resolvers_for_tests(); bool mod_register_activation_plugin(const std::string& id, void (*callback)(void)); bool mod_register_vblank_plugin(const std::string& id, void (*callback)(void)); +bool mod_register_savestate_plugin(const std::string& id, void (*callback)(void)); bool mod_plugin_registered(const std::string& id); void mod_invoke_activation_plugin(const std::string& id); void mod_invoke_vblank_plugin(const std::string& id); +void mod_invoke_savestate_plugin(const std::string& id); void mod_clear_plugins_for_tests(); } // namespace PSXRecompV4 diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 30887ac5..a37b420c 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -21,6 +21,10 @@ int psx_mod_register_activation_plugin(const char* id, PSXModActivationCallback callback); int psx_mod_register_vblank_plugin(const char* id, PSXModVBlankCallback callback); +/* Runs after successful guest-state restore, before the restored PC resumes. + * Rebind host hooks here; do not advance guest gameplay as a VBlank would. */ +int psx_mod_register_savestate_plugin(const char* id, + PSXModActivationCallback callback); int psx_mod_register_function_entry_plugin( const char* id, uint32_t address, PSXModFunctionEntryCallback callback); /* Called only from generated functions explicitly listed by the game config. */ diff --git a/runtime/src/boot_state.c b/runtime/src/boot_state.c index 0a644f4d..700945e5 100644 --- a/runtime/src/boot_state.c +++ b/runtime/src/boot_state.c @@ -7,6 +7,7 @@ #include "gpu_vram_dirty.h" #include "cpu_state.h" /* gte_canonicalize_cpu_state after CPU wire restore */ #include "interrupts.h" +#include "fntrace.h" #include "psx_cycles.h" #include "psx_icache.h" /* g_psx_icache_tv — fetch-cost tags in BS_SEC_ICACHE */ #include "pst_wire.h" @@ -372,11 +373,18 @@ static int boot_state_save_to(BsOut* o, const CPUState* cpu, h.codegen_hash = (uint32_t)PSX_OVERLAY_CODEGEN_HASH; h.abi_tag = (int32_t)PSX_OVERLAY_ABI_TAG; h.codegen_ver = (uint32_t)PSX_OVERLAY_CODEGEN_VER; - h.section_count = 16 + (psx_mod_memory_snapshot_bytes() ? 1u : 0u); + h.section_count = 17 + (psx_mod_memory_snapshot_bytes() ? 1u : 0u); ok = write_header_le(o, &h); if (ok) ok = write_cpu_section(o, cpu); + if (ok) { + uint8_t phase[4]; + PstW w; + pst_w_init(&w, phase, sizeof phase); + ok = pst_w_u32(&w, (uint32_t)fntrace_is_game_started()) && + write_section(o, BS_SEC_HANDOFF, phase, sizeof phase); + } if (ok) ok = write_section(o, BS_SEC_RAM, memory_get_ram_ptr(), RAM_SIZE); if (ok) ok = write_section(o, BS_SEC_SPAD, memory_get_scratchpad_ptr(), SPAD_SIZE); if (ok && psx_mod_memory_snapshot_bytes()) @@ -816,6 +824,7 @@ int boot_state_load_buffer(const uint8_t* file, size_t file_len, (1u< 1) ok = 0; + else game_started = (int)phase; + } + else if (!apply_section(tag, apply_ptr, apply_len, cpu, entry_pc)) ok = 0; else if (tag < 32) seen |= (1u << tag); { double dt = boot_state_mono_ms() - t_sec; @@ -909,6 +925,11 @@ int boot_state_load_buffer(const uint8_t* file, size_t file_len, if (!ok || (seen & required) != required) return 0; + /* Re-running the normal handoff after a cold gameplay restore clears the + * restored low kernel scratch and dirtiness baseline, then captures a + * bogus boot state. CD speed is already in the CD-ROM section. */ + fntrace_restore_game_started(game_started); + /* RAM was memcpy'd; force overlay revalidation before resume. */ overlay_watch_invalidate_after_ram_restore(); diff --git a/runtime/src/fntrace.c b/runtime/src/fntrace.c index b767ee6e..0f27f1d4 100644 --- a/runtime/src/fntrace.c +++ b/runtime/src/fntrace.c @@ -47,6 +47,15 @@ void fntrace_set_game_range(uint32_t lo, uint32_t hi) { int fntrace_is_game_started(void) { return s_game_started; } +void fntrace_restore_game_started(int started) { + if (started < 0) { + extern int dirty_ram_text_image_matches(uint32_t phys, uint32_t len); + started = s_game_entry_phys != 0 && + dirty_ram_text_image_matches(s_game_entry_phys, 32u); + } + s_game_started = started != 0; +} + /* Centralised game-start transition. Idempotent — safe to call from both * the dispatcher (fntrace_record) and the generated entry-point function. * Performs the complete handoff side effects: dirty-image baseline clear, diff --git a/runtime/src/interrupts.c b/runtime/src/interrupts.c index e3e6c143..08cf108f 100644 --- a/runtime/src/interrupts.c +++ b/runtime/src/interrupts.c @@ -632,6 +632,13 @@ int psx_irq_resume_context_snapshot_site(void) return g_cosim_dirty_pump_site; } +static unsigned s_snapshot_host_call_depth; +void psx_snapshot_host_call_begin(void) { ++s_snapshot_host_call_depth; } +void psx_snapshot_host_call_end(void) { + if (s_snapshot_host_call_depth) --s_snapshot_host_call_depth; +} +void psx_snapshot_host_call_reset(void) { s_snapshot_host_call_depth = 0; } + uint32_t psx_irq_resume_context_snapshot_pc(void) { return g_dirty_safe_resume_pc; @@ -639,6 +646,7 @@ uint32_t psx_irq_resume_context_snapshot_pc(void) int psx_irq_resume_context_snapshot_safe_at(uint32_t resume_pc) { + if (s_snapshot_host_call_depth) return 0; if (g_cosim_dirty_pump_site == 0) return 1; diff --git a/runtime/src/memory.c b/runtime/src/memory.c index dbb05188..8dcd1e80 100644 --- a/runtime/src/memory.c +++ b/runtime/src/memory.c @@ -522,6 +522,16 @@ void dirty_ram_register_text_image(uint32_t phys_lo, const uint8_t *bytes, int dirty_ram_text_image_registered(void) { return text_ref_image != NULL; } +/* Cold legacy restores have no serialized handoff latch. Check live bytes + * directly: the page-clean shortcut is not evidence of a loaded game after + * RAM/dirty-bit replacement, and a warm session's latch is not evidence either. */ +int dirty_ram_text_image_matches(uint32_t phys, uint32_t len) { + phys &= 0x1FFFFFFFu; + return text_ref_image && len && phys >= text_ref_lo && phys < text_ref_hi && + len <= text_ref_hi - phys && + memcmp(ram + phys, text_ref_image + phys - text_ref_lo, len) == 0; +} + static inline void text_guard_note_write(uint32_t phys, uint32_t val, int size) { if (!text_ref_image) return; if (phys < text_ref_lo || phys + (uint32_t)size > text_ref_hi) return; diff --git a/runtime/src/mod_packages.cpp b/runtime/src/mod_packages.cpp index 150a5a3d..cae42981 100644 --- a/runtime/src/mod_packages.cpp +++ b/runtime/src/mod_packages.cpp @@ -32,6 +32,7 @@ std::map& builtin_resolvers() { } struct RegisteredPlugin { + void (*savestate)(void) = nullptr; PSXModActivationCallback activation = nullptr; PSXModVBlankCallback vblank = nullptr; }; @@ -1452,7 +1453,21 @@ bool mod_register_vblank_plugin(const std::string& id, void (*callback)(void)) { bool mod_plugin_registered(const std::string& id) { const auto found = registered_plugins().find(id); return found != registered_plugins().end() && - (found->second.activation || found->second.vblank); + (found->second.activation || found->second.vblank || found->second.savestate); +} + +bool mod_register_savestate_plugin(const std::string& id, void (*callback)(void)) { + if (!valid_id(id) || !callback) return false; + RegisteredPlugin& plugin = registered_plugins()[id]; + if (plugin.savestate) return false; + plugin.savestate = callback; + return true; +} + +void mod_invoke_savestate_plugin(const std::string& id) { + const auto found = registered_plugins().find(id); + if (found != registered_plugins().end() && found->second.savestate) + found->second.savestate(); } void mod_invoke_activation_plugin(const std::string& id) { @@ -3663,3 +3678,9 @@ extern "C" int psx_mod_register_activation_plugin( return id && PSXRecompV4::mod_register_activation_plugin(id, callback) ? 1 : 0; } + +extern "C" int psx_mod_register_savestate_plugin( + const char* id, PSXModActivationCallback callback) { + return id && + PSXRecompV4::mod_register_savestate_plugin(id, callback) ? 1 : 0; +} diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index 92e4ee97..a241030e 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -1287,6 +1287,11 @@ extern "C" void mod_runtime_on_savestate_loaded(void) { applied = true; } s.main_applied = true; + for (const ModResolution::Plugin& plugin : s.plan.plugins) { + s.current_plugin = &plugin; + mod_invoke_savestate_plugin(plugin.id); + s.current_plugin = nullptr; + } if (applied) std::fprintf(stdout, "psxrecomp: reapplied mod plan %s after savestate restore\n", diff --git a/runtime/src/traps.c b/runtime/src/traps.c index d0145a19..9d246b0a 100644 --- a/runtime/src/traps.c +++ b/runtime/src/traps.c @@ -5,6 +5,7 @@ */ #include "cpu_state.h" +#include "interrupts.h" #include "psx_bss.h" #include "psx_runtime.h" /* fix B: psx_exc_escape_reason_t + g_exc_escape_reason */ #include "debug_server.h" @@ -810,6 +811,7 @@ void psx_scheduler_run(CPUState* cpu) g_sched_escape.reason = PSX_RUN_CONTINUE; for (;;) { if (setjmp(g_scheduler_jmpbuf) != 0) { + psx_snapshot_host_call_reset(); /* A structured escape unwound the native stack to here. Reset the * invariants the skipped psx_dispatch_impl frames would otherwise * own. No exception_jmpbuf frame is ever skipped (switch fires only diff --git a/runtime/tests/test_fntrace_restore_handoff.c b/runtime/tests/test_fntrace_restore_handoff.c new file mode 100644 index 00000000..3d7ccfe2 --- /dev/null +++ b/runtime/tests/test_fntrace_restore_handoff.c @@ -0,0 +1,37 @@ +#include "fntrace.h" +#include +#include + +static int effects, image_matches; +void dirty_ram_clear_image_baseline(void) { ++effects; } +void memory_clear_low_boot_scratch(void) { ++effects; } +void cdrom_notify_game_started(void) { ++effects; } +void boot_state_trigger_capture(const CPUState* cpu) { (void)cpu; ++effects; } +int dirty_ram_text_image_matches(uint32_t phys, uint32_t len) { + return image_matches && phys == 0x6B58Cu && len == 32u; +} +static void check(int ok, const char* message) { + if (!ok) { fprintf(stderr, "FAIL: %s\n", message); exit(1); } +} +int main(void) { + CPUState cpu = {0}; + fntrace_set_game_range(0x8006B58Cu, 0); + fntrace_restore_game_started(1); + fntrace_mark_game_started(&cpu); + check(fntrace_is_game_started() && !effects, "cold game restore skips destructive handoff"); + fntrace_restore_game_started(0); + check(!fntrace_is_game_started() && !effects, "pre-game restore resets warm latch"); + fntrace_mark_game_started(&cpu); + check(effects == 4, "normal boot retains all handoff effects"); + fntrace_mark_game_started(&cpu); + check(effects == 4, "handoff remains one-shot"); + image_matches = 1; + fntrace_set_game_range(0x8006B58Cu, 0); + fntrace_restore_game_started(-1); + check(fntrace_is_game_started() && effects == 4, "legacy game restore infers loaded entry"); + image_matches = 0; + fntrace_restore_game_started(-1); + check(!fntrace_is_game_started(), "legacy BIOS restore does not inherit warm game latch"); + puts("restored handoff checks passed"); + return 0; +} diff --git a/runtime/tests/test_host_snapshot_guard.c b/runtime/tests/test_host_snapshot_guard.c new file mode 100644 index 00000000..3adee300 --- /dev/null +++ b/runtime/tests/test_host_snapshot_guard.c @@ -0,0 +1,36 @@ +#include "interrupts.c" + +int g_cosim_dirty_pump_site; +int g_call_unit_depth; +int g_psx_dispatch_depth; +uint32_t g_dirty_safe_resume_pc; + +static void check(int ok, const char* message) { + if (!ok) { fprintf(stderr, "FAIL: %s\n", message); exit(1); } +} + +int main(void) { + uint32_t pc = 0x80025070u; + check(psx_irq_resume_context_snapshot_safe_at(pc), "native boundary admitted"); + psx_snapshot_host_call_begin(); + psx_snapshot_host_call_begin(); + check(!psx_irq_resume_context_snapshot_safe_at(pc), "nested host adapter deferred"); + psx_snapshot_host_call_end(); + check(!psx_irq_resume_context_snapshot_safe_at(pc), "outer adapter still active"); + psx_snapshot_host_call_end(); + check(psx_irq_resume_context_snapshot_safe_at(pc), "register restore admits snapshot"); + g_cosim_dirty_pump_site = 1; + g_dirty_safe_resume_pc = pc; + check(psx_irq_resume_context_snapshot_safe_at(pc), "retired interpreter boundary admitted"); + psx_snapshot_host_call_begin(); + check(!psx_irq_resume_context_snapshot_safe_at(pc), "interpreter adapter deferred"); + psx_snapshot_host_call_reset(); /* scheduler longjmp abandoned the adapter */ + check(psx_irq_resume_context_snapshot_safe_at(pc), "scheduler escape releases abandoned scope"); + psx_snapshot_host_call_end(); /* no underflow */ + check(psx_irq_resume_context_snapshot_safe_at(pc), "unmatched end stays safe"); + check(!psx_irq_resume_context_snapshot_safe_at(pc + 4), "existing resume-PC guard retained"); + g_call_unit_depth = 1; + check(!psx_irq_resume_context_snapshot_safe_at(pc), "existing call-unit guard retained"); + puts("host snapshot continuation checks passed"); + return 0; +} diff --git a/runtime/tests/test_mod_runtime.cpp b/runtime/tests/test_mod_runtime.cpp index 9b66052f..6264b069 100644 --- a/runtime/tests/test_mod_runtime.cpp +++ b/runtime/tests/test_mod_runtime.cpp @@ -20,6 +20,7 @@ static std::array ram; static int failures; static int activation_calls; static int plugin_calls; +static int restore_calls; extern "C" uint8_t psx_read_byte(uint32_t address) { return ram[address & 0x1fffffu]; @@ -61,6 +62,9 @@ extern "C" uint32_t psx_mod_gpu_dma_memory_alloc(uint32_t, uint32_t) { return 0; } extern "C" int psx_ws_x_margin(void) { return 0; } +extern "C" void gpu_ws_tag_hud_primitive(uint32_t, int) {} +extern "C" void gpu_ws_tag_world_primitive(uint32_t, int) {} +extern "C" void gpu_ws_set_adaptive_backdrop_preload(int) {} /* Stand-in for the GPU's display geometry. psx_mod_display_width/height must * report exactly what the presenter reports -- a plugin drawing an overlay @@ -82,6 +86,11 @@ static void test_activation_plugin(void) { activation_calls++; } +static void test_restore_plugin(void) { + restore_calls++; + if (ram[0x1000] != 0xa1) failures++; /* main plan must be reapplied first */ +} + static void check(bool value, const char* message) { if (!value) { std::cerr << "FAIL: " << message << "\n"; @@ -308,6 +317,10 @@ int main() { check(PSXRecompV4::mod_register_vblank_plugin( "runtime.test-vblank", test_vblank_plugin), "runtime test plugin must register"); + check(psx_mod_register_savestate_plugin("runtime.test-vblank", test_restore_plugin), + "restore callback must register through the C API"); + check(!psx_mod_register_savestate_plugin("runtime.test-vblank", test_restore_plugin), + "duplicate restore callback must be rejected"); check(PSXRecompV4::mod_runtime_initialize( root, "SLUS-RUNTIME", 0x80002000, {}, &error), error.c_str()); @@ -347,6 +360,8 @@ int main() { ram[0x1200] = 2; ram[0x1201] = 0; ram[0x1202] = 1; ram[0x1203] = 0x32; mod_runtime_on_savestate_loaded(); + check(restore_calls == 1 && activation_calls == 1 && plugin_calls == 1, + "restore must rebind hooks without activation or a gameplay VBlank"); check(ram[0x1000] == 0xa1 && ram[0x1003] == 0xa4 && ram[0x1100] == 42 && ram[0x1102] == 43 && ram[0x1200] == 1 && ram[0x1201] == 0x42 && From 4e8652fe2df9b24f3d876c6e0d7fdc16db01570d Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sun, 4 Oct 2026 18:53:09 -0700 Subject: [PATCH 48/52] Make host disc reads see the effective modded disc Apply committed sector mods during plugin activation, resolve paths through patched directory records, and bound file size by CD capacity. Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/src/mod_runtime.cpp | 134 +++++++++++++++++++++++------ runtime/tests/test_mod_runtime.cpp | 92 ++++++++++++++++++++ 2 files changed, 200 insertions(+), 26 deletions(-) diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index 6750d47d..45bb27b9 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -1447,6 +1447,86 @@ extern "C" void mod_runtime_enable_disc_patches(void) { PSXRecompV4::state().disc_enabled = true; } +static void patch_committed_disc_sector(uint32_t lba, int raw_sector, + uint8_t* bytes, uint32_t size); + +/* The largest file a CD can hold (80-minute disc, 360,000 sectors). Mods may + * grow an archive past its original extent, e.g. into a padding file. */ +static constexpr uint32_t kMaxDiscFileBytes = 360000u * 2048u; + +/* One 2048-byte user-data sector of the effective disc: the committed plan's + * raw and user-data writes/overlays applied. Form 2 (XA) sectors are refused. */ +static bool read_effective_user_sector(PS1::ISOReader& reader, uint32_t lba, + uint8_t* sector) { + uint8_t raw[2352]; + if (reader.ReadRawSector(lba, raw)) { + if (raw[15] != 1 && (raw[15] != 2 || (raw[18] & 0x20u))) return false; + patch_committed_disc_sector(lba, 1, raw, sizeof raw); + std::memcpy(sector, raw + (raw[15] == 1 ? 16 : 24), 2048); + if (raw[15] == 1) patch_committed_disc_sector(lba, 0, sector, 2048); + } else { + if (!reader.ReadSector(lba, sector)) return false; + patch_committed_disc_sector(lba, 0, sector, 2048); + } + return !PSXRecompV4::state().disc_guard_failed; +} + +/* ISO 9660 path lookup through the effective directory records. Mods may + * relocate or grow a file by patching its directory record (e.g. an archive + * extended into the following padding file); the emulated drive serves those + * patched records, so host reads must resolve paths through them too. Names + * compare case-insensitively without the ";1" version suffix. */ +static bool find_effective_file(PS1::ISOReader& reader, const std::string& path, + uint32_t& lba, uint32_t& bytes, bool& directory) { + uint8_t sector[2048]; + auto le32 = [](const uint8_t* p) { + return (uint32_t)p[0] | ((uint32_t)p[1] << 8) | ((uint32_t)p[2] << 16) | + ((uint32_t)p[3] << 24); + }; + if (!read_effective_user_sector(reader, 16, sector) || sector[0] != 1 || + std::memcmp(sector + 1, "CD001", 5) != 0) return false; + lba = le32(sector + 156 + 2); + bytes = le32(sector + 156 + 10); + directory = true; + size_t at = 0; + while (at < path.size()) { + size_t next = path.find_first_of("/\\", at); + if (next == std::string::npos) next = path.size(); + std::string want = path.substr(at, next - at); + at = next + 1; + if (want.empty()) continue; + if (!directory) return false; + std::transform(want.begin(), want.end(), want.begin(), + [](unsigned char c) { return (char)std::toupper(c); }); + bool found = false; + const uint32_t sectors = (bytes + 2047u) / 2048u; + for (uint32_t i = 0; i < sectors && !found; ++i) { + if (!read_effective_user_sector(reader, lba + i, sector)) return false; + for (uint32_t p = 0; p < 2048u && sector[p] && !found;) { + const uint32_t length = sector[p]; + if (length < 34 || p + length > 2048u || + 33u + sector[p + 32] > length) return false; + std::string name(reinterpret_cast(sector + p + 33), + sector[p + 32]); + name = name.substr(0, name.find(';')); + std::transform(name.begin(), name.end(), name.begin(), + [](unsigned char c) { return (char)std::toupper(c); }); + if (sector[p + 32] == 1 && (sector[p + 33] == 0 || sector[p + 33] == 1)) + name.clear(); + if (!name.empty() && name == want) { + lba = le32(sector + p + 2); + bytes = le32(sector + p + 10); + directory = (sector[p + 25] & 2u) != 0; + found = true; + } + p += length; + } + } + if (!found) return false; + } + return true; +} + extern "C" int psx_mod_read_disc_file(const char* path, void* buffer, uint32_t capacity, uint32_t* size) { using namespace PSXRecompV4; @@ -1457,29 +1537,21 @@ extern "C" int psx_mod_read_disc_file(const char* path, void* buffer, const auto& mount = s.effective_disc_path.empty() ? s.disc_path : s.effective_disc_path; if (mount.empty()) return 0; PS1::ISOReader reader; - PS1::ISOFileEntry entry; - if (!reader.Open(mount.string()) || !reader.FindFile(path, entry) || - entry.is_directory || !entry.size || entry.size > 64u * 1024u * 1024u) + uint32_t lba = 0, bytes = 0; + bool directory = false; + if (!reader.Open(mount.string()) || + !find_effective_file(reader, path, lba, bytes, directory) || + directory || !bytes || bytes > kMaxDiscFileBytes) return 0; - if (!buffer) { *size = entry.size; return 1; } - if (capacity < entry.size) return 0; - uint8_t sector[2048], raw[2352]; - for (uint32_t offset = 0; offset < entry.size; offset += 2048u) { - const uint32_t lba = entry.lba + offset / 2048u; - if (reader.ReadRawSector(lba, raw)) { - if (raw[15] != 1 && (raw[15] != 2 || (raw[18] & 0x20u))) return 0; - mod_runtime_patch_disc_sector(lba, 1, raw, sizeof raw); - std::memcpy(sector, raw + (raw[15] == 1 ? 16 : 24), sizeof sector); - if (raw[15] == 1) mod_runtime_patch_disc_sector(lba, 0, sector, sizeof sector); - } else { - if (!reader.ReadSector(lba, sector)) return 0; - mod_runtime_patch_disc_sector(lba, 0, sector, sizeof sector); - } - if (state().disc_guard_failed) return 0; - const uint32_t count = std::min(2048u, entry.size - offset); + if (!buffer) { *size = bytes; return 1; } + if (capacity < bytes) return 0; + uint8_t sector[2048]; + for (uint32_t offset = 0; offset < bytes; offset += 2048u) { + if (!read_effective_user_sector(reader, lba + offset / 2048u, sector)) return 0; + const uint32_t count = std::min(2048u, bytes - offset); std::memcpy(static_cast(buffer) + offset, sector, count); } - *size = entry.size; + *size = bytes; return 1; } catch (...) { return 0; } } @@ -1783,12 +1855,16 @@ extern "C" int psx_mod_function_entry_active(void) { return PSXRecompV4::function_entry_depth != 0; } -extern "C" void mod_runtime_patch_disc_sector(uint32_t lba, int raw_sector, - uint8_t* bytes, uint32_t size) { +/* Apply the committed plan's disc writes and overlays to one sector. The + * emulated drive reaches this only after mod_runtime_enable_disc_patches() + * (reference reads before then must see the original image); host-side + * preparation through psx_mod_read_disc_file() always sees the effective disc, + * including during plugin activation, which runs before the drive is enabled. */ +static void patch_committed_disc_sector(uint32_t lba, int raw_sector, + uint8_t* bytes, uint32_t size) { using namespace PSXRecompV4; RuntimeMods& s = state(); - if (!s.initialized || !s.disc_enabled || s.disc_guard_failed || - !bytes || size == 0) return; + if (!s.initialized || s.disc_guard_failed || !bytes || size == 0) return; /* Raw Mode2 Form1 reads are also the source of the 2048-byte logical * stream consumed by the emulated CD controller. Apply raw claims to the * complete sector, then user-data claims to its payload window. Form2/XA @@ -1807,7 +1883,7 @@ extern "C" void mod_runtime_patch_disc_sector(uint32_t lba, int raw_sector, const auto overlay_sector = overlay_index.find(lba); if (sector == index.end() && overlay_sector == overlay_index.end()) { if (has_mode2_form1_user_data) - mod_runtime_patch_disc_sector(lba, 0, bytes + 24, 2048); + patch_committed_disc_sector(lba, 0, bytes + 24, 2048); return; } if (sector != index.end()) { @@ -1862,5 +1938,11 @@ extern "C" void mod_runtime_patch_disc_sector(uint32_t lba, int raw_sector, } } if (has_mode2_form1_user_data && !s.disc_guard_failed) - mod_runtime_patch_disc_sector(lba, 0, bytes + 24, 2048); + patch_committed_disc_sector(lba, 0, bytes + 24, 2048); +} + +extern "C" void mod_runtime_patch_disc_sector(uint32_t lba, int raw_sector, + uint8_t* bytes, uint32_t size) { + if (!PSXRecompV4::state().disc_enabled) return; + patch_committed_disc_sector(lba, raw_sector, bytes, size); } diff --git a/runtime/tests/test_mod_runtime.cpp b/runtime/tests/test_mod_runtime.cpp index c5d0b15c..fc079444 100644 --- a/runtime/tests/test_mod_runtime.cpp +++ b/runtime/tests/test_mod_runtime.cpp @@ -956,6 +956,98 @@ int main() { check(PSXRecompV4::mod_runtime_commit(raw_path,&error),"reader mount raw disc"); check(psx_mod_read_disc_file("S0/LEVEL.NSF",result.data(),(uint32_t)result.size(),&bytes) && std::equal(result.begin(),result.end(),iso.begin()+22*2048),"raw and ISO reads identical"); + /* Plugin activation (native asset preparation) runs before the emulated + * drive's disc patches are enabled. Host reads must already return the + * committed plan's effective bytes, or a prepared cache would silently + * serve original assets under a modded plan. The drive path stays gated. */ + { + const auto patched_root = root / "host-reader-patched"; + const auto patched_iso = patched_root / "original.iso"; + /* A byte past the original 3000-byte extent; a mod that grows the file + * through its directory record exposes it. */ + std::vector grown_iso = iso; + grown_iso[22 * 2048 + 3500] = 0x77; + write_bytes(patched_iso, grown_iso); + write_text(patched_root / "packages/reader.patch/1.0.0/manifest.toml", + "format_version = 5\n" + "id = \"reader.patch\"\n" + "version = \"1.0.0\"\n" + "name = \"Reader Patch\"\n" + "[[target]]\n" + "game_id = \"READER\"\n" + "disc_sha256 = \"" + sha256_hex(grown_iso) + "\"\n" + "[[feature]]\n" + "id = \"asset\"\n" + "name = \"Asset\"\n" + "[[feature]]\n" + "id = \"grow\"\n" + "name = \"Grow\"\n" + "[[patch]]\n" + "feature = \"grow\"\n" + "target = \"disc_user\"\n" + "offset = " + std::to_string(21 * 2048 + 10) + "\n" + "expected = \"b80b0000\"\n" + "replace = \"a00f0000\"\n" + "[[feature]]\n" + "id = \"huge\"\n" + "name = \"Huge\"\n" + "[[patch]]\n" + "feature = \"huge\"\n" + "target = \"disc_user\"\n" + "offset = " + std::to_string(21 * 2048 + 10) + "\n" + "expected = \"b80b0000\"\n" + "replace = \"00f82204\"\n" + "[[patch]]\n" + "feature = \"asset\"\n" + "target = \"disc_user\"\n" + "offset = " + std::to_string(22 * 2048 + 5) + "\n" + "expected = \"23\"\n" + "replace = \"5a\"\n"); + write_text(patched_root / "state.toml", + "format_version = 2\n" + "[[feature]]\n" + "package_id = \"reader.patch\"\n" + "id = \"asset\"\n" + "enabled = true\n" + "[[feature]]\n" + "package_id = \"reader.patch\"\n" + "id = \"grow\"\n" + "enabled = true\n"); + check(PSXRecompV4::mod_runtime_initialize(patched_root, "READER", 0, {}, &error), + "patched reader initialize"); + check(PSXRecompV4::mod_runtime_commit(patched_iso, &error), "patched reader commit"); + check(psx_mod_read_disc_file("S0/LEVEL.NSF", nullptr, 0, &bytes) && bytes == 4000, + "host disc reads resolve paths through patched directory records"); + std::vector effective(4000); + check(psx_mod_read_disc_file("S0/LEVEL.NSF", effective.data(), + (uint32_t)effective.size(), &bytes) && + bytes == 4000 && effective[5] == 0x5a && effective[3500] == 0x77 && + std::equal(effective.begin() + 6, effective.begin() + 3000, + iso.begin() + 22 * 2048 + 6), + "host disc reads apply the committed plan before the drive is enabled"); + check(!psx_mod_read_disc_file("S0", nullptr, 0, &bytes), + "effective lookup still rejects directories"); + std::array drive_sector{}; + std::copy_n(iso.begin() + 22 * 2048, 2048, drive_sector.begin()); + mod_runtime_patch_disc_sector(22, 0, drive_sector.data(), (uint32_t)drive_sector.size()); + check(drive_sector[5] == 0x23, + "the emulated drive path stays original until disc patches are enabled"); + mod_runtime_enable_disc_patches(); + mod_runtime_patch_disc_sector(22, 0, drive_sector.data(), (uint32_t)drive_sector.size()); + check(drive_sector[5] == 0x5a, "enabled drive path applies the same plan"); + /* Grown archives may exceed 64 MiB (an extended MMX6 ROCK_X6.DAT is + * 69,400,576 bytes); the bound is CD capacity, not a fixed cap. */ + write_text(patched_root / "state.toml", + "format_version = 2\n" + "[[feature]]\n" + "package_id = \"reader.patch\"\n" + "id = \"huge\"\n" + "enabled = true\n"); + check(PSXRecompV4::mod_runtime_initialize(patched_root, "READER", 0, {}, &error) && + PSXRecompV4::mod_runtime_commit(patched_iso, &error), "huge plan commit"); + check(psx_mod_read_disc_file("S0/LEVEL.NSF", nullptr, 0, &bytes) && bytes == 69400576u, + "files grown past 64 MiB keep their effective size"); + } fs::remove_all(root, ec); if (failures) return 1; std::cout << "mod runtime tests passed\n"; From 559f5011c965e4f1b034282106a91815b0eb7e1a Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sun, 4 Oct 2026 19:29:17 -0700 Subject: [PATCH 49/52] Drop duplicated merge test helpers; link gpu_timeline into DMA fixture Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/tests/test_mod_runtime.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/runtime/tests/test_mod_runtime.cpp b/runtime/tests/test_mod_runtime.cpp index 5962b823..59a9802a 100644 --- a/runtime/tests/test_mod_runtime.cpp +++ b/runtime/tests/test_mod_runtime.cpp @@ -184,29 +184,6 @@ static void test_guest_function(CPUState* cpu, uint32_t) { if (cpu->gpr[31] != ra) failures++; } -static int guest_function_hits; -static int instruction_hits; -static void test_instruction(CPUState* cpu, uint32_t) { - instruction_hits++; - cpu->gpr[5] = 0x80301008u; - if (psx_mod_finish_function(cpu)) failures++; -} -static void test_guest_function(CPUState* cpu, uint32_t) { - guest_function_hits++; - const uint32_t ra = cpu->gpr[31]; - CPUState nested{}; - nested.gpr[31] = 0x80007000u; - const int mode = entry_test_mode; - entry_test_mode = 1; - if (!psx_mod_function_entry(&nested, 0x80003000u) || nested.pc != nested.gpr[31]) failures++; - entry_test_mode = mode; - interrupted_entry_cpu = cpu; - mod_runtime_on_vblank(); - interrupted_entry_cpu = nullptr; - if (!psx_mod_finish_function(cpu)) failures++; - cpu->gpr[2] = cpu->gpr[4] + 7u; - if (cpu->gpr[31] != ra) failures++; -} static void test_activation_plugin(void) { activation_calls++; From e9da6ab8b1fceaa95700ff79e70856b557b9e0ac Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sun, 4 Oct 2026 19:37:19 -0700 Subject: [PATCH 50/52] Reconcile PGXP field rebase with exact agreement; fix merged test links Rebase a shadow onto GP0's 11-bit field only when flag bits sit above it; a plain overflowed number keeps master's exact-agreement check. Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/CMakeLists.txt | 1 + runtime/src/pgxp.cpp | 10 ++++++++++ runtime/tests/psx_ram_runtime_map_stubs.c | 1 + 3 files changed, 12 insertions(+) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 89b4ad02..af04aa90 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -431,6 +431,7 @@ if(BUILD_TESTING) src/psx_ram_geometry.c src/mod_runtime.cpp src/mod_packages.cpp + src/mod_media.cpp src/disc_path.cpp src/cue_sheet.cpp src/iso_reader.cpp diff --git a/runtime/src/pgxp.cpp b/runtime/src/pgxp.cpp index 2556e967..98199904 100644 --- a/runtime/src/pgxp.cpp +++ b/runtime/src/pgxp.cpp @@ -1063,10 +1063,20 @@ static inline int pgxp_accept(int32_t px, int32_t py, int32_t int_x, return 2; } return 0; +} + +/* Rebase a shadow that describes the int16 half onto GP0's 11-bit field when + * the half carries flag bits ABOVE the field (Spider-Man packs clip flags in + * bits 14/15). A half whose bits 11-15 are a plain sign extension holds an + * ordinary number; if it overflowed the field (e.g. 0x0402 parses as -1022), + * that is CPU arithmetic the GPU wraps, which pgxp_agrees() only believes on + * exact integer agreement, so it is left to that check unchanged. */ static inline int32_t field_rebase(int32_t v16, uint32_t half, int32_t parsed) { int32_t as16 = (int16_t)half; int32_t as11 = ((int32_t)(half << 21)) >> 21; if (parsed != as11 || parsed == as16) return v16; + const uint32_t above = (half >> 11) & 0x1Fu; + if (above == ((half & 0x8000u) ? 0x1Fu : 0u)) return v16; return (int32_t)((int64_t)v16 + ((int64_t)as11 - as16) * 65536); } diff --git a/runtime/tests/psx_ram_runtime_map_stubs.c b/runtime/tests/psx_ram_runtime_map_stubs.c index 3341c7b9..2e98819d 100644 --- a/runtime/tests/psx_ram_runtime_map_stubs.c +++ b/runtime/tests/psx_ram_runtime_map_stubs.c @@ -57,6 +57,7 @@ uint32_t ls_read_hook(uint32_t a, int s, uint32_t v) { (void)a; (void)s; return void ls_write_hook(uint32_t a, int s, uint32_t v) { (void)a; (void)s; (void)v; } void ls_shadow_record_unreplayable(void) {} int fntrace_is_game_started(void) { return 0; } +void fntrace_restore_game_started(int started) { (void)started; } void overlay_loader_note_code_write(void) {} void overlay_loader_resync_validation_after_restore(void) {} void gte_canonicalize_cpu_state(CPUState *cpu) { (void)cpu; } From 911426552a22b4c5241f380ca42b88b9b2ba9e04 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sun, 4 Oct 2026 20:55:30 -0700 Subject: [PATCH 51/52] Add shared seamless-loading kit: resident disc packs and guest services Co-Authored-By: Claude Opus 5.5 (1M context) --- runtime/CMakeLists.txt | 25 ++ runtime/include/dma.h | 8 + runtime/include/mod_plugins.h | 38 ++ runtime/include/mod_resident.h | 114 ++++++ runtime/include/mod_runtime.h | 6 + runtime/runtime.cmake | 2 + runtime/src/debug_server.c | 28 ++ runtime/src/dma.c | 33 ++ runtime/src/mod_guest_services.c | 96 +++++ runtime/src/mod_resident.cpp | 540 ++++++++++++++++++++++++++++ runtime/src/mod_runtime.cpp | 59 +++ runtime/tests/test_mod_resident.cpp | 280 +++++++++++++++ 12 files changed, 1229 insertions(+) create mode 100644 runtime/include/mod_resident.h create mode 100644 runtime/src/mod_guest_services.c create mode 100644 runtime/src/mod_resident.cpp create mode 100644 runtime/tests/test_mod_resident.cpp diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index af04aa90..f057641c 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -791,6 +791,31 @@ if(BUILD_TESTING) endif() add_test(NAME mod_runtime_test COMMAND mod_runtime_test) + add_executable(mod_resident_test + tests/test_mod_resident.cpp + src/mod_resident.cpp + src/mod_runtime.cpp + src/mod_packages.cpp + src/mod_media.cpp + src/disc_path.cpp + src/cue_sheet.cpp + src/iso_reader.cpp + src/crc32.c + src/psx_sha256.c) + target_include_directories(mod_resident_test PRIVATE + include + ../recompiler/include + ../recompiler/lib/toml11) + target_link_libraries(mod_resident_test PRIVATE chdr-static) + if(WIN32) + if(MSVC) + target_link_options(mod_resident_test PRIVATE /STACK:16777216) + else() + target_link_options(mod_resident_test PRIVATE -Wl,--stack,16777216) + endif() + endif() + add_test(NAME mod_resident_test COMMAND mod_resident_test) + if(WIN32) add_executable(autocompile_publication_test tests/test_autocompile_publication.c diff --git a/runtime/include/dma.h b/runtime/include/dma.h index d6565acf..a681de9f 100644 --- a/runtime/include/dma.h +++ b/runtime/include/dma.h @@ -42,6 +42,14 @@ uint32_t dma_get_dicr(void); uint32_t dma_get_dpcr(void); int dma_cdrom_transfer_active(void); int dma_gpu_linked_list_active(void); +/* RAM-side effects of a completed CD-ROM (ch3) transfer of host-supplied + * sector data, for seamless-loading adapters serving a game's own CdGetSector + * or read loop: overlay capture before the first word, per-word RAM stores + * under DMA attribution, executable-page invalidation, the CD DMA log (when + * lba >= 0) and overlay capture on completion. Channel registers, IRQs and + * guest timing are untouched. dest/bytes word aligned; returns 0 if the span + * leaves live RAM. */ +int dma_host_cdrom_write(uint32_t dest, const uint8_t* src, uint32_t bytes, int lba); typedef struct DMAChannelDebugState { uint32_t madr; diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 0046a14d..1950975c 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -89,6 +89,9 @@ int psx_mod_game_started(void); * otherwise capacity must hold the entire file. Active sector mods apply. */ int psx_mod_read_disc_file(const char* path, void* buffer, uint32_t capacity, uint32_t* size); +/* Effective-disc LBA and byte size of a file (directory records patched by + * active mods apply, so a relocated file reports its new extent). */ +int psx_mod_disc_file_extent(const char* path, uint32_t* lba, uint32_t* size); /* Experimental retained-texture service (currently OpenGL only). IDs are * nonzero, stable game-owned identities, NOT GL names. Banks are immutable * 16-bit PS1 texels/indices with a caller-selected row pitch (width). @@ -126,6 +129,41 @@ void psx_mod_write_word(uint32_t address, uint32_t value); */ void psx_mod_write_code_word(uint32_t address, uint32_t value); +/* + * Services shared by seamless-loading adapters (resident disc data: see + * mod_resident.h). Emulation-thread callbacks only. + * + * Run a guest function to completion from a hook: a0..a3 and $ra are set, + * control returns when the guest reaches return_address, and the caller's + * GPRs, PC, HI and LO are restored. COP0, GTE and timing deadlines keep the + * callee's effects, as they would after an ordinary call. Snapshots wait + * until the call returns (the host stack holds the continuation). Returns v0. + */ +uint32_t psx_mod_call_guest(struct CPUState* cpu, uint32_t function, + uint32_t return_address, uint32_t a0, uint32_t a1, + uint32_t a2, uint32_t a3); +/* Deliver disc sectors into RAM exactly as a completed CD-ROM DMA would + * (overlay capture, executable-page invalidation, CD DMA log when lba >= 0). + * Word-aligned address and length. Returns 0 when the span leaves RAM. */ +int psx_mod_dma_write_ram(uint32_t address, const void* data, uint32_t bytes, + int lba); +/* Store bytes through the CPU store path (any alignment): for data the + * original code produces with CPU stores, e.g. a decompressor's output. */ +int psx_mod_host_write_ram(uint32_t address, const void* data, uint32_t bytes); +/* PsyQ SpuWrite by DMA, completed synchronously: transfer address, DMA-write + * transfer mode, the words through the SPU's DMA write path (address + * advance and sample-IRQ checks), then transfer mode stop when stop_after. + * spu_address 8-aligned, guest_source/bytes word aligned, within SPU RAM. + * Library bookkeeping (transfer callbacks, busy flags) stays the caller's. */ +int psx_mod_spu_upload(uint32_t spu_address, uint32_t guest_source, + uint32_t bytes, int stop_after); +/* PsyQ LoadImage completed synchronously: texture-cache flush, GP0 A0h + * rectangle copy of w*h 16-bit pixels from guest RAM (provenance attributed + * per word), then GP1(04h) DMA direction CPU->GP0 for uploads the library + * would DMA (16 words or more). Caller drains earlier GPU work first. */ +int psx_mod_psyq_load_image(uint32_t x, uint32_t y, uint32_t w, uint32_t h, + uint32_t guest_source); + /* * Allocate opt-in enhancement memory from Expansion 1. Until the first * allocation, the region remains hardware-faithful open bus. The returned diff --git a/runtime/include/mod_resident.h b/runtime/include/mod_resident.h new file mode 100644 index 00000000..770b36fd --- /dev/null +++ b/runtime/include/mod_resident.h @@ -0,0 +1,114 @@ +#pragma once +/* + * Resident disc resources for title-owned seamless-loading adapters. + * + * A seamless loader serves a game's blocking loads from memory instead of the + * emulated drive, with the game's own code still consuming every byte. The + * title-independent half lives here: read the listed files from the effective + * (mod-patched) disc once, optionally derive data from them with the title's + * own decoders, verify everything with SHA-256, and keep a cache that is + * reused only by the exact same mod plan. The adapter keeps its loader hooks, + * its catalog and its decoders. + * + * Cache key: SHA-256 over the active mod plan fingerprint, the adapter's + * format id and the complete spec (paths, stock sizes/hashes, policy). Every + * blob is re-verified when a cache is loaded; a mismatch rebuilds it. Packs + * live in LOCALAPPDATA (or XDG_CACHE_HOME / ~/.cache)//seamless, or in + * PSX_RESIDENT_CACHE when set. Only files named <format>-*.pack are pruned. + * + * Call psx_resident_prepare() from an activation callback (it reads the disc + * through psx_mod_read_disc_file). Accessors are emulation-thread only. + * TCP: {"cmd":"resident_status"} lists every prepared pack. + */ +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + /* Serve mod-effective content. Files that differ from their stock hash + * are counted (psx_resident_file_stock() == 0), never replaced. */ + PSX_RESIDENT_ALLOW_MODIFIED = 0, + /* Fail preparation when any file with a stock hash differs: for adapters + * whose hooks depend on the original layout. The title then loads + * normally. */ + PSX_RESIDENT_REQUIRE_STOCK = 1 +}; + +typedef struct PSXResidentFile { + const char* path; /* ISO 9660 path, e.g. "CD/TOMBA2.IMG" */ + uint32_t stock_size; /* original byte size; 0 = not catalogued */ + const char* stock_sha256; /* lowercase hex over the zero-padded sectors of + * the original file; NULL = not catalogued */ +} PSXResidentFile; + +typedef struct PSXResidentSink PSXResidentSink; + +/* Store one derived blob (decoded asset, table, ...) for source file `file`. + * `tag` and `meta` are the adapter's own; blobs are kept in emission order and + * identical bytes are stored once. Returns 0 on failure (preparation fails). */ +int psx_resident_emit(PSXResidentSink* sink, uint32_t file, uint32_t tag, + const uint32_t meta[4], const void* bytes, uint32_t size); + +/* Called once per file during preparation, in spec order, with the file's + * sector-padded effective content. `stock` is 1 when it matched its stock + * hash. Return 0 to fail preparation (e.g. a stock decode mismatch). */ +typedef int (*PSXResidentDeriveFn)(PSXResidentSink* sink, uint32_t file, + const uint8_t* data, uint32_t size, + int stock, void* user); + +typedef struct PSXResidentSpec { + uint32_t struct_size; /* sizeof(PSXResidentSpec) */ + const char* title; /* cache folder, e.g. "MegaManX6Recomp" */ + const char* format; /* pack id; change it whenever the derived + * data's meaning changes */ + const PSXResidentFile* files; + uint32_t file_count; + uint32_t policy; /* PSX_RESIDENT_ALLOW_MODIFIED / _REQUIRE_STOCK */ + uint32_t max_file_bytes; /* 0 = a full 80-minute CD */ + PSXResidentDeriveFn derive; /* optional */ + void* derive_user; + uint32_t keep_packs; /* packs of this format kept besides the + * active one; 0 = 3 */ +} PSXResidentSpec; + +typedef struct PSXResidentPack PSXResidentPack; + +/* Load (verified) or build the pack. NULL on failure; the reason is kept for + * resident_status and the resident.prepare_failed mod counter is bumped. A + * later prepare for the same title and format releases the earlier pack. */ +const PSXResidentPack* psx_resident_prepare(const PSXResidentSpec* spec); + +uint32_t psx_resident_file_count(const PSXResidentPack* pack); +/* Sector-padded effective bytes. `size` receives the file size, `padded` the + * padded length (both optional). NULL for an invalid index. */ +const uint8_t* psx_resident_file(const PSXResidentPack* pack, uint32_t file, + uint32_t* size, uint32_t* padded); +/* Effective-disc LBA of the file's first sector (relocations by mods apply). */ +uint32_t psx_resident_file_lba(const PSXResidentPack* pack, uint32_t file); +int psx_resident_file_stock(const PSXResidentPack* pack, uint32_t file); +uint32_t psx_resident_modified_files(const PSXResidentPack* pack); +/* `bytes` starting at effective LBA `lba`, entirely within one file's padded + * content; NULL otherwise. `file` (optional) receives the file index. */ +const uint8_t* psx_resident_find_lba(const PSXResidentPack* pack, uint32_t lba, + uint32_t bytes, uint32_t* file); + +uint32_t psx_resident_derived_count(const PSXResidentPack* pack); +/* Derived blob `index` in emission order. Optional out-params. */ +const uint8_t* psx_resident_derived(const PSXResidentPack* pack, uint32_t index, + uint32_t* file, uint32_t* tag, + uint32_t meta[4], uint32_t* size); + +/* Lowercase hex SHA-256 of the guest bytes in [lo, hi) of each range, hashed + * in order, compared with `sha256`. Guards an adapter's code contract. */ +typedef struct PSXResidentRange { uint32_t lo, hi; } PSXResidentRange; +int psx_resident_guest_ranges_match(const PSXResidentRange* ranges, + uint32_t count, const char* sha256); + +/* Debug server: JSON array describing every prepared pack. */ +int psx_resident_status_json(char* out, uint32_t capacity); + +#ifdef __cplusplus +} +#endif diff --git a/runtime/include/mod_runtime.h b/runtime/include/mod_runtime.h index 4d6672dd..a15c20f1 100644 --- a/runtime/include/mod_runtime.h +++ b/runtime/include/mod_runtime.h @@ -5,6 +5,7 @@ #ifdef __cplusplus #include <filesystem> #include <string> +#include <vector> #if defined(RECOMP_LAUNCHER) #include "recomp_launcher.h" #endif @@ -24,6 +25,11 @@ bool mod_runtime_commit(const std::filesystem::path& disc_path = {}, bool mod_runtime_clear_for_netplay(std::string* error = nullptr); const std::string& mod_runtime_fingerprint(); const std::filesystem::path& mod_runtime_effective_disc_path(); +/* Read an effective-disc file as whole sectors (true end-of-file tail bytes + * included). max_bytes = 0 allows a full CD. Emulation-thread only. */ +bool mod_runtime_read_disc_file_sectors(const std::string& path, uint32_t max_bytes, + std::vector<uint8_t>& padded, uint32_t& lba, + uint32_t& size, std::string* error = nullptr); #if defined(RECOMP_LAUNCHER) const ::RecompLauncherCModProvider* mod_runtime_launcher_provider(); diff --git a/runtime/runtime.cmake b/runtime/runtime.cmake index 28f4cb61..fa445bb2 100644 --- a/runtime/runtime.cmake +++ b/runtime/runtime.cmake @@ -442,6 +442,8 @@ set(PSXRECOMP_RUNTIME_SOURCES ${PSXRECOMP_ROOT}/runtime/src/mod_packages.cpp ${PSXRECOMP_ROOT}/runtime/src/mod_media.cpp ${PSXRECOMP_ROOT}/runtime/src/mod_runtime.cpp + ${PSXRECOMP_ROOT}/runtime/src/mod_resident.cpp + ${PSXRECOMP_ROOT}/runtime/src/mod_guest_services.c ${PSXRECOMP_ROOT}/runtime/src/mod_texture_banks.c ${PSXRECOMP_ROOT}/runtime/src/psx_keybinds.c ${PSXRECOMP_ROOT}/runtime/src/psx_bios_backend.c diff --git a/runtime/src/debug_server.c b/runtime/src/debug_server.c index bc38efd3..c789d8f5 100644 --- a/runtime/src/debug_server.c +++ b/runtime/src/debug_server.c @@ -7951,6 +7951,33 @@ static void handle_mod_counters(int id, const char *json) free(buf); } +/* Resident disc packs prepared by seamless-loading adapters (mod_resident.h): + * {"cmd":"resident_status"} + * -> packs: [{title, format, state, error, path, files, modified, derived, + * blobs, bytes, ms}] */ +static void handle_resident_status(int id, const char *json) +{ + extern int psx_resident_status_json(char *out, uint32_t capacity); + (void)json; + for (uint32_t cap = 4096u; cap <= (1u << 22); cap *= 4u) { + char *packs = (char *)malloc(cap); + if (!packs) break; + if (psx_resident_status_json(packs, cap)) { + char *buf = (char *)malloc(cap + 64u); + if (buf) { + snprintf(buf, cap + 64u, "{\"id\":%d,\"ok\":true,\"packs\":%s}", id, packs); + debug_server_send_line(buf); + free(buf); + } + free(packs); + if (!buf) send_err(id, "alloc failed"); + return; + } + free(packs); + } + send_err(id, "resident status too large"); +} + static void handle_ws_hud_mode(int id, const char *json) { int v = json_get_int(json, "tag_rects", -1); @@ -14500,6 +14527,7 @@ static const CmdEntry s_commands[] = { { "ws_hud_mode", handle_ws_hud_mode }, { "ws_tag_stats", handle_ws_tag_stats }, { "mod_counters", handle_mod_counters }, + { "resident_status", handle_resident_status }, { "capture_mark", handle_capture_mark }, { "present_image_ring_stats", handle_present_image_ring_stats }, { "present_image_ring_get", handle_present_image_ring_get }, diff --git a/runtime/src/dma.c b/runtime/src/dma.c index c3a5fd40..70ade5a9 100644 --- a/runtime/src/dma.c +++ b/runtime/src/dma.c @@ -516,6 +516,39 @@ static void start_async_cdrom_transfer(void) { } } +int dma_host_cdrom_write(uint32_t dest, const uint8_t *src, uint32_t bytes, int lba) { + if ((dest & 3u) || (bytes & 3u) || (!src && bytes)) return 0; + const uint32_t addr = DMA_RAM_ADDR(dest); + const uint32_t live = psx_ram_live_bytes(); + if (addr >= live || bytes > live - addr) return 0; + if (!bytes) return 1; + /* Same capture window as the real ch3 path: game data, not FMV buffers. */ + const int capture = addr < 0x1C0000u || addr >= PSX_MAIN_RAM_RETAIL_BYTES; + const int saved_ch = g_dma_cur_ch; + const uint32_t saved_madr = g_dma_cur_madr, saved_bcr = g_dma_cur_bcr; + g_dma_exec_depth++; + g_dma_cur_ch = 3; + g_dma_cur_bcr = bytes / 4u; + if (capture) overlay_capture_before_dma(addr, bytes); + for (uint32_t i = 0; i < bytes; i += 4u) { + uint32_t word; + memcpy(&word, src + i, 4); + g_dma_cur_madr = addr + i; + psx_write_word(addr + i, word); + } + dirty_ram_mark_executable_range(addr, bytes); + if (capture) { + if (lba >= 0) cd_dma_log_push(lba, addr, bytes); + extern uint8_t *memory_get_ram_ptr(void); + overlay_capture_on_dma(addr, bytes, memory_get_ram_ptr() + addr); + } + g_dma_cur_ch = saved_ch; + g_dma_cur_madr = saved_madr; + g_dma_cur_bcr = saved_bcr; + g_dma_exec_depth--; + return 1; +} + static void finish_async_cdrom_transfer(uint32_t final_addr) { finish_cdrom_dma_capture(final_addr, 1); DMAAsyncChannel *a = &cdrom_async; diff --git a/runtime/src/mod_guest_services.c b/runtime/src/mod_guest_services.c new file mode 100644 index 00000000..a148ffb5 --- /dev/null +++ b/runtime/src/mod_guest_services.c @@ -0,0 +1,96 @@ +/* Guest services for seamless-loading adapters (mod_plugins.h). Each is the + * one shared implementation of an effect several titles' adapters need; see + * the header for the contract. */ +#include "mod_plugins.h" +#include "cpu_state.h" +#include "dma.h" +#include "gpu.h" +#include "interrupts.h" +#include "psx_memory.h" +#include "spu.h" +#include <string.h> + +uint32_t psx_mod_call_guest(struct CPUState* cpu, uint32_t function, + uint32_t return_address, uint32_t a0, uint32_t a1, + uint32_t a2, uint32_t a3) { + uint32_t regs[32]; + const uint32_t pc = cpu->pc, hi = cpu->hi, lo = cpu->lo; + memcpy(regs, cpu->gpr, sizeof regs); + cpu->gpr[4] = a0; + cpu->gpr[5] = a1; + cpu->gpr[6] = a2; + cpu->gpr[7] = a3; + cpu->gpr[31] = return_address; + psx_snapshot_host_call_begin(); + psx_dispatch_call(cpu, function, return_address); + const uint32_t result = cpu->gpr[2]; + memcpy(cpu->gpr, regs, sizeof regs); + cpu->pc = pc; + cpu->hi = hi; + cpu->lo = lo; + psx_snapshot_host_call_end(); + return result; +} + +int psx_mod_dma_write_ram(uint32_t address, const void* data, uint32_t bytes, + int lba) { + return dma_host_cdrom_write(address, (const uint8_t*)data, bytes, lba); +} + +static int ram_span(uint32_t address, uint32_t bytes) { + const uint32_t phys = address & 0x1FFFFFFFu; + const uint32_t live = psx_ram_live_bytes(); + return address < 0xC0000000u && phys < live && bytes <= live - phys; +} + +int psx_mod_host_write_ram(uint32_t address, const void* data, uint32_t bytes) { + const uint8_t* p = (const uint8_t*)data; + if ((!p && bytes) || !ram_span(address, bytes)) return 0; + while (bytes && (address & 3u)) { psx_host_write_byte(address++, *p++); --bytes; } + for (; bytes >= 4; address += 4, p += 4, bytes -= 4) { + uint32_t word; + memcpy(&word, p, 4); + psx_host_write_word(address, word); + } + while (bytes--) psx_host_write_byte(address++, *p++); + return 1; +} + +#define SPU_RAM_BYTES 0x80000u +#define SPU_TRANSFER_ADDR 0x1F801DA6u +#define SPU_CONTROL 0x1F801DAAu + +int psx_mod_spu_upload(uint32_t spu_address, uint32_t guest_source, + uint32_t bytes, int stop_after) { + if ((spu_address & 7u) || (guest_source & 3u) || (bytes & 3u) || + spu_address >= SPU_RAM_BYTES || bytes > SPU_RAM_BYTES - spu_address || + !ram_span(guest_source, bytes)) + return 0; + spu_write(SPU_TRANSFER_ADDR, spu_address >> 3); + const uint16_t control = spu_ctrl_read(); + spu_write(SPU_CONTROL, (control & ~0x30u) | 0x20u); + for (uint32_t i = 0; i < bytes; i += 4u) spu_dma_write(psx_mod_read_word(guest_source + i)); + if (stop_after) spu_write(SPU_CONTROL, control & ~0x30u); + return 1; +} + +int psx_mod_psyq_load_image(uint32_t x, uint32_t y, uint32_t w, uint32_t h, + uint32_t guest_source) { + if (!w || w > 1024u || !h || h > 512u || x >= 1024u || y >= 512u || + (guest_source & 3u)) + return 0; + const uint32_t words = (w * h + 1u) / 2u; + if (!ram_span(guest_source, words * 4u)) return 0; + gpu_set_gp0_source(guest_source); + gpu_write_gp1(0x04000000u); + gpu_write_gp0(0x01000000u); + gpu_write_gp0(0xA0000000u); + gpu_write_gp0(x | (y << 16)); + gpu_write_gp0(w | (h << 16)); + for (uint32_t i = 0; i < words; i++) { + gpu_set_gp0_source(guest_source + 4u * i); + gpu_write_gp0(psx_mod_read_word(guest_source + 4u * i)); + } + if (words >= 16u) gpu_write_gp1(0x04000002u); + return 1; +} diff --git a/runtime/src/mod_resident.cpp b/runtime/src/mod_resident.cpp new file mode 100644 index 00000000..e0292481 --- /dev/null +++ b/runtime/src/mod_resident.cpp @@ -0,0 +1,540 @@ +/* Resident disc resources for seamless-loading adapters (mod_resident.h). + * + * Pack file (little endian): + * "PSXRES01", u32 version, u32 files, u32 derived, u32 blobs, + * u8 key[32], u64 payload_bytes, + * files[] {u32 lba, size, padded, stock, blob} + * derived[] {u32 file, tag, meta[4], blob} + * blobs[] {u64 offset, u32 size, u32 zero, u8 sha256[32]} + * u8 table_sha256[32] (everything above), payload. + * Every blob is hashed again on load. Identical bytes share one blob. */ +#include "mod_resident.h" +#include "mod_plugins.h" +#include "mod_runtime.h" +#include "psx_sha256.h" + +#include <algorithm> +#include <array> +#include <cctype> +#include <chrono> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <filesystem> +#include <fstream> +#include <map> +#include <memory> +#include <stdexcept> +#include <string> +#include <system_error> +#include <vector> +#ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include <windows.h> +#else +#include <unistd.h> +#endif + +namespace { + +using Bytes = std::vector<uint8_t>; +using Digest = std::array<uint8_t, 32>; + +constexpr char kMagic[8] = {'P', 'S', 'X', 'R', 'E', 'S', '0', '1'}; +constexpr uint32_t kVersion = 1; +constexpr uint32_t kBlobAlign = 16; +constexpr uint32_t kFullCd = 360000u * 2048u; +constexpr uint64_t kMaxPackBytes = 1ull << 31; + +struct FileRec { uint32_t lba, size, padded, stock, blob; }; +struct DerivedRec { uint32_t file, tag, meta[4], blob; }; +struct Blob { uint64_t offset; uint32_t size; Digest sha; }; + +} // namespace + +struct PSXResidentPack { + Bytes payload; + std::vector<FileRec> files; + std::vector<DerivedRec> derived; + std::vector<Blob> blobs; + std::vector<uint32_t> by_lba; /* file indices sorted by lba */ + uint32_t modified = 0; +}; + +struct PSXResidentSink { + PSXResidentPack* pack; + std::map<Digest, uint32_t> index; + uint32_t file_count; + std::string error; +}; + +namespace { + +struct Record { + std::string title, format, state, error, path; + std::unique_ptr<PSXResidentPack> pack; + double ms = 0; +}; +std::vector<Record>& records() { + static std::vector<Record> r; + return r; +} + +Digest sha(const uint8_t* p, size_t n) { + Digest d; + psx_sha256_compute(p, n, d.data()); + return d; +} +std::string hex(const uint8_t* d, size_t n = 32) { + std::string out(n * 2, '0'); + static const char* digits = "0123456789abcdef"; + for (size_t i = 0; i < n; i++) { + out[2 * i] = digits[d[i] >> 4]; + out[2 * i + 1] = digits[d[i] & 15]; + } + return out; +} + +void put32(Bytes& b, uint32_t v) { for (int i = 0; i < 4; i++) b.push_back(uint8_t(v >> (8 * i))); } +void put64(Bytes& b, uint64_t v) { for (int i = 0; i < 8; i++) b.push_back(uint8_t(v >> (8 * i))); } +uint32_t get32(const uint8_t* p) { + return uint32_t(p[0]) | uint32_t(p[1]) << 8 | uint32_t(p[2]) << 16 | uint32_t(p[3]) << 24; +} +uint64_t get64(const uint8_t* p) { return uint64_t(get32(p)) | uint64_t(get32(p + 4)) << 32; } + +bool valid_spec(const PSXResidentSpec* s) { + if (!s || s->struct_size < sizeof(PSXResidentSpec) || !s->title || !*s->title || + !s->format || !*s->format || !s->files || !s->file_count || + s->policy > PSX_RESIDENT_REQUIRE_STOCK) + return false; + for (const char* p = s->format; *p; ++p) + if (!(std::isalnum((unsigned char)*p) || *p == '-' || *p == '_' || *p == '.')) return false; + for (const char* p = s->title; *p; ++p) + if (*p == '/' || *p == '\\' || *p == ':' || *p == '.') return false; + for (uint32_t i = 0; i < s->file_count; i++) { + const auto& f = s->files[i]; + if (!f.path || !*f.path) return false; + if (f.stock_sha256 && std::strlen(f.stock_sha256) != 64) return false; + } + return true; +} + +Digest cache_key(const PSXResidentSpec* s, const std::string& fingerprint) { + psx_sha256_ctx ctx; + psx_sha256_init(&ctx); + auto text = [&](const std::string& t) { + psx_sha256_update(&ctx, reinterpret_cast<const uint8_t*>(t.c_str()), t.size() + 1); + }; + text("PSXRES01"); + text(fingerprint); + text(s->title); + text(s->format); + text(std::to_string(s->policy) + "/" + std::to_string(s->max_file_bytes)); + for (uint32_t i = 0; i < s->file_count; i++) { + const auto& f = s->files[i]; + text(f.path); + text(std::to_string(f.stock_size)); + text(f.stock_sha256 ? f.stock_sha256 : ""); + } + Digest d; + psx_sha256_final(&ctx, d.data()); + return d; +} + +std::filesystem::path cache_dir(const char* title) { + if (const char* p = std::getenv("PSX_RESIDENT_CACHE")) + if (*p) return std::filesystem::path(p) / title; + std::filesystem::path root; +#ifdef _WIN32 + if (const char* p = std::getenv("LOCALAPPDATA")) root = p; +#else + if (const char* p = std::getenv("XDG_CACHE_HOME")) root = p; + else if (const char* p = std::getenv("HOME")) root = std::filesystem::path(p) / ".cache"; +#endif + if (root.empty()) throw std::runtime_error("no cache directory"); + return root / title / "seamless"; +} + +uint32_t add_blob(PSXResidentSink& sink, const uint8_t* p, uint32_t n) { + const Digest d = sha(p, n); + auto it = sink.index.find(d); + if (it != sink.index.end()) return it->second; + auto& pack = *sink.pack; + uint64_t offset = (pack.payload.size() + kBlobAlign - 1) & ~uint64_t(kBlobAlign - 1); + if (offset + n > kMaxPackBytes) throw std::runtime_error("pack size limit"); + pack.payload.resize(size_t(offset)); + pack.payload.insert(pack.payload.end(), p, p + n); + pack.blobs.push_back({offset, n, d}); + const uint32_t id = uint32_t(pack.blobs.size() - 1); + sink.index.emplace(d, id); + return id; +} + +void index_lba(PSXResidentPack& pack) { + pack.by_lba.resize(pack.files.size()); + for (uint32_t i = 0; i < pack.by_lba.size(); i++) pack.by_lba[i] = i; + std::sort(pack.by_lba.begin(), pack.by_lba.end(), + [&](uint32_t a, uint32_t b) { return pack.files[a].lba < pack.files[b].lba; }); + pack.modified = 0; + for (const auto& f : pack.files) pack.modified += f.stock ? 0 : 1; +} + +std::unique_ptr<PSXResidentPack> build(const PSXResidentSpec* s, std::string& error) { + auto pack = std::make_unique<PSXResidentPack>(); + PSXResidentSink sink{pack.get(), {}, s->file_count, {}}; + const uint32_t max = s->max_file_bytes ? s->max_file_bytes : kFullCd; + Bytes data; + for (uint32_t i = 0; i < s->file_count; i++) { + const auto& f = s->files[i]; + uint32_t lba = 0, size = 0; + if (!PSXRecompV4::mod_runtime_read_disc_file_sectors(f.path, max, data, lba, size, &error)) + return nullptr; + int stock = 0; + if (f.stock_sha256) + stock = (!f.stock_size || f.stock_size == size) && + hex(sha(data.data(), data.size()).data()) == f.stock_sha256; + if (!stock && s->policy == PSX_RESIDENT_REQUIRE_STOCK && f.stock_sha256) { + error = std::string(f.path) + ": differs from the original disc"; + return nullptr; + } + const uint32_t blob = add_blob(sink, data.data(), uint32_t(data.size())); + pack->files.push_back({lba, size, uint32_t(data.size()), uint32_t(stock), blob}); + if (s->derive) { + const size_t before = pack->derived.size(); + if (!s->derive(&sink, i, data.data(), uint32_t(data.size()), stock, s->derive_user)) { + error = sink.error.empty() ? std::string(f.path) + ": derive failed" : sink.error; + return nullptr; + } + for (size_t d = before; d < pack->derived.size(); d++) + if (pack->derived[d].file != i) { + error = std::string(f.path) + ": derived blob names another file"; + return nullptr; + } + } + } + index_lba(*pack); + return pack; +} + +Bytes table(const PSXResidentPack& p, const Digest& key) { + Bytes t(kMagic, kMagic + 8); + put32(t, kVersion); + put32(t, uint32_t(p.files.size())); + put32(t, uint32_t(p.derived.size())); + put32(t, uint32_t(p.blobs.size())); + t.insert(t.end(), key.begin(), key.end()); + put64(t, p.payload.size()); + for (const auto& f : p.files) { + put32(t, f.lba); put32(t, f.size); put32(t, f.padded); put32(t, f.stock); put32(t, f.blob); + } + for (const auto& d : p.derived) { + put32(t, d.file); put32(t, d.tag); + for (uint32_t m : d.meta) put32(t, m); + put32(t, d.blob); + } + for (const auto& b : p.blobs) { + put64(t, b.offset); put32(t, b.size); put32(t, 0); + t.insert(t.end(), b.sha.begin(), b.sha.end()); + } + const Digest d = sha(t.data(), t.size()); + t.insert(t.end(), d.begin(), d.end()); + return t; +} + +void publish(const std::filesystem::path& path, const PSXResidentPack& p, const Digest& key) { + std::filesystem::create_directories(path.parent_path()); + auto tmp = path; +#ifdef _WIN32 + tmp += "." + std::to_string(GetCurrentProcessId()) + ".tmp"; +#else + tmp += "." + std::to_string(getpid()) + ".tmp"; +#endif + const Bytes t = table(p, key); + { + std::ofstream out(tmp, std::ios::binary | std::ios::trunc); + out.write(reinterpret_cast<const char*>(t.data()), std::streamsize(t.size())); + out.write(reinterpret_cast<const char*>(p.payload.data()), std::streamsize(p.payload.size())); + out.close(); + if (!out) { + std::error_code ec; + std::filesystem::remove(tmp, ec); + throw std::runtime_error("cannot write " + tmp.string()); + } + } +#ifdef _WIN32 + if (!MoveFileExW(tmp.c_str(), path.c_str(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) { + std::error_code ec; + std::filesystem::remove(tmp, ec); + throw std::runtime_error("cannot publish " + path.string()); + } +#else + std::filesystem::rename(tmp, path); +#endif +} + +/* Structure, key and every blob hash. Returns null on any mismatch. */ +std::unique_ptr<PSXResidentPack> load(const std::filesystem::path& path, const Digest& key, + uint32_t file_count) { + std::error_code ec; + const auto bytes = std::filesystem::file_size(path, ec); + if (ec || bytes < 64 || bytes > kMaxPackBytes) return nullptr; + std::ifstream in(path, std::ios::binary); + uint8_t head[64]; + if (!in.read(reinterpret_cast<char*>(head), sizeof head)) return nullptr; + if (std::memcmp(head, kMagic, 8) || get32(head + 8) != kVersion || get32(head + 12) != file_count || + std::memcmp(head + 24, key.data(), 32)) + return nullptr; + const uint64_t nd = get32(head + 16), nb = get32(head + 20), payload = get64(head + 56); + const uint64_t tsize = 64 + uint64_t(file_count) * 20 + nd * 28 + nb * 48; + if (tsize + 32 > bytes || tsize + 32 + payload != bytes) return nullptr; + Bytes raw(static_cast<size_t>(tsize + 32)); + std::memcpy(raw.data(), head, sizeof head); + if (!in.read(reinterpret_cast<char*>(raw.data() + 64), std::streamsize(raw.size() - 64))) return nullptr; + const uint8_t* p = raw.data(); + if (sha(p, size_t(tsize)) != *reinterpret_cast<const Digest*>(p + tsize)) return nullptr; + auto pack = std::make_unique<PSXResidentPack>(); + const uint8_t* q = p + 64; + for (uint32_t i = 0; i < file_count; i++, q += 20) + pack->files.push_back({get32(q), get32(q + 4), get32(q + 8), get32(q + 12), get32(q + 16)}); + for (uint64_t i = 0; i < nd; i++, q += 28) + pack->derived.push_back({get32(q), get32(q + 4), {get32(q + 8), get32(q + 12), get32(q + 16), + get32(q + 20)}, get32(q + 24)}); + for (uint64_t i = 0; i < nb; i++, q += 48) { + Blob b{get64(q), get32(q + 8), {}}; + std::memcpy(b.sha.data(), q + 16, 32); + if (b.offset > payload || b.size > payload - b.offset) return nullptr; + pack->blobs.push_back(b); + } + for (const auto& f : pack->files) + if (f.blob >= nb || pack->blobs[f.blob].size != f.padded || f.padded % 2048 || + f.size > f.padded || f.padded - f.size >= 2048) + return nullptr; + for (const auto& d : pack->derived) + if (d.blob >= nb || d.file >= file_count) return nullptr; + pack->payload.resize(static_cast<size_t>(payload)); + if (!in.read(reinterpret_cast<char*>(pack->payload.data()), std::streamsize(payload))) return nullptr; + for (const auto& b : pack->blobs) + if (sha(pack->payload.data() + b.offset, b.size) != b.sha) return nullptr; + index_lba(*pack); + return pack; +} + +/* A cache from another disc with the same plan fingerprint cannot match the + * extents of every listed file on this one. */ +bool extents_match(const PSXResidentPack& pack, const PSXResidentSpec* s) { + for (uint32_t i = 0; i < s->file_count; i++) { + uint32_t lba = 0, size = 0; + if (!psx_mod_disc_file_extent(s->files[i].path, &lba, &size) || + lba != pack.files[i].lba || size != pack.files[i].size) + return false; + } + return true; +} + +void prune(const std::filesystem::path& keep, const std::string& format, uint32_t count) { + std::error_code ec; + std::vector<std::filesystem::directory_entry> packs; + const std::string prefix = format + "-"; + for (const auto& e : std::filesystem::directory_iterator(keep.parent_path(), ec)) { + const auto name = e.path().filename().string(); + if (e.path() != keep && name.rfind(prefix, 0) == 0 && e.path().extension() == ".pack") + packs.push_back(e); + } + if (packs.size() <= count) return; + std::sort(packs.begin(), packs.end(), [](const auto& a, const auto& b) { + std::error_code e1, e2; + return a.last_write_time(e1) > b.last_write_time(e2); + }); + for (size_t i = count; i < packs.size(); i++) std::filesystem::remove(packs[i].path(), ec); +} + +Record& record_for(const PSXResidentSpec* s) { + auto& r = records(); + for (auto& rec : r) + if (rec.title == s->title && rec.format == s->format) return rec; + r.push_back({}); + r.back().title = s->title; + r.back().format = s->format; + return r.back(); +} + +void json_string(std::string& out, const std::string& s) { + out += '"'; + for (char c : s) { + if (c == '"' || c == '\\') { out += '\\'; out += c; } + else if ((unsigned char)c < 0x20) { char b[8]; std::snprintf(b, sizeof b, "\\u%04x", c); out += b; } + else out += c; + } + out += '"'; +} + +} // namespace + +extern "C" int psx_resident_emit(PSXResidentSink* sink, uint32_t file, uint32_t tag, + const uint32_t meta[4], const void* bytes, uint32_t size) { + if (!sink || file >= sink->file_count || (!bytes && size)) return 0; + try { + const uint32_t blob = add_blob(*sink, static_cast<const uint8_t*>(bytes), size); + DerivedRec d{file, tag, {0, 0, 0, 0}, blob}; + if (meta) std::memcpy(d.meta, meta, sizeof d.meta); + sink->pack->derived.push_back(d); + return 1; + } catch (const std::exception& e) { + sink->error = e.what(); + return 0; + } +} + +extern "C" const PSXResidentPack* psx_resident_prepare(const PSXResidentSpec* spec) { + if (!valid_spec(spec)) { + psx_mod_counter_add("resident.invalid_spec", 1); + return nullptr; + } + Record& rec = record_for(spec); + rec.pack.reset(); + rec.error.clear(); + rec.path.clear(); + const auto start = std::chrono::steady_clock::now(); + try { + const std::string& fingerprint = PSXRecompV4::mod_runtime_fingerprint(); + const Digest key = cache_key(spec, fingerprint); + /* Without a committed plan there is no disc identity to key on: build + * in memory and never reuse or publish. */ + const bool cacheable = !fingerprint.empty(); + std::filesystem::path path; + std::unique_ptr<PSXResidentPack> pack; + if (cacheable) { + path = cache_dir(spec->title) / (std::string(spec->format) + "-" + hex(key.data(), 16) + ".pack"); + rec.path = path.string(); + pack = load(path, key, spec->file_count); + if (pack && !extents_match(*pack, spec)) pack.reset(); + if (!pack && std::filesystem::exists(path)) psx_mod_counter_add("resident.cache_rejected", 1); + } + if (pack) { + rec.state = "verified"; + std::error_code ec; + std::filesystem::last_write_time(path, std::filesystem::file_time_type::clock::now(), ec); + psx_mod_counter_add("resident.verified", 1); + } else { + pack = build(spec, rec.error); + if (!pack) throw std::runtime_error(rec.error); + if (cacheable) publish(path, *pack, key); + rec.state = cacheable ? "prepared" : "prepared (uncached: no mod plan)"; + psx_mod_counter_add("resident.prepared", 1); + } + if (cacheable) prune(path, spec->format, spec->keep_packs ? spec->keep_packs : 3); + rec.pack = std::move(pack); + } catch (const std::exception& e) { + rec.pack.reset(); + rec.state = "failed"; + if (rec.error.empty()) rec.error = e.what(); + psx_mod_counter_add("resident.prepare_failed", 1); + } + rec.ms = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - start).count(); + return rec.pack.get(); +} + +extern "C" uint32_t psx_resident_file_count(const PSXResidentPack* p) { + return p ? uint32_t(p->files.size()) : 0; +} + +extern "C" const uint8_t* psx_resident_file(const PSXResidentPack* p, uint32_t file, + uint32_t* size, uint32_t* padded) { + if (!p || file >= p->files.size()) return nullptr; + const auto& f = p->files[file]; + if (size) *size = f.size; + if (padded) *padded = f.padded; + return p->payload.data() + p->blobs[f.blob].offset; +} + +extern "C" uint32_t psx_resident_file_lba(const PSXResidentPack* p, uint32_t file) { + return p && file < p->files.size() ? p->files[file].lba : 0; +} + +extern "C" int psx_resident_file_stock(const PSXResidentPack* p, uint32_t file) { + return p && file < p->files.size() ? int(p->files[file].stock) : 0; +} + +extern "C" uint32_t psx_resident_modified_files(const PSXResidentPack* p) { + return p ? p->modified : 0; +} + +extern "C" const uint8_t* psx_resident_find_lba(const PSXResidentPack* p, uint32_t lba, + uint32_t bytes, uint32_t* file) { + if (!p || p->by_lba.empty()) return nullptr; + /* Last file starting at or before lba. Files never overlap on a disc. */ + auto it = std::upper_bound(p->by_lba.begin(), p->by_lba.end(), lba, + [&](uint32_t v, uint32_t i) { return v < p->files[i].lba; }); + if (it == p->by_lba.begin()) return nullptr; + const uint32_t i = *--it; + const auto& f = p->files[i]; + const uint64_t offset = uint64_t(lba - f.lba) * 2048u; + if (offset > f.padded || bytes > f.padded - offset) return nullptr; + if (file) *file = i; + return p->payload.data() + p->blobs[f.blob].offset + offset; +} + +extern "C" uint32_t psx_resident_derived_count(const PSXResidentPack* p) { + return p ? uint32_t(p->derived.size()) : 0; +} + +extern "C" const uint8_t* psx_resident_derived(const PSXResidentPack* p, uint32_t index, + uint32_t* file, uint32_t* tag, + uint32_t meta[4], uint32_t* size) { + if (!p || index >= p->derived.size()) return nullptr; + const auto& d = p->derived[index]; + if (file) *file = d.file; + if (tag) *tag = d.tag; + if (meta) std::memcpy(meta, d.meta, sizeof d.meta); + if (size) *size = p->blobs[d.blob].size; + return p->payload.data() + p->blobs[d.blob].offset; +} + +extern "C" int psx_resident_guest_ranges_match(const PSXResidentRange* ranges, uint32_t count, + const char* sha256) { + if (!ranges || !count || !sha256) return 0; + psx_sha256_ctx ctx; + psx_sha256_init(&ctx); + uint8_t chunk[256]; + for (uint32_t r = 0; r < count; r++) { + if (ranges[r].hi < ranges[r].lo) return 0; + for (uint32_t a = ranges[r].lo; a < ranges[r].hi;) { + const uint32_t n = std::min<uint32_t>(sizeof chunk, ranges[r].hi - a); + for (uint32_t i = 0; i < n; i++) chunk[i] = psx_mod_read_byte(a + i); + psx_sha256_update(&ctx, chunk, n); + a += n; + } + } + uint8_t d[32]; + psx_sha256_final(&ctx, d); + return hex(d) == sha256; +} + +extern "C" int psx_resident_status_json(char* out, uint32_t capacity) { + std::string s = "["; + for (const auto& r : records()) { + if (s.size() > 1) s += ','; + s += "{\"title\":"; json_string(s, r.title); + s += ",\"format\":"; json_string(s, r.format); + s += ",\"state\":"; json_string(s, r.state); + s += ",\"error\":"; json_string(s, r.error); + s += ",\"path\":"; json_string(s, r.path); + char b[256]; + const PSXResidentPack* p = r.pack.get(); + std::snprintf(b, sizeof b, + ",\"files\":%u,\"modified\":%u,\"derived\":%u,\"blobs\":%u,\"bytes\":%llu,\"ms\":%.1f}", + p ? unsigned(p->files.size()) : 0u, p ? p->modified : 0u, + p ? unsigned(p->derived.size()) : 0u, p ? unsigned(p->blobs.size()) : 0u, + p ? (unsigned long long)p->payload.size() : 0ull, r.ms); + s += b; + } + s += ']'; + if (!out || capacity <= s.size()) return 0; + std::memcpy(out, s.c_str(), s.size() + 1); + return 1; +} diff --git a/runtime/src/mod_runtime.cpp b/runtime/src/mod_runtime.cpp index 1da7c7c1..526bfd2b 100644 --- a/runtime/src/mod_runtime.cpp +++ b/runtime/src/mod_runtime.cpp @@ -1627,6 +1627,65 @@ extern "C" int psx_mod_read_disc_file(const char* path, void* buffer, } catch (...) { return 0; } } +extern "C" int psx_mod_disc_file_extent(const char* path, uint32_t* lba, + uint32_t* size) { + using namespace PSXRecompV4; + if (lba) *lba = 0; + if (size) *size = 0; + if (!path || !*path || !lba || !size) return 0; + try { + const auto& s = state(); + const auto& mount = s.effective_disc_path.empty() ? s.disc_path : s.effective_disc_path; + if (mount.empty()) return 0; + PS1::ISOReader reader; + uint32_t first = 0, bytes = 0; + bool directory = false; + if (!reader.Open(mount.string()) || + !find_effective_file(reader, path, first, bytes, directory) || + directory || !bytes || bytes > kMaxDiscFileBytes) + return 0; + *lba = first; + *size = bytes; + return 1; + } catch (...) { return 0; } +} + +namespace PSXRecompV4 { +/* Whole effective sectors, including the bytes after end-of-file in the last + * sector: a sector-granular read by the game receives exactly these. */ +bool mod_runtime_read_disc_file_sectors(const std::string& path, uint32_t max_bytes, + std::vector<uint8_t>& padded, uint32_t& lba, + uint32_t& size, std::string* error) { + padded.clear(); + lba = size = 0; + auto fail = [&](const std::string& why) { + if (error) *error = path + ": " + why; + padded.clear(); + return false; + }; + try { + const auto& s = state(); + const auto& mount = s.effective_disc_path.empty() ? s.disc_path : s.effective_disc_path; + if (mount.empty()) return fail("no disc mounted"); + PS1::ISOReader reader; + bool directory = false; + if (!reader.Open(mount.string())) return fail("cannot open disc"); + if (!find_effective_file(reader, path, lba, size, directory) || directory) + return fail("not found on the disc"); + if (!size || size > kMaxDiscFileBytes || (max_bytes && size > max_bytes)) + return fail("unsupported size " + std::to_string(size)); + const uint32_t sectors = (size + 2047u) / 2048u; + padded.resize(size_t(sectors) * 2048u); + for (uint32_t i = 0; i < sectors; ++i) + if (!read_effective_user_sector(reader, lba + i, padded.data() + size_t(i) * 2048u)) + return fail("unreadable sector " + std::to_string(lba + i)); + return true; + } catch (const std::exception& e) { + return fail(e.what()); + } +} +} // namespace PSXRecompV4 + extern "C" void mod_runtime_activate_plugins(void) { using namespace PSXRecompV4; RuntimeMods& s = state(); diff --git a/runtime/tests/test_mod_resident.cpp b/runtime/tests/test_mod_resident.cpp new file mode 100644 index 00000000..7a1d5729 --- /dev/null +++ b/runtime/tests/test_mod_resident.cpp @@ -0,0 +1,280 @@ +/* Resident disc resources (mod_resident.h): build from the effective disc, + * warm verification, corruption and plan-change invalidation, stock policy, + * derived blobs, relocation, pruning and the guest-range guard. */ +#include "mod_resident.h" +#include "mod_runtime.h" +#include "mod_plugins.h" +#include "psx_sha256.h" +#include "gpu.h" + +#include <array> +#include <algorithm> +#include <cstdint> +#include <cstdlib> +#include <cstring> +#include <filesystem> +#include <fstream> +#include <iostream> +#include <string> +#include <vector> + +namespace fs = std::filesystem; + +static std::array<uint8_t, 2 * 1024 * 1024> ram; +static int failures; + +extern "C" uint8_t psx_read_byte(uint32_t a) { return ram[a & 0x1fffffu]; } +extern "C" void psx_write_byte(uint32_t a, uint8_t v) { ram[a & 0x1fffffu] = v; } +extern "C" uint16_t psx_read_half(uint32_t a) { + return (uint16_t)(ram[a & 0x1fffffu] | ram[(a + 1) & 0x1fffffu] << 8); +} +extern "C" void psx_write_half(uint32_t a, uint16_t v) { + psx_write_byte(a, (uint8_t)v); psx_write_byte(a + 1, (uint8_t)(v >> 8)); +} +extern "C" uint32_t psx_read_word(uint32_t a) { + return (uint32_t)psx_read_half(a) | (uint32_t)psx_read_half(a + 2) << 16; +} +extern "C" void psx_write_word(uint32_t a, uint32_t v) { + psx_write_half(a, (uint16_t)v); psx_write_half(a + 2, (uint16_t)(v >> 16)); +} +extern "C" void psx_host_write_byte(uint32_t a, uint8_t v) { psx_write_byte(a, v); } +extern "C" void psx_host_write_half(uint32_t a, uint16_t v) { psx_write_half(a, v); } +extern "C" void psx_host_write_word(uint32_t a, uint32_t v) { psx_write_word(a, v); } +extern "C" uint32_t psx_mod_memory_alloc(uint32_t, uint32_t) { return 0; } +extern "C" uint32_t psx_mod_gpu_dma_memory_alloc(uint32_t, uint32_t) { return 0; } +extern "C" void psx_ram_reset_size_request(void) {} +extern "C" void psx_projection_reset_session(void) {} +extern "C" void gpu_ws_set_native_scene_predicate(int (*)(void)) {} +extern "C" int psx_ws_x_margin(void) { return 0; } +extern "C" void gpu_get_display_info(GpuDisplayInfo* out) { *out = GpuDisplayInfo{}; } +extern "C" void dirty_ram_mark_executable_range(uint32_t, uint32_t) {} +extern "C" int fntrace_is_game_started(void) { return 1; } +extern "C" void gpu_ws_tag_hud_primitive(uint32_t, int) {} +extern "C" void gpu_ws_tag_world_primitive(uint32_t, int) {} +extern "C" void gpu_ws_set_adaptive_backdrop_preload(int) {} +extern "C" int gpu_ws_configured_x_reveal(void) { return 0; } +extern "C" void gpu_ws_tag_hud_prim(uint32_t, int) {} +extern "C" void gpu_ws_tag_screen_mask_quad(uint32_t) {} +extern "C" void gpu_ws_tag_radial_screen_mask_quad(uint32_t, float) {} + +static void check(bool ok, const char* what) { + if (!ok) { std::cerr << "FAIL: " << what << "\n"; failures++; } +} + +static std::string sha_hex(const uint8_t* p, size_t n) { + uint8_t d[32]; + psx_sha256_compute(p, n, d); + static const char* h = "0123456789abcdef"; + std::string s(64, '0'); + for (int i = 0; i < 32; i++) { s[2 * i] = h[d[i] >> 4]; s[2 * i + 1] = h[d[i] & 15]; } + return s; +} + +static void write_bytes(const fs::path& p, const std::vector<uint8_t>& b) { + fs::create_directories(p.parent_path()); + std::ofstream(p, std::ios::binary).write((const char*)b.data(), (std::streamsize)b.size()); +} +static void write_text(const fs::path& p, const std::string& t) { + fs::create_directories(p.parent_path()); + std::ofstream(p) << t; +} + +/* derive: one reversed copy of each file, plus a copy of file 0's bytes from + * file 1 (identical bytes must share one blob). */ +static int derive_calls; +static int derive(PSXResidentSink* sink, uint32_t file, const uint8_t* data, uint32_t size, + int stock, void* user) { + derive_calls++; + std::vector<uint8_t> rev(data, data + size); + std::reverse(rev.begin(), rev.end()); + const uint32_t meta[4] = {size, (uint32_t)stock, 0xabcdu, file}; + if (!psx_resident_emit(sink, file, 7, meta, rev.data(), size)) return 0; + if (file == 1) { + const auto* first = static_cast<const std::vector<uint8_t>*>(user); + if (!psx_resident_emit(sink, file, 9, nullptr, first->data(), (uint32_t)first->size())) return 0; + } + return 1; +} + +static std::string status() { + std::vector<char> b(8192); + return psx_resident_status_json(b.data(), (uint32_t)b.size()) ? std::string(b.data()) : ""; +} + +int main() { + std::error_code ec; + const fs::path root = fs::temp_directory_path() / "psx_mod_resident_test"; + fs::remove_all(root, ec); +#ifdef _WIN32 + _putenv_s("PSX_RESIDENT_CACHE", (root / "cache").string().c_str()); +#else + setenv("PSX_RESIDENT_CACHE", (root / "cache").string().c_str(), 1); +#endif + + /* ISO: root dir @20 -> DATA dir @21 -> A.BIN (3000 bytes @22..23), + * B.BIN (5000 bytes @24..26). Non-zero bytes after each end of file. */ + std::vector<uint8_t> iso(30 * 2048); + auto le32 = [&](size_t at, uint32_t n) { for (unsigned i = 0; i < 4; ++i) iso[at + i] = (uint8_t)(n >> (i * 8)); }; + auto record = [&](size_t at, uint32_t lba, uint32_t bytes, bool dir, const std::string& name) { + iso[at] = (uint8_t)((33 + name.size() + 1) & ~size_t(1)); + le32(at + 2, lba); le32(at + 10, bytes); iso[at + 25] = dir ? 2 : 0; + iso[at + 28] = 1; iso[at + 31] = 1; iso[at + 32] = (uint8_t)name.size(); + std::copy(name.begin(), name.end(), iso.begin() + at + 33); + return (size_t)iso[at]; + }; + iso[16 * 2048] = 1; std::copy_n("CD001", 5, iso.begin() + 16 * 2048 + 1); iso[16 * 2048 + 6] = 1; + record(16 * 2048 + 156, 20, 2048, true, std::string(1, '\0')); + record(20 * 2048, 21, 2048, true, "DATA"); + const size_t a_rec = 21 * 2048; + const size_t b_rec = a_rec + record(a_rec, 22, 3000, false, "A.BIN;1"); + record(b_rec, 24, 5000, false, "B.BIN;1"); + for (unsigned i = 0; i < 2 * 2048; ++i) iso[22 * 2048 + i] = i < 3000 ? (uint8_t)(i * 7) : 0xEE; + for (unsigned i = 0; i < 3 * 2048; ++i) iso[24 * 2048 + i] = i < 5000 ? (uint8_t)(i * 13 + 1) : 0xDD; + const std::vector<uint8_t> a_padded(iso.begin() + 22 * 2048, iso.begin() + 24 * 2048); + const std::vector<uint8_t> b_padded(iso.begin() + 24 * 2048, iso.begin() + 27 * 2048); + const std::string a_sha = sha_hex(a_padded.data(), a_padded.size()); + const std::string b_sha = sha_hex(b_padded.data(), b_padded.size()); + + const fs::path disc_root = root / "disc"; + const fs::path iso_path = disc_root / "game.iso"; + write_bytes(iso_path, iso); + std::string error; + check(PSXRecompV4::mod_runtime_initialize(disc_root, "RESIDENT", 0, {}, &error), "initialize"); + check(PSXRecompV4::mod_runtime_commit(iso_path, &error), "commit"); + check(!PSXRecompV4::mod_runtime_fingerprint().empty(), "a committed plan has a fingerprint"); + + uint32_t lba = 0, size = 0; + check(psx_mod_disc_file_extent("DATA/B.BIN", &lba, &size) && lba == 24 && size == 5000, + "extent query reports the effective record"); + check(!psx_mod_disc_file_extent("DATA", &lba, &size) && !lba && !size, "extent rejects directories"); + + PSXResidentFile files[2] = {{"DATA/A.BIN", 3000, a_sha.c_str()}, + {"data/b.bin", 5000, b_sha.c_str()}}; + PSXResidentSpec spec{}; + spec.struct_size = sizeof spec; + spec.title = "ResidentTest"; + spec.format = "rt-v1"; + spec.files = files; + spec.file_count = 2; + spec.policy = PSX_RESIDENT_REQUIRE_STOCK; + spec.derive = derive; + spec.derive_user = (void*)&a_padded; + spec.keep_packs = 2; + + const PSXResidentPack* pack = psx_resident_prepare(&spec); + check(pack != nullptr, "cold prepare"); + check(derive_calls == 2, "derive runs once per file on a cold build"); + check(status().find("\"state\":\"prepared\"") != std::string::npos, "status reports a prepared pack"); + uint32_t padded = 0; + const uint8_t* a = psx_resident_file(pack, 0, &size, &padded); + check(a && size == 3000 && padded == 4096 && std::equal(a_padded.begin(), a_padded.end(), a), + "file bytes include the true sector tail"); + check(psx_resident_file_lba(pack, 1) == 24 && psx_resident_file_stock(pack, 0) && + psx_resident_file_stock(pack, 1) && !psx_resident_modified_files(pack), "lba and stock flags"); + uint32_t which = 99; + const uint8_t* at = psx_resident_find_lba(pack, 25, 4096, &which); + check(at && which == 1 && std::equal(b_padded.begin() + 2048, b_padded.end(), at), "find by lba inside a file"); + check(!psx_resident_find_lba(pack, 25, 4097, nullptr), "find rejects spans past the padded end"); + check(!psx_resident_find_lba(pack, 21, 16, nullptr), "find rejects lbas before every file"); + check(psx_resident_derived_count(pack) == 3, "derived blobs kept in order"); + uint32_t file = 0, tag = 0, meta[4] = {}; + const uint8_t* d = psx_resident_derived(pack, 1, &file, &tag, meta, &size); + check(d && file == 1 && tag == 7 && size == 6144 && meta[0] == 6144 && meta[1] == 1 && meta[2] == 0xabcd && + d[0] == b_padded.back(), "derived blob metadata and bytes"); + const uint8_t* dup = psx_resident_derived(pack, 2, &file, &tag, nullptr, &size); + check(dup == a && tag == 9, "identical bytes share one blob"); + + /* Warm: verified from disk, derive not called. */ + pack = psx_resident_prepare(&spec); + check(pack && derive_calls == 2, "warm prepare reuses the cache"); + check(status().find("\"state\":\"verified\"") != std::string::npos, "status reports verification"); + check(std::equal(a_padded.begin(), a_padded.end(), psx_resident_file(pack, 0, nullptr, nullptr)), + "warm bytes identical"); + + /* A flipped payload byte is caught by its blob hash and rebuilt. */ + fs::path pack_path; + for (const auto& e : fs::directory_iterator(root / "cache" / "ResidentTest")) + if (e.path().extension() == ".pack") pack_path = e.path(); + { + std::fstream f(pack_path, std::ios::binary | std::ios::in | std::ios::out); + f.seekp(-1, std::ios::end); + char c = 0x55; + f.write(&c, 1); + } + pack = psx_resident_prepare(&spec); + check(pack && derive_calls == 4, "corrupt cache rebuilt"); + + /* Stock policy. */ + std::string wrong(64, '0'); + files[0].stock_sha256 = wrong.c_str(); + check(!psx_resident_prepare(&spec), "require-stock rejects a differing file"); + check(status().find("differs from the original disc") != std::string::npos, "failure reason kept"); + spec.policy = PSX_RESIDENT_ALLOW_MODIFIED; + pack = psx_resident_prepare(&spec); + check(pack && !psx_resident_file_stock(pack, 0) && psx_resident_modified_files(pack) == 1, + "allow-modified serves and counts the differing file"); + files[0].stock_sha256 = a_sha.c_str(); + spec.policy = PSX_RESIDENT_REQUIRE_STOCK; + + /* Old packs of this format are pruned to keep_packs; others untouched. */ + for (int i = 0; i < 4; i++) write_bytes(root / "cache" / "ResidentTest" / ("rt-v1-old" + std::to_string(i) + ".pack"), {1}); + write_bytes(root / "cache" / "ResidentTest" / "other-v1-x.pack", {1}); + pack = psx_resident_prepare(&spec); + unsigned ours = 0, other = 0; + for (const auto& e : fs::directory_iterator(root / "cache" / "ResidentTest")) { + const auto name = e.path().filename().string(); + ours += name.rfind("rt-v1-", 0) == 0; + other += name.rfind("other-", 0) == 0; + } + check(pack && ours == 3 && other == 1, "prune keeps the active pack plus keep_packs of its format only"); + + /* A mod plan that patches B and grows A through its directory record: + * a new key (new pack), effective bytes and the relocated extent. */ + write_text(disc_root / "packages/rt.patch/1.0.0/manifest.toml", + "format_version = 5\nid = \"rt.patch\"\nversion = \"1.0.0\"\nname = \"RT Patch\"\n" + "[[target]]\ngame_id = \"RESIDENT\"\ndisc_sha256 = \"" + sha_hex(iso.data(), iso.size()) + "\"\n" + "[[feature]]\nid = \"asset\"\nname = \"Asset\"\n" + "[[patch]]\nfeature = \"asset\"\ntarget = \"disc_user\"\noffset = " + std::to_string(24 * 2048 + 2) + "\n" + "expected = \"1b\"\nreplace = \"5a\"\n" + "[[patch]]\nfeature = \"asset\"\ntarget = \"disc_user\"\noffset = " + std::to_string(a_rec + 10) + "\n" + "expected = \"b80b0000\"\nreplace = \"00100000\"\n"); + write_text(disc_root / "state.toml", + "format_version = 2\n[[feature]]\npackage_id = \"rt.patch\"\nid = \"asset\"\nenabled = true\n"); + const std::string stock_fingerprint = PSXRecompV4::mod_runtime_fingerprint(); + check(PSXRecompV4::mod_runtime_initialize(disc_root, "RESIDENT", 0, {}, &error) && + PSXRecompV4::mod_runtime_commit(iso_path, &error), "patched plan commit"); + check(PSXRecompV4::mod_runtime_fingerprint() != stock_fingerprint, "plan fingerprint changed"); + check(!psx_resident_prepare(&spec), "require-stock refuses the modded plan"); + spec.policy = PSX_RESIDENT_ALLOW_MODIFIED; + const int before = derive_calls; + pack = psx_resident_prepare(&spec); + check(pack && derive_calls == before + 2, "modded plan builds its own pack"); + const uint8_t* b = psx_resident_file(pack, 1, &size, nullptr); + check(b && b[2] == 0x5a && !psx_resident_file_stock(pack, 1), "effective patched bytes served"); + a = psx_resident_file(pack, 0, &size, &padded); + check(a && size == 4096 && padded == 4096 && a[3500] == 0xEE && !psx_resident_file_stock(pack, 0), + "grown file read through its patched directory record"); + check(status().find("\"modified\":2") != std::string::npos, "status counts modified files"); + + /* Guest-range guard. */ + for (uint32_t i = 0; i < 64; i++) ram[0x1000 + i] = (uint8_t)(i ^ 0x5a); + std::vector<uint8_t> guarded(ram.begin() + 0x1000, ram.begin() + 0x1040); + const std::string guard = sha_hex(guarded.data(), guarded.size()); + const PSXResidentRange ranges[2] = {{0x80001000u, 0x80001020u}, {0x80001020u, 0x80001040u}}; + check(psx_resident_guest_ranges_match(ranges, 2, guard.c_str()), "guard matches"); + ram[0x1030] ^= 1; + check(!psx_resident_guest_ranges_match(ranges, 2, guard.c_str()), "guard detects a changed byte"); + + /* Invalid specs are refused before any disc access. */ + PSXResidentSpec bad = spec; + bad.format = "bad/format"; + check(!psx_resident_prepare(&bad), "format ids are file-name safe"); + bad = spec; + bad.struct_size = 4; + check(!psx_resident_prepare(&bad), "struct size checked"); + + fs::remove_all(root, ec); + if (failures) return 1; + std::cout << "mod resident tests passed\n"; + return 0; +} From 3358f81e25738a94adeac136d987ad23b9f47d88 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Sun, 4 Oct 2026 21:53:37 -0700 Subject: [PATCH 52/52] Let titles audit withheld plugin packages; SPU upload wraps like hardware Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --- runtime/include/mod_plugins.h | 3 ++- runtime/runtime.cmake | 23 ++++++++++++++++++++--- runtime/src/mod_guest_services.c | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/runtime/include/mod_plugins.h b/runtime/include/mod_plugins.h index 1950975c..948ae4c9 100644 --- a/runtime/include/mod_plugins.h +++ b/runtime/include/mod_plugins.h @@ -153,7 +153,8 @@ int psx_mod_host_write_ram(uint32_t address, const void* data, uint32_t bytes); /* PsyQ SpuWrite by DMA, completed synchronously: transfer address, DMA-write * transfer mode, the words through the SPU's DMA write path (address * advance and sample-IRQ checks), then transfer mode stop when stop_after. - * spu_address 8-aligned, guest_source/bytes word aligned, within SPU RAM. + * spu_address 8-aligned, guest_source/bytes word aligned, at most 512 KiB; + * the transfer address wraps at the end of SPU RAM as on hardware. * Library bookkeeping (transfer callbacks, busy flags) stays the caller's. */ int psx_mod_spu_upload(uint32_t spu_address, uint32_t guest_source, uint32_t bytes, int stop_after); diff --git a/runtime/runtime.cmake b/runtime/runtime.cmake index fa445bb2..715831fa 100644 --- a/runtime/runtime.cmake +++ b/runtime/runtime.cmake @@ -1,4 +1,4 @@ -# Shared psxrecomp runtime CMake helpers. +# Shared psxrecomp runtime CMake helpers. # # Include this from either the framework runtime build or a sibling game # project. SDL3 is the default; set -DPSX_SDL_BACKEND=SDL2 for the legacy @@ -1333,6 +1333,10 @@ function(_psxrt_stage_mod_catalog target preloaded_dir) AND IS_DIRECTORY "${preloaded_dir}") list(APPEND _audit_roots "${preloaded_dir}") endif() + get_target_property(_extra_roots ${target} PSXRT_AUDIT_MOD_DIRS) + if(_extra_roots) + list(APPEND _audit_roots ${_extra_roots}) + endif() add_test(NAME psx_mod_plugin_audit_${target} COMMAND $<TARGET_FILE:${target}> --audit-mod-plugins ${_audit_roots}) endif() @@ -1397,7 +1401,13 @@ function(psxrecomp_add_runtime_target target) # mods/builtin/packages) this target does not ship. They are left out of # <exe-dir>/mods/bundled entirely -- absent, not hidden -- so no packager # can ship them either. An id that is not a builtin fails configure. - set(multiValueArgs EXTRAS_SOURCES GAME_GENERATED_FULL_C EXCLUDE_BUILTIN_MODS) + # + # AUDIT_MOD_DIRS names further authored package trees (manifest.toml files + # are found recursively) that declare plugins this executable registers but + # no bundled catalog ships, e.g. development-only packages. They are + # audited, never staged. + set(multiValueArgs EXTRAS_SOURCES GAME_GENERATED_FULL_C EXCLUDE_BUILTIN_MODS + AUDIT_MOD_DIRS) cmake_parse_arguments(PSXRT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # DEBUG_PORT and WINDOW_TITLE were previously required cmake-time defaults. @@ -2003,7 +2013,14 @@ function(psxrecomp_add_runtime_target target) # letting it stage would have it wipe and re-stage the runtime's catalog # with only the framework half. if(NOT PSXRT_COSIM) - _psxrt_stage_mod_catalog("${target}" "${PSXRT_PRELOADED_MODS_DIR}" + foreach(_audit_dir IN LISTS PSXRT_AUDIT_MOD_DIRS) + if(NOT IS_DIRECTORY "${_audit_dir}") + message(FATAL_ERROR + "AUDIT_MOD_DIRS for target '${target}' is not a directory: ${_audit_dir}") + endif() + endforeach() + set_property(TARGET ${target} PROPERTY PSXRT_AUDIT_MOD_DIRS "${PSXRT_AUDIT_MOD_DIRS}") + _psxrt_stage_mod_catalog("${target}" "${PSXRT_PRELOADED_MODS_DIR}" ${PSXRT_EXCLUDE_BUILTIN_MODS}) endif() endif() diff --git a/runtime/src/mod_guest_services.c b/runtime/src/mod_guest_services.c index a148ffb5..141a5b4e 100644 --- a/runtime/src/mod_guest_services.c +++ b/runtime/src/mod_guest_services.c @@ -63,7 +63,7 @@ int psx_mod_host_write_ram(uint32_t address, const void* data, uint32_t bytes) { int psx_mod_spu_upload(uint32_t spu_address, uint32_t guest_source, uint32_t bytes, int stop_after) { if ((spu_address & 7u) || (guest_source & 3u) || (bytes & 3u) || - spu_address >= SPU_RAM_BYTES || bytes > SPU_RAM_BYTES - spu_address || + spu_address >= SPU_RAM_BYTES || bytes > SPU_RAM_BYTES || !ram_span(guest_source, bytes)) return 0; spu_write(SPU_TRANSFER_ADDR, spu_address >> 3);