Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GameBoy ROM support #1

Closed
GerbilSoft opened this issue Aug 5, 2017 · 5 comments
Closed

GameBoy ROM support #1

GerbilSoft opened this issue Aug 5, 2017 · 5 comments
Assignees

Comments

@GerbilSoft
Copy link
Owner

Issue by DankRank
Thursday Sep 01, 2016 at 17:52 GMT
Originally opened as https://github.com/GerbilSoft/rom-properties.reworking/pull/1


Added support for GameBoy ROMs (includes GameBoy Color and Super GameBoy)


DankRank included the following code: https://github.com/GerbilSoft/rom-properties.reworking/pull/1/commits

@GerbilSoft
Copy link
Owner Author

Comment by Techokami
Thursday Sep 01, 2016 at 23:53 GMT


Awesome, I was hoping for GameBoy support! Now you just need something for an icon. Even if it's something generic.

@GerbilSoft
Copy link
Owner Author

Comment by GerbilSoft
Thursday Sep 01, 2016 at 23:56 GMT


Generic filetype icons aren't in the scope of the project.

Then again, maybe that could be added later on...

@GerbilSoft
Copy link
Owner Author

Comment by Techokami
Thursday Sep 01, 2016 at 23:58 GMT


Well I mean, at least as a placeholder. Combined with the fact that some games use the exact same ROM data for all regions, and that there isn't a solid database of GameBoy cart images, would make things tricky for this platform.

@GerbilSoft
Copy link
Owner Author

Comment by GerbilSoft
Friday Sep 02, 2016 at 00:02 GMT


Placeholders would be generic icons set in the registry and/or installed in /usr/share/icons . Returning a placeholder icon in the thumbnail generation function would cause problems later on.

In any case, generic icons won't be part of the initial release. If I can get a good set at decent sizes, I'll look into adding them later. (PNG format for Linux; 256-color and 32-bit color ICO for Windows.)

@GerbilSoft
Copy link
Owner Author

Comment by GerbilSoft
Saturday Aug 05, 2017 at 04:29 GMT


This issue was moved to #1

@GerbilSoft GerbilSoft changed the title [CLOSED] GameBoy ROM support GameBoy ROM support Aug 5, 2017
@GerbilSoft GerbilSoft self-assigned this Aug 5, 2017
GerbilSoft added a commit that referenced this issue Jul 26, 2019
1: Limit the maximum number of entries to 1,048,576. Generally there's
much fewer entries, but this is a decent maximum.

2: rpcli/properties.cpp: Check that RomFields is not nullptr before using
it. This means there's no fields, which happened after fixing #1 but
before setting `d->isValid = false` on the failure path. It might happen
at some other times too, so check it anyway, and assert on failure in
debug builds.
GerbilSoft added a commit that referenced this issue Dec 8, 2019
…on error.

fst is this->fst, which is nullptr at this point.

This fixes a memory leak, reported by clang-9.0's AddressSanitizer.:

ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x81511e3 in operator new(unsigned int) compiler-rt-9.0.0.src/lib/asan/asan_new_delete.cc:99:3
    #1 0x84e439b in LibRomData::GcnPartitionPrivate::loadFst() src/libromdata/disc/GcnPartitionPrivate.cpp:179:25

Indirect leak of 112 byte(s) in 2 object(s) allocated from:
    #0 0x81511e3 in operator new(unsigned int) compiler-rt-9.0.0.src/lib/asan/asan_new_delete.cc:99:3
    #1 0x8571151 in LibRomData::GcnFst::GcnFst(unsigned char const*, unsigned int, unsigned char) src/libromdata/disc/GcnFst.cpp:377:6
GerbilSoft added a commit that referenced this issue Aug 18, 2023
Crash #1 was caused by using the header's image count instead of the
actual vector size.

A corrupted (or maliciously crafted) WIM XML file could have an
incorrect image count field. This crashes in the second half of the XML
parsing when processing the vector, since the index goes out of bounds.

Fix this by using a ranged-based `for` loop using the vector, and
maintain an index count separately.

Crash #2 was caused by not limiting the image count to a reasonable
maximum. A fuzzed value of 2147483650 caused an std::bad_alloc when
calling std::vector<>::reserve().

Other changes:
- Use a constant for the maximum image size.
- Get rid of the rowloop macros.

Found using aflplusplus-4.07c.
GerbilSoft added a commit that referenced this issue Feb 25, 2024
Not currently used...

Palette order matches the bits used in multi-color sprites:
- 0: Transparent
- 1: Multicolor register #0 ($D025)
- 2: Sprite color register
- 3: Multicolor register #1 ($D026)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant