Search found 3101 matches

by Stef
Tue Jan 04, 2022 10:35 am
Forum: SGDK
Topic: Sega Genesis Dev Kit (SGDK)
Replies: 845
Views: 650913

Re: Sega Genesis Dev Kit (SGDK)

The first problem I see in your code is the way you handle string in C. String requires a NULL ending character so you always need to allocate one extra character in your variable. Also you don't need to specify it when using strxxx methods as it does add it for you, so correct code is as follow : /...
by Stef
Sun Jan 02, 2022 9:12 pm
Forum: SGDK
Topic: Sprites map are not compressed in VRAM
Replies: 1
Views: 334

Re: Sprites map are not compressed in VRAM

SGDK does not handle the duplicate / flip optimization on sprite tiles for various reasons. It's much more tricky to handle as the optimization can work only on (hardware) sprite basis and so they should have the same size. It can somehow work if you fix the sprite size and also for single hardware ...
by Stef
Tue Dec 14, 2021 8:14 pm
Forum: SGDK
Topic: Disable automatic animations for statically loaded sprites
Replies: 3
Views: 373

Re: Disable automatic animations for statically loaded sprites

Well, that shouldn't give specific troubles, as soon you use the setVRAMTileIndex(..) according to it.
But if your sprite sheet only use a single row, be careful to not use more than 256 frames then.
by Stef
Wed Dec 08, 2021 10:13 pm
Forum: SGDK
Topic: Disable automatic animations for statically loaded sprites
Replies: 3
Views: 373

Re: Disable automatic animations for statically loaded sprites

I'm not sure of what you're doing exactly.
You said you have all your sprites are presented in a single row ? I don't understand, that means the sprite->animInd is always 0 ?
Also "statically" loaded sprites also require the use of setFrame(..) method at same time you're doing the setVRAMTileIndex(..)
by Stef
Mon Dec 06, 2021 4:01 pm
Forum: SGDK
Topic: help with black screen
Replies: 8
Views: 823

Re: help with black screen

Note that recent SGDK version are also more stable in general, so here depending on which version you are, you may also work with the old SGDK bugs too :-/
by Stef
Sun Dec 05, 2021 9:32 pm
Forum: SGDK
Topic: Sega Genesis Dev Kit (SGDK)
Replies: 845
Views: 650913

Re: Sega Genesis Dev Kit (SGDK)

Hi, Your code is correct :) If your IMAGE isn't compressed then Map *mymap = unpackMap(background.map, NULL); will still work as in case there is no compression unpackMap will do a simple copy and allocate destination if set to NULL so you should even keep the MEM_free(mymap); But i'm speaking about...
by Stef
Sun Dec 05, 2021 2:27 pm
Forum: SGDK
Topic: Sprites are not loaded in new version SGDK
Replies: 4
Views: 622

Re: Sprites are not loaded in new version SGDK

Oh sorry the method is called SYS_doVBlankProcess() !
by Stef
Sun Dec 05, 2021 2:26 pm
Forum: SGDK
Topic: help with black screen
Replies: 8
Views: 823

Re: help with black screen

To be honest handling correctly soft reset without resetting everything can be tricky, it's easy to miss some uninitialized variables !
by Stef
Sat Dec 04, 2021 10:21 pm
Forum: SGDK
Topic: help with black screen
Replies: 8
Views: 823

Re: help with black screen

I will say it's probably an issue with variable initialization / initialized state.
But why just don't do a "hard reset" on completion ? so you're sure to restart in a perfect initialized state :)
by Stef
Sat Dec 04, 2021 10:18 pm
Forum: SGDK
Topic: Sprites are not loaded in new version SGDK
Replies: 4
Views: 622

Re: Sprites are not loaded in new version SGDK

The Changelog give some tips about required changes when updating to a new SGDK version.
Version 1.6 required a major update in the code:
Change all VDP_waitVSync() references by VDP_doVBlankProcess().
You may have others issues but i think this one is the most important one :)
by Stef
Wed Nov 03, 2021 8:40 am
Forum: SGDK
Topic: Sky Gradients?
Replies: 4
Views: 778

Re: Sky Gradients?

I should have replied here as this is definitely a SGDK solution that I propose here :p So you should declare your H-Int function like this: void hint() { PAL_setColor(0, gradientColor); gradientColor-= 0x100; } Then prepare your H-Int gradient effect using this from your main code: // each 4 lines ...
by Stef
Tue Nov 02, 2021 2:23 pm
Forum: Video Display Processor
Topic: Palette color switching in HBlank
Replies: 14
Views: 9634

Re: Palette color switching in HBlank

Declare your H-Int function like this: void hint() { PAL_setColor(0, gradientColor); gradientColor-= 0x100; } Then prepare your H-Int gradient effect using this from your main code: // each 4 lines VDP_setHIntCounter(4); // enable H-Int VDP_setHInterrupt(TRUE); // set H-Int callback method SYS_setHI...
by Stef
Sun Oct 24, 2021 2:38 pm
Forum: SGDK
Topic: Weird things with very basic code
Replies: 3
Views: 665

Re: Weird things with very basic code

Hi, Just seeing your post sorry, indeed the sprite engine is meant to be used through the SPR_xx methods, don't directly modify internal fields (maybe except spr->timer in some situation) or you may screw some internal states of the sprite. Just use SPR_xx for all sprite manipulations and it should ...
by Stef
Thu Aug 26, 2021 10:04 pm
Forum: SGDK
Topic: 68k based PCM Audio mixer for YM2612
Replies: 7
Views: 1329

Re: 68k based PCM Audio mixer for YM2612

Writing a Z80 sound driver is probably one of the most difficult part when developing game for the system to be honest.
Did you had a look on existing Z80 driver from SGDK ? otherwise you can try to publish here the specification of the driver you need and hire someone to do it for you.
by Stef
Thu Aug 26, 2021 9:53 pm
Forum: SGDK
Topic: Bank switching with SGDK
Replies: 2
Views: 841

Re: Bank switching with SGDK

SGDK does support bank switching but using the official sega mapper (also called SSF2 mapper). So it switches 512 KB banks and bank 0 is fixed. SGDK can handle that almost all automatically for you in which case it access banks above 4 MB through the 3MB-4MB region. If you want to use your own bank ...