Fixed issue with screen resize

This commit is contained in:
neauoire 2021-12-28 17:22:40 -08:00
parent c3506869b5
commit a747e4b20a
5 changed files with 8 additions and 5 deletions

View File

@ -25,7 +25,7 @@ typedef struct {
extern Audio audio[POLYPHONY];
Uint8 audio_get_vu(Audio *c);
int audio_render(Audio *c, Sint16 *sample, Sint16 *end);
void audio_start(Audio *c, Uint16 adsr, Uint8 pitch);
Uint8 audio_get_vu(Audio *c);
void audio_finished_handler(Audio *c);

View File

@ -139,7 +139,7 @@ file_delete(void)
return unlink(current_filename);
}
/* API */
/* IO */
void
file_deo(Device *d, Uint8 port)

View File

@ -154,7 +154,7 @@ screen_debug(Screen *p, Uint8 *stack, Uint8 wptr, Uint8 rptr, Uint8 *memory)
}
}
/* APIs */
/* IO */
Uint8
screen_dei(Device *d, Uint8 port)
@ -174,7 +174,7 @@ screen_deo(Device *d, Uint8 port)
switch(port) {
case 0x1: d->vector = peek16(d->dat, 0x0); break;
case 0x5:
/* TODO: if(!FIXED_SIZE) set_size(peek16(d->dat, 0x2), peek16(d->dat, 0x4), 1); */
if(!FIXED_SIZE) set_size(peek16(d->dat, 0x2), peek16(d->dat, 0x4), 1);
break;
case 0xe: {
Uint16 x = peek16(d->dat, 0x8);

View File

@ -27,6 +27,9 @@ typedef struct Screen {
extern Screen screen;
/* this should probably be done differently */
int set_size(Uint16 width, Uint16 height, int is_resize);
void screen_palette(Screen *p, Uint8 *addr);
void screen_resize(Screen *p, Uint16 width, Uint16 height);
void screen_clear(Screen *p, Layer *layer);

View File

@ -101,7 +101,7 @@ set_window_size(SDL_Window *window, int w, int h)
SDL_SetWindowSize(window, w, h);
}
static int
int
set_size(Uint16 width, Uint16 height, int is_resize)
{
screen_resize(&screen, width, height);