Homebrew [WIP] PHBank - Pokémon Homebrew Bank

wolf Strider

Member
Newcomer
Joined
Oct 13, 2015
Messages
6
Trophies
0
XP
81
Country
Ecuador
Pokémon Homebrew Bank


Have you made a video? Please share it in the thread, I will take care of a small list.

Here is my first homebrew.
It is used to manage Pokémon storage with a Bank, like the Pokébank, but as free service (and a local storage solution).
This homebrew is not intended to cheat (not even cloning). It's just a storage solution!!

The source code is available on github!

What this Homebrew can do:
  • Navigate through PC boxes from ORAS save.
  • Navigate through Bank boxes.
  • Select one Pokémon and move it to another box slot.
  • Swap a box content to another (pc <-> bank)
  • Export/Import savedata to/from game (/main).
  • Load/Save bankdata to/from bank (/pkbank/bank).
  • Autocomplete Pokédex when transfering Pokémon (Only OR/AS).
  • Prompt a dialog to save/exit/backup during execution.
  • Work on o3DS AND n3DS!

How to install:
  • Just extract the archive at (to?) the root of you SD Card.
  • It must contain /pkbank/data/en/[DataFiles] and /3ds/PHBank/[PHBankFiles].

Controls:

Everywhere:
  • DPad/CPad: Move the cursor inbox.
  • L/R: Change box.
  • LZ/RZ: Switch from PC to Bank and vice versa.
  • Touchscreen: some funny stuff.
    • Move inbox.
    • Switch boxes.
    • Switch PC/Bank.
    • Drag & Drop Pokémon.
    • Change selection mode.
  • Start: Open the savexit menu.
  • Select: Switching selection mode. (Single -> Quick -> Multiple Select)
  • L+R+A+B+X+Y: Emergency exit... That's fun!
In Single Selection mode (Red):
  • A: Select Pokémon / Move Pokémon if one already selected.
  • B: Cancel selection.
In Quick Selection mode (Blue):
  • A: Select Pokémon / Move Pokémon if one already selected.
  • B: Cancel selection.
  • Y: Swap the current PC box content with the current Bank box content.
In Multiple Selection mode (Green):
  • Y: Active the box selector.
+ You can use the touchscreen, it should be corrected.


Todo list:
  • Complete the auto-completion Pokédex feature ( :o ).
  • Add a multiple selection. (lazyness...)
  • Display more specific information per Pokémon. (Tabs for contest/met/etc)
  • Enhance more the GUI.

Nota Bene:
  • I only tested this homebrew with Pokémon Alpha Sapphire on a cartridge and a N3DS.
  • I'm not an english speaker, correct me please!
  • This homebrew is not intended to cheat. It's just a storage solution.



Pre-GUI:



Post-GUI:



