Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

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

Post by Stef » Wed Dec 24, 2014 12:11 am

Chilly Willy wrote:Whoops! Minor bug on my side of things I just noticed...

Code: Select all

            if (md[0] & 0x02)
                my |= mx ? 0xFF00 : 0xFFFF; /* y sign extend */
Notice how it checks mx when setting my? Should be my instead of mx there in line 681. Sorry, should have noticed that myself earlier.
Thanks for reporting, i should have checked it (actually i read code but too quickly) ! Updated :)

hiperbou
Newbie
Posts: 6
Joined: Sun Aug 12, 2012 1:43 pm

Post by hiperbou » Sun Jan 18, 2015 1:17 pm

Hello, I was testing the sprite example, and I saw a strange thing in the plane explorer. It seems like it's painting some tiles on bottom left. It happens with the other plane too, and it's visible if you modify the camera to see a bit lower.
Could be a bug with the VDP_drawImageEx function?
Image[/img]

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

Post by Stef » Mon Jan 19, 2015 10:36 am

Never noticed that, i should check it but i think the VDP_drawImageEx(..) methods are ok as i used them a lot and never saw bugs with them. Maybe a effect from wrapping or something like that.

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

Post by Stef » Mon Mar 09, 2015 10:26 pm

Just to bump out the new version of SGDK which mainly fix a minor issue in the XGM driver :)

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

Post by Stef » Tue Mar 17, 2015 8:40 pm

As Google Code is closing doors, i moved SGDK on GitHub.
You should find almost everything on GitHub now, i just need to rewrite the tutorials now =)

letoulousain
Interested
Posts: 42
Joined: Fri Sep 24, 2010 11:32 pm
Location: toulouse

Post by letoulousain » Fri Mar 20, 2015 9:54 pm

Stef wrote:As Google Code is closing doors, i moved SGDK on GitHub.
You should find almost everything on GitHub now, i just need to rewrite the tutorials now =)
Thanks ! Et bon courage pour les tuto !
:D
thanks to Stef SGDK

lingh
Interested
Posts: 20
Joined: Thu Sep 06, 2012 4:57 am

Re: Sega Genesis Dev Kit (SGDK)

Post by lingh » Sun Dec 20, 2015 6:43 am

Stef, no more doxygen documentation?
Can you at least add doxygen conf file to the github?

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

Re: Sega Genesis Dev Kit (SGDK)

Post by Stef » Sun Dec 20, 2015 12:25 pm

Doxygen is still there, in doc folder :)
And generating it is pretty simple but i can add the script to build it from Code::Blocks i guess !

lingh
Interested
Posts: 20
Joined: Thu Sep 06, 2012 4:57 am

Re: Sega Genesis Dev Kit (SGDK)

Post by lingh » Sun Dec 20, 2015 12:49 pm

Stef wrote:Doxygen is still there, in doc folder :)
Yes, i remember it from googlecode page, but i can't find doc folder in github master branch.

Oh, it seems you have dropbox links for different versions, and you put docs in them. But still, you can add doxygen.conf to master branch for manual generation.

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

Re: Sega Genesis Dev Kit (SGDK)

Post by Stef » Mon Dec 21, 2015 5:23 pm

Yeah i removed it from repository, only present in archive as it generates hundred of files ! I will add the doxygen conf file to github soon :-)

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

Re: Sega Genesis Dev Kit (SGDK)

Post by Stef » Fri May 27, 2016 7:26 pm

SGDK 1.2 released :)

Many changes included !! Here's the changelog :

DOCUMENTATION:
* several update and fixes here and there (some tags were not correctly recognized in later doxygen version).

