diff --git a/core/hw/maple/maple_if.cpp b/core/hw/maple/maple_if.cpp index 39c26a362..08da4e305 100644 --- a/core/hw/maple/maple_if.cpp +++ b/core/hw/maple/maple_if.cpp @@ -217,7 +217,7 @@ static void maple_DoDma() } //printf("Maple XFER size %d bytes - %.2f ms\n",xfer_count,xfer_count*100.0f/(2*1024*1024/8)); - sh4_sched_request(maple_schid,xfer_count*(SH4_MAIN_CLOCK/(2*1024*1024/8))); + sh4_sched_request(maple_schid, std::min((u64)xfer_count * (SH4_MAIN_CLOCK / (2 * 1024 * 1024 / 8)), (u64)SH4_MAIN_CLOCK)); } int maple_schd(int tag, int c, int j) diff --git a/core/hw/mem/_vmem.cpp b/core/hw/mem/_vmem.cpp index 7b3a2b4f9..6f1123822 100644 --- a/core/hw/mem/_vmem.cpp +++ b/core/hw/mem/_vmem.cpp @@ -450,8 +450,7 @@ static void _vmem_set_p0_mappings() bool _vmem_reserve() { - // TODO: Static assert? - verify((sizeof(Sh4RCB)%PAGE_SIZE)==0); + static_assert((sizeof(Sh4RCB) % PAGE_SIZE) == 0, "sizeof(Sh4RCB) not multiple of PAGE_SIZE"); vmemstatus = MemTypeError; diff --git a/core/hw/pvr/pvr_mem.cpp b/core/hw/pvr/pvr_mem.cpp index 5327146e2..d0b304265 100644 --- a/core/hw/pvr/pvr_mem.cpp +++ b/core/hw/pvr/pvr_mem.cpp @@ -180,8 +180,7 @@ void YUV_data(u32* data , u32 count) //read u8 DYNACALL pvr_read_area1_8(u32 addr) { - INFO_LOG(MEMORY, "%08x: 8-bit VRAM reads are not possible", addr); - return 0; + return vram[pvr_map32(addr)]; } u16 DYNACALL pvr_read_area1_16(u32 addr) diff --git a/core/rend/TexCache.cpp b/core/rend/TexCache.cpp index a40b718ce..08c330849 100644 --- a/core/rend/TexCache.cpp +++ b/core/rend/TexCache.cpp @@ -836,7 +836,7 @@ void ReadFramebuffer(PixelBuffer& pb, int& width, int& height) { u16 src = pvr_read_area1_16(addr); *dst++ = (((src >> 11) & 0x1F) << 3) + FB_R_CTRL.fb_concat; - *dst++ = (((src >> 5) & 0x3F) << 2) + (FB_R_CTRL.fb_concat >> 1); + *dst++ = (((src >> 5) & 0x3F) << 2) + (FB_R_CTRL.fb_concat & 3); *dst++ = (((src >> 0) & 0x1F) << 3) + FB_R_CTRL.fb_concat; *dst++ = 0xFF; addr += bpp; diff --git a/core/windows/winmain.cpp b/core/windows/winmain.cpp index d24dd9a7e..ee149bd14 100644 --- a/core/windows/winmain.cpp +++ b/core/windows/winmain.cpp @@ -774,7 +774,7 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi sdl_window_destroy(); #else cfgSaveBool("window", "maximized", window_maximized); - if (!window_maximized && screen_width != 0 && screen_width != 0) + if (!window_maximized && screen_width != 0 && screen_height != 0) { cfgSaveInt("window", "width", screen_width); cfgSaveInt("window", "height", screen_height);