This also parses, generates, and displays nidoran male/female name strings correctly.
93 lines
3.0 KiB
C++
93 lines
3.0 KiB
C++
#pragma once
|
|
|
|
#include "coordinates.hpp"
|
|
#include "start_size.hpp"
|
|
#include "render_map.hpp" // for cell_offset
|
|
#include "vdp2.h"
|
|
|
|
#include "pokemon_instance.hpp"
|
|
|
|
struct interactive {
|
|
static constexpr uint8_t l_arrow = 0x75; // →
|
|
static constexpr uint8_t l_arrow_solid = 0x76; // →
|
|
static constexpr uint8_t d_arrow = 0x77; //
|
|
};
|
|
|
|
struct dialog_border {
|
|
static constexpr uint8_t corner_top_left = 105;
|
|
static constexpr uint8_t corner_top_right = 106;
|
|
static constexpr uint8_t corner_bottom_left = 107;
|
|
static constexpr uint8_t corner_bottom_right = 108;
|
|
static constexpr uint8_t vertical_end_cap = 109;
|
|
static constexpr uint8_t vertical = 110;
|
|
static constexpr uint8_t horizontal = 111;
|
|
};
|
|
|
|
struct battle_border {
|
|
static constexpr uint8_t horizontal = 96;
|
|
static constexpr uint8_t corner_bottom_right = 97;
|
|
static constexpr uint8_t arrow_right = 98;
|
|
static constexpr uint8_t vertical = 99;
|
|
static constexpr uint8_t corner_bottom_left = 100;
|
|
static constexpr uint8_t three_dots = 101;
|
|
static constexpr uint8_t vertical_end_cap = 102;
|
|
static constexpr uint8_t level = 103;
|
|
static constexpr uint8_t arrow_left = 104;
|
|
};
|
|
|
|
struct hp_bar {
|
|
static constexpr uint8_t hp = 0x50;
|
|
static constexpr uint8_t start_cap = 0x51;
|
|
static constexpr uint8_t seg0 = 0x52;
|
|
static constexpr uint8_t seg1 = 0x53;
|
|
static constexpr uint8_t seg2 = 0x54;
|
|
static constexpr uint8_t seg3 = 0x55;
|
|
static constexpr uint8_t seg4 = 0x56;
|
|
static constexpr uint8_t seg5 = 0x57;
|
|
static constexpr uint8_t seg6 = 0x58;
|
|
static constexpr uint8_t seg7 = 0x59;
|
|
static constexpr uint8_t seg8 = 0x5a;
|
|
static constexpr uint8_t end_cap_nobar = 0x5b;
|
|
static constexpr uint8_t end_cap_bar = 0x66;
|
|
};
|
|
|
|
struct stats {
|
|
static constexpr uint8_t id = 0x70; // ID
|
|
static constexpr uint8_t no = 0x71; // No
|
|
static constexpr uint8_t no_dot = 0x4e; // .
|
|
};
|
|
|
|
static inline void put_char(const uint32_t base_pattern,
|
|
const int32_t x, const int32_t y, // in cells
|
|
const uint8_t c)
|
|
{
|
|
const int32_t ix = (0x2000 / 2)
|
|
+ ((cell_offset::y + y) * 64 + (cell_offset::x + x));
|
|
vdp2.vram.u16[ix] = ((base_pattern + c) & 0xfff) | PATTERN_NAME_TABLE_1WORD__PALETTE(1);
|
|
}
|
|
|
|
void draw_text(const uint32_t base_pattern,
|
|
const uint8_t * text,
|
|
const int32_t x, const int32_t y);
|
|
|
|
void draw_box_border(const uint32_t base_pattern,
|
|
const screen_cell_t& top_left, const screen_cell_t& bottom_right);
|
|
|
|
void draw_box_background(const uint32_t base_pattern,
|
|
const screen_cell_t& top_left, const screen_cell_t& bottom_right);
|
|
|
|
void draw_battle_border(const uint32_t base_pattern,
|
|
const screen_cell_t& top_corner, const screen_cell_t& bottom_corner);
|
|
|
|
void draw_stats1(const uint32_t base_pattern,
|
|
const pokemon_instance_t& pokemon_instance);
|
|
|
|
struct dialog_t
|
|
{
|
|
static constexpr screen_cell_t top_left = { 0, 12};
|
|
static constexpr screen_cell_t bottom_right = {19, 17};
|
|
|
|
static void draw(const uint32_t base_pattern,
|
|
const start_size_t& text);
|
|
};
|