Can Screen or Char memory go into expansion memory ..

Basic and Machine Language

Moderator: Moderators

Post Reply
martin_f
Vic 20 Amateur
Posts: 46
Joined: Mon Jun 28, 2004 6:22 pm

Can Screen or Char memory go into expansion memory ..

Post by martin_f »

Currently working on a little proggy using bitmapped mode.

I have the screen memory set at $1200, and the char memory set at $1400. Using 20x12x16, the char mem finishes at $2080, which goes into expansion ram.

Everything works great in VICE, but tonight for the first time I loaded my proggy up on the real vic, and there are issues with the display. I am using top to bottom, then left to right for the characters, to get a bitmapped display. The last 4 columns are junk.

Having said that, 4 columns of 12x16, gives 768 bytes. Wheres $2080, is only 128 bytes into expansion memory, so I am thinking this is not the problem.

On a side note, I don't have a monitor cart whatsoever - In vice I just use vice's built in monitor. Anyone got a .prg (or .tap, or .d64) thats relocatable, or I could load and run from $4000 ? I have a 16k RAM cart plugged in, and my proggy ends before $4000.

Cheers

Martin
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Mmh, the VIC-I can only see 16 kBytes, normally from 0 to $3FFF.
But in our beloved VIC-20 it's split up into first 8k (0 to $1FFF) and first 8k in second memory half ($8000-$9FFF) to have a ROM-font.
So maybe the real machine get's confused about definitions beyond $1FFF...
tlr
Vic 20 Nerd
Posts: 571
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

Schlowski wrote:Mmh, the VIC-I can only see 16 kBytes, normally from 0 to $3FFF.
But in our beloved VIC-20 it's split up into first 8k (0 to $1FFF) and first 8k in second memory half ($8000-$9FFF) to have a ROM-font.
So maybe the real machine get's confused about definitions beyond $1FFF...
Yes, as far as I know expansion memory cannot be used for VIC-I visible data, atleast not above $1fff. I don't know about the low 3Kb expansions though (super expander).
Atleast some versions ago vice didn't properly implement this restriction.
martin_f
Vic 20 Amateur
Posts: 46
Joined: Mon Jun 28, 2004 6:22 pm

Post by martin_f »

That all makes sense, thanks guys .. time for a re-think !

Martin
martin_f
Vic 20 Amateur
Posts: 46
Joined: Mon Jun 28, 2004 6:22 pm

Post by martin_f »

Bwah I got my math wrong above aswell. $1400 + 20x12x16 = $2300.

$300 = 768 = 4 columns = bingo ... problem definately found.

Now to solve it.

Martin
User avatar
Mike
Herr VC
Posts: 4901
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

The VIC can only address RAM that's built into the machine.

That said, to implement 160x192 pixels, I let both screen memory and char memory start at $1000, thus I write $CC into $9005. The first usable character is 'P', and so the bitmap effectively starts at $1100.

We had another discussion about this in http://sleepingelephant.com/ipw-web/bul ... .php?t=653 regarding the character-layout.

Michael

(Edit: just to remind you. :) How's the family doing?)
Last edited by Mike on Tue Oct 11, 2005 6:46 am, edited 1 time in total.
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Ah, yes, expansion RAM...
I don't know if the VIC-I can use expansion RAM at all, if I remember correctly (is this a grammatically valid expression? :-) ) the VIC-1 can only use onboard memory.

Just thinking about this and suddenly realizing:
That's the reason why basic start moves with different memory expansions and you cannot use 3k and 8k/16k RAM expansions both for basic. Screen cannot start at $0400 or at the end of available memory above unexpanded RAM and basic must have one contigous area.

So with 3k expansion basic start has to go downto $0400 and screen remains at $1E00, with 8k+ expansion screen starts at $1000 and basic start moves to $1200. Both cannot be combined without dropping screen RAM out of unexpanded memory.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Yep, no expansion ram for the VIC chip. Unfortunately, VICE may not credit this limitation and fool people. If you piggy-back more RAM chips inside the VIC, you can overcome this limitation, but on the other hand get a VIC-20 that is different from the rest of the world. Some people have done this, persumably adding a switch to be able to boot it into unexpanded mode.

Some software fiddle the screen matrix into the low 1K, typically stack. It assumes 16 pixel height characters since you presumably can't fit more than 256 characters into there. It is how e.g. the VIC-Pic part of VIMMII does it, but also Pinball Wizard and many more.
Anders Carlsson

Image Image Image Image Image
martin_f
Vic 20 Amateur
Posts: 46
Joined: Mon Jun 28, 2004 6:22 pm

Post by martin_f »

All good stuff guys.

I have to say, what, this must be my first vic-20 programming of any kind in 20 years ! And my first machine code programming (well, anything worthwhile anyway) - its been an experience, I have and am learning so much.

I do seem to have vague memories of reading somewhere (don't think it was the prog reference guide) about the addressing restrictions of the VIC-1, which makes me wonder why I did what I did. Must have been another of *those* moments !

Mike, yeah I did have another look at that thread last night, but it didn't give much away about the best location of screen and char ram to achieve this configuration, unless I missed it (very likely, more often than not, I can have 3 people talking to me at the same time, whilst at home). However, thanks for the pointer in your response in this thread, that will assist me greatly.

And the family ... well, they sure are keeping me busy. VIC time now is limited to after 8 pm - every day (I also get vice going at lunchtime whilst at work, and sneak in 1/2 - 1 hour or so). But hey, at the end of the day I love them all, and wouldn't have it any other way. I need someone to give my VICs to when I die afterall (the 3 kids can have 2 each - although I don't think the 2 girls are too interested, my boy is though).

Cheers

Martin
User avatar
Mike
Herr VC
Posts: 4901
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Martin,

I had published an example program here in Denial, that utilises the 160x192 bitmap mode. It was hosted on my student's account, which now unfortunately is defunct. Until I get the time to set up a new web-site the program can't be accessed from here.

If you are interested, PM me your e-mail address, and I'll send it to you.

Michael
Post Reply