Jump to content
IGNORED

Newbie: Player Missle Graphics + Assembly


chriscam

Recommended Posts

Hello,

 

First, gotta say how happy I am that you all are here! You have totally inspired me to break out my old A800 and code binge. Thank you! Hopefully you will be kind to a newbie... I have many questions but I promise not to be annoying. ;)

 

Ok, so, I decided to take the plunge into assembly, and am both studying and assembling the following PMG example:

 

Assembly Language Programming for the Atari Computers, by By Mark Chasin

Chapter 10,

http://www.atariarchives.org/alp/chapter_10.php

 

The Problem:

Clearing out the PM area of memory doesn't really clear anything, but rather stores alot of data:

 

post-19087-1207995241_thumb.jpg

 

The offending code:

 

; ******************************
; Now clear out PM area of RAM
; ******************************
LDY #0      	;use as counter
LDA #0       	;byte to be stored
CLEAR
STA (XLOC),Y  	;clear 1st byte 
DEY        	;is page finished?
BNE CLEAR   	;page not done yet  
INC XLOC+1  	;page is done
LDA XLOC+1  	;on to next page
CMP STOTOP  	;are we done?
BEQ CLEAR   	;one more page
BCC CLEAR   	;keep going

 

When I remove the above section of code, everything appears normal, meaning my little tie fighter is drawn to the screen and there are no garbage bits elsewhere in the PM area.

 

Since this code is right out of the book, I assume it was *reasonably* tested. So, I'm at a complete loss.

 

Anyone know what could be going on?

 

Best regards,

Chris

Link to comment
Share on other sites

Corrected:

 

; ******************************
; Now clear out PM area of RAM
; ******************************
LDY #0      	;use as counter
CLEAR2
LDA #0       	;byte to be stored
CLEAR
STA (XLOC),Y  	;clear 1st byte 
DEY        	;is page finished?
BNE CLEAR   	;page not done yet  
INC XLOC+1  	;page is done
LDA XLOC+1  	;on to next page
CMP STOTOP  	;are we done?
BEQ CLEAR2   	;one more page
BCC CLEAR2   	;keep going

 

You basically only cleared the first page, and after that filled the pages with the high byte of the page pointer.

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