| |
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 |
|
| |
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 |
| |
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) |
| |
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.
|
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Try changing some of the values and see what happens. Trial'n'error is the way to go. |
| |
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 |
| |
Skate
Registered: Jul 2003 Posts: 490 |
you have probably copied many thing from/to the zeropage then :) |
| |
King Durin Account closed
Registered: Oct 2007 Posts: 85 |
:) Yes, zero page was being abused. |