[stella] Supercharger RPG bare beginnings - request for help

bob.montgomery at thomson.com bob.montgomery at thomson.com
Thu Sep 14 16:06:50 CDT 2006


Hi all,

I'd like some help with this project.

First, what it is:

In an effort to get something together for Glenn's Supercharger contest,
I undertook to write an RPG using the Supercharger.  This proved to be,
ultimately, too much work for too little time, plus I ran into some
technical difficulties (more about those in a minute!), so I put it
aside.

What I have right now is a tile-based, scrolling map partially based on
Andrew Davie's Boulderdash engine, adapted to the confines of the SC.
The screen shows an 8x7 window of a 48x42 tile map, plus sprites.

The two main technical problems: 

1. The kernel is a partially-unrolled loop where each displayed tile row
looks like this:
KernelLoop4
	SLEEP 4		;+4	 9
IntoKernelLoop4
	sta.w GRP0		;+4	13


	lda ColorTable,X
	sta COLUPF		;+7	20

MarkerR4PF1
	lda $1800,X		;		this absolute address is
				;		modified outside the
kernel
	sta PF1
MarkerR4PF2
	lda $1800,X		;		this absolute address is

				;		modified outside the
kernel
	sta PF2
MarkerR4PF4
	lda $1800,X		;		this absolute address is

				;		modified outside the
kernel
	sta PF1
MarkerR4PF3
	lda $1800,X		;		this absolute address is

				;		modified outside the
kernel
	sta PF2			;+28	48

MarkerOtherSpriteR4
	lda PlayerMaskingData,X		;		this absolute
address is 
						;		modified
outside the kernel
	sta GRP1			;+12/14	60/62	VDELed
	lda (PlayerDataPtr),Y		;
	and (PlayerMaskPtr),Y	;+10/12	65/68
	dey
	sta WSYNC
	
	dex
	bpl KernelLoop4		;+5	5
	
	ldx #ROWHEIGHT-1		;+2	 6
	jmp IntoKernelLoop5	;+3	 9	branch always

As you can see, each row has 5 addresses that need to be updated every
time the screen scrolls.  The subroutine that does this
(SetupTileDisplaySubroutine) takes a long time.  It takes the entire
overscan plus the entire VBLANK period plus part of an additional VBLANK
period to do this.  So I already can only update the screen every other
frame and trying to do anything else (play music, etc.) would cut that
rate further.  For an RPG, that isn't terrible, but I would really like
to speed that routine up.  Anybody want to take a crack at optimizing?

2nd problem:  Text.  How to do it?  I would like to fit 4-5 lines of
text in the bottom 20-30 scanlines.  The best option I've come up with
would be to dedicate 120-150 bytes of SC RAM and build a 48x25 bitmap
from various text strings.  The problem with that is, again, time - to
process that many characters, with all the font lookups and bit shifting
plus all the writes to SC RAM, would take forever.  Most likely at least
an entire VBLANK period.  So, to update the display would take something
like 3-4 frames.  So anybody have any brilliant ideas for this?  :)

Thanks, 

-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SCRPG20060317.zip
Type: application/x-zip-compressed
Size: 8662 bytes
Desc: SCRPG20060317.zip
Url : http://www.atariage.com/pipermail/stella/attachments/20060914/6a88606c/attachment.bin 


More information about the Stella mailing list