kikipdph Posted July 11 Share Posted July 11 (edited) Sometimes it happens that a game works on the Stella emulator but not on the Atari console. Later, by moving the "call sub" from the upper section to a lower position towards "drawscreen," I solved that problem. Now I have the same problem again, but the "call sub" is close to "drawscreen." Essentially, does anyone know exactly what is causing the problem, so that I can understand what it is about? DPC+ Edited July 11 by kikipdph Quote Link to comment Share on other sites More sharing options...
kikipdph Posted July 12 Author Share Posted July 12 I added another "drawscreen" within the loop, which solved the problem, but I still haven't figured out why it was happening. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted July 13 Share Posted July 13 If you post the file of your source code, then one of us could possibly help figuring out what's going on. My first guess as a stab in the dark: a gosub without a return statement. 2 Quote Link to comment Share on other sites More sharing options...
kikipdph Posted July 14 Author Share Posted July 14 19 hours ago, Karl G said: If you post the file of your source code, then one of us could possibly help figuring out what's going on. My first guess as a stab in the dark: a gosub without a return statement. The game works on the emulator but not on the Atari. And this happens with the latest version of Batari BASIC. If you slightly move the "Call Sub" towards "drawscreen", the game works on the Atari too. Everything else is the same, no changes in the code, just the positions. I'm using "Return" and that's not the issue. Similarly, in one game, when I placed "goto" at the beginning of the loop, the game didn't work on the Atari. That "goto" was exiting the loop. When I moved it towards "drawscreen", the game worked. This didn't happen in the previous version of BB, and it's very strange. Here's an example where it doesn't work on the Atari. __Main_Loop ;*************************************************************** ; ; 88 rows that are 2 scanlines high. ; DF6FRACINC = 255 ; Background colors. DF4FRACINC = 255 ; Playfield colors. DF0FRACINC = 128 ; Column 0. DF1FRACINC = 128 ; Column 1. DF2FRACINC = 128 ; Column 2. DF3FRACINC = 128 ; Column 3. ;*************************************************************** ; ; Simple fix for the top two lines having the same color. ; asm lda DF6FRACDATA lda DF4FRACDATA end gosub __Pozadina_10 if n = 1 then goto iskok if joy0fire then n = 1 : goto skiptitle iskok if !joy0fire then n = 0 drawscreen goto __Main_Loop skiptitle Here's an example where it works. (two drawscreen) __Main_Loop ;*************************************************************** ; ; 88 rows that are 2 scanlines high. ; DF6FRACINC = 255 ; Background colors. DF4FRACINC = 255 ; Playfield colors. DF0FRACINC = 128 ; Column 0. DF1FRACINC = 128 ; Column 1. DF2FRACINC = 128 ; Column 2. DF3FRACINC = 128 ; Column 3. ;*************************************************************** ; ; Simple fix for the top two lines having the same color. ; asm lda DF6FRACDATA lda DF4FRACDATA end drawscreen gosub __Pozadina_10 if n = 1 then goto iskok if joy0fire then n = 1 : goto skiptitle iskok if !joy0fire then n = 0 drawscreen goto __Main_Loop Quote Link to comment Share on other sites More sharing options...
+Karl G Posted July 14 Share Posted July 14 The subroutine being called isn't included in the source. If you can, just attach your whole source file to the post, which makes things easier to troubleshoot. If you want to keep the source private, then I would be willing to have a look at it myself if you send it via private message. 1 Quote Link to comment Share on other sites More sharing options...
kikipdph Posted July 14 Author Share Posted July 14 (edited) 8 hours ago, Karl G said: The subroutine being called isn't included in the source. If you can, just attach your whole source file to the post, which makes things easier to troubleshoot. If you want to keep the source private, then I would be willing to have a look at it myself if you send it via private message. Let's say the sub that calls is empty. You won't find an error in the code. Put the same code in an older version of BB and it will work. A substance is some kind of structure or lack of memory on a real atari. The emulator shows no errors and game works. Just move the callsub position or add another drawscreen and it works on the atari. But I don't know why that is. It's my PC. Is it my way of structuring or something else? Edited July 15 by kikipdph Quote Link to comment Share on other sites More sharing options...
+Karl G Posted July 16 Share Posted July 16 On 7/14/2023 at 2:28 PM, kikipdph said: Let's say the sub that calls is empty. You won't find an error in the code. Put the same code in an older version of BB and it will work. A substance is some kind of structure or lack of memory on a real atari. The emulator shows no errors and game works. Just move the callsub position or add another drawscreen and it works on the atari. But I don't know why that is. It's my PC. Is it my way of structuring or something else? Without code to demonstrate the issue, then it's hard for me to identify the root cause of the issue. If you could produce a minimal example that shows a blank screen where it shouldn't (whether on the Atari or Stella) then that would be helpful. If not, try turning on developer settings on Stella, and try running the version that just shows the blank screen. The results may be different than when you use the player settings, and you might possibly get a useful message that could show the possible cause. 2 Quote Link to comment Share on other sites More sharing options...
kikipdph Posted July 17 Author Share Posted July 17 On 7/16/2023 at 4:04 AM, Karl G said: Without code to demonstrate the issue, then it's hard for me to identify the root cause of the issue. If you could produce a minimal example that shows a blank screen where it shouldn't (whether on the Atari or Stella) then that would be helpful. If not, try turning on developer settings on Stella, and try running the version that just shows the blank screen. The results may be different than when you use the player settings, and you might possibly get a useful message that could show the possible cause. Because I successfully fixed it, I don't have the exact code now when it didn't work on Atari. When it happens again, I will post the code. For now, I can only state that I fix it by adding another "drawscreen" or by moving "go sub" closer to "drawscreen" in the loop. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted July 17 Share Posted July 17 5 hours ago, kikipdph said: Because I successfully fixed it, I don't have the exact code now when it didn't work on Atari. When it happens again, I will post the code. For now, I can only state that I fix it by adding another "drawscreen" or by moving "go sub" closer to "drawscreen" in the loop. When I first started using BASIC languages, I didn't use SAVE AS. If I messed something up, I couldn't go back to a previous version of the program. I'd spend hours or days trying to figure out what I did wrong. I eventually got a little wiser and used SAVE AS before making any major changes to the code. https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#use_save_as 1 Quote Link to comment Share on other sites More sharing options...
KevKelley Posted July 18 Share Posted July 18 1 hour ago, Random Terrain said: When I first started using BASIC languages, I didn't use SAVE AS. If I messed something up, I couldn't go back to a previous version of the program. I'd spend hours or days trying to figure out what I did wrong. I eventually got a little wiser and used SAVE AS before making any major changes to the code. https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#use_save_as Same. I usually make a new save each day I start work. Could be minor or could be major. If I decide to make a big change after work in a certain day or I want to try a couple different methods I will then make a second save file with a letter and then each branch would maintain that letter designation until it becomes the main save I work off. 1 Quote Link to comment Share on other sites More sharing options...
kikipdph Posted July 18 Author Share Posted July 18 4 hours ago, Random Terrain said: When I first started using BASIC languages, I didn't use SAVE AS. If I messed something up, I couldn't go back to a previous version of the program. I'd spend hours or days trying to figure out what I did wrong. I eventually got a little wiser and used SAVE AS before making any major changes to the code. https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#use_save_as I copy the project and place it in another folder. That serves as my backup. But in this example, the game is finished and everything is working, so I didn't save when it wasn't working on the Atari. I thought someone might have had similar issues and knows the answer, so I posted this. Is it happening only to me, and logically I can't figure out what the problem is. I know how to "fix" it, but it's not really fixing because there are no actual errors in the code. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted July 18 Share Posted July 18 1 hour ago, kikipdph said: I copy the project and place it in another folder. That serves as my backup. I make a new folder for a new project, then SAVE AS my .bas file before making any significant changes. Some programs I've worked on have had a boatload of versions. Here's an example: That's just what would fit within a screenshot. It keeps going and going. 1 Quote Link to comment Share on other sites More sharing options...
KevKelley Posted July 18 Share Posted July 18 8 hours ago, kikipdph said: I copy the project and place it in another folder. That serves as my backup. But in this example, the game is finished and everything is working, so I didn't save when it wasn't working on the Atari. I thought someone might have had similar issues and knows the answer, so I posted this. Is it happening only to me, and logically I can't figure out what the problem is. I know how to "fix" it, but it's not really fixing because there are no actual errors in the code. I know I have had similar, though not exactly the same issues. Where everything seemed fine and worked good in emulation but it would give me issues on hardware and it would sometimes be something like I accidentally left a colon somewhere. Quote Link to comment Share on other sites More sharing options...
kikipdph Posted July 18 Author Share Posted July 18 1 hour ago, KevKelley said: I know I have had similar, though not exactly the same issues. Where everything seemed fine and worked good in emulation but it would give me issues on hardware and it would sometimes be something like I accidentally left a colon somewhere. I think those are some kind of Batari Basic bugs because I didn't have that problem in the older version. I've also encountered some other bugs that are inexplicable and illogical. 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.