pokemon/graphic.hpp
Zack Buhman 3d8110ca1c graphic: add functions to draw stats screen borders
This also draws pokemon sprites on the screen, sequentially.
2023-08-03 22:19:01 +00:00

40 lines
1.2 KiB
C++

#pragma once
#include "coordinates.hpp"
#include "start_size.hpp"
#include "render_map.hpp" // for cell_offset
#include "vdp2.h"
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);
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);
};