Sega Genesis Dev Kit (SGDK)
Moderator: Stef
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
It will be really great if you can share the fixes you made to get rescomp to compile on linux, i never realized that stricmp was not standard method
Also appack is the aplib packer and i use it to compress resources. Initially i wanted to provide sources for it but i had some troubles to compile it... I will give more time on that next time.
You can find the library and the source here :
http://ibsensoftware.com/download.html
Also appack is the aplib packer and i use it to compress resources. Initially i wanted to provide sources for it but i had some troubles to compile it... I will give more time on that next time.
You can find the library and the source here :
http://ibsensoftware.com/download.html
This patch should allow compiling rescomp in gcc. There might be a better way to detect specifically the gcc compiler instead of just linux in the preprocessor, but this should work.
Code: Select all
Index: inc/tools.h
===================================================================
--- inc/tools.h (revision 176)
+++ inc/tools.h (working copy)
@@ -1,6 +1,11 @@
#ifndef _TOOLS_H_
#define _TOOLS_H_
+#if __linux
+#define stricmp strcasecmp
+#define strnicmp strncasecmp
+#define strupr toupper
+#endif
#define FALSE 0
#define TRUE 1
Makefile for rescomp (from cbp2make):
Code: Select all
#------------------------------------------------------------------------------#
# This makefile was generated by 'cbp2make' tool rev.147 #
#------------------------------------------------------------------------------#
WORKDIR = `pwd`
CC = gcc
CXX = g++
AR = ar
LD = g++
WINDRES = windres
INC =
CFLAGS = -Wall
RESINC =
LIBDIR =
LIB =
LDFLAGS =
INC_DEBUG = $(INC)
CFLAGS_DEBUG = $(CFLAGS) -g
RESINC_DEBUG = $(RESINC)
RCFLAGS_DEBUG = $(RCFLAGS)
LIBDIR_DEBUG = $(LIBDIR)
LIB_DEBUG = $(LIB)
LDFLAGS_DEBUG = $(LDFLAGS)
OBJDIR_DEBUG = out
DEP_DEBUG =
OUT_DEBUG = out/rescomp
INC_RELEASE = $(INC)
CFLAGS_RELEASE = $(CFLAGS) -O2
RESINC_RELEASE = $(RESINC)
RCFLAGS_RELEASE = $(RCFLAGS)
LIBDIR_RELEASE = $(LIBDIR)
LIB_RELEASE = $(LIB)
LDFLAGS_RELEASE = $(LDFLAGS) -s
OBJDIR_RELEASE = out
DEP_RELEASE =
OUT_RELEASE = out/rescomp
OBJ_DEBUG = $(OBJDIR_DEBUG)/src/snd_tools.o $(OBJDIR_DEBUG)/src/bin.o $(OBJDIR_DEBUG)/src/bitmap.o $(OBJDIR_DEBUG)/src/image.o $(OBJDIR_DEBUG)/src/img_tools.o $(OBJDIR_DEBUG)/src/libpng.o $(OBJDIR_DEBUG)/src/map.o $(OBJDIR_DEBUG)/src/palette.o $(OBJDIR_DEBUG)/src/pcm.o $(OBJDIR_DEBUG)/src/rescomp.o $(OBJDIR_DEBUG)/src/spr_tools.o $(OBJDIR_DEBUG)/src/sprite.o $(OBJDIR_DEBUG)/src/tfmmusic.o $(OBJDIR_DEBUG)/src/tile_tools.o $(OBJDIR_DEBUG)/src/tileset.o $(OBJDIR_DEBUG)/src/tools.o $(OBJDIR_DEBUG)/src/vgmmusic.o $(OBJDIR_DEBUG)/src/wav.o
OBJ_RELEASE = $(OBJDIR_RELEASE)/src/snd_tools.o $(OBJDIR_RELEASE)/src/bin.o $(OBJDIR_RELEASE)/src/bitmap.o $(OBJDIR_RELEASE)/src/image.o $(OBJDIR_RELEASE)/src/img_tools.o $(OBJDIR_RELEASE)/src/libpng.o $(OBJDIR_RELEASE)/src/map.o $(OBJDIR_RELEASE)/src/palette.o $(OBJDIR_RELEASE)/src/pcm.o $(OBJDIR_RELEASE)/src/rescomp.o $(OBJDIR_RELEASE)/src/spr_tools.o $(OBJDIR_RELEASE)/src/sprite.o $(OBJDIR_RELEASE)/src/tfmmusic.o $(OBJDIR_RELEASE)/src/tile_tools.o $(OBJDIR_RELEASE)/src/tileset.o $(OBJDIR_RELEASE)/src/tools.o $(OBJDIR_RELEASE)/src/vgmmusic.o $(OBJDIR_RELEASE)/src/wav.o
all: debug release
clean: clean_debug clean_release
before_debug:
test -d out || mkdir -p out
test -d $(OBJDIR_DEBUG)/src || mkdir -p $(OBJDIR_DEBUG)/src
after_debug:
debug: before_debug out_debug after_debug
out_debug: before_debug $(OBJ_DEBUG) $(DEP_DEBUG)
$(LD) $(LIBDIR_DEBUG) -o $(OUT_DEBUG) $(OBJ_DEBUG) $(LDFLAGS_DEBUG) $(LIB_DEBUG)
$(OBJDIR_DEBUG)/src/snd_tools.o: src/snd_tools.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/snd_tools.c -o $(OBJDIR_DEBUG)/src/snd_tools.o
$(OBJDIR_DEBUG)/src/bin.o: src/bin.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/bin.c -o $(OBJDIR_DEBUG)/src/bin.o
$(OBJDIR_DEBUG)/src/bitmap.o: src/bitmap.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/bitmap.c -o $(OBJDIR_DEBUG)/src/bitmap.o
$(OBJDIR_DEBUG)/src/image.o: src/image.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/image.c -o $(OBJDIR_DEBUG)/src/image.o
$(OBJDIR_DEBUG)/src/img_tools.o: src/img_tools.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/img_tools.c -o $(OBJDIR_DEBUG)/src/img_tools.o
$(OBJDIR_DEBUG)/src/libpng.o: src/libpng.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/libpng.c -o $(OBJDIR_DEBUG)/src/libpng.o
$(OBJDIR_DEBUG)/src/map.o: src/map.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/map.c -o $(OBJDIR_DEBUG)/src/map.o
$(OBJDIR_DEBUG)/src/palette.o: src/palette.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/palette.c -o $(OBJDIR_DEBUG)/src/palette.o
$(OBJDIR_DEBUG)/src/pcm.o: src/pcm.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/pcm.c -o $(OBJDIR_DEBUG)/src/pcm.o
$(OBJDIR_DEBUG)/src/rescomp.o: src/rescomp.c
$(CC) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/rescomp.c -o $(OBJDIR_DEBUG)/src/rescomp.o
$(OBJDIR_RELEASE)/src/spr_tools.o: src/spr_tools.c
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/spr_tools.c -o $(OBJDIR_RELEASE)/src/spr_tools.o
$(OBJDIR_RELEASE)/src/sprite.o: src/sprite.c
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/sprite.c -o $(OBJDIR_RELEASE)/src/sprite.o
$(OBJDIR_RELEASE)/src/tfmmusic.o: src/tfmmusic.c
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/tfmmusic.c -o $(OBJDIR_RELEASE)/src/tfmmusic.o
$(OBJDIR_RELEASE)/src/tile_tools.o: src/tile_tools.c
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/tile_tools.c -o $(OBJDIR_RELEASE)/src/tile_tools.o
$(OBJDIR_RELEASE)/src/tileset.o: src/tileset.c
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/tileset.c -o $(OBJDIR_RELEASE)/src/tileset.o
$(OBJDIR_RELEASE)/src/tools.o: src/tools.c
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/tools.c -o $(OBJDIR_RELEASE)/src/tools.o
$(OBJDIR_RELEASE)/src/vgmmusic.o: src/vgmmusic.c
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/vgmmusic.c -o $(OBJDIR_RELEASE)/src/vgmmusic.o
$(OBJDIR_RELEASE)/src/wav.o: src/wav.c
$(CC) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/wav.c -o $(OBJDIR_RELEASE)/src/wav.o
clean_release:
rm -f $(OBJ_RELEASE) $(OUT_RELEASE)
rm -rf out
rm -rf $(OBJDIR_RELEASE)/src
.PHONY: before_debug after_debug clean_debug before_release after_release clean_release
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Thanks for changes and makefile !
I included the changes for the methods (i did my own strupper method using toupper()). For the makefile, as i plan to eventually add some files in future i will try to get a generic one (don't need to add file in makefile each time). Anyway compilation is pretty easy, just compile all C files and link them, done
I included the changes for the methods (i did my own strupper method using toupper()). For the makefile, as i plan to eventually add some files in future i will try to get a generic one (don't need to add file in makefile each time). Anyway compilation is pretty easy, just compile all C files and link them, done
Awesome! I've managed to compile apLib into appack and include that into the linux build environment, so I'm further along. However, when I try to compile any of the samples, I run into some issues. For instance, the joytest example give me an error:
If I look at the definition of TileSet, this does not seem to have palette as a member.
Code: Select all
src/main.c: In function ‘main’:
src/main.c:16:34: error: ‘TileSet’ has no member named ‘palette’
Code: Select all
typedef struct
{
u16 compression;
u16 numTile;
u32 *tiles;
} TileSet;
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Don't worry, it just looks like some of the sample are outdated ! Unbelievable i did not noticed it before. Actually for some reason my "rebuild" command did not worked as expected and so i never saw the problem...
Glad you got aplib to compile ! Though i am using a custom aplib now i am thinking about it. It just remove the header aplib identifier to gain some bytes. I guess it's easy to modify it for that, this modification was done by r57shell i believe.
Glad you got aplib to compile ! Though i am using a custom aplib now i am thinking about it. It just remove the header aplib identifier to gain some bytes. I guess it's easy to modify it for that, this modification was done by r57shell i believe.
Stef wrote: Glad you got aplib to compile ! Though i am using a custom aplib now i am thinking about it. It just remove the header aplib identifier to gain some bytes. I guess it's easy to modify it for that, this modification was done by r57shell i believe.
Ahh, so that's probably why the graphics look corrupted then. Do you have a patch against the aplib I can apply?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Unfortunately i just got the exe file from this topic :
viewtopic.php?t=703&postdays=0&postorder=asc&start=15
I tried to look into the sources file of aplib and it looks like that making some changes in the aPsafe_pack method (the 32 bit or 64 bit version depending the one you use) should do the work. Basically you have to remove all the header useless information but i don't know if that is as easy.
Also there is still some aprt i don't understand, it looks like the base aP_pack(..) method is not in the source (i can't find it at least).
Maybe the best easiest way would be to ask r57shell for modified sources.
I will include them in the next SGDK version to avoid any problem, something you can do is to replace my unpack method in tools_a.s method with the usual aplib 68k unpack code in the meantime.
viewtopic.php?t=703&postdays=0&postorder=asc&start=15
I tried to look into the sources file of aplib and it looks like that making some changes in the aPsafe_pack method (the 32 bit or 64 bit version depending the one you use) should do the work. Basically you have to remove all the header useless information but i don't know if that is as easy.
Also there is still some aprt i don't understand, it looks like the base aP_pack(..) method is not in the source (i can't find it at least).
Maybe the best easiest way would be to ask r57shell for modified sources.
I will include them in the next SGDK version to avoid any problem, something you can do is to replace my unpack method in tools_a.s method with the usual aplib 68k unpack code in the meantime.