Jump to content

Photo

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


148 replies to this topic

#26 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Mon Jul 11, 2016 12:53 AM

I have the screen rolling at the start program again.

Attached Files



#27 BNE Jeff OFFLINE  

BNE Jeff

    Moonsweeper

  • 288 posts
  • Location:Virginia, USA

Posted Mon Jul 11, 2016 4:37 AM

Overscan:     
                sta WSYNC

                inx
                cpx #52
                bne Overscan
               

 

52 lines of overscan?  Then you fall into more routines after that?  Also your VBLANK is missing again..



#28 tschak909 OFFLINE  

tschak909

    Stargunner

  • 1,819 posts
  • Location:USA

Posted Mon Jul 11, 2016 12:21 PM

Your code needs some sanity, either you have a main loop of like:

 

Start:

        CLEAN_START                     ; Handy macro that sets up the VCS

MainLoop:
        jsr VCNTRL
        jsr VBLANK
        jsr CHECKSWITCHES
        jsr DOMOTION
        jsr PREPSCOREFORDISPLAY
        jsr KERNEL
        jsr OVERSCAN
        jmp MainLoop

or you literally arrange the main part of your code to be synchronous with the TV beam, with each of these routines unrolled.

 

-Thom


Edited by tschak909, Mon Jul 11, 2016 12:22 PM.


#29 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Mon Jul 11, 2016 5:50 PM

OK, I put them in a main loop like you suggested and a comb line appeared! I don't know why. So not wanting that in there, I changed the COLUBK to 0 to "cover" it up, and changed the eye around. Player 1 (the incinerator) will have to be white now instead of blue since missile0 is now the whites of his eye instead of the dot.

 

Attached Files



#30 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Mon Jul 11, 2016 6:25 PM

Minor adjustment so the white flash at the beginning is lessened.

 

Attached Files



#31 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Mon Jul 11, 2016 8:11 PM

I'm using this code to make the player0 move right. But when I put the player1 in, it was moving left. How do I stop that from happening?

PositionSprites

        ; Set the horizontal position of the two sprites, based upon their coordinates
        ; This uses the tricky 2600 method of positioning (RESPx, HMPx, etc)

        ; Algorithm invented a looong time ago by persons unknown
        ; Re-invented Feb2001 by yours truly, then optimised according to code by Thomas Jenztsch

        sta WSYNC
        sta HMCLR                       ; clear any previous movement

        ldx #2                   ; sprite index
PosSP   
        lda Player1X-1,x

        tay

        lsr
        lsr
        lsr
        lsr
        
        sta PS_temp

        tya
        and #15

        clc
        adc PS_temp

        ldy PS_temp

        cmp #15
        bcc NH
        sbc #15
        iny
NH

                ; Use remainder for fine adjustment
        eor #7
        asl
        asl
        asl
        asl

        sta HMP0-1,x                      ; fine movement
        sta WSYNC

    

        jsr Ret
        bit 0                           ; 15 cycles = 3 loops :)

Jiggle  dey
        bpl Jiggle

        sta RESP0-1,x


        dex
        bne PosSP
        

        

        sta WSYNC
        sta HMOVE
        sta WSYNC




Ret
        rts


#32 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Mon Jul 11, 2016 11:49 PM

There. I think I figured it out. Next up, trying to figure out Y positioning. Discovered that "PlayerX  ds 2" meant that PlayerX was holding both X positions, and that player 1x's was accessible by using PlayerX+1, which means an entirely different thing in bB.

Attached Files



#33 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Tue Jul 12, 2016 5:58 AM

It doesn't look good. Mr. Celery can't be on the screen because I apparently added too much stuff. And when the vegetarian gets in the range of the incinerator, the scanline count increases by 1. I tried everything and nothing will make it stop.

Attached Files



#34 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Wed Jul 13, 2016 12:25 AM

Let me ask you a question. Why would this work sometimes:

  ; Clear RAM and all TIA registers



                ldx #0

                lda #0



Clear           sta 0,x

                inx

                bne Clear

Up until a certain point. I thought I was going insane because this new version was working well on Stella but didn't display anything on real hardware. So I tried replacing that bit of code with CLEAN_START and it suddenly started displaying it correctly on a real 2600 with Harmony cart. Anyway, a lot has changed. I had to move the celery down since he was apparently taking up too much room. Now he's lurking at the bottom looking upwards at you playing the game. You can move the incinerator up and down with the joystick. That's pretty much what I have so far. It is really really hot in here, even at 11:30pm, so I'm going to quit for today.

 

Attached Thumbnails

  • celery9a.png

Attached Files



#35 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Wed Jul 13, 2016 5:06 AM

Added collision detection and sound.

 

Attached Files



#36 BNE Jeff OFFLINE  

BNE Jeff

    Moonsweeper

  • 288 posts
  • Location:Virginia, USA

Posted Wed Jul 13, 2016 5:23 AM

