Jump to content
IGNORED

why am I getting value in lda (P0_Ptr),y must be <$100


yllawwally

Recommended Posts

You need to fix your segments for ram and code. Here's what I did to change it:

 

	processor 6502
include vcs.h
include macro.h
;;;	org $F000

;Variables ------

   SEG.U VARIABLES
   ORG $80

YPosFromBot ds 1 ; = $80;
VisiblePlayerLine ds 1 ; = $81;
PICS ds 1 ; = $82;
ROLLING_COUNTER ds 1 ; = $83;
Graphics_Buffer ds 1 ; = $84
;P0_YPosFromBot ds 1 ; = $85;
VisibleEnemyLine ds 1 ; = $86;
VisibleEnemyLineCurrent ds 1 ; = $87;
EnemyLineBuffer ds 1 ; = $88;
VisiblePlayerLineCurrent ds 1 ; = $90;
BG_0 ds 1 ; = $91;
BG_1 ds 1 ; = $92;
BG_2 ds 1 ; = $93;
MainPlayerGraphicsBuffer ds 1 ; = $94;

P0_YPosFromBot ds 2
P0_XPos ds 1	;horizontal position
P0_Y ds 1	;needed for skipdraw
P0_Ptr ds 2	;ptr to current graphic

P1_YPosFromBot ds 2
P1_XPos ds 1	;horizontal position
P1_Y ds 1	;needed for skipdraw
P1_Ptr ds 2	;ptr to current graphic


;a few constants...
C_GHOST_SPEED = 300	;subpixel, divide by 256 for pixel speed
C_P0_HEIGHT = 8		;height of ghost sprite
C_P1_HEIGHT = 8		;height of ghost sprite
C_KERNAL_HEIGHT = 192	;height of kernal (full screen, single line kernal)


; Constants ------
playerheight   = #8 ;;;   ds #8;

    SEG CODE
    ORG $F000

 

Note I also fixed "playerheight" as it is a constant. There was a problem with:

 

	lda #<EnemyGraphic 	;low byte of ptr is boo graphic
sta P0_Ptr		;(high byte already set)

lda #>EnemyGraphic ;high byte of graphic location
sta P0_Ptr+1	;store in high byte of graphic pointer

 

 

You need to change that to "EnemyGraphics" (with a "s"), because that is what the label is in your code.

Link to comment
Share on other sites

Thanks for the help. I can move around the character. However it seems that P0_Y isn't set properly. I'm not sure where I'm going wrong here. The graphics of the character simply shift through the memory , and you can see the proper graphics if you happen to have the character in just the right spot.

face10.txt

Link to comment
Share on other sites

I'm glad you got this working! You've taken a big step in programming and got something going on the screen. :thumbsup:

 

 

What was deadspace for? It seems to me that you should just be able to put an ORG statement before the start of your graphics and you should be fine. Start with ORG $FF00, and if you fill that page up you can then use ORG $FE00, etc.

 

 

I would recommend cleaning up your source file. It will be easier on yourself later (and also if others are reading it) if it's more aligned. Right now everything kind of shifts left-right all over the place. Once you do that things will start poping out at you more.

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...