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

spg format + [tsconf_betadisc_flop.xml] updated games/demos [holub, tslabs] #11274

Closed
wants to merge 1 commit into from

Conversation

holub
Copy link
Contributor

@holub holub commented May 24, 2023

  • add spg file format
  • [tsconf_betadisc_flop.xml] soflist updates

spg format currently has no alternatives, because all existing don't support pagination with >128K RAM.

@holub holub changed the title spg format + softlist spg format + tsconf_betadisc_flop.xml] updated games/demos May 24, 2023
@holub holub changed the title spg format + tsconf_betadisc_flop.xml] updated games/demos spg format + [tsconf_betadisc_flop.xml] updated games/demos May 24, 2023
@holub
Copy link
Contributor Author

holub commented Jun 4, 2023

Diff looks strange with others commits leaked into this PR after merge.
I can reopen if required.

@cuavas
Copy link
Member

cuavas commented Jun 19, 2023

This seems to have got mixed up a bit with release branch commits from last month showing up as part of it. Could you merge or rebase to make GitHub less confused?

Copy link
Member

@cuavas cuavas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the decompression code cribbed from somewhere? It seems to be somewhat lacking in error checking as well as having some odd characteristics.

src/mame/sinclair/spec_snqk.cpp Outdated Show resolved Hide resolved
src/mame/sinclair/spec_snqk.cpp Outdated Show resolved Hide resolved
src/mame/sinclair/spec_snqk.cpp Outdated Show resolved Hide resolved
src/mame/sinclair/spec_snqk.cpp Outdated Show resolved Hide resolved
src/mame/sinclair/spec_snqk.cpp Outdated Show resolved Hide resolved
src/mame/sinclair/spec_snqk.cpp Outdated Show resolved Hide resolved
u8 data;
};

spg_v10* spg = (spg_v10*)snapdata;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should check the size here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible because declared blocks array will always oversize real data. If that can cause problems I can separate blocks from struct and process them iteratively

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cuavas sorry to bother... what is the preference here?

src/mame/sinclair/spec_snqk.cpp Outdated Show resolved Hide resolved
Comment on lines +2847 to +2849
u8 *data = &spg->data;
for (u8 i = 0; i < spg->blocks_num; i++)
{
const u16 size = (spg->blocks[i].size512 + 1) * 512;
const u8 page = spg->blocks[i].page;
const u16 offs = (spg->blocks[i].address512) * 512;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don’t seem to have checked the size against the number of blocks to ensure the snapshot isn’t truncated.

Copy link
Contributor Author

@holub holub Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to be trunketed. 256 is max allowed but snapshot can contain any less numbers of blocks.

src/mame/sinclair/spec_snqk.cpp Outdated Show resolved Hide resolved
@tslabs
Copy link

tslabs commented Jun 19, 2023

Was the decompression code cribbed from somewhere? It seems to be somewhat lacking in error checking as well as having some odd characteristics.

The decompression code has been copied from https://github.com/tslabs/zx-evo/blame/master/pentevo/unreal/Unreal/depack.cpp with my permission to any modifications

@holub holub requested a review from cuavas June 21, 2023 00:04
@holub holub changed the title spg format + [tsconf_betadisc_flop.xml] updated games/demos spg format + [tsconf_betadisc_flop.xml] updated [holub, tslabs]games/demos Aug 19, 2023
@holub holub changed the title spg format + [tsconf_betadisc_flop.xml] updated [holub, tslabs]games/demos spg format + [tsconf_betadisc_flop.xml] updated games/demos [holub, tslabs] Aug 19, 2023
@holub
Copy link
Contributor Author

holub commented Aug 28, 2023

@cuavas can you please take another look?

@cuavas
Copy link
Member

cuavas commented Sep 25, 2024

This PR still has multiple things in it that might be better separated:

  • General cleanup and bug fixes in the Spectrum snapshot formats handling. This stuff should be easy to get merged if it’s isolated.
  • The SPG format handling stuff itself. This is a bit more complicated because it makes licensing messy if it gets pasted into the middle of a MAME source file. It would be easier to discuss this part on its own.
  • A bunch of SPG snapshots in a software list. They seem to have been added to a BetaDisc floppy image software list. Should they have a software list of their own, since they appear to be memory snapshots that don’t correspond to physical media? If the software list addition was isolated, it may be possible to get that merged with supported="no" to get the media images in circulation before the SPG format support is ready.

@holub
Copy link
Contributor Author

holub commented Sep 25, 2024

Oh, I'm sorry for bothering. Tried to rebase it in order to revisit. Will close the PR and reopen when ready.

@holub holub closed this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants