papermario
Decompilation of Paper Mario
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
msg.c File Reference

Macros

#define MSG_ROM_START   0x1B83000
 
#define CHOICE_POINTER_MOVE_RATE   6.0
 
#define CHAR_SPACE_MULTIPLIER   0.6
 

Typedefs

typedef MessageImageDataMessageImageDataList[1]
 

Enumerations

enum  RewindArrowStates {
  REWIND_ARROW_STATE_INIT = 0 , REWIND_ARROW_STATE_GROW = 1 , REWIND_ARROW_STATE_NEUTRAL = 2 , REWIND_ARROW_STATE_CHANGE_COLOR = 3 ,
  REWIND_ARROW_STATE_CHANGE_COLOR_BACK = 4
}
 

Functions

s32 draw_image_with_clipping (IMG_PTR raster, s32 width, s32 height, s32 fmt, s32 bitDepth, s16 posX, s16 posY, u16 clipULx, u16 clipULy, u16 clipLRx, u16 clipRLy)
 
s32 _update_message (MessagePrintState *printer)
 
void msg_copy_to_print_buffer (MessagePrintState *printer, s32 arg1, s32 arg2)
 
void initialize_printer (MessagePrintState *printer, s32 arg1, s32 arg2)
 
MessagePrintState_msg_get_printer_for_msg (s32 msgID, s32 *donePrintingWriteback, s32 arg2)
 
void msg_update_rewind_arrow (s32)
 
void msg_draw_rewind_arrow (s32)
 
void msg_draw_choice_pointer (MessagePrintState *printer)
 
void draw_message_window (MessagePrintState *printer)
 
void appendGfx_message (MessagePrintState *, s16, s16, u16, u16, u16, u8)
 
void clear_character_set (void)
 
void clear_printers (void)
 
void load_font_data (Addr offset, u16 size, void *dest)
 
void load_font (s32 font)
 
void update_messages (void)
 
void render_messages (void)
 
void msg_play_speech_sound (MessagePrintState *printer, u8 character)
 
void dma_load_msg (u32 msgID, void *dest)
 
s8load_message_to_buffer (s32 msgID)
 
MessagePrintStatemsg_get_printer_for_msg (s32 msgID, s32 *donePrintingWriteback)
 
s32 msg_printer_load_msg (s32 msgID, MessagePrintState *printer)
 
void msg_printer_set_origin_pos (MessagePrintState *msgPrintState, s32 x, s32 y)
 
s32 cancel_message (MessagePrintState *msgPrintState)
 
void set_message_images (MessageImageData *images)
 
void set_message_text_var (s32 msgID, s32 index)
 
void set_message_int_var (s32 value, s32 index)
 
void close_message (MessagePrintState *msgPrintState)
 
s32 msg_get_print_char_width (s32 character, s32 charset, s32 variation, f32 msgScale, s32 overrideCharWidth, u8 flags)
 
s32 msg_get_draw_char_width (s32 character, s32 charset, s32 variation, f32 msgScale, s32 overrideCharWidth, u16 flags)
 
void get_msg_properties (s32 msgID, s32 *height, s32 *width, s32 *maxLineChars, s32 *numLines, s32 *maxLinesPerPage, s32 *numSpaces, u16 charset)
 
s32 get_msg_width (s32 msgID, u16 charset)
 
s32 get_msg_lines (s32 msgID)
 
void draw_msg (s32 msgID, s32 posX, s32 posY, s32 opacity, s32 palette, u8 style)
 
void draw_digit (IMG_PTR img, s32 charset, s32 posX, s32 posY)
 
void draw_number (s32 value, s32 x, s32 y, s32 charset, s32 palette, s32 opacity, u16 style)
 

Variables

Vp D_8014C280
 
u8 MessagePlural [] = { MSG_CHAR_LOWER_S, MSG_CHAR_READ_END }
 
u8 MessageSingular [] = { MSG_CHAR_READ_ENDL, MSG_CHAR_READ_END }
 
s16 gNextMessageBuffer = 0
 
Vtx gRewindArrowQuad []
 
Gfx D_8014C2D8 []
 
s32 gMsgBGScrollAmtX
 
u16 gMsgGlobalWaveCounter
 
MessageImageDataList gMsgVarImages
 
s32 gMsgBGScrollAmtY
 
u8D_8015131C
 
GfxD_80151338
 
IMG_BIN D_80159B50 [0x200]
 
PAL_BIN D_8015C7E0 [0x10]
 
s16 MsgStyleVerticalLineOffsets []
 
IMG_BIN ui_msg_rewind_arrow_png []
 
PAL_BIN ui_msg_rewind_arrow_pal []
 
IMG_BIN ui_msg_star_png []
 
IMG_BIN ui_msg_star_silhouette_png []
 
IMG_BIN MsgCharImgTitle []
 
IMG_BIN MsgCharImgNormal []
 
MessageCharsetMsgCharsets [5]
 
IMG_BIN MsgCharImgSubtitle []
 
PAL_BIN D_802F4560 [80][8]
 
IMG_BIN ui_point_right_png []
 
PAL_BIN ui_point_right_pal []
 
MessageNumber gMsgNumbers []
 
Gfx gMsgDlistInitDrawNumber []
 
s32 gItemIconRasterOffsets []
 
s32 gItemIconPaletteOffsets []
 
IMG_PTR MsgLetterRasterOffsets []
 
PAL_PTR MsgLetterPaletteOffsets []
 
MsgVoice MsgVoices []
 

Macro Definition Documentation

◆ CHAR_SPACE_MULTIPLIER

#define CHAR_SPACE_MULTIPLIER   0.6

◆ CHOICE_POINTER_MOVE_RATE

#define CHOICE_POINTER_MOVE_RATE   6.0

Referenced by msg_draw_choice_pointer().

◆ MSG_ROM_START

#define MSG_ROM_START   0x1B83000

Referenced by dma_load_msg().

Typedef Documentation

◆ MessageImageDataList

typedef MessageImageData* MessageImageDataList[1]

Enumeration Type Documentation

◆ RewindArrowStates

Enumerator
REWIND_ARROW_STATE_INIT 
REWIND_ARROW_STATE_GROW 
REWIND_ARROW_STATE_NEUTRAL 
REWIND_ARROW_STATE_CHANGE_COLOR 
REWIND_ARROW_STATE_CHANGE_COLOR_BACK 

Function Documentation

◆ _msg_get_printer_for_msg()

MessagePrintState * _msg_get_printer_for_msg ( s32 msgID,
s32 * donePrintingWriteback,
s32 arg2 )

Referenced by msg_get_printer_for_msg().

◆ _update_message()

s32 _update_message ( MessagePrintState * printer)

Referenced by update_messages().

◆ appendGfx_message()

void appendGfx_message ( MessagePrintState * printer,
s16 posX,
s16 posY,
u16 additionalOffsetX,
u16 additionalOffsetY,
u16 flag,
u8 alpha )

◆ cancel_message()

s32 cancel_message ( MessagePrintState * msgPrintState)

Referenced by cancel_current_message().

◆ clear_character_set()

void clear_character_set ( void )

Referenced by load_engine_data().

◆ clear_printers()

◆ close_message()

void close_message ( MessagePrintState * msgPrintState)

◆ dma_load_msg()

◆ draw_digit()

void draw_digit ( IMG_PTR img,
s32 charset,
s32 posX,
s32 posY )

Referenced by draw_number().

◆ draw_image_with_clipping()

s32 draw_image_with_clipping ( IMG_PTR raster,
s32 width,
s32 height,
s32 fmt,
s32 bitDepth,
s16 posX,
s16 posY,
u16 clipULx,
u16 clipULy,
u16 clipLRx,
u16 clipRLy )

Referenced by msg_draw_choice_pointer().

◆ draw_message_window()

void draw_message_window ( MessagePrintState * printer)

Referenced by render_messages().

◆ draw_msg()

void draw_msg ( s32 msgID,
s32 posX,
s32 posY,
s32 opacity,
s32 palette,
u8 style )

◆ draw_number()

◆ get_msg_lines()

◆ get_msg_properties()

void get_msg_properties ( s32 msgID,
s32 * height,
s32 * width,
s32 * maxLineChars,
s32 * numLines,
s32 * maxLinesPerPage,
s32 * numSpaces,
u16 charset )

◆ get_msg_width()

s32 get_msg_width ( s32 msgID,
u16 charset )

◆ initialize_printer()

void initialize_printer ( MessagePrintState * printer,
s32 arg1,
s32 arg2 )

◆ load_font()

void load_font ( s32 font)

Referenced by clear_printers().

◆ load_font_data()

void load_font_data ( Addr offset,
u16 size,
void * dest )

◆ load_message_to_buffer()

s8 * load_message_to_buffer ( s32 msgID)

◆ msg_copy_to_print_buffer()

void msg_copy_to_print_buffer ( MessagePrintState * printer,
s32 arg1,
s32 arg2 )

Referenced by _update_message(), and draw_msg().

◆ msg_draw_choice_pointer()

void msg_draw_choice_pointer ( MessagePrintState * printer)

Referenced by render_messages().

◆ msg_draw_rewind_arrow()

void msg_draw_rewind_arrow ( s32 printerIndex)

Referenced by render_messages().

◆ msg_get_draw_char_width()

s32 msg_get_draw_char_width ( s32 character,
s32 charset,
s32 variation,
f32 msgScale,
s32 overrideCharWidth,
u16 flags )

Referenced by appendGfx_message(), and msg_get_glyph().

◆ msg_get_print_char_width()

s32 msg_get_print_char_width ( s32 character,
s32 charset,
s32 variation,
f32 msgScale,
s32 overrideCharWidth,
u8 flags )

