|
Subject: [stella] DD Build 0002 From: Glenn Saunders <cybpunks2@xxxxxxxxxxxxx> Date: Sat, 22 Sep 2001 00:33:56 -0700 |
Glenn Saunders - Producer - Cyberpunks Entertainment Personal homepage: http://www.geocities.com/Hollywood/1698 Cyberpunks Entertainment: http://cyberpunks.uni.cc
;Death Derby 2001
; By Glenn Saunders
;LINEAGE:
; How to Draw an Asymmetric Reflected Playfield
; by Roger Williams
; Reflected mode modifications by Glenn Saunders
; with a lot of help from Nick Bensema
; (this started out as his "How to Draw a Playfield")
;Roger Williams:
; For comparison, I have tightened up Nick's code
; just a little by eliminating all the subroutine
; calling overhead, which is more like how a real
; game would work, and eliminated the scrolling and
; color effects to isolate them from the pure act of
; displaying a bitmap.
;
processor 6502
include vcs.h
org $F000
Temp = $80
ScanLine = $90
ScanPix = $91
PFColorRAM = $92
;FrameCounter = $93 was going to try some color cycling
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
MainLoop
LDX #0 ;vertical blank
LDA #2
STA WSYNC
STA WSYNC
STA WSYNC
STA VSYNC ;Begin vertical sync.
STA WSYNC ; First line of VSYNC
STA WSYNC ; Second line of VSYNC.
LDA #44 ;init timer for overscan
STA TIM64T
STA WSYNC ; Third line of VSYNC.
STA VSYNC ; (0)
LDA #0
STA COLUBK ; Background will be black.
VBLOOP LDA INTIM
BNE VBLOOP ; Whew!
STA WSYNC
STA VBLANK ;End the VBLANK period with a zero.
LDA #$34 ; set playfield color to deep red
STA COLUPF
LDA PF_Reflect
STA CTRLPF ; set playfield to reflect - G.S.
LDA #0
;
STA COLUP0
STA COLUP1; blacking out player colors
;STA PFColorRAM
;
LDA #200
STA ScanLine
LDA #6
STA ScanPix
;
; The height of the screen is not an even multiple of 36
; (the character height including blank.) Here we waste
; the extra lines.
;
; NB we may do away with this by adding 2 scans to each
; char in the blank or fore and aft bigpix lines
;
LDA #0
STA PF0
STA PF1
STA PF2; zero out playfield
LDX #12 ; 12 lines of padding
VPosition
STA WSYNC
DEC ScanLine
DEX
BNE VPosition
LDX #16 ; reserve 16 scanlines for the score
DrawScore
STA WSYNC
DEC ScanLine
DEX
BNE DrawScore
LDX #6
TopBorder
LDA SafeZone
STA PF0; this is the only write to PF0 necessary for the screen
LDA #$FF
STA PF1
STA PF2
STA WSYNC
ScanLoop
DEC ScanPix ;next screen pixel line
BNE ScanGo
LDA #5
STA ScanPix
DEX ;next big pixel line
BNE ScanGo
LDX #6
ScanGo
STA WSYNC
; Time to begin cycle counting
; 0
STA.W HMOVE ;+4 4
;will probably have to do an HMOVE on every line to
;simplify logic. HMOVE is only necessary for the missiles
LDA PFData1,X ;+4 8
STA PF1 ;+3 = *11* < 29 ;PF1 visible
LDA PFData2,X ;+4 15
STA PF2 ;+3 = *19* < 40 ;PF2 visible
nop ;+2 20
nop ;+2 22
nop ;+2 24
nop ;+2 26
nop ;+2 28
nop ;+2 30
nop ;+2 32
nop ;+2 34
LDA PFData1b,X ;+4 38
;PF1 no longer visible, safe to rewrite
STA PF1 ;+3 = *41*
LDA PFData2b,X ;+3 44
;PF2 rewrite must begin at exactly cycle 45!!, no more, no less
STA PF2 ;+3 = *47* ; > 46 PF2 no longer visible
DEC ScanLine
BNE ScanLoop
;
LDA #2
STA WSYNC ;Finish scanline 189.
DoBorder
LDA #$FF
STA PF1
STA PF2
STA WSYNC
;STA WSYNC
STA VBLANK ; Make TIA output invisible,
;
LDA #0
STA PF0
STA PF1
STA PF1
STA GRP0
STA GRP1
STA ENAM0
STA ENAM1
STA ENABL
OverScan
LDX #22
KillLines
STA WSYNC
DEX
BNE KillLines
JMP MainLoop ;Continue forever.
org $FF00 ; *********************** GRAPHICS DATA
; REFLECTED PLAYFIELD
; PF0| PF1 | PF2 | PF2b | PF1b |PF0b|
; 4567|76543210|01234567|76543210|01234567|7654|
SafeZone ; 7654----
.byte %10000000
PFData1 ;EA 7 6 5 4 3 2 1 0
.byte %00000000
.byte %00000000
.byte %11101010
.byte %10001010
.byte %11001110
.byte %10001010
.byte %11100100
PFData2 ;TH 0 1 2 3 4 5 6 7
.byte %00000000
.byte %00000000
.byte %01010010
.byte %01010010
.byte %01110010
.byte %01010010
.byte %01010111
PFData2b ;DE 76543210;<--- scanning order
.byte %00000000
.byte %00000000
.byte %01100111
.byte %01010100
.byte %01010110
.byte %01010100
.byte %01100111
PFData1b;RB 01234567;<--- scanning order
.byte %00000000
.byte %00000000
.byte %01101010
.byte %10101010
.byte %01100110
.byte %10101010
.byte %01100110
org $FFFC
.word Start
.word Start
Attachment:
DD_0002.bin
Description: Binary data
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [stella] Asymmetrical Reflected, Erik Mooney | Thread | RE: [stella] DD Build 0002, Brian Prescott |
| Re: [stella] Asymmetrical Reflected, Glenn Saunders | Date | RE: [stella] DD Build 0002, Brian Prescott |
| Month |