Re: [stella] Poker Solitaire/Squares build 025

Subject: Re: [stella] Poker Solitaire/Squares build 025
From: urchlay@xxxxxxxxxxxxx
Date: Sun, 16 Dec 2001 11:41:04 -0500 (EST)
On Sun, 16 Dec 2001, Thomas Jentzsch wrote:

> Phantom of the Opcodes wrote:
> > ...at this point, I've used all 128 bytes of RAM (126 for variables, with
> > 2 left over for stack, which I actually do use). I'm also down to around
> > 100 bytes of ROM space free. I was considering adding a couple of different
> > game modes (sliding puzzle mode, with timed and/or move-limited variants),
> > but unless I want to use bank-switching, I don't think it's going to happen..
> > and even with 4 more K of ROM, I'd still be out of RAM.
> 
> From my practice I know, that there a always ways to optimize code and
> memory consumption. So if you would like to share your code with us, we
> might give you some more hints.
> 

Only reason I haven't posted the code is that it's huge (40K split over 3
files)... I need to convert huge sections of code like this:

 byte %10101010
 byte %01010101
 byte %11110000
 byte %01001101
 byte %11001010
 (etc. etc.)

..into hex, with multiple bytes per line. The bytes were machine-generated
by various perl scripts...


> Have you tried to share RAM? There are two ways to do so:
> - identify temporary used variables, you might be able to reuse the
> space of a temporary variable with another one elsewhere

I'm doing tons of this already. The current hand of cards though, is
25 bytes that can't be shared... and the remaining cards in the deck can't
really be shared either (25 more bytes). Then there's 25 pointers into the
card sprite data, which are generated every frame from the 25-byte hand.
These can be overwritten during the overscan (which the scoring routine does),
but they get regenerated every frame, so I can't store anything in there
for long.

> - you could also share bits, so if you have variables that do not use
> all bits (e.g. state variables), you can mix them into single bytes.
> 

I'm also doing this, though I might be able to do more of it.

> This might cost you some ROM, but you can use bank-switching and give
> your game exactly the features you want.
> 

Except that one of the features I want, is that the game fit in a 4K EPROM :)

Anyway, I'm attaching the code to this message, as-is.. sorry about the mess.

B.

---

If a trainstation is the place where trains stop, what is a workstation?

Attachment: pokersol_027.zip
Description: Zip archive

Attachment: pokersol_027.pal
Description: Binary data

Attachment: pokersol_027.bin
Description: Binary data

Current Thread