Jump to content
IGNORED

River Raid Ending?


zaxxonfan

Recommended Posts

hmmmm....lots of NOPs dealing with screensaver mode. But looking even at the game select code that takes advantage of 2 variations it might be better (certainly easier!) to use the colour/bw switch to enable a random seed.

Edited by davyK
Link to comment
Share on other sites

BTW, thanks so much to Thomas J for your disassembly! River Raid was (along with Pitfall II) one of the first games I played over and over as a kid, and getting to see how its source code works so many years later was a huge treat. I don't think I would have even attempted my simulator/bot project without the insights reading your comments provided.

Link to comment
Share on other sites

So I got some time to look at this. Had to butcher the screen saver code to find the room for my bloated coding :)

 

This section lets the user select a 3rd variation:

.noReset:
       LSR                      ; 2
       BCS    .noSelect         ; 2
       DEC    gameDelay         ; 5             SELECT was pressed
       BPL    .skipSelect       ; 2
       LDA    gameVariation     ; 3             increment game variation (1-3)
       ADC    #$01              ; ?
       CMP    #$03              ; ?
       BNE    .gPlus1           ; 2
       LDA    #$00
.gPlus1:
       STA    gameVariation     ; 3?
       NOP
       NOP
;       STA    player            ; 3
       ASL                      ; 2
       ASL                      ; 2
       ASL                      ; 2
       ADC    #DIGIT_H          ; 2
       JSR    SetScorePtrs      ; 6
       JSR    FinishGame        ; 6
       LDY    #$1E              ; 2
.noSelect:
       STY    gameDelay         ; 3

And this is the change I made when the user presses reset to reseed (I don't think the first section will change since that is already generated from the original hard-coded seed selected by Activision?) :

; *** check switches: ***
       LDA    SWCHB             ; 4
       LSR                      ; 2
       BCS    .noReset          ; 2
       LDA    gameVariation     ; 3             RESET was pressed
       CMP    #$02              ; ?
       BNE    .normalMode       ; 2
       LDA    #$45             ; ?             random seed changed
       STA    SEED_HI           ; 3
       LDA    #$00              ; 3
       STA    gameVariation     ; 3
.normalMode
       STA    player            ; 3
       LDX    #$F7              ; 2
       JMP    Reset             ; 3

I've hard-coded a new seed just to experiment but 2 questions:

 

1. Do I need to change both bytes SEED_Hi and LO?

2. Can I use something like INTIM to get a random seed? I know this could result in a unoptimal sequence but I like the "lucky dip" aspect of doing it this way.

 

I ask this because this is up and running but I don't see a big change in the river (though I am not overly familiar with this game).

 

Just noticed batari has already done a similar thing (far nicer job) but I'd like to complete this for my own development.

Edited by davyK
Link to comment
Share on other sites

A random seed may be outside the original sequence, because that covers only 57337 of the 65535 possible screens. And if its outside the sequence, then only about 8000 (or even way! less) screens before repeating are there. Better would be to call the random number generator multiple, random times (e.g. 1000 times) to create a new seed. Then you are sure the seed is in the original sequence.

 

And yes, you can use INTIM. Either for the seed (changing only one byte is OK) or e.g. multiplied with 128 for the number of random number generator calls.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

Good idea to multi-call the RND code a number of times to stay "on the path". I could have x = INTIM*128 and call the RND code x times? I have plenty of bytes to implement that. Reckon I could do a 2 player mode as well. Thanks for the fast response.

Edited by davyK
Link to comment
Share on other sites

  • 6 years 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...