News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

beam specific doors(Done)

Started by A_red_monk_called_Key, September 14, 2011, 02:47:19 PM

Previous topic - Next topic

A_red_monk_called_Key

i'm looking for some help with SM phazons new doors. i'm trying to replace the graple block door block with a beam specific door.
i have the new door pointed to new graphics and added to my PLM list as the 6th door type. the thing is that i can only make it vurnable to missile, super missile, power bomb, or a combanation of 2 or all 3 of those. i'm good at making graphics like ships, PLMs, doors, enemys, and BGs (they take some time but that seems tobe what most people want)

Crashtour99

If your only problem is with projectile type detection, this should be a pretty easy fix.
I'm guessing you have a bit of code in your doors that looks like:

LDA $0C18,X     ;projectile type array
AND #$0F00     ;getting rid of the extra bits
CMP #$0100     ;value for missile projectile

Really, you're just working with the wrong bits @ $0C18.  What I did for my beam specific shotblocks was this:

LDA $0C18,X     ;projectile type array
AND #$000F     ;getting rid of the extra bits
CMP #$000y     ;y is the bit identifier for beam type

1 = wave beam
2 = ice beam
4 = spazer beam
8 = plasma beam


If your doors worked with other projectiles, that should be just the tweak needed to get them to recognize beam type projectiles.


All I really ask for in return is if your TLP/photoshop graphics wizardry can be done with Paint.NET instead of photoshop.  I've already got Paint.NET installed on this machine, and I'd rather not have to go to the trouble of finding a cracked version of photoshop to install.  haha

A_red_monk_called_Key

#2
awesome i'll try this now. let me know what you need for graphics

Edit: what value for graple beam

didn't work. the code in hex is
BD 77 1D      F0 21   29 00 0F     C9 00 01        then D0 12    9E 77 1D
LDA $1D77   BEQ    AND #$0F00   CMP #$0100      ??           STZ $1D77

Scyzer

I've looked at the code for blue gates. They code checks if the projectile is a powerbomb, and if it is, doesn't run the opening code. All other projectiles do.

Starting from the LDA $1D77, write this code:

LDA $1D77,X
BEQ $21
CMP #$8000
BNE $15

In byte form, this is: BD 77 1D F0 21 C9 00 80 D0 15. The rest of the data should remain unchanged. The door will only open when fired upon with grapple.






A_red_monk_called_Key

#4
do i need   29 00 0F


it works with out but makes strange sound fx when shot by outher beams(is this because BEQ 21 branches too far?)i tried 1E, but that made differt sounds.

this is grate i can also add extra shots to open door!


(crash if you need graphics i'll still hook you up)

Crashtour99

Unfortunately there is no value for grapple in the projectile type array (that I'm aware of at least).  I'm not sure how blue doors recognize grapple shots, but I'm guessing it has something to do with the shotblock bts they generate (40-43 are bts specific for blue doors).

I don't know how that's really working for your doors, so let's just do a quick disassembly of a regular missile door PLM and see if we can see what it's doing, shall we?

If we look at missile door facing left, our 3 code pointers are:
C7B1     initiation pointer
C318     door coding pointer
C301     closing animation pointer

@C7B1 we see
LDX $1C87   ;load PLM location in room, Absolute Indexed, Y
LDA #$C044
JSR $82B4
RTS
This is the same for all PLM type doorcaps (even gray ones though they have a bit of extra stuff in their initiation).

Closing animation pointer we shouldn't have to look at since it consists of frame delays, tilemap pointers, and "play a sound" pointers.

C318 is where all the action is happening.  There we find this series of pointers:
8A72     ;basically checks if door has been opened already or not. 
            ;if so, use next pointer, if not then skip it.
C4B1     ;this is a pointer in blue door animation coding that generates a shotblock bts
            ;basically generating a blue door
8A24     ;puts next pointer in PLM GoTo Instruction pointer RAM address
C32A     ;pointer to hit and opening animations
86C1     ;use next pointer as plm room argument
BD50     ;projectile detections
0001     ;frame delay
A8E7     ;tilemap pointer to missile door facing left closed
86B4     ;use previous pointer as next PLM instruction

BD50 looks like where all the magic is happening.  With a disassembly of that we find:
BD50
BD 77 1D F0 26 29 00 0F C9 00 02 F0 22 C9 00 01 D0 12 9E 77 1D BF BC DE 7E 9D 27 1D A9 01 00 9F 1C DE 7E 60
LDA $1D77,X ;Variable use PLM value
BEQ +26 ;BRANCH TO HERE1 IF EQUAL
AND #$0F00
CMP #$0200 ;VALUE FOR SUPERMISSILE
BEQ +22 ;BRANCH TO HERE2 IF EQUAL
CMP #$0100 ;VALUE FOR MISSILE
BNE +12 ;BRANCH TO HERE1 IF NEGATIVE
HERE3:
STZ $1D77,X ;Variable use PLM value
LDA $7EDEBC,X ;PLM Goto Instruction Pointer
STA $1D27,X ;Next PLM instruction
LDA #$0001
STA $7EDE1C,X ;PLM frame delay
RTS

A9 57 00 22 CB 90 80 9E 77 1D 60
LDA #$0057
JSL $8090CB
HERE1:
STZ $1D77,X
RTS

HERE2:
A9 77 00 9F 0C DF 7E 80 DA
LDA #$0077
STA $7EDF0C,X ;Unknown PLM value. Initialized to #$0000
BRA +DA ;BRANCH ALWAYS TO HERE3


Basically, it looks like it's using $1D77,x as a hit flag for the door, so the projectile type array value is most likely being stored there but without the beam type bits being kept so it's not working.  If it's not hit then it stores 0 to 1D77 and ends, and also does the same if hit by anything other than a missile or super missile.  If it's hit by either a missile or super, it clears the flag (STZ $1D77) then puts the PLM GoTo instruction into the next PLM instruction (in this case C32A door hit flash and opening animation).

The following ASM should be able to get your doors working now.  Just insert it into freespace somewhere in $84, and point to that location for the Room Argument pointer for projectile detections (if you were going to use it instead of missile doors, you'd repoint BD50 here).  You'll also have to one of each of these for every beam door type.  It's already set up for wave beam, so all you'll need to do to change it is alter the CMP value and point it to different freespace.

lorom

!WAVE = #$0001
!ICE = #$0002
!SPAZER = #$0004
!PLASMA = #$0008

org $freespace
LDA $1D77,X ;Variable use PLM value
BEQ HERE1 ;BRANCH TO HERE1 IF EQUAL
LDA $0C18,X       ;projectile type array
AND #$000F       ;getting rid of the extra bits
CMP !WAVE        ;REPLACE WITH WHAT BEAM YOU WANT IT TO BE VULNERABLE TO
BEQ HERE2         ;BRANCH TO HERE2 IF EQUAL
HERE1:
STZ $1D77,X
RTS
HERE2:
STZ $1D77,X ;Variable use PLM value
LDA $7EDEBC,X ;PLM Goto Instruction Pointer
STA $1D27,X ;Next PLM instruction
LDA #$0001
STA $7EDE1C,X ;PLM frame delay
RTS


Let me know if it works for you.   :^_^:

Scyzer

Quote
Unfortunately there is no value for grapple in the projectile type array (that I'm aware of at least).

This isn't technically a bit for grapple, but the live bit still triggers (+8000) without setting anything else. This means that a grapple beam is actually $8000. Wave would be $8001, missiles are $8100. You can check for exactly #$8000, and this will tell you if it's grapple.

A_red_monk_called_Key

crash i messed around with that ASM for a while and couldn't get it to work


QuoteI've looked at the code for blue gates. They code checks if the projectile is a powerbomb, and if it is, doesn't run the opening code. All other projectiles do.

Starting from the LDA $1D77, write this code:

LDA $1D77,X
BEQ $21
CMP #$8000
BNE $15

In byte form, this is: BD 77 1D F0 21 C9 00 80 D0 15. The rest of the data should remain unchanged. The door will only open when fired upon with grapple.
i was hoping to combind both codes to get the results i needed. sadi's code works, but there is sound glitch when the door is shot with a diffrent beam.
i don't know enough to know if skipping AND #$0F00 is safe, or if thats what causes the sound glitch.

maybe one of you two know better how to fix this.

sadi i already owe you a mega ton of graphics, even though you say i don't
crash let me know what you need so i can get started

and thank you both for helping me out

Crashtour99

Hmmm...  that seems, odd...
Unfortunately I can't really determine why it's not working with the limited info I have.  Any chance you could PM me a patch/asm/text file of the doors coding?  That way I could see the actual coding and maybe tweak it (figure out why the sound is glitching, or why the alternate projectile detection isn't working).

As for me, I'd rather get your doors working properly before asking for any graphics stuff.   :wink: 
[spoiler]But if you insist:
Eventually I'd like to alter the title screen image.  I planned on making a drawing by hand, then scan it into my computer and use your graphics technique, but I haven't even gotten around to drawing it yet.  If you've seen my Ridley edit:
[spoiler]http://www.youtube.com/watch?v=_VP3dTISoL8[/spoiler]
The plan was to have him in a similar pose as Ridley in the gold statue room, but facing forward and heavily shadowed (and using the title screen glow for his eyes).  Kind of a menacing upper body bust type of thing.  But like I said, I haven't even gotten around to making the drawing yet. 
[/spoiler]

Crashtour99

Actually, I just went and did a bunch of testing and whatnot, and I came up with a few things.

For a grapple reaction:

lorom

org $freespace in $84
LDA $1D77,X ;Variable use PLM value
BEQ HERE1         ;BRANCH TO HERE1 IF EQUAL
CMP #$8000
BEQ HERE2         ;BRANCH TO HERE2 IF EQUAL
HERE1:
STZ $1D77,X
RTS
HERE2:
STZ $1D77,X ;Variable use PLM value
LDA $7EDEBC,X ;PLM Goto Instruction Pointer
STA $1D27,X ;Next PLM instruction
LDA #$0001
STA $7EDE1C,X ;PLM frame delay
RTS


For a beam reaction:

lorom

org $freespace in $84
LDA $1D77,X ;Variable use PLM value
BEQ HERE1         ;BRANCH TO HERE1 IF EQUAL
AND #$0F00
CMP #$0500
BEQ HERE1
LDA $1D77,X ;Variable use PLM value
AND #$000F       ;getting rid of the extra bits
CMP #$0001       ;REPLACE WITH WHAT BEAM YOU WANT IT TO BE VULNERABLE TO
BEQ HERE2         ;BRANCH TO HERE2 IF EQUAL
HERE1:
STZ $1D77,X
RTS
HERE2:
STZ $1D77,X ;Variable use PLM value
LDA $7EDEBC,X ;PLM Goto Instruction Pointer
STA $1D27,X ;Next PLM instruction
LDA #$0001
STA $7EDE1C,X ;PLM frame delay
RTS


I've tested both of these by copying a missile door facing left to freespace and then repointed the projectile detection (room PLM argument pointer) to one of these.  They work perfectly aside from a slight x-ray glitch, but that has to do with the way PLMs are displayed and isn't a problem with the actual PLM coding at all (if you're replacing existing doors then this x-ray glitch won't be an issue).  No sound issues or anything.  All you have to do is copy/paste into an .asm file, write in your freespace, and apply with xkas (then hex tweak to point to them).

If you still have sound fx issues after that, it's an issue with the door hit/opening coding, which I can also lend a hand with if you need.

A_red_monk_called_Key

#10
QuoteEventually I'd like to alter the title screen image.  I planned on making a drawing by hand, then scan it into my computer and use your graphics technique, but I haven't even gotten around to drawing it yet.  If you've seen my Ridley edit:
ok but recomend practiceing the photoshop stuff. because it took me some time to learn how to get it right. i'll mod the post later on how to get better multi color images. if your going to start keep diffrent colors on differnt layers


QuoteI've tested both of these by copying a missile door facing left to freespace and then repointed the projectile detection (room PLM argument pointer) to one of these.  They work perfectly aside from a slight x-ray glitch, but that has to do with the way PLMs are displayed and isn't a problem with the actual PLM coding at all (if you're replacing existing doors then this x-ray glitch won't be an issue).  No sound issues or anything.  All you have to do is copy/paste into an .asm file, write in your freespace, and apply with xkas (then hex tweak to point to them).

If you still have sound fx issues after that, it's an issue with the door hit/opening coding, which I can also lend a hand with if you need.
awesome i'll try this out when i get back from class. as far as x-ray my other doors and new tile sets have gliches to. i might try to make a x-ray disable air block for some areas, i don't know.

edit:just tested works great. now we can talk title (and thanks for the other beam doors, i have 7 door types in parasite echo, soon there will be 11)




Edit: heres the photoshpo diffrence from when i started to now


the trick is putting colors on differnt layers

Scyzer

If you meant the fuzzy sound when you shoot the door with a beam, that isnt a sound glitch. It's The door dud sound that is in the vanilla rom. Try shooting a normal missile door with a beam and you'll hear it.