Serguei2 Posted February 17, 2004 Share Posted February 17, 2004 I gave it a try to make my own playfield. I got strange results: ;Scrolling color border thingy processor 6502 include "vcs.h" include "macro.h" SEG ORG $F000 Reset ; Clear RAM and all TIA registers ldx #0 lda #0 Clear sta 0,x inx bne Clear ;------------------------------------------------ ; Once-only initialisation... ;lda #0 lda #$45 sta COLUPF ; set the playfield colour lda #$1F sta COLUBK ; set the playfield colour lda #%00000001 sta CTRLPF ; reflect playfield StartOfFrame ; Start of vertical blank processing lda #0 sta VBLANK lda #2 sta VSYNC ; 3 scanlines of VSYNCH signal... sta WSYNC sta WSYNC sta WSYNC lda #0 sta VSYNC sta WSYNC ; 37 scanlines of vertical blank... ldx #0 VerticalBlank sta WSYNC inx cpx #36 ; Now waiting 36 lines bne VerticalBlank DrawField ldx #0 ; this counts our scanline number lda #%11111111 ;lda #%00000000 sta PF0 sta PF1 sta PF2 Top2 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #15 bne Top2 lda #%11111111 sta PF0 sta PF1 sta PF2 Top3 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #30 bne Top3 lda #%11111111 sta PF0 lda #%11111111 sta PF1 lda #%00001111 sta PF2 Top4 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #45 bne Top4 lda #%11111111 sta PF0 sta PF1 lda #%00000000 sta PF2 Top5 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #60 bne Top5 lda #%11111111 sta PF0 lda #%11110000 sta PF1 lda #%00000000 sta PF2 Middle sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #105 bne Middle lda #%00000000 sta PF0 sta PF1 sta PF2 Bottom1 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #120 bne Bottom1 lda #%11111111 sta PF0 lda #%11110000 sta PF1 lda #%00000000 sta PF2 Bottom2 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #135 bne Bottom2 lda #%11111111 sta PF0 sta PF1 lda #%00000000 sta PF2 Bottom3 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #150 bne Bottom3 lda #%11111111 sta PF0 sta PF1 lda #%00001111 sta PF2 Bottom4 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #165 bne Bottom4 lda #%11111111 sta PF0 sta PF1 sta PF2 Bottom5 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #192 bne Bottom5 lda #%0 ;lda #%11111111 sta PF0 sta PF1 sta PF2 ;------------------------------------------------ ;lda #%01000010 sta VBLANK ; end of screen - enter blanking ; 30 scanlines of overscan... ldx #0 Overscan sta WSYNC inx cpx #30 bne Overscan jmp StartOfFrame ;------------------------------------------------------------------------------ ORG $FFFA InterruptVectors .word Reset ; NMI .word Reset ; RESET .word Reset ; IRQ END Quote Link to comment Share on other sites More sharing options...
Serguei2 Posted February 17, 2004 Author Share Posted February 17, 2004 Later I add more lines and I got a better results: ;Scrolling color border thingy processor 6502 include "vcs.h" include "macro.h" SEG ORG $F000 Reset ; Clear RAM and all TIA registers ldx #0 lda #0 Clear sta 0,x inx bne Clear ;------------------------------------------------ ; Once-only initialisation... ;lda #0 lda #$45 sta COLUPF ; set the playfield colour lda #$1F sta COLUBK ; set the playfield colour lda #%00000001 sta CTRLPF ; reflect playfield StartOfFrame ; Start of vertical blank processing lda #0 sta VBLANK lda #2 sta VSYNC ; 3 scanlines of VSYNCH signal... sta WSYNC sta WSYNC sta WSYNC lda #0 sta VSYNC sta WSYNC ; 37 scanlines of vertical blank... ldx #0 VerticalBlank sta WSYNC inx cpx #36 ; Now waiting 36 lines bne VerticalBlank DrawField ldx #0 ; this counts our scanline number lda #%11111111 ;lda #%00000000 sta PF0 sta PF1 sta PF2 Top2 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #15 bne Top2 lda #%11111111 sta PF0 sta PF1 sta PF2 Top3 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #30 bne Top3 lda #%11111111 sta PF0 lda #%11111111 sta PF1 lda #%00001111 sta PF2 Top4 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #45 bne Top4 lda #%11111111 sta PF0 sta PF1 lda #%00000000 sta PF2 Top5 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #60 bne Top5 lda #%11111111 sta PF0 lda #%11110000 sta PF1 lda #%00000000 sta PF2 Middle sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #75 bne Middle lda #%00000000 sta PF0 sta PF1 sta PF2 Middle2 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #90 bne Middle2 lda #%00000000 sta PF0 sta PF1 sta PF2 Middle3 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #105 bne Middle3 lda #%00000000 sta PF0 sta PF1 sta PF2 Bottom1 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #120 bne Bottom1 lda #%11111111 sta PF0 lda #%11110000 sta PF1 lda #%00000000 sta PF2 Bottom2 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #135 bne Bottom2 lda #%11111111 sta PF0 sta PF1 lda #%00000000 sta PF2 Bottom3 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #150 bne Bottom3 lda #%11111111 sta PF0 sta PF1 lda #%00001111 sta PF2 Bottom4 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #165 bne Bottom4 lda #%11111111 sta PF0 sta PF1 sta PF2 Bottom5 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #192 bne Bottom5 lda #%0 ;lda #%11111111 sta PF0 sta PF1 sta PF2 ;------------------------------------------------ ;lda #%01000010 sta VBLANK ; end of screen - enter blanking ; 30 scanlines of overscan... ldx #0 Overscan sta WSYNC inx cpx #30 bne Overscan jmp StartOfFrame ;------------------------------------------------------------------------------ ORG $FFFA InterruptVectors .word Reset ; NMI .word Reset ; RESET .word Reset ; IRQ END I'm wondering if I have problem with DASM or 2600 works this way? Serguei2 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted February 17, 2004 Share Posted February 17, 2004 If you want it to look like the lower picture, your problem is, that you first wait and then draw (Middle). But you have to draw first, and then wait until you change the pattern again. Quote Link to comment Share on other sites More sharing options...
Serguei2 Posted February 17, 2004 Author Share Posted February 17, 2004 Hi Thomas I used Andrew's tutorial 15 to make my own playfield. you first wait and then draw (Middle) But the Middle codes looks like the other codes (Top2, Top3...) they work. So what's wrong with Middle codes? Serguei2 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted February 17, 2004 Share Posted February 17, 2004 So what's wrong with Middle codes? I've added some comments to your code. Middle sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #105 bne Middle lda #%00000000; we are at line 105 now sta PF0 ; and *now* we start drawing the middle sta PF1 sta PF2 Bottom1 sta WSYNC lda #$45 sta COLUPF lda #0 inx cpx #120 ; middle lasts until line 120 bne Bottom1 lda #%11111111; here the bottom starts sta PF0 lda #%11110000 sta PF1 lda #%00000000 sta PF2 Quote Link to comment Share on other sites More sharing options...
Serguei2 Posted February 17, 2004 Author Share Posted February 17, 2004 Thanks Thomas I'll check it out. Serguei Quote Link to comment Share on other sites More sharing options...
Serguei2 Posted February 17, 2004 Author Share Posted February 17, 2004 Thanks Thomas I'll check it out. Serguei Oops... Quote Link to comment Share on other sites More sharing options...
Serguei2 Posted February 17, 2004 Author Share Posted February 17, 2004 Big thanks Thomas It works. Serguei2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.