Home | Forums | What's new | Resources | |
Reinhart's Animation |
slinga - Sep 13, 2003 |
1 | 2 | Next> |
Reinhart | Sep 15, 2003 | |||
Reinhart's Animation That 2 function are copy-paste from the sgl samples. Basically, set_sprite load sprite into Saturn Memory ans disp_sprite is used to dispay the sprite. The most important is the sprite data located in in anotherfile (where are set size, orientation ...). I'm using ssconv to convert sprites (toss only for background). I will try to write a little toturial ... |
slinga | Sep 15, 2003 | |||
Reinhart's Animation Can you explain what PICTURE *pcptr and Uint32 NbPicture are? I think I got everything else. |
Reinhart | Sep 16, 2003 | |||
Reinhart's Animation Here is a little tutorial... I hope it will answer your question. It focus on displaying a single sprite (more to come) Feedbacks, corrections, rewiews are welcome (my engrish may be bad) I also hope it is good enough to be put in the SatDev section. |
vreuzon | Sep 16, 2003 | |||
Reinhart's Animation I was writing a tutorial, too; I merged it with reinhart's. It is far from beeing completed. Any corrections welcome. |
Reinhart | Sep 16, 2003 | |||
Reinhart's Animation :thumbs-up: Thanks for the correction. Let's see how everybody like this before the 'howto display 23 sprites' tutorial. |
RockinB | Sep 16, 2003 | ||||
Reinhart's Animation Now that this is going to become a tutorial.... ...SGL sprites are 16 bits, so why creating them with 24 bit color depth? May be confusing. ...the sprite dimensions don't strictly need to be a multiple of 8, when I remember correctly. Only one dimension must be multiple of 8, but I don't know exactly which of both. You'll have to take a brief look into VDP1 users manual. ... sprite conversion: for completeness, there is the possibility to use the SEGA Converter for Windows. Taken from MineSweeper's README.TXT:
...maybe you should mention something about bitmap/palette: The SGL uses 16bits bitmap sprites/textures because of color calculations that are made when displaying 3D objects. This tutorial is not about textures, but sprites. And for sprites it would be much better to use paletted images, because of memory usage. I remember Reinhards stating on his site that he tried to get more sprites managed. Paletted sprites is the solution. But no one did this. What I read is that the used pallete is the same that is registered inside VDP2. But there seems to be another way to place multiple palettes of 16 colors into VDP1 RAM. Bye, The Rockin'-B |
antime | Sep 16, 2003 | |||||||
Reinhart's Animation
The width must be a multiple of eight pixels (max 504 pixels) while the height can be given in one-pixel precision (max 255 pixels).
I don't know how/if SGL exposes this, but the "Color Mode" bits in the CMDPMOD command table field must be set to 001. The address of the color table divided by 8 is stored in the CMDCOLR field. The color table can either hold color bank codes (VDP2 palettes) or RGB data. Set the MSB of the color to 1 for it to be interpreted as RGB. If VDP1 is in 8bpp mode (framebuffer rotation or hires) you can only use color bank codes. Also note that color number zero is used as transparent, unless the disable bit is set. If you enable end codes, you lose another color (number 15 with 4bpp data). EDIT: Looking at the SGL docs, it seems you can use paletted data by setting the right face/sprite attribute data. The "Mode" should be CL16Look, the lookup table address (divided by 8, I assume) should be given as "Color" and the "Option" should be UsePalette. I think you have to manage the CLUTs yourself, couldn't see any references in the manual. |
slinga | Sep 16, 2003 | ||||
Reinhart's Animation Thanks so much guys!! This is exactly what I was looking for. One small suggestion, in the section 4 of the pdf can we have comments describing the struct member variables?
Code:
|
slinga | Sep 16, 2003 | ||||
Reinhart's Animation I copy and pasted the code, (I used ring1.c from reinhart's source code). I couldn't get it to compile:
Any ideas as to what I'm doing wrong? :huh I included scr_data.h, and it compiles fine now. Only thing is I don't see a ring on satourne? Argh I'm going to bed, but good work on the tutorial. I'll keep trying. |
vreuzon | Sep 17, 2003 | |||
Reinhart's Animation slinga : - did you add the file containing your sprites attributes in the OBJECT file ? As the PICTURE, TEXTURE and SPR_ATTR are EXTERN in the main.c, you have to add the relative object file for the link to be successfull. - parts of the sprites structures are rather unclear to me; someone reading japanese could help by translating the members meaning by translating them from sgl.h (or sl_def, I don't remember) rockin'b, antime : thanks for your comments. They've been added to the tutorial. reinhart : multiple sprites from different arrays, now ? and then paletted sprites ? |
RockinB | Sep 17, 2003 | |||
Reinhart's Animation Yo slinga, I think you already know the reason for this compilation error. No sprite display? I had really, really strange problems like that with the old compiler that you use. Don't want to go into detail, but I very strongly suggest you to take the new kpit compiler. This problem will be eliminated then and you will avoid a lot of wasted time.... . Good luck, The Rockin'-B |
Reinhart | Sep 17, 2003 | |||
Reinhart's Animation Slinga : Check if the initial position of the sprite is not 'outside' of the screen Vreuzon : I have to make some tries with multiple arrays . Paleted sprites seems difficult to handle for me ... |
slinga | Dec 29, 2003 | ||||||||||||||||
Reinhart's Animation *bump* New compiler. Still no sprite =( If someone has some free time, please take a look at my files and tell me what I'm doing wrong, I copy and pasted directly from the guide: Main.c
Code:
spr_data.c
Code:
ring1.c (taken from Reinhart's contest entry)
Code:
Objects
Code:
And everything compiles without a hitch:
I'm guessing I'm missing something in the objects file. |
mrkotfw | Jan 1, 2004 | ||||||||||
Reinhart's Animation
Code:
change it to:
Code:
and heres mine:
Code:
|
slinga | Jan 3, 2004 | |||
Reinhart's Animation Hey Piratero, Thanks for your help. After I made the change you recommended, I see an image in the middle of the screen. It doesn't look correct though, I still think something is wrong. Can I see the source files for your new demo? Thanks in advance. |
slinga | Sep 23, 2004 | |||
Reinhart's Animation Giving it another go but still stuck, image is corrupted: |
Reinhart | Sep 24, 2004 | |||
Reinhart's Animation Have you tried with one file of my demo ? |
slinga | Sep 24, 2004 | |||
Reinhart's Animation Yep. I used ring1.c. |
slinga | Sep 27, 2004 | |||
Reinhart's Animation Here is my source code if everyone wants to take a look. |
1 | 2 | Next> |