"F-RIS" (TETRIS in Family BASIC) 2.10 by Masando Vision _____________________ ROMhack version by Garrett Gilchrist (TygerbugGarrett) This is a standalone ROM prepared as an IPS patch of Hudson's Family BASIC 3 (1985) for the Nintendo Family Computer / Nintendo Entertainment System. On Nov 3 2021, programmer "Masando Vision" published a video on Youtube, featuring a demo which attempts to remake Tetris on the Nintendo Entertainment System / Famicom using Family Basic V2 and 1982 bytes of RAM. Family Basic was only available in Japan, and allowed for minigames to be programmed in Basic, within limited RAM space and using default graphics. Family Basic V3 (1985) has more RAM but is still limited. https://www.youtube.com/watch?v=z1NyczNrp7M Tetris (Russian: Тетрис) is a puzzle video game created by Soviet software engineer Alexey Pajitnov in 1984. The Game Boy version is one of the best-selling games of all time, with more than 35 million copies sold. In Tetris, players complete lines by moving and rotating differently shaped pieces (tetrominoes), which descend onto the playing field. The completed lines disappear and grant the player points. During a dispute over rights, three versions were published for the Nintendo Entertainment System in 1988 and 1989. Bullet-Proof Software and Atari/Tengen published versions which are now rare, compared to Nintendo's own widely-released version. Tengen's version is considered superior by some. In Nintendo's, the two-player comeptitive mode is unfinished and unavailable. Masando's version attempts to recreate Tetris using Family BASIC code and default graphics. No sprites are used, and so the playfield updates more slowly using background nametables. It's a little sluggish at first, and may need to be sped up in emulation, but is otherwise playable. Not that the NES needs another version of Tetris, but this is an interesting experiment. _____________________ This version is a hack by Garrett Gilchrist. Masando's original code is displayed in the video and also played as "cassette" audio. That audio was converted to a headerless WAV and imported into VirtuaNES as a vtp (virtual cassette tape), and from these converted to a NES ROM. Masando's background was recreated in Shiru's NES Screen Tool, with only minor changes. A new additional graphic of St. Basil's Cathedral in Russia was added by Gilchrist, replacing Japanese text in the ROM. A cultural landmark of Russia, the cathedral commonly appears in versions of Tetris. If you'd rather use the default Family Basic graphics, this portion of the graphic could be removed from the nametable at 7BE0 in the ROM. This space was originally occupied by an explanation of the game controls. Masando notes that the additional ROM present in Family Basic V3 could theoretically allow for some improvements to the game logic. __________________________ KNOWN ISSUES: I've seen that the block structure doesn't move downward after clearing the bottom lines. Not sure what that's about. __________________________ HACKING AND REPRODUCING THE FAMILY BASIC CODE: Masando's Family Basic V2 code is displayed onscreen in his video using the LIST function. The code also played as audio when loading, so I decided to use that instead. The VirtuaNES (emulator) .vtp file format is a headerless unsigned 8-bit PCM wave file with a 32000 Hz sampling rate. (The Nestopia .tp format is identical.) I saved the audio in this format, and loaded this into VirtuaNES, using the Family Basic LOAD command. VirtuaNES has a memory viewer but no output for it. However, a VirtuaNES save state can be converted to NES by a program called STTONES. "You need to have a Family Basic V3.0 ROM renamed to FAMIBE_V3.nes and STTONES in the same folder. Then run FAMIBE_V3 in VirtuaNES, load the code, run the code, and BREAK out of the code (using the End key). Then create a save state in VirtuaNES. It creates a FAMIBE_V3.st0 file that you can drop on STTONES." The FAMIBAS_V3.nes ROM I was using doesn't say it has a battery-backed WRAM segment (the part that stores the game). Therefore VirtuaNES doesn't have the 0x2000 extra bytes that STTONES wants: You need to set 0x6 from 01 to 03 first. Alternately, when you've got a Save State, open up your hex editor. There should be program data in the VirtuaNES Save State at about 0A14. Copy all of that data to about 2A14. Some FFs at the beginning will have to become 00s. Now I run STTONES and have a more or less working file, which I used for further hacking. Alternately we can use the Python remake STTONED.PY : Usage: sttoned.py path/to/save_state path/to/family_basic.nes https://gist.github.com/einstein95/f33906cd4ee0c6e1abae0b4141e08ea9 The background graphic was recreated in Shiru's NES Screen Tool, and pasted into the ROM at 7BE0. I then decided to use some original graphics of the cathedral. These were created in Photoshop and then copied into the ROM using YY-CHR. Shiru's NES Screen Tool was again used to redesign the background. This could be removed if you're a purist. New code was hacked in using a hex editor and/or the FCEUX emulator hex editor.