Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
boviex committed Jul 16, 2017
1 parent 3cc75be commit bef841c
Show file tree
Hide file tree
Showing 1,728 changed files with 126,090 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

#rom stuff
*.gba
*.sav
*.sgm

# =========================
# Operating System Files
# =========================
Expand Down
17 changes: 17 additions & 0 deletions Custom Definitions.event
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#define FreeSpace 0xb2a610
#define FreeSpaceBLRange 0x1c1ec0

#define ChapterTileset(chapter, object, palette, config) "PUSH; ORG 0x8b0890 + (148* chapter) + 4; SHORT object; BYTE palette config; POP"
#define ChapterTileAnims(chapter, anim1, anim2) "PUSH; ORG 0x8b0890 + (148* chapter) + 9; BYTE anim1 anim2; POP"

#ifndef ItemTable
#define ItemTable 0x809B10
#endif
#ifndef DebuffTable
#define DebuffTable 0x203F100
#endif

#define LunarBrace MoonBracelet
#define SolarBrace SunBracelet

#include "Engine Hacks/Skill System/skill_definitions.event"
Binary file added Engine Hacks/ASM/20dmg.dmp
Binary file not shown.
8 changes: 8 additions & 0 deletions Engine Hacks/ASM/20dmg.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.thumb
mov r2, #0x14
mov r1, #0x5a
strb r2, [r0, r1]
mov r1, #0x5c
mov r2, #0
strb r2, [r0, r1]
bx lr
20 changes: 20 additions & 0 deletions Engine Hacks/ASM/Assemble ARM.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off

SET startDir=C:\devkitPro\devkitARM\bin\

@rem Assemble into an elf
SET as="%startDir%arm-none-eabi-as"
%as% -g -mcpu=arm7tdmi -mthumb-interwork %1 -o "%~n1.elf"

@rem Print symbol table
SET readelf="%startDir%arm-none-eabi-readelf"
%readelf% -s "%~n1.elf" > "%~n1.symbols.log"

@rem Extract raw assembly binary (text section) from elf
SET objcopy="%startDir%arm-none-eabi-objcopy"
%objcopy% -S "%~n1.elf" -O binary "%~n1.dmp"

echo y | del "%~n1.elf"

echo y | del "%~n1.symbols.log"
pause
Binary file added Engine Hacks/ASM/CasualModeFE8.dmp
Binary file not shown.
Binary file added Engine Hacks/ASM/DZ_hook.dmp
Binary file not shown.
Binary file added Engine Hacks/ASM/DangerZone.dmp
Binary file not shown.
Binary file added Engine Hacks/ASM/Debuffs NoMagic FE8.zip
Binary file not shown.
20 changes: 20 additions & 0 deletions Engine Hacks/ASM/Debuffs/Assemble ARM.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off

SET startDir=C:\devkitPro\devkitARM\bin\

@rem Assemble into an elf
SET as="%startDir%arm-none-eabi-as"
%as% -g -mcpu=arm7tdmi -mthumb-interwork %1 -o "%~n1.elf"

@rem Print symbol table
SET readelf="%startDir%arm-none-eabi-readelf"
%readelf% -s "%~n1.elf" > "%~n1.symbols.log"

@rem Extract raw assembly binary (text section) from elf
SET objcopy="%startDir%arm-none-eabi-objcopy"
%objcopy% -S "%~n1.elf" -O binary "%~n1.dmp"

echo y | del "%~n1.elf"

echo y | del "%~n1.symbols.log"
pause
40 changes: 40 additions & 0 deletions Engine Hacks/ASM/Debuffs/Debuff Weapons Installer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#define Extra_Data_Location 0x0203F100
#define ItemTable 0x809B10


#define defWeaponDebuffs(str, skl, spd, luk, def, res) "BYTE (str|(skl<<4)) (spd|(def<<4)) (res|(luk<<4))"

ORG 0x2B54E
SHORT 0x0000
jumpToHack(damagedThisTurn)

ORG 0x2B422
#incbin "Set Hit This Turn.dmp"

ORG 0x2C078
callHack_r3(setDebuffs)


