Subversion Repositories Shiroi

Rev

Rev 12 | Rev 20 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12 Rev 13
Line 1... Line 1...
1
/* $Id: main.c 12 2024-08-29 04:19:08Z nishi $ */
1
/* $Id: main.c 13 2024-08-29 04:36:14Z nishi $ */
2
 
2
 
3
#include <stdio.h>
3
#include <stdio.h>
4
#include <stdbool.h>
4
#include <stdbool.h>
5
#include <sys/stat.h>
5
#include <sys/stat.h>
6
#include <stdlib.h>
6
#include <stdlib.h>
Line 141... Line 141...
141
		debug = debugcard->debugptr;
141
		debug = debugcard->debugptr;
142
	}
142
	}
143
 
143
 
144
	SetTraceLogLevel(LOG_NONE);
144
	SetTraceLogLevel(LOG_NONE);
145
	if(video != NULL) {
145
	if(video != NULL) {
146
		InitWindow(video->width * scx + (text == NULL ? 0 : 200), video->height * scy, "Shiroi Emulator");
146
		InitWindow(video->width * scx + ((debug == NULL && text == NULL) ? 0 : 200), video->height * scy, "Shiroi Emulator");
147
	} else {
147
	} else {
148
		InitWindow(640 + (text == NULL ? 0 : 200), 480, "Shiroi Emulator");
148
		InitWindow(640 + ((debug == NULL && text == NULL) ? 0 : 200), 480, "Shiroi Emulator");
149
	}
149
	}
150
	InitAudioDevice();
150
	InitAudioDevice();
151
	SetAudioStreamBufferSizeDefault(512);
151
	SetAudioStreamBufferSizeDefault(512);
152
	AudioStream as = LoadAudioStream(48000, 16, 1);
152
	AudioStream as = LoadAudioStream(48000, 16, 1);
153
	SetAudioStreamCallback(as, shiroi.play_audio);
153
	SetAudioStreamCallback(as, shiroi.play_audio);
Line 302... Line 302...
302
				}
302
				}
303
			}
303
			}
304
 
304
 
305
			EndTextureMode();
305
			EndTextureMode();
306
 
306
 
307
			DrawTexturePro(r.texture, (Rectangle){0, 0, video->width, -video->height}, (Rectangle){text == NULL ? 0 : 200, 0, GetScreenWidth() - (text == NULL ? 0 : 200), GetScreenHeight()}, (Vector2){0, 0}, 0, WHITE);
307
			DrawTexturePro(r.texture, (Rectangle){0, 0, video->width, -video->height}, (Rectangle){(text == NULL && debug == NULL) ? 0 : 200, 0, GetScreenWidth() - ((text == NULL && debug == NULL) ? 0 : 200), GetScreenHeight()}, (Vector2){0, 0}, 0, WHITE);
308
		} else {
308
		} else {
309
			DrawText("No Video", 0, 20, 20, WHITE);
309
			DrawText("No Video", 200 + 5, 5, 20, WHITE);
310
		}
310
		}
311
 
311
 
-
 
312
		if(text != NULL) {
312
		DrawText("Caps Lock", 5, 5, 10, WHITE);
313
			DrawText("Caps Lock", 5, 5, 10, WHITE);
313
 
314
 
314
		DrawCircle(200 - 10, 10, 5, text->caps ? ON_COLOR : OFF_COLOR);
315
			DrawCircle(200 - 10, 10, 5, text->caps ? ON_COLOR : OFF_COLOR);
-
 
316
		}
315
 
317
 
316
		if(debug != NULL) {
318
		if(debug != NULL) {
317
			DrawText("Debug", 5, 5 + 10 + 5, 10, WHITE);
319
			DrawText("Debug", 5, 5 + 10 + 5, 10, WHITE);
318
			for(i = 0; i < 4; i++) {
320
			for(i = 0; i < 4; i++) {
319
				int shx = i * (5 + 20 + 5 + 5 + 10);
321
				int shx = i * (5 + 20 + 5 + 5 + 10);