Re: [stella] BiiggerBoing26

Subject: Re: [stella] BiiggerBoing26
From: David <davidgalloway@xxxxxxxxxxxxxx>
Date: Sun, 06 Jul 2003 15:06:37 -0700
Rob wrote:

On Sunday 06 July 2003 07:20, David wrote:


- remastered the art" from a different source and it is 48x90 (original
was 40x50)
- added bounce.



Looks sweet! I should learn to write bankswitching code one of these days...


Rob


Thanks,


I think the original has better looking animation (one more frame for instance). I didn't put in any touch up time on the art at all. (That's tedious). I've included the PCX files in the source, there is a go.bat which generates the art using Eckhard Stolberg's pcx2grp. Do you feel like touching it up again. ;-) Perhaps you still have better source art.

The bankswitching is 'el cheapo'.

While there is always some overhead in bankswitching, this is effectively a 7K cart.

It's like having two 3K 'banks' of unique data because the first 1K of code appears in both 4K banks. I assembled the code seperately and used incbin to bring in the 1K of code twice. I made sure to emit a byte at $3FF in the code so that it would come out to 1024 bytes. I've included the code to assemble the cart below (also in source zip)

The snippet of code for bankswitching.

; Each frame now takes $300 bytes. - lots of waste (76 bytes/frame)
; The start address of the frames is in the AnimPtr table
; Frames 0,1,2,3 are in bank 0
; Frames 4,5,6 are in bank 1

; Hacky code to get base address of animation frame in Y and set bank

       LDA    RotateDir       ; which direction to rotate it in?
       CLC
       ADC    Frame
       BPL    .low
       LDA    #6
.low    CMP    #7
       BCC    .low1
       LDA    #0
.low1   STA    Frame

       CMP     #4
       BCC    .b1
       BIT    $1FF9           ; frame is in bank 1
       SBC    #4
       BCS    .b2
.b1     BIT    $1FF8           ; frame is in bank 0
.b2     TAX
       LDY    AnimPtr,X

.
.
.

AnimPtr .byte $F4,$F7,$FA,$FD


END ;;;;;;;;;;;;;;;;;;




Code for assembling cart from code + art



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


processor 6502


Cart_Init equ $F000


org $0000

incbin "boingcode.bin" ; bring in code in first bank
org $0400


include "PCX\frame0.s"
org $0700
include "PCX\frame1.s"
org $0A00
include "PCX\frame2.s"
org $0D00
include "PCX\frame3.s"
org $0ffa ; vectors in first bank


       .word   Cart_Init    ; NMI
       .word   Cart_Init    ; Reset
       .word   Cart_Init    ; IRQ

org $1000 ; start of second bank

incbin "boingcode.bin" ; bring in code in second bank

org $1400

include "PCX\frame4.s"
org $1700
include "PCX\frame5.s"
org $1A00
include "PCX\frame6.s"
org $1D00
; include "PCX\frame0.s"
org $1ffa ; vectors in second bank


       .word   Cart_Init    ; NMI
       .word   Cart_Init    ; Reset
       .word   Cart_Init    ; IRQ


----------------------------------------------------------------------------------------------


; Bonus.
; alternate code to get base address of animation frame in Y and set bank. Less Branches / no table


       LDA     RotateDir       ; which direction to rotate it in?
       CLC
       ADC    Frame
       TAX
       BPL    .cl1
       DEX
.cl1    CPX    #7
       BNE    .cl2
       INX
.cl2    TXA
       AND    #3
       STA    Temp
       ASL
       ADC    Temp
       ADC    #$F4
       TAY
       TXA
       AND    #7
       STA    Frame
       LSR
       LSR
       TAX
       STA    $1FF8,X






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


Current Thread