-input/input_rawinput.cpp: Properly align buffers for RAWINPUT header

-jaleco/megasys1.cpp: Clarified comment about MCU program used for chimerab.
This commit is contained in:
Vas Crabb 2024-03-07 03:10:27 +11:00
parent 9fa38080b1
commit 2c40cf660e
2 changed files with 8 additions and 8 deletions

View file

@ -2923,7 +2923,7 @@ ROM_START( chimerab )
ROM_LOAD16_BYTE( "prg8.bin", 0x000000, 0x010000, CRC(a682b1ca) SHA1(66f5d5a73f5e8cba87eac09c55eee59117d94f7b) )
ROM_LOAD16_BYTE( "prg7.bin", 0x000001, 0x010000, CRC(83b9982d) SHA1(68e7d344ebfffe19822c4cf9f7b13cb51f23537a) )
ROM_REGION( 0x4000, "iomcu", 0 ) /* TMP91640 Internal Code, same as cybattlr */
ROM_REGION( 0x4000, "iomcu", 0 ) /* TMP91640 Internal Code - using Cybattler program, label not confirmed */
ROM_LOAD( "mo-91028.mcu", 0x00000, 0x04000, BAD_DUMP CRC(a72e04a7) SHA1(0bd96272e37b0e23793ca47b98a966540e2e2df9) )
ROM_REGION( 0x080000, "scroll0", 0 ) /* Scroll 0 */

View file

@ -608,7 +608,7 @@ private:
//============================================================
// rawinput_module - base class for rawinput modules
// rawinput_module - base class for RawInput modules
//============================================================
class rawinput_module : public wininput_module<rawinput_device>
@ -726,9 +726,9 @@ protected:
{
HRAWINPUT const rawinputdevice = *static_cast<HRAWINPUT *>(eventdata);
BYTE small_buffer[4096];
union { RAWINPUT r; BYTE b[4096]; } small_buffer;
std::unique_ptr<BYTE []> larger_buffer;
LPBYTE data = small_buffer;
LPVOID data = &small_buffer;
UINT size;
// determine the size of data buffer we need
@ -738,7 +738,7 @@ protected:
// if necessary, allocate a temporary buffer and fetch the data
if (size > sizeof(small_buffer))
{
larger_buffer.reset(new (std::nothrow) BYTE [size]);
larger_buffer.reset(new (std::align_val_t(alignof(RAWINPUT)), std::nothrow) BYTE [size]);
data = larger_buffer.get();
if (!data)
return false;
@ -843,7 +843,7 @@ protected:
//============================================================
// keyboard_input_rawinput - rawinput keyboard module
// keyboard_input_rawinput - RawInput keyboard module
//============================================================
class keyboard_input_rawinput : public rawinput_module
@ -870,7 +870,7 @@ protected:
//============================================================
// mouse_input_rawinput - rawinput mouse module
// mouse_input_rawinput - RawInput mouse module
//============================================================
class mouse_input_rawinput : public rawinput_module
@ -897,7 +897,7 @@ protected:
//============================================================
// lightgun_input_rawinput - rawinput lightgun module
// lightgun_input_rawinput - RawInput lightgun module
//============================================================
class lightgun_input_rawinput : public rawinput_module