Giter Site home page Giter Site logo

stephane-d / sgdk Goto Github PK

View Code? Open in Web Editor NEW
1.7K 1.7K 180.0 181.35 MB

SGDK - A free and open development kit for the Sega Mega Drive

Home Page: https://www.patreon.com/SGDK

License: MIT License

C 62.51% Assembly 3.67% Batchfile 0.08% Java 29.77% PowerShell 0.07% Dockerfile 0.08% ReScript 0.01% Makefile 0.04% CMake 0.08% C++ 3.70%
68000 assembly c game-development gcc java m68k m68k-assembly m68k-elf-gcc mega-drive megadrive motorola-68000 programming retrodev sdk sega sega-genesis sega-megadrive sgdk sgdk-library

sgdk's Issues

Error "make: *** No rule to make target `C:/sega/sdk/lib/libmd.a', needed by `out/rom.out'

What steps will reproduce the problem?
1. Configure environment 
(https://code.google.com/p/sgdk/wiki/UseSGDKWithEclipse)
2. Checkout SDK from trunk.
3. Create "Hello world" example and try to build.

What is the expected output? What do you see instead?
Expected result: Application is compiled.
Actual result: Error "make: *** No rule to make target 
`C:/sega/sdk/lib/libmd.a', needed by `out/rom.out'.  Stop."

What version of the product are you using? On what operating system?
SDK from trunk

Original issue reported on code.google.com by [email protected] on 26 Apr 2013 at 10:54

RGB24_TO_VDPCOLOR is BGR

The RGB24_TO_VDPCOLOR macro is BGR, nor RGB.

VDP_setPaletteColor(63, RGB24_TO_VDPCOLOR(0xff0000));

sets the color to blue, even though it should be red.

wavtoraw crashes

The attached file crashes wavtoraw. It's straight exported from Audacity at 16Khz and 8-bit unsigned.

Valgrind log:

==4496== Command: /tmp/wavtoraw /tmp/bug.wav bug.tmp 16000
==4496==
==4496== Conditional jump or move depends on uninitialised value(s)
==4496==    at 0x400B1B: main (wavtoraw.c:68)
==4496==
==4496== Conditional jump or move depends on uninitialised value(s)
==4496==    at 0x400C36: main (wavtoraw.c:93)
==4496==
==4496== Conditional jump or move depends on uninitialised value(s)
==4496==    at 0x400C82: main (wavtoraw.c:99)
==4496==
==4496== Conditional jump or move depends on uninitialised value(s)
==4496==    at 0x400CB0: main (wavtoraw.c:105)
==4496==
==4496== Conditional jump or move depends on uninitialised value(s)
==4496==    at 0x400D70: main (wavtoraw.c:99)
==4496==
==4496== Use of uninitialised value of size 8
==4496==    at 0x400DAD: main (wavtoraw.c:129)
==4496==

The line numbers are offset by 2, because I had to add a #define _GNU_SOURCE on top, to fix a warning about round().

The file is named PDF because github didn't allow uploading wavs, just rename to wav.

bug.pdf

Makefile supporting variable overriding for tools.

Use:

SHELL?=$(BIN)/sh
RM?= $(BIN)/rm
AR?= $(BIN)/ar
CC?= $(BIN)/gcc
LD?= $(BIN)/ld 

Instead of:

SHELL=$(BIN)/sh
RM= $(BIN)/rm
AR= $(BIN)/ar
CC= $(BIN)/gcc
LD= $(BIN)/ld

Original issue reported on code.google.com by Stephane.D on 31 Jul 2013 at 7:49

4PCM_ENV driver crackles

The attached wav file plays badly on the 4PCM_ENV driver, it crackles. The format is fine, as it's already 8-bit mono 16kHz, and it sounds perfect when player on a computer.

It plays perfect in both mplayer and aplay, the latter confirms there is no advanced filtering in play. So either there is an issue in the 4PCM driver's mixing or interpolating algorithms, or in wavtoraw.

bug.pdf

Add instructions for using SGDK with QtCreator

Hi,

I've just written a guide on how to use SGDK with QtCreator (my IDE of choice), 
with images.

It's available at 
https://github.com/AbigailBuccaneer/sgdk/wiki/sgdk-with-qtcreator - it's public 
domain, so feel free to copy it over to this wiki, or do whatever you want with 
it.

Thanks for the tools :)
--Abigail

