Commit Graph

475 Commits

Author SHA1 Message Date
GearsProgress
0577a450da Formatting (again) 2026-10-22 15:04:58 -04:00
GearsProgress
1738b2ebdd Moving libraries into their own folders 2026-10-18 11:27:01 -04:00
GearsProgress
f1e2b62e4a Applying formatting and moving libraries into specific folders 2026-10-18 11:07:35 -04:00
GearsProgress
f1cf11f2cf Final set of bug fixes before release 2026-10-02 12:20:03 -04:00
Philippe Symons
00a2f1d55e Fix crash when transferring to Spanish Emerald
There was a problem with Spanish Emerald triggering a crash in mystery_gift_injector.cpp

The problem was that the section30 and script BPS patch FileContainers specify @chunkSize=4096 in their .containerdef files.

However, mystery_gift_injector.cpp didn't specify a chunkSize in the constructor of the FileContainerReader instances in reconstructPregeneratedPayloads()

This resulted in it falling back to DEFAULT_CHUNK_SIZE, which is 2048.

Fix: Specify chunkSize 4096 as a constructor argument!
2026-10-02 17:05:28 +02:00
GearsProgress
99bf032751 Fixing a few more bugs for release 2026-10-01 22:41:04 -04:00
Philippe Symons
8d81cd4758 Fix some compiler warnings in vertical_menu 2026-09-30 17:19:28 +02:00
Philippe Symons
91791243a1 Merge branch 'release-candidate' into have-build-lang-independent-gba-payload-translations 2026-09-30 17:07:30 +02:00
GearsProgress
fa4dd1197a Fixing issue with entrypoint checking while in debug mode 2026-09-30 09:13:56 -04:00
GearsProgress
492c14b74f General fixes 2026-09-29 15:41:32 -04:00
GearsProgress
4d39ce30d0 Adding entrypoint values 2026-09-29 15:40:06 -04:00
GearsProgress
503478d665 Adding global compression header 2026-09-28 16:15:09 -04:00
Philippe Symons
a6b34279f1 Work on multilang gba payloads (WIP/broken)
Do some more work for multilang gba payloads. Revise the patch structure and make it use the right RSEFRLG table.

But it's broken. For some reason the english text doesn't show up when running the payload. Don't ask me why yet.
2026-09-28 17:09:44 +02:00
Philippe Symons
f11c11d5bf Make gba payload translations independent from BUILD_LANG (WIP/untested) 2026-09-25 21:20:21 +02:00
GearsProgress
60a9586867 Disable KOR versions of Gold and Silver 2026-09-25 14:45:33 -04:00
GearsProgress
f4696d7009 Adding error message for mixing JPN and Latin 2026-09-25 14:43:02 -04:00
Philippe Symons
1b0efc2166 Use a 4096 byte chunkSize for the bps patch containers to maximize compression 2026-09-25 09:25:29 +02:00
Philippe Symons
3884d4b5da Strip some more fields from the BPS patches and make easyaspi314's implementation deal with it. 2026-09-24 23:07:48 +02:00
Philippe Symons
c12b478596 Merge branch 'isolate_mystery_gift_builder' into trim-bps-patches 2026-09-24 21:08:52 +02:00
Philippe Symons
b49a0793db Fix bug 2026-09-24 16:07:41 +02:00
Philippe Symons
11a581061f Fix first_time text entries in payload (untested)
first_time entries would be longer, therefore the reference pointers inside the payload would shift.

To avoid that, we now reserve space for the longest entry, knowing that the texts will get stripped after
the payloads have been generated.

Doing so ensures that the text offsets remain constant, no matter if we're dealing with the first_time or othertimes payload.

This also means we need to take that reservation into account on the PTGB rom side of things of course.
To do so, I created a pair array indicating the first time entries and there non-first_time counterparts.

We'll determine which entry is the longest and ensure we use that length for the offset of the next entry.
2026-09-22 17:10:20 +02:00
Philippe Symons
12183e51d7 Bugfix: make sure to move data that is stored at the text insertion point out of the way.
We just overwrote it.
2026-09-22 15:45:27 +02:00
Philippe Symons
8015d8187b Merge branch 'isolate_mystery_gift_builder' into strip-texts-from-generated-payloads 2026-09-22 14:16:39 +02:00
Philippe Symons
0e5cf21010 Merge remote-tracking branch 'upstream/release-candidate' into isolate_mystery_gift_builder 2026-09-22 14:15:58 +02:00
Philippe Symons
c0e20d473f Fix the packet arrival address for gen2 [cherry-pick]
Recently the GB payload for gen2 changed the arrival address at which packets get stored.

It went from 0xC6DC to 0xC8DC. But for gen1 it remained the same.

This commit makes sure that change is reflected on the PTGB side.
2026-09-22 13:49:36 +02:00
Philippe Symons
2945baa71c Add comment 2026-09-17 16:33:41 +02:00
Philippe Symons
c8b95b418e There are only 8 entries in section30TextSequence 2026-09-17 16:32:09 +02:00
Philippe Symons
3579fe6658 Reinject RSEFRLG table entries into the GBA payload at runtime. (untested)
This commit makes mystery_gift_injector re-insert the text entries into the gba payload at runtime.

