Tutorial: Restore Yen (Monetary) Sign to After Money Sum - pret/pokered GitHub Wiki

The original Japanese games put the 円 sign AFTER money sums, the English release puts ₽ (poke rubles) BEFORE money. This tutorial restores the money symbol to its original position.

image

Optional: 1) Go to: pokered (main folder) /gfx/font/font.png

Edit your font.png to replace ₽ with 円 if you want. You can redraw it in an image editor, or grab the original Japanese one from my file here:

image

NOTE! 1) Some emulators change the 円 sign to look THICKER than it really is, and you may think there is a font problem but there isn’t. 2) The entire Japanese alphabet, including numbers and yen sign, are on the very BOTTOM row. The entire English alphabet, including numbers and money sign, are ONE PIXEL up from the bottom.

Example below: The emulator running the Japanese game has artificially thickened the 円, it is the exact same 円 as in the English. In the English pic the English 円 is on the same line as the Japanese, it was not moved up one pixel to suit the English alphabet.

image

  1. Go to: pokered (main folder) /engines/menu/start_sub_menus.asm

This is the amount of money you own on the trainer card.

Remove (or comment out by putting ; at the start of the line) the lines in red below that start with -, and copy-paste into your code the lines in green that start with + below. Delete the - and + symbols themselves or the code will give errors (this type of code uses the blank space at the front of the line as a place to put code labels, but - and + are not code labels so they will cause errors).

	ld de, wPlayerMoney
+; start code to put yen sign after money on trainer cards screen
-	ld c, $e3 deleting this line WITHOUT replacing it with c3 below causes numbers to run on after the money amount and overflow onto other graphics!
+	ld c, $c3 ; hides money sign in front of sum on trainer card, seemingly without breaking anything - taken from pokered-jp
	call PrintBCDNumber ; prints sum of money on the trainer card
+	ld a, $f0 ; Loads the tile ID number for yen ("f0", viewable via right-clicking on an open rom, options > VRAM viewer in GBG emulator, also appears in charmap.asm)
+	ld [hl], a ; places (prints) the tile for yen directly after the printed BCD number, so we see it onscreen
+; end code to put yen after money in trainer card screen
	hlcoord 9, 6
	ld de, wPlayTimeHours ; hours
  1. Go to: /engine/menus/text_box.asm

This is the "money box" that shows how much money you currently own, on the top-right of shop screens.

	call ClearScreenArea
	hlcoord 12, 1
	ld de, wPlayerMoney
-	ld c, $a3
+	ld c, $83; value $83 obtained from pokered-jp. replacing with $a3 moves money digits + yen sign to far right of money box instead of far left.
	call PrintBCDNumber
+; After printing the BCD number (sum of player's owned money in shop money box), print the yen symbol
+	ld a, $f0  ; Loads the tile ID number for yen ($f0 in charmap) into register a
+	ld [hl], a ; places (prints) the tile for yen directly after the printed BCD number, so we see it onscreen
	ld hl, wd730
	res 6, [hl]
	ret
  1. pokered main folder/home/list_menu.asm

This is the prices put on items in shops.

.printItemPrice
	push hl
	ld a, [de]
	ld de, ItemPrices
	ld [wcf91], a
	call GetItemPrice ; get price
	pop hl
	ld bc, SCREEN_WIDTH + 5 ; 1 row down and 5 columns right
	add hl, bc
-	ld c, $a3 ; no leading zeroes, right-aligned, print currency symbol, 3 bytes
+	ld c, $83 ; remove yen sign from in front of item prices in item list in shop
	call PrintBCDNumber ; get item price
+	ld a, $f0 ; load value for yen sign ($f0 in charmap.asm)
+	ld [hl], a ; print yen sign directly after price
.skipPrintingItemPrice
............
.skipHalvingPrice
	hlcoord 12, 10
	ld de, SpacesBetweenQuantityAndPriceText
	call PlaceString
	ld de, hMoney ; total price
; move money sign on total price when buying/selling shop items, from before sum to after sum
-	ld c, $a3
+	ld c, $83 ; remove yen sign from in front of item prices in item list in shop
	call PrintBCDNumber ; get item price
+	ld a, $f0 ; load value for yen sign ($f0 in charmap.asm)
+	ld [hl], a ; print yen sign directly after price
	hlcoord 9, 10
.printQuantity
  1. Go to: pokered (home folder) /scripts/GameCorner.asm

This is the money & coin box in the game corner (this code is untested, feel free to test and correct it):

call PlaceString
	hlcoord 12, 3
	ld de, wPlayerMoney
-	ld c, 3 | MONEY_SIGN | LEADING_ZEROES
+	ld c, 3 | LEADING_ZEROES
	call PrintBCDNumber
+	ld a, $f0
+	ld [hl], a
	hlcoord 12, 4
	ld de, GameCornerCoinText
	call PlaceString

All the other ones are just plain text, or text with code in front. As defined in pokered (main folder) > charmap.asm by default, the money symbol is typed as ¥ in game text (but not all ¥s in the files are money symbols! the \ sign also turns into ¥ in some files).

In dialog boxes ¥ often comes before @ (to look like "¥@") where @ can mark the code pointing to the next line under it, which is a calculation or some other event. The easiest way anything in your files is to set up a github for your project and use it to search. Here are the changes:

6) pokered (main folder)/text/Daycare.asm

_DaycareGentlemanOweMoneyText::
-	text "You owe me ¥@"
+	text "You owe me @" ; we can't write @¥ to put the yen sign after the money sum as the @ points to the calculated or retrieved and formatted variable (non-text) in the line of code directly below. If we write @¥ the ¥ sign will disappear or things will glitch up the game
	text_bcd wDayCareTotalCost, 2 | LEADING_ZEROES | LEFT_ALIGN
-	text_start
+	text "¥" ; the "text" command continues text on the SAME line as the previous one if there was one, so this prints ¥ directly after the monetary calculation @.
	line "for the return"
  1. (pokered main folder) /data/text/text_4.asm
_PokemartTellBuyPriceText::
	text_ram wStringBuffer
	text "?"
	line "That will be"
-	cont "¥@"
+	cont "@"
	text_bcd hMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
-	text ". OK?"
+	text "¥. OK?"
	done
......
_PokemartTellSellPriceText::
	text "I can pay you"
-	line "¥@"
+	line "@"
	text_bcd hMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
-	text " for that."
+	text "¥ for that."
	done
  1. pokered main folder /data/text/text_2.asm
_MoneyForWinningText::
-	text "<PLAYER> got ¥@"
+	text "<PLAYER> got @"
	text_bcd wAmountMoneyWon, 3 | LEADING_ZEROES | LEFT_ALIGN
-	text_start
+	text "¥" ; TEXT prints what comes next on the same line as the previous line of text, regardless of if there were calculations or not
	line "for winning!"
........
_PickUpPayDayMoneyText::
	text "<PLAYER> picked up"
-	line "¥@"
+	line "@"
	text_bcd wTotalPayDayMoney, 3 | LEADING_ZEROES | LEFT_ALIGN
-	text "!"
+	text "¥!"
  1. The remaining files to search for and change the location of ¥ in are literally just text:
  • text/Museum1F.asm
  • text/PewterMart.asm
  • text/LavenderMart.asm
  • text/SafariZoneGate.asm
  • text/MtMoonPokecenter.asm
  • text/RockTunnelPokecenter.asm
  • engine/events/vending_machine.asm
  • text/GameCorner.asm
  1. pokered main folder /scripts/BikeShop.asm

It's easy to get tricked by this last one because it has an @. It's just plain text, the @ is not a monetary calculation.

BikeShopMenuPrice:
-	db "¥1000000@"
+	db "1000000¥@"

You should now have all prices and money in the game, showing with the currency symbol behind the money sum instead of before it.

⚠️ **GitHub.com Fallback** ⚠️