Jump to content
IGNORED

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


Recommended Posts

I had an idea. Why not make a title screen song? This proved to be way way harder since every time I put stuff in, it kept breaking or not working right. I think I finally got it working okay after 4 hours of work. Let me know if you see any bugs in this version. I know the title screen isn't all that great, I plan to redo it, the one in here is just temporary.

celery37.zip

Link to comment
Share on other sites

This web page really helps a lot:

http://www.randomterrain.com/atari-2600-memories-music-and-sound.html

Here is my first try.

EDIT: I also made the vegetarian and celery move up or down slightly, randomly determined.

celery39.zip

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

Now I need help with randomness. It likes to do certain unbreakable patterns. One of which is:

celery down

celery down

vegetarian down

vegetarian unchanged

vegetarian up

repeat the Y positions exactly the same. I've cleaned the code up some, removing unnecessary blank lines and changing swear words and stuff. I just get so angry when things don't work.

celery40.asm

celery40.bin

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

How is this possible?

post-9475-0-29064000-1486374099_thumb.png

In the bottom picture, the black space at the bottom is clearly more, yet the scanline counter counts 262 for BOTH of them. How would I fix this so it doesn't display an obvious fluctuation of black space at the bottom? I've tried for at least a few hours and can't figure it out.

 

celery42.asm

Link to comment
Share on other sites

Nevermind, I see you posted the source here. I like the look of the new incinerator, well done :thumbsup:

 

I took a look and there's not enough time in the score kernel as written; but, you have plenty of RAM left so I do have a solution! I'm working late this evening though, so won't be able to make the changes until this weekend.

Link to comment
Share on other sites

Thank you so much! I made a few changes and now the lives counter goes down instead of up. And I didn't even have to ask for help on that one! I also made it so the song only plays when the game is over. If you lose a life, you'll hear a small unpleasant beep noise.

celery20170211.zip

  • Like 2
Link to comment
Share on other sites

Help time again. I wanted to see if I could make the game decide randomly if the character changes direction or not when it hits the y position boundary. I introduced a new variable called Bouncing. I did this:

        jsr Random
        sta Bouncing

        lda Bouncing
        cpx #127
        bcs Do_not_bounce
 
        ;code that happens for it to bounce

But it always either bounces or doesn't (and doesn't choose one), no matter what I do. What am I doing wrong?

This code problem begins at line 1,321 in this code. The Bouncing variable is chosen at line 1,365-6.

celery48.asm

Edited by atari2600land
Link to comment
Share on other sites

Made some minor changes to make it easier to diagnose the problem.

  • added hex digits A-F and revised the score to show the paddle reading on the left and the converted value on the right.
  • Disabled the movement of the human/celery

In order to do this I had to bump up the ROM size to 4K.

Highest paddle reading is $A1 which is converted to $30
post-3056-0-08275500-1487887798_thumb.png

"Lowest" paddle reading is $1E which is converted to $5A
post-3056-0-10431700-1487887790_thumb.png

"Lowest" because turn the paddle a little further and the reading jumps to $31 with a converted value of $0B
post-3056-0-05302200-1487887794_thumb.png

Looking in the comments I see:

; Paddle1 will have a value from 49-164
; We need to convert it to 11-49



49-164 is $31-$A4 in hex.
11-49 is $0B-$31 in hex

So something happened that changed the range of paddle readings from $31-$A4 to $1E-$A1. Plus there's a "hiccup" that occurs causing the reading to jump from $1E to $31.


What you need to do now is a binary search to figure out in which version of Celery the problem first appeared. To do a binary search establish your MIN and MAX versions, then test the one in the middle. With 50 versions the MIN=1 and MAX=50.

(MIN+MAX)/2 = 25 - so the first version to test is 25.

Does 25 have the problem?
  • Yes - your new MAX is 24
    next search is (1+24)/2 = 12
  • No - your new MIN is 26
    next search is (26+50)/2 = 38

Repeat the process until you find the version the problem first appeared. Then compare that source with the one before it - so if the problem is in version 40, compare versions 39 and 40. Use a tool like WinMerge to make it easier to figure out what changed.


Source
celery50dgs.asm

ROM
celery50dgs.bin

Link to comment
Share on other sites

The change happened between the versions 32 and 33, but I can't figure out what I did to change it. I used WinMerge and everything and it's a total mystery to me. Versions 32 and 33 are here. I noticed the big change is that I rounded the celery. Could that have something to do with it?

celerychangehappening.zip

Link to comment
Share on other sites

If you happen to look at this some more before I do tonight, remember that this macro is what does the paddle reading:

 

       MAC READ_PADDLE_1 ; DGS macro to read the first paddle
        lda INPT0         ; 3   - always 9
        bpl .save         ; 2 3
        .byte $2c         ; 4 0
.save   stx Paddle1       ; 0 3
        ENDM

and that it relies on the value in the X register - so take a closer look at any changes involving the X register.

Link to comment
Share on other sites

Found the "jump" problem. This bit of code used to be this:

    cpx #50         ; are we at line 
    bne EyeDot      ; No, so do another
    lda #49         ; DGS - set paddle low value
    sta Paddle1     ; DGS

it's now this:

    cpx #30         ; are we at line 	
    sta RESM1	    ; reset missile1 position						
    bne EyeDot      ; No, so do another	
    lda #49         ; DGS - set paddle low value
    sta Paddle1     ; DGS

The sampling of the paddle starts immediately after this routine, and the initial value of X changed from 50 to 30 which is causing the problem. Because of that the low value for the paddle needs to be changed, it should be set to 29 (1 less the 30).

    cpx #30         ; are we at line 	
    sta RESM1	    ; reset missile1 position						
    bne EyeDot      ; No, so do another	
    lda #29         ; DGS - set paddle low value
    sta Paddle1     ; DGS

Once that's been changed the raw paddle range becomes 29-161 ($1D-$A1):

post-3056-0-98867100-1488038414_thumb.png post-3056-0-88145800-1488038409_thumb.png

 

Once that's fixed we need to update the UsePaddle routine to convert the range to 11-49($0b-$31).

UsePaddle:  ; DGS
; Paddle1 will have a value from 29-161
; We need to convert it to 11-49
; and store it in ObjectY+1

    sec
    lda Paddle1     ; A = 29-161 ($1D-$A1)
    sbc #29         ; A = 0-132
    
; divide by 3 routine by Omegamatrix, from:

; http://atariage.com/forums/blog/563/entry-10805-unsigned-integer-division-routines/  
    clc
    sta  Temp
    lsr
    adc  #21
    lsr
    adc  Temp
    ror
    lsr
    adc  Temp
    ror
    lsr
    adc  Temp
    ror
    lsr             ; A = 0-44
; end divide by 3    
    cmp #38         ; need to be 0-38
    bcc RangeOK     ; if A < 38 than then we are OK
    lda #38         ; else force it to 0-38
    
RangeOK:
    bit SWCHB       ; this tests the difficulty switches.  BVC (switch=B) or BVS (A) for the left switch, and BPL (B) or BMI (A) for the right.
    bvc SkipReverse ; do not reverse range if Left Difficulty = B

    sta Temp        ; reverse the range
    sec
    lda #38
    sbc Temp        ; A= 38-0
    
SkipReverse:
    clc             
    adc #11         ; A = 49-11 (or 11-49 if not reversed)
    
ConvertDone:
    sta ObjectY+1   

    rts ;   DGS end of UsePaddle

post-3056-0-72023100-1488039930_thumb.png post-3056-0-43500900-1488039934_thumb.png

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
  • 7 months later...

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