summaryrefslogtreecommitdiff
path: root/src/d/d_bg_plc.cpp
blob: 00d3ef1eb3477c6efdeca224d4403056d85fa339 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "d/dolzel.h" // IWYU pragma: keep

#include "d/d_bg_plc.h"
#include "JSystem/JUtility/JUTAssert.h"

dBgPlc::dBgPlc() {
    m_base = NULL;
}

dBgPlc::~dBgPlc() {}

void dBgPlc::setBase(void* pbase) {
    m_base = (sBgPlc*)pbase;
}

sBgPc* dBgPlc::getCode(int index, sBgPc** ppcode) const {
    JUT_ASSERT(45, m_base != NULL);
    JUT_ASSERT(46, m_base->m_code_size == ZELDA_CODE_SIZE);
    JUT_ASSERT(47, index >= 0 && index< m_base->m_num);
    sBgPc* code = m_base->m_code;
    code += index;

    *ppcode = code;
    return code;
}

u32 dBgPlc::getGrpCode(int index) const {
    JUT_ASSERT(62, m_base != NULL);
    JUT_ASSERT(63, m_base->m_code_size == ZELDA_CODE_SIZE);
    JUT_ASSERT(64, 0 <= index && index < m_base->m_num);
    sBgPc* code = m_base->m_code;
    code += index;

    return code->code4;
}