#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <stddef.h>
#include <string.h>
#include <assert.h>
#include "vector_ops.h"
#endif
#include "psx_gpu_simd.h"
+#include "psx_gpu_offsets.h"
#if 0
void dump_r_d(const char *name, void *dump);
return mask;
}
-void update_texture_cache_region(psx_gpu_struct *psx_gpu, u32 x1, u32 y1,
- u32 x2, u32 y2)
+static void update_texture_cache_region_(psx_gpu_struct *psx_gpu,
+ u32 x1, u32 y1, u32 x2, u32 y2)
{
u32 mask = texture_region_mask(x1, y1, x2, y2);
u32 texture_page;
}
}
+void update_texture_cache_region(psx_gpu_struct *psx_gpu, u32 x1, u32 y1,
+ u32 x2, u32 y2)
+{
+ s32 w = x2 - x1;
+ do
+ {
+ x2 = x1 + w;
+ if (x2 > 1023)
+ x2 = 1023;
+ update_texture_cache_region_(psx_gpu, x1, y1, x2, y2);
+ w -= x2 - x1;
+ x1 = 0;
+ }
+ while (unlikely(w > 0));
+}
+
#ifndef NEON_BUILD
void update_texture_4bpp_cache(psx_gpu_struct *psx_gpu)
if(vertex_a->x >= vertex_b->x)
{
vertex_swap(vertex_a, vertex_b);
+ (void)triangle_winding;
}
x_a = vertex_a->x;
}
}
+#ifndef PCSX
void render_block_copy(psx_gpu_struct *psx_gpu, u16 *source, u32 x, u32 y,
u32 width, u32 height, u32 pitch)
{
render_block_copy(psx_gpu, psx_gpu->vram_ptr + source_x + (source_y * 1024),
dest_x, dest_y, width, height, 1024);
}
-
+#endif
void initialize_reciprocal_table(void)
{
psx_gpu->texture_page_ptr = psx_gpu->vram_ptr;
psx_gpu->clut_ptr = psx_gpu->vram_ptr;
+ psx_gpu->viewport_start_x = psx_gpu->viewport_start_y = 0;
+ psx_gpu->viewport_end_x = psx_gpu->viewport_end_y = 0;
psx_gpu->mask_msb = 0;
psx_gpu->texture_window_x = 0;
psx_gpu->primitive_type = PRIMITIVE_TYPE_UNKNOWN;
psx_gpu->saved_hres = 256;
+
+ // check some offset
+ psx_gpu->reserved_a[(offsetof(psx_gpu_struct, blocks) == psx_gpu_blocks_offset) - 1] = 0;
}
u64 get_us(void)
#endif
#include "psx_gpu_4x.c"
+
+// vim:ts=2:sw=2:expandtab