Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
msg.h File Reference

Go to the source code of this file.

Functions

s32 msg_get_print_char_width (s32 character, s32 charset, s32 variation, f32 msgScale, s32 overrideCharWidth, u8 flags)
 
void msg_get_glyph (s32 font, s32 variation, s32 charIndex, s32 palette, MesasgeFontGlyphData *out)
 
void dma_load_msg (u32 msgID, void *dest)
 

Function Documentation

◆ msg_get_print_char_width()

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

Definition at line 1584 of file msg.c.

1584 {
1585 f32 charWidth;
1586
1591 return 0;
1592 }
1593
1594#if VERSION_IQUE
1596 charWidth = 16.0;
1597 return charWidth * msgScale;
1598 }
1599#endif
1600
1601 if (overrideCharWidth != 0) {
1602 charWidth = overrideCharWidth;
1603 } else if (flags != 0) {
1604 u8* charWidthTable = MsgCharsets[charset]->rasters[variation].charWidthTable;
1605
1606 if (charWidthTable != NULL
1610 charWidth = charWidthTable[character];
1611 } else {
1612 charWidth = MsgCharsets[charset]->rasters[variation].monospaceWidth;
1613 }
1614 } else {
1615 charWidth = MsgCharsets[charset]->rasters[variation].monospaceWidth;
1616 }
1617
1619 return charWidth * msgScale * CHAR_SPACE_MULTIPLIER;
1620 }
1622 f64 retWidth = charWidth * msgScale;
1623 return retWidth;
1624 }
1626 return charWidth * msgScale * 0.5;
1627 }
1628 if (character >= MSG_CONTROL_CHAR) {
1629 return 0;
1630 }
1631 return charWidth * msgScale;
1632}
BSS s32 PopupMenu_SelectedIndex
MessageCharData * rasters
s8 flags
Definition demo_api.c:15
@ MSG_CHAR_READ_HALF_SPACE
Definition enums.h:6051
@ MSG_CHAR_READ_SPACE
Definition enums.h:6049
@ MSG_CHAR_READ_FULL_SPACE
Definition enums.h:6050
@ MSG_CONTROL_CHAR
Definition enums.h:6060
MessageCharset * MsgCharsets[5]
Definition msg_data.c:865
#define CHAR_SPACE_MULTIPLIER
Definition msg.c:1581

Referenced by get_msg_properties().

◆ msg_get_glyph()

void msg_get_glyph ( s32 font,
s32 variation,
s32 charIndex,
s32 palette,
MesasgeFontGlyphData * out )

Definition at line 2279 of file msg_draw.c.

2279 {
2280 out->raster = &MsgCharsets[font]->rasters[variation].raster[(u16)MsgCharsets[font]->charRasterSize * charIndex];
2281 out->palette = D_802F4560[palette];
2282 out->texSize.x = MsgCharsets[font]->texSize.x;
2283 out->texSize.y = MsgCharsets[font]->texSize.y;
2284 out->charWidth = msg_get_draw_char_width(charIndex, font, variation, 1.0f, 0, 0);
2285 out->charHeight = out->texSize.y;
2286}
s32 msg_get_draw_char_width(s32 character, s32 charset, s32 variation, f32 msgScale, s32 overrideCharWidth, u16 flags)
Definition msg.c:1634
PAL_BIN D_802F4560[80][8]
MessageCharset * MsgCharsets[5]
Definition msg_data.c:865

◆ dma_load_msg()

void dma_load_msg ( u32 msgID,
void * dest )

Definition at line 1402 of file msg.c.

1402 {
1403 u8* addr = (u8*) MSG_ROM_START + (msgID >> 14); // (msgID >> 16) * 4
1404 u8* offset[2]; // start, end
1405
1406 dma_copy(addr, addr + 4, &offset[0]); // Load section offset
1407
1408 addr = MSG_ROM_START + offset[0] + (msgID & 0xFFFF) * 4;
1409 dma_copy(addr, addr + 8, &offset); // Load message start and end offsets
1410
1411 // Load the msg data
1412 dma_copy(MSG_ROM_START + offset[0], MSG_ROM_START + offset[1], dest);
1413}
u32 dma_copy(Addr romStart, Addr romEnd, void *vramDest)
Definition 43F0.c:442
#define MSG_ROM_START
Definition msg.c:23

Referenced by draw_msg(), get_msg_properties(), load_message_to_buffer(), and set_message_text_var().