+Al_Nafuur Posted May 17, 2021 Share Posted May 17, 2021 which ROMs have you tested so far? Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted May 17, 2021 Share Posted May 17, 2021 (edited) After rebooting the problem was gone. But whenever I play Combat, it returns. Weird. I tested the NTSC version of Combat and also an Air Sea Battle (Alien Battle) hack. And both seem to trigger the bug. Both have PAL color loss (odd scanline count), maybe that plays a role? Or maybe some special coding of the old games? Combat - Tank-Plus (Tank) (1977) (Atari, Joe Decuir, Larry Kaplan, Steve Mayer, Larry Wagner - Sears) (CX2601 - 99801, 6-99801, 49-75101, 49-75124) ~.bin Edited May 17, 2021 by Thomas Jentzsch Link to comment Share on other sites More sharing options...
alex_79 Posted May 17, 2021 Share Posted May 17, 2021 (edited) 6 hours ago, Thomas Jentzsch said: I tested the NTSC version of Combat and also an Air Sea Battle (Alien Battle) hack. And both seem to trigger the bug I think the problem might be that both games, in addition to reading the switches, perform several writes to SWCHB (because they have some unused bits set as output and use them as extra ram), and the value written has bit d0=0, according to the Stella debugger. To the Pluscart, this appears identical to a read from SWCHB with the RESET switch pressed, as it cannot differentiate a read operation from a write one. In both cases it sees SWCHB on the address bus followed by a value with bit d0=0 on the data bus, and there's no way to know if the latter comes from the RIOT (read) or the CPU (write). Edited May 17, 2021 by alex_79 1 Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted May 17, 2021 Share Posted May 17, 2021 Very good analysis. I suppose that kills the current exiting logic. Any idea for a better solution? Link to comment Share on other sites More sharing options...
alex_79 Posted May 17, 2021 Share Posted May 17, 2021 Nope, I can't think of any. Link to comment Share on other sites More sharing options...
+Al_Nafuur Posted May 18, 2021 Share Posted May 18, 2021 15 hours ago, Thomas Jentzsch said: Very good analysis. I suppose that kills the current exiting logic. Any idea for a better solution? 15 hours ago, alex_79 said: Nope, I can't think of any. me too, but maybe we just wait what @batari comes up with for the Harmony Cart: Link to comment Share on other sites More sharing options...
Bomberman94 Posted May 18, 2021 Share Posted May 18, 2021 Is it possible to make „the method of emulation exit“ selectable in the PlusCard configuration menue? I mean the actual method works (for some/most of the programs) but is not easy to execute. If we had an option to select the method everyone can test it by themselves. … just an idea ?♂️ 1 Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted May 18, 2021 Share Posted May 18, 2021 Maybe we should build a database which contains ROMs which do not well with the exit code. Link to comment Share on other sites More sharing options...
alex_79 Posted May 18, 2021 Share Posted May 18, 2021 (edited) What about this: As soon as there's an access to SWACNT or SWBCNT (and mirrors), then disable the emulation exit for the current game. This takes care of games that use the ports as outputs: you wouldn't be able to use the exit functions for those, but that's still better than unexpected exit. There's still the problem of controllers (e.g. trackballs) that can leave one input constantly low, but that could be solved by using a combination that only involves the console switches, like the previously proposed "long RESET press while SELECT is NOT pressed". In this case you don't even need to check SWACNT anymore. Edited May 18, 2021 by alex_79 1 Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted May 18, 2021 Share Posted May 18, 2021 (edited) The PlusCart cannot track the state of SWBCNT because it is a write operation, right? BTW: The SaveKey and AtariVox write to SWCHA too. But usually they only use the right port. Edited May 18, 2021 by Thomas Jentzsch Link to comment Share on other sites More sharing options...
alex_79 Posted May 18, 2021 Share Posted May 18, 2021 It can see an access, while it cannot know if it's a write or read operation. Anyway there shouldn't be any reason for a game to access SWACNT / SWBCNT unless it's using the ports as output. Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted May 18, 2021 Share Posted May 18, 2021 (edited) That's not correct. Quite a lot of games simply write 0 to SWBCNT (e.g. Beat 'Em & Eat 'Em, Buck Rogers, Bump 'n Jump...). Could we get the bits set by assuming that the load operation happened directly before the write? lda/x/y #?? sta/x/y SWBCNT Edited May 18, 2021 by Thomas Jentzsch Link to comment Share on other sites More sharing options...
alex_79 Posted May 18, 2021 Share Posted May 18, 2021 (edited) 1 hour ago, Thomas Jentzsch said: That's not correct. Quite a lot of games simply write 0 to SWBCNT (e.g. Beat 'Em & Eat 'Em, Buck Rogers, Bump 'n Jump...). Good point, I assumed that only games that need to set it as output did that. Quote Could we get the bits set by assuming that the load operation happened directly before the write? Actually, I think there's no need for that: you can read back SWACNT/SWBCNT, so it doesn't really matter to know if it's a write or read operation: the data bus will in any case have the SWBCNT value. So, on any access to SWBCNT, just check the data bus, and if it's not 0 then disable the emulation exit function. Edited May 18, 2021 by alex_79 1 Link to comment Share on other sites More sharing options...
+MrZarniwoop Posted May 20, 2021 Share Posted May 20, 2021 For what it's worth, Tim Worthington's 2600RGB allows for an extra button on the joystick that allows for remote SELECT/RESET. The extra button is implemented as a simultaneous left+right at the same time, in combination with the joystick being pressed up or down: Quote How to use The extra button mounted on the joystick can activate three functions. Extra + Up = Select Extra + Down = Reset Extra + Fire = Palette switch. When using PlusCart games, usually trying to use the extra button results in exiting the ROM and back to the PlusCart menu. Link to comment Share on other sites More sharing options...
alex_79 Posted May 20, 2021 Share Posted May 20, 2021 The extra button functionality is known to cause incompatibilities with some controllers (for example with trackballs), and/or some specific games. https://atariage.com/forums/topic/243453-atari-2600-trak-ball-games/?do=findComment&comment=4268750 https://atariage.com/forums/topic/317432-2600-jr-strange-joystick-behaviour-help-needed/ The Extra + Down combination would almost always exit emulation on the PlusCart, as it triggers Right + Reset. 1 Link to comment Share on other sites More sharing options...
Omegamatrix Posted May 24, 2021 Share Posted May 24, 2021 While testing the new HSC roms for Solar Fox I triggered early exit often. What I think is happening is that when I lost my last life I was traveling to the right, and a second or two later I hit reset. I also had this problem with early exit while playing Berzerk a long time ago. Link to comment Share on other sites More sharing options...
+Al_Nafuur Posted May 24, 2021 Share Posted May 24, 2021 1 hour ago, Omegamatrix said: While testing the new HSC roms for Solar Fox I triggered early exit often. What I think is happening is that when I lost my last life I was traveling to the right, and a second or two later I hit reset. I also had this problem with early exit while playing Berzerk a long time ago. Yes I had this effect too. If SWCHA is not read by the kernel (Game Over or Titlescreen) after the game, the last value read for SWCHA is the "active" value for the exit function. A fix is to add a "LDA SWCHA" in the Titlescreen/Game Over loop. Link to comment Share on other sites More sharing options...
Omegamatrix Posted May 26, 2021 Share Posted May 26, 2021 I had 3 bytes free before doing VSYNC, so I inserted a LDA SWCHA. Hopefully everything is good now. Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted May 26, 2021 Share Posted May 26, 2021 On 5/18/2021 at 8:26 PM, alex_79 said: Actually, I think there's no need for that: you can read back SWACNT/SWBCNT, so it doesn't really matter to know if it's a write or read operation: the data bus will in any case have the SWBCNT value. So, on any access to SWBCNT, just check the data bus, and if it's not 0 then disable the emulation exit function. @Al_Nafuur Are you going to fix the bug based on this information? Link to comment Share on other sites More sharing options...
+Al_Nafuur Posted May 26, 2021 Share Posted May 26, 2021 1 hour ago, Thomas Jentzsch said: @Al_Nafuur Are you going to fix the bug based on this information? I think this will not "fix" the bug this will only deactivate the exit function for unintentional and intentional exits. Furthermore this will only "fix" it for the few games that are using the free SWCHB bits for extra storage. Most of the unintended exits happen when the games don't query both SWCHx in their different loops (Game, title screen or game-over loop). Then the status stored for the not queried SWCHx in our flags is no longer updated. Therefore I tend more to a solution like this one: On 5/18/2021 at 4:47 PM, Bomberman94 said: Is it possible to make „the method of emulation exit“ selectable in the PlusCard configuration menue? I mean the actual method works (for some/most of the programs) but is not easy to execute. If we had an option to select the method everyone can test it by themselves. … just an idea ?♂️ Or maybe I can implement a simple 6502 cycle counter that resets our SWCHx states when the counter overflows (e.g. a 16 bit counter would reset the flags after ~ 55 ms ) Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted May 26, 2021 Share Posted May 26, 2021 21 minutes ago, Al_Nafuur said: I think this will not "fix" the bug this will only deactivate the exit function for unintentional and intentional exits. Furthermore this will only "fix" it for the few games that are using the free SWCHB bits for extra storage. IMO that's a valid bug fix for the games in question. It is not meant to fix all problems. 21 minutes ago, Al_Nafuur said: Most of the unintended exits happen when the games don't query both SWCHx in their different loops (Game, title screen or game-over loop). Then the status stored for the not queried SWCHx in our flags is no longer updated. That's a different problem which seems independent from the problem of games writing to SWCHx. Link to comment Share on other sites More sharing options...
+Al_Nafuur Posted May 27, 2021 Share Posted May 27, 2021 On 5/26/2021 at 11:15 AM, Thomas Jentzsch said: IMO that's a valid bug fix for the games in question. It is not meant to fix all problems. No matter how we would call it, these kind of exceptions will cost a lot of precious MCU cycles during the emulation of every ROM and it will only solve the issue with a handful of games. That's why I would prefer a more generic solution (like a user setting to disable the exit function). Link to comment Share on other sites More sharing options...
Fierodoug5 Posted May 28, 2021 Share Posted May 28, 2021 A user setting to disable exit function would be great. When I was playing Alfred Challenge for the 2600 game by game Podcast last week, the game would exit to the PlusCart menu when I pressed reset(not holding the joystick to right). Also someone I gave a UnoCart(PlusCart hardware) to has complained about various games that exit on him. 1 Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted September 28, 2021 Share Posted September 28, 2021 Where are we here? I would like to be at least able to disable the exit functionality if it breaks a game. Link to comment Share on other sites More sharing options...
Bomberman94 Posted November 22, 2021 Share Posted November 22, 2021 Why not list 2 or 3 possible exit functionalities in the settings? First one could be the well known we use today and the others ones can be tested by the users - feedback what or how many games could be listed here ? Link to comment Share on other sites More sharing options...
Recommended Posts