Re: [cc65] Creating Sprites with VIC

Date view Thread view Subject view

From: Brian Bagnall (bbagnall_at_mts.net)
Date: 2002-10-15 03:09:50


Thanks, Blackjack, but that's not even close to what I was asking. Believe
it or not I have heard of an array.

My question is, how do I get those data values into the bitmap? Do I poke
them in, or does VIC provide an easier way to do it? Can someone show me
some code using VIC to form the sprite? Here's some code I think would work
to make a simple Balloon (monocolor sprite):

static const unsigned char BalloonSprite [] = {
0,127,0,1,255,192,3,255,224,3,231,224,
7,217,240,7,223,240,7,217,240,3,231,224,
3,255,224,3,255,224,2,255,160,1,127,64,
1,62,64,0,156,128,0,156,128,0,73,0,0,73,0,
0,62,0,0,62,0,0,62,0,0,28,0};
VIC.spr_ena = 1;
VIC.spr0_color = COLOR_GREEN;
VIC.spr0_x = x;
VIC.spr0_y = y;
poke(2040, 13);  // SPRITE 0 DATA FROM 13TH BLOCK
for(char N = 0 TO 62) {
    poke (832+N, BalloonArray[N]);
}

This just pokes them in, but does VIC provide a cleaner way to do this
without all the poking? I think it's a bit dangerous poking data in manually
because you never know if the compiler has allocated that memory space to
something else already.

- Brian


----- Original Message -----
From: "BlackJack/Civitas" <blackjack_at_civitas64.de>
To: <cc65_at_musoftware.de>
Sent: Monday, October 14, 2002 5:20 PM
Subject: Re: [cc65] Creating Sprites with VIC


> On Monday 14 October 2002 23:25, Brian Bagnall wrote:
>
> > But is it possible to get the drawing values into the sprite using
> > VIC? If I need to poke the values in, that's no problem. I know the
> > appropriate memory locations to do that but I was wondering if VIC
> > gave an easier way to do this.
>
> I assume you are talking about the bitmap of the sprite!? If you don't
> want to load the data from disk into the right memory locations, a char
> array like
>
> const char sprite_data[63] = { 0x00, 0x3e, 0x00, ...60 values... };
>
> and the memcpy() function might help.
>
> Ciao,
> Marc 'BlackJack' Rintsch
> --
> _ _____  __  __ _____________________________________________________
>  /  __/ /_/  \_\ CiViTAS - "Lameness rulez"
> /  /   ____  ____ http://www.civitas64.de/
> \  \_ / /\ \/ /\ \ mailto:blackjack_at_civitas64.de
>  \___/_/  \__/  \_\ C64 forever...
>
> ----------------------------------------------------------------------
> To unsubscribe from the list send mail to majordomo_at_musoftware.de with
> the string "unsubscribe cc65" in the body(!) of the mail.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-10-15 03:10:03 CEST