Jump to content
IGNORED

Superchip Variables Starting?


KevKelley

Recommended Posts

I had noticed that when using the Superchip variables, sometimes I would get funky behaviors if I don't immediately set them to zero at the beginning of my program as if they are already retaining a value.  

 

Is there a particular reason for this or am I missing something?

Link to comment
Share on other sites

6 hours ago, Gemintronic said:

I think that on real hardware memory can be dirty and have random values.   So, maybe that's Stella trying to be like a real 2600 at boot.

 

What I'd like to know is if there's a programmatic way to clear SuperChip memory.  Some for .. next loop.  Save some space.

At the start of any normal bB program, there is a bit of assembly that clears out all of the normal (non-SuperChip) RAM. For on-cart RAM like SuperChip, you may need to clear it yourself. Here's a for loop that can clear all SuperChip RAM at the start of a program:

 

    for temp5 = 0 to 127
        w000[temp5] = 0
    next

 

Edited by Karl G
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

4 minutes ago, Karl G said:

At the start of any normal bB program, there is a bit of assembly that clears out all of the normal (non-SuperChip) RAM. For on-cart RAM like SuperChip, you may need to clear it yourself. Here's a for loop that can clear all SuperChip RAM at the start of a program:

 


    for temp5 = 0 to 127
        w000[temp5] = 0
    next

 

Thanks! I had noticed that sometimes I would hit the reset switch and it was throwing me a bit. I was using super chip ram for counters for various things like movement or sound and I thought it strange that things seemed to stick or when I turn it on a sound would play when it shouldn't. I figured there was a good reason.

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