Hello guys,
so i managed to compile the toolchain and all and i'm already having some issues with drawing on the 32X.
I was able to show a 32K picture on screen but drawing a sprite that can be anywhere on screen with transparency is a little more difficult...
The examples Chilly provides (32x_images.c) unfortunely seems to be designed to work only in 256 color mode.
Now of course, i could just work only in 256-mode but i don't want that because managing a palette that huge is painful.
Are there any examples/code out there that shows how to display sprites on-screen ?
I'm personally interested to make some 32X games.
Thanks
[C] Sprite examples for 32X ?
Moderator: BigEvilCorporation
-
- Very interested
- Posts: 160
- Joined: Sun Apr 29, 2007 10:04 pm
- Location: Belo Horizonte, MG, Brazil
Re: [C] Sprite examples for 32X ?
Well, the 32x does not have hardware sprites (unless you use the Genesis' ones, of course), but you can do it via software; maybe you could take a look at Olivier's SuperVDP or, if you want a 32768 color example with software sprites, maybe you could take a look at my slow, unoptimized and still a work-in-progress VN32X.
-
- Interested
- Posts: 18
- Joined: Thu Sep 26, 2013 12:41 am
Re: [C] Sprite examples for 32X ?
Hey, thanks !haroldoop wrote:Well, the 32x does not have hardware sprites (unless you use the Genesis' ones, of course), but you can do it via software; maybe you could take a look at Olivier's SuperVDP or, if you want a 32768 color example with software sprites, maybe you could take a look at my slow, unoptimized and still a work-in-progress VN32X.
Your routines work pretty well, i must say.
It even supports alpha transparency !
But why do you have to convert your images to 8-bits though ?
To save space ?
I'm kind of surprised you can do 3D on this thing because it's basically a VGA adaptor with 2 powerful cpus...
-
- Very interested
- Posts: 160
- Joined: Sun Apr 29, 2007 10:04 pm
- Location: Belo Horizonte, MG, Brazil
Re: [C] Sprite examples for 32X ?
I'm glad it's useful.gameblabla wrote:Hey, thanks !haroldoop wrote:Well, the 32x does not have hardware sprites (unless you use the Genesis' ones, of course), but you can do it via software; maybe you could take a look at Olivier's SuperVDP or, if you want a 32768 color example with software sprites, maybe you could take a look at my slow, unoptimized and still a work-in-progress VN32X.
Your routines work pretty well, i must say.
It even supports alpha transparency !
![Smile :)](./images/smilies/icon_smile.gif)
Not really, it was mostly lazyness plus lack of time in my part; I didn't want to write my own image converter, so instead I experimented first with micol972's PNG decoder for 32x; it worked okay at first, I even managed to make the alpha channel work, but overall, it was quite slow; if you want to take a look at the original effort, you can access this old revision of the VN32X repository. Later, I tried sixpack; I counldn't manage to make its 15 bit conversion work, but the 256 color version worked like a charm, as long as the width was a multiple of 8. I still had to write a small Python script to add image width and height to the converted data, since sixpack does not include that.gameblabla wrote: But why do you have to convert your images to 8-bits though ?
To save space ?
I am thinking about implementing a custom image converter with a custom image format so as to use the full 32768 color palette but, right now, since there are other parts of VN32X that are in need of attention, this will probably be pushed to a later date.
Yes, programing the 32x hardware sorta feels like developing a MS-DOS game.gameblabla wrote: I'm kind of surprised you can do 3D on this thing because it's basically a VGA adaptor with 2 powerful cpus...
-
- Interested
- Posts: 18
- Joined: Thu Sep 26, 2013 12:41 am
Re: [C] Sprite examples for 32X ?
Ok, so i'm already running out of memory...
The 32X has two framebuffers of 128Ko, right ?
If so, then can i use the other framebuffer to store graphics ?
Can it be used at all for that purprose ?
Because it seems that i can't display more than a 320x202 screen in 32K mode...
You simply need to set the format to "d15", kind of like this :
The 32X has two framebuffers of 128Ko, right ?
If so, then can i use the other framebuffer to store graphics ?
Can it be used at all for that purprose ?
Because it seems that i can't display more than a 320x202 screen in 32K mode...
I don't know how you couldn't get it to work...I counldn't manage to make its 15 bit conversion work.
You simply need to set the format to "d15", kind of like this :
Code: Select all
./sixpack -image -pack -target 32x -codec aplib -format d15 -width 320 -height 202 porn.png -o porn.apx
Re: [C] Sprite examples for 32X ?
Nope. One framebuffer is displayed on screen (and can't be touched at all), the other framebuffer is used to draw into. So you only have access to one framebuffer at a time I'm afraid.gameblabla wrote:The 32X has two framebuffers of 128Ko, right ?
If so, then can i use the other framebuffer to store graphics ?
Can it be used at all for that purprose ?
Sik is pronounced as "seek", not as "sick".