Keith Weisshar Posted April 17, 2010 Share Posted April 17, 2010 Why does Raiders of the Lost Ark switch back to debugger mode every time I reset after setting breakpoint to the init routine at $dd68? Quote Link to comment Share on other sites More sharing options...
Glade Swope Posted December 28, 2013 Share Posted December 28, 2013 Maybe that's where the CPU goes when you hit reset? 1 Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted January 25, 2014 Share Posted January 25, 2014 That is correct. Although the practice of re-initializing the system has undesirable effects (such as a possible screen roll caused by throwing timing, etc. out the window), there are a LOT of games that do it simply because it's a quick'n'dirty (and often completely unnecessary) solution. LD3FB: sta WSYNC bit $9C bpl LD409 ; branch if game already initialized ror SWCHB ; game reset -> carry bcs LD409 ; branch if not pressed jmp LDD68 ; cold start The game will also cold start when pressing the right controller trigger after a game has been lost/won. Stella has the ability to startup in the debugger from commandline at the very first executed instruction (rather than setting a breakpoint)...since the start vector address is the same in any 2600 game. stella -break "* ($fffc)" mygame.bin (substitute your program name for "mygame.bin"...and use correct spacing) IIRC you can add that text to Stella.ini (without the "stella -" program specification) to have the launcher do it automatically. Quote Link to comment Share on other sites More sharing options...
Keith Weisshar Posted March 4, 2014 Author Share Posted March 4, 2014 (edited) If I win the game and find the ark the reset switch no longer works because RAM location $9C set to a positive number which is between $00 to $7F. When Indy reaches the bottom of the pedestal at the start of a new game RAM location $9C is set to $80 and the ark disappears. The game uses the negative bit of this RAM location to skip drawing the ark at the top of the screen. Finding the ark causes the game to detect as already initialized and not allow the reset to work. Edited March 4, 2014 by Keith Weisshar Quote Link to comment Share on other sites More sharing options...
Keith Weisshar Posted March 16, 2014 Author Share Posted March 16, 2014 Nukey, Why is the same memory location $9C used to check if game is already initialized and also to draw the Ark on the top of the screen when the negative bit is not set? Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted March 21, 2014 Share Posted March 21, 2014 $9C is just a temp counter, really. The "score" screen uses the location to decide whether or not to draw the ark. HSW figured that as long as it was doing that, he could check that ram location when looking for a game reset (otherwise, doing so would place the program into an endless loop when the switch is held down). This is not necessary if the switch routine is moved to just below where VSYNC and TIM64T are set for a new display. Altering the cold start routine slightly makes it clear user ram only any other time than the initial powerup sequence. Here's how ya do it. LD3FB: sta WSYNC ;3 ;removed lines... ; bit $9C ;3 ; bpl LD409 ;2 ; ror SWCHB ;6 ; bcs LD409 ;2 ; jmp LDD68 ;3 ;LD409: sta WSYNC ;3 lda #$00 ;2 ldx #$2C ;2 sta WSYNC ;3 sta VSYNC ;3 stx TIM64T ;4 ;new lines... lda SWCHB ;4 ror ;2 bcs Skip_Reset ;2 jmp Warm_Start ;3 .byte 0,0,0 ; leftovers Skip_Reset: Reset_Done: That takes care of the switch so it happens AFTER Vsync. Alter the trigger press jump a bit further down too... ; jmp LDD68 ;2 jmp Warm_Start ;3 LD45B: Then, alter the powerup code to include a "warm start", which clears only the user ram portion after the initial powerup. LDD68: sei ;2 cld ;2 ;removed lines... ; ldx #$FF ;2 ; txs ;2 ; inx ;2 ; txa ;2 ;LDD6F: ; sta VSYNC,X ;4 ; dex ;2 ; bne LDD6F ;2 ; dex ;2 ; stx $9E ;3 ;added lines... ldx #$00 ;2 .byte $2C ;4 Warm_Start: ldx #$80 ;2 lda #$00 ;2 Clear_Loop: txs ;2 stx $9E ;3 inx ;2 sta VSYNC,X ;4 bne Clear_Loop ;2 And finally, the jump to take you back to the program... ; jmp LD3DD ;3 jmp Reset_Done ;3 LDDA6: Rock-steady @262 lines. The new routine is 2 bytes larger than the old one, but there are some unused bytes @DDF8-$DDFF you can steal from. Quote Link to comment Share on other sites More sharing options...
Keith Weisshar Posted April 7, 2014 Author Share Posted April 7, 2014 (edited) E.T. doesn't do cold start to start a new game unlike Raiders of the Lost Ark. Both games are programmed by HSW. Can you contact HSW to find out why Raiders of the Lost Ark does a cold start after each game? Edited April 7, 2014 by Keith Weisshar Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted April 7, 2014 Share Posted April 7, 2014 And neither one of those miss a scanline like Yars' Revenge! He could have gotten better But seriously, it's not possible to use a cold start as reset in E.T. (or Yars' either), because that would wipe out your game selection. Raiders only has the one game, so that method was not a problem. It wasn't seen as such a big deal at the time...many games before and after reused the cold start routine. Quote Link to comment Share on other sites More sharing options...
Keith Weisshar Posted April 7, 2014 Author Share Posted April 7, 2014 I went into Stella debugger while Indy was descending and noticed that $9C is still #$00 and then I resumed emulation and when I waited until the Ark disappeared after Indy reaches the bottom of the pedestal I went rechecked $9C and it is now #$80. This is when the game resets again when the switch is held down. The counter is actually in $CF and is also compared against $9E or #$7C whichever comes first. The code that moves Indy down the pedestal starts at $D45B 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.