Sprybug Posted March 31, 2021 Share Posted March 31, 2021 I have such a weird problem that was just boggled my mind. If anyone can help, that would be great. So, in Robot Zed, I have Genesis Controller support because it's a game that really needs 2 buttons to be able to play it without it being awkward. I've used the Genesis C Button, INPT1{7} in the past before on Princess Rescue and that worked just great. I basically did the same thing with Robot Zed, but this time it's acting like you are holding down the C button and never letting go. I ran a bunch of different test code to see if I can "unstuck" this, and nothing has worked. I even tried a little inline assembly! The funny thing is, the alternate shooting button if you don't have a Genesis controller is Joystick up, and that works perfectly fine. Note: Genesis_Controller is a defined bit (g{7}). Early in the code it detects a Genesis controller with if INPT1{7} then Genesis_Controller=1 else Genesis_Controller=0 Then when it gets to the part that deals checking the controls for shooting, I do this: if Genesis_Controller then GenButton if !joy0up then Zed_Shoot=0 : Shoot_Debounce=0 if joy0up && bally=Reset_Object && !Shoot_Debounce then gosub ZedFire bank6 goto EndControlCheck GenButton if INPT{7} then Zed_Shoot=0 : Shoot_Debounce=0 if !INPT{7} && bally=Reset_Object && !Shoot_Debounce then gosub ZedFire bank6 EndControlCheck Same code for up if you don't have a Gen controller as you do for C button if you do have a Gen controller. Up works great. C button acts like it's stuck. It'll shoot once, and that's it (while the zedshoot sprite stays). As a test, I changed the code to decrease sc0 on INPT{7} and increase on !INPT{7} Example: GenButton if INPT{7} then sc0=sc0-$01 if !INPT{7} then sc0=sc0+$01 sc0 only increases. Like if it's stuck. I'm not even pressing the C button. This is done through the Stella BTW, and yes it is detecting the Genesis controller automatically. James tried it on the real machine and the same thing happens. I even thought to bypass Batari completely and did a touch of inline to read directly from the INPT1 register. GenButton asm lda $001A sta $00EB end if x{7} then Zed_Shoot=0 : Shoot_Debounce=0 if !x{7} && bally=Reset_Object && !Shoot_Debounce then gosub ZedFire bank6 EndControlCheck $00EB of course being the variable x in the memory map. SAME RESULT. Now I thought, well maybe it's the version of Batari I'm compiling with. So I compiled my old Princess Rescue with it....AND IT WORKED FINE. I really don't know what else to do! Any help would be greatly appreciated! 1 Quote Link to comment Share on other sites More sharing options...
alex_79 Posted March 31, 2021 Share Posted March 31, 2021 I'm not familiar with batari Basic, but the symptoms you're describing (genesis C button always detected as pressed) happen if you have bit 7 of VBLANK set. That bit is used to discharge the paddle capacitors and while it's set, bit 7 of INPT0 to INPT3 will read as "0". 3 Quote Link to comment Share on other sites More sharing options...
Sprybug Posted March 31, 2021 Author Share Posted March 31, 2021 2 hours ago, alex_79 said: I'm not familiar with batari Basic, but the symptoms you're describing (genesis C button always detected as pressed) happen if you have bit 7 of VBLANK set. That bit is used to discharge the paddle capacitors and while it's set, bit 7 of INPT0 to INPT3 will read as "0". This is very interesting information. That site you linked is terrific BTW. Definitely favorited! This makes me wonder if one of my kernel options automatically sets that bit on, and if so, I wonder why. Time for some more experimenting! Now I know where to focus my debugging and lets see what happens when I change my kernel options. Something tells me to try turning off my background kernel option. If that's it, then it makes me wonder why batari sets that bit high when you have background colors enabled as it doesn't seem like you would need to have that bit set. I do need that option for what I am doing in this game, and I wonder if there would be a way to override what batari is doing and force that bit to stay low. 2 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted March 31, 2021 Share Posted March 31, 2021 I think bB needs some additional files tweaked for Genesis button support. have you tried pairing down the logic by making the changes outlined here and compiling RevEngs example? https://atariage.com/forums/topic/158596-2-button-games-in-bb-using-sega-genesis-pads-with-the-2600/ Maybe after that changing the example to use your kernel options and trying again. Just to see if it stops working as intended. Not trying to sound huffy muffy. Just thinking about what I'd do to figure it out 1 Quote Link to comment Share on other sites More sharing options...
Sprybug Posted April 1, 2021 Author Share Posted April 1, 2021 8 hours ago, Gemintronic said: I think bB needs some additional files tweaked for Genesis button support. have you tried pairing down the logic by making the changes outlined here and compiling RevEngs example? https://atariage.com/forums/topic/158596-2-button-games-in-bb-using-sega-genesis-pads-with-the-2600/ Maybe after that changing the example to use your kernel options and trying again. Just to see if it stops working as intended. Not trying to sound huffy muffy. Just thinking about what I'd do to figure it out Thank you Gemintronic, that did it! I looked at the thread you linked, and it seems I ran across it myself 7 years ago. XD You definitely help save this project of mine that's been going on for years! It's interesting that it works fine with Princess Rescue without the modification, but didn't with Robot Zed. Really weird. I'm making notes now for people who helped me along the way, so that everyone gets credit for it. I'm curious what the point of discharging the capacitors accomplishes and why it might be necessary for games that don't use INPT1. 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.