Jump to content
Random Terrain

Bankswitching, if-then length, and pfpixel/pfhline/pfvline

Recommended Posts

I've been trying to stay within 4k, but my bloated code demands more, so I started playing around with bankswitching. I found out that an if-then can have more pfpixel/pfhline/pfvline code on the same line when using 4k. Once you move up to bankswitching, you're suddenly limited to 4 pfpixels after an if-then and only 3 pfhlines or pfvlines after an if-then. I was using up to 6 pfhlines after an if-then in 4k, but now I'll have to use the ENDIF solution to make the code work with bankswitching or just use 2 if-then statements.

 

Does anyone know if there are any other little surprises when moving up to bankswitching?

Edited by Random Terrain

Share this post


Link to post
Share on other sites

Found a little surprise related to bankswitching. I added set smartbranching on and did a quick replace all that changed every 'then goto' to 'then', but that caused an error. It seems if you jump from one bank to another, you need the goto.

Share this post


Link to post
Share on other sites
Found a little surprise related to bankswitching. I added set smartbranching on and did a quick replace all that changed every 'then goto' to 'then', but that caused an error. It seems if you jump from one bank to another, you need the goto.

Yes, that's correct, because there's no way to simply branch to code in another bank-- and you also need to tell it which bank you're going to. You could think of it as not just "too far away" or "not in this neighborhood," but as "not even on this planet"! ;)

 

Michael

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...