|
Subject: Re: [stella] 18 extra lives From: Eckhard Stolberg <Eckhard_Stolberg@xxxxxxxxxxxxxxxxxxxxx> Date: Tue, 01 Sep 1998 16:23:37 +0200 |
At 18:03 31.08.98 -0700, you wrote:
>Pretty cool! Any chance you could post the source code?
Sure. I didn't comment it very much, though. But you all know
how the effect works anyway, right. :-)
Ciao, Eckhard Stolberg
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
processor 6502
include vcs.h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;
; Zeropage variables declaration
;
SEG.U Variables
ORG $80
PTR18 DS 2 ; pointer to graphics for 18 sprites display
HideGFX DS 5 ; bitmap to put over 18 sprites display
; PF1 PF2 PF0 PF1 PF2
ShowCount DS 1 ; display this many sprites
SaveStack DS 1 ; holds stack pointer during 18 sprites disp.
LastJoy DS 1 ; last joystick value
AnimCount DS 1 ; change animation frame when zero
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;
; Program initialization
;
SEG Code
ORG $f000
Cart_Init:
sei
cld
Common_Init:
ldx #$28 ; Clear the TIA registers ($04-$2C)
lda #$00
TIAClear:
sta $04,X
dex
bpl TIAClear
RAMClear:
sta $00,X
dex
bmi RAMClear
ldx #$ff
txs
IOClear:
sta SWBCNT
sta SWACNT
DemoInit: lda #%00110100 ; priority for playfield & ball
; ball is 8 pixels wide
sta CTRLPF
lda #%00000011 ; 3 copies close spacing
sta NUSIZ0
sta NUSIZ1
lda #$08 ; grey
sta COLUP0
sta COLUP1
lda #0
sta HideGFX
sta HideGFX+1
sta HideGFX+2
sta HideGFX+3
sta HideGFX+4
lda #18
sta ShowCount
lda #<Graphics
sta PTR18
lda #>Graphics
sta PTR18+1
sta WSYNC
sta RESBL ; position ball over 1st sprite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;
; Main program loop
;
NewFrame:
lda #$02 ; syncronize frame
sta WSYNC
sta VSYNC
sta WSYNC
sta WSYNC
sta WSYNC
lda #$00
sta VSYNC
lda #43 ; Vblank for 37 lines
sta TIM64T
Joystick:
lda SWCHA
and #%11000000 ; right & left of player0
cmp LastJoy
beq JEnd
sta LastJoy
lda LastJoy
bpl Right
asl
bpl Left
JEnd: jmp VblankLoop
Right:
ldx ShowCount
dex
bpl R1
jmp VblankLoop
R1: jmp ChangeGFX
Left:
ldx ShowCount
inx
cpx #19
bne ChangeGFX
jmp VblankLoop
ChangeGFX:
stx ShowCount
lda HideData1,x
sta HideGFX
lda HideData2,x
sta HideGFX+1
lda HideData3,x
sta HideGFX+2
lda HideData4,x
sta HideGFX+3
lda HideData5,x
sta HideGFX+4
VblankLoop:
lda INTIM
bne VblankLoop
sta WSYNC
sta VBLANK
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DisplayStart:
lda HideGFX+2
sta PF0
tsx
stx SaveStack
ldx #%00000010 ; enable ball, when leftmost (18th)
lda ShowCount ; sprite is invisible
cmp #18
bne H0
ldx #0
H0: stx ENABL
ldx HideGFX+4
txs
ldy #12
sta WSYNC
H1: lda (PTR18),y
sta GRP0
asl ; make up for uneven sprite positioning
sta GRP1
lda HideGFX+1
ldx HideGFX+3
sta RESP0
sta RESP1
sta RESP0 ; create multiple sprites by hitting RESPx
sta RESP1 ; before all 3 copies have been drawn
sta PF2
nop
sta RESP0 ; again
sta RESP1
stx PF1
nop
sta RESP0 ; and again
sta RESP1
tsx
stx PF2
sta RESP0 ; and again
sta RESP1
lda HideGFX
sta.a PF1 ; absolute addressing to waste an extra cycle
dey
bpl H1
ldx SaveStack
txs
ldy #179
H2: sta WSYNC
dey
bne H2
lda #$02
sta VBLANK
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
OverscanStart: lda #35 ;skip 30 lines (overscan)
sta TIM64T
Animate:
lda AnimCount ; flip between animation frames
clc ; every 32 TV frames
adc #$08
sta AnimCount
bne OverscanLoop
lda PTR18
eor #$10
sta PTR18
OverscanLoop:
lda INTIM
bne OverscanLoop
sta WSYNC
jmp NewFrame
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
ORG $f400
Graphics:
.byte %00000000
.byte %00001010
.byte %00010001
.byte %00010101
.byte %00001110
.byte %00011111
.byte %00011111
.byte %00010101
.byte %00011111
.byte %00001110
.byte %00001110
.byte %00000100
.byte %00000100
.byte 0,0,0
.byte %00000000
.byte %00010101
.byte %00001010
.byte %00000100
.byte %00001010
.byte %00011111
.byte %00011111
.byte %00010101
.byte %00011111
.byte %00001110
.byte %00001110
.byte %00000100
.byte %00000100
HideData1: ; PF1 left
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111111
.byte %00111100
.byte %00110000
.byte %00000000
.byte %00000000
HideData2: ; PF2 left
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %00111111
.byte %00001111
.byte %00000011
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
HideData3: ; PF0
.byte %11110000
.byte %11110000
.byte %11110000
.byte %11110000
.byte %11110000
.byte %11110000
.byte %11110000
.byte %11110000
.byte %11110000
.byte %00110000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
HideData4: ; PF1 right
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111111
.byte %11111100
.byte %11110000
.byte %11000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
HideData5: ; PF2 right
.byte %11111111
.byte %00111111
.byte %00001111
.byte %00000011
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;
; Set up the 6502 interrupt vector table
;
ORG $fffc
Reset .word Cart_Init
IRQ .word Cart_Init
END
--
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] 18 extra lives, Eckhard Stolberg | Thread | [stella] AOL anti-timer -- Recommen, timer930 |
| Re: [stella] 18 extra lives, Eckhard Stolberg | Date | [stella] AOL anti-timer -- Recommen, timer930 |
| Month |