uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit a747e4b20ac9615c83c69e8a7a9050f58ee5844d
parent c3506869b50287f6e21c1c8f4ce4479a501f5e06
Author: neauoire <aliceffekt@gmail.com>
Date:   Tue, 28 Dec 2021 17:22:40 -0800

Fixed issue with screen resize

Diffstat:
Msrc/devices/audio.h | 2+-
Msrc/devices/file.c | 2+-
Msrc/devices/screen.c | 4++--
Msrc/devices/screen.h | 3+++
Msrc/uxnemu.c | 2+-
5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/devices/audio.h b/src/devices/audio.h @@ -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); \ No newline at end of file diff --git a/src/devices/file.c b/src/devices/file.c @@ -139,7 +139,7 @@ file_delete(void) return unlink(current_filename); } -/* API */ +/* IO */ void file_deo(Device *d, Uint8 port) diff --git a/src/devices/screen.c b/src/devices/screen.c @@ -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); diff --git a/src/devices/screen.h b/src/devices/screen.h @@ -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); diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -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);