Jump to content
IGNORED

help with movable objects


ClintTX
 Share

Recommended Posts

I'm having a hard time understanding movable objects and how to control how tall they are and where they are drawn. I've been through the Andrew Davie tutorial, but I just don't understand. I'm using his background for a base program, and I'm just trying to understand the player 0 right now. I made GRP0 8 bits wide, and got it on the screen, but I don't know why it is where it is and I would like to be able to make it only 1 line tall. Here is what I have so far.

 

 

learning.asm

learning.bin

Link to comment
Share on other sites

TIA's a scanline based video chip, as such it has no concept of Y. Therefore it's up to your program to keep track of which row of the screen is currently being drawn, and whether or not the sprite shows up on that row.

 

Here's a replacement for your Picture section of code that will draw player0 on just 1 scanline:

 

                ldx #0 
                stx GRP0        ; make sure player 0 is off
Picture:
                inx 
                stx COLUBK                 
                lda #0          ; assume we're not going to draw player0
                cpx #100        ; are we on line 100?
                bne skip        ; if not, skip over the next instruction
                lda #%11111111  ; we are, so draw player 0
skip:           sta GRP0        ; set shape of player 0 for current scanline
                sta WSYNC 
                cpx #192
                bne Picture		 

Minor tip - always end labels with a colon, makes it so you can easily search for where the label is - ie search for "skip:" only has 1 hit, while "skip" has multiple. In a short program it's not a biggie, but as your code gets larger it's really useful.

Link to comment
Share on other sites

Oh, thank you. Finally something has clicked a little for me and now I can understand more how the kernel works. What text editor do you use for programming? I downloaded some of your source files, like for collect mini, but I guess there is some formatting issues and the code is all in a single paragraph. Do I need to save it as something other than a text file, like an RTF, or use the same text editor that you have?

Link to comment
Share on other sites

Great! Glad it's starting to make sense. Coding for the Atari is unlike anything else I've ever done, which is a large part of the attraction.

 

 

I'm using a Mac where end of line is denoted by Line Feed (LF). Linux/Unix uses the same, so I suspect you're on Windows where it's Carriage Return + Line Feed (CR+LF). Older Macs (running OS 9 or earlier) used Carriage Return (CR).

 

I use jEdit, which was written in Java thus runs on most platforms. It recognizes all the different end-of-line characters so any sourse will load and display correctly.

 

jEdit can be configured for syntax highlighting (helps you spot typos), compile your source via DASM, and launch the resulting ROM via Stella. This topic shows some examples and I have a series of jEdit blog entries that go into specifics.

Link to comment
Share on other sites

Is there a way to get player 0 to be all the way to the left using just the RESP0 strobe? I thought if it was done during the horizontal blanking then P0 should appear at the 1st visible pixel drawn or is this the best positioning that can be done without using a horizontal movement register?

 

Now I can't figure out how to attach something to the post, I did it before, but I don't see an option to anymore.

Edited by ClintTX
Link to comment
Share on other sites

Is there a way to get player 0 to be all the way to the left using just the RESP0 strobe? I thought if it was done during the horizontal blanking then P0 should appear at the 1st visible pixel drawn or is this the best positioning that can be done without using a horizontal movement register?

I've not tried to do that before, but it doesn't look to work that way. Closest I could get was this, which put it at 159 (1 pixel to the left of where you wanted it):

                sta WSYNC
                SLEEP 71    
                sta RESP0   

This put it at 2:

                sta WSYNC
                SLEEP 72    
                sta RESP0   

while this put it at 3:

                sta WSYNC
                sta RESP0   

 

Now I can't figure out how to attach something to the post, I did it before, but I don't see an option to anymore.

The bottom-right corner of the text box probably has a "More Reply Options" button. Click it to see the Attach Files options.
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...
 Share

  • Recently Browsing   0 members

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