Improved hot reload
This commit is contained in:
parent
2b55c0732d
commit
406d2fb327
|
@ -53,6 +53,14 @@ screen_blit(UxnScreen *p, Layer *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8
|
|||
}
|
||||
}
|
||||
|
||||
static void layer_clear(UxnScreen *p, Layer *layer)
|
||||
{
|
||||
Uint32 i, size = p->width * p->height;
|
||||
for(i = 0; i < size; i++)
|
||||
layer->pixels[i] = 0x00;
|
||||
layer->changed = 1;
|
||||
}
|
||||
|
||||
void
|
||||
screen_palette(UxnScreen *p, Uint8 *addr)
|
||||
{
|
||||
|
@ -82,18 +90,15 @@ screen_resize(UxnScreen *p, Uint16 width, Uint16 height)
|
|||
if(bg && fg && pixels) {
|
||||
p->width = width;
|
||||
p->height = height;
|
||||
screen_clear(p, &p->bg);
|
||||
screen_clear(p, &p->fg);
|
||||
screen_clear(p);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
screen_clear(UxnScreen *p, Layer *layer)
|
||||
screen_clear(UxnScreen *p)
|
||||
{
|
||||
Uint32 i, size = p->width * p->height;
|
||||
for(i = 0; i < size; i++)
|
||||
layer->pixels[i] = 0x00;
|
||||
layer->changed = 1;
|
||||
layer_clear(p, &p->bg);
|
||||
layer_clear(p, &p->fg);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -25,7 +25,7 @@ extern UxnScreen uxn_screen;
|
|||
|
||||
void screen_palette(UxnScreen *p, Uint8 *addr);
|
||||
void screen_resize(UxnScreen *p, Uint16 width, Uint16 height);
|
||||
void screen_clear(UxnScreen *p, Layer *layer);
|
||||
void screen_clear(UxnScreen *p);
|
||||
void screen_redraw(UxnScreen *p, Uint32 *pixels);
|
||||
|
||||
Uint8 screen_dei(Uint8 *d, Uint8 port);
|
||||
|
|
|
@ -17,8 +17,7 @@ WITH REGARD TO THIS SOFTWARE.
|
|||
static const char *errors[] = {
|
||||
"underflow",
|
||||
"overflow",
|
||||
"division by zero"
|
||||
};
|
||||
"division by zero"};
|
||||
|
||||
static void
|
||||
system_print(Stack *s, char *name)
|
||||
|
|
|
@ -105,7 +105,9 @@ emu_start(Uxn *u, char *rom)
|
|||
{
|
||||
if(!load_rom(u, rom))
|
||||
return 0;
|
||||
if(!uxn_screen.width || !uxn_screen.height)
|
||||
screen_resize(&uxn_screen, WIDTH, HEIGHT);
|
||||
screen_clear(&uxn_screen);
|
||||
if(!uxn_eval(u, PAGE_PROGRAM))
|
||||
return emu_error("Boot", "Failed to start rom.");
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue