Skip to content

Fixes to Sega randomizer and Marathon C88#3

Open
zaphod77 wants to merge 2 commits intocambridge-stacker:mainfrom
zaphod77:main
Open

Fixes to Sega randomizer and Marathon C88#3
zaphod77 wants to merge 2 commits intocambridge-stacker:mainfrom
zaphod77:main

Conversation

@zaphod77
Copy link

Tetris for System 16's randomizer is known, so i coded it. :)

Also that game has a DAS bug of it's own.

This pull request, at the cost of breaking old replays for Marathon C88 and Marathon C99, fixes both issues.

The new Sega randomizer now truly generates only sequences the arcade itself can. if you comment out the code that randomly picks a valid sega seed, it will generate the famous poweron pattern, but won't work in replays.

This commit makes it so the Sega 88 randomizer actually only generates sequences the system 16 arcade version can.

Since the seed was well chosen enough to make the period maximal length for the bits that alter, i was able to shortcut it, because every possible seed with those bits constant is visited.

The seed at the top generates the TITII power on pattern.
When you switch directions in one frame on Tetris (Sega 1988), the game rests das one frame too late.  This makes it move two cells in two frames.

This commit implements this bug, just as Marathon C99 implements that game's DAS bug.

Will break existing replays.
@Rexxt
Copy link
Contributor

Rexxt commented May 11, 2025

given the breaking nature of these changes i think it would be best to make this a separate mode from the current implementation of c88 if we really want to preserve replay compatibility

if no one really cares about c88 replays, we can go ahead and merge without too much question.

@zaphod77
Copy link
Author

the real issue is that replacing the randomizer also breaks marathon_c99, because it uses the same randomizer.

I strongly suspect that the game does use the exact same randomizer, because there are two cases where the game will produce the original poweron pattern. But i do not have the reverse engineering chops to confirm this.

The DAS bug being implemented is 110% the right thing to do, because it only breaks replays for the mode itself. After all, marathon_c99 has that game's DAS bug, so c88 should have that game's DAS bug.

The only thing left is the row 20 bug, which super rarely comes up, and I am not sure how to actually implement it.

@zaphod77
Copy link
Author

okay, it seems the naomi version uses a different generator, but still pregens 1000 pieces. it just copies in the poweron pattern and whatever else i needs for it's demos.

So it seems sega.lua needs to be separated into sega_88.lua and sega_99.lua, and i don't know which PRMG sega 99 uses, but it still generates 1000 pieces, which will never all get dealt, as 300 lines is insufficient, no matter how many pieces are left on the field when you clear line 300.

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.

2 participants