Subject: RE: [stella] Playfield Basics (newbie question) From: Rico Dones <wrbs@xxxxxxxxxx> Date: Tue, 05 Nov 2002 21:36:15 -0400 |
Thank you Dennis and Andrew for your help! After the corrections the code runs just fine. Thanks! 11/3/02 9:51:51 PM, "Dennis Debro" <ddebro@xxxxxxxxxxxxx> wrote: >Hi Rico! Welcome aboard. > >> I am learning how to draw a playfield. I have read Nick's famous >> playfield example and tried different variations that have >> been posted on the list. I have written a small program >> which only purpose is to draw a rectangle repeatedly >> from the top to the bottom of the screen (without worrying about the >> reflected portion of the screen). I initialized the playflied >> registers to draw something like this: >> >> * * * * * * * * * * * * * * * * >> * * >> * * >> * * >> * * >> * * >> * * >> * * * * * * * * * * * * * * * * > >Actually your rectangle is more like > * * * * * * * * * * * * * * * * * * * * > * * * > * * * > * * * > * * * > * * * > * * * > * * * * * * * * * * * * * * * * * * * * > >Change your $A0 to $80 for PFData2 to get the rectangle you're expecting > >See my comments below > >> ; Learning atari playfields >> ; >> ; Objective: Draw a rectangle many times >> ; using the playfield registers. >> ; >> >> processor 6502 >> include eckvcs.h >> org $F000 >> >> START >> SEI >> CLD >> LDX #$FF >> TXS >> LDA #0 >> >> CLEARMEM >> STA 0,X >> DEX >> BNE CLEARMEM >> LDA #$00 ; SET BACKGROUND BLACK >> STA COLUBK >> LDA #$1E ; SET PLAYFIELD YELLOW >> STA COLUPF >> >> MAINLOOP >> LDA #2 ; TURN ON VSYNC >> STA VSYNC >> STA WSYNC >> STA WSYNC >> STA WSYNC >> >> LDA #43 >> STA TIM64T >> LDA #0 ; TURN OFF VSYNC >> STA VSYNC >> >> VBLANKTIME >> LDA INTIM >> BNE VBLANKTIME > > STA WSYNC ; end the current scan line > STA VBLANK ; end VBLANK period >> >> LDX #7 ; Use X register to count >> ; eight playfield lines >> ; to draw. >> LDY #191 >> >> SCANLOOP >> STA WSYNC ; Accumulator is still 0 >; STA VBLANK ; remove the VBLANK from your drawing loop >> >> LDA PFData0,X >> STA PF0 >> LDA PFData1,X >> STA PF1 >> LDA PFData2,X >> STA PF2 >> >> DEX ; Decrement X. >> BNE SKIPINITX ; If X != 0 then skip next line >> LDX #7 ; Repeat playfield drawing >> ; by setting X to decimal 7. >> >> SKIPINITX >> >> DEY >> BNE SCANLOOP >> >> LDX #30 > STX WSYNC ; end current scan line > STX VBLANK ; Make TIA output invisible (bit 1 is set to 1) > STY PF0 ; clear the playfield registers > STY PF1 > STY PF2 >> >> OVERSCAN >> STA WSYNC >> DEX >> BNE OVERSCAN >> >> JMP MAINLOOP >> >> org $FF00 ; GRAPHICS DATA STARTS HERE >> >> ; Playfield graphic is supposed to look like this: >> ; >> ; * * * * * * * * * * * * * * * * >> ; * * >> ; * * >> ; * * >> ; * * >> ; * * >> ; * * >> ; * * * * * * * * * * * * * * * * >> ; >> >> PFData0 >> .byte $F0,$10,$10,$10,$10,$10,$10,$F0 >> >> PFData1 >> .byte $FF,$00,$00,$00,$00,$00,$00,$FF >> >> PFData2 >> .byte $FF,$A0,$A0,$A0,$A0,$A0,$A0,$FF >> >> >> ORG $FFFC >> .WORD START >> .WORD START > > > >---------------------------------------------------------------------------------------------- >Archives (includes files) at http://www.biglist.com/lists/stella/archives/ >Unsub & more at http://www.biglist.com/lists/stella/ > > > ---------------------------------------------------------------------------------------------- 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] Playfield Basics (newb, Dennis Debro | Thread | RE: [stella] Playfield Basics (newb, KirkIsrael |
Re: [stella] [POLL]What is everybod, Erik Eid | Date | RE: [stella] Playfield Basics (newb, KirkIsrael |
Month |