Commit Graph

9 Commits

Author SHA1 Message Date
Philippe Symons
c9ed32e3a1 Debug option: Write/Load Cable data to/from SRAM
This commit allows you to use the Write Cbl Data debug option and new Load Cbl Data debug option to dump a link's data to SRAM
or load it from SRAM and pretend like you got it over the link cable.

This is useful for capturing the link process on gameboy and replay + debug it later in an emulator.
2026-06-04 15:22:46 +02:00
Philippe Symons
58654de02c Fix MGBA logging bug
va args passing was broken in my initial implementation, causing garbage values to get printed whenever you try
to print an actual argument.

Moreover, I also had a bug in the PTGB_MGBA_XYZ macros.

Sorry, I should've tested it with actual arguments.
2026-03-31 16:40:16 +02:00
Philippe Symons
1ee98caa55 Integrate libmgba into PTGB debug builds
This allows us to log to mgba's logging window.
It will be very useful to debug issues.

But we only allow enabling this for debug builds for license reasons.
2026-03-30 21:06:36 +02:00
GearsProgress
1f29379810 Linking textbox creation to string display 2026-03-14 10:16:16 -04:00
Philippe Symons
9268cbd42e Reduce binary size by eliminating libstdc++
This commit removes all references to things in the libstdc++ library to remove a decent chunk of bloat.

This means every std::to_string() call, std::string and std::vector. (as well as iostream related stuff).

I replaced those with my own versions ptgb::to_string() and ptgb::vector. Especially the latter is not exactly the same,
but close enough.

I also replaced operator new and delete with my own implementation to avoid pulling in everything related to exceptions
from libstdc++

Another problem was the fact that libtonc uses siscanf, which pulls in everything related to the scanf family of functions
and locale support. The worst part of that was that it included a 13KB "categories" symbol from libc_a-categories.o,
which was pulled in because of the locale support integrated into newlibc's siscanf() function. To fix that, I created a
custom, extremely restricted implementation of siscanf. libtonc only used this function to parse at most 2 integers from a
string anyway.
2025-04-09 20:04:08 +02:00
Philippe Symons
93a6c0f3fe Add functionality to upload Poke Transporter GB to another gba after it has started on the current one [EZ Flash Omega]
The reason for this functionality is that some flashcarts *cough* EZ Flash Omega (DE) *cough* can't be hotswapped IN. When you try this, they will trigger a reset of the gba.
This is only relevant for the use case in which you first launch the rom from a flashcart in the first place.

I suppose this can only be relevant for flashcarts which offer "single cart mode". (mode B for EZ Flash Omega).

So, I added an option to upload the rom to another GBA from the "game_load_error" screen if you press the SELECT button.

So, with this change, you could

- launch Poke Transporter GB on GBA 1 from a flashcart.
- eject the flashcart on GBA 1
- make sure the EZ Flash Omega or other "single cart mode/mode B" capable flashcart is set to this mode.
- insert this flashcart into GBA 2
- connect GBA link cable (narrow plug on GBA 1, wide plug on GBA 2)
- Power on GBA 2 and press both SELECT and START while the gameboy logo is still shown
- On GBA 1, in the "game_load_error" screen, press SELECT
- On GBA 1, now press A -> The multiboot upload will now start
- Once finished, GBA 2 will now be running Poke Transporter GB as well
- GBA 2 will recognize the gen III save!
- You can now disconnect the GBA link cable and turn off GBA 1. (you may use it later for the GBC game alongside a GBC link cable to start the actual PKMN transfer)
2025-04-03 23:31:24 +02:00
Remnants of Forgotten Disney
f70ce475d2 Restoring memory.c 2024-03-20 15:41:03 -05:00
Remnants of Forgotten Disney
0d39923c0a Fixing interrupts 2024-03-20 15:38:33 -05:00
Remnants of Forgotten Disney
53e7748d48 Organizing files 2024-03-19 13:52:23 -05:00