Original issue reported on code.google.com by [email protected] on 9 Jan 2015 at 2:45

VRam copy DMA locks up on real hardware

Try to do a VRAM Copy DMA operation actually fails when done on the real 
hardware.

Original issue reported on code.google.com by Stephane.D on 9 May 2014 at 6:35

SR set in SGDK

Add SR control in SGDK.
Should be already done but verify it.


Original issue reported on code.google.com by Stephane.D on 25 May 2012 at 10:00

Feature request: add JASC-PAL palette support to rescomp

Here is the format description :

.pal Paint Shop Pro colour palette file:

Contains the colour palette table saved from a 16 or 256 colour image. It can 
be loaded for another image and this provides a means of copying colour 
palettes from one image to another.

These files are text editable. The format of the file is as follows:

- The first line contains the header "JASC-PAL" (without the quotes).
- The second line contains the palette file version. For example "0100" 
(without the quotes)
- The third line contains the number of colours, either 16 or 256.
- Subsequent lines contain the Red, Green and Blue components of each palette 
entry, with a space between each of the Red, Green and Blue numbers. These 
numbers are in decimal, so each attribute should be in the range 0 to 255.

Original issue reported on code.google.com by Stephane.D on 16 Jun 2014 at 8:54

Error with fading method

Using fading method on palette != PAL0 result in some unexpected results.
For instance VDP_fadePalOut(PAL1, ...) doesn't work correctly.

Original issue reported on code.google.com by Stephane.D on 31 May 2013 at 8:50

Rescomp: RLE compression issue

The RLE compression return corrupted image sometime.


Original issue reported on code.google.com by Stephane.D on 2 Jun 2014 at 3:35

Random seed initialization.

Just add HV counter in the seed number, take care of not having any sync before 
it.

Original issue reported on code.google.com by Stephane.D on 10 Jul 2013 at 9:25

Move QtCreator info to local GitHub wiki

Hi. A while back (before SGDK moved from Google Code to GitHub) I wrote the instructions for using QtCreator with SGDK, and put them in the wiki of my own GitHub exported version of SGDK.

Now SGDK's officially on GitHub, but the QtCreator pages are still on my wiki. I don't have any plans to maintain them so it makes no sense for them to be on my version of the SGDK repository (which I was about to delete, before I remembered the QtCreator docs).

I've just updated my version's wiki's master branch to be ahead of yours and merge in the QtCreator info.

Please merge https://github.com/AbigailBuccaneer/sgdk.wiki.git into https://github.com/Stephane-D/SGDK.wiki.git. It should be a simple fast-forward merge.

Basic Tutorial outdated.

Update tutorial to reflct last SGDK version.

Original issue reported on code.google.com by Stephane.D on 30 May 2012 at 10:31

Sprite "rolls" from posx 384 back to 184, but from posy 1016 back to 0.

I'm trying to make a simple "Snake" game, where I control a sprite which is represented by a block.

If I'm going horizontally right- then I increment the sprite.posx by + 8. It will reach 384 (sometimes only 376 if I frame step slowly) but the next position is 128.

It does not do this vertically, instead when doing sprite.posy + 8, it will reach 1016 and reset to 0.

Is the sprite area not defined to be 512x512 starting at 128,128?

I've got these values using GensKmod, but I get the same behaviour in Fusion.

My code looks like this:


    while(1)
    {

    if (count > 5) {
        switch (steer) { // I change steer elsewhere
        case up:
            snakeSprite->posy = snakeSprite->posy - 8;
            direction = up;
            break;
        case down:
            snakeSprite->posy = snakeSprite->posy + 8;
            direction = down;
            break;
        case left:
            snakeSprite->posx = snakeSprite->posx - 8;
            direction = left;
            break;
        case right:
            snakeSprite->posx = snakeSprite->posx + 8;
            direction = right;
            break;
        }
        count = 0;
    }
    else count++;

        VDP_setSpriteP(0, &snakeSprite);
        VDP_updateSprites();

        VDP_waitVSync();

    }

