[cc65] Koala Bitmap load

From: Carlos <shangri-la1teleline.es>
Date: 2009-02-04 14:03:33
Hi,

This is my first message in the list, i'm also a newbie about c64 graphics programming and c64 programming with cc65 in general.

After do some sprite stuff with cc65, now i'm trying to show a bitmap. I have a Koala paint picture that's ok (i have viewed it with an image viewer) and i want to use it in my program.

To display it i have done the next steps:

define in my data.s the next code: 

.export _img_data 

.segment "DATA" 

_img_data: 
    .incbin "ninja3.koa" 

and my main program looks like: 

extern unsigned char img_data[10000]; 

// set bitmap mode 
VIC.ctrl1 = 0x3b; 

// set multicolor mode 
VIC.ctrl2 = 0x18; 

// set addresses (screen and bitmap) 
VIC.addr = 0x18; 

// copy bitmap, screen, and color 
memcpy(0x2000, img_data, 8000); 
memcpy(0x0400, img_data + 8000, 1000); 
memcpy(0xd800, img_data + 9000, 1000); 

But the result is a bit weird (http://xs436.xs.to/xs436/09062/ln3118.png) and is not exactly the Last Ninja 3 intro picture that's supposed to be  




----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
icon_confused.gif
Received on Wed Feb 4 14:03:34 2009

This archive was generated by hypermail 2.1.8 : 2009-02-04 14:03:35 CET