Repository: Provenance-Emu/Provenance (language: cpp)

Issue:
VirtualBoy crashes at load
<!--- DISCLAIMERS ---------------------------------------------------------------

🛑 STOP! Before posting, make sure you…
✅ …have checked issues for existing bug reports.
✅ …are using the latest development build (may have already been fixed).
✅ …have discussed the issue on our Discord:     https://discord.gg/4TK7PU5

🚫 We DO NOT support unofficial 3rd-party installations (buildstore, iemulators, tweakbox, etc…). 
☠️ Delete and use official install:  https://git.io/vxABg

⚠️ BUG REPORTS ONLY! If you need help, use Discord. If suggesting a feature, use the request form. 
🚦 If you have read the above, please continue…
❌ Reports that do not use the template below will be closed and locked immediately.

----- BUG REPORT: Be clear, concise and thorough, beginning with a summary. --->

replaceWithSummaryOrDelete


<!--- What did you expect to happen? --------------------------------------------> 
### Expected: 

replaceWithExpectedResults


<!--- What happened instead? ---------------------------------------------------> 
### Actual: 

replaceWithActualResults


<!--- What are steps we can follow to reproduce this issue? ---------------------->
 ### Reproduce:  

1. replaceWithSteps
2. 
3. 


# 
#### NOTES  

replaceWithNotesOrDelete




#
<!--- ☑️ REQUIRED: Check the detail boxes after posting! ------------------------>











































































#### APP VERSION
- [ ] 1.5 *beta*
- [ ] 1.4

#### APP SOURCE
- [ ] Provenance-Emu GitHub  *&nbsp;(Official)*
- [ ] Other  *&nbsp;(Unofficial)*

#### INSTALLED BY 
- [ ] [Side-Loading](https://git.io/vpYzf)
- [ ] [Building](https://git.io/vpYzv) *from Source*

#### PLATFORM
- [ ] iPhone
- [ ] iPad
- [ ] Apple TV

#### iOS/tvOS VERSION
- [ ] 14.x
- [ ] 13.x
- [ ] 12.x
- [ ] 11.x
- [ ] 10.x

-------------------------------------------
<sup> 🚫 We **DO NOT** support unofficial builds installed from 3rd-party sites. ([Official Install](https://git.io/vxABg)) </sup><br><sup> ❓ **Need help or have a suggestion?** Join our [Official Discord](https://discord.gg/4TK7PU5) </sup><br>



Discussion / hints:

Fix patch:
diff --git a/Cores/Mednafen/MednafenGameCore.mm b/Cores/Mednafen/MednafenGameCore.mm
index 71f13d67aa..609c5a7d03 100644
--- a/Cores/Mednafen/MednafenGameCore.mm
+++ b/Cores/Mednafen/MednafenGameCore.mm
@@ -651,6 +651,11 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError**)error
         game->SetInput(0, "gamepad", (uint8_t *)inputBuffer[0]);
         game->SetInput(1, "gamepad", (uint8_t *)inputBuffer[1]);
     }
+    else if (self.systemType == MednaSystemVirtualBoy)
+    {
+        game->SetInput(0, "gamepad", (uint8_t *)inputBuffer[0]);
+        game->SetInput(1, "gamepad", (uint8_t *)inputBuffer[1]);
+    }
     else if (self.systemType == MednaSystemPSX)
     {
         for(unsigned i = 0; i < multiTapPlayerCount; i++) {
@@ -744,6 +749,7 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError**)error
     else
     {
         game->SetInput(0, "gamepad", (uint8_t *)inputBuffer[0]);
+        game->SetInput(0, "gamepad", (uint8_t *)inputBuffer[1]);
     }
 
     Mednafen::MDFNI_SetMedia(0, 2, 0, 0); // Disc selection API


Test patch: