From 252df2cc9563522e9aef02b0b13010421b60e5fe Mon Sep 17 00:00:00 2001 From: hooby3dfx Date: Mon, 13 Jan 2014 12:12:26 -0500 Subject: [PATCH] Holy Seaman, batman! Seaman will load :) --- core/hw/maple/maple_cfg.cpp | 2 +- core/hw/maple/maple_devs.cpp | 85 +++++++++++++++++++++++++++++++++++- core/hw/maple/maple_devs.h | 1 + 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/core/hw/maple/maple_cfg.cpp b/core/hw/maple/maple_cfg.cpp index 16e5a63fe..8ed2b09cc 100644 --- a/core/hw/maple/maple_cfg.cpp +++ b/core/hw/maple/maple_cfg.cpp @@ -72,7 +72,7 @@ void mcfg_CreateDevices() #ifdef HAS_VMU mcfg_Create(MDT_SegaVMU,0,0); - mcfg_Create(MDT_SegaVMU,0,1); + mcfg_Create(MDT_Microphone,0,1); #endif } diff --git a/core/hw/maple/maple_devs.cpp b/core/hw/maple/maple_devs.cpp index c352db493..aa684a304 100755 --- a/core/hw/maple/maple_devs.cpp +++ b/core/hw/maple/maple_devs.cpp @@ -651,6 +651,86 @@ struct maple_sega_vmu: maple_base }; #endif +struct maple_microphone: maple_base +{ + virtual u32 dma(u32 cmd) + { + //printf("maple_microphone::dma Called 0x%X;Command %d\n",device_instance->port,Command); + switch (cmd) + { + case MDC_DeviceRequest: + //caps + //4 + w32(MFID_4_Mic); + + //struct data + //3*4 + w32( 0xfe060f00); + w32( 0); + w32( 0); + + //1 area code + w8(0xFF); + + //1 direction + w8(0); + + //30 + wstr(maple_sega_mic_name,30); + + //60 + wstr(maple_sega_brand,60); + + //2 + w16(0x01AE); + + //2 + w16(0x01F4); + + return MDRS_DeviceStatus; + + //controller condition + case MDCF_GetCondition: + { + //PlainJoystickState pjs; + //config->GetInput(&pjs); + //caps + //4 + w32(MFID_4_Mic); + + //state data + //2 key code + //w16(pjs.kcode); + + //triggers + //1 R + //w8(pjs.trigger[PJTI_R]); + //1 L + //w8(pjs.trigger[PJTI_L]); + + //joyx + //1 + //w8(pjs.joy[PJAI_X1]); + //joyy + //1 + //w8(pjs.joy[PJAI_Y1]); + + //not used + //1 + w8(0x80); + //1 + w8(0x80); + } + + return MDRS_DataTransfer; + + default: + printf("UNKOWN MAPLE COMMAND %d\n",cmd); + return MDRE_UnknownFunction; + } + } +}; + maple_device* maple_Create(MapleDeviceType type) { maple_device* rv=0; @@ -659,6 +739,9 @@ maple_device* maple_Create(MapleDeviceType type) case MDT_SegaController: rv=new maple_sega_controller(); break; + case MDT_Microphone: + rv=new maple_microphone(); + break; #ifdef HAS_VMU case MDT_SegaVMU: rv = new maple_sega_vmu(); @@ -670,4 +753,4 @@ maple_device* maple_Create(MapleDeviceType type) } return rv; -} \ No newline at end of file +} diff --git a/core/hw/maple/maple_devs.h b/core/hw/maple/maple_devs.h index 0c9980dc0..2793e039f 100644 --- a/core/hw/maple/maple_devs.h +++ b/core/hw/maple/maple_devs.h @@ -5,6 +5,7 @@ enum MapleDeviceType { MDT_SegaController, MDT_SegaVMU, + MDT_Microphone, MDT_Count };