KevKelley Posted April 29, 2022 Share Posted April 29, 2022 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? Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted April 29, 2022 Share Posted April 29, 2022 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. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted April 30, 2022 Share Posted April 30, 2022 (edited) 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 April 30, 2022 by Karl G 1 1 Quote Link to comment Share on other sites More sharing options...
KevKelley Posted April 30, 2022 Author Share Posted April 30, 2022 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. 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.