-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 51e4371
Showing
7 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bsp/bspcomp | ||
*.bsp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "bsp"] | ||
path = bsp | ||
url = https://github.com/aaaaaa123456789/bsp | ||
ignore = dirty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
conquestsavefiletools.bsp: bsp/bspcomp *.bsps | ||
./bsp/bspcomp main.bsps conquestsavefiletools.bsp | ||
|
||
bsp/bspcomp: bsp/bspcomp.c | ||
gcc -o bsp/bspcomp bsp/bspcomp.c | ||
|
||
clean: | ||
rm *.bsp | ||
rm bsp/bspcomp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Conquest Save File Patcher | ||
|
||
BSP scrips that work on Pokemon Conquest save data | ||
|
||
## Download the patch script | ||
|
||
(todo: add releases page) | ||
|
||
## Building the project yourself | ||
|
||
On Linux, Mac, or WSL: | ||
|
||
git clone --recurse-submodules https://github.com/MathyFurret/conquestsavefiletools | ||
cd conquestsavefiletools | ||
make | ||
|
||
This builds conquestsavefiletools.bsp. GCC is used to build the BSP compiler; to use a different C compiler, simply run a command that builds `bsp/bspcomp` yourself. | ||
|
||
## Patching your save | ||
|
||
Go to https://aaaaaa123456789.github.io/bsp/. Drop the .bsp under "Patch file" and your save file under "Input file", then click "Begin patching" and select the patch you want. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
main: | ||
print .message1 | ||
print .message2 | ||
print .message3 | ||
menu #0, .options | ||
jumptable #0 | ||
dw Max_IVs | ||
|
||
.message1 | ||
string "Mathy's Conquest Save File Tools v0.0" | ||
.message2 | ||
string "Use only for a Pokemon Conquest (USA) save file." | ||
.message3 | ||
string "What would you like to do?" | ||
.options | ||
dw .option1 | ||
dw -1 | ||
.option1 | ||
string "Max out all IVs (only option currently)" | ||
|
||
include "maxivs.bsps" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
define GALLERY_BLOCK_OFFSET, 0x78b6 | ||
define HEADER_LENGTH, 0x18 | ||
define WARRIOR_LIST_LENGTH, 0xe10 | ||
define TOTAL_LENGTH, 0x3c84 | ||
|
||
define FORRETRESS, 56 | ||
define NUM_POKEMON, 1000 | ||
|
||
define i, 0 | ||
define species, 1 | ||
define checksum, 2 | ||
|
||
Max_IVs: | ||
add #0, GALLERY_BLOCK_OFFSET, HEADER_LENGTH | ||
add #0, WARRIOR_LIST_LENGTH | ||
seek #0 | ||
xor #i, #i | ||
.loop | ||
readword #species | ||
and #species, 0xff | ||
|
||
lockpos | ||
readword #2 | ||
or #2, 0x3fff8000 | ||
unlockpos | ||
writeword #2 | ||
|
||
lockpos | ||
readword #2 | ||
unlockpos | ||
ifne #species, FORRETRESS, .not_forretress | ||
|
||
xor #3, 0x1f, 0xffffffff | ||
and #2, #3 | ||
jump .endif | ||
.not_forretress | ||
or #2, 0x1f | ||
.endif | ||
writeword #2 | ||
|
||
increment #i | ||
iflt #i, NUM_POKEMON, .loop | ||
|
||
; calculate checksum | ||
add #0, GALLERY_BLOCK_OFFSET, HEADER_LENGTH | ||
seek #0 | ||
xor #i, #i | ||
xor #checksum, #checksum | ||
.checksum_loop | ||
readbyte #3 | ||
add #checksum, #3 | ||
increment #i | ||
iflt #i, TOTAL_LENGTH, .checksum_loop | ||
|
||
seek GALLERY_BLOCK_OFFSET | ||
writeword #checksum | ||
|
||
return |