Tetris hack needs help with SRAM issue with Nestopia

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Need help with SRAM issue with Nestopia

Post by Dwedit »

That's also a PAL build...
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
infidelity
Posts: 486
Joined: Fri Mar 01, 2013 4:46 am

Re: Need help with SRAM issue with Nestopia

Post by infidelity »

I got it working properly on Nestopia now. I dont have the internet, I do my online stuff via my smartphone. When I get the chance ill upload the new .ips, and ill put up a detailed list of what I did. It had alot to do with adding additional writes to $A001.

-infidelity
3gengames
Formerly 65024U
Posts: 2281
Joined: Sat Mar 27, 2010 12:57 pm

Re: Need help with SRAM issue with Nestopia

Post by 3gengames »

Request: Make it MMC1 again. Learn how the serial writes work and it shouldn't be much to change at all.
infidelity
Posts: 486
Joined: Fri Mar 01, 2013 4:46 am

Re: Need help with SRAM issue with Nestopia

Post by infidelity »

Here is my latest .ips.

Tetris Zero (MMC3-118-v2)
http://acmlm.kafuka.org/uploader/get.php?id=4409

This is taken from the .txt within the .zip file.

4-16-13
infidelity

Tetris Zero Fix For TKROM Board & Nestopia

It was brought to my attention that when inserting Tetris Zero on a TKROM board, that the score system was all messed up, the tile id's for the players names were screwed up, and the 2nd player has no A/B button functions during in-game play.

I knew right away that this specificly had to deal with SRAM. My custom score saving system is stored within SRAM, as well as some of player 2's in-game piece & controller functions.

During my searches and fixes, i was slowly getting various functions back up and running, but then i came across that if you obtain a high score, the name entry screen was bypassed, and you were unable to write your name.

I already had a write of 80 to $A001 within the HW bank, which enables SRAM. But for some bizzare reason, i've had to add that same code throughout the rom, before every write within the region of $6000-$7FFF.

So what i wil do, is just paste the things that i added/changed from my notes.

Force WRAM At End Of Bankswap Routine, Wipe Out WRAM At CHR Routine
$FE2D = EAEAEAEAEA
$FF27 = A980 8D01A0
OK! Scores Appear! But, still no proper 2nd player function during gameplay

Push Bits For Player 2
$D7A0 = A980 8D01A0 A900 8DFF7F 4CF2A3
$8209 = 20B3AD (originaly 20B8AD)
$ADC3 = A980 8D01A0
$D920 = A980 8D01A0 ADF27F 60 (all 00's originaly)
$DA50 = 2010D9 (originaly ADF27F)
$DA37 = 2010D9 (originaly ADF27F)
OK! 2nd Player Pieces Appears! Can enable/disable the next
piece icon! Can rotate falling piece! But, NEXT piece does not change,
falling piece doesn't change.

$AE5F = A980 8D01A0 202EAE 60
OK! 2nd Player Next Piece Changes! But, the actual piece does not come down. And
the flip doesn't reset itself when the next piece comes down.

$81F0 = 5BAE ;60AE original
$AE6B = A980 8D01A0
$81F2 = 18AE ;68AE original
$AE28 = A980 8D01A0 4C68AE
OK! 2nd Player Next Piece changes without flickering in the box! But, that actual
next piece does not come down.

$AE4D = 4CB1B 0000000
$B0C1 = A980 8D01A0 A5A6 8DF17F 60
$AE59 = 20E4B0 EAEAEA
$B0F4 = A980 8D01A0 ADF17F 8DF07F 60
OK! 2nd Player In-Game Is Working Properly At This Point! But, player 2 score doesnt
work....

$A29A = 206BB7 (original 2070B7)
$B77B = (4F4E original)
$AE78 = A980 8D01A0 A901 8DF37F 4CA299
$B488 = A980 8D01A0 4C30B6 (originaly 00's)
$A10A = 4C78B4 (original 4C30B6)

Going to do logs of writes to 6000-7FFF after you press start on the victory screen
that lets you insert your score

$BB60 $A061,$A068,$A06F,$A133,$A1FF,$A12B,$B6A5,$B6B1,$B6BD (changes to 2054BB's)
$BB70 $A1DB,$A1E2,$A1E9 (change to 206BBB's)
$BB80
$BB90 $A07C (change to 2080BB)
$BBA0 $A1FA (change to 2093BB)
$BBB0
$BBC0 $B6E9 (change to 4CBBBB)

$BC23 = 0D2060

$BC4A = A980 8D01A0 60
$BB64 = A980 8D01A0 A5BE C902 F004 B90060 60 B92060 60 000000000000000000
$BB90 = A980 8D01A0 A5BE C902 F004 B91860 60 B93860 60 000000000000000000000000
$BBA3 = A980 8D01A0 A5BE C902 F004 BD1860 60 BD3860 60 00000000000000000000

OK! Player 2 Can Enter Score! But, when player 1 wins, and player 2 has already entered they're name, they're name is glitched. So i need to check the reads to $6000-$7FFF

$B969 = 4CA8BB (originaly 4C58BA)
$BBB8 = A980 8D01A0 4C58BA
$BB35 = 2060BC EAEAEAEAEA
$BC70 = A980 8D01A0 A924 999E60 88 10F3 60 (originaly all 00's)
$A041 = A980 8D01A0 (originaly EA's)
$A17A = 4CD1B0 0000000000000000000000
$B0E1 = A980 8D01A0 A5BE C902 F004 B95060 60 B98060 60
$AA4B = 4CDBAF
$AFEB = A980 8D01A0

OK! Score names appear correctly, when writing new name for high score!
DONE! Game runs normaly in Nestopia!
3gengames
Formerly 65024U
Posts: 2281
Joined: Sat Mar 27, 2010 12:57 pm

Re: Tetris hack needs help with SRAM issue with Nestopia

Post by 3gengames »

Anyone know why enabling WRAM wouldn't keep it enabled? That sounds very iffy.
FrankWDoom
Posts: 255
Joined: Mon Jan 23, 2012 11:27 pm

Re: Tetris hack needs help with SRAM issue with Nestopia

Post by FrankWDoom »

Tried this on a real cart tonight and the player 2 controls are working now. Player 2 pieces are also working but I think there may be a bug where p2 does not get the piece shown as next. I can't figure out what the condition is for that, or even if it's happening for sure. Might just be my short attention span. Anyway, the big issues from the first patch seem to be sorted out.

In the 2 player modes, is clearing multiple lines supposed to bump up the other player's field? I was expecting that would happen with this patch for some reason- maybe just confusing that behavior with a different version.
infidelity
Posts: 486
Joined: Fri Mar 01, 2013 4:46 am

Re: Tetris hack needs help with SRAM issue with Nestopia

Post by infidelity »

No I dont believe you're seeing things.

Ive tried very hard to create a separate NEXT piece for p2.

Originaly in the hidden 2p mode, both players go for one NEXT piece. Whichever players piece lands/completes first, obtains the NEXT piece.

It was difficult trying to keep my code from glitching. I thought I finally figured it out, but I guess not.

As for the random block appearances for the opposing player, I think I removed that back in my first initial release.
Post Reply