Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Combining a charset and bitmap in VIC Bank 0?
2010-12-31 04:27
Schema

Registered: May 2005
Posts: 15
Combining a charset and bitmap in VIC Bank 0?

Newbieish question here. I'm prefixing a little intro and bitmap before a game, and am unsure where to put everything in memory.

I'd prefer to keep it all in VIC Bank 0, as the game code neatly fits in $4000 onwards. Likewise, if I change VIC banks, then screen memory also moves, but that's where the game code is so writing to it would be bad ;-)

The problem is: I have to put the bitmap between $2000 and $4000, as the VIC sees the default character ROM from $1000-$2000.

So where can I put my custom charset? I'd have the same problem of the VIC seeing the default ROM instead if I put it at $1000 or $1800. $0800 is the intro code, and $0000 is zero page etc.

Surely this has been solved before, but I can't figure out a way to do it. Browsed many threads here, and read the c64codebase articles.

Can this be done?

2010-12-31 08:22
enthusi

Registered: May 2004
Posts: 677
Usually bank 0 is not used for that very reason ;-)
Why do you need charset AND bitmap anyway?
I mean what do you want to display?
Ifyou have i.e. some logo gfx in charmode you can set up the screen at 0400 (as is) and the charset above 2000.
Or use 0000-0800 non the less but only define and use areas that wont hurt. So if charset is at $0000, dont write/use first, second char ($00,$01) etc...
If it's just for an intro, I'd use bank 3 instead and move your code up again afterwards (if it leaks into $c000....)
2010-12-31 08:54
Marauder/GSS
Account closed

Registered: Jul 2006
Posts: 224
Can't you move your intro-code to $1000 and use the charset at $0800 then?
2010-12-31 09:08
tlr

Registered: Sep 2003
Posts: 1790
Also note that commonly not all of a charset is needed. If you only use uppercase letters ~$200 bytes is usually enough.
2011-01-01 14:13
Martin Piper

Registered: Nov 2007
Posts: 722
You could also put the charset into the bitmap and blank out that portion of the bitmap on the screen. Or use that part of the screen to display a different bank, or the same bank with charset etc.

Or compress the data and uncompress into the place where you need it on demand.
2011-01-04 21:01
Schema

Registered: May 2005
Posts: 15
Thanks for all the suggestions. I am only using lower-case, non-reversed chars (it's the world's most boring/minimalist intro screen).

So I ended up putting half the charset at $0C00, and just adc #$80 to all the characters ;-) Works fine.
2011-01-04 21:58
Stryyker

Registered: Dec 2001
Posts: 468
You could run the text through something so it is stored ORA #$80 already. BTW, why ADC instead of ORA?
2011-01-04 22:00
Schema

Registered: May 2005
Posts: 15
True, it was just a quick code change to see that it worked, and I just left it. ORA would be more suitable, you're right.
2011-01-05 03:36
The Phantom

Registered: Jan 2004
Posts: 360
You can use $800-$fff and then do a lda #$12, sta $d018

I often avoid using this area though, it sometimes get's over-written because I'm a very sloppy coder ;)

I typically use:

$0800-$0fff - Sinus/Data/Charset/Sprites
$1000-$1fff - music
$2000-$4711 - multicolor bitmap+screen+colors
$4718-$47ff - scroll text (if small text is required)
$4800-$???? - code

Most of the time I use $0800-$0fff for a cset if using bitmapped graphics and often I use $4800-$4fff for scroll memory. Most of my code starts at $5000, anybody can tell you that...
2011-01-05 10:24
Skate

Registered: Jul 2003
Posts: 494
you don't have to use bank 0. you can change the order. placing first game datas then intro code+datas in the memory is a better solution i guess.

disable basic and kernal roms, use Bank 2-3 area (something like $b000-$ffff should be enough for your intro) and reserve rest of the memory for the packed game datas. pack everything (packed game datas + intro) with pucrunch.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
kbs/Pht/Lxt
DJ Gruby/TRiAD
The Syndrom/TIA/Pret..
leonofsgr/Singular C..
Guests online: 76
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.045 sec.