#include "../gpulib/gpu.h"
#include "../../include/arm_features.h"
+#if defined(__GNUC__) && (__GNUC__ >= 6 || (defined(__clang_major__) && __clang_major__ >= 10))
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
+
#define u32 uint32_t
#define INFO_TW 0
PSXDisplay_t PSXDisplay;
unsigned char *psxVub;
-signed char *psxVsb;
unsigned short *psxVuw;
unsigned short *psxVuw_eom;
-signed short *psxVsw;
-uint32_t *psxVul;
-int32_t *psxVsl;
long lGPUstatusRet;
uint32_t lGPUInfoVals[16];
static void set_vram(void *vram)
{
psxVub=vram;
-
- psxVsb=(signed char *)psxVub; // different ways of accessing PSX VRAM
- psxVsw=(signed short *)psxVub;
- psxVsl=(int32_t *)psxVub;
psxVuw=(unsigned short *)psxVub;
- psxVul=(uint32_t *)psxVub;
-
psxVuw_eom=psxVuw+1024*512; // pre-calc of end of vram
}
{
}
+void renderer_notify_scanout_x_change(int x, int w)
+{
+}
+
extern const unsigned char cmd_lengths[256];
-int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
+int do_cmd_list(uint32_t *list, int list_len, int *last_cmd)
{
unsigned int cmd = 0, len;
- unsigned int *list_start = list;
- unsigned int *list_end = list + list_len;
+ uint32_t *list_start = list;
+ uint32_t *list_end = list + list_len;
for (; list < list_end; list += 1 + len)
{
}
#ifndef TEST
- if (cmd == 0xa0 || cmd == 0xc0)
+ if (0x80 <= cmd && cmd < 0xe0)
break; // image i/o, forward to upper layer
else if ((cmd & 0xf8) == 0xe0)
gpu.ex_regs[cmd & 7] = GETLE32(list);
return list - list_start;
}
-void renderer_sync_ecmds(uint32_t *ecmds)
+void renderer_sync_ecmds(uint32_t *ecmds_)
{
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ // the funcs below expect LE
+ uint32_t i, ecmds[8];
+ for (i = 1; i <= 6; i++)
+ ecmds[i] = HTOLE32(ecmds_[i]);
+#else
+ uint32_t *ecmds = ecmds_;
+#endif
cmdTexturePage((unsigned char *)&ecmds[1]);
cmdTextureWindow((unsigned char *)&ecmds[2]);
cmdDrawAreaStart((unsigned char *)&ecmds[3]);
cmdSTP((unsigned char *)&ecmds[6]);
}
-void renderer_update_caches(int x, int y, int w, int h)
+void renderer_update_caches(int x, int y, int w, int h, int state_changed)
{
}