Homebrew [WIP] PHBank - Pokémon Homebrew Bank

Gocario

GBAFail'd
OP
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
Are you ripping the assets from Pokémon X/Y/OR/AS/Bank or including it with the homebrew?
Since I dunno how to rip from ROM during runtime, I include it. (But it's heavy...)

By the way gocario, would yo be interested in adding pokemon link support for poke milles / battle points? The amount received is based on pokemon stored and time since last boot.

I need to research little (with ramsav worked right away, but I think tjere's some checksum that needs update using savegames)? but it should be possible, even celebi or johto starters or any other event, as long as someone is kind enough to provide a savegame with that link data (currently we have them all)
I can store more values in bankdata. So everything is possible... ?
That would be cool anyway (if people use thoses points/miles, because I don't... xD).


Current progress:
I managed to use the sf2dlib to print the Boxes with Pokémon icons with savedata.
I can navigate through PC/Bank, but I have to check how to change boxes in-PC/Bank, since I can't anymore... :c But I think I know where the problem is.
EDIT:
Okay, I found it! Boxes are fully navigable! .o/

Next step: rearange display with pc/bank.​
 
Last edited by Gocario,

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
Since I dunno how to rip from ROM during runtime, I include it. (But it's heavy...)

Suggestion to make that heavy icon pack optional: include a default icon (some shadowed pokemon chosen at random) and display species number over it if icon pack can't be loaded for some reason.

I can store more values in bankdata. So everything is possible... ?
That would be cool anyway (if people use thoses points/miles, because I don't... xD).
I already stated my feels about bankdata (I'd prefer it being dividided in 100 boxes), that would require like an extra file, but well, do it as you please :P
Miles aren't all that useful (well, with homepass you can receive like 10.000 miles a day if you want, which you can convert to 40 rare candies, which is a pretty easy way to get pokemon to level 50/100.
BattlePoints are another story though, the bank is a realiably source of battlepoints and they are the only means to obtain certain evolutionary items (well, you can randomly receive them by spending miles at Pokémon Global Link, but it's a pain).

Providing the exclusive pokemon once per TID/SID would be cool too.

I'll check that latter, as I said I think directly using the savegame would require some checksum fix.
 

Gocario

GBAFail'd
OP
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
Suggestion to make that heavy icon pack optional: include a default icon (some shadowed pokemon chosen at random) and display species number over it if icon pack can't be loaded for some reason.
Infact, atm I load the spritesheet directly from C file. (exported with GIMP).

I already stated my feels about bankdata (I'd prefer it being dividided in 100 boxes), that would require like an extra file, but well, do it as you please :P
I'm still a bit reluctant about using 100 files. D:
In my bank file, data are stored like that: https://github.com/gocario/PHBank/wiki/File-Format#bank-bankdata. Pokémon data only starts @0x100
 

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
I'm still a bit reluctant about using 100 files. D:
In my bank file, data are stored like that: https://github.com/gocario/PHBank/wiki/File-Format#bank-bankdata. Pokémon data only starts @0x100
Well, your decision, I just thought it would speed up the write process. A tool to split bankdata into box.bin data (and vice versa) can always be made.
BTW, those unknown are more rather like unused right? :P

I don't know if that space is enough. It certainly could hold last time the bank was launched and if battlepoints/miles were given that date, but for the bank event pokemon it's another story, since the original bank only gave one celebi/johto starters per account, once and I feel that if this is implemented in PKBank, it should give them once for savegame (via checking TID/SID), and that would require a file to store those TID/SID that already received them.

Since you have some unused space at the end, how about adding a checksum for "bank" at some point? (Just dropping the suggestion, I can implement crc32 and make a pull request if you want).
 
D

Deleted User

Guest
  • Like
Reactions: Deleted User

Gocario

GBAFail'd
OP
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
How about just 1 big file that simply holds all the .pkx files seperately, so it could be opened easily for external modification/troubleshooting?
This is how it work right now.

Well, your decision, I just thought it would speed up the write process. A tool to split bankdata into box.bin data (and vice versa) can always be made.
BTW, those unknown are more rather like unused right? :P

I don't know if that space is enough. It certainly could hold last time the bank was launched and if battlepoints/miles were given that date, but for the bank event pokemon it's another story, since the original bank only gave one celebi/johto starters per account, once and I feel that if this is implemented in PKBank, it should give them once for savegame (via checking TID/SID), and that would require a file to store those TID/SID that already received them.

Since you have some unused space at the end, how about adding a checksum for "bank" at some point? (Just dropping the suggestion, I can implement crc32 and make a pull request if you want).
Yes, Unknown are unused.
Btw I love the idea of Celebi distribution. But I don't want a TID/SID file storage... That would be gross...
Checksum? For bank? What is the utility?
 
Last edited by Gocario,
  • Like
Reactions: Deleted User

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
Just tested pokemon link injection, for johto starters and celebi I would just include the bin files the bank makes in PKBank, they have a CRC-16/CCITT checksum at the end.

Also, changing pokemon link data needs to update checksum #30 (this was checked with pkhex and with hex editor)

Pokemon link data goes as follows:

XY: 0x1FFFF
ORAS: 0x20FFF

1 byte: 0x80 means pokemon link is enabled
2628 bytes linkdata
2 bytes CRC-16/CCITT

known linkdata structure:
0x00: title of the app that set the pokemon link data (we can actually set this to PKBank!). I'll check the actual lenght
0x4A0 u16 battlepoints
0x4A2 u16 pokemiles

UPDATE: confirmed u16 values for battlepoints/pokemiles, but while 65535 pokemiles can be retrieved, battle points are capped at 9999 even if it is set to 0xFFFF.
App name is 54 characters long (108bytes, 2 byte encoding), or at least that is the maximum displayed in XY.
Pokemon, battle points and pokemiles can be all given with 1 pokemon link, even though I think for now nintendo has never mixed battlepoints/pokemiles/pokemon with each other. This can probably be used to give items too.


I can't be sure that battle points and pokemiles are u16, but I'll run a couple tests later. We could probably sort out how the pokemon are stored there with data from glalie/steelix (ORAS demo), celebi and johto starters and be able to produce any gift pokemon this way, as it probably works in the same way as wondercards for how the pokemon data is stored there, but lacks any real benefit since none of it would be legit.

BTW, if we want to keep the PKBank legit, celebi injection should be restricted to XY, or at least warn the users.
EDIT: for those worried about the date the pokemon was obtained being after the bank celebi ended, notice that recceived date has nothing to do with legitimacy of the pokemon, since there are two ways a totally legit bank celebi could have today's date:

1.- Had used pokemon bank when event was going on, but never entered pokemon link until today.
2.- Enter pokemon link with a wrong date set in 3ds settings.

I have to test injection on a savegame that doesn't have pokemon link enabled (I'll do later), but I'm pretty sure it only needs that one byte set to 0x80

Checksum? For bank? What is the utility?
Some kind of safety measure for sd corruption? I don't trust sd cards as much as nand, in fact my SD card got corrupted and almost lost all its contents, including ironfall (which at the time would have kind of sucked since the other entrypoint was tubehax).
 
Last edited by suloku,

Clydefrosch

Well-Known Member
Member
Joined
Jan 2, 2009
Messages
6,020
Trophies
2
XP
4,613
Country
Germany
well, this is a pretty nice development. since i didn't play the games too much these recent gens, it never felt like paying for the bank was worth buying a 15/25€ card for. and considering it still didn't allow items to be transfered.
but this one works with held items too, yes?

does the original pokebank add any data/edits any values when it transfers pokemon between games? like met location? and does this do that too?
 

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
well, this is a pretty nice development. since i didn't play the games too much these recent gens, it never felt like paying for the bank was worth buying a 15/25€ card for. and considering it still didn't allow items to be transfered.
but this one works with held items too, yes?

does the original pokebank add any data/edits any values when it transfers pokemon between games? like met location? and does this do that too?

The normal pokemon bank works with 6th gen pokemon, so there's no reason to change met locations. The only time met location is altered is when transfering between gens I think, you can do that with pkhex which supposedly handles it 100% as nintendo.

Also, little POC of all the pokemon link thing

 
Last edited by suloku,

VaiCorinthians

Well-Known Member
Member
Joined
Oct 7, 2014
Messages
461
Trophies
0
Age
39
Location
GB
XP
470
Country
Papua New Guinea
well, this is a pretty nice development. since i didn't play the games too much these recent gens, it never felt like paying for the bank was worth buying a 15/25€ card for. and considering it still didn't allow items to be transfered.
but this one works with held items too, yes?

does the original pokebank add any data/edits any values when it transfers pokemon between games? like met location? and does this do that too?
I believe that the purpose of PKBank is only store your Pokemon.
For those who do not want to pay for Pokemon Bank. And PKBank is free.
(and yes, it stores with items too)

for editing (in homebrew mode), I recommend the PCHex:
https://gbatemp.net/threads/pchex-homebrew-pkhex.397565
 
Last edited by VaiCorinthians,
  • Like
Reactions: Deleted User

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country
I believe that the purpose of PKBank is only store your Pokemon.

It is also the only legit way (well, pchex converted pokemon are legit too, legit in the nintendo way of doing it sense) to transfer gen V pokemon to gen VI, and that includes the transfer chain gen III->IV->V->VI, which is a pain for mass transfers, but not for homebrew (with a NDSLite + flashcard and a computer).
 
Last edited by suloku,

suloku

Well-Known Member
Member
Joined
Apr 28, 2008
Messages
883
Trophies
0
XP
866
Country

Nice played! Testing right away!

Why is it now called PHBank?

EDIT: pokemon homebrew bank, ok :P. This is amazing stuff.

About pkmiles and battlepoints:
Rewards
The player receives 100 Poké Miles when Pokémon are deposited for the first time into Pokémon Bank. Additional Poké Miles are awarded for the length of time that a given Pokémon is deposited into Pokémon Bank. The amount of Poké Miles earned by the player increases if more Pokémon are deposited into Pokémon Bank.

Accumulated Poké Miles may be transferred to the currently selected game via Pokémon Link either directly as Poké Miles or as Battle Points (at a rate of 1 Battle Point for every 10 Poké Miles). If the player chooses not to transfer their Poké Miles, they will simply continue to accumulate.

Keeping track of how long each pokemon has been stored seems excessive to me, something more simple like 1 pokemile for every 10 pokemon stored per day seams reasonable: if bank is full, 300 pokemiles a day, or 30 battlepoints a day.
With around 1000 pokemon that would make 100PM / 10 battlepoints a day, which I think it's similar to what the bank rewards.
 
Last edited by suloku,

Ekaitz

Redhead Believer
Member
Joined
Jun 13, 2010
Messages
608
Trophies
0
XP
441
Country
France
Small question guys, I didn't have the occasion to try this homebrew.
I didn't transfer my Pokemon from XY to ORAS with PkHex at the time because I want them to be exactly as they would have been transfer from the Bank or from trade...

Does the homebrew do that kind of stuff? (aka keep the Pokemon as legit as it is supposed to be, modifying the data that should be modified to act as it was the official Bank that was used to transfer the Pokemon)

I'll try the homebrew this week-end, it's time to complete my OR dex.
 

Gocario

GBAFail'd
OP
Member
Joined
Sep 5, 2015
Messages
640
Trophies
0
Location
Bourg Palette
XP
804
Country
France
Nice played! Testing right away!
Why is it now called PHBank?
EDIT: pokemon homebrew bank, ok :P. This is amazing stuff.

About pkmiles and battlepoints:
Keeping track of how long each pokemon has been stored seems excessive to me, something more simple like 1 pokemile for every 10 pokemon stored per day seams reasonable: if bank is full, 300 pokemiles a day, or 30 battlepoints a day.
With around 1000 pokemon that would make 100PM / 10 battlepoints a day, which I think it's similar to what the bank rewards.
Yes, I had Pokémon Homebrew Bank since the start. (and I'm quite sure there is a grammar error B-))
That should be pretty easy .o/

Small question guys, I didn't have the occasion to try this homebrew.
I didn't transfer my Pokemon from XY to ORAS with PkHex at the time because I want them to be exactly as they would have been transfer from the Bank or from trade...

Does the homebrew do that kind of stuff? (aka keep the Pokemon as legit as it is supposed to be, modifying the data that should be modified to act as it was the official Bank that was used to transfer the Pokemon)

I'll try the homebrew this week-end, it's time to complete my OR dex.
The program do (should*) not change anything when transfering a Pokémon.
It only decrypts it if he is loaded from the save (game). And encrypts it if he is saving to the save (game).
The Pokémon aren't encrypted in the Bank.

DISCLAIMER: There is no filter at the moment. So transfering to X/Y may be risky if new items/moves/abilities are imported!! There could be other problems beyond my control!!
 

Ekaitz

Redhead Believer
Member
Joined
Jun 13, 2010
Messages
608
Trophies
0
XP
441
Country
France
So, basically the official Bank don't modify anything? (Not even things like "Traded from" or whatever is it called right now in the menu?)
I thought that it was the case.

I'll try it asap.

About the transferring to XY, there are 4 moves (I think that there are only 4 new moves), the new megatons btw and I think that's it.
People just have to be aware of what they do, if you have a doubt about an item, just don't try to transfer it, that would be safer!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    @Maximumbeans, I'm doing alright, thanks.
    +1
  • Maximumbeans @ Maximumbeans:
    That must be rough. Productive I'm sure but hard to balance with daily life
    +1
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Indeed. I've been working on getting this Infecutus chip to work on my PS2. But after soldering, I realised that a plastic piece was missing from the power ribbon cable to the power and eject buttons.
  • SylverReZ @ SylverReZ:
    Now I could go with soldering the contacts from the cable to the connector on the mobo, but doesn't sound like a good permanent solution.
  • Maximumbeans @ Maximumbeans:
    Man, that's beyond my brain :rofl: I'm no good with hardware for now. I'd like to get into hardmods in future though
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Maybe start practice soldering. Get a cheap-ass soldering iron and follow some good YouTube tutorials.
    +1
  • SylverReZ @ SylverReZ:
    Least my experience has gotten better than over a decade ago. My iron would constantly bump into components and break them.
  • Maximumbeans @ Maximumbeans:
    Sounds good. I actually did soldering but like 16 years ago for school so uuuuh probably rusty haha
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Same here. I did soldering at school from a teacher who I honestly liked since he had plenty of good electronics experience.
    +1
  • Maximumbeans @ Maximumbeans:
    I wish I could play chess well
    +1
  • Maximumbeans @ Maximumbeans:
    Useless but a true art
    +1
  • SylverReZ @ SylverReZ:
    @Maximumbeans, I had a friend who had a glass chess set for their birthday.
  • SylverReZ @ SylverReZ:
    It was like all clear and fancy. Tbf I'm not too experienced with chess, but would like to learn someday.
  • Maximumbeans @ Maximumbeans:
    That sounds really cool
  • Maximumbeans @ Maximumbeans:
    I know the basics but no strategy at all :rofl:
    +1
  • Veho @ Veho:
    Watch chess streamers on Twitch and you'll pick up a thing or two.
    +1
  • Veho @ Veho:
    Not to mention there's an infinite number of chess games for every possible platform.
    +1
  • DinohScene @ DinohScene:
    just play it, get beaten a few times and start dominating
    +1
  • K3Nv2 @ K3Nv2:
    Nude chess is best
    +1
  • DinohScene @ DinohScene:
    strip checkers > nude chess
    +1
  • K3Nv2 @ K3Nv2:
    Nude checkers get jumped
    +1
  • SylverReZ @ SylverReZ:
    @Veho, I guess you'd pick up something while watching tub streams.
  • SylverReZ @ SylverReZ:
    @K3Nv2, Dick fights. :tpi:
  • Veho @ Veho:
    Turkish olive oil wrestling.
    Veho @ Veho: Turkish olive oil wrestling.