[stella] startup bank

Darrell Spice, Jr. dspice at houston.rr.com
Sun Apr 30 14:22:24 CDT 2006


It could be any - so all banks should include code to switch to the  
bank with your InitSystem code and then run it.

In my game, Medieval Mayhem, I use a macro called JUMP_TABLE that I  
include at the start of every bank, and another macro called  
BANKS_AND_VECTORS that goes at the end of every bank.

	MAC JUMP_TABLE ; put this at the start of every bank
	RORG $F000
InitSystem
	cmp SelectBank5   ; inits system then goes to the menu
	jmp InitSystemCode
VerticalBlankMenu
	cmp SelectBank6
	jmp VerticalBlankMenuCode
VerticalBlankGame
	cmp SelectBank1
	jmp VerticalBlankGameCode
KernelGame
	cmp SelectBank8    ; draws score, top castles, dragons
	jmp KernelGameCode
KernelGameDragon
         cmp SelectBank5    ; draws bottom castles
	jmp KernelGameDragonCode
KernelGameBottom
         cmp SelectBank5    ; draws bottom castles
	jmp KernelGameBottomCode
OverscanMenu2             ; Menu Entry Point if user hits SELECT
	cmp SelectBank6   ; or RESET during a game
	jmp OverscanMenu2Code
OverscanGame
	cmp SelectBank7
	jmp OverscanGameCode
	ENDM
	
	MAC BANKS_AND_VECTORS ; put this at the end of every bank
	RORG $FFF4
	
SelectBank1 .byte $00
SelectBank2 .byte $00
SelectBank3 .byte $00
SelectBank4 .byte $00
SelectBank5 .byte $00
SelectBank6 .byte $00
SelectBank7 .byte $00
SelectBank8 .byte $00

;	.word InitSystem ; NMI - not used in 32K as this ROM location is  
SelectBank7 and SelectBank8 hotspots for 32K
	.word InitSystem ; RESET
	.word InitSystem ; IRQ
	ENDM

Having the jumptable in every bank is not the most efficient as I'll  
never jump to every routine from every bank, but I found it made it  
easier to follow and rearrange bank usage when I needed to.

You can nab the full source for Medieval Mayhem to see how I used the  
macros from my Blog at AtariAge:
http://www.atariage.com/forums/index.php?automodule=blog&blogid=148&


On Apr 30, 2006, at 12:16 PM, adam at cuddlepuddle.org wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> In general, in a multibank ROM file, is the start up bank the first
> 4K or the last 4K in the file?
>
> - --
> adam at cuddlepuddle.org        http://cuddlepuddle.org/~adam
> KG6GZR                       http://cuddlepuddle.org/~adam/resume.html
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
>
> iD8DBQFEVPELyvXf5Z0z5zERAr8OAKCZ00is0okYwwz3US0o1o/Yijd75gCdFOQX
> oUq2VTZxLj44cM+avv7mgu0=
> =419q
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Stella mailing list
> Stella at atari2600.org
> http://atari2600.org/mailman/listinfo/stella

Darrell Spice, Jr.
www.spiceware.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.atariage.com/pipermail/stella/attachments/20060430/5f8ebe7f/attachment.html 


More information about the Stella mailing list