Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user eightbitswide ! (Registered 2024-12-24) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Video bank selection...
2005-06-01 10:43
Bizzmo
Account closed

Registered: Mar 2005
Posts: 82
Video bank selection...

I'm in the process of re-learning to code! After 15 years or so I'm more than a little rusty so please excuse any silly questions!

I'm planning a little game, which is currently using the following memory configuration. (At the moment all this is stuffed at $C000. I want to use a bank without a ROM image so I can have as much memory available for graphics.

Data is currently at these offsets:

+$0000 - Screen Buffer 1
+$0400 - Screen Buffer 2
+$0800 - Character Set
+$1000 - Sprites Definitions...

Is this going to cause me a problem? Trying to load data to $D000 causes WinVice to do strange things! ;-)

Any tips would be appreciated!

Bizz.
 
... 12 posts hidden. Click here to view all posts....
 
2005-06-02 03:48
Majikeyric

Registered: Sep 2002
Posts: 83
Quote: I've added that D018 Manager tool to CSDB
D018 Manager

R.
---
-= Silicon Ltd. =-
http://www.deco-design.com/scl


Thanks! Very useful !
2005-06-02 07:01
JackAsser

Registered: Jun 2002
Posts: 2014
For people having problem with the bits in $01 (like myself) I can strongly recommend C= Hacking, issue 7. (http://www.canberra.edu.au/~scott/C=Hacking/C-Hacking7.html) under topic "Hiding kilobytes". There is a nice matrix there which I use when I get unsure.

/JackAsser
2005-06-02 07:13
iopop

Registered: Dec 2001
Posts: 317
To calculate the value to put into $D018 I ususally use this formula:

lownibble = (char_mem-((3-gfx_bank)*$4000))/$0400
hignibble = (scr_mem-((3-gfx_bank)*$4000))/$0400

Where char_mem and scr_mem have to be at $0800 respectively $0400 boundaries and gfx_bank = {0 .. 3}.
2005-06-02 13:58
Stryyker

Registered: Dec 2001
Posts: 468
I experienced $01 issues with loading and saving. I was patient at the time with no carts to freeze or reset. I would use the standard ROM routines then make a drink :)

I would read a byte, SEI, $01=$34, write data to memory, $01=$37, continue until end of file.
2005-06-02 14:59
White Flame

Registered: Sep 2002
Posts: 136
Here's my $d018/$dd00 setup for use in cc65. Set CharBase and FontBase to their full addresses, and everything works out. Just make sure they're in the same 16k bank. :)

; Set char/font pointers
lda #((CharBase >> 6) & $f0) | ((FontBase >> 10) & $0e)
sta $d018

; Set VIC bank
lda # ((CharBase ^ $ffff) >> 14)
sta $dd00
2005-06-02 16:05
JackAsser

Registered: Jun 2002
Posts: 2014
Growing beards are we? =D
2005-06-02 17:06
White Flame

Registered: Sep 2002
Posts: 136
Actually, I've kept them trimmed to the same length for years now. :)=
2005-06-03 10:33
yago

Registered: May 2002
Posts: 333
My 0.02€ regarding VIC-Memorysettings:

#include <macros/graphics.inc>

vicbnk=$C000
SETVICBANK(vicbnk)
lda#SCREENFONT($C000-vicbnk,$C800-vicbnk)
sta vic.mem

where graphics.inc has:
#ifdef DLOAD
#begindef SETVICBANK(address)
lda #0
sta cia2
lda #($3f^((address/16384)^3))
sta cia2|2
#enddef
#else
#begindef SETVICBANK(address)
lda #(address/16384)^3
sta cia2
#enddef
#endif

and
#define SCREENFONT(screen,font) ((screen)/64)|((font)/1024)| %?

and vic.mem is $D018

--
If everything is worth money
money is worth nothing
2005-06-03 12:25
Frantic

Registered: Mar 2003
Posts: 1648
"lda #($3f^((address/16384)^3))"?

I have to ask: Do you actually think in decimal numbers when coding? ...or do you translate $4000 to 16384 when typing the code? :)

I hate it when people use decimal notation instead of hexadecimal ;) (no offence whatsoever, it's not YOU I hate, just this phenomenon.). I think I will never understand the reasons behind it.. I suspect it's ununderstandable in principle. ;)
2005-06-03 19:20
Oswald

Registered: Apr 2002
Posts: 5094
autoboy: if you started doing sprites, replacing charsets and stuff in basic, you would be also used to decimal notation :) took me years to learn all the addys in hex.

btw, bank, screen and cset selection is way too simple. I simply use

lda %xxxxxxxx
sta whatever

needs 5 seconds of thinking instead of overcomplicated adress translations.
Previous - 1 | 2 | 3 - Next
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
lotus_skylight
pottendo
Brush/Elysium
Flexman/VCC
Alakran_64
Avalanche/Atlantis
Hydrogen/Glance
Krill/Plush
ΛΛdZ
psych
Jammer
Guests online: 132
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
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 Censor Design  (9.3)
5 Triad  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

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