Jump to content

Young Link Using the Bow


Jason777
 Share

Recommended Posts

This is for a seperate project that I am working on and normally I wouldn't release content like this, but... so far, I haven't seen a fix for the bow and some people might need this for there own projects (besides, this isn't completely custom).

 

Took me long enough, eh? I'll release the source along with the patch at a later time:

http-~~-//www.youtube.com/watch?v=7-M73wYsqFE&feature=plcp

 

That was the result of...

  • Display list porting
  • Two ASM hacks
  • Fixing display list pointers in code.zdata
  • Fixing item enabling in ovl_kaleido_scope.zdata
For those of you, who had seen the original source code on here (didn't work properly)...: Original Source

^ It should be noted that the lines of code was reduced quite significantly (and it actually works).

 

I may fix the positioning of the arrow spawn and the bow string. Anyways, there's only two bugs with it that I can see so far.

Also, I suck at making cool videos.

Link to comment
Share on other sites

Nice, though there's something strange going on with the item amounts...

 

The thing with the item amounts is that it tries to decrease the deku seed amounts and not the arrow amounts even if an arrow is spawned (I assume it's because of the routine that sets up the deku seed spawning for child link in the ovl_player_actor). To combat this, I add 1 to deku seed amount (if the arrow actor that was spawned has a variable of 0x0002, 0x0003, 0x0004, 0x0005) while subtracting 1 from the arrow amount. The result is that the deku seed amount remains fixed.

 

Example: If you use an arrow...

Deku seed amount = 19;

19 + 1 = 20;

... then it tries to decrease the deku seeds as usual.

20 - 1 = 19;

... this maintains a fixed amount for the deku seeds.

... while decreasing the arrow amount.

Arrow amount = 19;

19 - 1 = 18;

 

^ A hackish fix but it works. One other thing that you may have not noticed is that when decreasing magic, the yellow part of the magic bar that shows how much magic was lost does not appear.

 

...the video is unavailable in Germany because of music from UMG. Goddamn GEMA.

 

Yup. That pisses me off, too. It won't allow me to watch the video on any mobile device except through a special hole in the security (it's only available only to the uploader as far as I can tell). I'm thinking of reuploading the video with different music to see if it fixes anything.
Link to comment
Share on other sites

  • 3 weeks later...

Meh, I'll probably never release a patch for this. Instead I'll release the assembly source:

 

Display list fix assembly code:

 

 

; This ASM hack changes how the display lists for the Bow/Slingshot are loaded

; Hook @ 0x801064B0 = JR RA
; Free Registers = AT, S4, S5, S6, S7, S8, GP
; Non-Changing Registers = A0, A3, T0, T1, T2, S1, S3, K0, K1, RA
; A0 = 0x80146020
; A3 = 0x00000003
; T0 = 0x80002000
; T1 = 0x80001FF0
; T2 = 0x00002000
; S1 = 0x801666A0
; S3 = 0x80166668
; K0 = 0xA430000C
; K1 = 0x00000AAA
; RA = 0x800C8D7C
; Registers in Use = AT, GP, K1

.ORG 0x801064B0
J 0x80600800
NOP

.ORG 0x80600800
; Check if you're Young Link
LUI K1, 0x8016
LW K1, 0xE664(K1)
BEQ K1, R0, Exit
NOP
; Check last button pressed
LUI AT, 0x8016
LW K1, 0x6AF0(AT)
; C-Left Check
LUI GP, 0x0002
AND GP, GP, K1
BNEL GP, R0, ItemCheck
LB AT, 0xE6C9(AT)
; C-Down Check
LUI GP, 0x0004
AND GP, GP, K1
BNEL GP, R0, ItemCheck
LB AT, 0xE6CA(AT)
; C-Right Check
LUI GP, 0x0001
AND GP, GP, K1
BNEL GP, R0, ItemCheck
LB AT, 0xE6CB(AT)
; Else
B Exit
NOP

ItemCheck:
; Regular Arrow Check
ADDIU GP, AT, 0xFFFD    ; 0xFFFFFFFD = -0x03 (Regular Arrows)
BEQL GP, R0, BowSetup
LUI K1, 0x0603
; Fire Arrow Check
ADDIU GP, AT, 0xFFC8     ; 0xFFFFFFC8 = -0x38 (Fire Arrows) 
BEQL GP, R0, BowSetup
LUI K1, 0x0603
; Ice Arrow Check
ADDIU GP, AT, 0xFFC7    ; 0xFFFFFFC7 = -0x39 (Ice Arrows)
BEQL GP, R0, BowSetup
LUI K1, 0x0603
; Light Arrow Check
ADDIU GP, AT, 0xFFC6    ; 0xFFFFFFC6 = -0x3A (Light Arrows)
BEQL GP, R0, BowSetup
LUI K1, 0x0603
; Else
LUI K1, 0x0602
ORI GP, K1, 0x21A8
B ChangeDisplay
ADDIU K1, K1, 0x8048

BowSetup:
ORI GP, K1, 0x0490
B ChangeDisplay
ADDIU K1, K1, 0xFE80

ChangeDisplay:
LUI AT, 0x8012
SW K1, 0x5F3C(AT)
B Exit
SW GP, 0x6144(AT)

Exit:
OR GP, R0, R0        ; Clear GP
OR AT, R0, R0        ; Clear AT
JR RA
ORI K1, R0, 0x0AAA    ; Restore K1 back to 0x00000AAA

 

 

Display list fix nemu cheat (probably need to fix the cheat number):

 

 

CheatName19=Arrow_Display
CheatName19Code0=811064B0 0818
CheatName19Code1=811064B2 0200
CheatName19Code2=811064B4 0000
CheatName19Code3=811064B6 0000
CheatName19Code4=81600800 3C1B
CheatName19Code5=81600802 8016
CheatName19Code6=81600804 8F7B
CheatName19Code7=81600806 E664
CheatName19Code8=81600808 101B
CheatName19Code9=8160080A 0028
CheatName19Code10=8160080C 0000
CheatName19Code11=8160080E 0000
CheatName19Code12=81600810 3C01
CheatName19Code13=81600812 8016
CheatName19Code14=81600814 8C3B
CheatName19Code15=81600816 6AF0
CheatName19Code16=81600818 3C1C
CheatName19Code17=8160081A 0002
CheatName19Code18=8160081C 039B
CheatName19Code19=8160081E E024
CheatName19Code20=81600820 541C
CheatName19Code21=81600822 000B
CheatName19Code22=81600824 8021
CheatName19Code23=81600826 E6C9
CheatName19Code24=81600828 3C1C
CheatName19Code25=8160082A 0004
CheatName19Code26=8160082C 039B
CheatName19Code27=8160082E E024
CheatName19Code28=81600830 541C
CheatName19Code29=81600832 0007
CheatName19Code30=81600834 8021
CheatName19Code31=81600836 E6CA
CheatName19Code32=81600838 3C1C
CheatName19Code33=8160083A 0001
CheatName19Code34=8160083C 039B
CheatName19Code35=8160083E E024
CheatName19Code36=81600840 541C
CheatName19Code37=81600842 0003
CheatName19Code38=81600844 8021
CheatName19Code39=81600846 E6CB
CheatName19Code40=81600848 1000
CheatName19Code41=8160084A 0018
CheatName19Code42=8160084C 0000
CheatName19Code43=8160084E 0000
CheatName19Code44=81600850 243C
CheatName19Code45=81600852 FFFD
CheatName19Code46=81600854 501C
CheatName19Code47=81600856 000E
CheatName19Code48=81600858 3C1B
CheatName19Code49=8160085A 0603
CheatName19Code50=8160085C 243C
CheatName19Code51=8160085E FFC8
CheatName19Code52=81600860 501C
CheatName19Code53=81600862 000B
CheatName19Code54=81600864 3C1B
CheatName19Code55=81600866 0603
CheatName19Code56=81600868 243C
CheatName19Code57=8160086A FFC7
CheatName19Code58=8160086C 501C
CheatName19Code59=8160086E 0008
CheatName19Code60=81600870 3C1B
CheatName19Code61=81600872 0603
CheatName19Code62=81600874 243C
CheatName19Code63=81600876 FFC6
CheatName19Code64=81600878 501C
CheatName19Code65=8160087A 0005
CheatName19Code66=8160087C 3C1B
CheatName19Code67=8160087E 0603
CheatName19Code68=81600880 3C1B
CheatName19Code69=81600882 0602
CheatName19Code70=81600884 377C
CheatName19Code71=81600886 21A8
CheatName19Code72=81600888 1000
CheatName19Code73=8160088A 0004
CheatName19Code74=8160088C 277B
CheatName19Code75=8160088E 8048
CheatName19Code76=81600890 377C
CheatName19Code77=81600892 0490
CheatName19Code78=81600894 1000
CheatName19Code79=81600896 0001
CheatName19Code80=81600898 277B
CheatName19Code81=8160089A FE80
CheatName19Code82=8160089C 3C01
CheatName19Code83=8160089E 8012
CheatName19Code84=816008A0 AC3B
CheatName19Code85=816008A2 5F3C
CheatName19Code86=816008A4 1000
CheatName19Code87=816008A6 0001
CheatName19Code88=816008A8 AC3C
CheatName19Code89=816008AA 6144
CheatName19Code90=816008AC 0000
CheatName19Code91=816008AE E025
CheatName19Code92=816008B0 0000
CheatName19Code93=816008B2 0825
CheatName19Code94=816008B4 03E0
CheatName19Code95=816008B6 0008
CheatName19Code96=816008B8 341B
CheatName19Code97=816008BA 0AAA
CheatName19Count=98

 

 

-------------------------------------------------

 

Arrow spawn fix assembly code:

 

 

; This ASM hack changes how Arrows/Deku Seeds are spawned

; Registers that can be used: AT, K1, GP, A2, T9, SP + 0x0024
; Registers in use: K1, GP, AT, T9

.ORG 0x800324A4
J 0x80600000
NOP

.ORG 0x80600000
; Check if you're Young Link
LUI K1, 0x8016
LW K1, 0xE664(K1)
BEQ K1, R0, Exit
NOP
; Check if A2 = 0x0016 (Arrow actor)
ADDIU K1, R0, 0x0016
BNE K1, A2, Exit
NOP
; Check last button pressed
LUI AT, 0x8016
LW K1, 0x6AF0(AT)
; C-Left Check
LUI GP, 0x0002
AND GP, GP, K1
BNEL GP, R0, ItemCheck
LB AT, 0xE6C9(AT)
; C-Down Check
LUI GP, 0x0004
AND GP, GP, K1
BNEL GP, R0, ItemCheck
LB AT, 0xE6CA(AT)
; C-Right Check
LUI GP, 0x0001
AND GP, GP, K1
BNEL GP, R0, ItemCheck
LB AT, 0xE6CB(AT)
; Else
B Exit
NOP

ItemCheck:
; Regular Arrow Check
ADDIU GP, AT, 0xFFFD    ; 0xFFFFFFFD = -0x03 (Regular Arrows)
BEQL GP, R0, BowSetup
ORI T9, R0, 0x0002
; Fire Arrow Check
ADDIU GP, AT, 0xFFC8     ; 0xFFFFFFC8 = -0x38 (Fire Arrows) 
BEQL GP, R0, MagicCheck
ORI T9, R0, 0x0003
; Ice Arrow Check
ADDIU GP, AT, 0xFFC7    ; 0xFFFFFFC7 = -0x39 (Ice Arrows) 
BEQL GP, R0, MagicCheck
ORI T9, R0, 0x0004
; Light Arrow Check
ADDIU GP, AT, 0xFFC6    ; 0xFFFFFFC6 = -0x3A (Light Arrows) 
BEQL GP, R0, LightMagicCheck
ORI T9, R0, 0x0005
; Slingshot Check
ADDIU GP, AT, 0xFFFA    ; 0xFFFFFFFA = -0x06 (Slingshot) 
BEQL GP, R0, Exit
ORI T9, R0, 0x0009
; Else
B Exit
NOP

LightMagicCheck:
; Check if there is any more Magic left for Light Arrows
LUI AT, 0x8016
LB K1, 0xE693(AT)
ADDIU GP, R0, 0x0008
SLT GP, K1, GP
BNEL GP, R0, BowSetup
ORI T9, R0, 0x0002
; If so, add -8 to Magic
ADDIU K1, K1, 0xFFF8
B BowSetup
SB K1, 0xE693(AT)

MagicCheck:
; Check if there is any more Magic left for Fire/Ice Arrows
LUI AT, 0x8016
LB K1, 0xE693(AT)
ADDIU GP, R0, 0x0004
SLT GP, K1, GP
BNEL GP, R0, BowSetup
ORI T9, R0, 0x0002
; If so, add -4 to Magic
ADDIU K1, K1, 0xFFFC
B BowSetup
SB K1, 0xE693(AT)

BowSetup:
; Check if there are any more Arrows
LUI AT, 0x8016
LB K1, 0xE6EF(AT)
BEQL K1, R0, Exit
ORI T9, R0, 0x0009
; If so, add -1 to Arrow count
ADDIU K1, K1, 0xFFFF
SB K1, 0xE6EF(AT)
; ...And add 1 to Deku Seed count
LB K1, 0xE6F2(AT)
ADDIU K1, K1, 0x0001
B Exit
SB K1, 0xE6F2(AT)

Exit:
OR GP, R0, R0        ; Clear GP
OR AT, R0, R0        ; Clear AT
ORI K1, R0, 0x0AAA    ; Restore K1 back to 0x00000AAA
JAL 0x80031F50
SW T9, 0x0024 (SP)
J 0x800324AC
NOP

 

 

Arrow spawn fix nemu cheat (probably need to fix the cheat number):

 

 

CheatName18=Arrow_Spawn
CheatName18Code0=810324A4 0818
CheatName18Code1=810324A6 0000
CheatName18Code2=810324A8 0000
CheatName18Code3=810324AA 0000
CheatName18Code4=81600000 3C1B
CheatName18Code5=81600002 8016
CheatName18Code6=81600004 8F7B
CheatName18Code7=81600006 E664
CheatName18Code8=81600008 101B
CheatName18Code9=8160000A 0041
CheatName18Code10=8160000C 0000
CheatName18Code11=8160000E 0000
CheatName18Code12=81600010 241B
CheatName18Code13=81600012 0016
CheatName18Code14=81600014 14DB
CheatName18Code15=81600016 003E
CheatName18Code16=81600018 0000
CheatName18Code17=8160001A 0000
CheatName18Code18=8160001C 3C01
CheatName18Code19=8160001E 8016
CheatName18Code20=81600020 8C3B
CheatName18Code21=81600022 6AF0
CheatName18Code22=81600024 3C1C
CheatName18Code23=81600026 0002
CheatName18Code24=81600028 039B
CheatName18Code25=8160002A E024
CheatName18Code26=8160002C 541C
CheatName18Code27=8160002E 000B
CheatName18Code28=81600030 8021
CheatName18Code29=81600032 E6C9
CheatName18Code30=81600034 3C1C
CheatName18Code31=81600036 0004
CheatName18Code32=81600038 039B
CheatName18Code33=8160003A E024
CheatName18Code34=8160003C 541C
CheatName18Code35=8160003E 0007
CheatName18Code36=81600040 8021
CheatName18Code37=81600042 E6CA
CheatName18Code38=81600044 3C1C
CheatName18Code39=81600046 0001
CheatName18Code40=81600048 039B
CheatName18Code41=8160004A E024
CheatName18Code42=8160004C 541C
CheatName18Code43=8160004E 0003
CheatName18Code44=81600050 8021
CheatName18Code45=81600052 E6CB
CheatName18Code46=81600054 1000
CheatName18Code47=81600056 002E
CheatName18Code48=81600058 0000
CheatName18Code49=8160005A 0000
CheatName18Code50=8160005C 243C
CheatName18Code51=8160005E FFFD
CheatName18Code52=81600060 501C
CheatName18Code53=81600062 0021
CheatName18Code54=81600064 3419
CheatName18Code55=81600066 0002
CheatName18Code56=81600068 243C
CheatName18Code57=8160006A FFC8
CheatName18Code58=8160006C 501C
CheatName18Code59=8160006E 0015
CheatName18Code60=81600070 3419
CheatName18Code61=81600072 0003
CheatName18Code62=81600074 243C
CheatName18Code63=81600076 FFC7
CheatName18Code64=81600078 501C
CheatName18Code65=8160007A 0012
CheatName18Code66=8160007C 3419
CheatName18Code67=8160007E 0004
CheatName18Code68=81600080 243C
CheatName18Code69=81600082 FFC6
CheatName18Code70=81600084 501C
CheatName18Code71=81600086 0006
CheatName18Code72=81600088 3419
CheatName18Code73=8160008A 0005
CheatName18Code74=8160008C 243C
CheatName18Code75=8160008E FFFA
CheatName18Code76=81600090 501C
CheatName18Code77=81600092 001F
CheatName18Code78=81600094 3419
CheatName18Code79=81600096 0009
CheatName18Code80=81600098 1000
CheatName18Code81=8160009A 001D
CheatName18Code82=8160009C 0000
CheatName18Code83=8160009E 0000
CheatName18Code84=816000A0 3C01
CheatName18Code85=816000A2 8016
CheatName18Code86=816000A4 803B
CheatName18Code87=816000A6 E693
CheatName18Code88=816000A8 241C
CheatName18Code89=816000AA 0008
CheatName18Code90=816000AC 037C
CheatName18Code91=816000AE E02A
CheatName18Code92=816000B0 541C
CheatName18Code93=816000B2 000D
CheatName18Code94=816000B4 3419
CheatName18Code95=816000B6 0002
CheatName18Code96=816000B8 277B
CheatName18Code97=816000BA FFF8
CheatName18Code98=816000BC 1000
CheatName18Code99=816000BE 000A
CheatName18Code100=816000C0 A03B
CheatName18Code101=816000C2 E693
CheatName18Code102=816000C4 3C01
CheatName18Code103=816000C6 8016
CheatName18Code104=816000C8 803B
CheatName18Code105=816000CA E693
CheatName18Code106=816000CC 241C
CheatName18Code107=816000CE 0004
CheatName18Code108=816000D0 037C
CheatName18Code109=816000D2 E02A
CheatName18Code110=816000D4 541C
CheatName18Code111=816000D6 0004
CheatName18Code112=816000D8 3419
CheatName18Code113=816000DA 0002
CheatName18Code114=816000DC 277B
CheatName18Code115=816000DE FFFC
CheatName18Code116=816000E0 1000
CheatName18Code117=816000E2 0001
CheatName18Code118=816000E4 A03B
CheatName18Code119=816000E6 E693
CheatName18Code120=816000E8 3C01
CheatName18Code121=816000EA 8016
CheatName18Code122=816000EC 803B
CheatName18Code123=816000EE E6EF
CheatName18Code124=816000F0 501B
CheatName18Code125=816000F2 0007
CheatName18Code126=816000F4 3419
CheatName18Code127=816000F6 0009
CheatName18Code128=816000F8 277B
CheatName18Code129=816000FA FFFF
CheatName18Code130=816000FC A03B
CheatName18Code131=816000FE E6EF
CheatName18Code132=81600100 803B
CheatName18Code133=81600102 E6F2
CheatName18Code134=81600104 277B
CheatName18Code135=81600106 0001
CheatName18Code136=81600108 1000
CheatName18Code137=8160010A 0001
CheatName18Code138=8160010C A03B
CheatName18Code139=8160010E E6F2
CheatName18Code140=81600110 0000
CheatName18Code141=81600112 E025
CheatName18Code142=81600114 0000
CheatName18Code143=81600116 0825
CheatName18Code144=81600118 341B
CheatName18Code145=8160011A 0AAA
CheatName18Code146=8160011C 0C00
CheatName18Code147=8160011E C7D4
CheatName18Code148=81600120 AFB9
CheatName18Code149=81600122 0024
CheatName18Code150=81600124 0800
CheatName18Code151=81600126 C92B
CheatName18Code152=81600128 0000
CheatName18Code153=8160012A 0000
CheatName18Count=154

 

Link to comment
Share on other sites

  • 5 months later...

I must express the same sentiments as Siren. This is some Top-notch work! This opens up so many puzzle possibilities as Young Link so to the average modder who is not that skilled with inputting hex or compiling ASM into a usable form you would doing the modding community a great service by making a patch for this.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.