Jump to content
IGNORED

How to change background colors quickly with IntyBasic?


emerson

Recommended Posts

I have written some code which modifies data in the backtab to change the background color based on time of day. My goal is to edit background colors in software in order to eliminate a massive amount of data tables. The problem I am having is my code is just too slow. You can visibly see the color change as it's happening.

 

Could someone please look at my code and see how I can improve the speed?

 

bg_color_demo.bas

bg_color_demo.rom

Link to comment
Share on other sites

Wow that does work a lot better! Thank you nanochess! So was it the comparisons within nested loops that were slowing me down? When you say "unloaded code" do you mean unloading the cpu?

 

I haven't experimented with color stack mode yet. In my situation there are specific cards that need to keep their background color (player's head, sails, etc). If updating the stack value changes the background color for every card then I don't think it would work for my situation.

Link to comment
Share on other sites

I haven't experimented with color stack mode yet. In my situation there are specific cards that need to keep their background color (player's head, sails, etc). If updating the stack value changes the background color for every card then I don't think it would work for my situation.

Changing a value in the Color Stack only changes the color of those cards using that value. Now, to be clear, assigning Color Stack values to background cards, although straightforward, it's not as simple as in with FG/BG Mode, but it is versatile, and changing one value has the result of updating all cards using it immediately with no additional code or CPU cost.

 

It may not be appropriate for your project to switch modes since you have already started it; but it is definitely worth checking out Color Stack mode in the future. In my opinion, it is really misunderstood and can be very versatile and powerful. It's just weird and takes some effort to get used to it. ;)

 

dZ.

Link to comment
Share on other sites

Wow that does work a lot better! Thank you nanochess! So was it the comparisons within nested loops that were slowing me down? When you say "unloaded code" do you mean unloading the cpu?

 

I haven't experimented with color stack mode yet. In my situation there are specific cards that need to keep their background color (player's head, sails, etc). If updating the stack value changes the background color for every card then I don't think it would work for my situation.

Sorry, my bad English, I mean unload the CPU by moving code inside the IF because it's only used there.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...