Begun implementing VERA sprite API
This commit is contained in:
parent
95306ab124
commit
9fd38360a5
|
@ -10,6 +10,8 @@
|
|||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
typedef enum {
|
||||
ADDR_INCREMENT_0 = 0,
|
||||
ADDR_INCREMENT_1 = 1,
|
||||
|
@ -29,6 +31,13 @@ typedef enum {
|
|||
ADDR_INCREMENT_640 = 15
|
||||
} VeraAddressIncrement;
|
||||
|
||||
typedef enum {
|
||||
VERA_DEPTH_1BPP,
|
||||
VERA_DEPTH_2BPP,
|
||||
VERA_DEPTH_4BPP,
|
||||
VERA_DEPTH_8BPP
|
||||
} VeraBitDepth;
|
||||
|
||||
typedef union vera_palette_entry_s {
|
||||
struct {
|
||||
uint8_t blue: 4;
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
//*****************************************************************************
|
||||
// Sentinel 65X Kernel
|
||||
//
|
||||
// include/drivers/vera_sprites.h
|
||||
//*****************************************************************************
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "drivers/vera.h"
|
||||
|
||||
typedef enum {
|
||||
SPRITE_ORDER_DISABLE,
|
||||
SPRITE_ORDER_BOTTOM,
|
||||
SPRITE_ORDER_MID,
|
||||
SPRITE_ORDER_TOP
|
||||
} VeraSpriteZOrder;
|
||||
|
||||
typedef enum {
|
||||
SPRITE_SIZE_8,
|
||||
SPRITE_SIZE_16,
|
||||
SPRITE_SIZE_32,
|
||||
SPRITE_SIZE_64,
|
||||
} VeraSpriteSize;
|
||||
|
||||
void vera_sprite_set_bitmap_address(uint8_t index, uint32_t address);
|
||||
|
||||
uint32_t vera_sprite_get_bitmap_address(uint8_t index);
|
||||
|
||||
void vera_sprite_set_bit_depth(uint8_t index, VeraBitDepth depth);
|
||||
|
||||
VeraBitDepth vera_sprite_get_bit_depth(uint8_t index);
|
||||
|
||||
void vera_sprite_set_z_order(uint8_t index, VeraSpriteZOrder order);
|
||||
|
||||
VeraSpriteZOrder vera_sprite_get_z_order(uint8_t index);
|
||||
|
||||
void vera_sprite_set_x_position(uint8_t index, uint16_t position);
|
||||
|
||||
uint16_t vera_sprite_get_x_position(uint8_t index);
|
||||
|
||||
void vera_sprite_set_y_position(uint8_t index, uint16_t position);
|
||||
|
||||
uint16_t vera_sprite_get_y_position(uint8_t index);
|
||||
|
||||
void vera_sprite_set_h_flip(uint8_t index, bool state);
|
||||
|
||||
bool vera_sprite_get_h_flip(uint8_t index);
|
||||
|
||||
void vera_sprite_set_v_flip(uint8_t index, bool state);
|
||||
|
||||
bool vera_sprite_get_v_flip(uint8_t index);
|
||||
|
||||
void vera_sprite_set_width(uint8_t index, VeraSpriteSize size);
|
||||
|
||||
VeraSpriteSize vera_sprite_get_width(uint8_t index);
|
||||
|
||||
void vera_sprite_set_height(uint8_t index, VeraSpriteSize size);
|
||||
|
||||
VeraSpriteSize vera_sprite_get_height(uint8_t index);
|
||||
|
||||
void vera_sprite_set_palette_offset(uint8_t index, uint8_t value);
|
||||
|
||||
uint8_t vera_sprite_get_palette_offset(uint8_t index);
|
|
@ -0,0 +1,164 @@
|
|||
//*****************************************************************************
|
||||
// Sentinel 65X Kernel
|
||||
//
|
||||
// src/drivers/vera_sprites.c
|
||||
//*****************************************************************************
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "drivers/vera.h"
|
||||
#include "drivers/vera_sprites.h"
|
||||
|
||||
|
||||
void
|
||||
vera_sprite_set_bitmap_address(uint8_t index, uint32_t address)
|
||||
{
|
||||
(void) index;
|
||||
(void) address;
|
||||
|
||||
}
|
||||
|
||||
uint32_t
|
||||
vera_sprite_get_bitmap_address(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_bit_depth(uint8_t index, VeraBitDepth depth)
|
||||
{
|
||||
(void) index;
|
||||
(void) depth;
|
||||
|
||||
}
|
||||
|
||||
VeraBitDepth
|
||||
vera_sprite_get_bit_depth(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return VERA_DEPTH_1BPP;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_z_order(uint8_t index, VeraSpriteZOrder order)
|
||||
{
|
||||
(void) index;
|
||||
(void) order;
|
||||
|
||||
}
|
||||
|
||||
VeraSpriteZOrder
|
||||
vera_sprite_get_z_order(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return SPRITE_ORDER_BOTTOM;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_x_position(uint8_t index, uint16_t position)
|
||||
{
|
||||
(void) index;
|
||||
(void) position;
|
||||
|
||||
}
|
||||
|
||||
uint16_t
|
||||
vera_sprite_get_x_position(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_y_position(uint8_t index, uint16_t position)
|
||||
{
|
||||
(void) index;
|
||||
(void) position;
|
||||
|
||||
}
|
||||
|
||||
uint16_t
|
||||
vera_sprite_get_y_position(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_h_flip(uint8_t index, bool state)
|
||||
{
|
||||
(void) index;
|
||||
(void) state;
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
vera_sprite_get_h_flip(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_v_flip(uint8_t index, bool state)
|
||||
{
|
||||
(void) index;
|
||||
(void) state;
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
vera_sprite_get_v_flip(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_width(uint8_t index, VeraSpriteSize size)
|
||||
{
|
||||
(void) index;
|
||||
(void) size;
|
||||
|
||||
}
|
||||
|
||||
VeraSpriteSize
|
||||
vera_sprite_get_width(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return SPRITE_SIZE_8;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_height(uint8_t index, VeraSpriteSize size)
|
||||
{
|
||||
(void) index;
|
||||
(void) size;
|
||||
|
||||
}
|
||||
|
||||
VeraSpriteSize
|
||||
vera_sprite_get_height(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return SPRITE_SIZE_8;
|
||||
}
|
||||
|
||||
void
|
||||
vera_sprite_set_palette_offset(uint8_t index, uint8_t value)
|
||||
{
|
||||
(void) index;
|
||||
(void) value;
|
||||
|
||||
}
|
||||
|
||||
uint8_t
|
||||
vera_sprite_get_palette_offset(uint8_t index)
|
||||
{
|
||||
(void) index;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue