Search found 15 matches

by izidor
Sat Feb 20, 2021 3:26 pm
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

How to erase the tiles of the vram of plan A or B?
VDP_clearPlane simply clear the screen, the tiles are still in vram.

I just want to delete the tileset from the vram that I no longer need to load the next level tileset.

If anyone can help me or give me hints.
thank you
by izidor
Tue Feb 16, 2021 7:40 pm
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

Thanks for the answer, it works !!
by izidor
Mon Feb 15, 2021 5:18 pm
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

Hello, another question I have a sprite that won't be erased, i am using the SPR_releaseSprite () function, this sprite is initialized when the player presses a button and i want to delete it when the player presses another button. When I pass all my other sprites as a parameter, no problem it all g...
by izidor
Tue Feb 09, 2021 3:56 pm
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

I expressed myself badly, indeed I want to do this operation during a Vblank, in fact I want to slide the camera of X pixel. if I do it outside of Vblank,the camera immediately goes to the position but I tested in a Vblank period and it seems to work, I find it a bit risky to do it in a for loop enu...
by izidor
Tue Feb 09, 2021 8:14 am
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

I have another question regarding the Vblank period, can I use
if (SYS_doVBlankProcess ()) in a function to perform an operation after Vblank period. I tested it looks good but I want to be sure it won't be a source of problem.
by izidor
Tue Feb 09, 2021 6:41 am
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

Ok, thanks for the answer, in the meantime I found a solution: and indeed I test the tiles where the player is. if( posx%8 >4 ){ tile_x = ((posx - psox%8)>>3) +1} else tile_x = ((posx - psox%8)>>3) if( posy%8 >4 ){ tile_y = ((posxy - psoxy%8)>>3) +1} else tile_y = ((posxy - psoxy%8)>>3) test_collisi...
by izidor
Sun Feb 07, 2021 5:56 am
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

Hello, I have a small problem with the recovery of the tile at the player's position for collisions. I get the tile this way : pos_x = player.x >> 3, pos_y = player.x >> 3 (division by eight) the variables player.y and player.y, pos_x and pos_y are declared in u16 To increment player.x and player.y ...
by izidor
Thu Feb 04, 2021 2:43 pm
Forum: SGDK
Topic: Get Tile Index of background specific position (X, Y)
Replies: 6
Views: 12977

Re: Get Tile Index of background specific position (X, Y)

At the risk of saying something stupid,
If you are using a MAP resource on the A or B plane, there is a function," u16 MAP_getTile(Map*map, u16 x, u16 y) " in file " Map.c " maybe do a comparison with the return value and the tile index which you can find with dump VRAM with K-mod
by izidor
Thu Feb 04, 2021 10:27 am
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

Thanks, I'll take your advice and watch this.
by izidor
Thu Feb 04, 2021 6:57 am
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

No one to help me! I will wait, there is someone who will come :D . In the meantime I observed SPR_Update () sprite_eng.c to try to understand this part: // handle frame animation if (timer) { // timer elapsed --> next frame if (--timer == 0) SPR_nextFrame(sprite); // just update remaining timer els...
by izidor
Thu Feb 04, 2021 5:36 am
Forum: SGDK
Topic: Display a variable on the screen[resolved]
Replies: 4
Views: 7661

Re: Display a variable on the screen[resolved]

Thank you for the information,
it's not falling on deaf ears !! :wink:
by izidor
Wed Feb 03, 2021 3:44 pm
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Re: Some questions about SGDK

Apparently, we need to update the sprite position coordinates according to the Camera, I just wrote a function to handle that and it works fine. Other questions, I looked for on the forum but the subject is only partially addressed. I have a problem to stop an animation on the last frame, I thought ...
by izidor
Wed Feb 03, 2021 6:22 am
Forum: SGDK
Topic: Some questions about SGDK
Replies: 15
Views: 25670

Some questions about SGDK

Hello, I would need confirmation, if I understood correctly, Plane A and B can scroll vertically and horizontally and the sprite plane is fixed. For the coordinate system, the reference point is the coordinate 0,0 of (top left of the screen). When the BGs scroll, I have to update a variable which si...
by izidor
Mon Feb 01, 2021 12:00 pm
Forum: SGDK
Topic: Display a variable on the screen[resolved]
Replies: 4
Views: 7661

Re: Display a variable on the screen[resolved]

It's resolved with sprintf(), I had not seen this function.

Code: Select all

char str_Region[2] = "0";

void RegionDisplay()
{
	sprintf(str_Region,"%d",indexReg);
	VDP_clearTextAreaBG(BG_B,15,10,2,1);
	VDP_drawTextBG(BG_B,str_Region,15,10);
}
by izidor
Mon Feb 01, 2021 9:27 am
Forum: SGDK
Topic: Display a variable on the screen[resolved]
Replies: 4
Views: 7661

Display a variable on the screen[resolved]

Hello, I am new to the forum that I have already been browsing for a few weeks, I thank the author of this bookstore (SGDK) who opened the doors to me to programming on Megadrive in C Language, as well as all the participants / members of this forums that enrich this section of the forum, it helps a...