Search found 3116 matches

by Stef
Tue Jul 19, 2022 10:00 am
Forum: SGDK
Topic: polygon is not drawn
Replies: 18
Views: 1058

Re: polygon is not drawn

alko wrote:
Fri Jul 15, 2022 6:57 pm
:oops:

Code: Select all

 line = MEM_alloc( sizeof(Line));
No, it's really overkill and you may not release it properly later.
Just use static structure for that:

Code: Select all

 Line line;
line.pt1.x =0;
line.pt1.y =0;
line.pt2.x =100;
line.pt2.y =100;
line.col=10;

BMP_drawLine(&line);
by Stef
Tue Jul 19, 2022 9:58 am
Forum: SGDK
Topic: Form day to night, impossible to compile. gcc.exe: fatal error: -fuse-linker-plugin, but libto_plugin-0.dll not found
Replies: 2
Views: 180

Re: Form day to night, impossible to compile. gcc.exe: fatal error: -fuse-linker-plugin, but libto_plugin-0.dll not foun

Do a complete clean of your project, you may have dirty .s files somewhere..
I also experienced it and fixed it just by cleaning some intermediate .s file not properly cleaned
by Stef
Tue Jul 19, 2022 9:55 am
Forum: Demos
Topic: Instruction timing test (68000)
Replies: 6
Views: 563

Re: Instruction timing test (68000), wip.

Very interesting but i'm not sure to understand the VRAM/VSRAM cycles number. 85 cycles is for VRAM read operation during display ON i guess and continuous operation ? what represent the first 19 cycles ? single VRAM read operation ? I'm also very surprised by the 11 cycles obtained on long VRAM wri...
by Stef
Wed Jul 13, 2022 7:31 am
Forum: SGDK
Topic: polygon is not drawn
Replies: 18
Views: 1058

Re: polygon is not drawn

Kega isn't accurate, nor Gens is. You should test with BlastEm to see if you still have the same problem.
About the font, you can just "overwrite" it with your own tiles if you don't use it :)
by Stef
Mon Jul 11, 2022 7:55 am
Forum: SGDK
Topic: polygon is not drawn
Replies: 18
Views: 1058

Re: polygon is not drawn

The BMP mode uses a lot of main ram but also lot of VRAM so first you need to be sure you have enough VRAM to actually store your image. Bitmap start to allocate its rendering buffer to TILE_USER_INDEX so you will overwrite it when you draw your image. You need to initialize ind with BMP_FB1_END_TIL...
by Stef
Wed Jul 06, 2022 8:39 am
Forum: SGDK
Topic: polygon is not drawn
Replies: 18
Views: 1058

Re: polygon is not drawn

Resolution is fixed, that is a limitation of the bitmap engine, mean that you're limited to 20 FPS max on NTSC systems and 30 FPS on PAL systems. Resolution was flexible in priors implementations (very old SGDK version) but code was more convoluted and not as fast (width as power of 2 is a big win h...
by Stef
Mon Jul 04, 2022 8:26 am
Forum: SGDK
Topic: polygon is not drawn
Replies: 18
Views: 1058

Re: polygon is not drawn

Unfortunately no. First because it makes the polygon processing easier (no need to test about clockwise direction) and also because that is the way to do back culling when drawing 3D transformed objects in general.
So yeah, when defining 2D polygons, you need to take care of that.
by Stef
Mon Jul 04, 2022 8:22 am
Forum: SGDK
Topic: Sega Genesis Dev Kit (SGDK)
Replies: 848
Views: 719001

Re: Sega Genesis Dev Kit (SGDK)

Yeah i renamed that recently to have better consistency in definition names, i probably forgot to update them in some places though. Thanks for reporting, I will check that !
by Stef
Sun Jun 26, 2022 7:51 pm
Forum: SGDK
Topic: polygon is not drawn
Replies: 18
Views: 1058

Re: polygon is not drawn

You don't initialize pts correctly. By default variable are not initialized in C so you can't do MEM_free(pts); without having initialized pts first. Normally you should have done: pts = NULL; Then you should try to release pts only if pts != NULL so there is no reason to try to release on init. Ano...
by Stef
Thu May 19, 2022 7:37 pm
Forum: Demos
Topic: WIP Satan Claus - Mega Drive / Genesis / 32x
Replies: 5
Views: 585

Re: WIP Satan Claus - Mega Drive / Genesis / 32x

Looks like a nice platform / puzzle game :) do you make everything yourself ??
by Stef
Tue Apr 19, 2022 9:06 am
Forum: SGDK
Topic: Dynamically modify a Map
Replies: 7
Views: 1329

Re: Dynamically modify a Map

To be honest i'm checking this forum less and less as most of the support is given through my discord server where lot of people can reply : https://discord.gg/CeJtKmyT The sonic example won't help much here as it's still based on a Map resource even with setTileMapEx(..) The easiest way to deal wit...
by Stef
Sun Apr 03, 2022 4:12 pm
Forum: SGDK
Topic: Dynamically modify a Map
Replies: 7
Views: 1329

Re: Dinamicaly modify a Map

MAP_xxx methods aren't made for dynamic maps. If you need to modify map then indeed you will need to handle it by yourself and use lower level methods as VDP_setTileMapEx(..) :)
by Stef
Fri Mar 18, 2022 5:15 am
Forum: SGDK
Topic: Bank switching with SGDK
Replies: 6
Views: 2072

Re: Bank switching with SGDK

I want to make my ROM with more than 4Mb work (at the moment I have a crash with an illegal function). I opened the config.h file and changed ENABLE_BANK_SWITCH to 1, adding support for switching banks. Then I ran the build_lib.bat file from the root of my SGDK by double clicking on the file. It lo...
by Stef
Tue Feb 08, 2022 9:56 am
Forum: SGDK
Topic: SGDK memory allocation
Replies: 1
Views: 758

Re: SGDK memory allocation

Hi,

It will temporary consume RAM if your GFX data are compressed as it needs memory to store GFX data unpacked before sending to VRAM.
by Stef
Fri Feb 04, 2022 8:44 am
Forum: SGDK
Topic: Best way to access nibbles
Replies: 2
Views: 695

Re: Best way to access nibbles

You can also use bit fields in a structure, but as Cero said, nibble manipulation aren't really fast.
I think that using boolean logic operation directly on your u16 variable is the fastest way to go:

Code: Select all

var = (var & 0xF0FF) | 0x0300;
To change nibble 2 for instance