Re: [cc65] TGI blit

From: Karri Kaksonen <karri1sipo.fi>
Date: 2009-11-03 11:36:49
Oliver Schmidt wrote:
> So it seems there is in fact demand for a new tool - even for the C64:
>
> - Running on the cc65 host (not target) platforms
> - Reading a BMP/PNG/...
>   

This is the first problematic area. In real life I probably cannot use 
the colors and resolutions directly on my target. Part of porting a 
project includes fine-tuning the colors and the size of the graphics. 
For me it is enough to do the reduction of colors, dithering etc in 
Gimp. I would then save my graphics as an indexed png file.

I do not want any extra "intelligence" of the conversion tool. Just 
re-pack the data - don't mess with it. This means that the colors, 
indexes and palettes are already suitable for the target when I compile 
my code.

> - Writing a device dependend bitmap (hopefully supporting many TGI drivers)
> - The bitmap contains some minimal header with height and width and ...
>   

This is very device dependent. Don't define it. Just define a binary 
object that contains the graphics without defining the structure, the 
fields etc.

> - Hopefully many TGI drivers support copying "their" bitmap to a drawpage
>   

The Lynx needs no software for this. Just pass the pointer of the binary 
object to Suzy. The Lynx mandatory sprite header looks like this. You 
don't want to have it in any other target ;)

> #define SPRCTL0_1_bit_per_pixel 0
> #define SPRCTL0_2_bits_per_pixel 0x40
> #define SPRCTL0_3_bits_per_pixel 0x80
> #define SPRCTL0_4_bits_per_pixel 0xc0
> #define SPRCTL0_h_flip 0x20
> #define SPRCTL0_v_flip 0x10
> #define SPRCTL0_shadow 7
> #define SPRCTL0_xor_shadow 6
> #define SPRCTL0_non_collide 5
> #define SPRCTL0_normal 4
> #define SPRCTL0_boundary 3
> #define SPRCTL0_boundary_shadow 2
> #define SPRCTL0_background_no_coll 1
> #define SPRCTL0_background_shadow 0
>
> #define SPRCTL1_literal 0x80
> #define SPRCTL1_hsize_vsize_strech_tilt 0x30
> #define SPRCTL1_hsize_vsize_strech 0x20
> #define SPRCTL1_hsize_vsize 0x10
> #define SPRCTL1_no_palette 0x08
> #define SPRCTL1_skip_sprite 0x04
> #define SPRCTL1_start_drawing_up 0x02
> #define SPRCTL1_start_drawing_left 0x01
>
> #define SPRCOLL_dont_collide 0x20
> #define SPRCOLL_number_0_3 0x00
>
> typedef struct {
>     unsigned char sprctl0;
>     unsigned char sprctl1;
>     unsigned char sprctl2;
>     void *next;
>     void *bitmap;
>     int posx, posy, sizex, sizey;
>     char palette[8];
> } sprite_t;

--
Karri

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Nov 3 11:36:59 2009

This archive was generated by hypermail 2.1.8 : 2009-11-03 11:37:02 CET