Mik's Arcade Posted October 20, 2021 Share Posted October 20, 2021 Ok, I've hit a complete stop on my game due to a VERY odd bug. I wonder if I am hitting some sort of memory issue or something is going out of bounds causing this. But, I have no idea how I can test this issue since the Intybuild comes out clean with no errors or warning. Before I go trying to use the SDK debugger and figure this out, I will see if this sounds familiar to anyone. I have a very simple chunk of code for this GOUB called bonus_level bonus_level: PROCEDURE CLS WAIT PRINT AT 84 COLOR 7,"M" gosub hit_button ' this is here to test screen, will remove ' num_level = num_level + 1 num_boss = num_boss + 1 if num_level > 5 then num_level = 5 'if num_boss = 6 then goto final_boss num_ninja = enemies(num_level) END This code compiles and executes fine. Ok, so what I am complaining for then? If you notice the print statement, I am printing one letter, "M". I don't just want to print one letter. the code SHOULD be PRINT AT 84 COLOR 7,"MAGIC BONUS" However, when I build that, it compiles just fine, but when I run it, the screen just comes up in a purple color and does nothing. WTF? even PRINT AT 84 COLOR 7,"MA" causes this purple screen of death Has anyone ever seen such an odd error with print? I can call a GOSUB within a GOSUB, right? thanks in advance....I've been chugging along just fine with more complex code until this show stopper on what seems like simple code. I hope I am not hitting some IntyBasic limit on anything. I've only used 50 of 228 8-bit variables and 8 of 47 16-bit. Quote Link to comment Share on other sites More sharing options...
Mik's Arcade Posted October 20, 2021 Author Share Posted October 20, 2021 (edited) UPDATE: Yes, I must be hitting some limit. The thing I did today was add a new screen I created with IntyColor and I am trying to get it up and running. I merely commented out all of these DATA statements to test and the full print statement ran. So, what can I do? Is there a limit on the number of DATA and BITMAPS you can make? Bummer...I am getting so close too. Edited October 20, 2021 by Mik's Arcade Quote Link to comment Share on other sites More sharing options...
carlsson Posted October 20, 2021 Share Posted October 20, 2021 Check your CFG file. Enable generation of a list file and check it. Most likely you're running across a segment boundary you should not run over, and would need ASM ORG somwhere to direct the compiler to put rest of the code (or data) into a new segment. That is one of the shortcomings with IntyBASIC, that it doesn't automatically switch to a good segment, you need to keep track of this yourself. Quote Link to comment Share on other sites More sharing options...
Mik's Arcade Posted October 20, 2021 Author Share Posted October 20, 2021 11 minutes ago, carlsson said: Check your CFG file. Enable generation of a list file and check it. Most likely you're running across a segment boundary you should not run over, and would need ASM ORG somwhere to direct the compiler to put rest of the code (or data) into a new segment. That is one of the shortcomings with IntyBASIC, that it doesn't automatically switch to a good segment, you need to keep track of this yourself. Thank you, I am sure this do it. What's funny is that I've already gone through and cleaned up the code a bit as the lines of code are starting to add up I'm done for today but this will be my target for tomorrow. Quote Link to comment Share on other sites More sharing options...
+cmadruga Posted October 20, 2021 Share Posted October 20, 2021 Necro bumping much? Quote Link to comment Share on other sites More sharing options...
carlsson Posted October 20, 2021 Share Posted October 20, 2021 Rather posting in the wrong subforum. I don't know if any of our nice mods patrol these areas and can move topics one level up. Quote Link to comment Share on other sites More sharing options...
Mik's Arcade Posted October 20, 2021 Author Share Posted October 20, 2021 lol....why on earth did I put this topic here? LOL Quote Link to comment Share on other sites More sharing options...
Mik's Arcade Posted October 21, 2021 Author Share Posted October 21, 2021 (edited) Yes, this resolved the issue. I remember reading about ASM ORG $F000 in the appendix of Oscar's first book I didn't understand what it did.....until now. Now we can put this 2018 contest subforum back in the ground where it belongs to rest in peace....don't know how I put this here instead of the normal programming board. Once I finish the game, I am going to go back and try to optimize the code even more. I've been taking really redundant code and turning them into procedures I call with GOSUB. Edited October 21, 2021 by Mik's Arcade 1 Quote Link to comment Share on other sites More sharing options...
Kiwi Posted November 2, 2021 Share Posted November 2, 2021 On 10/21/2021 at 9:11 AM, Mik's Arcade said: I remember reading about ASM ORG $F000 in the appendix of Oscar's first book Yup, it's basically a stake in the ground where the data after this line is in ROM. You're creating a map for the Intellivision's CPU to read data from. Keep in mind, after $FFFF address is a big void of nothing. I would use ASM ORG $C100 to start and then it'll end at $FFFF, so it's a big contentious space. Good for graphic, and music data. Another area to use is ASM ORG $A000-$BFFF. After $C000-$C100, there's a probe that changes graphic mode when read. So avoid using that segment. Quote Link to comment Share on other sites More sharing options...
Mik's Arcade Posted November 2, 2021 Author Share Posted November 2, 2021 (edited) 53 minutes ago, Kiwi said: Yup, it's basically a stake in the ground where the data after this line is in ROM. You're creating a map for the Intellivision's CPU to read data from. Keep in mind, after $FFFF address is a big void of nothing. I would use ASM ORG $C100 to start and then it'll end at $FFFF, so it's a big contentious space. Good for graphic, and music data. Another area to use is ASM ORG $A000-$BFFF. After $C000-$C100, there's a probe that changes graphic mode when read. So avoid using that segment. thanks, these are the learning curves us newbies go through. On an interesting note, hitting this limit made me go back rethink the code I wrote, and I have since gone in and streamlined it a LOT. I found more clever ways to do things so I could recycle the same code for different purposes. I condensed 10 GOSUB procedures down to 3, and can use them to do even more than it was originally doing. At some point, I will take the ASM ORG line out and see if I still need it, but I'm sure I will..... Edited November 2, 2021 by Mik's Arcade 2 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.