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 > Need help setting VIC registers
2011-11-12 13:57
King Durin
Account closed

Registered: Oct 2007
Posts: 85
Need help setting VIC registers

I'm working on a project where I have music player and data that extends beyond $2000, so all of the examples for displaying a Koala file that load the file at that location don't work for me. I need to change the VIC to use bank 2 (8000 - BFFF), and I want to set screen ram to 8000-84ff and use the upper 8K for the bitmap.

My assembler code loads in the koala file at an arbitrary location and then copies the bitmap data to a000 and the screen to 8000 and the color to d800. Then it attempts to set the appropriate values to the registers to display the image. However, all I get is a blank screen (which I initialized first as part of my program), so I don't think my bank changes are taking effect.

	lda	$dd02
	ora	#$03
	sta	$dd02
		
	lda	$dd00		
	and	#%11111100
	ora	#%00000001
	sta	$dd00
			
	lda	#$3b	; bitmap mode
	ldx	#$d8	; multi-color mode
	ldy	#%00000100
	sta	$d011
	stx	$d016
	sty	$d018


If you see the problem, please thump me with the solution.

King Durin aka plbyrd
http://cbmcommand.codeplex.com
http://www.paytonbyrd.com
2011-11-12 14:28
terric
Account closed

Registered: Feb 2009
Posts: 47
Have a look at these links.
And i think you will figure it out.
http://codebase64.org/doku.php?id=base:vicii_memory_organizing
http://codebase64.org/doku.php?id=base:memmanage
Hint: In which bank are you when copying to the other location, is $01 set to $37 or what?

terric
2011-11-12 17:27
Frantic

Registered: Mar 2003
Posts: 1627
Why do you touch the data direction register (dd02?). Seems strange and totally irrelevant to what you are trying to do? Simply removing this may in fact take you some way closer to the solution. (perhaps even all the way)
2011-11-12 18:15
Zaz

Registered: Mar 2004
Posts: 33
One problem is wrong bitmap pointer ($d018 value).
Change to:
	ldy	#%00001000

it might work better.

The data direction part is the right thing to do, though in all reasonable scenarios they will already be set to output by the kernal.
The value of $01 doesn't matter; writes to $a000-$bfff will write to the RAM underneath even if the ROM is banked in.
2011-11-12 19:05
Cruzer

Registered: Dec 2001
Posts: 1048
Try changing some of the values and see what happens. Trial'n'error is the way to go.
2011-11-13 05:01
King Durin
Account closed

Registered: Oct 2007
Posts: 85
I got it working. My memory copy routine was inverting the high/low bytes of the addresses. Oops.

King Durin aka plbyrd
http://cbmcommand.codeplex.com
http://www.paytonbyrd.com
2011-11-13 12:26
Skate

Registered: Jul 2003
Posts: 490
you have probably copied many thing from/to the zeropage then :)
2011-11-14 05:22
King Durin
Account closed

Registered: Oct 2007
Posts: 85
:) Yes, zero page was being abused.
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
zscs
Frostbyte/Artline De..
Guests online: 92
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Graphicians
1 Sulevi  (10)
2 Mirage  (9.8)
3 Lobo  (9.7)
4 Mikael  (9.7)
5 Archmage  (9.7)

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