Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

Yuge wrote: Yeah, I don't use no Code::blocks nor Eclipse IDE's. I was looking for more general solution.
fun...it's because I was looking for a 'general' solution than I tried (with success) to use Eclipse...
I thought it was a very common IDE, more than PN(?)
Yuge
Newbie
Posts: 9
Joined: Sat Jul 19, 2008 7:53 pm
Location: Latvia

Post by Yuge »

KanedaFr wrote:
Yuge wrote: Yeah, I don't use no Code::blocks nor Eclipse IDE's. I was looking for more general solution.
fun...it's because I was looking for a 'general' solution than I tried (with success) to use Eclipse...
I thought it was a very common IDE, more than PN(?)
By the term "general" I meant something more IDE independent. Eclipse is a good IDE (made some PHP development with it), a little too heavy and has too much features (probably a good thing :D).
I'm looking for (MS Visual Studio) auto completion and xml code documentation, that would be some neat features, if we could agree on one widely used IDE.

I wonder if somebody could describe how is debugging possible on emulators? (Kaneda, where is part 3? :roll: )
KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

NM= $(GDK)bin/nm
NM2WCH= $(GDK)bin/nm2wch

rom.bin: rom.out
$(NM) -n -S -t x rom.out >rom.nm
$(NM2WCH) rom.nm rom.wch
$(OBJC) --pad-to 131072 -O binary rom.out rom.bin

:)

then in KMod, check Options>Debug... Auto load watchers & structures
nm2wch create a watcher file from variables in your code

you're only problem will be to make >rom.nm to work
sh or cmd.exe ? ;)
zhengyaxin_8bit
Very interested
Posts: 101
Joined: Thu Sep 04, 2008 2:57 am
Location: China

Post by zhengyaxin_8bit »

Why I can't find out some key like"fix16,u8",by press search button[/img]
KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

I don't know why but, trying to (re)use GenDevKit, I now have a
'pearl' not recognized
and talk about not being a batch command nor an executable

any idea ? I'm under XP, same problem call direclty gcc with file and params

ps: and don't forget I updated part 3 and part 4 on my eclipse tut!
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

KanedaFr wrote:I don't know why but, trying to (re)use GenDevKit, I now have a
'pearl' not recognized
and talk about not being a batch command nor an executable

any idea ? I'm under XP, same problem call direclty gcc with file and params

ps: and don't forget I updated part 3 and part 4 on my eclipse tut!
sounds like a parameter not correctly spelled. Did you tried GCC alone ? then adding parameter one by one ?
TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX »

'pearl' not recognized
Is it 'pearl' or 'perl'?
KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

ah ah! sorry for the mistake, it's perl, the language
it's why I don't understand.....
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

Making genesis dev in perl ? wow ! nice challenge ;)
KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

ok..I figured it out....
I must say having AVR, Java, MS & Genny dev kit on the same computer IS NOT a good idea :D

Stef, other problem I found is make doesn't like full path (since the ':' in c:/projectpath/file.. is seen as a dependency)....
I lost my evening on this one yesterday !!!! ;)

hop, back to coding (hard time switching from my devkit to this better one!)
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

KanedaFr wrote:ok..I figured it out....
I must say having AVR, Java, MS & Genny dev kit on the same computer IS NOT a good idea :D

Stef, other problem I found is make doesn't like full path (since the ':' in c:/projectpath/file.. is seen as a dependency)....
I lost my evening on this one yesterday !!!! ;)

hop, back to coding (hard time switching from my devkit to this better one!)
Yeah GCC is very picky about what you installed on your system ;)
About the absolute path, i'm using environnement variable as it's also more convenient. How did you fixed it ?

Glad to see you use the devkit by the way, the next version will add some news Z80 drivers and some others various stuff ^^
KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

[quote="Stef]
Yeah GCC is very picky about what you installed on your system ;)
About the absolute path, i'm using environnement variable as it's also more convenient. How did you fixed it ?
[/quote]

relative path ;)
../../ ;)

Glad to see you use the devkit by the way, the next version will add some news Z80 drivers and some others various stuff ^^
I use it because it's a more advanced one...

It would be could to not include the driver on a C file...and hardcoded their size...
I plan to update my MVST and I would like to easily update it.

oh, and also put the logo call out of the start().
I am not again it but I assume a lot of people desactive it (like I did myself) so call Logo_init() from our main is better than use a defined var.

Please please, don't change functions' names! I'm having a hard time learning the current ones!! :)
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

It would be could to not include the driver on a C file...and hardcoded their size...
I plan to update my MVST and I would like to easily update it.
Afaik the drivers aren't included as C files, only the MVST driver is in this format because i don't have the original source :-/
Drivers are provided in .s80 file, then the makefile automatically generate C and H files ;)
oh, and also put the logo call out of the start().
I am not again it but I assume a lot of people desactive it (like I did myself) so call Logo_init() from our main is better than use a defined var.
The logo is there because it's sort of "devkit" signature, as these "powered by" logo ;)
As i know it can be annoying i added a quick way of desactivating it :p
Please please, don't change functions' names! I'm having a hard time learning the current ones!! :)
I'm trying to avoid that as much i can but it can happen sometime :-/
Generally new names are better ;)
Last edited by Stef on Thu Feb 19, 2009 10:39 pm, edited 1 time in total.
Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