◆ msg_get_printer_for_msg()

◆ msg_play_speech_sound()

void msg_play_speech_sound ( MessagePrintState * printer,
u8 character )

◆ msg_printer_load_msg()

s32 msg_printer_load_msg ( s32 msgID,
MessagePrintState * printer )

◆ msg_printer_set_origin_pos()

void msg_printer_set_origin_pos ( MessagePrintState * msgPrintState,
s32 x,
s32 y )

◆ msg_update_rewind_arrow()

void msg_update_rewind_arrow ( s32 printerIndex)

Referenced by render_messages().

◆ render_messages()

void render_messages ( void )

Referenced by gfx_draw_frame().

◆ set_message_images()

void set_message_images ( MessageImageData * images)

◆ set_message_int_var()

◆ set_message_text_var()

◆ update_messages()

void update_messages ( void )

Referenced by step_game_loop().

Variable Documentation

◆ D_8014C280

Vp D_8014C280
Initial value:
= {
.vp = {
.vscale = {640, 480, 511, 0},
.vtrans = {640, 480, 511, 0},
}
}

Referenced by render_messages().

◆ D_8014C2D8

◆ D_8015131C

u8* D_8015131C

◆ D_80151338

Gfx* D_80151338

◆ D_80159B50

IMG_BIN D_80159B50[0x200]

◆ D_8015C7E0

PAL_BIN D_8015C7E0[0x10]

◆ D_802F4560

PAL_BIN D_802F4560[80][8]
extern

Referenced by draw_number(), and load_font().

◆ gItemIconPaletteOffsets

s32 gItemIconPaletteOffsets[]
extern

◆ gItemIconRasterOffsets

s32 gItemIconRasterOffsets[]
extern

◆ gMsgBGScrollAmtX

s32 gMsgBGScrollAmtX

◆ gMsgBGScrollAmtY

s32 gMsgBGScrollAmtY

◆ gMsgDlistInitDrawNumber

◆ gMsgGlobalWaveCounter

u16 gMsgGlobalWaveCounter

◆ gMsgNumbers

MessageNumber gMsgNumbers[]

Referenced by draw_digit(), and draw_number().

◆ gMsgVarImages

MessageImageDataList gMsgVarImages

Referenced by set_message_images().

◆ gNextMessageBuffer

s16 gNextMessageBuffer = 0

Referenced by load_message_to_buffer().

◆ gRewindArrowQuad

Vtx gRewindArrowQuad[]
Initial value:
= {
{ .v = { .ob = { 0xFFF0, 0x0009, 0x0000 }, .tc = { 0x0000, 0x0000 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}},
{ .v = { .ob = { 0x0010, 0x0009, 0x0000 }, .tc = { 0x0400, 0x0000 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}},
{ .v = { .ob = { 0xFFF0, 0xFFF7, 0x0000 }, .tc = { 0x0000, 0x0240 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}},
{ .v = { .ob = { 0x0010, 0xFFF7, 0x0000 }, .tc = { 0x0400, 0x0240 }, .cn = { 0xFF, 0xFF, 0xFF, 0xFF }}},
}

Referenced by msg_update_rewind_arrow().

◆ MessagePlural

◆ MessageSingular

◆ MsgCharImgNormal

IMG_BIN MsgCharImgNormal[]
extern

Referenced by load_font().

◆ MsgCharImgSubtitle

IMG_BIN MsgCharImgSubtitle[]
extern

Referenced by load_font().

◆ MsgCharImgTitle

IMG_BIN MsgCharImgTitle[]
extern

Referenced by load_font().

◆ MsgCharsets

◆ MsgLetterPaletteOffsets

PAL_PTR MsgLetterPaletteOffsets[]
extern

◆ MsgLetterRasterOffsets

IMG_PTR MsgLetterRasterOffsets[]
extern

◆ MsgStyleVerticalLineOffsets

s16 MsgStyleVerticalLineOffsets[]
extern

◆ MsgVoices

MsgVoice MsgVoices[]
extern

◆ ui_msg_rewind_arrow_pal

PAL_BIN ui_msg_rewind_arrow_pal[]
extern

Referenced by msg_draw_rewind_arrow().

◆ ui_msg_rewind_arrow_png

IMG_BIN ui_msg_rewind_arrow_png[]
extern

Referenced by msg_draw_rewind_arrow().

◆ ui_msg_star_png

IMG_BIN ui_msg_star_png[]
extern

Referenced by msg_update_rewind_arrow().

◆ ui_msg_star_silhouette_png

IMG_BIN ui_msg_star_silhouette_png[]
extern

Referenced by msg_update_rewind_arrow().

◆ ui_point_right_pal

PAL_BIN ui_point_right_pal[]
extern

Referenced by msg_draw_choice_pointer().

◆ ui_point_right_png

IMG_BIN ui_point_right_png[]
extern

Referenced by msg_draw_choice_pointer().