New in SGDK
Posted: Fri Apr 11, 2014 11:16 pm
Hi everybody, I hope this thread is usefull and you can help me
.
Some days ago i started to make little roms with SGDK, (genesis/MD looks like a powerfull device, a lot of maths power).
1- Making waves with bkg
I tried to achieve a wave effect but i don't know how to do it, or control it...
This code moves a plane using a sine function:
Now i want to reset the X value every time the screen goes to VBLANK. i need some function to do something like:
"if (screen is in vblank) X = 0;"
I'd also like to know if there is a "scan line counter" and how to use it. and maybe there is a better way to make waves with the planes.
2- Noob C question
I've got a bunch of planes loaded in a rom, they are called "plane1, plane2..."
Now i want to draw them to make a "video", this code does not work, but it will explain what i want to do:
How do i have to write the "plane(i)" part, so that it loads plane1 if i = 1?.
3- Drawing 3D objects over a image
I also got a 3d object rotating and everything
. Is it possible to draw the objects in plane A over an image loaded in plane B?
4- 22050 Khz sound
I used Deflemask to create some music, then realized i could insert 22050 Khz samples for the drums, created a vgm, compiled a rom with it...
The rom worked well and played the samples in an emulator.. Can the real hardware play that samples at 22050 Khz?
Thanks a lot!
I attach some pictutes of what i got to work
.
Out of control waves:

3D icosahedron:

512x512 seamless images:


Some days ago i started to make little roms with SGDK, (genesis/MD looks like a powerfull device, a lot of maths power).
1- Making waves with bkg
I tried to achieve a wave effect but i don't know how to do it, or control it...
This code moves a plane using a sine function:
Code: Select all
while(1){
if (X > 1024) X = 0;
VDP_setHorizontalScroll(BPLAN,sinFix16(X));
X+=4;
}
"if (screen is in vblank) X = 0;"
I'd also like to know if there is a "scan line counter" and how to use it. and maybe there is a better way to make waves with the planes.
2- Noob C question
I've got a bunch of planes loaded in a rom, they are called "plane1, plane2..."
Now i want to draw them to make a "video", this code does not work, but it will explain what i want to do:
Code: Select all
//imagine i loaded 9 planes (plane1, plane2...)
while(1){
if (i == 10) i = 1;
VDP_drawImageEx(BPLAN, &plane(i), TILE_ATTR_FULL(PAL0,0,0,0,ind),0,0,0,1);
ind += plane(i).tileset->numTile;
i++;
VDP_waitVSync();
}
3- Drawing 3D objects over a image
I also got a 3d object rotating and everything

4- 22050 Khz sound
I used Deflemask to create some music, then realized i could insert 22050 Khz samples for the drums, created a vgm, compiled a rom with it...
The rom worked well and played the samples in an emulator.. Can the real hardware play that samples at 22050 Khz?
Thanks a lot!
I attach some pictutes of what i got to work

Out of control waves:

3D icosahedron:

512x512 seamless images:
