Browse code

Fixed issue with screen resize

neauoire authored on 29/12/2021 01:22:40
Showing 5 changed files
... ...
@@ -25,7 +25,7 @@ typedef struct {
25 25
 
26 26
 extern Audio audio[POLYPHONY];
27 27
 
28
+Uint8 audio_get_vu(Audio *c);
28 29
 int audio_render(Audio *c, Sint16 *sample, Sint16 *end);
29 30
 void audio_start(Audio *c, Uint16 adsr, Uint8 pitch);
30
-Uint8 audio_get_vu(Audio *c);
31 31
 void audio_finished_handler(Audio *c);
32 32
\ No newline at end of file
... ...
@@ -139,7 +139,7 @@ file_delete(void)
139 139
 	return unlink(current_filename);
140 140
 }
141 141
 
142
-/* API */
142
+/* IO */
143 143
 
144 144
 void
145 145
 file_deo(Device *d, Uint8 port)
... ...
@@ -154,7 +154,7 @@ screen_debug(Screen *p, Uint8 *stack, Uint8 wptr, Uint8 rptr, Uint8 *memory)
154 154
 	}
155 155
 }
156 156
 
157
-/* APIs */
157
+/* IO */
158 158
 
159 159
 Uint8
160 160
 screen_dei(Device *d, Uint8 port)
... ...
@@ -174,7 +174,7 @@ screen_deo(Device *d, Uint8 port)
174 174
 	switch(port) {
175 175
 	case 0x1: d->vector = peek16(d->dat, 0x0); break;
176 176
 	case 0x5:
177
-		/* TODO: if(!FIXED_SIZE) set_size(peek16(d->dat, 0x2), peek16(d->dat, 0x4), 1); */
177
+		if(!FIXED_SIZE) set_size(peek16(d->dat, 0x2), peek16(d->dat, 0x4), 1);
178 178
 		break;
179 179
 	case 0xe: {
180 180
 		Uint16 x = peek16(d->dat, 0x8);
... ...
@@ -27,6 +27,9 @@ typedef struct Screen {
27 27
 
28 28
 extern Screen screen;
29 29
 
30
+/* this should probably be done differently */
31
+int set_size(Uint16 width, Uint16 height, int is_resize);
32
+
30 33
 void screen_palette(Screen *p, Uint8 *addr);
31 34
 void screen_resize(Screen *p, Uint16 width, Uint16 height);
32 35
 void screen_clear(Screen *p, Layer *layer);
... ...
@@ -101,7 +101,7 @@ set_window_size(SDL_Window *window, int w, int h)
101 101
 	SDL_SetWindowSize(window, w, h);
102 102
 }
103 103
 
104
-static int
104
+int
105 105
 set_size(Uint16 width, Uint16 height, int is_resize)
106 106
 {
107 107
 	screen_resize(&screen, width, height);