Jump to content
IGNORED

The Celery Game (was:"Screen rolls at the start")


Recommended Posts

So I have been trying to get into ASM 2600 coding. I've been reading the tutorial by Andrew Davie (the link to DASM is dead, by the way). I have a program that displays a celery stalk, but it rolls for a few seconds before it sits still. I noticed that the first program that Andrew put on there does the same thing on Harmony. I was wondering if there is a way to stop it so it doesn't do that. Take a look at my code and perhaps see why it would do that.

celery.asm

Edited by atari2600land
Link to comment
Share on other sites

Very interesting atari2600land, I tried this on 2600 and it rolls slowly and continuously on both my classic tube TV and also on my plasma set.

 

Thing is stella shows the scanline count is stable at 262 so there's no real reason for it to roll unless you've selected the wrong background color - I've seen this occur before with just the right shade of red for the background but that only affected the plasma display (emulated NTSC), you've found a hue that can take down CRT's! :)

 

I changed the background to black where you load COLUBK and the display is stable:

 

Celery.bin

Link to comment
Share on other sites

		lda #0
		sta PF1
			
                inx
                cpx #192
                bne Celery
		
                sta VBLANK          ; end of screen - enter blanking


When you're done with your Kernel you need to store 2 in VBLANK to turn off the image output, looks like you're storing 0. If you don't turn off video output it can interfere with the sync signal.

Link to comment
Share on other sites

You're setting to to 0 again at StartOfFrame. Instead of this:

StartOfFrame:
                lda #0
                sta VBLANK
                lda #2
                sta VSYNC	



Do this:
StartOfFrame:
                lda #2
                sta VSYNC	



Then set it to 0 before you start to draw the screen:
                lda #0
                sta VBLANK                
Picture: 
                sta WSYNC



basically storing 2 will turn off video output, storing 0 will turn on video output. If video output is on it can interfere with the sync signal.

Adding a colon at the end of each label helps if you need to search for routine. Search for "Picture:" takes you to the routine, search for "Picture" takes you to anyplace that references the routine.

Have you checked out Collect? Step 1 is how to generate a stable display.
Link to comment
Share on other sites

This is part of your rolling problem:

                lda #2
                sta VSYNC	
                sta WSYNC
                sta WSYNC
                sta WSYNC               ; 3 scanlines of VSYNC signal
                lda #0
                sta VSYNC    

Change it to this:

                lda #2
                sta WSYNC   ; ADDED
                sta VSYNC	
                sta WSYNC
                sta WSYNC
                lda #0      ; MOVED
                sta WSYNC               ; 3 scanlines of VSYNC signal
                sta VSYNC   

At that point you will see your scanlines are now 263, so you will have to change "Overscan" so that it does 1 less loop.

 

 

You also need to write "2" to VBLANK at the bottom (after you have drawn the screen), and "0" to VBLANK at the top (before you draw the screen).

Link to comment
Share on other sites

I put

lda #2
sta VBLANK

inside the Overscan area.

I've made a few changes and here's what I have now. I'm going to use a dot of the eye for the ball or, if I can, a missile.

In batariBasic, you cannot use certain missiles with an asymmetrical playfield. Does assembly have the same limitations?

 

 

celery20160709.zip

post-9475-0-30245300-1468113938_thumb.png

Edited by atari2600land
  • Like 1
Link to comment
Share on other sites

OK, just discovered some really interesting things.

#1 - RESM1 actually does something. It determines where missile 1's X spot is.

#2 - Activating missiles at certain spots in the code makes the missile show up. You can control the height of the missile by how long it's activated. For example, I put missile1y's starting code at the beginning of the eye part. And ended it at the end of the eye part. Thus, I was able to draw the dot of the eye using the missile. Nowhere is this stuff mentioned that I've seen anyway, so I had to discover it myself.

 

post-9475-0-39509900-1468122878_thumb.png

celery5.zip

Link to comment
Share on other sites

Omega's post fixed the rolling, but now the display is all ugly:

attachicon.gifcelery2222.png

How would I get the black areas to be white like they were? (Current code is attached.)

When you screen is set up properly you will have 262 line with a black bar at the top and bottom something like this:

 

post-7074-0-35592800-1468169257_thumb.png

 

Those black bars are where VBLANK has '2' written to it. You should set up your screen to be like this. What you will need to change in your code is drawing a certain amount of empty lines below your celery stick before writing '2' to VBLANK.

 

 

I also read another post that you are discovering some new things "RESM1" and missile height. This is good but keep going through Andrew's and Darrell's tutorials otherwise you will be hitting quite a few walls that you don't need to.

Link to comment
Share on other sites

The MiniDig is an ancient site, from ancient times (when the Stella Programmers mailing List was still active), which ultimately collected all the bits and pieces that all its participants put in there over the years from 1995 until... around 2004 or so....

 

It is an indispensable treasure trove of documentation, and my personal favorite, COMMENTED DISASSEMBLIES. There are also some small discussions on certain tricks (early HMOVE, the 6-digit score kernel, etc..etc..etc..), and a few bits of demo code.

 

-Thom

Edited by tschak909
Link to comment
Share on other sites

I have managed to put a little vegetarian in my game. The problem is, he's tiny. If he's 6 feet tall, that makes the celery 600 feet tall or so. I don't remember pixels being so small in 2600 games. Oh well. Since I am determined to make a thing out of this, I am going to make it like Street Racer, where the little guys are down at the bottom and so is a machine to kill them. A vegetarian incinerator if you will. The object of the game is to position the incinerator's y position to the same vegetarian's. Since I don't know how to do otherwise, all the action will take place at the bottom of the screen. I tried inserting the code from the Collect game, but it didn't want to work, so I had to manually draw the guy using 7 horizontal pixel lines. Enough for today, though. It's too hot to work on this longer. Angry + hot = sweating.

celery6.zip

Link to comment
Share on other sites

The hard part I think will be displaying a sort of score. I want to keep it as simple as possible, like the scoring in Superman. All the scores I use in my Odyssey 2 games are four digits, so it should be plenty. But that's a long way off at this point, one of the last things I think I'll work on.

Link to comment
Share on other sites

scores aren't too bad, you have a bit of help actually with the 6502, it has a BCD mode, which can be mapped directly to score digits. Look at Collect for a quick example, and look at the 6 digit score kernel on the miniDig for the other major type of score display.

 

-Thom

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