Commit Graph

50 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
382817d20b Fix grammar mistake :-) 2024-11-10 22:01:08 +01:00
Philippe Symons
1c431f0457 Add "Batteryless reproduction carts" to the "Limitations" section in README.md 2024-11-10 21:58:59 +01:00
Philippe Symons
b239588133 Reword a line 2024-11-10 21:55:29 +01:00
Philippe Symons
03968032ac
Document why I'm giving up on Batteryless Reproduction Cartridges (#12)
Because of a hardware limitation (we can only do 32-byte block writes), I'm forced to give up on batteryless reproduction
cartridges. So the only thing I can do is document why.
2024-11-10 21:50:38 +01:00
Philippe Symons
1584f7a871 Update libpokemegb to commit 2ba33f26f772b261050cd98e035fcab47e0aaba9
This was needed because I forgot to do some changes in libpokemegb for issue https://github.com/risingPhil/PokeMe64/issues/10
2024-10-08 12:52:03 +02:00
Philippe Symons
34281254b3
Bugfix for #10 - Sprites error Pokémon silver
Update libpokemegb to commit 095b15227e
2024-10-08 12:37:16 +02: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
ddafa46dfc Update libpokemegb to commit bd518d0d8719418de5ad5638fb49c43f609c03cd 2024-09-26 12:05:11 +02:00
Philippe Symons
dc8d9bb00d Undo README.md changes because they were already shown in github after merging the feature branch
I will bring these changes back later when I'm about to release
2024-09-11 22:50:49 +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
c0141cba9d Change screen3 screenshot. The previous one was confusing because the GS ball entry wasn't shown 2024-08-27 21:25:28 +02:00
Philippe Symons
bcf71ef421
Feature/update docs (#6)
Do some changes to README.md, CREDITS.md and the screenshots
2024-08-27 20:23:29 +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
6209da042d Update libpokemegb to commit 33b4f9c 2024-08-23 01:42:43 +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
0ac60b6c02 Fix issue which caused gen2 pokemon to be received as an egg when they shouldn't be. (most PCNY pokémon SHOULD be in egg form though) 2024-08-20 13:03:28 +02:00
Philippe Symons
63278da157 Forgot to commit Arial-small.ttf 2024-08-15 23:22:15 +02:00
Philippe Symons
f516c6d138 Add StatsScene for showing obtained pokemon 2024-08-13 19:18:14 +02:00
Philippe Symons
4a8ecb6017 Update libpokemegb to commit 7b96cae 2024-08-09 14:12:56 +02:00
Philippe Symons
0e7e46a78e Update libpokemegb git submodule to commit 816c4ea 2024-08-09 11:34:54 +02:00
Philippe Symons
e3edf32979 Update libpokemegb git submodule to commit 044bb1f 2024-08-09 10:57:50 +02:00
Philippe Symons
864f09d0a2 Update libpokemegb to commit 2136e90 2024-08-08 21:46:44 +02:00
Philippe Symons
a29751b98b Update libpokemegb to commit bd95cc3 2024-08-08 12:17:17 +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
6ce9c1ec23 Update CREDITS.md because I used PkHex as a reference for the latest GS Ball changes 2024-07-29 10:30:20 +02:00
Philippe Symons
f6727cdb11 Make the latest README.md changes a bit more clear 2024-07-29 10:26:56 +02:00
Philippe Symons
faa8a24282 Update the README.md file with suggestions from users who tested on Reddit and things I've learned since my initial post 2024-07-29 10:24:09 +02:00
Philippe Symons
521a9ae30c Make GS Ball event repeatable
With these changes, libpokemegb will remove an existing GS Ball from the
players' inventory and reset all GS ball related event flags before
activating the event.

This basically fixes up saves which used earlier versions of PokeMe64
that only gave you the item without triggering the event. (By removing
the existing GS Ball item, it prevents the
need to create a new save in order to unlock the gs ball event
for the users who were so nice to test these earlier builds)

As an added bonus, this makes the GS Ball event entirely repeatable
(which is actually great). You just need to use PokeMe64 everytime to make the
event repeat from the start..
2024-07-28 23:28:17 +02:00
Philippe Symons
4da27db8b8 Fix GS Ball unlock functionality
It was reported by /u/ImranFZakhaev on reddit that receiving the GS Ball
doesn't actually unlock the event. So I implemented it in a different
way.

By writing 0xB to 0x3E3C, we can start the GS Ball event semi-legit.
After triggering the GS Ball event from PokeMe64, you need to go to and
leave the Golden Rod Pokemon Center and an attendant will appear to hand
you the GS Ball.
2024-07-26 21:40:52 +02:00
Philippe Symons
39d7c31831 Update libpokemegb git submodule to fix bug
Bug was reported by /u/imranFZakhaev on reddit:

When adding a pokémon to a save with a full party, the behaviour is
completely broken.

Not only did we add a pokémon to every box, but it also would be a
completely different one or even crash the game when trying to access
the box.

Fixes:

- Stop after adding a pokemon to a box. Don't add it to all.
- In commit 77d5d15 I added a ::setPokemon function and reworked the
  Gen1Box::add() function to use it. That's where it went wrong:

  in the add() function, we would modify the number_of_pokemon counter
  of the box, but not manipulate the species list and write it.
  Then in the setPokemon() function, we would read the box metadata and
  correct it because the number did not match the species list. This is
  what went wrong.

  To fix it, I just had to modify the species list in the add() function
  as well again.
2024-07-26 19:58:13 +02:00
Philippe Symons
55cf13d0c6
Update README.md
corrected a leftover word "library" to "rom" in README.md. (it was copypasta from libpokemegb)
2024-07-25 23:34:26 +02:00
Philippe Symons
14f1680ff2 Remove development check of the main checksum
This is unnecessary and has a performance impact.
2024-07-25 15:20:28 +02:00
Philippe Symons
265b83dd7a Add screenshots to README.md 2024-07-25 13:46:33 +02:00
Philippe Symons
eecb464afd
Update README.md
Update README.md to include the new feature to teach pikachu
2024-07-25 13:35:14 +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
risingPhil
fdc6f90415 Update libdragon submodule again 2024-07-19 20:44:57 +02:00
Philippe Symons
e85e94eb8e remove libdragon submodule 2024-07-19 22:26:22 +02:00
Philippe Symons
9b09ad5d96 try again with git submodule 2024-07-19 22:06:38 +02:00
Philippe Symons
6e4f590258 remove libdragon. Seems like the current approach in git isn't working.
I need another commit to fix it
2024-07-19 21:59:59 +02:00
Philippe Symons
e1a1b01b3f make sure to initialize libdragon 2024-07-19 21:55:58 +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
Philippe Symons
03e87d734b
Initial commit 2024-07-19 21:34:32 +02:00