Commit Graph

16 Commits

Author SHA1 Message Date
Philippe Symons
d106863b50
V0.3 (#16)
* Feature/add support for other game languages (#13)

* Add support for other game localizations/languages

* Increase PokeMe64 version to v0.3

* Update README.md

* Slightly improve the text in docs/Why_I_Had_To_Give_Up_On_Batteryless_Repros.md

* Update libpokemegb submodule to commit 3d86aa8

* Add Japanese characters to the fonts

* Make validating Japanese save files work correctly

Turns out these Japanese cartridges are using an MBC1 controller. There's a notable difference between it and
MBC3: by default it is doing banking mode 0. But in this mode, you can't switch SRAM banks!

So in order to make japanese cartridges work, we must switch to mode 1.

* Update Arial font: add Japanese glyphs from Osaka Regular-Mono.ttf

In order to render japanese characters, we need to have a font which has japanese characters and make sure they
are added to the .font64 file with mkfont during compilation.

I wrote a small program before to figure out which Japanese characters are actually used in the Japanese gameboy
cartridges.

I only added those unicode ranges to the fonts to keep them small.

There was no easy way to have a font that has both latin and Japanese characters, especially not free. So I
used FontForge to merge the japanese glyphs from Osaka Regular-Mono into Arial.ttf

* Update libpokemegb to commit 0ef7a3a

* Update libpokemegb submodule

* Update libpokemegb submodule to commit d6f3423

* Various changes

- Upgrade libpokemegb to commit c47f8b3

- [Korean gen II games]: Make the UI show Trainer and Pokémon instead of the actual trainer name and pokémon name.
  This is needed because our font does not include the necessary characters for the Korean games. And while I could attempt to add them, I don't sufficiently care to do so.

- Attempt to randomize random values. This is needed for random IVs and shininess chances.
  It's not entirely clear to me whether the rand() function would actually return random values in previous versions of PokeMe64.
  While libdragon does gather entropy at bootup and implements a getentropy() function, I don't see this function referenced anywhere.
  That being said, it DOES look like libstdc++ would call a getentropy() function, so perhaps this is a way in which getentropy() from libdragon would get called.
  But I'm not using libstdc++'s functionality to obtain random values, I'm using libc's rand() function. And I don't see any reference from libc (for rand()) to getentropy(), so...
  At the very least we might need to use values from getentropy() to seed with srand(). But because I have trust issues with randomizing pseudo-random values in a system
  that doesn't have a system clock, I also added trainerID, trainerName and the number of elapsed cpu cycles until we are going to the main menu to the seed. I might consider
  adding the RTC values for gen II games to the seed as well later.

* Update README.md

* More README.md

* Update libpokemegb to commit 17232c4

* Feature/automatically reset rtc in backed up save file for gen2 (#14)

* Add support for other game localizations/languages

* Increase PokeMe64 version to v0.3

* Update README.md

* Slightly improve the text in docs/Why_I_Had_To_Give_Up_On_Batteryless_Repros.md

* Update libpokemegb submodule to commit 3d86aa8

* Set the flag to reconfigure RTC in the backed up save file when backing up the save of a cartridge.

* Update libpokemegb submodule to commit 5037690

* Update libpokemegb submodule to commit 8ff128c

* Add support for Pokémon Green (JPN)

* Update libpokemegb submodule to commit 1897845

* Update README.md -> japanese pokemon fallback OT name change -> PokeMe64 -> PM64

* Add gen I move delete feature. (Idea by /u/ImranFZakhaev on Reddit)

* Add check to make sure the player is in a pokémon center before allowing him/her to delete a pokémon move.

The reason behind this check is to avoid getting the player stuck on a map after deleting an HM.

* Forgot to add the actual check in the last commit

* Feature/implement gen1 move deleter (#15)

* Add gen I move delete feature. (Idea by /u/ImranFZakhaev on Reddit)

* Add check to make sure the player is in a pokémon center before allowing him/her to delete a pokémon move.

The reason behind this check is to avoid getting the player stuck on a map after deleting an HM.

* Update screenshots

* Update CREDITS and add some people as Testing/Validation credits in the AboutScene

These people have been a great help in getting PokeMe64 to work correctly.

Thank you, everyone!

* Fix whitespace issues

* Update libpokemegb to commit aedb588
2025-02-17 20:34:12 +01:00
Philippe Symons
d3b11b90d5
Feature/add icons to selectfilescene (#9)
* Create PokemonPartyIconWidget for displaying the party menu icon in the distribution event pokemon menu (untested)

* Integrate PokemonPartyIconWidget into the DistributionPokemonListScene

* Do some visual changes to the DistributionPokemonListScene

* Revert "Undo README.md changes because they were already shown in github after merging the feature branch"

This reverts commit dc8d9bb00d.

* Update docs

* Add file and folder icon to SelectFileScene
2024-09-30 23:31:24 +02:00
Philippe Symons
5f353d6a1c
Feature/show party icons on distribution pokemon selection screen (#8)
* Create PokemonPartyIconWidget for displaying the party menu icon in the distribution event pokemon menu (untested)

* Integrate PokemonPartyIconWidget into the DistributionPokemonListScene

* Do some visual changes to the DistributionPokemonListScene

* Revert "Undo README.md changes because they were already shown in github after merging the feature branch"

This reverts commit dc8d9bb00d.

* Update docs
2024-09-30 23:29:09 +02:00
Philippe Symons
711107d453
Feature/backup cartridge save to flashcart sd (#7)
Merged feature/backup cartridge save to flashcart sd

Summary: 

* Add menu options to backup/restore a save from a pokémon gen I/II cartridge to the N64 flashcarts' SD card.
This is only compatible with 64Drive, Everdrive64, ED64Plus and SummerCart64!

* Add menu option to wipe a save from a cartridge

* Add menu option to reset the in-game clock of gen II cartridges. This will let the game prompt to update the clock on the next time you try to load the save file. Before it was quite hard to reset the game clock without starting a new save. Especially for crystal you had to calculate some kind of password to make it work. Not anymore. PokeMe64 now makes this easy!

Commits:

* Write a hello world of sorts for writing to SD card.

This just writes a file sd://helloworld.txt to the sd card.

It will form the basis for implementing save backup

* Implement save file backup functionality.

It works! But it needs some UI work (progress bar or something), because it takes > 5 seconds

* Add ProgressBarWidget and SceneWithProgressBar

* Add DataCopyScene and implement backup/restore with progress indication properly

Added a new DataCopyScene which takes care of displaying a progress bar while we're backup'ing or restoring data.

I also implemented cartridge Rom and Save backup to (micro)SD card  and Save restore from (micro)SD card
to the cartridge.

And it works! I verified it with my Pokémon Blue cartridge: I can back up its save, play the game,
release almost all pokémon, go to a different location and save again and then restore the previous save using PokeMe64

Rom backup also works: I can play the resulting rom in VisualBoyAdvance without any issue. I can also use the save
that I backed up in VisualBoyAdvance.

So right now, you can take an emulator save/pkhex save and transfer it to an actual (original) pokémon cartridge
and it will work!

However, it's not ready for release yet for a few reasons:

- It will currently always output to sd:/gb_out.sav and sd:/rom.gb. I want it to output to
sd:/<cartridgetitle>_<trainername>.sav and sd:/<cartridgetitle_<trainername>.gb instead. In fact I want PokeMe64 to
add numbers to the save file in case one already exists with that name.

- libdragon currently doesn't have the functionality to create directories. I wish PokeMe64 to backup to a directory
called PokeMe64, even if the directory doesn't exist yet.

- I want a file selector so you can select which save file to restore. This way you could have multiple saves. In
theory that would also allow you to transfer a pokémon red save to a pokémon blue cartridge and so on.

- I want to have a wipe save option

- I need to safeguard PokeMe64 for corrupted save data. Right now, for reproduction carts PokeMe64 crashes while trying
to decode the trainerName. This is because the actual save file is not accessible on a reproduction cart. If I'm going
to allow people to restore random saves (even from different versions alltogether), I need PokeMe64 to be robust enough
for people to be able to wipe the save file or restore a different one. (in order for them to be able to correct their
mistake without having to take out the battery). In order to be robust enough, I should make sure to check the CRC
checksum of the save file before going to the main menu. And if it doesn't match, I should offer a reduced menu to
the user.

So... no release of this feature until I resolve all the topics above.

But man, it's so satisfying to see it work in the current form already! The functionality itself just works on first try!

* Add FileBrowserWidget and rework TestScene to use it for testing purposes

* Add SelectFileScene and connect everything together.

* Generate unique save file names

<gameName>_<trainerName>_<uniquenumber>.sav (the last part is optional)

This allows you to backup your save multiple times without overwriting the pre-existing ones.

* Add option to wipe save and validate save CRC before continuing to main menu

If an invalid/corrupt save is found, the user will only be offered the backup/restore options

The wipe save option exists in case the user messes up and restores a save that makes the gameboy crash on bootup. (I don't know if that can actually happen, but just in case)
After all: the backup/restore options allow for restoring saves of different games than the cartridge you're restoring to. (a red save to a blue cartridge, ...)
Therefore the user could also -accidentally- restore a gold save to a blue cartridge (for example).

So yeah, that option is only there to fix theoretic accidents without the user having to take out the battery.

* Add "Reset clock" function so you can easily reconfigure your game clock in gen 2

There's no straightforward in gen 2 to reconfigure the in-game clock. There's an arcane key combination that's the worst
on Pokémon Crystal and requires you to calculate some kind of password.

Now PokeMe64 makes it easy: the "Reset Clock" function sets a flag that will let the game prompt you in the main menu to
reconfigure the date/time again.

* Update README.md

* Move Reset Clock option to the main menu

* Some usability tweaks of the SelectFileScene

- Add title
- Add scroll arrows
- Make it possible to go back to the previous scene
- Increase PokeMe64 version to 0.2

* Ask confirmation before wiping the save
2024-09-11 22:31:50 +02:00
Philippe Symons
b87b1ac093
Add menu entry "Gen 3 Transfer Info" which leads to a screen referencing Poke Transporter GB (#5) 2024-08-27 20:21:57 +02:00
Philippe Symons
8e556391f3
Feature/show cartridge icons in initial transferpak scene (#4)
We now show a cartridge icon in the initial transferpak scene, which switches to the cartridge that was detected.
2024-08-23 12:32:12 +02:00
Philippe Symons
629f57af6e Fix display of original trainer name in stats scene 2024-08-23 01:35:05 +02:00
Philippe Symons
90bb9ccceb
Feature/scroll indication (#3)
Add scroll arrows when there are more items in the list than the list can show at a time.

These arrows can be shown in the main menu (although there aren't enough items in there to have them shown) or in the various DistributionEventPokemonListScene menus.

I also did provisions to support the same for the ScrollWidget in the about screen. Although I haven't implemented that (yet?)
2024-08-22 21:45:31 +02:00
Philippe Symons
bc7733cc36
Feature/add about screen (#1)
Adds the "About" scene, which displays the version info and credits. The user can scroll up/down through this screen.
2024-08-20 23:57:35 +02:00
Philippe Symons
f516c6d138 Add StatsScene for showing obtained pokemon 2024-08-13 19:18:14 +02:00
Philippe Symons
73b308fd2c Finish ScrollWidget implementation 2024-08-02 19:35:16 +02:00
Philippe Symons
65a59d050e Work on ScrollWidget (Work In Progress/Incomplete) 2024-08-01 21:27:49 +02:00
Philippe Symons
9313571610 Also add an option to Unlock the Unown doll in gen 2 2024-08-01 10:11:24 +02:00
Philippe Symons
f7a687b147 Various changes
- Add "Pikachu Bed" and "Tentacool Doll" decoration unlock options for
  gen 2
- bugfix for unsafe behaviour
- attempt to make the RESET button work for cartridge switching. It
  failed though. (not reliable). Therefore I just added a warning
  message instead.
- Work on new ScrollWidget for Credits/About screen (Work In Progress)
2024-07-31 22:29:21 +02:00
Philippe Symons
eaf9224b31 Add menu options to teach Pikachu Surf and Fly
This implements functionality to teach Pikachu Surf and/or Fly and
extends existing widgets to help provide this functionality.

When a gen1 game is inserted, the user gets the choice to teach Pikachu
these moves.

This commit also restructures some of the Data and Style structs.
2024-07-25 11:01:20 +02:00
Philippe Symons
e51726eef9 Initial import of the first (extremely early) functional version.
It doesn't look like much, but it's functional ;-)

It can inject distribution pokémon into gen 1 and gen 2 original
cartridges and inject the GS ball in Pokémon Crystal.

That's it. But that was the minimal feature set I had in mind for the
project. In the Readme.md you can find the ideas I have for expanding
the project.

But the first priority is the UI, because it really looks bad right now.
(as I was mostly focused on building blocks and transfer pak
functionality. Not on making it looks good)
2024-07-19 21:46:11 +02:00