From dc7f608461a66463b39cb65a7df779aa091dd3e9 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Wed, 8 May 2019 22:31:59 +0200 Subject: [PATCH] wince: fix vmu issues --- core/hw/maple/maple_devs.cpp | 55 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/core/hw/maple/maple_devs.cpp b/core/hw/maple/maple_devs.cpp index 3efc18fe8..b06af0a3d 100755 --- a/core/hw/maple/maple_devs.cpp +++ b/core/hw/maple/maple_devs.cpp @@ -90,7 +90,7 @@ enum MapleDeviceRV MDRE_UnknownFunction = 0xFE, //0 words MDRE_UnknownCmd = 0xFD, //0 words - MDRE_TransmitAgain = 0xFC, //1 word, 1 or 2? + MDRE_TransmitAgain = 0xFC, //0 words MDRE_FileError = 0xFB, //1 word, bitfield MDRE_LCDError = 0xFA, //1 word, bitfield MDRE_ARGunError = 0xF9, //1 word, bitfield @@ -152,7 +152,7 @@ struct maple_base: maple_device u8 r8() { u8 rv=*((u8*)dma_buffer_in);dma_buffer_in+=1;dma_count_in-=1; return rv; } u16 r16() { u16 rv=*((u16*)dma_buffer_in);dma_buffer_in+=2;dma_count_in-=2; return rv; } u32 r32() { u32 rv=*(u32*)dma_buffer_in;dma_buffer_in+=4;dma_count_in-=4; return rv; } - void rptr(const void* dst,u32 len) + void rptr(void* dst, u32 len) { u8* dst8=(u8*)dst; while(len--) @@ -205,7 +205,7 @@ struct maple_sega_controller: maple_base virtual u32 dma(u32 cmd) { - //printf("maple_sega_controller::dma Called 0x%X;Command %d\n",device_instance->port,Command); + //printf("maple_sega_controller::dma Called 0x%X;Command %d\n", bus_id, cmd); switch (cmd) { case MDC_DeviceRequest: @@ -275,7 +275,7 @@ struct maple_sega_controller: maple_base return MDRS_DataTransfer; default: - //printf("UNKOWN MAPLE COMMAND %d\n",cmd); + //printf("maple_sega_controller UNKOWN MAPLE COMMAND %d\n",cmd); return MDRE_UnknownCmd; } } @@ -288,24 +288,23 @@ struct maple_sega_controller: maple_base u8 vmu_default[] = { - 0x78,0x9c,0xed,0xd2,0x31,0x4e,0x02,0x61,0x10,0x06,0xd0,0x8f,0x04,0x28,0x4c,0x2c, - 0x28,0x2d,0x0c,0xa5,0x57,0xe0,0x16,0x56,0x16,0x76,0x14,0x1e,0xc4,0x03,0x50,0x98, - 0x50,0x40,0x69,0xc1,0x51,0x28,0xbc,0x8e,0x8a,0x0a,0xeb,0xc2,0xcf,0x66,0x13,0x1a, - 0x13,0xa9,0x30,0x24,0xe6,0xbd,0xc9,0x57,0xcc,0x4c,0x33,0xc5,0x2c,0xb3,0x48,0x6e, - 0x67,0x01,0x00,0x00,0x00,0x00,0x00,0x4e,0xaf,0xdb,0xe4,0x7a,0xd2,0xcf,0x53,0x16, - 0x6d,0x46,0x99,0xb6,0xc9,0x78,0x9e,0x3c,0x5f,0x9c,0xfb,0x3c,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x80,0x5f,0xd5,0x45,0xfd,0xef,0xaa,0xca,0x6b,0xde,0xf2,0x9e,0x55, - 0x3e,0xf2,0x99,0xaf,0xac,0xb3,0x49,0x95,0xef,0xd4,0xa9,0x9a,0xdd,0xdd,0x0f,0x9d, - 0x52,0xca,0xc3,0x91,0x7f,0xb9,0x9a,0x0f,0x6e,0x92,0xfb,0xee,0xa1,0x2f,0x6d,0x76, - 0xe9,0x64,0x9b,0xcb,0xf4,0xf2,0x92,0x61,0x33,0x79,0xfc,0xeb,0xb7,0xe5,0x44,0xf6, - 0x77,0x19,0x06,0xef, + 0x78, 0x9c, 0xed, 0xd2, 0x3d, 0x6a, 0x02, 0x01, 0x10, 0x06, 0xd0, 0x4f, 0x89, 0x41, 0x84, 0x74, + 0x36, 0x16, 0x41, 0x8f, 0x91, 0xda, 0x0b, 0x58, 0xa5, 0xcf, 0x81, 0x52, 0x08, 0x16, 0x5a, 0x5a, + 0x78, 0x14, 0x8b, 0x5c, 0xc7, 0xfc, 0xa8, 0xd9, 0x18, 0xd7, 0x65, 0xc1, 0x46, 0xd0, 0x4a, 0x09, + 0x84, 0xf7, 0x86, 0x0f, 0x66, 0x98, 0x66, 0x8a, 0x59, 0x66, 0x91, 0x8c, 0xa6, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xae, 0xef, 0xae, 0xca, 0xe3, 0xeb, 0x7d, 0xc6, 0x59, 0xd4, 0x79, 0xca, 0xa4, + 0x4e, 0x5e, 0x66, 0xc9, 0xbc, 0xf3, 0xd7, 0xe7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9c, 0xb5, 0x2b, 0xd5, 0xff, 0xae, 0xa2, 0x5c, 0xe5, 0x3d, 0x1f, 0xf9, 0xcc, 0x57, 0xd6, 0xd9, + 0x64, 0x9b, 0xef, 0x14, 0xf9, 0xc9, 0x2e, 0x45, 0xb5, 0x7b, 0x3e, 0xd1, 0x28, 0x2b, 0x17, 0xfe, + 0x65, 0xd0, 0x6b, 0xb5, 0x07, 0xc3, 0x6e, 0xf3, 0x38, 0x97, 0x75, 0xf6, 0x69, 0xe4, 0x37, 0x0f, + 0x55, 0xff, 0x96, 0xfe, 0xcd, 0x7f, 0x96, 0xeb, 0x39, 0x00, 0xcd, 0xca, 0x06, 0x7d, }; struct maple_sega_vmu: maple_base @@ -416,7 +415,7 @@ struct maple_sega_vmu: maple_base } virtual u32 dma(u32 cmd) { - //printf("maple_sega_vmu::dma Called for port 0x%X, Command %d\n",device_instance->port,Command); + //printf("maple_sega_vmu::dma Called for port %d:%d, Command %d\n", bus_id, bus_port, cmd); switch (cmd) { case MDC_DeviceRequest: @@ -504,7 +503,7 @@ struct maple_sega_vmu: maple_base w8(47); //X dots -1 w8(31); //Y dots -1 w8(((1)<<4) | (0)); //1 Color, 0 contrast levels - w8(0); //Padding + w8(2); //Padding return MDRS_DataTransfer; } @@ -791,7 +790,7 @@ struct maple_microphone: maple_base switch (cmd) { case MDC_DeviceRequest: - LOGI("maple_microphone::dma MDC_DeviceRequest"); + LOGI("maple_microphone::dma MDC_DeviceRequest\n"); //this was copied from the controller case with just the id and name replaced! //caps @@ -826,7 +825,7 @@ struct maple_microphone: maple_base case MDCF_GetCondition: { - LOGI("maple_microphone::dma MDCF_GetCondition"); + LOGI("maple_microphone::dma MDCF_GetCondition\n"); //this was copied from the controller case with just the id replaced! //PlainJoystickState pjs; @@ -863,7 +862,7 @@ struct maple_microphone: maple_base case MDC_DeviceReset: //uhhh do nothing? - LOGI("maple_microphone::dma MDC_DeviceReset"); + LOGI("maple_microphone::dma MDC_DeviceReset\n"); return MDRS_DeviceReply; case MDCF_MICControl: @@ -932,7 +931,7 @@ struct maple_microphone: maple_base LOGI("maple_microphone::dma MDCF_MICControl set gain %#010x\n",secondword); return MDRS_DeviceReply; case MDRE_TransmitAgain: - LOGW("maple_microphone::dma MDCF_MICControl MDRE_TransminAgain"); + LOGW("maple_microphone::dma MDCF_MICControl MDRE_TransmitAgain\n"); //apparently this doesnt matter //wptr(micdata, SIZE_OF_MIC_DATA); return MDRS_DeviceReply;//MDRS_DataTransfer;