From 7f44bb99560c5e308cca0325b47efcfd711f0653 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Fri, 29 Mar 2019 19:54:59 +0100 Subject: [PATCH] vmu: pass bus id and port to callback --- core/hw/maple/maple_devs.cpp | 3 +-- core/hw/maple/maple_devs.h | 2 +- core/rend/gui.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/hw/maple/maple_devs.cpp b/core/hw/maple/maple_devs.cpp index 90cc5a089..ef9d5ac35 100755 --- a/core/hw/maple/maple_devs.cpp +++ b/core/hw/maple/maple_devs.cpp @@ -644,8 +644,7 @@ struct maple_sega_vmu: maple_base } } config->SetImage(lcd_data_decoded); - if (bus_id <= 3 && bus_port <= 1) - push_vmu_screen(bus_id * 2 + bus_port, lcd_data_decoded); + push_vmu_screen(bus_id, bus_port, lcd_data_decoded); #if 0 // Update LCD window if (!dev->lcd.visible) diff --git a/core/hw/maple/maple_devs.h b/core/hw/maple/maple_devs.h index 34cce8e56..ec45b4986 100755 --- a/core/hw/maple/maple_devs.h +++ b/core/hw/maple/maple_devs.h @@ -102,5 +102,5 @@ maple_device* maple_Create(MapleDeviceType type); #ifndef TARGET_PANDORA int get_mic_data(u8* buffer); //implemented in Android.cpp #endif -int push_vmu_screen(int vmu_id, u8* buffer); // vmu_id: 0-7 +void push_vmu_screen(int bus_id, int bus_port, u8* buffer); #define MAPLE_PORTS 4 diff --git a/core/rend/gui.cpp b/core/rend/gui.cpp index e2e9ef357..4b53795fb 100644 --- a/core/rend/gui.cpp +++ b/core/rend/gui.cpp @@ -1511,14 +1511,15 @@ static u32 vmu_lcd_data[8][48 * 32]; static bool vmu_lcd_status[8]; static ImTextureID vmu_lcd_tex_ids[8]; -int push_vmu_screen(int vmu_id, u8* buffer) +void push_vmu_screen(int bus_id, int bus_port, u8* buffer) { + int vmu_id = bus_id * 2 + bus_port; + if (vmu_id < 0 || vmu_id >= ARRAY_SIZE(vmu_lcd_data)) + return; u32 *p = &vmu_lcd_data[vmu_id][0]; for (int i = 0; i < ARRAY_SIZE(vmu_lcd_data[vmu_id]); i++, buffer++) *p++ = *buffer != 0 ? 0xFFFFFFFFu : 0xFF000000u; vmu_lcd_status[vmu_id] = true; - - return 0; } static const int vmu_coords[8][2] = {