vmu: pass bus id and port to callback

This commit is contained in:
Flyinghead 2019-03-29 19:54:59 +01:00
parent 09ea5eba78
commit 7f44bb9956
3 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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

View File

@ -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] = {