Jump to content

Photo

Using overscan to store data?


36 replies to this topic

#26 Karl G ONLINE  

Karl G

    Moonsweeper

  • 466 posts

Posted Tue Jun 5, 2018 8:12 AM

I think my brain just melted at the concept of "fractions of bits".   :D



#27 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,976 posts

Posted Tue Jun 5, 2018 9:47 AM

I think you meant fractional byte variables, like nybbles and bits? 



#28 RevEng OFFLINE  

RevEng

    River Patroller

  • 4,934 posts
  • Bitnik
  • Location:bottom of the stack

Posted Tue Jun 5, 2018 9:54 AM

This reminds me of a technique I used on the NES. [...] I'm pretty sure I've explained it before.


http://www.biglist.c...5/msg00205.html

Nice :thumbsup:

[edit ...it was twenty years ago, today.]

#29 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 23,544 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Tue Jun 5, 2018 11:19 AM

I think my brain just melted at the concept of "fractions of bits".   :D

Most of today's programmer would have that problem with fractions of words already.

They wouldn't understand how you can fraction bytes and have no clue how to fraction bits. I suppose that would sound like fission to them.

Edited by Thomas Jentzsch, Tue Jun 5, 2018 11:21 AM.


#30 Keatah OFFLINE  

Keatah

    Missile Commander

  • 21,319 posts

Posted Tue Jun 5, 2018 11:40 AM

If we're desperate for memory, just ask the player to remember some values for us and input them later.

 

That's what the Keyboard Controllers are for.



#31 JeremiahK OFFLINE  

JeremiahK

    Chopper Commander

  • 187 posts
  • Location:Indiana, USA

Posted Tue Jun 5, 2018 2:10 PM

For fractional bits, do you load the value, subtract the offset for the sub-variable, and then perform a modulus to extract the actual value? In other words, you would split the 256 possible values into multiple groups of various sizes, and treat each group separately. Makes it take awhile to decide values, but saves precious RAM.

Edited by JeremiahK, Tue Jun 5, 2018 2:12 PM.


#32 Andrew Davie OFFLINE  

Andrew Davie

    Stargunner

  • 1,821 posts
  • Dr.Boo
  • Location:Tasmania

Posted Tue Jun 5, 2018 9:33 PM

For fractional bits, do you load the value, subtract the offset for the sub-variable, and then perform a modulus to extract the actual value? In other words, you would split the 256 possible values into multiple groups of various sizes, and treat each group separately. Makes it take awhile to decide values, but saves precious RAM.

 

Almost. Check out the biglist link in the post above.

Essentialy - consider the string of bits as a mixed-base number. Each digit has its own base.... could be base 21, or base 3.. whatever.

So,  [base4][base35][base3][base7]

That's a 4 digit mixed-base number, with each digit written in its own base. To extract the lowest significant digit we need the remainder when divided by the base of that digit. In this example, base 7.  That's effectively the original binary number MOD 7.  Or in another way, keep subtracting 7 from the original number until you can't anymore. What you are left with is the low digit, in this case [base7]. That's how to extract the lowest. To extract the next one up, you need to divide by the base of the lowest. Just like 102/10 --> 10 (in integer arithmetic) now puts the 2nd base-10 digit in the low position (i.e,. units), by dividing our original number by base7's base (ie: 7) we drop that base7 digit "off" the mixed-base number. We'd now be left with [base4][base35][base3] having dropped the [base7] off the end.  So now we use the same method to get the base3 number - that is, MOD 3 (or repeated subtractions of 3). What's left is the value stored in that 2nd grouping from the right (i.e., [base3]).  Similarly we'd do the same for the remaining [base35] digit and the [base4] digit.  In summary, think of a number as being entirely in the base of the least significant digit (and we're trying to extract the least significant digit). Perform an effective MOD of the base on the whole number, leaving just the digit.  Then, shift off that low-digit in the base we were dealing with by dividing by the base.



#33 JeremiahK OFFLINE  

JeremiahK

    Chopper Commander

  • 187 posts
  • Location:Indiana, USA

Posted Tue Jun 5, 2018 10:02 PM

Aha!  I remember reading that awhile back, but had forgotten it.

 

Did anyone else notice this in your final reply on that biglist link?

"And yes, in answer to the quesion... I DID need to use this technique on the C64. I distinctly remember the days when we had to use the screen space to hold code, and change the colours so that it would not be seen on the TV. Space was often really really really tight."

Deja vu, no?


Edited by JeremiahK, Tue Jun 5, 2018 10:06 PM.


#34 azure ONLINE  

azure

    Space Invader

  • 28 posts
  • Location:Seattle, WA

Posted Thu Jun 7, 2018 2:22 AM

If we're desperate for memory, just ask the player to remember some values for us and input them later.

 

The difficulty and black & white switches could be used for 3 bits of memory storage input by the player.



#35 cimmerian OFFLINE  

cimmerian

    Chopper Commander

  • 243 posts
  • Location:Vancouver Canada

Posted Sat Jun 9, 2018 10:57 PM

Hahah, if you're counting switches as memory you could count the joystick direction/buttons or other controller in port 2 as even more user controlled input memory storage! :-)

 

 

The difficulty and black & white switches could be used for 3 bits of memory storage input by the player.



#36 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,760 posts
  • Location:The land of Gorch

Posted Sun Jun 10, 2018 2:41 AM

True...both A and B ports can be reconfigured as the user wants.  8 bits in each one.  The stack pointer is another byte, and T1024T can be used as temporary storage of another byte if your program is quick about it.

 

None of it really matters, tho...since a cartridge can just include it's own Ram memory scheme - up to 2 kb without banking.  Go into coprocessor territory, and it becomes pretty much unlimited.



#37 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 23,544 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Sun Jun 10, 2018 3:01 AM

BTW: The guy who posted the shit at reddit has deleted all his posts. He is not even the man to stand the truth and that we was wrong.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users