Erik Zimmermann Posted February 4, 2022 Share Posted February 4, 2022 Hello, Today I have a compiler error that I don't understand. This is for my Weekend Project: - Car Racing - 10 Playfields with scrolling. - _change_room (street) will use bank 2 for more free space. what am I doing wrong? Who can me help me? Bye Erik ca1.bas Quote Link to comment https://forums.atariage.com/topic/330812-compiler-error-fastfetch-0000-r/ Share on other sites More sharing options...
+Random Terrain Posted February 4, 2022 Share Posted February 4, 2022 Take a look at the section called Bankswitching: https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#bankswitching If you're going to use "set romsize 16kSC" you need to have the correct number of banks. Also look at your dims. Only reuse variables if they're not going to interfere with each other. For example, you can use the same variable with different aliases in your title screen section, the main loop, and your game over section. But you can't use "dim room11_generator = f" and "dim p0_X = player0x.f" if those variable aliases are going to be used in the main loop. If you think of the variable f as a box and you put 10 kittens in it, then you put 2 owls in the box (thinking it's a different box), you're going to have a mess. If you're using Visual batari Basic, you can right click on the code and select Audit Variables. It will give you a compact list of all the variables used in the program (if you've used dim to create aliases). It also looks like batari Basic doesn't like playfield data shoved into if-thens. I got the code fixed up enough that it will compile: ca1_2022y_02m_04d_1509t.bas 1 Quote Link to comment https://forums.atariage.com/topic/330812-compiler-error-fastfetch-0000-r/#findComment-4998507 Share on other sites More sharing options...
+Karl G Posted February 4, 2022 Share Posted February 4, 2022 Hi - I gave it a try, and the actual error that was causing the issue was "branch out of range". You are defining playfields in the midst of an if/then statement, which usually works okay, but it doesn't in one case because the playfield is too big. TL;DR instead of this code: if current_room_number = 10 then playfield: You need something like this: if current_room_number <> 10 then goto _skip_room_10 ...and then put the _skip_room_10 label after the "end" of the playfield definition. Edit: Yeah; what RT said. Defining a playfield after a "then" sometimes works, but it's bad practice, and can sometimes cause problems like what you have seen Quote Link to comment https://forums.atariage.com/topic/330812-compiler-error-fastfetch-0000-r/#findComment-4998510 Share on other sites More sharing options...
Erik Zimmermann Posted February 5, 2022 Author Share Posted February 5, 2022 Many Thanks. You saved my weekend. Quote Link to comment https://forums.atariage.com/topic/330812-compiler-error-fastfetch-0000-r/#findComment-4998840 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.