Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

Moon-Watcher
Very interested
Posts: 117
Joined: Sun Jan 02, 2011 9:14 pm
Contact:

Post by Moon-Watcher » Wed Aug 24, 2011 6:40 pm

A new version is always welcome, thanks!
I updated it but I have this error when compiling:

Code: Select all

-------------- Build: default in abbaye ---------------

Using makefile: C:\MDDev\makefile.gen
make: *** [res/classic.asm] Error 53
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
I've noticed that happens generating .o resources at res folder.

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

Post by Stef » Wed Aug 24, 2011 7:30 pm

The error message isn't really revelating anything here. Did you get that error message from Code::Blocks ?
If you're using Code::Blocks, you should set Compiler Logging to "Full Command Line" in the Compiler and debugger settings (be sure you're on the Sega Genesis compiler settings then go to the tab "Others Settings").

As soon this is done, try to compile again your project and report the error message you obtain in the "Build Log" windows.

Moon-Watcher
Very interested
Posts: 117
Joined: Sun Jan 02, 2011 9:14 pm
Contact:

Post by Moon-Watcher » Wed Aug 24, 2011 8:33 pm

Stef wrote:The error message isn't really revelating anything here. Did you get that error message from Code::Blocks ?
If you're using Code::Blocks, you should set Compiler Logging to "Full Command Line" in the Compiler and debugger settings (be sure you're on the Sega Genesis compiler settings then go to the tab "Others Settings").

As soon this is done, try to compile again your project and report the error message you obtain in the "Build Log" windows.
Thank for your help, Stef. It returns:

Code: Select all

-------------- Build: default in abbey ---------------

Running command: make.exe -f C:\MDDev\makefile.gen
c:/MDDev/bin/genres res/abbayemap.rc res/abbayemap.asm
make: *** [res/abbayemap.asm] Error 53
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
So I executed genres.exe. Seem it needs MSVCR100.dll file, so I placed it at bin directory and... worked like charm

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

Post by Stef » Wed Aug 24, 2011 8:54 pm

Hmm ok, probably needs to be reported at Kaneda as he's the author of Genres tool :)

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

Post by KanedaFr » Thu Aug 25, 2011 1:17 am

sh$$$$ microsoft....
it's why I hate it...always a dll missing :(

