pikapython/package/Arm2D/Arm2D_common.h

87 lines
2.6 KiB
C
Raw Normal View History

2021-10-05 09:49:52 +08:00
#ifndef __ARM_2D__COMMON_H
#define __ARM_2D__COMMON_H
2021-11-03 20:11:31 +08:00
#include <stdbool.h>
#include "Arm2D_Box.h"
#include "BaseObj.h"
2021-10-05 09:49:52 +08:00
#include "arm_2d.h"
#include "arm_2d_helper.h"
2021-11-03 20:11:31 +08:00
#include "dataStrs.h"
2021-10-05 09:49:52 +08:00
#include "pikaScript.h"
2021-11-02 22:58:30 +08:00
#ifndef ARM2DQEMUBOOTER_APP_ARM2D_H_
#define APPLICATIONS_APP_ARM2D_H_
2021-11-20 20:23:11 +08:00
#define LCD_WIDTH 128
#define LCD_HEIGHT 160
2021-11-04 23:50:03 +08:00
typedef struct __pika_arm2d_element_info_t {
int x, x_last;
int y, y_last;
int alpha, alpha_last;
} pika_arm2d_element_info_t;
typedef struct __pika_arm2d_box_info_t {
2021-11-20 20:23:11 +08:00
pika_arm2d_element_info_t elem_info;
arm_2d_region_t arg2d_regin;
2021-11-04 23:50:03 +08:00
int wight, wight_last;
int hight, hight_last;
uint16_t color_code, color_code_last;
} pika_arm2d_box_info_t;
typedef struct __pika_arm2d_window_t {
2021-11-03 20:11:31 +08:00
arm_2d_tile_t* pfb_tile_now;
bool pfb_is_new_frame;
2021-11-04 23:50:03 +08:00
arm_2d_region_list_item_t* dirty_region_list;
2021-11-03 20:11:31 +08:00
PikaObj* pika_windows_object;
PikaObj* pika_background_object;
PikaObj* pika_elems_object;
2021-11-02 22:58:30 +08:00
} pika_arm2d_window_t;
extern pika_arm2d_window_t pika_arm2d_window;
/* GLCD RGB color definitions */
2021-11-03 20:11:31 +08:00
#define GLCD_COLOR_BLACK 0x0000 /* 0, 0, 0 */
#define GLCD_COLOR_NAVY 0x000F /* 0, 0, 128 */
#define GLCD_COLOR_DARK_GREEN 0x03E0 /* 0, 128, 0 */
#define GLCD_COLOR_DARK_CYAN 0x03EF /* 0, 128, 128 */
#define GLCD_COLOR_MAROON 0x7800 /* 128, 0, 0 */
#define GLCD_COLOR_PURPLE 0x780F /* 128, 0, 128 */
#define GLCD_COLOR_OLIVE 0x7BE0 /* 128, 128, 0 */
#define GLCD_COLOR_LIGHT_GREY 0xC618 /* 192, 192, 192 */
#define GLCD_COLOR_DARK_GREY 0x7BEF /* 128, 128, 128 */
#define GLCD_COLOR_BLUE 0x001F /* 0, 0, 255 */
#define GLCD_COLOR_GREEN 0x07E0 /* 0, 255, 0 */
#define GLCD_COLOR_CYAN 0x07FF /* 0, 255, 255 */
#define GLCD_COLOR_RED 0xF800 /* 255, 0, 0 */
#define GLCD_COLOR_MAGENTA 0xF81F /* 255, 0, 255 */
#define GLCD_COLOR_YELLOW 0xFFE0 /* 255, 255, 0 */
#define GLCD_COLOR_WHITE 0xFFFF /* 255, 255, 255 */
2021-11-02 22:58:30 +08:00
void pika_arm2d_init(void);
void pika_arm2d_update();
#endif /* ARM2DQEMUBOOTER_APP_ARM2D_H_ */
2021-10-05 09:49:52 +08:00
2021-11-03 20:11:31 +08:00
uint16_t getColorCode(char* colorName);
2021-11-02 22:58:30 +08:00
typedef struct {
2021-11-03 20:11:31 +08:00
arm_2d_op_rotate_t tOP;
const arm_2d_tile_t* ptTile;
float fAngle;
float fAngleSpeed;
arm_2d_location_t tCentre;
arm_2d_region_t tRegion;
2021-10-05 09:49:52 +08:00
} rotate_tile_t;
2021-11-20 20:23:11 +08:00
/* need implement in platform */
int32_t __Arm2D_platform_drawRegin(uint32_t x,
uint32_t y,
uint32_t width,
uint32_t height,
const uint8_t* bitmap);
/* need implement in platform */
int32_t __Arm2D_platform_Init();
2021-11-02 22:58:30 +08:00
#endif