Color High Nibbles
Moderator: Moderators
-
- Vic 20 Hobbyist
- Posts: 143
- Joined: Thu Aug 25, 2011 10:04 am
Color High Nibbles
Hi,
Do the high nibbles of the color area (38400-... on unexpanded vic) have any use?
Do the high nibbles of the color area (38400-... on unexpanded vic) have any use?
Phil Ranger
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-
- The Most Noble Order of Denial
- Posts: 343
- Joined: Fri May 01, 2009 4:44 pm
-
- Vic 20 Hobbyist
- Posts: 143
- Joined: Thu Aug 25, 2011 10:04 am
Free memory! A bit complex to get to, but still free memory: 256 bytes + the 6 last ones as the color memory (like the screen memory) uses only 506 of the 512 addresses. Or am I missing something?
Phil Ranger
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-
- The Most Noble Order of Denial
- Posts: 343
- Joined: Fri May 01, 2009 4:44 pm
-
- Vic 20 Afficionado
- Posts: 352
- Joined: Tue Apr 14, 2009 8:15 am
- Website: http://wimbasic.webs.com
- Location: Netherlands
- Occupation: farmer
- Mike
- Herr VC
- Posts: 4901
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
If you need a little more memory there, here's a simple method to expand the colour RAM.PhilRanger wrote:Free memory! A bit complex to get to, but still free memory: [...]
![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
-
- Omega Star Commander
- Posts: 1371
- Joined: Thu Jan 31, 2008 2:12 pm
- Website: https://robert.hurst-ri.us
- Location: Providence, RI
- Occupation: Tech & Innovation
You are evil, sir.Mike wrote:If you need a little more memory there, here's a simple method to expand the colour RAM.
![Twisted Evil :twisted:](./images/smilies/icon_twisted.gif)
But there's no denying those are very impressive results.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
https://robert.hurst-ri.us/rob/retrocomputing
-
- Vic 20 Hobbyist
- Posts: 143
- Joined: Thu Aug 25, 2011 10:04 am
Sorry, siliconed girls and modded computers aren't my cup of tea!
Phil Ranger
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
- Mike
- Herr VC
- Posts: 4901
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Thorough hardware knowledge surely isn't necessary, but at least a bit of it can help to understand why things work as is on the VIC-20:PhilRanger wrote:Sorry, siliconed girls and modded computers aren't my cup of tea!
- The colour RAM is actually 1024 4-bit nibbles in size, and ranges from 37888 ($9400) to 38911 ($97FF). That is, how the 6502 main CPU "sees" the colour RAM.
- During the half-cycle while VIC access the memory, the colour RAM is separated from the normal RAM. Instead there are extra 4 data lines going into the VIC chip, so character data and colour data are read simultaneously over a 12-bit bus. The colour RAM shares the 10 lower address lines with the screen RAM.
- For this reason, the colour RAM also shifts around, when the screen is relocated to 4096 with 8K RAM expansion, or more: 7680 (screen start with unexpanded or +3K) leaves a remainder of 512 when divided by 1024 -> 37888 + 512 = 38400 (=colour RAM start address); 4096 (screen start address with +8K or more) is divisible by 1024 -> colour RAM start address = 37888.
- The VIC chip can change the screen geometry to display more than 506 characters, for example 32 rows with 26 columns. This would need 832 nibbles in the colour RAM, but of course there are still 192 nibbles, amounting to 96 bytes left.
![Razz :P](./images/smilies/icon_razz.gif)
- If I have to choose between normal RAM in an expansion cartridge, and colour RAM to store data, I'd nearly always take the former. Unless the data is already 4-bits wide, as Wim already noted: for example in MAXIGRAFIK, the "unused" half of colour RAM is used as mirror copy of the colour RAM data in hires mode.
Yes, your idea is an decidedly old hat.
-
- Vic 20 Hobbyist
- Posts: 143
- Joined: Thu Aug 25, 2011 10:04 am
I like it. I wish my wife would talk like that to me once in a while!Mike wrote:Thorough hardware knowledge surely isn't necessary, but at least a bit of it can help to understand why things work as is on the VIC-20:
Do you mean there is no RAM chip for the high nibble so it's not useable?Mike wrote:- The colour RAM is actually 1024 4-bit nibbles in size, and ranges from 37888 ($9400) to 38911 ($97FF). That is, how the 6502 main CPU "sees" the colour RAM.
Got it.Mike wrote:- During the half-cycle while VIC access the memory, the colour RAM is separated from the normal RAM. Instead there are extra 4 data lines going into the VIC chip, so character data and colour data are read simultaneously over a 12-bit bus. The colour RAM shares the 10 lower address lines with the screen RAM.
- For this reason, the colour RAM also shifts around, when the screen is relocated to 4096 with 8K RAM expansion, or more: 7680 (screen start with unexpanded or +3K) leaves a remainder of 512 when divided by 1024 -> 37888 + 512 = 38400 (=colour RAM start address); 4096 (screen start address with +8K or more) is divisible by 1024 -> colour RAM start address = 37888.
So half of the color ram is always unused in normal resolution? (unless you use 2 screens and switch between them)Mike wrote:- The VIC chip can change the screen geometry to display more than 506 characters, for example 32 rows with 26 columns. This would need 832 nibbles in the colour RAM, but of course there are still 192 nibbles, amounting to 96 bytes left.
But if you don't have enough memory you could use some (I guess 512 + 6 nibbles, taking for granted this RAM is nibbles, not bytes?) Many variables could fit in 4 bits: level, number of ennemys, etc.Mike wrote:- If I have to choose between normal RAM in an expansion cartridge, and colour RAM to store data, I'd nearly always take the former. Unless the data is already 4-bits wide, as Wim already noted: for example in MAXIGRAFIK, the "unused" half of colour RAM is used as mirror copy of the colour RAM data in hires mode.
Meaning other people used it before me? Sorry, my English isn't perfect for idiomatic experssions!Mike wrote:Yes, your idea is an decidedly old hat.
Phil Ranger
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
- Mike
- Herr VC
- Posts: 4901
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Exactly.PhilRanger wrote:Do you mean there is no RAM chip for the high nibble so it's not useable?
Yes, you can use the colour RAM this way. Writes proceed as normal, but when read back, the high nibble just reflects random 'bus noise' *), and needs to be masked out with 'AND #%00001111' or the like.So half of the color ram is always unused in normal resolution? (unless you use 2 screens and switch between them) [...] But if you don't have enough memory you could use some (I guess 512 + 6 nibbles, taking for granted this RAM is nibbles, not bytes?) Many variables could fit in 4 bits: level, number of enemys, etc.
Taking the unused colour RAM for storage has indeed been explicitly mentioned before in Denial. Wim's maze example and the mirror copy in MAXIGRAFIK are just two of the more recent uses.other people used it before me?
Michael
-
- Vic 20 Hobbyist
- Posts: 143
- Joined: Thu Aug 25, 2011 10:04 am
Thanks Mike! ![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Phil Ranger
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg