Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeskydev committed Aug 16, 2019
2 parents 5045d04 + 5d71d80 commit 12dc29c
Show file tree
Hide file tree
Showing 15 changed files with 157 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@

This program creates a randomized version of The Legend of Zelda: The Minish Cap.

Current version: `0.2.0a`
Current version: `0.2.1a`

### Logic
The following things are randomized:
Expand Down
Binary file added Resources/Patches/asm/gripScrub1.dmp
Binary file not shown.
25 changes: 25 additions & 0 deletions Resources/Patches/asm/gripScrub1.s
@@ -0,0 +1,25 @@
.thumb
push {lr}
ldr r0,[r0,#0x7C]
ldrb r0,[r0,#8]
cmp r0,#0x44
bne vanilla

ldr r0,=#0x2002EA4
ldr r1,=#10
ldr r3,=#0x801D5E0 @vanilla flag check routine
mov lr,r3
.short 0xF800
cmp r0,#0
beq invert
mov r0,#0
b end
invert:
mov r0,#1
end:
pop {pc}

vanilla:
ldr r3,=#0x8029139
cmp r0,#0x5C
bx r3
Binary file added Resources/Patches/asm/gripScrub2.dmp
Binary file not shown.
27 changes: 27 additions & 0 deletions Resources/Patches/asm/gripScrub2.s
@@ -0,0 +1,27 @@
.thumb
push {lr}
mov r2,r0
ldrb r1,[r2]
mov r0,#0xFC
and r0,r1
cmp r0,#0xC
beq goto802919E

ldrb r0,[r2,#8]
cmp r0,#0x44
bne vanilla

ldr r0,=#0x2002EA4
ldr r1,=#10
ldr r3,=#0x801D5E0 @vanilla flag check routine
mov lr,r3
.short 0xF800
pop {pc}

goto802919E:
ldr r3,=#0x802919F
bx r3

vanilla:
ldr r3,=#0x802917D
bx r3
Binary file added Resources/Patches/asm/gripScrub3.dmp
Binary file not shown.
23 changes: 23 additions & 0 deletions Resources/Patches/asm/gripScrub3.s
@@ -0,0 +1,23 @@
.thumb
push {r4,lr}
mov r4,r0
mov r0,#0
mov r1,#6
strb r1,[r4,#0xC]
mov r1,r4
add r1,#0x81
strb r0,[r1]
ldr r0,[r4,#0x7C]
ldrb r0,[r0,#8]
cmp r0,#0x44
bne end

ldr r0,=#0x2002EA4
mov r1,#10
ldr r3,=#0x801D5F4 @vanilla flag set routine
mov lr,r3
.short 0xF800

end:
ldr r3,=#0x8029215
bx r3
Binary file modified Resources/Patches/improvements/asm/dungeonDisplay.dmp
Binary file not shown.
24 changes: 12 additions & 12 deletions Resources/Patches/improvements/asm/dungeonDisplay.s
Expand Up @@ -8,6 +8,17 @@ ldr r3,=#0x801D668
mov lr,r3
.short 0xF800

clean:
ldr r0,=#0x2034CB0
ldr r1,=#0x440
add r1,r0
mov r2,#0
cleanLoop:
str r2,[r0]
add r0,#4
cmp r0,r1
bne cleanLoop

@check current map mode
ldr r2,=#0x20344A4
ldrb r2,[r2]
Expand All @@ -21,7 +32,7 @@ and r4,r1
loop:
ldrb r1,[r0]
cmp r1,#0
beq clean
beq end
cmp r1,r4
beq match
add r0,#2
Expand Down Expand Up @@ -103,17 +114,6 @@ add r0,r5
bl draw
b end

clean:
ldr r0,=#0x2034CB0
ldr r1,=#0x440
add r1,r0
mov r2,#0
cleanLoop:
str r2,[r0]
add r0,#4
cmp r0,r1
bne cleanLoop

end:
pop {r4-r7}
ldr r3,=#0x80A6807
Expand Down
3 changes: 3 additions & 0 deletions Resources/Patches/improvements/installer.event
Expand Up @@ -146,3 +146,6 @@ BYTE 0x1A 0x1C //pow
BYTE 0x12 0x1D //dhc
BYTE 0x0F 0x1E //rc
BYTE 0x00 0x00 //terminator

//element object can have sub ids
PUSH; ORG $9FB64; SHORT 0x7AE1; POP
Binary file added Resources/Patches/logicfixes/asm/elementsFix.dmp
Binary file not shown.
38 changes: 38 additions & 0 deletions Resources/Patches/logicfixes/asm/elementsFix.s
@@ -0,0 +1,38 @@
.thumb
mov r1,r4
add r1,#0x6A
mov r0,#0x40
strb r0,[r1]
ldrb r0,[r4,#0x0A]

ldr r0,=#0x3000BF0
ldrb r1,[r0,#4]
ldrb r2,[r0,#5]
ldr r3,poin
loop:
ldrb r0,[r3]
cmp r0,#0
beq noMatch
cmp r0,r1
bne next
ldrb r0,[r3,#1]
cmp r0,r2
beq match
next:
add r3,#3
b loop

noMatch:
mov r0,#0x40
b end

match:
ldrb r0,[r3,#2]

end:
ldr r3,=#0x809FA7B
bx r3

.align
.ltorg
poin:
14 changes: 14 additions & 0 deletions Resources/Patches/logicfixes/installer.event
Expand Up @@ -228,3 +228,17 @@ PUSH; ORG $9E2A27; String("You should try"); BYTE 0x20 2 1; String("Figuresanity
PUSH; ORG $9E39AA; String("You should try"); BYTE 0x20 2 1; String("Figuresanity"); BYTE 2 0 0x2E 0x0A; String("You'll"); BYTE 0x20 2 1; String("love"); BYTE 0x20 2 0; String("it, trust me"); BYTE 0; POP
PUSH; ORG $9E4A08; String("You should try"); BYTE 0x20 2 1; String("Figuresanity"); BYTE 2 0 0x2E 0x0A; String("You'll"); BYTE 0x20 2 1; String("love"); BYTE 0x20 2 0; String("it, trust me"); BYTE 0; POP
PUSH; ORG $9E54A7; String("You should try"); BYTE 0x20 2 1; String("Figuresanity"); BYTE 2 0 0x2E 0x0A; String("You'll"); BYTE 0x20 2 1; String("love"); BYTE 0x20 2 0; String("it, trust me"); BYTE 0; POP

//fix elements hardcoded movement
PUSH; ORG $9FA70; jumpToHack(elementsFix); POP
ALIGN 4
elementsFix:
#incbin "asm/elementsFix.dmp"
POIN elementsTable
ALIGN 4
elementsTable:
BYTE 0x49 0x00 0x40
BYTE 0x51 0x00 0x41
BYTE 0x60 0x0E 0x42
BYTE 0x70 0x00 0x43
BYTE 0x00 0x00 0x00 //terminator
14 changes: 14 additions & 0 deletions Resources/Patches/scrubs.event
Expand Up @@ -44,3 +44,17 @@ POIN $CC0B8; SHORT bottleScrubItem bottleScrubSub
POIN $CC0A0; SHORT gripScrubItem gripScrubSub
//POIN $CC0DC; SHORT stoneScrubItem stoneScrubSub
WORD 0 0 //terminator

//fix grip scrub flag
PUSH; ORG $29130; jumpToHack(gripScrub1); POP
ALIGN 4
gripScrub1:
#incbin "asm/gripScrub1.dmp"
PUSH; ORG $2916C; jumpToHack(gripScrub2); POP
ALIGN 4
gripScrub2:
#incbin "asm/gripScrub2.dmp"
PUSH; ORG $29200; jumpToHack(gripScrub3); POP
ALIGN 4
gripScrub3:
#incbin "asm/gripScrub3.dmp"
1 change: 0 additions & 1 deletion Resources/default.logic
Expand Up @@ -116,7 +116,6 @@ CrenelHeartCaveHeartPiece; Minor; 0FB32B; Locations.AccessLowerCrenel, Items.Bom
CrenelFairyHeartPiece; Minor; 0FB0BB; Locations.AccessCrenel, Items.BombBag
CrenelGripScrub; Major; gripScrubItem:Define:FirstByte, gripScrubSub:Define:SecondByte; Locations.AccessCrenel, Items.Shield, Items.BombBag; Items.GripRing
GraybladeLeft; Minor; 25-00-00; Locations.AccessCrenel, Helpers.CanSplit2, Items.GripRing
GraybladeLeft; Minor; 25-00-00; Locations.AccessCrenel, Helpers.CanSplit2, Items.GripRing
GraybladeRight; Minor; 25-00-01; Locations.AccessCrenel, Helpers.CanSplit2, Items.GripRing
GraybladeHeartPiece; Minor; 0D752B; Locations.AccessCrenel, Helpers.CanSplit2, Items.GripRing
CrenelBombFairy; Major; 00B828; Locations.AccessCrenel, Items.BombBag, Items.GripRing
Expand Down

0 comments on commit 12dc29c

Please sign in to comment.