//If not using Fates EXP hack
/*
ORG 0x2C56C
mov r1, #0x01
and r0, r1
*/



ORG FreeSpace
ALIGN 4
damagedThisTurn:
#incbin "Set Damaged This Turn.dmp"

setDebuffs:
#incbin "Set Debuffs.dmp"
WORD Extra_Data_Location
POIN ItemTable
POIN DebuffTable

DebuffTable:
defWeaponDebuffs(0,0,0,0,0,0) //let 0-index entry be no debuffs.
defWeaponDebuffs(0,1,1,0,2,2) //Bronze Shuriken debuff.
80 changes: 80 additions & 0 deletions Engine Hacks/ASM/Debuffs/Defense Getter.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
.thumb
@Additional Data Format:
@0-2: Debuffs, 4 bits each (str/skl/spd/def/res/luk)
@3: Rallys (bit 7 = rally move, bit 8 = rally spectrum)
@4: Str/Skl Silver Debuff (6 bits), bit 7 = half strength, HO bit = Hexing Rod
@5: Magic
@6: LO Nibble = Dual Guard Meter?

@Original at 19210
push {r4-r6, lr}
mov r4, r0 @Unit
mov r5, #0x17
ldsb r5, [r4, r5] @Base defense

ldr r6, AdditionalDataTable
ldrb r1, [r4 ,#0xB] @Deployment number
lsl r1, r1, #0x3 @*8
add r6, r1 @r0 = *debuff data
@r6 = &Additional Data

@Now get the weapon bonus.
ldr r1, GetEquippedWeapon
bl gotoR1
ldr r1, GetWeaponDefBonus
bl gotoR1

@Add it to the accumulator.
add r5, r0

@Now get the debuff
@Def debuff is HO nibble of 1st byte
ldr r0, [r6]
mov r1, #0xF
lsl r1, #0xC
and r0, r1
lsr r0, #0xC
@Subtract the debuff off.
sub r5, r0


@Pair Up Bonus


@Rally Bonus
@8 bit of the 0x3 byte
ldrb r1, [r6, #0x3]
mov r0, #0x8
and r0, r1
cmp r0, #0x0
beq noDefRally
add r5, #0x4
noDefRally:
@Rally Spectrum
mov r0, #0x80
and r0, r1
cmp r0, #0x0
beq noRallySpectrum
add r5, #0x2
noRallySpectrum:

@Return the acccumulator.
mov r0, r5

cmp r0, #0x0
bge end
mov r0, #0x0
end:
pop {r4-r6}
pop {r1}
gotoR1:
bx r1

.align
GetEquippedWeapon:
.long 0x8016B29
GetWeaponDefBonus:
.long 0x80164B1
AdditionalDataTable:
@Handled by installer.
@.long 0x0203E894
Binary file added Engine Hacks/ASM/Debuffs/Defense Getter.dmp
Binary file not shown.
7 changes: 7 additions & 0 deletions Engine Hacks/ASM/Debuffs/Extra Data Format.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Additional Data Format:
0-2: Debuffs, 4 bits each (str/skl/spd/def/res/luk)
3: Rallys (bit 7 = rally move, bit 8 = rally spectrum)
4: Str/Skl Silver Debuff (5 bits), bit 6 = half magic?, bit 7 = half strength, HO bit = Hexing Rod
5: Magic
6: LO Nibble = Dual Guard Meter?
7: unused3
15 changes: 15 additions & 0 deletions Engine Hacks/ASM/Debuffs/Getter Locations.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Current HP - 8019150 (unmodded right now -- set to use MaxHP getter)

MaxHP - 08019190

Strength - 080191B0

Skill - 080191D0

Speed - 08019210

Defence - 08019250

Resistance - 08019270

Luk - 08019298
68 changes: 68 additions & 0 deletions Engine Hacks/ASM/Debuffs/Installer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#define Free_Space 0xEAB000
#define Free_Saved_RAM_Space 0x0203F100

//Installation
#include "Extensions/Hack Installation.txt"
#define Debuff_Table Free_Saved_RAM_Space

//To zero out the additional data upon making a new unit.
ORG 0x17D7C
gotoHackWithR3(Initialization)
//This is for loading a previously deployed unit for the first time on a map.
ORG 0xA5808
gotoHackWithR3(Reloading)

ORG 0x188A8 //This is for decreasing the debuffs each turn/ending rally
jumpToHack(PerTurn)

ORG 0x19190
gotoHack(MaxHPGetter)
ORG 0x191B0
gotoHack(StrengthGetter)
ORG 0x191D0
gotoHack(SkillGetter)
ORG 0x19210
gotoHack(SpeedGetter)
ORG 0x19250
gotoHack(DefenseGetter)
ORG 0x19270
gotoHack(ResistanceGetter)
ORG 0x19298
gotoHack(LuckGetter)

ORG Free_Space
MaxHPGetter:
#incbin "MaxHP Getter.dmp"
WORD Debuff_Table
StrengthGetter:
#incbin "Strength Getter.dmp"
WORD Debuff_Table
SkillGetter:
#incbin "Skill Getter.dmp"
WORD Debuff_Table
SpeedGetter:
#incbin "Speed Getter.dmp"
WORD Debuff_Table
DefenseGetter:
#incbin "Defense Getter.dmp"
WORD Debuff_Table
ResistanceGetter:
#incbin "Resistance Getter.dmp"
WORD Debuff_Table
LuckGetter:
#incbin "Luck Getter.dmp"
WORD Debuff_Table



Initialization:
#incbin "New Initializer.dmp"
WORD Debuff_Table

Reloading:
#incbin "New Reload.dmp"
WORD Debuff_Table

PerTurn:
#incbin "ProcessDebuffs.dmp"
WORD Debuff_Table
80 changes: 80 additions & 0 deletions Engine Hacks/ASM/Debuffs/Luck Getter.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
.thumb
@Additional Data Format:
@0-2: Debuffs, 4 bits each (str/skl/spd/def/res/luk)
@3: Rallys (bit 7 = rally move, bit 8 = rally spectrum)
@4: Str/Skl Silver Debuff (6 bits), bit 7 = half strength, HO bit = Hexing Rod
@5: Magic
@6: LO Nibble = Dual Guard Meter?

@Original at 19298
push {r4-r6, lr}
mov r4, r0 @Unit
mov r5, #0x19
ldsb r5, [r4, r5] @Base luk

ldr r6, AdditionalDataTable
ldrb r1, [r4 ,#0xB] @Deployment number
lsl r1, r1, #0x3 @*8
add r6, r1 @r0 = *debuff data
@r6 = &Additional Data

@Now get the weapon bonus.
ldr r1, GetEquippedWeapon
bl gotoR1
ldr r1, GetWeaponLukBonus
bl gotoR1

@Add it to the accumulator.
add r5, r0

@Now get the debuff
@Luk debuff is HO nibble of 2nd byte
ldr r0, [r6]
mov r1, #0xF
lsl r1, #0x14
and r0, r1
lsr r0, #0x14
@Subtract the debuff off.
sub r5, r0


@Pair Up Bonus


@Rally Bonus
@20 bit of the 0x3 byte
ldrb r1, [r6, #0x3]
mov r0, #0x20
and r0, r1
cmp r0, #0x0
beq noLukRally
add r5, #0x4
noLukRally:
@Rally Spectrum
mov r0, #0x80
and r0, r1
cmp r0, #0x0
beq noRallySpectrum
add r5, #0x2
noRallySpectrum:

@Return the acccumulator.
mov r0, r5

cmp r0, #0x0
bge end
mov r0, #0x0
end:
pop {r4-r6}
pop {r1}
gotoR1:
bx r1

.align
GetEquippedWeapon:
.long 0x8016B29
GetWeaponLukBonus:
.long 0x8016511
AdditionalDataTable:
@Handled by installer.
@.long 0x0203E894
Binary file added Engine Hacks/ASM/Debuffs/Luck Getter.dmp
Binary file not shown.
Loading

0 comments on commit bef841c

Please sign in to comment.