|
27 | 27 |
|
28 | 28 | typedef struct {
|
29 | 29 | Uint8 ram[RAM_SIZE + 8];
|
30 |
| - Uint8 screenbuf[SCREEN_W * SCREEN_H]; |
31 | 30 | Uint64 last_tick;
|
32 | 31 | Uint64 tick_acc;
|
33 | 32 | SDL_Window* window;
|
@@ -187,7 +186,7 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) {
|
187 | 186 | }
|
188 | 187 |
|
189 | 188 | if (!(vm->screen = SDL_CreateSurfaceFrom(
|
190 |
| - SCREEN_W, SCREEN_H, SDL_PIXELFORMAT_INDEX8, vm->screenbuf, SCREEN_W |
| 189 | + SCREEN_W, SCREEN_H, SDL_PIXELFORMAT_INDEX8, vm->ram, SCREEN_W |
191 | 190 | ))) {
|
192 | 191 | return SDL_APP_FAILURE;
|
193 | 192 | }
|
@@ -296,18 +295,18 @@ SDL_AppResult SDL_AppIterate(void* appstate) {
|
296 | 295 | SDL_UnlockTexture(vm->screentex);
|
297 | 296 |
|
298 | 297 | SDL_RenderTexture(vm->renderer, vm->screentex, NULL, NULL);
|
299 |
| - } |
300 | 298 |
|
301 |
| - if (vm->display_help) { |
302 |
| - print(vm, 4, 4, "Drop a BytePusher file in this"); |
303 |
| - print(vm, 8, 12, "window to load and run it!"); |
304 |
| - print(vm, 4, 28, "Press ENTER to switch between"); |
305 |
| - print(vm, 8, 36, "positional and symbolic input."); |
306 |
| - } |
| 299 | + if (vm->display_help) { |
| 300 | + print(vm, 4, 4, "Drop a BytePusher file in this"); |
| 301 | + print(vm, 8, 12, "window to load and run it!"); |
| 302 | + print(vm, 4, 28, "Press ENTER to switch between"); |
| 303 | + print(vm, 8, 36, "positional and symbolic input."); |
| 304 | + } |
307 | 305 |
|
308 |
| - if (vm->status_ticks > 0) { |
309 |
| - vm->status_ticks -= 1; |
310 |
| - print(vm, 4, SCREEN_H - 12, vm->status); |
| 306 | + if (vm->status_ticks > 0) { |
| 307 | + vm->status_ticks -= 1; |
| 308 | + print(vm, 4, SCREEN_H - 12, vm->status); |
| 309 | + } |
311 | 310 | }
|
312 | 311 |
|
313 | 312 | SDL_SetRenderTarget(vm->renderer, NULL);
|
|
0 commit comments