Re: [stella] VCS.H standardization

Subject: Re: [stella] VCS.H standardization
From: "Thomas Jentzsch" <tjentzsch@xxxxxx>
Date: Tue, 27 Nov 2001 09:24:44 +0100
Erik wrote:
> The xxx_Disable constants may be a bit excessive, but I thought it might 
> help make some code a little more clear.

I think the problem with to many constants is, that they make it harder to optimize the code. You don't see the actual values anymore. Look at the following (quite usual) simple sequences:

    lda #M_Disable
    sta ENAM0
    sta ENAM1
    lda #BL_Disable
    sta ENABL

and

    lda #VR_NoDelay
    sta VDELP0
    sta VDELP1
    lda #0
    sta GRP0
    sta GRP1   

With using constants, you might not recognize, that you can avoid loading #0 twice. 

Optimizing is (unlike other plattforms) an essential factor for the 2600. Constants should be used *very* carefully.

Is suggest only to use enabling (For disabling the TIA uses zero in most cases) constants and only one of them for similar registers (M0,M1,BL: ENABLE) . But even then they might still be to many:

    lda #ENABLE
    cpy m0Start
    bcs .enable
    lsr          ; this little trick will save you one byte
.enable:
    sta ENAM0

As always for true the 2600, you have to make compromises here too.
 
Have fun!
Thomas
_______________________________________________________
Thomas Jentzsch         | *** Every bit is sacred ! ***
tjentzsch at web dot de |


______________________________________________________________________________
Keinen Jackpot mehr verpassen! Mit dem Dauerschein des WEB.DE Lottoservice.
Einfach und bequem Lotto tippen! http://tippen2.web.de/?x=4

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


Current Thread