Jump to content
IGNORED

Having some issues with define space (ds) and Playfield


Recommended Posts

Hey y'all. Having some issues regarding defining spaces. I know that it is extremly important when it comes to setting certain spaces for things in Ram so I really want to get it right. THis is my code now, all help (and pointers) are greatly appreciated

 

; '2600 for Newbies
; Session 21 - Sprites
; This kernel draws a simple box around the screen border
; Introduces sprites
processor 6502
include "vcs.h"
include "macro.h"
;----------------------------------------------------------
PATTERN = $80
TIMETOCHANGE = 120
Playfield_Length = 3
;---------------------------------------------------------
;I Figured
SEG.U vars
ORG $80
MyPF0 ds 3
MyPF1 ds 3
MyPF2 ds 3
;------------------------------------------------------------------------------
SEG code
ORG $F000
Reset
; Clear RAM and all TIA registers
ldx #0
lda #0
Clear sta 0,x
inx
bne Clear
;------------------------------------------------
; Once-only initialisation...
lda #$45
sta COLUPF ; set the playfield colour
lda #$56
sta COLUP0
lda #$67
sta COLUP1
lda #%00000000
sta CTRLPF ; reflect playfield
;------------------------------------------------
LDA #0
STA PATTERN
MyPF0
.byte %01010101
.byte %10101010
.byte %01010101
MyPF1
.byte %10101010
.byte %01010101
.byte %10101010
MyPF2
.byte %01010101
.byte %10101010
.byte %01010101
StartOfFrame
; Start of new frame
; Start of vertical blank processing
lda #0
sta VBLANK
lda #2
sta VSYNC
sta WSYNC
sta WSYNC
sta WSYNC ; 3 scanlines of VSYNC signal
lda #0
sta VSYNC
;------------------------------------------------
; 37 scanlines of vertical blank...
ldx #0
VerticalBlank sta WSYNC
inx
cpx #37
bne VerticalBlank
;------------------------------------------------
; Do 192 scanlines of colour-changing (our picture)
LDX #192
Tick
CPX Playfield_Length+1
BCC WRITEIN
LDA #%11111111
STA PF0
STA PF1
STA PF2
THISISEND
STA WSYNC
dex
BNE Tick
;------------------------------------------------
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
WRITEIN
LDA MyPF0,X
STA PF0
LDA MyPF1,X
STA PF1
LDA MyPF2,X
STA PF2
JMP THISISEND
;------------------------------------------------------------------------------
ORG $FFFA
InterruptVectors
.word Reset ; NMI
.word Reset ; RESET
.word Reset ; IRQ
END
In my IDE its saying that I have a label mismatch with MYPF0-2 in the WRITEIN method. That might have something to do withit
Link to comment
Share on other sites

The top part of your assembly is defining MyPF#'s as Ram variables, but you used those same labels as Rom data tables. Which do you want them to be (Ram or Rom)? If you want to use Ram (so that the playfield can be altered during the program), You need to copy the data into them. If you just want a static playfield (Rom), do not define them as variables up top.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...