sorry about that :(

Zontar
Very interested
Posts: 55
Joined: Fri Oct 21, 2011 8:58 pm

Post by Zontar » Fri Oct 21, 2011 9:07 pm

Chilly Willy wrote:My own makefile that turns the mini devkit files into a lib looks like this

Code: Select all

CC = m68k-elf-gcc
AR = m68k-elf-ar
RANLIB = m68k-elf-ranlib
OBJC = m68k-elf-objcopy
RM = rm -f
ASMZ80 = zasm
BINTOC = 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
	cp include/*.h $(GENDEV)/include
	cp libmd.a $(GENDEV)/lib
	cp md.o $(GENDEV)/lib
That assumes GENDEV and the PATH environment vars set as explained in my toolchain thread.

Done that way, you would link md.o first, then the object files for the program, then the libs (including libmd).

bintoc is made by compiling the bintoc source from the devkit and coying the executable to the toolchain binary directory. Zasm is one of a couple Z80 compilers that work fairly well, the other being sjasmplus.

I currently use zasm 3.0.18... the current is 3.0.20. I need to update or move to sjasmplus sometime... :)
Edit: Okay, I realized that it couldn't find the files it was trying to compile, but my next problem is that i appear to be missing a lot of the .o files listed in the Makefile. Are those already in the .a files under the lib/ directory?
Last edited by Zontar on Fri Oct 21, 2011 9:16 pm, edited 1 time in total.

Zontar
Very interested
Posts: 55
Joined: Fri Oct 21, 2011 8:58 pm

Post by Zontar » Fri Oct 21, 2011 9:11 pm

I'm also using sjasm...will there be any changes needed to the Z80 portion?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Oct 21, 2011 9:25 pm

The .o files are made by the compiler from the appropriate .c files using the makefile. As long as you put together the toolchain as explained in the thread on that AND have done the exports mentioned, there shouldn't be any trouble other than convert from zasm to sjasm.

As for that, you might need to change a couple items, but I can't say what as I haven't done it myself. Just look at any errors sjasm gives and correct them. It's pretty straightforward.

Zontar
Very interested
Posts: 55
Joined: Fri Oct 21, 2011 8:58 pm

Post by Zontar » Fri Oct 21, 2011 9:54 pm

Chilly Willy wrote:The .o files are made by the compiler from the appropriate .c files using the makefile. As long as you put together the toolchain as explained in the thread on that AND have done the exports mentioned, there shouldn't be any trouble other than convert from zasm to sjasm.

As for that, you might need to change a couple items, but I can't say what as I haven't done it myself. Just look at any errors sjasm gives and correct them. It's pretty straightforward.
Okay then, I got sjasm to work, however, md.o appears not be generating. I get this upon running make:
zontar@BPC-V-L:~/Programs/GenDev/qikexample/src$ make
sjasm z80_drv1.s80
SjASM Z80 Assembler v0.39g6 - www.xl2s.tk
Pass 1 complete (0 errors)
Pass 2 complete
Errors: 0
bintoc z80_drv1.o80
sjasm z80_drv2.s80
SjASM Z80 Assembler v0.39g6 - www.xl2s.tk
Pass 1 complete (0 errors)
Pass 2 complete
Errors: 0
bintoc z80_drv2.o80
make: *** No rule to make target `md.o', needed by `all'. Stop.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Oct 22, 2011 8:02 pm

Sorry, that's because I renamed sega.s into md.s. I felt sega.s was not quite descriptive enough since there are many sega consoles and boards.

Zontar
Very interested
Posts: 55
Joined: Fri Oct 21, 2011 8:58 pm

Post by Zontar » Sun Oct 23, 2011 12:05 am

Chilly Willy wrote:Sorry, that's because I renamed sega.s into md.s. I felt sega.s was not quite descriptive enough since there are many sega consoles and boards.
Many thanks. :D I got it.

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

Post by Mixail » Wed Dec 07, 2011 4:25 pm

please, give me MakeFile for SGDK 0.9
I use it.

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

Post by Stef » Wed Dec 07, 2011 10:03 pm

Mixail wrote:please, give me MakeFile for SGDK 0.9
I use it.
Why you don't use directly the included makefile ?

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

Post by Mixail » Thu Dec 08, 2011 7:55 am

What files? i don't have it.
May MakeFile:

Code: Select all

GDK= ../../
CC= $(GDK)bin/gcc
OBJC= $(GDK)bin/objcopy
ASMZ80= $(GDK)bin/asmz80
BINTOC= $(GDK)bin/bintoc
NM= $(GDK)bin/nm
NM2WCH= $(GDK)bin/nm2wch
OUTPUT= Game
RESOL=bin


SRC_C= $(wildcard *.c)
SRC_S= $(wildcard *.s)
SRC_SZ80= $(wildcard *.s80)


OBJ= $(SRC_SZ80:.s80=.o)
OBJ+= $(SRC_C:.c=.o)
OBJ+= $(SRC_S:.s=.o)

LINKOBJ= $(GDK)lib/sega.o \
        $(GDK)lib/base.o \
        $(GDK)lib/tools.o \
        $(GDK)lib/vdp.o \
        $(GDK)lib/font.o \
        $(GDK)lib/vdp_bg.o \
        $(GDK)lib/vdp_dma.o \
        $(GDK)lib/vdp_pal.o \
        $(GDK)lib/vdp_spr.o \
        $(GDK)lib/vdp_tile.o \
        $(GDK)lib/bitmap.o \
        $(GDK)lib/z80_ctrl.o \
        $(GDK)lib/psg.o \
        $(GDK)lib/joy.o \
        $(GDK)lib/timer.o \
        $(OBJ)

INCS= -I$(GDK)include
FLAGS= $(OPTION) -m68000 -Wall -O1 -fomit-frame-pointer $(INCS)
FLAGSZ80= -c -i -x1 -x2 -x3 -z -lnul

all: $(OUTPUT).$(RESOL)
		

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

$(OUTPUT).out: $(OBJ)
	$(CC) -T $(GDK)bin/md.ld -nostdlib $(LINKOBJ) $(GDK)bin/libgcc.a -o $(OUTPUT).out


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

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

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

%.o: %.s
	$(CC) $(FLAGS) -c $< -o $@
	
clean: 
	$(RM) *.o
	
	$(RM) *.out
	$(RM) *.wch
	$(RM) *.nm

But it does not work on SGDK 0.9

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

Post by Mixail » Fri Dec 09, 2011 11:53 am

Mixail wrote:please, give me MakeFile for SGDK 0.9
I use it.
Help me!

Post Reply