HomeForumsWhat's newResources 
 
 
new saturn developer
surixurient - Jun 19, 2014
 surixurient Jun 19, 2014
Hello, I am a long time Saturn enthusiast now interested in developing for the platform. I am familiar with the hardware from ripping graphics and data from a saturn game several years ago. I'll stick around here while I develop my first game (2d-rpg). My plan is to do 16 color animated sprites for characters and magic effects, 256 color scrolling backgrounds and 16 color background sprites for trees, house roofs, and other stuff you can walk behind/under. for my 16 color sprites, is there anything I should take into account as far as using color lookup tables in vdp1 memory vs using color palettes in vdp2 memory? Are there any specific examples of doing efficient magic effects, palette tricks and the like?

Thanks for any advice. I am glad to have found this forum and I am excited to dive into saturn dev Here's hoping I don't end up over my head.

 vbt Jun 20, 2014
welcome here surixurient ! feel free to ask questions

 surixurient Jun 20, 2014
Thanks, vbt. my first question is if anyone has built a saturn app based on the SBL. I cant get them to run so far (the SBL samples with SaturnOrbit), just SGL works.

 surixurient Jun 20, 2014
well i figured out something that was wrong with the SBL samples. First their linker file had them starting at 0x06010000 but they were actually being put at 0x06004000 so i changed that.

then their entry point which is file strt1_c.s had a problem
Code:
  
	.section	.text
	.align	4
	.IMPORT	__INIT
	.global			START
START:
	#mov.l	STACKPTR_R,r0
	#mov		r0,r15
	mov.l	AP_START_R,r0
	JMP	@r0
	NOP
	.align	4
AP_START_R:
	.long	__INIT
STACKPTR_R:
	.long	0
	.align	4
	.global			__D_BGN
	.global			__D_END
	.global			__B_BGN
	.global			__B_END
__D_BGN:	.long	STARTOF_R
__D_END:	.long	ENDOF_R
__B_BGN:	.long	STARTOF_B
__B_END:	.long	ENDOF_B
The two lines i commented out
#mov.l STACKPTR_R,r0
#mov r0,r15
sets R15 to 0. R15 looks like what is being used as the stack pointer by the compiler and it doesn't work at address 0, so I got rid of those lines and the demos at least start now. (they dont work but they start ;P)

Maybe i need a different compiler to use SBL?


I guess some of them work now and some dont. probably the ones that use assembler dont work, being they are expecting a different compilation of the c and keep messing it up

 vbt Jun 21, 2014
for sbl, you need to compile/assemble strt1_g.xx & strt2_g.xx
and link script looks like this :

  
	
	
SECTIONS {
.text 0x06004000 :
{
*(.text)
*("P")
*("SEGA_P")
*("C")
*("SEGA_C")
*(.strings)
}

.rodata ALIGN(0x20) :
{
*(.rodata)
}
.tors ALIGN(0x10) :
{
___ctors = . ;
*(.ctors)
___ctors_end = . ;
___dtors = . ;
*(.dtors)
___dtors_end = . ;
}

.bss ALIGN(0x10) (NOLOAD):
{
__bstart = . ;
B_BGN = . ;

*(.bss)
* ( COMMON )
__bend = . ;
B_END = . ;
_end = .;
}
}


 surixurient Jun 23, 2014
thanks, vbt. ill use those.

 surixurient Jul 3, 2014
Is there a register for cpu tick? to measure elapsed time

 antime Jul 5, 2014
No, you have to use one of the timers.

 surixurient Jul 7, 2014
thanks antime. on psx i used a counter in the vblank interrupt, i think ill do that.

 ExCyber Jul 7, 2014
There isn't literally a register for the CPU tick, but ISTR that there is a "free running timer" that more or less represents the CPU clock run through a configurable divider. I don't have the manual handy (I tried to look it up, but it seems like Renesas has tossed the relevant product line down the memory hole; it doesn't even show up in the "obsolete products" search), so I'm not sure what resource to point you at exactly.

 surixurient Jul 7, 2014

ExCyber said:
There isn't literally a register for the CPU tick, but ISTR that there is a "free running timer" that more or less represents the CPU clock run through a configurable divider. I don't have the manual handy (I tried to look it up, but it seems like Renesas has tossed the relevant product line down the memory hole; it doesn't even show up in the "obsolete products" search), so I'm not sure what resource to point you at exactly.

Yeah i'm actually using that now. there are macros defined for it and covered in the sega basic library guide 3.

 antime Jul 8, 2014

ExCyber said:
I'm not sure what resource to point you at exactly.

You can get it from my site if you need it. The "blinky" example I wrote for the SATNKernel port also shows how to configure the timer directly....

 surixurient Jul 9, 2014
thanks antime.

Do you guys know any practical examples of animated transparency? like for a god-ray that pulses in and out. I understand id animate the value in one of the 8 transparency banks. I was reading the technical bulletin on transparency but it was not entirely clear to me which type of sprites id use. Can i do individual sprite transparency with 4bpp or 8 bpp sprites? or do they have to be 16bpp?

http://koti.kapsi.fi/~antime/sega/files/Sattechs.pdf
SEGA SATURN TECHNICAL BULLETIN #SOA-7
Re: Sprite Transparency

Also I'd like to have mist/fog that goes over both the backgrounds and my characters on the sprite layer, how can this be done? with half-transparency sprite mode only?

Thanks