I did notice the simplicity of your routine.  Here's the Kirk Isreal version:

	SEI	 ;Disable Any Interrupts (hey look! we can put comments here)
	CLD  	 ; Clear BCD math bit.
	LDX #$FF ; put X to the top...
	TXS	 ; ...and use it reset the stack pointer


#37 BNE Jeff OFFLINE  

BNE Jeff

    Moonsweeper

  • 288 posts
  • Location:Virginia, USA

Posted Wed Jul 13, 2016 5:25 AM

And this:  Sorry.

LDA #0		;Put Zero into A, X is at $FF
ClearMem 
	STA 0,X		;Now, this doesn't mean what you think...
	DEX		;decrement X (decrease X by one)
	BNE ClearMem	;if the last command resulted in something 
			;that's "N"ot "Equal" to Zero, branch back
			;to "ClearMem"


#38 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Wed Jul 13, 2016 5:20 PM

Why doesn't the random code in CollectMini work when I insert it in my game? I'm assuming it's because the computer hates me.

Attached Files



#39 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Wed Jul 13, 2016 9:13 PM

I fixed it, although it's now random, it starts at the same y position every time. All the rest of the positions are random.

Attached Files



#40 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Thu Jul 14, 2016 5:27 AM

The Celery came back in full view. This took all night to do. I will need help with a score though.

Attached Thumbnails

  • celery12.png

Attached Files


Edited by atari2600land, Thu Jul 14, 2016 5:28 AM.


#41 BNE Jeff OFFLINE  

BNE Jeff

    Moonsweeper

  • 288 posts
  • Location:Virginia, USA

Posted Thu Jul 14, 2016 5:47 AM

Nice shredder sound :)



#42 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Thu Jul 14, 2016 7:13 PM

Even though my hand hurts, I worked on this a little bit adding the reset switch in to start new games.

I do have a question though. When I go to compile the game, it always has a message saying NO_ILLEGAL_OPCODES is an unrecognized symbol. Nowhere in the code did I type in NO_ILLEGAL_OPCODES, and the game works, but I would like to have some idea as to how much free space I have left.

Attached Files


Edited by atari2600land, Thu Jul 14, 2016 7:13 PM.


#43 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Fri Jul 15, 2016 4:02 AM

I stared at the computer for so long I'm sick. Nevertheless, I finally figured out how to take the "jump" out of the beginning. Let me know what you think. If all looks good, then the score is next. I can't do a score, so it would be really helpful if someone could help me with that.

Attached Files



#44 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Fri Jul 15, 2016 4:55 AM

Sorry about the profanities in my code. Here is a clean version. I guess I should mention I changed it so the button press starts a new game.

Attached Files


Edited by atari2600land, Fri Jul 15, 2016 5:04 AM.


#45 tschak909 OFFLINE  

tschak909

    Stargunner

  • 1,819 posts
  • Location:USA

Posted Fri Jul 15, 2016 6:45 AM

Looking at Collect/CollectMini will show you how to implement a playfield based score routine. It's explained in one of the blog posts.

 

http://atariage.com/...cat-188-collect

 

-Thom



#46 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Fri Jul 15, 2016 9:56 PM

Score added. But it's a two digit score. I see that there would be room for a third digit after the second one (or is that before the second one?), but not enough room for a fourth digit. Could anyone explain how to make a third digit appear after the second one (preferably after the score reaches 99). After the score is done, I'll try to work on increasing the vegetarian's speed as time goes on. After all, I don't want it to be really easy (and boring) to get 999 points.

Attached Files


Edited by atari2600land, Fri Jul 15, 2016 10:05 PM.


#47 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Sat Jul 16, 2016 1:55 AM

So what I've decided to do is make a four-digit score. The first two digits are the thousands and hundreds, while the second two are the tens and ones. Unfortunately, there's a big huge gap between the numbers. I tried and failed to try to get the second set of numbers closer to the first two using PF2. I read that PF2 is backwards, so I put in a second set of backwards numbers to use for PF2, but I can't figure it out. I'm hoping that someone can look at the code and revise it so that the four-digit number is a four digit number with no huge gap between the numbers. (I've made the score start at 98 just to test to see if it would go to 100).

Attached Files



#48 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Sat Jul 16, 2016 7:01 AM

I tried to fix it myself, but the score came out all wonky looking. The code for the score is lines 218-289 in case you want to take a look and see what's wrong.

 

Attached Thumbnails

  • celery15bb.png

Attached Files



#49 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

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

Posted Sat Jul 16, 2016 7:33 AM

I tried to fix it myself, but the score came out all wonky looking. The code for the score is lines 218-289 in case you want to take a look and see what's wrong.

 

 

 

Looks fine to me, similar to how it was done in Space Invaders :thumbsup:

 

Space Invaders (1980) (Atari).png



#50 atari2600land OFFLINE  

atari2600land

    Waffles:

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

Posted Sat Jul 16, 2016 1:52 PM

I wanted a good solid score. Is that possible?






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users