X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfxvideo%2Fgpulib_if.c;h=bb3ad5637f68029ddc3b7affe79195a729fb10bd;hb=9766e77ddec3157cbf8b7da407b99f47467a8f72;hp=d98520cb6a776945581acf438d2551aded73c452;hpb=b194a2ecd43debbb3724e332b660b993725acd52;p=pcsx_rearmed.git diff --git a/plugins/dfxvideo/gpulib_if.c b/plugins/dfxvideo/gpulib_if.c index d98520cb..bb3ad563 100644 --- a/plugins/dfxvideo/gpulib_if.c +++ b/plugins/dfxvideo/gpulib_if.c @@ -309,11 +309,11 @@ void renderer_notify_res_change(void) 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) { @@ -342,7 +342,12 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) while(1) { - if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end) + if(list_position >= list_end) { + cmd = -1; + goto breakloop; + } + + if((*list_position & 0xf000f000) == 0x50005000) break; list_position++; @@ -360,7 +365,12 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) while(1) { - if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end) + if(list_position >= list_end) { + cmd = -1; + goto breakloop; + } + + if((*list_position & 0xf000f000) == 0x50005000) break; list_position += 2; @@ -386,6 +396,7 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd) } } +breakloop: gpu.ex_regs[1] &= ~0x1ff; gpu.ex_regs[1] |= lGPUstatusRet & 0x1ff;