|
Subject: Re: [stella] DASM 'upgrade' in progress From: "Andrew Davie" <atari2600@xxxxxxxxxxxxx> Date: Fri, 21 Mar 2003 19:54:43 +1100 |
> IMO using a macro for highly specialized tasks *might* be a better idea.
>
> And something like PIC "X.XX.XX." (and many, many more useful things!)
could
> be implemented as macro if we just extend the capabilities there a bit.
I totally agree with this.
If, for example, simple string-capability was added, which could do compares
on strings or characters, and select the nth character of a string, then all
of the requests for bit-defining pictures could be done with simple macros -
especially including Manuel's horizontal and vertical flipping. The
assembler should as far as possible be machine/hardware independant. I
believe, now, that PIC should be a macro. Then, the space or dot or X or
whatever can be set by the user, as preferred.
Here's a first-pass at what a macro would look like to produce 8-bit wide
sprite picture data...
SOLID = 'X
MAC PIC ;{1} is string
SINDEX SET 0 ; index to {1}'s nth character
SBYTE SET 0 ; output byte we're producing
REPEAT {1}.LENGTH ; {1}.LENGTH is the length of parameter 1, in
bytes
SBYTE SET SBYTE * 2
#if {1}[SINDEX] = SOLID ; get nth character of string, see if its an
'X' (or whatever)
SBYTE SET SBYTE + 1
#endif
REPEND
.byte SBYTE ; output data
ENDM
To use the above, you'd go...
PIC "X......X"
which should produce
.byte %10000001 ; or equivalent :)
To Mirror, you'd just shift to the right (/2) and add 128 instead.
So that covers left/right mirroring!
To do vertical mirroring, you could wrap the above macro inside another
which did the lines in reverse-order by calling the PIC macro for the
parameters in reverse-order. Similarly, it would be straightfoward to write
macros to do playfields with PF0/PF1/PF2 format, or packed, etc.
DASM already has string and character types, but doesn't (AFAIK) allow
comparisons and substrings. If the assembler could have a simple substring
capability, and a character-comparison, and a length operator... then macros
could handle just about all of the stuff we've been talking about so far,
and it would be more a matter of building a macro library than inbuilding
'2600 knowledge into DASM (which is multi-platform, after all).
No special knowledge of pictures, or screen or playfield formats. I think
this is the way to go.
Cheers
A
PS: DASM is something I'm going to support - it's *NOT* something I'm going
to spend all my time maintaining!
----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [stella] DASM 'upgrade' in prog, Thomas Jentzsch | Thread | Re: [stella] DASM 'upgrade' in prog, Thomas Jentzsch |
| Re: [stella] DASM 'upgrade' in prog, Thomas Jentzsch | Date | Aw: Re: [stella] DASM 'upgrade' in , cybergoth |
| Month |