COMPILER
* Rescomp: updated to version 1.5 (with updated documentation)
- updated SPRITE resource compilation to the new SGDK Sprite structures.
- fixed minor issue on IMAGE resource packing.
- now using constants for sound driver (less confusing, got annoying bug because of that).
- changed header 'define' name generation to avoid conflict between 2 identical named file.
- fixed a bug in tilemap optimization for flipped tiles.
- removed all packers not anymore used in SGDK.
- minor change to XGM resource to support extra parameter
- fixed a minor bug in sprite structure definition
* XGMTool: updated to version 1.64
- major structure changes for faster conversion / optimization operations
- improved VGM to XGM conversion.
- added options to disable some PCM auto processing
- new options available to handle specific case and improve conversion process
- added GD3 tag support.
- better handling of PAL/NTSC timing
- fixed pal information lost during XGC conversion.
- more accurate loop position
- fixed a minor issue in offset calculation.
- fixed VGM loop information export (when using VGM optimization)
* WavToRaw:
- fix 64-bit issues, it is still not endian safe.
- check for read errors.
* Appack: minor fix for silent parameter.
* Added new custom LZ4W packer (require Java to be installed).
* Removed GenRes tool (not anymore used and can confuse with rescomp).
* added GDB tool (not yet really used yet)
* Separated 'debug' and 'release' library build for easier profile switch.

LIBRARY
* BITMAP:
- allow to change the plan used for bitmap rendering
- added buffer preservation option (severe impact on performance)
- fixed minors issues on reset/initialization process
* DMA: added new DMA queue system in 'dma' unit, you can consider 'vdp_dma' unit as deprecated (still provided for backward compatibility).
- we can now limit the max transfer capabilities in a single frame with DMA_setMaxTransferSize(..)
- can now define the DMA queue size with DMA_init(..) method.
- added DMA_setIgnoreOverCapacity(..) to change DMA strategy when reaching max capacity.
* GRAPHIC:
- added news methods for allocation and compression stuff (see TOOLS section)
- added dynamic VRAM allocation ('vram' unit which replace 'tilecache' unit)
* PALETTE:
- fixed RGB24_TO_VDPCOLOR so it does what it says.
- better palette fading using rounding.
- fixed issue using sync fading locking interrupts (can cause XGM music lag).
* MATHS:
- added abs(..) method.
- fixed fix32ToRoundedInt() and fix32Round() defines (added parenthesis around)
- replaced distance_approx(..) by getApproximatedDistance(..)
- changed fix32 div/mul calculation strategy for better value preservation
* MEMORY:
- added MEM_getAllocated() to return current dynamically allocated memory.
- added MEM_dump() to dump in Gend KMod console the memory allocation table
* SOUND:
- renamed Z80_DRIVER_4PCM_ENV --> Z80_DRIVER_4PCM
* SPRITE: complete rewrite of sprite engine !
- many changes including the API.
- should be faster but will be more optimized in future.
* STRING:
- added isdigit(c), strnlen(..) and the very useful sprintf(..) ma
- added strncpy(..) method.
- replaced strreplace(..) --> strreplacechar(..)
- fixed fix32ToStr(..) and fix16ToStr(..) methods
* SYSTEM:
- tried to more more compatible with default GCC stdint.h definitions
- added SYS_setVIntPreCallback(..) so you can have your method called at VInt before any internal SGDK stuff are proceed.
- added SYS_isNTSC() and SYS_isPAL() methods for easy system determination.
- minor fix on SP register initialization (preserve value set in vector table)
- added SYS_hardReset() to force hard reset.
* TOOLS:
- added new LZ4W compression (very fast unpacking but average compression level)
- removed RLE, RLE_MAP and UFTC compression (LZ4W performs better in almost all cases).
- removed UnpackEx(..) method (useless now).
- added setRandomSeed(u16 seed) to initialize randomizer.
* VDP:
- renamed WPLAN / WINDOW / VDP_WINDOW --> VDP_PLAN_WINDOW
- renamed APLAN --> VDP_PLAN_A
- renamed BPLAN --> VDP_PLAN_B
- renamed SLIST / VDP_SPRITE_LIST --> VDP_SPRITE_TABLE
- renamed HSCRL / VDP_SCROLL_H --> VDP_HSCROLL_TABLE
- added planWidth / planHeight to replace VDP_getPlanWidth() / VDP_getPlanHeigth() for faster internal SGDK calculations.
- added windowWidth / windowHeight for faster internal SGDK calculations.
- added VDP_setWindowHPos(..) and VDP_setWindowVPos(..) methods to set window positions.
- fixed a bug with VDP_setBPlanAddress(..) method.
* VDP BG/TILE:
- replaced VDP_PLAN_A / VDP_PLAN_B constants by PLAN_A / PLAN_B in some methods.
- some methods now support PLAN_WINDOW parameter.
- added VDP_clearTextAreaBG(..), VDP_clearTextLineBG(..), VDP_clearTextArea(..) methods.
- modified VDP_drawTextBG(..) method.
- others minors changes.
* VDP SPRITE: major rewrite of 'vdp_sprite' unit (require project modifications) !
- replaced SpriteDef structure by VDPSprite structure (fit better hardware structure).
- added dynamic allocation of hardware sprite:
VDP_allocateSprites(..), VDP_releaseSprites(..), VDP_getAvailableSprites()
- VDP_updateSprites(..) can now use DMA queue.
- many others changes.
* XGM driver:
- better handling of main BUS contention with DMA
- added methods to improve BUS contention when using PSG sound in music.
- fixed PCM play status when PCM is used from XGM music.
- minor fix in driver code for better music frame sync.
- better pause/resume support.
- music sync is now handled on 68000 side for more flexibility (adjustable tempo).
* Z80:
- modified writeYM macros
* memory usage optimizations.