I made a makefile for the functions, and made a library out of it. That makes it much easier to handle.

Code: Select all

CC = $(GENDEV)/m68k/bin/gcc
AR = $(GENDEV)/m68k/bin/ar
RANLIB = $(GENDEV)/m68k/bin/ranlib
RM = rm -f
OBJC = $(GENDEV)/m68k/bin/objcopy
ASMZ80 = $(GENDEV)/bin/zasm
BINTOC = $(GENDEV)/bin/bin2c

#OPTION= -Dnologo_

libmd.a_OBJS = base.o tools.o vdp.o font.o vdp_bg.o vdp_dma.o \
	vdp_pal.o vdp_spr.o vdp_tile.o bitmap.o bitmapx.o z80_ctrl.o \
	tab_sin.o tab_log2.o tab_pow2.o maths.o maths3D.o ym2612.o \
	psg.o audio.o joy.o timer.o logo_lib.o z80_drv1.o z80_drv2.o \
	z80_mvst.o

INCS = -I./include
FLAGS = $(OPTION) -m68000 -Wall -O1 -c -fomit-frame-pointer $(INCS)
FLAGSZ80 = -vb2

all: z80_drv1.o80 z80_drv1.c z80_drv2.o80 z80_drv2.c md.o $(libmd.a_OBJS) libmd.a

%.a: $(libmd.a_OBJS)
	$(RM) $@
	$(AR) cru $@ $($@_OBJS)
	$(RANLIB) $@

%.o80: %.s80
	$(ASMZ80) $(FLAGSZ80) -o $@ -i $<

%.c: %.o80
	$(BINTOC) $<

%.o: %.c
	$(CC) $(FLAGS) -c $< -o $@

%.o: %.s
	$(CC) $(FLAGS) -c $< -o $@

clean:
	$(RM) -rf *.o *.a *.o80 *.log
	$(RM) -f z80_drv1.c z80_drv1.h z80_drv2.c z80_drv2.h

install: all
	mkdir -p $(GENDEV)/m68k/sdk
	mkdir -p $(GENDEV)/m68k/sdk/include
	mkdir -p $(GENDEV)/m68k/sdk/lib
	cp include/*.h $(GENDEV)/m68k/sdk/include
	cp libmd.a $(GENDEV)/m68k/sdk/lib
	cp md.o $(GENDEV)/m68k/sdk/lib
Then you get a simple makefile for 68K projects. Here's the one I made for the particle example:

Code: Select all

CC = $(GENDEV)/m68k/bin/gcc
RM = rm -f
OBJC = $(GENDEV)/m68k/bin/objcopy
ASMZ80 = $(GENDEV)/bin/zasm
BINTOC = $(GENDEV)/bin/bin2c

#OPTION= -Dnologo_

OBJS = main.o tranceS.o vangelisS.o

INCS = -I$(GENDEV)/m68k/include -I$(GENDEV)/m68k/sdk/include -I.
FLAGS = $(OPTION) -m68000 -Wall -O1 -c -fomit-frame-pointer $(INCS)
FLAGSZ80 = -vb2
LIBS = -L$(GENDEV)/m68k/lib -L$(GENDEV)/m68k/sdk/lib -lmd -lgcc

all: rom.bin

rom.bin: rom.out
	$(OBJC) --pad-to 3145728 -O binary rom.out rom.bin

rom.out: $(OBJS)
	$(CC) -T $(GENDEV)/m68k/lib/md.ld -nostdlib $(GENDEV)/m68k/sdk/lib/md.o $(OBJS) $(LIBS) -o rom.out

%.o80: %.s80
	$(ASMZ80) $(FLAGSZ80) -o$@ $<

%.c: %.o80
	$(BINTOC) $<

%.o: %.c
	$(CC) $(FLAGS) -c $< -o $@

%.o: %.s
	$(CC) $(FLAGS) -c $< -o $@

clean:
	$(RM) -rf *.o *.a *.o80 *.out *.bin
KanedaFr
Administrateur
Posts: 1154
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr »

Chilly Willy wrote:I made a makefile for the functions, and made a library out of it. That makes it much easier to handle.
COOOOL!! I was about to make it ;)

I just need to confirm something...I know it could be some kind of newbie question, but I never worked with my own lib :
with a lib, will the linker include ONLY used functions or the full lib ?
Stef wrote: only the MVST driver is in this format because i don't have the original source
Like everything I made, the source is available :) Look http://gendev.spritesmind.net/page-mvst.html
Stef wrote: The logo is there because it's sort of "devkit" signature
I would be ok if it was a "Powered by GenesisDevKit" but flemteam means nothing...
When I mean "nothing", I mean people won't find genesis dev searching flemteam on google.
I have no problem using the powered by MVST logo when I used Pascal version since I knew MVST search will result in Pascal's or Ivan's website.

Else we have to make a flemteam website.
I could make a subdomain with last version and demos of everyone but it won't be fair : flemteam isn't spritesmind.

Sorry it's my "genesis dev for everyone" syndrom :)

ps: for the people who could think that : no, I don't mean I want the Spritesmind logo !
Post Reply