Thanks to @suloku for all of your work on the project.
Thanks to @Kaphotics & @Asia81 (and PKHex's contributors) for the save functions (offsets, and algorithms) and data.
Thanks to @Stracker (and PCHex's contributors) for some of his functions, and the pattern design. Merci ! :)
Thanks to @xerpi (and SF2D's contributors) for the Graphic library.

Disclaimer: I'm not responsible for you losing or corrupting your save by using this homebrew. It mays contain bugs within the normal intended use. Use it at your own risk.
ALWAYS MAKE A BACKUP! (Hold L while launching homebrew or/and use svdt)



Alpha v0.1:
- Inital αlpha-release.​
Alpha v0.3:
- Box transfer.
- Pokédex auto-completion (ORAS).
- Reorder input by Selection mode.
- Icon changed.​
Alpha v0.3a:
- Fix with Pokédex A-C.​
Alpha v0.3b:
- Fix a problem with the names (FS_Streams).​
Alpha v0.3c:
- Maybe a fix for digital games load file.​
Beta v1.0:
- Don't wanna list...​
Beta v1.0.1:
- Added a GUI, is that enough?​
Beta v1.0.2:
- Fixed the previous buggy touchscreen.
- Double tap to select (double mean, tap again while in the slot).​
Beta v1.0.3:
- Fixed some issues with save from SD.
- Added a start-key menu.​
Beta v1.0.4:
- Implemented Drag&Drop.​
Beta v1.0.5 (removed):
- Integrated Filters use & fix.
- More displayed informations.​
Beta v1.0.5-a:
- Fix the move filter.​
Beta v1.0.6:
- Very basic box selector.​
Beta v1.0.6-a:
- Improved the basic box selector DPad controls.​
Beta v1.0.6-b:
- Completed the navigation in box​
 

Xenosaiga

Time to switch it up
Member
Joined
Oct 9, 2015
Messages
1,501
Trophies
0
Age
33
Location
The Shadows
XP
1,070
Country
United States
Didn't I told you that the main purpose of this homebrew is to steal Pokémon for the glory of the Team Rocket?!
Infact, the OT name is coded in 16bytes ("normal characters" are coded in 8bytes). That's why I used a placeholder (it was in a test variable too :D).

I see what you did there. Now Team Rocket is the OT

Very very sneaky Gocario. Lol
 

plasma

GBAtemp's Artificial Lifeform
Member
Joined
May 15, 2009
Messages
1,670
Trophies
1
Location
Inazuma TM Caravan
XP
2,675
Country
United Kingdom
It's possible, but I don't want to search a font...
If you find one, which is free and open (no rights on). I can integrate it!
Im not sure what I would be looking for to a close font that looks like the Pokemon one, but Google's Roboto font is able to be used and I am sure that would look decent.
 

greatwizard

Active Member
Newcomer
Joined
Sep 1, 2006
Messages
39
Trophies
0
Location
France
XP
377
Country
France
Last edited by greatwizard,
  • Like
Reactions: Coleman_C18

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
@Gocario am I reading this wrong or are you adding dex item when moving a pokemon from ORAS save to bank?
EDIT: OK, that's ok for swapping pokemon, but won't this try to add empty slots too?
Code:
        // Pokédex completion
        if (srcBanked && !dstBanked)
            addDex(src);
        if (!srcBanked && dstBanked) //<----
            addDex(dst);

Shouldn't it be this?

Code:
        // Pokédex completion
        if (srcBanked && !dstBanked)
            if(!isPkmEmpty(src)) addDex(src);
        if (!srcBanked && dstBanked)
            if(!isPkmEmpty(dst)) addDex(dst);
Maybe it's better to add the check to addDex() method itself.

Edit: actually, wouldn't it be better to update dex when savibg savefile, just like the update to notOT handler? It's what pokemon bank does and will only update for those pokemon that are in the savegame at the end of thr bank session

Also, what is weird about xy dex outside the foreing pokemon flags?
 
Last edited by suloku,

jd_lee

Member
Newcomer
Joined
Sep 19, 2015
Messages
18
Trophies
0
Age
29
XP
44
Country
Indonesia
any risk on using this? will it harm my pokemon save files? is it available for X & Y save files?
sorry if i'm asking too much, i just need this n i would never pay for a pokebank account.
 

Xenosaiga

Time to switch it up
Member
Joined
Oct 9, 2015
Messages
1,501
Trophies
0
Age
33
Location
The Shadows
XP
1,070
Country
United States
any risk on using this? will it harm my pokemon save files? is it available for X & Y save files?
sorry if i'm asking too much, i just need this n i would never pay for a pokebank account.
There's always an inherent risk when messing with save files.

But so far I have had no issues with this but I have not tested this extensively.

But if you do use this it is always recommended to backup your data. That way if something does mess up you can recover your save.
 

Gocario

GBAFail'd
OP
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
Im not sure what I would be looking for to a close font that looks like the Pokemon one, but Google's Roboto font is able to be used and I am sure that would look decent.
I've updated the font to Roboto.
@Gocario am I reading this wrong or are you adding dex item when moving a pokemon from ORAS save to bank?
EDIT: OK, that's ok for swapping pokemon, but won't this try to add empty slots too?
Code:
        // Pokédex completion
        if (srcBanked && !dstBanked)
            addDex(src);
        if (!srcBanked && dstBanked) //<----
            addDex(dst);

Shouldn't it be this?

Code:
        // Pokédex completion
        if (srcBanked && !dstBanked)
            if(!isPkmEmpty(src)) addDex(src);
        if (!srcBanked && dstBanked)
            if(!isPkmEmpty(dst)) addDex(dst);
Maybe it's better to add the check to addDex() method itself.

Edit: actually, wouldn't it be better to update dex when savibg savefile, just like the update to notOT handler? It's what pokemon bank does and will only update for those pokemon that are in the savegame at the end of thr bank session

Also, what is weird about xy dex outside the foreing pokemon flags?
I already did it yesterday but I only commited now. -> https://github.com/gocario/PHBank/blob/master/source/pkbank.cpp#L1108-L1124
I am currently working on the Pokédex feature, to be used with XY and ORAS.
Please please please do not use comic sans if you were actually going to conssider that;-;
I can understand why people hates Comis Sans... I like it! (Easter egg: On Skype, when using the Comis Sans MS font, the emoticon is sad)
any risk on using this? will it harm my pokemon save files? is it available for X & Y save files?
sorry if i'm asking too much, i just need this n i would never pay for a pokebank account.
There is always a risk. Just make a backup, by using SVDT or by holding L button while starting the PHBank. The backup will be stored in "/pkbank/backup/ as main_ALOTOFNUMBER"
If anything went wrong restore the save using SVDT.
 

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
So in the end only difference were the foreign flags? Glad to see it already implemented, at this speed the project will be finished before we know it :P
And then I'll make endless tests to ensure everything works like the actual official bank... (not really looking forward to that part).
 

BurningDesire

Well-Known Member
Member
Joined
Jan 27, 2015
Messages
4,999
Trophies
1
Location
Behind a screen reading news
XP
4,885
Country
United States
So in the end only difference were the foreign flags? Glad to see it already implemented, at this speed the project will be finished before we know it :P
And then I'll make endless tests to ensure everything works like the actual official bank... (not really looking forward to that part).
Can you try to work on making it so the OT is are trainers name?
 

SleepyEagle

New Member
Newbie
Joined
Oct 13, 2015
Messages
3
Trophies
0
Age
36
XP
75
Country
United States
Just stumbled onto this project and...wow. I love it. I also appreciate the decision to try and make as "legal" as possible. Great work.
 

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
Can you try to work on making it so the OT is are trainers name?
You mean in the status screen?
That is something quite complicated due to the enconding used in the names. English names would be easy though, I don't know what does gocario have in mind.

Speaking of which, @Gocario, mashers developed a font engine for his HBL mod and it supports 2 byte encoding and uses roboto font, you should contact him for that matter.

Meanwhile, HBL has a nice function to at least get latin names displayed in some way (extended ascii I guess):

Code:
#pragma once

static inline void unicodeToChar(char* dst, u16* src, int max)
{
    if(!src || !dst)return;
    int n=0;
    while(*src && n<max-1){*(dst++)=(*(src++))&0xFF;n++;}
    *dst=0x00;
}
 
  • Like
Reactions: BurningDesire

Xenosaiga

Time to switch it up
Member
Joined
Oct 9, 2015
Messages
1,501
Trophies
0
Age
33
Location
The Shadows
XP
1,070
Country
United States
@Gocario
I'm not sure if this was done on purpose but the icon has noticeable black spots on the corners. There appear to be 2 on each corner

If this is on purpose then ignore this post. If not is there a way to fix it?
 

Gocario

GBAFail'd
OP
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
Can you try to work on making it so the OT is are trainers name?
The problem is how to render 16bit (2bytes) characters... I am trying with the wchar_t, but I am still not succeeding! (It's the same for nicknames)
Speaking of which, @Gocario, mashers developed a font engine for his HBL mod and it supports 2 byte encoding and uses roboto font, you should contact him for that matter.
Meanwhile, HBL has a nice function to at least get latin names displayed in some way (extended ascii I guess):
Code:
#pragma once

static inline void unicodeToChar(char* dst, u16* src, int max)
{
    if(!src || !dst)return;
    int n=0;
    while(*src && n<max-1){*(dst++)=(*(src++))&0xFF;n++;}
    *dst=0x00;
}
I will contact mashers if I can do it this evening.
Isn't that piece of code converting all 2 bytes character to 1 byte character, rounding to 0xFF if the value is greater than 0xFF?
@Gocario
I'm not sure if this was done on purpose but the icon has noticeable black spots on the corners. There appear to be 2 on each corner

If this is on purpose then ignore this post. If not is there a way to fix it?
Ye, I know, I didn't even fixed the buggy 'é'. Don't worry!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    They make good burning plastic
  • BigOnYa @ BigOnYa:
    Makes me wonder if the Pi5 can play PS2? If there's even a core for it yet.
  • K3Nv2 @ K3Nv2:
    Pi5 should be able to do ps2
  • Psionic Roshambo @ Psionic Roshambo:
    Try Dragon Quest VIII it ran perfectly on a core 2 Duo I had
  • Psionic Roshambo @ Psionic Roshambo:
    Easiest game to run I found
  • K3Nv2 @ K3Nv2:
    Ps2 emulation is cake compared to 3 years ago
  • Psionic Roshambo @ Psionic Roshambo:
    Hardest is probably Gran Turismo 4
  • Psionic Roshambo @ Psionic Roshambo:
    It's much better now yes but Gran Turismo 4 is still the hardest one to emulate that I have in my collection
  • Psionic Roshambo @ Psionic Roshambo:
    Runs perfectly fine but it's as if I can feel it always on the boarder line of dropping a frame lol
  • BigOnYa @ BigOnYa:
    I ordered a spin ball couple days ago to add to my arcade cabinet, will be nice for games like golden tee, or bowling
  • Psionic Roshambo @ Psionic Roshambo:
    I always wanted a controller for like Ikari Warriors, Time Soldiers, Heavy Barrel, Forgotten Worlds games like those
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Not even sure what to call that controller
  • Xdqwerty @ Xdqwerty:
    an online friend I've known since 2021 left me :( bc my attitude is "cutty"
  • Psionic Roshambo @ Psionic Roshambo:
    Sylvester Stallone should have played Kyle Reese lol Arnold still as the Terminator
  • BakerMan @ BakerMan:
    TF DOES "CUTTY" EVEN MEAN?
  • Xdqwerty @ Xdqwerty:
    @BakerMan, he is peruvian so it's probably an idiom
  • BigOnYa @ BigOnYa:
    I thought Cutty was a west coast rapper
  • K3Nv2 @ K3Nv2:
    Cutter
  • Psionic Roshambo @ Psionic Roshambo:
    Dr Cutty
  • Psionic Roshambo @ Psionic Roshambo:
    It's from House MD lol
  • K3Nv2 @ K3Nv2:
    I took too much viagra Dr cutty oh wait
    +2
  • Ligudink @ Ligudink:
    What in the goddamn
  • Xdqwerty @ Xdqwerty:
    @Ligudink, welcome to the gbatemp chat
    +2
  • Ligudink @ Ligudink:
    I've sen enough HAHAHA
    +2
    Ligudink @ Ligudink: I've sen enough HAHAHA +2