Jump to content

Photo

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


152 replies to this topic

#1 atari2600land ONLINE  

atari2600land

    Waffles:

  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sat Jul 9, 2016 5:34 AM

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.

Attached Files


Edited by atari2600land, Sun Jul 10, 2016 8:42 PM.


#2 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,754 posts

Posted Sat Jul 9, 2016 9:49 AM

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:

 

Attached File  Celery.bin   2KB   69 downloads



#3 Lumi OFFLINE  

Lumi

    Star Raider

  • 81 posts

Posted Sat Jul 9, 2016 10:42 AM

That's really weird. What happens if you try setting COLUBK to $00 during vertical blank and overscan?



#4 SpiceWare OFFLINE  

SpiceWare

    Draconian

  • 11,662 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Sat Jul 9, 2016 1:02 PM

		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.



#5 atari2600land ONLINE  

atari2600land

    Waffles:

  • Topic Starter
  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sat Jul 9, 2016 2:20 PM

Changing that to two makes it roll continuously.



#6 BNE Jeff ONLINE  

BNE Jeff

    Moonsweeper

  • 295 posts
  • Location:Virginia, USA

Posted Sat Jul 9, 2016 2:30 PM

Not sure if it matters but I think you are turning off VBLANK before your vertical blank loop starts


Edited by BNE Jeff, Sat Jul 9, 2016 2:32 PM.


#7 BNE Jeff ONLINE  

BNE Jeff

    Moonsweeper

  • 295 posts
  • Location:Virginia, USA

Posted Sat Jul 9, 2016 2:38 PM

Its working fine for me in Stella already, but I moved your VBLANK here and it still worked.

 

VerticalBlank  
                sta WSYNC
                inx
                cpx #37
                bne VerticalBlank
                lda #0
                sta VBLANK


Edited by BNE Jeff, Sat Jul 9, 2016 2:49 PM.


#8 SpiceWare OFFLINE  

SpiceWare

    Draconian

  • 11,662 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Sat Jul 9, 2016 2:49 PM

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.



#9 Omegamatrix OFFLINE  

Omegamatrix

    Quadrunner

  • 6,137 posts
  • Location:Canada

Posted Sat Jul 9, 2016 3:01 PM

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



#10 atari2600land ONLINE  

atari2600land

    Waffles:

  • Topic Starter
  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sat Jul 9, 2016 3:36 PM

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

celery2222.png

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

Attached Files



#11 atari2600land ONLINE  

atari2600land

    Waffles:

  • Topic Starter
  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sat Jul 9, 2016 4:09 PM

I think I figured it out. Try this on your Harmony cart and see if it rolls. I did on mine and it didn't, but apparently my TV doesn't work as well as i thought, as post #2 proved.

Attached Files



#12 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,754 posts

Posted Sat Jul 9, 2016 6:51 PM

Looks good on my CRT, haven't checked the plasma.

 

What did you change from the black bottom image?



#13 atari2600land ONLINE  

atari2600land

    Waffles:

  • Topic Starter
  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sat Jul 9, 2016 7:24 PM

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?

 

 

Attached Thumbnails

  • celery4a_1.png

Attached Files


Edited by atari2600land, Sat Jul 9, 2016 7:25 PM.


#14 tschak909 OFFLINE  

tschak909

    Stargunner

  • 1,940 posts
  • Location:USA

Posted Sat Jul 9, 2016 7:27 PM

Atari2600, this is not a limitation of Batari per-se, but rather of the kernel in use. If you can find the time to enable the missile, you can use it.

 

-Thom



#15 atari2600land ONLINE  

atari2600land

    Waffles:

  • Topic Starter
  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sat Jul 9, 2016 9:54 PM

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.

 

Attached Thumbnails

  • celery5.png

Attached Files



#16 tschak909 OFFLINE  

tschak909

    Stargunner

  • 1,940 posts
  • Location:USA

Posted Sat Jul 9, 2016 11:19 PM

Do you have the Stella Programmers Guide? If not, you really need it.

 

-Thom



#17 Omegamatrix OFFLINE  

Omegamatrix

    Quadrunner

  • 6,137 posts
  • Location:Canada

Posted Sun Jul 10, 2016 10:55 AM

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:

 

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



#18 atari2600land ONLINE  

atari2600land

    Waffles:

  • Topic Starter
  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sun Jul 10, 2016 5:01 PM

Do you have the Stella Programmers Guide? If not, you really need it.

 

-Thom

Where do I find it?



#19 tschak909 OFFLINE  

tschak909

    Stargunner

  • 1,940 posts
  • Location:USA

Posted Sun Jul 10, 2016 5:04 PM

Where do I find it?

Get it here on this page: http://www.qotile.ne...nidig/docs.html

-Thom

Sent from my SM-G920F using Tapatalk

#20 SpiceWare OFFLINE  

SpiceWare

    Draconian

  • 11,662 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Sun Jul 10, 2016 5:22 PM

Where do I find it?


That's the first thing I cover in Collect.

#21 tschak909 OFFLINE  

tschak909

    Stargunner

  • 1,940 posts
  • Location:USA

Posted Sun Jul 10, 2016 6:16 PM

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, Sun Jul 10, 2016 6:16 PM.


#22 atari2600land ONLINE  

atari2600land

    Waffles:

  • Topic Starter
  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sun Jul 10, 2016 8:48 PM

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.

Attached Files



#23 tschak909 OFFLINE  

tschak909

    Stargunner

  • 1,940 posts
  • Location:USA

Posted Sun Jul 10, 2016 9:16 PM

I'm glad you finally made the jump to assembler. :)

 

-Thom



#24 atari2600land ONLINE  

atari2600land

    Waffles:

  • Topic Starter
  • 10,898 posts
  • Man's best invention. Ever.
  • Location:Salem, Oregon

Posted Sun Jul 10, 2016 9:30 PM

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.



#25 tschak909 OFFLINE  

tschak909

    Stargunner

  • 1,940 posts
  • Location:USA

Posted Sun Jul 10, 2016 10:14 PM

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 






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users