RE: [stella] Crazy Valet

Subject: RE: [stella] Crazy Valet
From: "Brian Prescott" <bprescot@xxxxxxxxxxxxxxx>
Date: Sun, 12 Nov 2000 09:34:24 -0500
Hi Thomas.

You are right, the Crazy Valet code was written a Visual Basic programmer
used to taking liberties about wasting code space and resources.  It took me
almost a year of studying 6502 assembly language programming, the Atari
programmer's guide, and other documents from the Stella list or on the web
before I was able to become comfortable enough to even attempt to write this
game.  (And even now, I am still a little light on some of the assembly
language concepts, as the code no doubt shows.)  At some point, I do intend
to go back and clean up parts of the code, so I will keep your message
archived.

And as far as the demo being too easy, that is true.  But don't worry, when
I release the full game binary, puzzles 20 and higher are enough to make you
use Nolan Bushnell's name in vain.  :D

Thanks for your expertise.  Oh, and by the way, in case no one has said
anything, Thrust is pretty darn cool.

Brian

-----Original Message-----
From: owner-stella@xxxxxxxxxxx [mailto:owner-stella@xxxxxxxxxxx]On
Behalf Of Thomas Jentzsch
Sent: Sunday, November 12, 2000 7:31 AM
To: stella@xxxxxxxxxxx
Subject: Re: [stella] Crazy Valet


Hello Brian,
you wrote:

BP> - You are correct, the whole game is basically "fun with playfields"
except
BP> for the cursor, which is player 1.  I tried to integrate player 2 to
mark
BP> the important car, but ran into problems.  (See below)

BP> - I consider myself very lucky on this game, as I started to reach the
end
BP> and integrate nice little things I wanted to put in, I ran out of
memory.
BP> After reshuffling my graphics and sound data to avoid crossing pages, I
had
BP> about 16 bytes left out of the 4K on the current version of the game.

After a quick look at your code (Distella), i think,
you still have plenty of room for improvements, which
would save you a lot of bytes.

Examples:
  lda  #$00      lda  #$00
  sta  PF0       sta  PF0
  lda  #$00      sta  PF2
  sta  PF1       sta  PF2
  lda  #$00
  sta  PF2
                 4 bytes saved

  DEC  $D4       lda  $D4
  DEC  $D4       sec
  DEC  $D4       sbc  #6
  DEC  $D4       sta  $D4
  DEC  $D4       lda  $D5
  DEC  $D4       sec        <- necessary?
  DEC  $D5       sbc  #6
  DEC  $D5       sta  $D5
  DEC  $D5       tax
  DEC  $D5
  DEC  $D5
  DEC  $D5
  LDX  $D5
                 11-12 bytes saved

The following block could be improved even more:
LF09D: LDA    #$00
       STA    $D3
       LDA    #$40
       BIT    SWCHA     <- try shifting instead of many BITs/ANDs
       BNE    LF0AF
       LDA    #$03
       STA    $D3       <- store only once _after_ JMP to LF0F2
       JMP    LF0F2     <- use Bxx is such cases (BNE here)
LF0AF: LDA    #$80
       BIT    SWCHA
       BNE    LF0BD
       LDA    #$04
       STA    $D3
       JMP    LF0F2
LF0BD: LDA    #$10
       BIT    SWCHA
       BNE    LF0CB
       LDA    #$05
       STA    $D3
       JMP    LF0F2
LF0CB: LDA    #$20
       BIT    SWCHA
       BNE    LF0D9
       LDA    #$06
       STA    $D3
       JMP    LF0F2
LF0D9:

If you change the expected results in $D3 a bit, it
could look like this (saves more than 75%!):
     ldy      #4
     lda      SWCHA
.loop:
     asl
     bcc      LF0F2
     dey
     bne      .loop
     ...
LF0F2:
     sty      $D3

There are other places too (positioning of player 0,
...), were the code could be compressed.

You should also try to use the wasted space where you
align your code/data.

I think you should investigate some time in optimising
your code a bit, as this would make your game even
better.
If not, others (me?) might even want to make that better
version, the concept of the game is just too good to be
"wasted" ;-)


BP> - If you follow the links for Philip Cheng on my web site, he has a few
BP> links to other Rush Hour websites, including a fellow that has a java
BP> version that has different puzzles each week.

I already did this and found a lot of very challenging
puzzles. Thanx.


BP> Also, I have added additional content to my Crazy Valet web page,
including
BP> a download page at which you can download a demonstration version of the
BP> game to decide if you want to request a cartridge.

BP> And as always, questions or comments are welcome.

I tried your demo and i think the puzzles are far to
easy (for me?). I expect, that they are getting more
difficult at higher levels, so maybe you should
demonstrate this in your demo, too. Just use every
5th puzzle.

Thomas



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


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

Current Thread