You may or may not remember that I made gba-payload-generator strip the text entries again after generating the payloads.
I did this to improve compression: it removes the variability of the text lengths. It also ensures that texts are not really part of the BPS patch files
that are generated to transform the base payload into a specific language and game variant.

Therefore, we don't run at risk of storing certain text entries multiple times (or partially multiple times) due to them being stored at FileContainer boundaries.
It should make patch files smaller and more predictable.

Stripping the text entries also made it easy to reinsert: almost every rom uses the same offset for the first entry.
We now only need to store each language variant of the RSEFRLG (variants aren't being generated yet) once. That should be a big boon.

By first generating the payloads and THEN stripping the texts, we also ensure that the pointers/references within the payload remain intact and will become valid
again once the texts get reinserted.

Anyway, this specific commit does the re-insertion of those text entries into the payload (script + section30) using the RSEFRLG table.

Because the text stripping takes out these variable length texts, the text insertion offsets always end up the same, no matter the language:

Section30: 0x97E
Script:
- Ruby/Sapphire: 0x268
- Fire Red/Leaf Green: 0x278
- Emerald: 0x298
2026-09-17 16:13:08 +02:00
Philippe Symons
e313ec83b1 Var reinitialization fix by antoineok.
dataOutBufferCurrIndex is used by GET_CHECKSUM, but it never gets reset if you trigger the transfer again.

Fix: reinitialize it on ::setup()
2026-09-15 13:28:09 -04:00
GearsProgress
b16f9d9f6e Tightening mystery gift event detection 2026-09-14 16:29:36 -04:00
GearsProgress
8c9c7fe201 Fixing Pokedex Entry 2026-09-14 15:48:55 -04:00
GearsProgress
61bc5c17b1 Fix removal array crash 2026-09-14 13:23:52 -04:00
GearsProgress
6db80329b3 Fixing tutorial button crash 2026-09-14 13:21:48 -04:00
GearsProgress
4196ede675 Fixing flag palettes 2026-09-14 12:10:06 -04:00
GearsProgress
10bad431fa Updating credits to include JPN Crystal 2026-09-12 10:27:43 -04:00
Philippe Symons
aba2c5864b Fix the packet arrival address for gen2
Recently the GB payload for gen2 changed the arrival address at which packets get stored.

It went from 0xC6DC to 0xC8DC. But for gen1 it remained the same.

This commit makes sure that change is reflected on the PTGB side.
2026-09-10 15:20:00 +02:00
Philippe Symons
ac257b314f Fix transfer issue in isolate_mystery_gift_builder branch
Problem: several variables were used in mystery_gift_builder before they were initialized.
Fix: initialize them.

I also made sure to memset the entire buffer before generating a payload to avoid garbage data to seep in.
2026-09-09 15:30:07 +02:00
Philippe Symons
f4626c1c0a Merge remote-tracking branch 'upstream/release-candidate' into isolate_mystery_gift_builder 2026-09-07 20:35:57 +02:00
GearsProgress
3cc00d3aa9 Fixing intro crash and graphics 2026-09-07 11:22:22 -04:00
Philippe Symons
74babb10fc Var reinitialization fix by antoineok.
dataOutBufferCurrIndex is used by GET_CHECKSUM, but it never gets reset if you trigger the transfer again.

Fix: reinitialize it on ::setup()
2026-09-07 16:39:52 +02:00
Philippe Symons
82d394d1bb Eliminate some code duplication in reconstruct_pregenerated_payloads and rename generate_payloads.sh 2026-09-04 15:47:33 +02:00
Philippe Symons
afe0b5cc68 Merge remote-tracking branch 'upstream/gameboy-payload-update' into isolate_mystery_gift_builder 2026-09-02 15:06:32 +02:00
GearsProgress
9cd6dc30c3 Updating box graphics and adding Crystal revisions 2026-09-01 18:19:29 -04:00
GearsProgress
ab69cb7ce0 Fixing link cable timeout 2026-09-01 11:17:39 -04:00
Philippe Symons
db1b83a29b Merge remote-tracking branch 'upstream/gameboy-payload-update' into gears-merge 2026-08-31 13:21:29 +02:00
GearsProgress
608022a80e Improving the link cable connection initialization 2026-08-29 13:23:33 -04:00
Philippe Symons
6c4c8e72b9 Trim BPS patches. Remove 4 bytes from the header and 12 from the trailer. 2026-08-28 23:19:14 +02:00
Philippe Symons
3ed33fac2b Make sure to zero tempBuffer in between 2026-08-28 21:56:34 +02:00
Philippe Symons
e96821aed5 Fix bug and improve logs
Bugfix: do not apply the same base payload patch twice.

I also improved the mystery_gift_builder log messages a bit.
2026-08-28 16:15:11 +02:00
Philippe Symons
3145fe69d2 Make us have less base payloads.
For example, Fire Red and Leaf green are (almost?) identical. But if we create separate base payloads, it takes up way more space.
2026-08-28 15:12:39 +02:00