mirror of
https://github.com/ringtailsoftware/uvm32.git
synced 2026-06-05 22:43:39 +00:00
SDL based host with extram mapped to framebuffer and simple gfx app to accompany it
This commit is contained in:
parent
577aaadacd
commit
e7485d5972
8 changed files with 336 additions and 0 deletions
13
apps/gfx/Makefile
Normal file
13
apps/gfx/Makefile
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
TOPDIR=../..
|
||||
PROJECT:=$(shell basename ${PWD})
|
||||
|
||||
OPT=-Os
|
||||
SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S
|
||||
|
||||
HOST_EXTRA=-i 4294967295
|
||||
all: all_common
|
||||
test: all
|
||||
${TOPDIR}/hosts/host-sdl/host-sdl ${HOST_EXTRA} ${PWD}/${PROJECT}.bin
|
||||
|
||||
clean: clean_common
|
||||
include ${TOPDIR}/apps/makefile.common
|
||||
22
apps/gfx/gfx.c
Normal file
22
apps/gfx/gfx.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include "uvm32_target.h"
|
||||
|
||||
uint32_t *framebuffer = (uint32_t *)UVM32_EXTRAM_BASE;
|
||||
#define WIDTH 800
|
||||
#define HEIGHT 600
|
||||
|
||||
void main(void) {
|
||||
uint32_t col = 0x000000FF;
|
||||
uint8_t c = 0;
|
||||
uint32_t framecount = 0;
|
||||
while(1) {
|
||||
for (int y=0;y<HEIGHT;y++) {
|
||||
for (int x=0;x<WIDTH;x++) {
|
||||
framebuffer[y*WIDTH+x] = col;
|
||||
}
|
||||
}
|
||||
col = (c << 24) | (c << 16) | (c<<8) | 0xFF;
|
||||
c++;
|
||||
printdec(framecount++);
|
||||
println("");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue