Nugget
Loading...
Searching...
No Matches
Macros
raster-helpers.h File Reference
#include <stdint.h>
#include "common/hardware/dma.h"
#include "common/hardware/gpu.h"
#include "common/hardware/hwregs.h"
#include "common/hardware/irq.h"
#include "common/syscalls/syscalls.h"
Include dependency graph for raster-helpers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RASTER_DRAW_AREA_X1   0
 
#define RASTER_DRAW_AREA_Y1   0
 
#define RASTER_DRAW_AREA_X2   1024
 
#define RASTER_DRAW_AREA_Y2   512
 
#define RASTER_SENTINEL   0xDEADu
 
#define RASTER_CMD_RED   rasterCmdColor(0x1f, 0x00, 0x00)
 
#define RASTER_VRAM_RED   rasterVram555(0x1f, 0x00, 0x00)
 
#define RASTER_CMD_GREEN   rasterCmdColor(0x00, 0x1f, 0x00)
 
#define RASTER_VRAM_GREEN   rasterVram555(0x00, 0x1f, 0x00)
 
#define RASTER_CMD_BLUE   rasterCmdColor(0x00, 0x00, 0x1f)
 
#define RASTER_VRAM_BLUE   rasterVram555(0x00, 0x00, 0x1f)
 
#define RASTER_CMD_WHITE   rasterCmdColor(0x1f, 0x1f, 0x1f)
 
#define RASTER_VRAM_WHITE   rasterVram555(0x1f, 0x1f, 0x1f)
 
#define ASSERT_PIXEL_EQ(expected, x_, y_)
 
#define ASSERT_PIXEL_UNTOUCHED(x_, y_)    ASSERT_PIXEL_EQ(RASTER_SENTINEL, (x_), (y_))
 

Macro Definition Documentation

◆ ASSERT_PIXEL_EQ

#define ASSERT_PIXEL_EQ (   expected,
  x_,
  y_ 
)
Value:
do { \
int16_t _ax = (int16_t)(x_); \
int16_t _ay = (int16_t)(y_); \
uint16_t _aval = rasterReadPixel(_ax, _ay); \
ramsyscall_printf("OBS x=%d y=%d val=0x%04x expect=0x%04x\n", \
(int)_ax, (int)_ay, (unsigned)_aval, \
(unsigned)(expected)); \
cester_assert_uint_eq((unsigned)(expected), (unsigned)_aval); \
} while (0)

◆ ASSERT_PIXEL_UNTOUCHED

#define ASSERT_PIXEL_UNTOUCHED (   x_,
  y_ 
)     ASSERT_PIXEL_EQ(RASTER_SENTINEL, (x_), (y_))

◆ RASTER_CMD_BLUE

#define RASTER_CMD_BLUE   rasterCmdColor(0x00, 0x00, 0x1f)

◆ RASTER_CMD_GREEN

#define RASTER_CMD_GREEN   rasterCmdColor(0x00, 0x1f, 0x00)

◆ RASTER_CMD_RED

#define RASTER_CMD_RED   rasterCmdColor(0x1f, 0x00, 0x00)

◆ RASTER_CMD_WHITE

#define RASTER_CMD_WHITE   rasterCmdColor(0x1f, 0x1f, 0x1f)

◆ RASTER_DRAW_AREA_X1

#define RASTER_DRAW_AREA_X1   0

◆ RASTER_DRAW_AREA_X2

#define RASTER_DRAW_AREA_X2   1024

◆ RASTER_DRAW_AREA_Y1

#define RASTER_DRAW_AREA_Y1   0

◆ RASTER_DRAW_AREA_Y2

#define RASTER_DRAW_AREA_Y2   512

◆ RASTER_SENTINEL

#define RASTER_SENTINEL   0xDEADu

◆ RASTER_VRAM_BLUE

#define RASTER_VRAM_BLUE   rasterVram555(0x00, 0x00, 0x1f)

◆ RASTER_VRAM_GREEN

#define RASTER_VRAM_GREEN   rasterVram555(0x00, 0x1f, 0x00)

◆ RASTER_VRAM_RED

#define RASTER_VRAM_RED   rasterVram555(0x1f, 0x00, 0x00)

◆ RASTER_VRAM_WHITE

#define RASTER_VRAM_WHITE   rasterVram555(0x1f, 0x1f, 0x1f)