Any advice you could give would be appreciated.

VDP_loadBMPTileData broken.

The moon display tutorial does not work anymore because of the 
VDP_loadBMPTileData which seems to be broken when tile index destination is not 
aligned on 32.
Also check the default plan initialization...

Original issue reported on code.google.com by Stephane.D on 30 May 2012 at 9:39

Duplicated video output

What steps will reproduce the problem?
1. Configure Eclipse with https://code.google.com/p/sgdk/wiki/UseSGDKWithEclipse
2. Compile any example from "sample" directory.

What is the expected output? What do you see instead?
Expected result: Image isn't duplicated.
Actual result: Image is duplicated.

Please see attachment (duplicated_image.PNG).

Original issue reported on code.google.com by [email protected] on 26 Apr 2013 at 11:36

Attachments:

tools/xgmtool/inc/gd3.h missing

Hello,

Was building with gendev and ran into this.

In file included from src/xgmtool.c:8:0:
src/../inc/vgm.h:6:17: fatal error: gd3.h: No such file or directory
 #include "gd3.h"
                 ^

The code blocks project file has a reference to this header, so just forgot to commit it I think.

Move VISIBILITY_ALWAYS_xxx definition in sprite_eng.h file

It can be useful to know the visibility state of a sprite so move that :

define VISIBILITY_ALWAYS_FLAG 0x40000000

define VISIBILITY_ALWAYS_ON (VISIBILITY_ALWAYS_FLAG | 0x3FFFFFFF)

define VISIBILITY_ALWAYS_OFF (VISIBILITY_ALWAYS_FLAG | 0x00000000)

in sprite_eng.h file :)

Redefinition of size_t causes compilation error.

What steps will reproduce the problem?
1. Build sgdk file that includes both "genesis.h" and <stdio.h>
2.
3.

What is the expected output? 

Compilation should be successful.

What do you see instead?

Compilation fails with the following:

"""
/opt/toolchains/gen/m68k-elf/lib/gcc/m68k-elf/4.5.2/include/stddef.h:211:23: 
error: conflicting types for ‘size_t’
/opt/toolchains/gen/m68k-elf/include/types.h:160:22: note: previous declaration 
of ‘size_t’ was here
"""

The file stddef.h checks for the prior definition of __size_t which is not 
defined in types.h.  Defining this fixes the issue.  Here is the patch:

{{{
--- types.h.orig        2012-12-12 16:36:39.734989382 -0500
+++ types.h     2012-12-12 16:36:48.755034106 -0500
@@ -158,7 +158,7 @@

 // used for memcpy and memset ISO C method
 typedef unsigned int size_t;
-
+#define __size_t

 #define FASTCALL
}}} 



What version of the product are you using? On what operating system?

Ubuntu 12.10

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 12 Dec 2012 at 10:31

Wrong return value in readJoypadX-Y functions

/**
 ...
 * A light gun returns the unsigned screen X coordinate. This is not calibrated;<br>
 * Calibration is left to the game to handle. The value is -1 if the gun is not<br>
 * pointed at the screen, or the screen is too dim to detect.<br>
 ...
 */

u16  JOY_readJoypadX(u16 joy);
 &
u16  JOY_readJoypadY(u16 joy);


Wrong return value, should be s16

Original issue reported on code.google.com by [email protected] on 12 Oct 2014 at 3:59

Big sprites do not display correctly

Hi there.

I'm trying to insert a sprite that is 13x13 tiles big. Data seems to be OK, but as soon as an animation is changed, the sprite partially blinks and also displays some bad tiles.

Is there something important that I am missing or is it really a bug?
By the way, I made some slides about basic function usage etc and could send these to you.

PS: did not find your e-mail therefore I am sending this message.

Declaring lenght array from a char var

It's probably a C lenguage problem, but i write it for if its not.


unsigned char lenght = 25;
unsigned char buffer[lenght];

Compies but show's illegal instruction on screen.

Original issue reported on code.google.com by [email protected] on 3 Oct 2012 at 9:41

SGDK causes conflict with gcc stdint.h

I usually use data types provided by stdint.h, such as uint16_t. But including this file on projects using also SGDK, causes type redefinition problems:

In file included from /opt/toolchains/gen//m68k-elf/include/genesis.h:7:0,
                 from main.c:8:
/opt/toolchains/gen//m68k-elf/include/types.h:142:21: error: conflicting types for 's8'
 #define int8_t      s8
                     ^
/opt/toolchains/gen//m68k-elf/include/types.h:79:14: note: previous declaration of 's8' was here
 typedef char s8;
              ^
Makefile:148: recipe for target 'main.o' failed
make: *** [main.o] Error 1

I think conflicting with standard header files should be avoided. Could this be fixed?

VDP_drawImageEx() - SetPalette() after SetMap() produces an incorrect flashing with old colours

What steps will reproduce the problem?
1.VDP_drawImageEx() -> using Load Palette true


What is the expected output? What do you see instead?
If you load an image it flashes with the old palette during some milliseconds. 
Instead of show the correct palette.


What version of the product are you using? On what operating system?
SGDK - Last Version


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 19 Aug 2014 at 11:46

Function PSG_setNoise missing

Not really a issue but an featurerequest for the sake of completness.
the psg-part is missing a function for controlling the noisechannel.
something like the following should work (untested)

void PSG_setNoise(u8 type,u8 frequency)
{
vu8 *psg;
psg = (u8 *) PSG_PORT;
*psg = 0xE0 | ((type & 1) << 2) | (frequency & 0x3);
}

Original issue reported on code.google.com by [email protected] on 30 Aug 2012 at 6:21

ResComp Crash

When i was compiling a PNG file (with an invalid palette between 2 tiles) as a SPRITE ResComp keep crashing, after a quick look up here's what i found:

Sprite.c in the Execute function :

sprDef = getSpriteDefinition(data, wt, ht, wf, hf, time, collid);  (return null due to invalid palette in getTile)

removeEmptyFrame(sprDef);

if sprDef is null removeEmptyFrame access member of sprDef crashing ResComp.

Undefined reference to "registerState"

What steps will reproduce the problem?
1. Checkout the repo (r96);
2. Try to compile with Eclipse CDT;

First error will be about "libmd.a", which can be fixed by copying it to ./lib 
dir.
Second will be about:
"out/sega.o: In function `registersDump':
(.text+0x2a4): undefined reference to `registerState'".

How to fix that?

Original issue reported on code.google.com by [email protected] on 8 Jan 2014 at 2:14

Move project to Github

Maybe it will be better to move project on Github?

Github community could be a little bit active. :)

Original issue reported on code.google.com by [email protected] on 23 Jan 2015 at 12:46

TFM Z80 driver issues.

- Should provide a stop command (just by unloading the driver).
- Fix multiple play operation (clear Z80 ram before loading params and driver).

Original issue reported on code.google.com by Stephane.D on 25 Jun 2013 at 1:40

strcmp() return error

Should return s16 instead u16

From

http://code.google.com/p/sgdk/source/diff?spec=svn171&r=171&format=side&path=/tr
unk/inc/string.h

42  u16 strcmp(const char *str1, const char *str2);

Also in string.c

Original issue reported on code.google.com by [email protected] on 14 Mar 2014 at 1:21

Split SPR_setAttribut() / SPR_setPosition() into more specific functions

Because you sometimes only want to change HFLIP, VFLIP,.... should be interesting create an especific funcion for each task, in addition to SPR_setAttribut()

An example could be:

void SPR_setHFlip( Sprite *sprite, u8 HFlip )
{
if( HFlip )
{
sprite->attribut |= ( 1<<11 );
}
else
{
sprite->attribut &= ~( 1<<11 );
}
}

Others interesting functions:
SPR_setVFlip
SPR_setPalette
SPR_setPriority

The same with SPR_setPosition...
SPR_setPositionX
SPR_setPositionY
Should be created in order to update only one axis.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.