Page 19 of 57

Posted: Wed Aug 24, 2011 6:40 pm
by Moon-Watcher
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.

Posted: Wed Aug 24, 2011 7:30 pm
by Stef
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.

Posted: Wed Aug 24, 2011 8:33 pm
by Moon-Watcher
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

Posted: Wed Aug 24, 2011 8:54 pm
by Stef
Hmm ok, probably needs to be reported at Kaneda as he's the author of Genres tool :)

Posted: Thu Aug 25, 2011 1:17 am
by KanedaFr
sh$$$$ microsoft....
it's why I hate it...always a dll missing :(

sorry about that :(

Posted: Fri Oct 21, 2011 9:07 pm
by Zontar
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?

Posted: Fri Oct 21, 2011 9:11 pm
by Zontar
I'm also using sjasm...will there be any changes needed to the Z80 portion?

Posted: Fri Oct 21, 2011 9:25 pm
by Chilly Willy
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.

Posted: Fri Oct 21, 2011 9:54 pm
by Zontar
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.

Posted: Sat Oct 22, 2011 8:02 pm
by Chilly Willy
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.

Posted: Sun Oct 23, 2011 12:05 am
by Zontar
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.

Posted: Wed Dec 07, 2011 4:25 pm
by Mixail
please, give me MakeFile for SGDK 0.9
I use it.

Posted: Wed Dec 07, 2011 10:03 pm
by Stef
Mixail wrote:please, give me MakeFile for SGDK 0.9
I use it.
Why you don't use directly the included makefile ?

Posted: Thu Dec 08, 2011 7:55 am
by Mixail
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

Posted: Fri Dec 09, 2011 11:53 am
by Mixail
Mixail wrote:please, give me MakeFile for SGDK 0.9
I use it.
Help me!