[stella] An exercise in minimalism...

Subject: [stella] An exercise in minimalism...
From: Mark De Smet <desmet@xxxxxxxxxxxx>
Date: Wed, 1 Sep 1999 18:47:08 -0500 (CDT)
I've been trying to make a 'game' that takes up the minimum amount of rom
space.  So far, I've been able to reduce it to 62 bytes(unless my count is
off).  The only thing it does is display the scrolling rainbow.  I was
trying to make it as small as possible, yet still display something on the
screen so that someone running it knows that it is in fact running.

Anyone have ideas for making it smaller?

I still havn't used the accumulator in it, but there has to be a way to
use that to save another byte or two...

I also couldn't come up with a way to use the timer to save more bytes(it
isn't used at all right now.), but there has to be a way to use it
efficiently...

Mark




	processor 6502
	include vcs.h

backcolor  = $80

	org $F000
Start

;Initialise

	SEI  		;1 ; Disable interrupts.  This may be removeable.
	CLD  		;1 ; Clear BCD math bit.  Removeable?  depends if
			;inc&dec are affected.

;need to clear out the player and playfield graphics regs as well as 
;turn off the missles and ball.  I think this loop is smaller than 
;doing each of those individually.

	LDY #$FF	;2
	LDX #0		;2
B1      STX 0,Y		;2
	DEY		;1
	BNE B1		;2

top

OverScan

	LDY #34		;2
	STY VBLANK	;2
			;yes, I loose a scan line(it is blanked), but
			;by doing this trick, I've removed 3 bytes!!!!

	DEY		;1
KillLines
	STY WSYNC	;2
	DEY		;1
	BNE KillLines	;2

VerticalBlank
	LDY #38		;2 ;Y now is %00100110(1 in bit1)
	STY  WSYNC	;2
vsync
	STY VSYNC	;2
	STY  WSYNC 	;2
	STY  WSYNC 	;2
	DEY		;1 ;Y now is %00100101 (37)
	STY  WSYNC 	;2
	STY VSYNC	;2 ;0 in bit 1, turns off VSYNC
	INY		;1 ;Y is now 38
vbloop	
	STY WSYNC	;2
	DEY		;1
	BNE vbloop	;2 ;Y is now 0
	STY VBLANK	;2  ; 0 turns off VBLANK

	LDY #191 	;2
	LDX backcolor	;2
	INC backcolor	;2

ScanLoop
	STX WSYNC	;2
	INX		;1
	STX COLUBK	;2
	DEY		;1
	BNE ScanLoop	;2

	BEQ top		;2

	org $FFFC	;4k
	.word Start	;2



--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread