General ASM Help topic

Page 4 of 4 Previous  1, 2, 3, 4

Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Fri 19 Jul 2013 - 16:17

Some testing. Freezing is possible only if all on same bg. But this was not originally planed.
 
General ASM Help topic - Page 4 Bg10
 
p1
Can freeze water from ground, but can not get out of deep water (swims all over, if object 0DA).
 
p2
Can freeze water from ground, but can not get out of deep water (stuck, if object 0C9 or 0D8).
 
p3
Can not hit water this way!
 
 
 
If dungeon deep water wants to be frozen, no water corridors must exist, only deep and shallow water on the same bg.
 
Further Asm needed to fix the dungeon collision between shallow and deep water (objects 0C8 and 0C9) to be the same as in the overworld.
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Fri 19 Jul 2013 - 16:28

ush... that explains everything.

Another possibility:
Wouldn't it be simply possible to edit bg1 below the water to have a 08?
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Founder Fri 19 Jul 2013 - 16:29

Wow so much progress here since I last saw this thread, keep going guys, simply amazing! It was a good idea to have a general asm thread!

Founder

General ASM Help topic - Page 4 Image212

Since : 2012-06-19

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Fri 19 Jul 2013 - 17:03

Quote
Wow so much progress here since I last saw this thread, keep going guys, simply amazing! It was a good idea to have a general asm thread!
-----
Yes, it was a brakethrough today I think, since this overworld code really is final in my oppinion.


Last edited by Puzzledude on Fri 19 Jul 2013 - 17:22; edited 1 time in total
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Fri 19 Jul 2013 - 17:21

It CAN be done. Very Happy 
 
General ASM Help topic - Page 4 Ahaaah10
 
Quick explanation:
We must place 2 objects at once on same place. 0CA object on bg2 AND another on bg1, but on same place. This fixes all Very Happy (even autofixes swiming - because object on bg2, but also enables freezing because of object on bg1). So: Object on bg2 fixes collision problems of bg1 object (if single), but object on bg1 fixes freezing problems of bg2 object (if single).
 
Visual side effect (ice will be seen transculent). Things in or under the water will Not be seen.


Last edited by Puzzledude on Fri 19 Jul 2013 - 17:56; edited 1 time in total
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Fri 19 Jul 2013 - 17:41

Cool!!!!!!!

As for the visual side effect: from the pic I figure that a "solid" water surface must be placed in dungeons, so there is no transculedence anymore (seeing no ground).
So, when editing the bg1 layer, can't you simply remove the bg2 layer via HM then, to have only the "solid" bg1 water layer and no transculent bg2 layer?

If this isn't possible I could also hardcode bg2 layer away with icetile on bg1, but this is harder, if it goes via HM to completely can renounce on transculent bg2, everything is fine Smile
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Fri 19 Jul 2013 - 17:55

There's one more problem with double objects: will make a visual paradox. If partially iced, Link would swim into ice. Only when he jumps out of water on staircase, can he return on the ice (this is actually no good).
 
I can remove water on bg2 easily, so the "solid" bg1 remains, but Link does not swim in this - you jump in and can not move in the water! Don't know why? If we can make Link swim in water object 0C9 placed on bg1, than this is the solution to all problems.

EDIT
There's also an issue with the special staircase. It will not let Link operate on bg1 alone, it will always send him to bg2, this is why bg2 water is needed. If we remove bg2, we must remove the staircase (but this is the only object which makes Link come out of the water). Also indoors can get buggy (I've just bugged out my rom with HM, without using icerod effect at all).

I know from Goddess of Wisdom hack, that indoor water was a pain to do (and buggy). So I had a hard time making it work as it is.

I will personally stick to overworlds with this effect, only using the water rock (no water freeze in GoT Part1 probably), while implementing the water freeze in Part2, because of the lava land.
----------------

For the dungeon testing. The only thing that worked, or was the least bugged, was my first test with double object on one place. All other tests resulted in bugs.
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Fri 19 Jul 2013 - 18:39

I hardcoded the bg2 away when bg1 is iced in the dungeon roms (so only the tile hit by the ice will vanish in bg2 which will maybe cause less bugs)

Can you test it?
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Fri 19 Jul 2013 - 19:13

I did some more testing on the dungeons fix-4.

The problem are the stairs or a small object to jump out of the water (default entrance to water), which always go to bg2. If the part of corridor is iced, we need Link to jump out where the ice is. But not just jump out, but also go from bg2 to bg1.
 
If however all is iced, it is again no good. If going to the edge of corridor (if all iced) Link will jump of into wall.
 
We need to do some incredible collision adoptations to fix this, not to mention that the indoor water corridors are complex by nature without the icerod effect.


EDIT
Haven't yet tested the dungeons fix-5.
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Fri 19 Jul 2013 - 21:11

I cross my fingers that it works.

However, I was thinking about 2 further problems. In caves you have upper and lower floors (seperated through staircases), upper is bg1, lower is bg2. If this hack is used for pools in caves, it of course can only be performed if the pool is made on upper floors. Luckily no caves have deep water.

The second is more severe: this hack will spoil the water dungeon riddle (light world opening the gates enables entrance to dungeon), because we must stablize the second pool in bg1. Well, could be hardcoded so that the bg1 pool appears with bg2 pool (but this is much effort I guess) or simply skip adding the tiles to this first room (what might be confusing to some players: eh, I can freeze that pool but not this?)

Ah well, I am curious about your testing outcome and then we'll see. If everything fails we have this feature as overworld only, where it seems to work flawlessly and yet opens many possibilities (water blocks, riddles prior flippers, lava riddles) _)

Edit:
was able to test it myself with HM. Well, you jump into the wall, swim through ice and so on... maybe fixable but with much exceptional coding, bug fixing unexpected results.... I'd suggest to stick on having this feature on overworld only. What do you guys think?

Puzz, can you please finalize the patches then? I'd suggest however making it easy for the users by not giving too many variations, it will just end in cinfusion. I'd suggest one with no gfx (code only) and one with gfx (to directly use) as we had it.

Both should contain the 03 block read since it is unused in normal game, so it won't matter to have it here (saves two variations). You can also have the waterblocks as 03 in the gfx version (so we save further 2 variations). Anybody who has different stuff for 03 can edit it according to his wishes.
I do not know about the 13 lava blocks, but you can also add this code if you wish,
so we have a lda $03e8
cmp 08 -> change deep water to ice
cmp 03 -> change unused blocks to ice
cmp 13 -> change lava to ice (or ground?)
to this code (same in both variations) we can give the asm so that people can nop out the undesired code themselves?
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Sat 20 Jul 2013 - 6:39

Yes, fix-5 of dungeons has the same main problems. I will also stick to overworlds only with this feature.
 
I will make only 2 versions then (gfx and no gfx, freezing type 08 and 03).
 
Lava is actually red water, but the freezing tile is normal ground type 00, rather then ice type 14. But I think I rather make a lava ground tile, like in Parallel Worlds. More of those will hurt you like spikes. To get through, you will freeze them (to normal ground probably, could also be ice in this case, but lava palette will probably not match with ice).
 
Further global problems of freezing water in overworlds if no flippers:
-can not have a deep water screen transition (freezing deep water and transit, will make you fall in deep water with no flippers and no possibility of further freezing on the other screen),
-can freeze rocks floating on water, if one 16x16 tile is half type 08, half type 02, can walk out of screen, since these rocks are a natural barrier,
-can not jump on ice horizontally if one horizontal is iced,
-icing to close to end of water, but leaving one line uniced, can make you jump of the ice into a wall,
-can be stuck on the island with no green magic left.
 
The above has nothing to do with the code, and is more a global problem, since freezing water is a giant change to overworld's default status.
-----------------------------------
 
So I'll probably make "debug" version (gfx and no gfx) from my perspective, to not be able to freeze water, but rather special ground objects (like water rock, lava rock or lava ground element. So this code is higly adoptable.
 
If a ground area is build with many water rocks, or a ground area with many lava ground objects (coresponds to spikes), the results will be awesome as well, since you could icerod yourself through, blasting away many objects as you would be freezing water. This is just a debugger's solution, but I will also make a patch to implement the original idea.
 
Can also make it so, that you can freeze all bushes (no riddles here, just fun for the player Smile , and to point out this new code obviously).
 
The 3 CMP's are smart,
-cmp 08 (deep water), to ice
-cmp 03 (unused, water rock on ground), to ice
-cmp 13 (spike or lava on ground), to ice (can not be ground if first two are ice),
all to ice or all to ground is possible, if I understand the code correctly.
 
I will probably build the code based on 2 cmp's, since I don't think all 3 can be in one game, since the lava pal 23, is not compatible to upper 2. Also the iced tiles will be normal ground with lava, so again not compatible. I have this fixed in GoT, since lava is much later in the game, and the game will have 2 parts (roms) with 2 endings. So I can make Part1, have the cmp 8+3, iced to type14, but in Part2 the cmp 13+3, iced to type 0.


Last edited by Puzzledude on Sat 20 Jul 2013 - 9:19; edited 1 time in total
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Sat 20 Jul 2013 - 7:30

Ok, I'll skip the dungeon, since this is too bug appealing.

ohoh... yeah the code does some major changes to the overworld. But as you tell, the glitchaffective problems must be solved by editing with HM:
can not have a deep water screen transition
I suggest bordering screen frames with shallow water in areas you can access without flippers

-can freeze rocks floating on water, if one 16x16 tile is half type 08, half type 02, can walk out of screen, since these rocks are a natural barrier
Ah... I was wondering why this was this way in Hyrule lake but not in the swamp area. So every rock of a barrier must be complete 16x16

can not jump on ice horizontally if one horizontal is iced
Yes, nothing I can do but jumping on it vertically or swim back to the start

icing to close to end of water, but leaving one line uniced, can make you jump of the ice into a wall,
must be solved by bordering the wall with shallow water I guess :-/

can be stuck on the island with no green magic left.
Maybe you should get the flute before the icerod so you can always escape...


I'm not sure how to best offer this code since it is highly adoptable... maybe giving one asm with explanation where to change what to get which result is best? I will leave this all up to you since you seem to be an expert of what to get out of this piece of asm Laughing
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Sat 20 Jul 2013 - 9:18

All the above is actually fixable with Hyrule Magic. I was pointing out that if the icerod effect is choosen, the author of his hack must know this from the beginning and build the overworld so, that it can handle freezing water; which can be done. So he should then choose a full 16x16 rock tile to block out the water path, bring flute in earlier, make shallow water transits etc.

But one can also adopt it differently, by rather freezing new object on the ground (since ground is much more stable then water), with the same effect as if freezing water. You are just more limited (more limitation of freezing means less bugs).

Also: freezing water (type 08) and lava (type 13) is not recommended in one rom, but rather choose one or the other (palette and the new reloaded tiles are not compatible here). So I'll make the patches with 2 CMP's only (freezing 2 types is plenty enough).
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Sat 20 Jul 2013 - 9:56

phew, I almost think I will hand over the complete code to you (unless more bugs are found that I need to fix).

Guess you know the code well enough now to help out other people to implement this hack into their roms in the way they want to have it Smile
(or somebody makes an asm out of all possibilities)
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Sat 20 Jul 2013 - 10:22

I just look the code from the hex perspective. But I could understand the beginning of it, because you disassembled it into Asm a few posts back.
 
The only adoptation, which has to be made, are 3 bytes only (1 which controls the type of the frozen tile, and two to determine which type to freeze, so I think people will understand this and can adopt to their wishes). The first byte can be edited in HM also, the second 2 can not (since this is new code).
 
I could also point out the bytes, which control the palette of the reloaded tile and which tile in gfx will be the one, to be transferend into vram. If someone should choose to change this (specially palette).
 
If I for instance, adopt the pal to 2, and redo the gfx, the rod will make the water stone disappear.
 
Just an idea:
when you draw the ice rod with two commands in the code (first and second shoot)
LDA $0303 ; check rod is used
CMP #$06
BEQ $01
RTL
LDA $0304 ; check rod is used #2
, can this be changed to powder? Because then we could make certain rocks disappear (or changed to ice) if sprincled with powder.
 
This is just additional and is not necessary to look into.
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Sat 20 Jul 2013 - 11:31

unfortunately not possible with this code since it is specific to $03E8 save. If you want to make blocks with powder changed you need to write a similar code but with check at... wait, tracing... $0333 but also gets written at another place, at $09/9352 8D 33 03    STA $0333
So you need to hijack from here, make a check for the value (as for the rod, 08 is deep water, 09 is shallow water...) but it is less complicated since no second shot is possible - so we have no x values here.

Here's the latest complete code. Maybe you can adjust it to all other uses...

Code:


; This is a ASM FrontEnd Code for Zelda ALTTP (US, no header) to change tiles with ice rod (freeze water e.g.,).

lorom


org $088a5d ; jsl to main code
jsl $0efba0


org $0efba0 ; main code
STA $03E4,x  ; load native value
TAY               
LDA $008C ; check if you're on overworld 
BNE $01     
RTL                 
LDA $03A3 ; disable other flying object icing water (boomerang, sword beam)   
CMP #$06               
BEQ $01   
RTL     
CPX #$04 ; check if ice shot #1 only is used (disable 2nd shot to ice)             
BEQ $01   
RTL     
LDA $03E8 ; check if ice shot is on water tiles 
CMP #$08 
BEQ $08 
LDA $03E8 ; check if ice shot is on native unused, edited blocks   
CMP #$03 
BEQ $01 
RTL
LDA $0303  ; double check if really ice shot is used
CMP #$06     
BEQ $01   
RTL     
LDA $0304 
CMP #$06
BEQ $01 
RTL         
TXA       
STA $7ED004 ; store native x value into ram to regain after code
LDA $4212 ; wait for vblank to enable dma transfer
AND #$80             
BEQ $F9   
REP #$30             
LDA $2116
STA $7ED005 ; store native value to regain later
LDA $00    ; calculation procedure to get correct x,y coordinates for new tile
SEC                 
SBC $0708
AND $070A
ASL A         
ASL A               
ASL A             
STA $06   
LDA $02 
SEC               
SBC $070C
AND $070E
ORA $06 
TAX           
LDA #$00B7         
STA $7E2000,x ; store new 16x16 ice tile into ram (property of tile!)
CLC                   
STZ $02      ; calculation procedure to get 8x8 vram map address (look of tile)
TXA                 
AND #$003F       
CMP #$0020           
BCC $05 
LDA #$0400       
STA $02   
TXA             
AND #$0FFF       
CMP #$0800         
BCC $07
LDA $02   
ADC #$07FF       
STA $02   
TXA           
AND #$001F       
ADC $02 
STA $02   
TXA                 
AND #$0780           
LSR A         
ADC $02   
STA $2116        ; store vram address for upper tile part (8x16) to $2116
STA $7ED007
LDA #$1D83      ; load new ice tiles
STA $7ED000
STA $7ED002
JSR $FD00        ; jsr to dma vram transfer for upper ice tile part
REP #$30         
LDA $7ED007      ; regain vram address
ADC #$0020      ; add 20 for lower part (8x16) and store to $2116
STA $2116 
JSR $FD00        ; jsr to dma vram transfer for lower ice tile part
LDA $7ED005      ; regain native register value
STA $2116
SEP #$30       
LDA $7ED004      ; regain native x-value
TAX               
RTL             


org $0efd00 ; vram dma transfer
LDA #$007E ; load origin of bytes to transfer (7E/d000)
STA $4304
LDA #$D000         
STA $4302 
SEP #$30
LDA #$18 ; bus
STA $4301 
LDA #$04 ; transfer 4 bytes     
STA $4305
LDA #$01 
STA $4300 
STA $420B ; make dma transfer
RTS     


; bug fix to not swim through tiles but jump onto them

org $07dc9e
jsl $0efc80
nop

org $0efc80
LDA $0A 
TSB $0343 
TSB $0348
RTL       

; bug fix to stop gliding on shallow water when leaving ice tile

org $07dd1b
jsl $0efc90
nop

org $0efc90
LDA $0A 
TSB $0359 
LDA $0350 
CMP #$0100             
BNE $03   
STZ $034A 
RTL                 


org $0e95dc ; get a 0e written here (first byte) to enable gliding on new tiles
ASL $5757

org $0f85b8 ; get new tile values (83 1d) written 4 times here
STA $1D,s 
STA $1D,s 
STA $1D,s 
STA $1D,s


Last edited by Conn on Sat 20 Jul 2013 - 14:15; edited 2 times in total
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Sat 20 Jul 2013 - 13:58

I'm beginning to slowly understand how this works. The code also looks very interesting once disassembled.
 
This is also why I was going for powder (since I intuitively thought it is simpler).
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Sat 20 Jul 2013 - 14:09

Sorry, please re-copy the asm. Did a mistake (the org $ must actually given in lorom address, I put pc addresses in. Corrected this now in edited above code Smile
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Puzzledude Sat 20 Jul 2013 - 14:48

I've updated it. Just finalizing the original (non-adopted) files with the code.
Puzzledude
Puzzledude

General ASM Help topic - Page 4 Image213

Since : 2012-06-20

Back to top Go down

General ASM Help topic - Page 4 Empty Re: General ASM Help topic

Post by Conn Sat 20 Jul 2013 - 15:23

great Smile I am off for vacation.
Maybe you can provide all types of asm for the different codes and only for the finalized gfx ips patches (just a suggestion)?
Conn
Conn

General ASM Help topic - Page 4 Image212

Since : 2013-06-30

Back to top Go down

Page 4 of 4 Previous  1, 2, 3, 4

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum