Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

nemezes
Interested
Posts: 43
Joined: Sat Mar 31, 2018 1:09 pm

Re: Sega Genesis Dev Kit (SGDK)

Post by nemezes » Thu Jul 12, 2018 1:37 pm

Stef wrote:
Tue Jan 16, 2018 1:00 pm
To release some VRAM in the tilemap allocation.
Megadrive allow 32x32, 32x64, 64x32 (default since SGDK 1.31), 64x64 (defaut in SGDK < 1.31), 128x32, 32x128 tilemap size
But almost time 64x32 is enough to do whatever you want and allow to store more tile data in VRAM =)
Of course you can change the VRAM setup if you want =)
I had this same doubt.. I thought the screen virtual area 64x64 was standard for mega drive.

Nice to know about it. :)

Munkyears
Very interested
Posts: 50
Joined: Sat Mar 21, 2009 4:24 pm
Location: Sheffield, England

Re: Sega Genesis Dev Kit (SGDK)

Post by Munkyears » Thu Jan 31, 2019 1:32 am

Hi Stef!!

Random question but have you any plans to incorporate bank switching within SGDK??

Would be mighty helpful!!

Glad to see you are still active!!

Joe
To be this good takes ages, To be this good takes Stef, Kanedafr, ChillyWilly & everyone who has helped me discover what hardwork is!

Dive into the SpritesMind! :)

User avatar
Stef
Very interested
Posts: 2912
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Sega Genesis Dev Kit (SGDK)

Post by Stef » Thu Jan 31, 2019 12:29 pm

Hey :)
Of course i'm still alive ^^ Busy but alive ;)
Adding bank switching isn't something i can really do much for it. I can eventually to register get/set operation to change the bank but except that i do not see how i can work out easily bank switching part with the compiler. It's more something you need to do manually.

User avatar
Sik
Very interested
Posts: 787
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Sega Genesis Dev Kit (SGDK)

Post by Sik » Fri Feb 01, 2019 5:47 pm

Well, later consoles (and some DOS programs :​v) would resort to "overlays" which are chunks of code that can be loaded and unloaded as needed… I suppose that bank switching support on SGDK would require a scheme like that. And yes, this is something that needs help from the linker (to put data in overlapping regions).

It's doable, but also a pain in the ass.
Sik is pronounced as "seek", not as "sick".

Mixail
Very interested
Posts: 108
Joined: Thu Nov 18, 2010 4:47 pm

Re: Sega Genesis Dev Kit (SGDK)

Post by Mixail » Thu Feb 28, 2019 11:43 am

Does SGDK have an analogue of the memcmp () function?

User avatar
Stef
Very interested
Posts: 2912
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Sega Genesis Dev Kit (SGDK)

Post by Stef » Thu Feb 28, 2019 12:08 pm

Nope, i think it's the first time somebody ask for it ^^
Could be added but you will definitely be faster do it yourself for now ;)

cero
Very interested
Posts: 246
Joined: Mon Nov 30, 2015 1:55 pm

Re: Sega Genesis Dev Kit (SGDK)

Post by cero » Thu Feb 28, 2019 6:44 pm

The Linux version of SGDK includes newlib, meaning standard funcs like memcmp are available there.

danibus
Interested
Posts: 35
Joined: Sat Feb 03, 2018 12:41 pm

Re: Sega Genesis Dev Kit (SGDK)

Post by danibus » Thu Mar 21, 2019 3:42 pm

Just a question about "Sample/Sprite" example in SGDK

Why using

Code: Select all

fix32 enemyPosx[2];
to represent sprite TV position?

I mean, if megadrive only have 0 to 512 pixels, and only from 128 to 128+320px are visible (0 to 320px in SGDK), why using fix32??
Why not using fix16?

Can I use int to check position? Or do I have to check hex numbers instead?

I'm playing with u16, u32, etc for position and don't know how to proceed if one "enemy" exit TV (from right to left) and then appears again in right part... I'm using kdebug to check position but after going left part, position = 0, appears in right part and then position = FFFF.... :?:

User avatar
Stef
Very interested
Posts: 2912
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Sega Genesis Dev Kit (SGDK)

Post by Stef » Fri Mar 22, 2019 10:02 am

fix16 could be enough if you enable your sprite position only when you want to display, but for convenience sometime you need to retain the sprite position even when it's off screen (not too far but still off screen) in which case fix16 can be limiting (fix16 range is limited to -[512.0 to to 511.0]).
Also for very low acceleration / speed, fix32 can be useful (but to be honest fix16 should be enough in 99% of case here).

Also iIt's always better to use signed values for sprite position as definitely your sprite can be in negative position relative to the screen to don't use u16 or u32 for that (you know that you can convert fix16 to signed integer right ?)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests