SBL problems

mrkotfw

Mid Boss
Code:
#

#¡‚±‚Ì makefile ‚Ì—˜—pŽÃ¨ˆÃ¸‚«

# 1. ‚±‚̃tƒ@ƒCƒ‹‚ðƒTƒ“ƒvƒ‹‚̃fƒBƒŒƒNƒgƒŠ‚ɃRƒs[‚µ‚Ä‚­‚¾‚³‚¢B

# 2. ƒfƒBƒŒƒNƒgƒŠ‚̐Ý’è‚𒲐®‚µ‚Ä‚­‚¾‚³‚¢B

#  ƒ}ƒNƒÂ GCC, SEGALIB, SEGASMP ‚ð’è‹`‚µ‚Ä‚­‚¾‚³‚¢B

# 3. ƒRƒ“ƒtƒBƒMƒ…ƒŒÂ[ƒVƒ‡ƒ“ƒtƒ@ƒCƒ‹ sample.cfg ‚ðì¬‚µ‚Ä‚­‚¾‚³‚¢B

#  ƒ}ƒNƒÂ TARGET ‚Æ OBJS ‚ð’è‹`‚µ‚Ä‚­‚¾‚³‚¢B

# 4. make ‚ðŽÃ€Âs‚µ‚ăTƒ“ƒvƒ‹ƒvƒÂƒOƒ‰ƒ€‚ðì¬‚µ‚Ä‚­‚¾‚³‚¢B

#

#

#¡‚±‚̃tƒ@ƒCƒ‹‚ÅŽg‚í‚ê‚Ä‚¢‚éƒ}ƒNƒÂ‚̐à–¾

# CC      ‚bƒRƒ“ƒpƒCƒ‰‚ðŽw’肵‚Ü‚•BiŽÃ€Âs‰Ã‚”\‚ÈŒ`‚Å‹Lq‚µ‚Ä‚­‚¾‚³‚¢j

# CFLAGS    ‚bƒRƒ“ƒpƒCƒ‰‚̃IƒvƒVƒ‡ƒ“‚ðŽw’肵‚Ü‚•B

# AS      ƒAƒZƒ“ƒuƒ‰‚ðŽw’肵‚Ü‚•BiŽÃ€Âs‰Ã‚”\‚ÈŒ`‚Å‹Lq‚µ‚Ä‚­‚¾‚³‚¢j

# ASFLAGS   ƒAƒZƒ“ƒuƒ‰‚̃IƒvƒVƒ‡ƒ“‚ðŽw’肵‚Ü‚•B

# LDFLAGS   ƒŠƒ“ƒJ‚̃IƒvƒVƒ‡ƒ“‚ðŽw’肵‚Ü‚•B

# SATURN    ƒTƒ^[ƒ“—p‚̃z[ƒ€ƒfƒBƒŒƒNƒgƒŠ‚ðŽw’肵‚Ü‚•B

# GCC     ‚f‚m‚t‚Ì‚ ‚éƒfƒBƒŒƒNƒgƒŠ‚ðŽw’肵‚Ü‚•B

# SEGASMP   ‚r‚a‚k‚̃Tƒ“ƒvƒ‹‚Ì‚ ‚éƒfƒBƒŒƒNƒgƒŠ‚ðŽw’肵‚Ü‚•B

# SEGALIB   ‚r‚a‚k‚̃‰ƒCƒuƒ‰ƒŠ‚Ì‚ ‚éƒfƒBƒŒƒNƒgƒŠ‚ðŽw’肵‚Ü‚•B

# LOCATE_FILE ƒÂƒ‚ƒŠ‚̃ƒP[ƒVƒ‡ƒ“‚ð‹Lq‚µ‚½ƒtƒ@ƒCƒ‹‚Å‚•B

# ENTRY_POINT ƒTƒ“ƒvƒ‹ƒvƒÂƒOƒ‰ƒ€‚̎ÀsŠJŽnƒAƒhƒŒƒX‚ðŽw’肵‚Ü‚•B

# LIBS     ƒŠƒ“ƒN‚•‚郉ƒCƒuƒ‰ƒŠ‚ðŽw’肵‚Ü‚•B

# 

# iƒRƒ“ƒtƒBƒMƒ…ƒŒÂ[ƒVƒ‡ƒ“ƒtƒ@ƒCƒ‹ sample.cfg ‚Ì’†‚Å’è‹`‚µ‚Ü‚•j

# TARGET    ƒTƒ“ƒvƒ‹ƒvƒÂƒOƒ‰ƒ€‚Ì–¼‘O‚ðŽw’肵‚Ü‚•B

#        iƒtƒ@ƒCƒ‹‚̃vƒ‰ƒCƒ}ƒŠƒl[ƒ€‚É‚È‚è‚Ü‚•j

# OBJS     ƒŠƒ“ƒN‚•‚éƒIƒuƒWƒFƒNƒgƒtƒ@ƒCƒ‹‚ðŽw’肵‚Ü‚•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 :damn: :sleep: -- i wont be able to have much time soon because i am in school and school will be my first priority (unlike sophmore yr.) :ph34r: :blink: :angry: :flamethrower: :puke:

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.
 
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
 
anyone? :cool: - 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? :drool:
 
Maybe you define an another start address in the IP.BIN, here you use "0x06010000" and maybe you use "0x06004000" in you IP.BIN.
 
mmmm, but VBT are you sure my makefile is correct? i need those god damn v-blank and h-blank functions :blush: 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
 
If you just want to wait for hblanks and vblanks, it's easy to just test the TVSTAT register manually.
 
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.
 
thank you antime, i may have to read some more of the docs. can you tell me where you found that address? :unsure:
 
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).
 
Back
Top