[//]: <> (This readme is in the markdown format. Please preview in a markdown parser.)

# Miho Nakayama's Tokimeki High School

Source code: [https://github.com/romh-acking/miho-nakayama-tokimeki-high-school](https://github.com/romh-acking/miho-nakayama-tokimeki-high-school)

## Patching Instructions
The patch is a [Beat patch](https://www.romhacking.net/utilities/893/). Either use the Beat patcher or patch your disk image here:

[https://www.romhacking.net/patch/](https://www.romhacking.net/patch/)

No IPS patches will be provided.

The translation is based on `Idol Hotline - Nakayama Miho no Tokimeki High School (Japan) (DV 10).fds` with a MD5 checksum of `dab482f9791af3ab7f607f92eed02631`, although, I could have used any disk image and revision as a base. Beat patches require a disk image with a certain checksum. In other words, you're not going to find the correct disk image by downloading from random rom websites. I suggest using simple Google Dorks or forcing a disk image to be patched with RHDN's patcher, linked above.

## About

### Filler Notes
I was introduced to Nakayama Miho no Tokimeki High School in episode 25 of Chrontendo, a video series by "Dr. Sparkle" attempting to showcase all Famicom/NES/FDS games in chronological order. Described as a proto-dating-sim, and featuring the talents of such gaming legends as Gunpei Yokoi, Hironobu Sakaguchi, and Nobuo Uematsu, I was instantly fascinated with the idea of game.

In late March of 2017 I did something I hadn't done in over a decade, I decoded the game's custom text encoding and dumped a script. Normally I leave hacking work to others, but I was so taken with this game that I decided to do what I could; replacing the font, changing the title screen, and even "hacking" the menus into English. I posted the work to the RHDN forums, and by April 19, 2017 I'd finished a first draft script translation and began seeking additional technical help.

Shortly thereafter FCandChill responded with an interest in inserting the translated script. By the end of May we'd made progress, but the script was going to need to be pared down so I did some editing to my initial draft to trim it for space. At some point the project stalled, but FCandChill returned years later and resurrected it.

I was initially on the hook to compare the pared down script to the initial script, but having long since moved on to other projects I unfortunately let that work languish. Thankfully FCandChill, along with other folks such as TheMajinZenki, got the script to a point they were happy with, and this years long effort to release and English language translation patch seems to be at an end.

Many thanks to all involved with bringing this project to completion. I'm truly glad to see my little dream of an English language translation patch for this game come true thanks to our combined efforts.

### FCandChill Notes:
If you were expecting this game to have any ties to Tokimeki Memorial, I'm sorry to disappoint!

#### What's Included Inside

* A [Beat patch](https://www.romhacking.net/utilities/893/)
	*  Either use the Beat patcher or patch your rom here:
	* [https://www.romhacking.net/patch/](https://www.romhacking.net/patch/)
* A translated manual.
    * Special thanks to Hubz from Gaming Alexandria for the manual scan:
    * [https://www.gamingalexandria.com/wp/2018/10/nakayama-miho-no-tokimeki-high-school/](https://www.gamingalexandria.com/wp/2018/10/nakayama-miho-no-tokimeki-high-school/)
* A phone hotline flyer.
	* The game displays numbers that you'd call for game immersion and tips.
	* The hotline was available for a short time so future release included a flyer of transcripts of the prerecordings.
* An FCEUX Lua script to display the translated hotline transcripts in-game
	* Yes, FCEUX isn't that great of an emulator. I tried developing a MESEN Lua script but there to date isn't a feature to be PC address aware.

#### About the Game
Where to start with this game. This game is one of the first dating sim games, and it was a joint effort between Nintendo and Square. It was designed by Hironobu Sakaguchi and Yoshio Sakamoto, the creators of Final Fantasy and Metroid respectively. It credits big names such as Nobuo Uematsu for the music (and you can really tell which tracks were made by him). A lot of online sources cite a Nintendo Dream magazine interview the game was developed in a two-week time period. However, an Iwata asks interview claims the game was developed in three months and was finished in the last two weeks. I guess the first three months were planning and the last two weeks were actual programming? The details are a bit murky.

The game received a celebrity endorsement from the then-famous actress and singer Miho Nakayama. From time to time, you're given a phone hotline number to call to hear a prerecording of Miho. The calls are lost to time, however later releases of the game included transcripts of them. The last transcript's phone number seemingly can't be accessed in-game. Presumably, the service data feature grant you access to the phone number in-game.

Plans were underway to have a voice actors read the lines (one voice actress considered for the role of Miho was GlitterBerri) but having writeups that were essentially paraphrased versions of the real hotline calls killed those plans. By the time ppltoast uncovered scans of the flyer that included transcripts, I already wanted the project over and done with.

Well that's the backstory, so what about the game? The game starts out fine. The story is a bit goofy but is fine. The phone conversations give some immersion. The in-game conversations you have with Miho contain multiple choice responses. You can use your common sense to deduce what the correct answers are and play into the dating sim aspect. There's also some puzzle solving you have to do. The puzzles mostly aren't too difficult. But then you'll hit a certain point in the game where the game design is just player hostile. The correct way to progress requires a very specific and obtuse solution. Sometimes, you have to select a very specific part of the scene. Other times, the correct multiple choice options are obtuse. And to top it off, you're supposed to select the correct facial expression of among six for each option! I believe part of this was to create a barrier of completion for the contest. If you got one of the endings, you could utilize the Disk Fax network to have the chance to win prizes (autographed phone card and a VHS tape for the bad ending and good ending respectively). I believe another part of this was to artificially extend the length of the game. FDS floppies were larger than stock Nintendo mappers at the time, but that soon changed. So a lot of the game is trial and error, and game overs force you to sit through at least one lengthy loading screen.

With that being said, it's no wonder the game received *multiple* strategy guides after the contest was over and [one translation attempt was cancelled after the translator couldn't complete the game](https://en.wikipedia.org/wiki/Talk:Nakayama_Miho_no_Tokimeki_High_School#Untitled).

With a guide, the game is amusing to play through and complete in one sitting. Without a guide, it is a slog to play through and a game of trial and error. I would definitely suggest using a guide, such as this one:

https://nindb.net/nes/tokimeki-high-school/guide.html

Just keep in mind it has some translation errors and some absent information on the Sadakichi ending.

#### Project History
This translation project started in the relatively more innocent times of early 2017. For whatever reason, I decided that my first translation project to be involved in would be a text heavy Famicom Disk System game. Daring to say the least. I would like to thank everyone who helped us along the way and provided guidance. I really didn't know what I got myself into. Originally, I leveraged a custom script dumper and inserter that really wasn't that great (and creatively named CreativeName). The script was managed in flat files. The script could be inserted but the project was in a state of limbo for three years. Without advanced hacking, the project couldn't progress without drastic cuts.

The project was always in the back of my mind for years. Flash forward to the end of May 2020, I saw a random new forum post by filler about the project and I picked it up again. I recently polished my rom hacking skills from the Metal Slader Glory project and decided to take another whack at the game. My new script dumping and insertion tool was better, and I learned 6502 assembly language. I looked at posts by Pennywise and KingMike for inspiration. Pennywise's descriptions on his Dead Zone translation was a major inspiration for me in particular on how he improved the game's text compression.

FDS floppies have their own simple file system and expanding files is trivial, with some stipulations. The files must fit nicely in RAM and you have to adjust pointers if necessary. Within a couple of days (and while the world was in chaos), I expanded the dictionary file, relocated it in RAM, and made asm hacks to leverage the expanded dictionary. Fortunately, the game's code for text parsing is extremely unoptimized, so inserting my own code was easy. With better compression, I knew the project was going places.

Later on, in addition to an expanded dictionary, I added a few more space saving tricks to fit the script in. 

First, I expanded the script files by appending blank data to them. Right after the initial script space is miscellaneous data. Previously, I was writing script data linearly, however, this resulted in wasted space. Let's say we have 8 lines write, and we've already written five lines. In region A, there's 10 bytes free. Line #6 is 20 bytes long so we move to region B. However, line #7 is exactly 10 bytes. With a linear writing methodology, we write to region B. We've essentially wasted 10 bytes. So I came up with the solution of writing to the two regions, but with a simple but effective trick: I would write strings from biggest to smallest and check each region to see if space is available to insert a line. With the FDS, everything is loaded into RAM, so every byte counts.

Another space saving trick I added was a new page control code. The game prints text in windows that don't scroll. To pad out a window, the script has appended line breaks after a lot of sentences. The new page control code eliminates the need for such wasteful padding.

This was added very early in development, but the translation script is in ALL CAPS. This was originally done to make the dictionary compression more effective. It later proved to be necessary because it allowed for every character and dictionary entry to be a byte long. A lot of script files could be expanded a lot due to free space in RAM, but a handful script files couldn't be because they're huge. There's also nowhere else to put the files in memory as far as I'm aware, so an ALL CAPS font is here to stay, unless you want drastic script cuts for a handful of files.

With that being said, the with all these hacks, the script has a lot more room to breathe. The original raw translation was originally cut but such changes have been rolled back. Additionally, TheMajinZenki went through the script to make sure everything was accurate. Additionally, they generously translated the (creepy and awkward) manual for me as well as the hotline flyer.

Admittedly, the menus were more work than adding the tricks to fit the entire script in.

With that being said, thanks so much to everyone involved with the process. I couldn't have done it without you all!

## Translation Changes
* The title screen's 16x16 orange font had to be reduced to 8x8 to mitigate tilemap compression space limitations (it also looks better in my opinion).
* The double-spacing was removed for Miho's Message to fit more text onscreen. The text speed was also increased.
* The double-spacing was removed for the dialogue, again to fit more text onscreen. The text printing is handled by a giant loop function that prints text, menus, etc. It wasn't designed in a way to easily make changes. As a result text is printed by line. This has the side effect of significantly increasing the text speed. However, it also slightly slows down the music. To be fair, this was also a problem in the original game, but it's a bit more noticeable now.
* The "form" screen was adjusted to remove character entry restrictions, upon the suggestion of Pennywise. The save data encoding was also adjusted because of this. As a result, the address field's character limit had to be reduced. Since this screen no longer allows dakutens or handakutens to be entered, this was omitted from the manual.
* The player's name size was increased from 4 to 8, with the assistance of suggestion of Pennywise.
* In the original, you can have a name with trailing whitespaces at the end, which looks ugly. As a result, trailing whitepaces are truncated in this translation.
* Miho is sometimes referred to as Miporin. I assume this is a fan-given name. In any case, it was changed to simply be Miho for better clarity. Same goes for her sometimes referring to herself in third person.
* The translated manual excludes the Disk Fax location pages as there would be *a lot* to translate and type set.

## Changelog
* 2022 June 11th: 1.0 
    * Initial release

## Credits

### Main Team
* FCandChill
    * Project lead
    * Advanced ASM hacking
    * Utilities
    * Proofreader
	* Manual and flyer editing
	* Vectorized version of Graphicus's title screen
* filler
    * Initial script dump
    * Translation
    * Initial hacking and resources
* TheMajinZenki
    * Proofreader
    * Accuracy checks
    * Manual and flyer translator
* Graphicus
    * Title screen

### Support
* Pennywise
    * Some ASM work
    * Guidance / inspiration
* KingMike
    * Hacking
    * Guidance
* Spinner8
    * Hacking
    * Guidance
* Hubz
    * Manual scan from Gaming Alexandria
* Eien Ni Hen
    * On-spot translations
* Tom
    * On-spot translation
* Disch
    * Guidance for address conversion handling

### Beta Testers
* cccmar
* ppltoast
