diff --git a/Cores/VisualBoyAdvance-M/GBA/PVGBAEmulatorCore.h b/Cores/VisualBoyAdvance-M/GBA/PVGBAEmulatorCore.h index c640859074..5a854a0a9a 100644 --- a/Cores/VisualBoyAdvance-M/GBA/PVGBAEmulatorCore.h +++ b/Cores/VisualBoyAdvance-M/GBA/PVGBAEmulatorCore.h @@ -29,7 +29,7 @@ #import #import -@interface PVGBAEmulatorCore : PVEmulatorCore +@interface PVGBAEmulatorCore : PVEmulatorCore - (void)didPushGBAButton:(PVGBAButton)button forPlayer:(NSInteger)player; - (void)didReleaseGBAButton:(PVGBAButton)button forPlayer:(NSInteger)player; diff --git a/Cores/VisualBoyAdvance-M/GBA/PVGBAEmulatorCore.mm b/Cores/VisualBoyAdvance-M/GBA/PVGBAEmulatorCore.mm index 43a60e4514..9ef78cf2b2 100644 --- a/Cores/VisualBoyAdvance-M/GBA/PVGBAEmulatorCore.mm +++ b/Cores/VisualBoyAdvance-M/GBA/PVGBAEmulatorCore.mm @@ -352,6 +352,7 @@ - (BOOL)loadStateFromFileAtPath:(NSString *)fileName error:(NSError**)error }; const int GBAMap[] = {KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_BUTTON_A, KEY_BUTTON_B, KEY_BUTTON_L, KEY_BUTTON_R, KEY_BUTTON_START, KEY_BUTTON_SELECT}; + - (void)didPushGBAButton:(PVGBAButton)button forPlayer:(NSInteger)player { pad[player] |= GBAMap[button]; @@ -362,6 +363,18 @@ - (void)didReleaseGBAButton:(PVGBAButton)button forPlayer:(NSInteger)player pad[player] &= ~GBAMap[button]; } +const int GBMap[] = {KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_BUTTON_A, KEY_BUTTON_B, KEY_BUTTON_START, KEY_BUTTON_SELECT}; + +- (void)didPushGBButton:(PVGBButton)button forPlayer:(NSInteger)player +{ + pad[player] |= GBMap[button]; +} + +- (void)didReleaseGBButton:(PVGBButton)button forPlayer:(NSInteger)player +{ + pad[player] &= ~GBMap[button]; +} + bool systemReadJoypads() { __strong PVGBAEmulatorCore *strongCurrent = _current; diff --git a/Cores/VisualBoyAdvance-M/PVGBA.xcodeproj/project.pbxproj b/Cores/VisualBoyAdvance-M/PVGBA.xcodeproj/project.pbxproj index cefd19c1c1..74bd1e504b 100644 --- a/Cores/VisualBoyAdvance-M/PVGBA.xcodeproj/project.pbxproj +++ b/Cores/VisualBoyAdvance-M/PVGBA.xcodeproj/project.pbxproj @@ -210,15 +210,15 @@ 1A9FBC3A1ABD0FEF004E778B /* GBACore */ = { isa = PBXGroup; children = ( - 1A9FBC3B1ABD0FEF004E778B /* apu */, + 1A9FBD211ABD0FEF004E778B /* Util.cpp */, 1A9FBC4A1ABD0FEF004E778B /* AutoBuild.h */, - 1A9FBC4B1ABD0FEF004E778B /* common */, - 1A9FBC871ABD0FEF004E778B /* gba */, 1A9FBD0A1ABD0FEF004E778B /* NLS.h */, 1A9FBD201ABD0FEF004E778B /* System.h */, - 1A9FBD211ABD0FEF004E778B /* Util.cpp */, 1A9FBD221ABD0FEF004E778B /* Util.h */, 1A9FBD241ABD0FEF004E778B /* version.h */, + 1A9FBC3B1ABD0FEF004E778B /* apu */, + 1A9FBC4B1ABD0FEF004E778B /* common */, + 1A9FBC871ABD0FEF004E778B /* gba */, ); path = GBACore; sourceTree = ""; @@ -226,19 +226,19 @@ 1A9FBC3B1ABD0FEF004E778B /* apu */ = { isa = PBXGroup; children = ( + 1A9FBC3F1ABD0FEF004E778B /* Blip_Buffer.cpp */, + 1A9FBC411ABD0FEF004E778B /* Effects_Buffer.cpp */, + 1A9FBC451ABD0FEF004E778B /* Gb_Apu_State.cpp */, + 1A9FBC431ABD0FEF004E778B /* Gb_Apu.cpp */, + 1A9FBC461ABD0FEF004E778B /* Gb_Oscs.cpp */, + 1A9FBC481ABD0FEF004E778B /* Multi_Buffer.cpp */, 1A9FBC3C1ABD0FEF004E778B /* blargg_common.h */, 1A9FBC3D1ABD0FEF004E778B /* blargg_config.h */, 1A9FBC3E1ABD0FEF004E778B /* blargg_source.h */, - 1A9FBC3F1ABD0FEF004E778B /* Blip_Buffer.cpp */, 1A9FBC401ABD0FEF004E778B /* Blip_Buffer.h */, - 1A9FBC411ABD0FEF004E778B /* Effects_Buffer.cpp */, 1A9FBC421ABD0FEF004E778B /* Effects_Buffer.h */, - 1A9FBC431ABD0FEF004E778B /* Gb_Apu.cpp */, 1A9FBC441ABD0FEF004E778B /* Gb_Apu.h */, - 1A9FBC451ABD0FEF004E778B /* Gb_Apu_State.cpp */, - 1A9FBC461ABD0FEF004E778B /* Gb_Oscs.cpp */, 1A9FBC471ABD0FEF004E778B /* Gb_Oscs.h */, - 1A9FBC481ABD0FEF004E778B /* Multi_Buffer.cpp */, 1A9FBC491ABD0FEF004E778B /* Multi_Buffer.h */, ); path = apu; @@ -247,17 +247,17 @@ 1A9FBC4B1ABD0FEF004E778B /* common */ = { isa = PBXGroup; children = ( - 1A9FBC4C1ABD0FEF004E778B /* Array.h */, + 1A9FBC4F1ABD0FEF004E778B /* memgzio.c */, 1A9FBC4D1ABD0FEF004E778B /* ffmpeg.cpp */, + 1A9FBC511ABD0FEF004E778B /* Patch.cpp */, + 1A9FBC561ABD0FEF004E778B /* SoundSDL.cpp */, + 1A9FBC4C1ABD0FEF004E778B /* Array.h */, 1A9FBC4E1ABD0FEF004E778B /* ffmpeg.h */, - 1A9FBC4F1ABD0FEF004E778B /* memgzio.c */, 1A9FBC501ABD0FEF004E778B /* memgzio.h */, - 1A9FBC511ABD0FEF004E778B /* Patch.cpp */, 1A9FBC521ABD0FEF004E778B /* Patch.h */, 1A9FBC531ABD0FEF004E778B /* Port.h */, 1A9FBC541ABD0FEF004E778B /* RingBuffer.h */, 1A9FBC551ABD0FEF004E778B /* SoundDriver.h */, - 1A9FBC561ABD0FEF004E778B /* SoundSDL.cpp */, 1A9FBC571ABD0FEF004E778B /* SoundSDL.h */, 1A9FBC581ABD0FEF004E778B /* Types.h */, ); @@ -268,37 +268,21 @@ isa = PBXGroup; children = ( 1A9FBC881ABD0FEF004E778B /* agbprint.cpp */, - 1A9FBC891ABD0FEF004E778B /* agbprint.h */, 1A9FBC8A1ABD0FEF004E778B /* armdis.cpp */, - 1A9FBC8B1ABD0FEF004E778B /* armdis.h */, 1A9FBC8C1ABD0FEF004E778B /* bios.cpp */, - 1A9FBC8D1ABD0FEF004E778B /* bios.h */, 1A9FBC8E1ABD0FEF004E778B /* Cheats.cpp */, - 1A9FBC8F1ABD0FEF004E778B /* Cheats.h */, 1A9FBC901ABD0FEF004E778B /* CheatSearch.cpp */, - 1A9FBC911ABD0FEF004E778B /* CheatSearch.h */, 1A9FBC921ABD0FEF004E778B /* EEprom.cpp */, - 1A9FBC931ABD0FEF004E778B /* EEprom.h */, 1A9FBC941ABD0FEF004E778B /* elf.cpp */, - 1A9FBC951ABD0FEF004E778B /* elf.h */, 1A9FBC961ABD0FEF004E778B /* Flash.cpp */, - 1A9FBC971ABD0FEF004E778B /* Flash.h */, 1A9FBC981ABD0FEF004E778B /* GBA-arm.cpp */, 1A9FBC991ABD0FEF004E778B /* GBA-thumb.cpp */, 1A9FBC9A1ABD0FEF004E778B /* GBA.cpp */, - 1A9FBC9B1ABD0FEF004E778B /* GBA.h */, - 1A9FBC9C1ABD0FEF004E778B /* GBAcpu.h */, 1A9FBC9D1ABD0FEF004E778B /* gbafilter.cpp */, - 1A9FBC9E1ABD0FEF004E778B /* gbafilter.h */, 1A9FBC9F1ABD0FEF004E778B /* GBAGfx.cpp */, - 1A9FBCA01ABD0FEF004E778B /* GBAGfx.h */, - 1A9FBCA11ABD0FEF004E778B /* GBAinline.h */, 1A9FBCA21ABD0FEF004E778B /* GBALink.cpp */, - 1A9FBCA31ABD0FEF004E778B /* GBALink.h */, 1A9FBCA41ABD0FEF004E778B /* GBASockClient.cpp */, - 1A9FBCA51ABD0FEF004E778B /* GBASockClient.h */, 1A9FBCA61ABD0FEF004E778B /* Globals.cpp */, - 1A9FBCA71ABD0FEF004E778B /* Globals.h */, 1A9FBCA81ABD0FEF004E778B /* Mode0.cpp */, 1A9FBCA91ABD0FEF004E778B /* Mode1.cpp */, 1A9FBCAA1ABD0FEF004E778B /* Mode2.cpp */, @@ -307,10 +291,26 @@ 1A9FBCAD1ABD0FEF004E778B /* Mode5.cpp */, 1A9FBCAE1ABD0FEF004E778B /* remote.cpp */, 1A9FBCAF1ABD0FEF004E778B /* RTC.cpp */, - 1A9FBCB01ABD0FEF004E778B /* RTC.h */, 1A9FBCB11ABD0FEF004E778B /* Sound.cpp */, - 1A9FBCB21ABD0FEF004E778B /* Sound.h */, 1A9FBCB31ABD0FEF004E778B /* Sram.cpp */, + 1A9FBC891ABD0FEF004E778B /* agbprint.h */, + 1A9FBC8B1ABD0FEF004E778B /* armdis.h */, + 1A9FBC8D1ABD0FEF004E778B /* bios.h */, + 1A9FBC8F1ABD0FEF004E778B /* Cheats.h */, + 1A9FBC911ABD0FEF004E778B /* CheatSearch.h */, + 1A9FBC931ABD0FEF004E778B /* EEprom.h */, + 1A9FBC951ABD0FEF004E778B /* elf.h */, + 1A9FBC971ABD0FEF004E778B /* Flash.h */, + 1A9FBC9B1ABD0FEF004E778B /* GBA.h */, + 1A9FBC9C1ABD0FEF004E778B /* GBAcpu.h */, + 1A9FBC9E1ABD0FEF004E778B /* gbafilter.h */, + 1A9FBCA01ABD0FEF004E778B /* GBAGfx.h */, + 1A9FBCA11ABD0FEF004E778B /* GBAinline.h */, + 1A9FBCA31ABD0FEF004E778B /* GBALink.h */, + 1A9FBCA51ABD0FEF004E778B /* GBASockClient.h */, + 1A9FBCA71ABD0FEF004E778B /* Globals.h */, + 1A9FBCB01ABD0FEF004E778B /* RTC.h */, + 1A9FBCB21ABD0FEF004E778B /* Sound.h */, 1A9FBCB41ABD0FEF004E778B /* Sram.h */, ); path = gba; diff --git a/Cores/VisualBoyAdvance-M/PVGBA/Core.plist b/Cores/VisualBoyAdvance-M/PVGBA/Core.plist index e742db12aa..d794679d8d 100644 --- a/Cores/VisualBoyAdvance-M/PVGBA/Core.plist +++ b/Cores/VisualBoyAdvance-M/PVGBA/Core.plist @@ -9,6 +9,8 @@ PVSupportedSystems com.provenance.gba + com.provenance.gb + com.provenance.gbc PVProjectName VisualBoyAdvance