yllawwally Posted April 9, 2010 Share Posted April 9, 2010 Why am I getting value in lda (P0_Ptr),y must be <$100, when I compile. face9.txt Quote Link to comment Share on other sites More sharing options...
Wickeycolumbus Posted April 9, 2010 Share Posted April 9, 2010 (edited) You were handling your RAM in a strange way, which resulted in you mapping some of your variables where ROM is supposed to be. Attached is a fixed source face9.txt Edited April 9, 2010 by Wickeycolumbus Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted April 9, 2010 Share Posted April 9, 2010 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. Quote Link to comment Share on other sites More sharing options...
yllawwally Posted April 9, 2010 Author Share Posted April 9, 2010 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 Quote Link to comment Share on other sites More sharing options...
yllawwally Posted April 14, 2010 Author Share Posted April 14, 2010 OK I got it fixed. Here's code of it working. face11.txt Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted April 15, 2010 Share Posted April 15, 2010 I'm glad you got this working! You've taken a big step in programming and got something going on the screen. 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. 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.