davyK Posted July 16, 2017 Share Posted July 16, 2017 (edited) 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 July 16, 2017 by davyK Quote Link to comment Share on other sites More sharing options...
Lord Tom Posted July 17, 2017 Share Posted July 17, 2017 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. Quote Link to comment Share on other sites More sharing options...
davyK Posted July 19, 2017 Share Posted July 19, 2017 (edited) 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 July 19, 2017 by davyK Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted July 19, 2017 Share Posted July 19, 2017 (edited) 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 July 19, 2017 by Thomas Jentzsch Quote Link to comment Share on other sites More sharing options...
davyK Posted July 19, 2017 Share Posted July 19, 2017 (edited) 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 July 19, 2017 by davyK Quote Link to comment Share on other sites More sharing options...
Atari-Collector Posted July 19, 2017 Share Posted July 19, 2017 I never get far enough to worry about there being an end to the game... 2 Quote Link to comment Share on other sites More sharing options...
accousticguitar Posted July 20, 2017 Share Posted July 20, 2017 I never get far enough to worry about there being an end to the game... Same here. Quote Link to comment Share on other sites More sharing options...
king eric Posted January 16 Share Posted January 16 after sending in a picture!, Receive a t-shirt Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.