Jump to content
IGNORED

Missadventure Revised (Adventure hack)


accousticguitar

Recommended Posts

That's an interesting thought. Is it hard to do?

No, if you are not concerned with the actual variance (so long as it keeps them different). The X register already contains a value that rises by 5, so just use that to EOR the state value.

 

MoveDragon_3:
;;	   LDA	DragonDiff,Y	   ;4 (removed)
   TXA					   ;2 Get current dragon offset
   SEC					   ;2
   SBC	#RDragonNumber	 ;2 subtract minimal value
   EOR	DragonDiff,Y	   ;4 Flip bits to create unique wait value
;continue...
   STA	NUSIZ0,X		   ;4 Store as Dragon's State (Open Mouthed)

 

That will keep dragons waiting at different intervals following a bite. If you want a higher variance, perform an ASL before the EOR instruction.

Link to comment
Share on other sites

If you really want to improve on Adventure, why not make the dragons be able to face the direction it's moving in? After all, there is a built in player register to flip the graphics. It should have been done that way from the start. I've been waiting 30 years for that.

 

I've thought about the same thing in the past, but I just came to accept the current behavior. Nukey Shay recently packed the kernal a bit tighter, so it might actually be possible now, but there is still the problem of positioning the dragon when it bites the player when it's being flipped.

 

It's a really good idea though, just don't know how feasible this would be.

Link to comment
Share on other sites

If you really want to improve on Adventure, why not make the dragons be able to face the direction it's moving in? After all, there is a built in player register to flip the graphics. It should have been done that way from the start. I've been waiting 30 years for that.

 

