Re: [stella] Odd Occurance in Program

Subject: Re: [stella] Odd Occurance in Program
From: "Chris Larkin" <clarkin@xxxxxxxxxxxxx>
Date: Thu, 9 Jan 2003 09:36:56 -0800
(Shrug).... OK :-)...

The PlusFive table has been modfied for testing, and does only contains two
symbols...

Attached are two shots... one of the kernel crashing... and one of the
kernel functioning fine with the X value less than 50.  The timing is off so
the symbols don't line up correctly... but that is not my concern at the
moment.

PlusFive
 .byte $00,$00,$00,$0E,$42,$42,$EE,$48,$48,$0E,$00,$00
 .byte $00,$00,$00,$0B,$4B,$4A,$EA,$4A,$4B,$0B,$00,$00
 .byte $00,$00,$00,$0B,$4B,$4A,$EA,$4A,$4B,$0B,$00,$00
 .byte $00,$00,$00,$0E,$42,$42,$EE,$48,$48,$0E,$00,$00
 .byte $00,$00,$00,$0E,$42,$42,$EE,$48,$48,$0E,$00,$00
 .byte $00,$00,$00,$0B,$4B,$4A,$EA,$4A,$4B,$0B,$00,$00
 .byte $00,$00,$00,$0E,$42,$42,$EE,$48,$48,$0E,$00,$00
 .byte $00,$00,$00,$0B,$4B,$4A,$EA,$4A,$4B,$0B,$00,$00
 .byte $00,$00,$00,$0B,$4B,$4A,$EA,$4A,$4B,$0B,$00,$00
;***************************************************************************
****************
;Draw card boxes
DrawDr
     LDX #7 ;Draw 7 cards on screen
     STX $81
     LDA #$34
     STA COLUP0 ;Set color for card symbols to red
CardLoop
     LDX #11 ;Each card "box" gets 11 scan lines
     STX $84 ;Store 11 into $84 we will decrement this for loop count.
     LDA #$0F
     STA COLUPF ;Box is white
     TXA ;Load 11 into accumulator
     CLC ;Clear carry bit
     ADC $85 ;Add the current card offset to the accumulator
     TAX ;Move accumulator back to X register
     LDX #59 ;Used for debugging when X equates to this high, the kernel
crashes. If below 50 the kernel functions fine.
InCardLoop ;Loop 11 times, drawing card symbol and white box.
     STA WSYNC
     LDA PlusFive,X
     STA GRP0
     LDA #%11100000
     STA PF2
     LDA $82 ;$82 is enabled if the symbol sprite requires an extra pixel of
data from the missle graphics. I have disabled this for testing.
     BEQ Nope
     LDA PlusFive,X
     STA ENAM0
     JMP Laa
Nope ;Delay to make all the symbols line up correctly
     nop
     nop
     nop
     nop
Laa
     nop
     nop
     nop
     nop
     LDA #%00110000
     STA PF0
     STA RESP0 ;Position Player graphic near middle of screen
     STA RESM0
     LDA #0
     STA PF2
     STA PF0
     STA ENAM0
     DEY ;Y contains scan lines remaining on screen.
     DEX ;X contains card offset index
     DEC $84 ;$84 contains how many scan lines remaining for this card
     BNE InCardLoop

     STA WSYNC
     LDX #0
     STX $82 ;Reset missile pixel
     STX GRP0
     LDX $81 ;$81 contains how many cards are left to draw on screen
     DEX ;Decrement it
     LDA PlayerHand,X ;Load the players next card's offset index.
     STA $85
     STA WSYNC
     DEY ;Decrement Y twice because we used two scan lines here.
     DEY
     DEC $81 ;Now decremement the current card count in memory.
     BNE CardLoop
;************************************************************

Attachment: KABLAM2.JPG
Description: JPEG image

Attachment: KABLAM.JPG
Description: JPEG image

Current Thread