|
Subject: Re: [stella] Useless Information Department From: Christopher Tumber <christophertumber@xxxxxxxxxx> Date: Fri, 20 Dec 2002 13:58:58 -0500 |
>I could think of it being useful as a grid pattern for board games, providing a higher resolution grid than you could get with playfield. Good thought! Check the attached boardgame.bin (I got tired of fidling with the positioning, it could probably be improved on). You'd need to be loading the "game pieces" drawing portion into RAM and then turn pieces on off between rows (ie: while drawing the vertical lines) because there's no time to do any calcs while drawing. Although I don't know if it's really any better than the playfield technique used in Activision's Checkers, Video Checkers or even the method used in Video Chess. Though I'm not using the playfield at all, except for the horizontal lines. You _may_ be able to use the playfield to do differently coloured squares, but lining them up would be tough and you'd probably want to use wider missiles for the vertical lines in order to hide any mis-alignment. >But then you'd still have to fill in the gaps with something. I'm assuming you can't manage a nonreflected playfield nor can you simultaneously do the RESP0 trick on the sprites with this trick, so you'd probably be limited to whatever you can do with the two players and the ball per line. Yeh, pretty much, or you can do like I did in boardgame.bin and go Missile/Player1/Missile/Player2. If 3 "game pieces" (2 player + ball) per row (or more with flicker) is enough then you could do a closer grid did than I did in "boardgame.bin" and instead you could go with "gridpattern.bin" and just position pieces through traditional methods. Or "gridpattern2.bin" which just uses missiles 1 and 2 with widths of 8 pixels. >I'm also thinking that depending on how precise you can get with the positioning of the cloned missile, if you used few enough of them per scanline you could potentially create denser starfields or more frantic shooters (think Gunfight) without having to rely on flicker as much. Hrm, you could probably use this to produce a big stream of bullets, but as with the sprite replication trick in general, getting it to interact with "normal" objects is going to be a bit of a chore (and moving the stream smoothly could be tricky...). Certainly not impossible though... See "bullets.bin" for a short example of this... >I'd love to see a demo snowfall or starfield effect using this entirely with just missiles and see how densely packed you can fill the screen with random dots. See "starfield.bin" which produces just such a display but with all pixels on (and no animation or anything). But again, the overhead for this is quite considerable and you don't have an awful lot of time to do anything on the scanlines where stars are drawn. And on scanlines where stars are not drawn, I know from Space Instigators that you're going to be spending a non-trivial amount of time priming the RAM routine to draw the "stars" (Actually, you could simplify things considerably by always making sure you have enough stars displayed that you never trigger any of the exceptions which are what really eat up CPU time...) All these examples do exhibit the "shifted one pixel left" problem at the right of the pattern, to fix this you need to increase the spacing between objects by 1 cycle (3 pixels) as per "starfield2.bin". You can move the pattern, as a whole, 1 cycle (3 pixels) a frame by adding/removing pauses before drawing (ie: NOPs) Heh, not quite so useless after all... Chris...
;BEWARE! NO STACK!!
processor 6502
include vcs.h
org $F000
Start
; SEI ; Disable interrupts, if there are any.
; CLD ; Clear BCD math bit.
; LDX #$FF
; TXS ; Set stack to beginning.
; LDA #0
;B1 STA 0,X
; DEX
; BNE B1
lda #0
sta PF0
sta PF1
sta PF2
lda #1
sta CTRLPF
lda #00
STA COLUBK
lda #0
STA COLUPF
sta GRP0
sta GRP1
sta HMCLR
lda #14
sta COLUP1
sta COLUP0
lda #1 ;+16
sta NUSIZ0 ;3 Cycles
sta NUSIZ1 ;3 Cycles
DrawLogo
LDX #0
LDA #2
STA VSYNC ;Begin vertical sync.
STA WSYNC ; First line of VSYNC
STA WSYNC ; Second line of VSYNC.
LDA #41
STA TIM64T
LDA #0
STA CXCLR
STA WSYNC ; Third line of VSYNC.
STA VSYNC ; (0)
DrawScreen
LDA INTIM
BNE DrawScreen ; Whew!
STA WSYNC
STA VBLANK ;End the VBLANK period with a zero.
ldx #29
nextstars:
sta WSYNC
lda #255
sta ENAM0
sta ENAM1
; nop
; nop
; nop
; nop
nop
nop
nop
nop
nop
nop
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
ldy #4
nextblankline2
sta WSYNC
lda #0
sta ENAM0
sta ENAM1
dey
bpl nextblankline2
dex
bpl nextstars
ldy #17
nextblankline:
sta WSYNC
dey
bne nextblankline
STA VBLANK ; Make TIA output invisible,
lda #35
sta TIM64T
OverscanWait:
lda INTIM
bne OverscanWait
JMP DrawLogo ;Continue forever.
Sprite1: .byte 24,60,126,255,126,60,24
Sprite2: .byte 153,90,60,255,60,90,153
org $FFFC
.word Start
.word Start
Attachment:
boardgame.bin
Description: Binary data
;BEWARE! NO STACK!!
processor 6502
include vcs.h
org $F000
Start
; SEI ; Disable interrupts, if there are any.
; CLD ; Clear BCD math bit.
; LDX #$FF
; TXS ; Set stack to beginning.
; LDA #0
;B1 STA 0,X
; DEX
; BNE B1
lda #0
sta PF0
lda #255
sta PF1
sta PF2
lda #1
sta CTRLPF
lda #00
STA COLUBK
lda #0
STA COLUPF
sta GRP0
sta GRP1
sta HMCLR
lda #14
sta COLUP1
sta COLUP0
lda #1 ;+16
sta NUSIZ0 ;3 Cycles
sta NUSIZ1 ;3 Cycles
DrawLogo
LDX #0
LDA #2
STA VSYNC ;Begin vertical sync.
STA WSYNC ; First line of VSYNC
STA WSYNC ; Second line of VSYNC.
LDA #41
STA TIM64T
LDA #0
STA CXCLR
STA WSYNC ; Third line of VSYNC.
STA VSYNC ; (0)
DrawScreen
LDA INTIM
BNE DrawScreen ; Whew!
STA WSYNC
STA VBLANK ;End the VBLANK period with a zero.
lda #255
sta ENAM0
sta ENAM1
ldy #14
nextrow:
sta WSYNC
lda #14
STA COLUPF
sta WSYNC
sta WSYNC
lda #0
STA COLUPF
ldx #8
nextvertical:
sta WSYNC
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
dex
bpl nextvertical
dey
bpl nextrow
sta WSYNC
lda #14
STA COLUPF
lda #0
sta ENAM0
sta ENAM1
sta WSYNC
sta WSYNC
lda #0
STA COLUPF
ldy #17
nextblankline:
sta WSYNC
dey
bne nextblankline
STA VBLANK ; Make TIA output invisible,
lda #35
sta TIM64T
OverscanWait:
lda INTIM
bne OverscanWait
JMP DrawLogo ;Continue forever.
Sprite1: .byte 24,60,126,255,126,60,24
Sprite2: .byte 153,90,60,255,60,90,153
org $FFFC
.word Start
.word Start
Attachment:
gridpattern.bin
Description: Binary data
;BEWARE! NO STACK!!
processor 6502
include vcs.h
org $F000
Start
; SEI ; Disable interrupts, if there are any.
; CLD ; Clear BCD math bit.
; LDX #$FF
; TXS ; Set stack to beginning.
; LDA #0
;B1 STA 0,X
; DEX
; BNE B1
lda #0
sta PF0
lda #255
sta PF1
sta PF2
lda #1
sta CTRLPF
lda #00
STA COLUBK
lda #0
STA COLUPF
sta GRP0
sta GRP1
sta HMCLR
lda #14
sta COLUP1
lda #54
sta COLUP0
lda #1+16+32 ;+16
sta NUSIZ0 ;3 Cycles
sta NUSIZ1 ;3 Cycles
DrawLogo
LDX #0
LDA #2
STA VSYNC ;Begin vertical sync.
STA WSYNC ; First line of VSYNC
STA WSYNC ; Second line of VSYNC.
LDA #41
STA TIM64T
LDA #0
STA CXCLR
STA WSYNC ; Third line of VSYNC.
STA VSYNC ; (0)
DrawScreen
LDA INTIM
BNE DrawScreen ; Whew!
STA WSYNC
STA VBLANK ;End the VBLANK period with a zero.
ldy #14
nextrow:
sta WSYNC
lda #00
STA COLUPF
lda #0
sta ENAM0
sta ENAM1
sta WSYNC
sta WSYNC
lda #0
STA COLUPF
ldx #8
nextvertical:
sta WSYNC
lda #255
sta ENAM0
sta ENAM1
; nop
; nop
; nop
; nop
nop
nop
nop
nop
nop
nop
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
sta RESM0
sta RESM1
dex
bpl nextvertical
dey
bpl nextrow
sta WSYNC
lda #00
STA COLUPF
lda #0
sta ENAM0
sta ENAM1
sta WSYNC
sta WSYNC
lda #0
STA COLUPF
ldy #17
nextblankline:
sta WSYNC
dey
bne nextblankline
STA VBLANK ; Make TIA output invisible,
lda #35
sta TIM64T
OverscanWait:
lda INTIM
bne OverscanWait
JMP DrawLogo ;Continue forever.
Sprite1: .byte 24,60,126,255,126,60,24
Sprite2: .byte 153,90,60,255,60,90,153
org $FFFC
.word Start
.word Start
Attachment:
gridpattern2.bin
Description: Binary data
;BEWARE! NO STACK!!
processor 6502
include vcs.h
org $F000
Start
; SEI ; Disable interrupts, if there are any.
; CLD ; Clear BCD math bit.
; LDX #$FF
; TXS ; Set stack to beginning.
; LDA #0
;B1 STA 0,X
; DEX
; BNE B1
lda #0
sta PF0
lda #255
sta PF1
sta PF2
lda #1
sta CTRLPF
lda #0
STA COLUBK
lda #0
STA COLUPF
sta GRP0
sta GRP1
sta HMCLR
lda #54
sta COLUP0
lda #14
sta COLUP1
lda #1 ;+16
sta NUSIZ0 ;3 Cycles
sta NUSIZ1 ;3 Cycles
DrawLogo
LDX #0
LDA #2
STA VSYNC ;Begin vertical sync.
STA WSYNC ; First line of VSYNC
STA WSYNC ; Second line of VSYNC.
LDA #41
STA TIM64T
LDA #0
STA CXCLR
STA WSYNC ; Third line of VSYNC.
STA VSYNC ; (0)
DrawScreen
LDA INTIM
BNE DrawScreen ; Whew!
STA WSYNC
STA VBLANK ;End the VBLANK period with a zero.
ldx #8
nexttworows:
ldy #1
nexthoriz:
sta WSYNC
lda #14
STA COLUPF
lda #255
sta PF1
lda #0
sta GRP0
sta GRP1
nop
nop
nop
nop
nop
nop
nop
nop
lda #127
sta PF1
dey
bpl nexthoriz
sta WSYNC
lda #0
STA COLUPF
lda #255
sta ENAM1
ldy #6
nextmissiledemo:
sta WSYNC
lda Sprite1,y
sta GRP0
lda Sprite2,y
sta GRP1
nop
nop
sta RESM1
sta RESP0
sta RESM1
sta RESP1
sta RESM1
sta RESP0
sta RESM1
sta RESP1
sta RESM1
sta RESP0
sta RESM1
sta RESP1
sta RESM1
sta RESP0
sta RESM1
dey
bpl nextmissiledemo
lda #0
sta GRP0
sta GRP1
ldy #1
nexthoriz2:
sta WSYNC
lda #14
STA COLUPF
lda #255
sta PF1
nop
nop
nop
nop
nop
nop
nop
nop
lda #127
sta PF1
dey
bpl nexthoriz2
sta WSYNC
lda #0
STA COLUPF
lda #255
sta ENAM1
ldy #6
nextmissiledemo2:
sta WSYNC
lda Sprite1,y
sta GRP0
lda Sprite2,y
sta GRP1
nop
nop
sta RESM1
sta RESP1
sta RESM1
sta RESP0
sta RESM1
sta RESP1
sta RESM1
sta RESP0
sta RESM1
sta RESP1
sta RESM1
sta RESP0
sta RESM1
sta RESP1
sta RESM1
dey
bpl nextmissiledemo2
lda #0
sta GRP0
sta GRP1
dex
beq donescreen
jmp nexttworows
donescreen:
ldy #1
nexthoriz3:
sta WSYNC
lda #14
STA COLUPF
lda #255
sta PF1
nop
nop
nop
nop
nop
nop
nop
nop
lda #127
sta PF1
dey
bpl nexthoriz3
sta WSYNC
lda #0
STA COLUPF
lda #0
sta ENAM0 ;GRP0
sta ENAM1 ;GRP1
sta GRP0
sta GRP1
ldy #18
nextblankline:
sta WSYNC
dey
bne nextblankline
STA VBLANK ; Make TIA output invisible,
lda #35
sta TIM64T
OverscanWait:
lda INTIM
bne OverscanWait
JMP DrawLogo ;Continue forever.
Sprite1: .byte 24,60,126,255,126,60,24
Sprite2: .byte 153,90,60,255,60,90,153
org $FFFC
.word Start
.word Start
Attachment:
starfield.bin
Description: Binary data
Attachment:
starfield2.bin
Description: Binary data
;BEWARE! NO STACK!!
processor 6502
include vcs.h
org $F000
Start
; SEI ; Disable interrupts, if there are any.
; CLD ; Clear BCD math bit.
; LDX #$FF
; TXS ; Set stack to beginning.
; LDA #0
;B1 STA 0,X
; DEX
; BNE B1
lda #0
sta PF0
sta PF1
sta PF2
lda #1
sta CTRLPF
lda #00
STA COLUBK
lda #0
STA COLUPF
sta GRP0
sta GRP1
sta HMCLR
lda #14
sta COLUP1
sta COLUP0
lda #1 ;+16
sta NUSIZ0 ;3 Cycles
sta NUSIZ1 ;3 Cycles
DrawLogo
LDX #0
LDA #2
STA VSYNC ;Begin vertical sync.
STA WSYNC ; First line of VSYNC
STA WSYNC ; Second line of VSYNC.
LDA #41
STA TIM64T
LDA #0
STA CXCLR
STA WSYNC ; Third line of VSYNC.
STA VSYNC ; (0)
DrawScreen
LDA INTIM
BNE DrawScreen ; Whew!
STA WSYNC
STA VBLANK ;End the VBLANK period with a zero.
ldx #29
nextstars:
sta WSYNC
lda #255
sta ENAM0
sta ENAM1
; nop
; nop
; nop
; nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
ldy #4
nextblankline2
sta WSYNC
lda #0
sta ENAM0
sta ENAM1
dey
bpl nextblankline2
dex
bpl nextstars
ldy #17
nextblankline:
sta WSYNC
dey
bne nextblankline
STA VBLANK ; Make TIA output invisible,
lda #35
sta TIM64T
OverscanWait:
lda INTIM
bne OverscanWait
JMP DrawLogo ;Continue forever.
Sprite1: .byte 24,60,126,255,126,60,24
Sprite2: .byte 153,90,60,255,60,90,153
org $FFFC
.word Start
.word Start
;BEWARE! NO STACK!!
processor 6502
include vcs.h
org $F000
Start
; SEI ; Disable interrupts, if there are any.
; CLD ; Clear BCD math bit.
; LDX #$FF
; TXS ; Set stack to beginning.
; LDA #0
;B1 STA 0,X
; DEX
; BNE B1
lda #0
sta PF0
sta PF1
sta PF2
lda #1
sta CTRLPF
lda #00
STA COLUBK
lda #0
STA COLUPF
sta GRP0
sta GRP1
sta HMCLR
lda #14
sta COLUP1
sta COLUP0
lda #0
sta $81
; lda table
; sta $82
; lda table+1
; sta $83
lda #20
sta $84
DrawLogo
LDX #0
LDA #2
STA VSYNC ;Begin vertical sync.
STA WSYNC ; First line of VSYNC
STA WSYNC ; Second line of VSYNC.
LDA #41
STA TIM64T
LDA #0
STA CXCLR
STA WSYNC ; Third line of VSYNC.
STA VSYNC ; (0)
DrawScreen
LDA INTIM
BNE DrawScreen ; Whew!
STA WSYNC
STA VBLANK ;End the VBLANK period with a zero.
lda $81 ;3
asl
tay
lda table,y ;5
sta $82 ;3
lda table+1,y ;5
sta $83 ;3
sta WSYNC
lda #255
sta ENAM0
sta ENAM1
jmp ($82) ;5 cycles
return:
lda #0
sta ENAM0
sta ENAM1
sta WSYNC
ldy #195
nextblankline:
sta WSYNC
dey
bne nextblankline
STA VBLANK ; Make TIA output invisible,
lda #35
sta TIM64T
OverscanWait:
lda INTIM
bne OverscanWait
lda #1 ;+16
sta NUSIZ0 ;3 Cycles
sta NUSIZ1 ;3 Cycles
dec $84
bne notreset
lda #20
sta $84
inc $81
lda $81
cmp #22
bne notreset
lda #0
sta $81
notreset:
JMP DrawLogo ;Continue forever.
stream1:
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream2:
nop
nop
nop
nop
nop
sta $80
; nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream3:
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream4:
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream5:
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream6:
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream7:
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream8:
nop
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream9:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream10:
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
jmp return
stream11:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
; sta.w RESM0
jmp return
stream12:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
; sta.w RESM0
jmp return
stream13:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
; sta.w RESM0
jmp return
stream14:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
; sta.w RESM0
jmp return
stream15:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
; sta.w RESM1
; sta.w RESM0
jmp return
stream16:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
; sta.w RESM1
; sta.w RESM0
jmp return
stream17:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
; sta.w RESM1
; sta.w RESM0
jmp return
stream18:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
sta.w RESM0
; sta.w RESM1
; sta.w RESM0
jmp return
stream19:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
; sta.w RESM0
; sta.w RESM1
; sta.w RESM0
jmp return
stream20:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
; sta.w RESM0
; sta.w RESM1
; sta.w RESM0
jmp return
stream21:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
; sta.w RESM0
; sta.w RESM1
; sta.w RESM0
jmp return
stream22:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
sta $80
sta.w RESM0
sta.w RESM1
sta.w RESM0
sta.w RESM1
; sta.w RESM0
; sta.w RESM1
; sta.w RESM0
jmp return
table: .word stream1,stream2,stream3,stream4,stream5,stream6,stream7,stream8,stream9,stream10,stream11,stream12,stream13,stream14,stream15,stream16,stream17,stream18,stream19,stream20,stream21,stream22
org $FFFC
.word Start
.word Start
Attachment:
bullets.bin
Description: Binary data
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [stella] Useless Information De, Glenn Saunders | Thread | [stella] DASM RPM's for Linux, Rob |
| Re: [stella] FE, 3F, Bankswitching,, Mickey Mouse | Date | [stella] Tree Hugger update, Billy Eno |
| Month |