wavelength 1.0.0
Loading...
Searching...
No Matches
shiftjis.h File Reference

Go to the source code of this file.

Classes

struct  ShiftJisSymbol
 One ASCII symbol and its full-width Shift-JIS code. More...
struct  ShiftJisRange
 One run of consecutive characters that maps linearly. More...

Functions

unsigned short EncodeShiftJisCharacter (unsigned char cAscii)
 Convert one ASCII character to its full-width Shift-JIS code.
void AsciiToShiftJis (const char *pszAscii, char *pszDest)
 Convert ASCII text to the Shift-JIS bytes icon.sys stores a title as.

Variables

constexpr int kShiftJisSymbolCount = 33
 Punctuation pairs in g_aShiftJisSymbols, one for each printable ASCII symbol.
constexpr int kShiftJisRangeCount = 3
 Runs in g_aShiftJisRanges: the digits, the capital letters, and the small letters.
const ShiftJisSymbol g_aShiftJisSymbols [kShiftJisSymbolCount+1]
 The ASCII punctuation from space to tilde in ASCII order, followed by one zero entry.
const ShiftJisRange g_aShiftJisRanges [kShiftJisRangeCount]
 The digit, capital, and small-letter runs, based at 0x824f, 0x8260, and 0x8281.

Function Documentation

◆ EncodeShiftJisCharacter()

unsigned short EncodeShiftJisCharacter ( unsigned char cAscii)

Convert one ASCII character to its full-width Shift-JIS code.

A code outside space to tilde is reported through the log as bad ASCII code 0xx. The title is inferred.

Parameters
cAsciiThe character.
Returns
The two-byte code, lead byte high, or zero for a character outside the tables.
Ghidra address:
NTSC-U/C: 0x0029e518
Ghidra address:
PAL: 0x002a81e0

◆ AsciiToShiftJis()

void AsciiToShiftJis ( const char * pszAscii,
char * pszDest )

Convert ASCII text to the Shift-JIS bytes icon.sys stores a title as.

Every character becomes two bytes, lead byte first, and two zero bytes end the result. MCCreateSaveDirTask is its only caller, and the title is inferred from that use.

Parameters
pszAsciiThe text to convert.
pszDestThe destination, of at least twice the text length plus two bytes.
Ghidra address:
NTSC-U/C: 0x0029e628
Ghidra address:
PAL: 0x002a82f0

Variable Documentation

◆ kShiftJisSymbolCount

int kShiftJisSymbolCount = 33
constexpr

Punctuation pairs in g_aShiftJisSymbols, one for each printable ASCII symbol.

◆ kShiftJisRangeCount

int kShiftJisRangeCount = 3
constexpr

Runs in g_aShiftJisRanges: the digits, the capital letters, and the small letters.

◆ g_aShiftJisSymbols

const ShiftJisSymbol g_aShiftJisSymbols[kShiftJisSymbolCount+1]
extern

The ASCII punctuation from space to tilde in ASCII order, followed by one zero entry.

Ghidra address:
NTSC-U/C: 0x003b2430
Ghidra address:
PAL: 0x004312f0

◆ g_aShiftJisRanges

const ShiftJisRange g_aShiftJisRanges[kShiftJisRangeCount]
extern

The digit, capital, and small-letter runs, based at 0x824f, 0x8260, and 0x8281.

Ghidra address:
NTSC-U/C: 0x003b24b8
Ghidra address:
PAL: 0x00431378