Re: [stella] DASM 'upgrade' in progress

Subject: Re: [stella] DASM 'upgrade' in progress
From: Christopher Tumber <christophertumber@xxxxxxxxxx>
Date: Thu, 20 Mar 2003 23:31:15 -0500
Andrew wrote:

>How about incorporating automatic playfield knowledge, too?  Perhaps allow the system to encode any quoted string with spaces as a bit-pattern, separated into groups of 8-bit wide bytes - and, in the case of a 40-bit wide string, producing 6 bytes (or 5 packed bytes, even) representing that playfield in correct PF0/PF1/PF2 format.

This is an excellent idea and I'd like to suggest going one step further.

There are a variety of reasons besides bitmaps to be providing binary data and it would be nice if at least one mode of this is flexible enough to accomidate this kind of thing.

For example, in DiscoTech, dance step data is a nybble wide, as follows:

1000 = Up
0100 = Down
0010 = Left
0001 = Right

I wound up writing a little utility to "compose" (sequence?) dance steps, but prior to that, data tended to look like:

DanceSteps:
.byte 128+2,2,2,1,1,128+2,32+1

etc..

To make my life easier, I could have done something like:

Up_h EQU #128
Down_h EQU #64
Left_h EQU #32
Right_h EQU #16
Up_l EQU #8
Down_l EQU #4
Left_l EQU #2
Right_l EQU #1

DanceSteps:
.byte Up_h|Left_l,Left_l,Left_l,Right_l,Right_l,Up_h|Left_l,Left_h|Right_l

But I'd decided pretty quickly I'd need a utility if I was going to keep my sanity.

However, what if I could do something like:

Up    BITS  1000
Down  BITS  0100
Left  BITS  0010
Right BITS  0001

DanceSteps
.bitstring Up,Left,Left,Left,Right,Right,Up,Left,Left,Right

Which would then sequence the nybbles correcly in the byte (ie: Would automatically see that data is 4 bits wide and concat them together to form bytes).

It would still be nice to be able to use boolean operations on this, for example, if I want to combine two dance steps on a single beat I'd like to be able to do:

DanceSteps
.bitstring Up|Down,Left ,Left,Left|Right, Left|Right,Right, Up|,Left,Left,Right

Which should result in: 11000010,00100011,0011001,10100010,00010000

But that's a feature that won't always be usefull, it's just that my data is really only 1 bit wide...


This would be particularly helpfull for oddly sized data. Say for some reason you have data which is 3 bits wide, like a colour table. This value is then used as a offset on a table of real TIA values (Say some kind of block game where you're only using a hanfull of primary colours and each level has a unique, predetermined begin state)

The you'd just lay it out:

Black   BITS 000
Red     BITS 001
Green   BITS 010
Blue    BITS 011
Yellow  BITS 100
Purple  BITS 101
Brown   BITS 110
Orange  BITS 111

ColourTable
.bitstring Black,Black,Red,Red,Blue,Green,Blue,Red,Black,Black

Which is an awful lot easier than actually breaking up the bytes by hand...

Umm, is that clear? The desired result is a "packed" table that'll be decoded at run time, rather than using a full byte for each colour value.


For a large project (designing a bunch of levels in a game) you're probably going to want to eventually come up with a level editor type utility because this is still going to get tedious in the long haul. But, in the early/testing stages this kind of thing could be really usefull.


Chris...

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


Current Thread