SAMPLE:
* Bench: added new sample for general test and benchmarking.
* Sound:
- minors changes about Z80 load information for XGM driver.
* Sprite:
- added basic enemies (no collision yet)
- added basic SFX
- updated to last SGDK
- some refactoring

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

Re: Sega Genesis Dev Kit (SGDK)

Post by cero » Fri May 27, 2016 8:02 pm

The zlib declaration disappeared from tools.h, but not from src? Did you mean to remove it, or did you accidentally remove the header part?

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

Re: Sega Genesis Dev Kit (SGDK)

Post by cero » Fri May 27, 2016 8:44 pm

I reviewed the new commits, and two things poked out:

- the _hexchars should not be a pointer, but a const char []. The inner hex pointer should be const, and then the assignment wouldn't need a cast
- in VDP_updateSprites: "(sizeof(VDPSprite) * num) / 2" should be "(sizeof(VDPSprite) / 2) * num" so the / 2 is optimized out

The struct's size is divisible by 2, so no need to divide at runtime.

Grind
Very interested
Posts: 69
Joined: Fri Jun 13, 2014 1:26 pm
Location: US
Contact:

Re: Sega Genesis Dev Kit (SGDK)

Post by Grind » Sat May 28, 2016 4:08 am

Certainly liking the look of the improved sprite engine!

In my porting over to the new version, stumbled into this:

Code: Select all

/opt/toolchains/gen//m68k-elf/lib/libmd.a(sys_a.o): In function `SYS_hardReset':
(.text+0x1c): undefined reference to `_hard_reset'
collect2: error: ld returned 1 exit status
Makefile:132: recipe for target 'out.elf' failed
Not sure if the root of the issue is me, gendev, or SGDK, but my project doesn't call SYS_hardReset().

EDIT Same thing happens with a hello world program. Maybe a new file was added that contains "_hard_reset" and the gendev makefile needs to be updated (it lists every c file instead of using a wildcard for whatever reason).

EDIT 2 It's a change to sega.s that adds _hard_reset. Just have to copy the new version into any existing projects. Going to make a list of changes for gendev including this and to copy lz4w.jar to $(GENDEV)/bin.

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

Re: Sega Genesis Dev Kit (SGDK)

Post by Stef » Sat May 28, 2016 9:34 am

Cero>Thanks for your reports, the vsprintf(..) method was not wrote by me originally so i never payed attention to that (just changed to const to not eat RAM but using [] has more sense here). Also i believe there is a bug in this method, some the sprintf(..) does not work i expected, i have to check that ... still it's a very useful method :)
I reintroduced zlib declared i accidently removed and about this "sizeof(VDPSprite) * num) / 2", well i believe the compiler does see that "sizeof(VDPSprite)" can be divided by 2 so it optimizes it anyway (not 100% sure though). The thing is that if sizeof(VDPSprite) is odd then the code becomes wrong but i agree that sizeof(VDPSprite) is not odd and cannot be here so it would be better to change it the way you tell ;)
I will push the changes soon.

Edit: I just pushed the changes to github, i won't do a new SGDK release for that as this is only minors changes but at least you can get them ;)

Grind> Oh you're right, everyone already having the sega.s file may experience this problem... I believe that doing a clean rebuild remove the sega.s file as myself i never encountered the issue.

Post Reply