Mario no Photopi English Localization Patch

  Mario's Photo Studio (or Mario no Photopi) is a photo editor and print design software.
  It allows adding frames, clipart, licensed content, text, and personal drawings to photographs.  The result can be printed by creating an FDI (Fujifilm digital image) print request you can take to a Fujifilm print studio or specialized kiosk.

  It is +not+ in any way related to the Mario Artist titles on 64DD, and has nothing to do with the disk drive.  It also has nothing to do with SD cards.

  This uses SmartMedia cards, also known as Solid State Floppy Disk Cards.  They were commonly used in digital cameras and other devices until roughly the mid-naughts.
  Among its more interesting features, supplemental SM cards can extend the frames (.frm), clipart (.clp), and characters (.ang) available in the studio menus.  The ANG files use an encryption called "crypto capsule", preventing direct copying without low-level page copying.  They are decrypted at a hardware level.


Patching:
  Two patches are provided.  One does not alter the original clipart ("Mario's Photo Studio (USA) (old art).xdelta", and the other provides (most) clipart in English ("Mario's Photo Studio (USA).xdelta").  Use one or the other.  You can't apply both.
  Patches will only apply to a ROM in native byte order (big-endian).  Attempting to patch something else will result in a completely unhelpful checksum error.  Xdelta patches can be applied with the aptly-named xdelta patcher.
  The SHA-512 for the original file, padded high to the nearest viable chip size would be:
37A5A1B2FD992808716257B60E57DA5AD28093C8159B567B4CD7AD9054EC2F93036F5811CB83BB520E75C8ED9C4FE898A9F4F53B78458C739BA492B2BC96D525

  ** Please note that at the time of release for this patch no emulator supports the SmartMedia drive. **
  ** Modern flashcarts do not support it either. **
  The only reasonable methods require using an original cart.  You can either use a passthrough method such as the old Bung backup units or (haha) attempt to switch out the MaskROM on its board.  The patch has been tested on console with a Doctor V64jr.
  A video of the translation running on hardware can (hopefully) be found at:
  https://youtu.be/Hez01E_uGdk


General Usage Notes:
  SmartMedia cards must be 3.3v, 2MBs to 16MBs, and FAT12 or FAT16.  Page sizes must be 512 bytes.  You absolutely can not remove cards before turning off the power.
  If we're to trust the manual, JPEG / JFIF using Exif 1.0/1.1/2.0/2.1 under 200KB should be acceptable.  The extension must be .jpg.  Be aware this was released in 1998 so encodings or features added to the specification at a later date (lossless encoding for instance) are not supported.

  There is a distinction between "photos" and "works".  Photos are .jpgs you provide.  Works are what you create in the Studio.
  Studio and Gallery appear to only find photos in the root directory, though they may only be occluding certain directory names.  Other rooms can find any JPEGs on your card, including those generated for DPE requests.  The DPE Print Center only uses works.

  The Studio can only be accessed if you have at least 500KBs of free space on a card.  WARNING: it uses your disk as a scratchpad.

  What you see in the Studio is a lie.
  The Studio framebuffer is 320x240, but the viewing window is slightly smaller.  Your image--regardless its size or magnification--will be scaled with a fast, lossy algo.  The end result is a pixelated mess that does not accurately represent output.
  The composites created in the Gallery and DPE are more accurate representations using double precision blending.  These are true composites; works are stored as original images losslessly and scaling / position information as necessary.

  B opens and closes the menu.  You must close the menu to edit the frame.
  Hover over a tool or tab name for a couple seconds to display a tooltip.  The user-defined palette erroneously does not display a tooltip, though one exists.
  The tools available depend on the type of layer in use.  Adjust tools can only be used on Photo layers, drawing tools on Graffiti layers, color and text on text layers.  The background color is shared for the entire work.  The File menu is where you load clipart, frames, and characters.  The right-most Studio menu manages tabs and allows changing their type.
  Clipart can be freely resized by moving the four coins in its corners.  The entire image can be moved by grabbing it inside the four coins.  B sets the image, and A allows picking it back up again.  Only one clipart can be used in a single layer.
  Frames, regardless their original shape, will automatically stick to the outer edges of the image.
  Character layers can only be the top-most layer.  They can only be used with 3R and Postcard sized works, not Other (640x480) works.  Unlike clipart they cannot be resized and cannot use transparency.  However, like clipart you can only use one image per layer, so yes, you can only use one character in a work max.  External character art (.ang files) are specially-handled.

  Text layers are...odd.
  Text scaled below a certain threshhold is not displayed in the Studio window, only placeholder blocks.  It can be resized and repositioned like clipart using the four coins.  It will display correctly in the Gallery.
  The text editor is also peculiar.  Text is written left-to-right, top-to-bottom.  Each character advances the field, and the shift arrows effectively add a space and offset all glyphs in the indicated direction.  It's not intuitive, at all.
  The layout screen is also an editor.  Besides viewing how the text has been mutilated you can highlight lines or blocks of text and drag-&-drop them in other portions of the space.

  External Clipart (.clp), frames (.frm), and characters (.ang) files must be stored with 8.3 filenames in the root directory.  The situation's a bit crazy.
  The Studio can find the files just fine regardless the filename length.  However, when saved as a work the filenames are reduced to 8.3 filenames using the typical pattern ("Too_Lo^1.ext").  The file is copied and the extension changed to signify the type of layer--or it would be if the filename isn't changed.
  Instead of copying "too_long_name.clp" as "too_lo^1.ppc" as expected, it attempts to copy a nonexistant "too_lo^1.clp".  This fails but it's not fatal.  However, it does prevent that layer getting composited in DPE and prevents viewing it altogether in the Gallery.

  The DPE (Digital Photo Export) Output Center, somewhat renamed, generates 72dpi JPEG images from your works.  (Yes, inches, and yes 72 and not 300.  Check the EXIF.)  Usually ;*)
  There are three types of requests that can be generated.
  1) As many Other sized works (640x480) as you can fit on the card can be made at one time.  The minimum count is 1.  These are "home print" requests, and although a home printer technically could print them the intention was a self-serve print station or specialized kiosks.
  In actual fact, each composite will be stored in the /IMTFN64B folder and can be printed off on your home printer.
  2) 3R or Postcard sized prints that do not use external .ang files generate an FDI print request.  The minimum count is 10 prints.  The print portion of the FDI request pregenerated as well, but--at least at first--you'd still need to fill out paperwork with your shipping address, telephone number in case of an issue, and most likely all the information already completed in the generated print request.  The final prints are exactly that: prints on photo paper.
  These are also pre-composited and stored in the /IMTFN64B folder.  Only one can be created at a time, probably to prevent confusion on the printer's end.
  3) 3R or Postcard sized prints that use external .ang files are a different matter.  These can only be printed from specialized services like Digipri kiosks or participating Fujifilm print centers.  They're equipped to read the encrypted JPEG portion of the .ang file.
  In this case, all but the top-most layer is precomposited.  The .ang is layered on by the print service.  Only one can be created at a time.
  4) The fourth, unused type is a 640x480 work utilizing .ang files, but this shouldn't be possible to create.

  Options set in the Options menu are not stored.  There is no on-board eeprom and the removable nature of SmartMedia cards undermines the notion of perpetual settings.

  The other rooms should be easy enough to muddle through.  The Slideshow editor also has tooltips if you hover over most options.


Elsewise:
  *) The card copy debug feature has been moved from holding all + pad buttons at boot to holding all C-buttons.  Holding A in addition to these buttons copies from card 2 to 1 instead.  Use at your own risk.
  *) There are a plethora of technical reasons modern flashcarts would be better off trying to support mapping virtual floppy disk dumps than letting this touch its SD card directly, but what would I know.
  *) This is, quite possibly, the only title on the system that has no credits whatsoever.
  *) If you know what you're doing, the APP1 field can contain a simple binary mask, either raw or RLE encoded.  Tag 0x823 gives the width, 0x824 the height, 0x840 indicates if it's compressed, 0x841 the length in bytes, and 0x842 the bitfield itself.
  *) I have no intention of interjecting the "shareware trial mode" patch into this release.  Translating something nobody is interested in and will never use is one thing, but it would be a herculean task attempting to explain what use photo editing software is when it can neither save nor load photos.  You can bother its creator if you like.
  *) There were a total of ten supplemental cards that were released over the next year containing 20-30 additional images each.  With any luck these will also be preserved for the future at, say, archive.org.  If you possess an undumped card and need assistance creating a backup please get in touch.  (I'm personally interested in the Cardcaptor Sakura one wink wink nudge nudge.)

-Zoinkity