Code the exception into the Setup routine. The unused bits in the sprite size data byte can provide a "flag" for any sprite that is to differ (and if set, if it's X position is less than or greater than the ball).

 

ResizeObject:;Object1 Size
   LDY	#$00			   ;2 Set no reflect

;2 existing lines...
   LDA	Store8,X		   ;4 Get Object1's width...
   STA	NUSIZ0			 ;3 Set sprite width

   BPL	NotReversable1	 ;2 Branch if sprite is inanimate
   LDA	Obj1X			  ;3 Get object's X location
   SEC					   ;2
   SBC	PlayerY			;3 Subtract player's location
   BMI	NotReversable1	 ;2 Branch if sprite is on the right
   LDY	#$08			   ;2 Set reflect
NotReversable1:
   STY	REFP0			 ;3 store reflect

 

ResizeObject2:;Object2 Size
   LDY	#$00			   ;2 Set no reflect

;2 existing lines...
   LDA	Store8,X		   ;4 Get Object1's width...
   STA	NUSIZ1			 ;3 Set sprite width

   BPL	NotReversable2	 ;2 Branch if sprite is inanimate
   LDA	Obj2X			  ;3 Get object's X location
   SEC					   ;2
   SBC	PlayerY			;3 Subtract player's location
   BMI	NotReversable2	 ;2 Branch if sprite is on the right
   LDY	#$08			   ;2 Set reflect
NotReversable2:
   STY	REFP1			 ;3 store reflect

 

Then set bit 7 in the width data for animated sprites.

Link to comment
Share on other sites

Two things with the above code: You checked for PlayerY instead of PlayerX, and the sprite flipping is backward. I dunno how to fix the latter, using BPL instead of BMI misses something and causes crashes when I have a lot of dragons on screen.

 

EDIT: Oh duh, just flip the dragon bitmaps. :P

Edited by EarthQuake
Link to comment
Share on other sites

In the Objects table, there's a collection of bytes for each sprite (ram/rom address, color, etc). It's the last byte for each one. Add $80 to the value shown to set the high bit for each dragon. NUSIZ registers do not use the upper 2 bits ($80 and $40), so you can use bit6 for something else too.

Link to comment
Share on other sites

Okay, I found that, but when I try to assemble it Dasm gives me an error: Unresolved symbol list REFP0 and REFP1. It doesn't seem to recognize the control register.

 

Edit: I got it to assemble by assigning REFP1 and REFP0 ram locations E5 and E6, but the screen jumps up and down, so I'm still not doing something right.

Edited by accousticguitar
Link to comment
Share on other sites

Hmm, it should be working, although when I tried it with my source code, the "two existing lines" were actually three:

 

ResizeObject:
   LDA	Store8,X		  ; Get size of Object1.										;4
   ORA	#$10			  ; And set to larger size if necessary.						;2
   STA	NUSIZ0			; (Used by bridge and invisible surround.					 ;3

 

I put the LDY #$00 before it, and the rest of the code after this block of instructions, and the same for object2 in the ResizeObject2 routine. After defining REFP1 and REFP0, adding $80 to the width of the dragons, and flipping the bitmaps of the dragons, everything worked perfectly. Oh and make sure it uses PlayerX instead of PlayerY.

Edited by EarthQuake
Link to comment
Share on other sites

Like this? It still shakes.

;Object1 Size
ResizeObject:			;Object1 Size
   LDY	#$00			   ;2 Set no reflect

   LDA	Store8,X		   ;Get Object1's Size	   			;4
   ORA	#$10			   ;And set to larger size if necessary.	;2
   STA	NUSIZ0			 ;(Used by bridge and invisible surround);3

   BPL	NotReversable1	;2 Branch if sprite is inanimate
   LDA	Obj1X			 ;3 Get object's X location
   SEC					  ;2
   SBC	PlayerX		   ;3 Subtract player's location
   BMI	NotReversable1	;2 Branch if sprite is on the right
   LDY	#$08			  ;2 Set reflect
NotReversable1:
   STY	REFP0			;3 store reflect

 

;Object2 Size
ResizeObject2:			  ;Object2 Size
   LDY	#$00			  ;2 Set no reflect

   LDA	Store8,X		   ;Get Object2's Size				;4
   ORA	#$10			   ;And set to larger size if necessary.	;2
   STA	NUSIZ1			 ;(Used by bridge and invisible surround);3

   BPL	NotReversable2	;2 Branch if sprite is inanimate
   LDA	Obj2X			 ;3 Get object's X location
   SEC					  ;2
   SBC	PlayerX		   ;3 Subtract player's location
   BMI	NotReversable2	;2 Branch if sprite is on the right
   LDY	#$08			  ;2 Set reflect
NotReversable2:
   STY	REFP1			;3 store reflect

I tried changing the ram locations but it didn't make a difference.

Link to comment
Share on other sites

Okay, I found that, but when I try to assemble it Dasm gives me an error: Unresolved symbol list REFP0 and REFP1. It doesn't seem to recognize the control register.

 

Edit: I got it to assemble by assigning REFP1 and REFP0 ram locations E5 and E6, but the screen jumps up and down, so I'm still not doing something right.

 

REFP0 and REFP1 are hardware registers...$0B and $0C respectively. Bit 3 controls whether or not the sprite is to be flipped (all other bits are unused).

 

REFP0 = $0B

REFP1 = $0C

 

 

 

Hmm, it should be working, although when I tried it with my source code, the "two existing lines" were actually three:
ResizeObject:
   LDA	Store8,X		 ; Get size of Object1.									;4
   ORA	#$10			 ; And set to larger size if necessary.					;2
   STA	NUSIZ0		; (Used by bridge and invisible surround.					;3

 

Bits 4 and 5 set the missile width (the side panels), This can be placed right in the data table, making ORA #$10 superfluous.

Link to comment
Share on other sites

I guess one way of getting around that, is to check if the dragon's current state is the "moving" state, and then flip the sprite if that is the case. It would prevent the sprites from flipping if you're eaten, they are dead, or they are biting (preventing the need to reposition the dragon when it's flipped).

 

And yes, I agree, the dragons look mighty strange when flipped. :)

Link to comment
Share on other sites

Not quite sure I've ever experienced anything like that before. I'm pretty sure the above code wouldn't cause the playfield or background to exhibit any such things, at least. Can you describe in detail what's going on? What things' colors are being changed? How do they change over time? Is the screen rumbling or are the colors just changing? Is it possible to take screenshots? Are you just getting random output or is the game still in a semi-working state? Does the select button fix everything?

Link to comment
Share on other sites

Okay after looking at it, it basically just crashes. I just got a black screen. I really don't think this has anything to do with the new sprite flipping code. Instead, I think it's related to the main loop where it checks if the winning condition has been met. You didn't reorder any of the code in the first part of the main game loop did you?

Edited by EarthQuake
Link to comment
Share on other sites

Here is what I did to stop the dead dragons from flipping. It's kind of long, but it seems to work.

 

;Object1 Size
ResizeObject:			;Object1 Size
   LDY	#$00			   ;2 Set no reflect

   LDA	Store8,X		   ;Get Object1's Size	   			;4
   ORA	#$10			   ;And set to larger size if necessary.	;2
   STA	NUSIZ0			 ;(Used by bridge and invisible surround);3

 BPL	NotReversable1	;2 Branch if sprite is inanimate

 LDA	  RDragonR+4	  
 CMP	  #$01		   
 BEQ	  NotReversable1	  
 LDA	  GDragonR+4	   
 CMP	  #$01		   
 BEQ	  NotReversable1	  
 LDA	  YDragonR+4	  
 CMP	  #$01		   
 BEQ	  NotReversable1	  
 LDA	  BDragonR+4	   
 CMP	  #$01		   
 BEQ	  NotReversable1	   
 LDA	  FDragonR+4	  
 CMP	  #$01		   
 BEQ	  NotReversable1	


   LDA	Obj1X			 ;3 Get object's X location
   SEC					  ;2
   SBC	PlayerX		   ;3 Subtract player's location
   BMI	NotReversable1	;2 Branch if sprite is on the right
   LDY	#$08			  ;2 Set reflect
NotReversable1:
   STY	REFP0			;3 store reflect

 

;Object2 Size
ResizeObject2:			  ;Object2 Size
   LDY	#$00			  ;2 Set no reflect

   LDA	Store8,X		   ;Get Object2's Size				;4
   ORA	#$10			   ;And set to larger size if necessary.	;2
   STA	NUSIZ1			 ;(Used by bridge and invisible surround);3

   BPL	NotReversable2	;2 Branch if sprite is inanimate

 LDA	  RDragonR+4	   
 CMP	  #$01		   
 BEQ	  NotReversable2	  
 LDA	  GDragonR+4	   
 CMP	  #$01		   
 BEQ	  NotReversable2	  
 LDA	  YDragonR+4	   
 CMP	  #$01		   
 BEQ	  NotReversable2	 
 LDA	  BDragonR+4	   
 CMP	  #$01		   
 BEQ	  NotReversable2	   
 LDA	  FDragonR+4	   
 CMP	  #$01		   
 BEQ	  NotReversable2	

   LDA	Obj2X			 ;3 Get object's X location
   SEC					  ;2
   SBC	PlayerX		   ;3 Subtract player's location
   BMI	NotReversable2	;2 Branch if sprite is on the right
   LDY	#$08			  ;2 Set reflect
NotReversable2:
   STY	REFP1			;3 store reflect
 RTS

Link to comment
Share on other sites

The live dragons work great, I'm trying to get the dead dragons to stop moving. My latest failed attempt:

 

;Object1 Size
ResizeObject:			;Object1 Size
   LDY	#$00			   ;2 Set no reflect

 LDA	  NUSIZ0,X		   
 CMP	  #$01		   
 BEQ	  NotReversable1	   

   LDA	Store8,X		   ;Get Object1's Size	   			;4
   ORA	#$10			   ;And set to larger size if necessary.	;2
   STA	NUSIZ0			 ;(Used by bridge and invisible surround);3

 BPL	NotReversable1	;2 Branch if sprite is inanimate

   LDA	Obj1X			 ;3 Get object's X location
   SEC					  ;2
   SBC	PlayerX		   ;3 Subtract player's location
   BMI	NotReversable1	;2 Branch if sprite is on the right
   LDY	#$08			  ;2 Set reflect
NotReversable1:
   STY	REFP0			;3 store reflect

 

;Object2 Size
ResizeObject2:			  ;Object2 Size
   LDY	#$00			  ;2 Set no reflect

 LDA	  NUSIZ0,X		
 CMP	  #$01		  
 BEQ	  NotReversable2	

   LDA	Store8,X		   ;Get Object2's Size				;4
   ORA	#$10			   ;And set to larger size if necessary.	;2
   STA	NUSIZ1			 ;(Used by bridge and invisible surround);3

   BPL	NotReversable2	;2 Branch if sprite is inanimate

   LDA	Obj2X			 ;3 Get object's X location
   SEC					  ;2
   SBC	PlayerX		   ;3 Subtract player's location
   BMI	NotReversable2	;2 Branch if sprite is on the right
   LDY	#$08			  ;2 Set reflect
NotReversable2:
   STY	REFP1			;3 store reflect
 RTS

Link to comment
Share on other sites

Change the location of the exception. If it's just the chasing dragon that you are concerned with, stick it right where the sprite shape is stored. Maybe place the chasing dragon sprite on a different page from ALL other sprites...then just check for that page when storing Obj1Hi and Obj2Hi. In that case, you wouldn't need to alter the size data and other stuff.

 

Undo ALL the changes thus far, and use something LIKE** this instead...

 

;existing lines (in MY file)...
   JSR	GetObjectState	 ;6 Find current state in the state information
   INY					   ;2 Index to the state's corresponding graphic pointer
   LDA	(CurrentObject),Y  ;5 Get Object1's low graphic address...
   STA	Obj1Lo			 ;3 and store for printing sprite 0
   INY					   ;2 bump index
   LDA	(CurrentObject),Y  ;5 Get Object1's high graphic address...
   STA	Obj1Hi			 ;3 and store for printing sprite 0

;added lines...
   LDY	#$00			   ;2 Set no reflect
   CMP	#>GfxDrag0		 ;2 is it a chasing dragon bitmap?
   BNE	NotReversable1	 ;2 skip ahead if not
   LDA	Obj1X			  ;3 Get object's X location
   SEC					   ;2
   SBC	PlayerX			;3 Subtract player's location
   BMI	NotReversable1	 ;2 Branch if sprite is on the right
   LDY	#$08			   ;2 Set reflect
NotReversable1:
   STY	REFP0			  ;3 store reflect for sprite 0

 

And do the same thing for the second sprite (be sure to change the label names).

 

This works well for specific shapes you only want the ability given to (rather than the ability to grant it to all shapes). Just place the dragon sprite on a different memory page than all of the rest.

 

 

 

** NOTE: I'm posting the word "Like" because I don't know what your guys' assemblies look like (and nobody ever seems to post the files that help is needed on) :P But you should be able to figure out what it's doing here.

Link to comment
Share on other sites

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