MCPcopy Create free account
hub / github.com/doldecomp/mkdd / readBmg

Function readBmg

src/Kameda/ReadPrintMessage.cpp:31–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 }
30
31 void readBmg(void *bmgPtr)
32 {
33#line 58
34 JUT_ASSERT(bmgPtr != 0);
35
36 Header *headerPtr = (Header *)bmgPtr;
37 Block *blockPtr = (Block *)(headerPtr + 1);
38
39 JUT_ASSERT(headerPtr->signature == 'MESG');
40 JUT_ASSERT(headerPtr->dataType == 'bmg1');
41 // JUT_ASSERT(headerPtr->dataSize == 1088);
42
43 JUT_ASSERT(headerPtr->numBlocks <= 2);
44
45 for (int i = 0; i < headerPtr->numBlocks; i++)
46 {
47 Block *curBlock = blockPtr;
48 blockPtr = (Block *)((u8 *)blockPtr + blockPtr->size);
49 switch (curBlock->kind)
50 {
51 case BLOCK_KIND_INF:
52 mInfoPtr = (Inf *)curBlock;
53 break;
54 case BLOCK_KIND_DAT:
55 mDataPtr = curBlock;
56 break;
57 default:
58#line 80
59 JUT_ASSERT(0);
60 }
61 }
62 }
63
64 u8 getDefaultColor(void *bmgPtr)
65 {

Callers 4

getDefaultColorFunction · 0.85
getRateFunction · 0.85
getCharSpaceFunction · 0.85
getMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected