HomeForumsWhat's newResources 
 
 
SBL problems
mrkotfw - Aug 27, 2003
 mrkotfw Aug 27, 2003
Code:
  
#

# makefile p

# 1. t@CTvfBNgRs[­B

# 2. fBNg𲐮­B

#  }N GCC, SEGALIB, SEGASMP `­B

# 3. RtBM[Vt@C sample.cfg 쐬­B

#  }N TARGET  OBJS `­B

# 4. make sTvvO쐬­B

#

#

#t@Cg¢}N

# CC      bRpCwBis\`Lq­j

# CFLAGS    bRpCIvVwB

# AS      AZuwBis\`Lq­j

# ASFLAGS   AZuIvVwB

# LDFLAGS   JIvVwB

# SATURN    T^[pz[fBNgwB

# GCC     fmt fBNgwB

# SEGASMP   rakTv fBNgwB

# SEGALIB   rakCu fBNgwB

# LOCATE_FILE ÍP[VLqt@CB

# ENTRY_POINT TvvO΍sJnAhXwB

# LIBS     NCuwB

# 

# iRtBM[Vt@C sample.cfg `j

# TARGET    TvvOּOwB

#        it@CvC}l[j

# OBJS     NIuWFNgt@CwB

#

CC = gcc

AS = gasm

CONV=objcopy

CFLAGS = -g -O0 -Wall -m2 -DMODEL_S -I$(GCC)/include -I$(SEGALIB)/include

ASFLAGS =

LDFLAGS = -T $(LOCATE_FILE) -e $(ENTRY_POINT) -nostartfiles

SATURN = ../../..

GCC   = ../../../../gccsh

SEGASMP = ../../../..

SEGALIB = ./

LOCATE_FILE = ./saturn.lnk

ENTRY_POINT = START

CONFIG_FILE = sample.cfg

LIBS=	$(SEGALIB)/lib/sega_sgl.a\

 $(SEGALIB)/lib/sega_per.a\

 $(SEGALIB)/lib/sega_sat.a\

 $(SEGALIB)/lib/sega_cdc.a\

 $(SEGALIB)/lib/sega_adp.a

include	$(CONFIG_FILE)

.SUFFIXES:

.SUFFIXES: .cof .o .src .c

all: $(TARGET).cof

$(TARGET).cof:	$(OBJS)

	$(CC) $(LDFLAGS) $(_LDFLAGS) -o $(TARGET).cof -Xlinker -Map -Xlinker $(TARGET).map $(OBJS) $(LIBS)

	$(CONV) -O binary XXX.bin

%.o: %.c

	$(CC) -c $(CFLAGS) $(_CFLAGS) -o $@ $<

%.o: %.src

	$(AS) $< $(ASFLAGS) $(_ASFLAGS) -o $@

clean:

	del *.o

well before i go to sleep (with a headache) i'll post this, i have all the *.o and the *.h it asked me that is missing i pointed it to the correct location and it compiles... so when it does compile it creates a bad *.bin -- i dont know why it just doesnt load on girigiri!

here it is:

Code:
  
gcc -c -g -O0 -Wall -m2 -DMODEL_S -I../../../../gccsh/include -I.//include -I../

../../../per/smpclib -o sblsgl02.o sblsgl02.c

sblsgl02.c: In function `main':

sblsgl02.c:80: warning: unused variable `dummy_pad'

gcc -T ./saturn.lnk -e START -nostartfiles -o sblsgl02.cof -Xlinker -Map -Xlink

er sblsgl02.map ./lib/strt1_g.o ./lib/strt2_g.o ./lib/per_x1.o ./lib/per_x2.o ./

lib/per_x3.o ./v_blank/v_blank2.o ./v_blank/set_vb.o aki_ashi.o aki_dou.o aki_ka

o.o aki_kata.o aki_ude.o aki_walk.o scldata.o sblsgl02.o .//lib/sega_sgl.a .//li

b/sega_per.a .//lib/sega_sat.a .//lib/sega_cdc.a .//lib/sega_adp.a

objcopy -O binary penis.bin

c:/ss/saturn/bin/objcopy.exe: XXX.bin: No such file or directory

make.exe: *** [sblsgl02.cof] Error 1

the Sample.cfg:

Code:
  
TARGET = sblsgl02

OBJS=	./lib/strt1_g.o\

 ./lib/strt2_g.o\

 ./lib/per_x1.o\

 ./lib/per_x2.o\

 ./lib/per_x3.o\

 ./v_blank/v_blank2.o\

 ./v_blank/set_vb.o\

 aki_ashi.o\

 aki_dou.o\

 aki_kao.o\

 aki_kata.o\

 aki_ude.o\

 aki_walk.o\

 scldata.o\

 $(TARGET).o

_CFLAGS=-I$(SEGASMP)/per/smpclib

anyone? i have no idea what is wrong -- i wont be able to have much time soon because i am in school and school will be my first priority (unlike sophmore yr.) :flamethrower:

heh -- i am trying to make a few demos but SBL has Vblank and i think Hblank functions for me to work with, so i basicly need it -- SGL isnt enuf.

 antime Aug 28, 2003
This line seems wrong:

Code:
  
 $(CONV) -O binary XXX.bin
You never name an input file, try something like

Code:
  
 $(CONV) -O binary $(TARGET).cof XXX.bin

 mrkotfw Aug 28, 2003
this is so wierd, it does the same thing

 ExCyber Aug 28, 2003
How large is the bin?

 mrkotfw Aug 28, 2003
nope, around 133kb -- it just doesnt load! i kind of need SBL+SBL together, i tried everything

 mrkotfw Aug 29, 2003
anyone? - i never had this type of problem before... it seems wierd. i tried to add that common folder to init the game but no-go

mmm

this is wierd

Code:
  
OUTPUT_FORMAT("coff-sh")

OUTPUT_ARCH(sh)

SECTIONS

{

	.text	0x06010000:

	{

 *(.text)

 *(.strings)

	}

	.tors ALIGN(0x10) : 	/* CHANGE MADE HERE */

	{

 ___ctors = .;

 *(.ctors)

 ___ctors_end = .;

 ___dtors = .;

 *(.dtors)

 ___dtors_end = .;

	}  /* CHANGE MADE HERE */

	.data ALIGN(0x10):

	{

 STARTOF_R = .;

 *(.data)

 SIZEOF_R = . - STARTOF_R;

 ENDOF_R = .;

	}

	.bss ALIGN(0x10) (NOLOAD):

	{

 STARTOF_B = .;

 *(.bss)

 *( COMMON )

 SIZEOF_B = . - STARTOF_B;

 ENDOF_B = .;

 _end = .;

 }

}

why in that address, should i use the old SL.LNK?

 vbt Aug 30, 2003
Maybe you define an another start address in the IP.BIN, here you use "0x06010000" and maybe you use "0x06004000" in you IP.BIN.

 mrkotfw Aug 30, 2003
mmmm, but VBT are you sure my makefile is correct? i need those god damn v-blank and h-blank functions heh... it could be that *.lnk script and or the ip.bin -- i hexed the ip.bin but i find nothing on that address -- maybe i need to look harder

 antime Aug 30, 2003
If you just want to wait for hblanks and vblanks, it's easy to just test the TVSTAT register manually.

 mrkotfw Aug 30, 2003
Code:
  
  extern Uint16 slGetHCount(void);

  extern Uint16 slGetVCount(void);

mmmm!?

 antime Aug 30, 2003
From scroll.txt (isn't documentation great?)


  
	
	
******************************************************************************

Uint16 slGetHCount(void)

******************************************************************************

*************************Changes *****************************

Function:

Reads the VDP2 H counter.

******************************************************************************

Uint16 slGetVCount(void)

******************************************************************************

Function:

Reads the VDP2 V counter.

********************* End of Changes **********************



I've used something like this:

Code:
  
#define TVSTAT (*(volatile unsigned short *)0x25F80004)

/* Wait for VBLANK */

while( (TVSTAT & 8) == 0);

/* Wait until we're out of VBLANK */

while( (TVSTAT & 8) != 0);

To wait for hblank, just check bit 2 of TVSTAT instead. However, since you're using SGL keep in mind that it does a lot of processing during vblank and that you can register a callback function using slIntFunction that will be executed after SGL has completed whatever it needs to do. Other SGL functionality that is based on interrupts can also seriously mess up any of your code that depends on timing.

 mrkotfw Aug 30, 2003
thank you antime, i may have to read some more of the docs. can you tell me where you found that address?

 antime Aug 31, 2003
The VDP2 registers can be found in the VDP2 manual. The addresses in the document are given as an offset from the VDP2 base address (0x5E00000, the 0x20000000 added to the addresses when actually used means the CPU will bypass the cache which should always be done when accessing hardware registers).