Fixed exception with fullscreen. Improved debugger BASIC window.
This commit is contained in:
22
vdp.cpp
22
vdp.cpp
@@ -65,25 +65,15 @@ static Uint8 palette[16][4] = {
|
||||
|
||||
void vdp_init() {
|
||||
SDL_Init(SDL_INIT_EVERYTHING);
|
||||
sdlWindow = SDL_CreateWindow("PaCo", 160, SDL_WINDOWPOS_UNDEFINED, 608, 480, SDL_WINDOW_SHOWN);
|
||||
sdlWindow = SDL_CreateWindow("PaCo", 160, SDL_WINDOWPOS_UNDEFINED, 608, 480, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_SHOWN);
|
||||
sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, SDL_RENDERER_PRESENTVSYNC);
|
||||
//SDL_SetRenderDrawBlendMode(sdlRenderer, SDL_BLENDMODE_BLEND);
|
||||
SDL_RenderSetLogicalSize(sdlRenderer, 152, 120);
|
||||
SDL_SetRenderDrawColor(sdlRenderer, palette[border][0], palette[border][1], palette[border][2], palette[border][3]);
|
||||
sdlTexture = SDL_CreateTexture(sdlRenderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, 128, 128);
|
||||
SDL_ShowCursor(fullscreen ? 0 : 1);
|
||||
|
||||
for (int i = 0; i < 16 * 12; i++) screen_map[i] = 32;
|
||||
for (int i = 0; i < 16 * 12; i++) screen_color[i] = color;
|
||||
//jtexture texture = (jtexture)malloc(sizeof(jtexture_t));
|
||||
//FILE* f = fopen("font.png", "rb");
|
||||
//if (!f) { error = 2; return; }
|
||||
//int c;
|
||||
//int size = 128;
|
||||
//Uint8* buffer = stbi_load_from_file(f, &size, &size, &c, 4);
|
||||
sdlTexture = SDL_CreateTexture(sdlRenderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, 128, 128);
|
||||
//SDL_UpdateTexture(sdlTexture, NULL, buffer, 128 * sizeof(Uint32));
|
||||
//SDL_SetTextureBlendMode(sdlTexture, SDL_BLENDMODE_BLEND);
|
||||
//stbi_image_free(buffer);
|
||||
//fclose(f);
|
||||
|
||||
src.x = src.y = 0;
|
||||
dst.x = dst.y = 12;
|
||||
@@ -152,6 +142,12 @@ void vdp_flip() {
|
||||
void vdp_switch_fullscreen() {
|
||||
SDL_SetWindowFullscreen(sdlWindow, fullscreen ? 0 : SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
fullscreen = !fullscreen;
|
||||
SDL_DestroyRenderer(sdlRenderer);
|
||||
sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, SDL_RENDERER_PRESENTVSYNC);
|
||||
SDL_RenderSetLogicalSize(sdlRenderer, 152, 120);
|
||||
SDL_ShowCursor(fullscreen ? 0 : 1);
|
||||
SDL_DestroyTexture(sdlTexture);
|
||||
sdlTexture = SDL_CreateTexture(sdlRenderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, 128, 128);
|
||||
}
|
||||
|
||||
void vdp_data_out(const unsigned char& value) {
|
||||
|
||||
Reference in New Issue
Block a user