GCC ready. Removed VS Project. Removed stb_image
This commit is contained in:
1
.hgignore → .gitignore
vendored
1
.hgignore → .gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
syntax: glob
|
||||
|
||||
paco
|
||||
recursos/*
|
||||
bin/*
|
||||
obj/*
|
||||
14
debug.cpp
14
debug.cpp
@@ -1,8 +1,7 @@
|
||||
#include "debug.h"
|
||||
#include <SDL.h>
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include "parser.h"
|
||||
#include "font_bmp.h"
|
||||
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
@@ -299,14 +298,19 @@ void debug_show_window() {
|
||||
debug_window_id = SDL_GetWindowID(debug_window);
|
||||
SDL_SetRenderDrawColor(debug_renderer, 128, 128, 128, 255);
|
||||
|
||||
FILE* f = fopen("font.png", "rb");
|
||||
// [RZC 15-04-2021] Old version using PNG
|
||||
/*FILE* f = fopen("font.png", "rb");
|
||||
int x = 128, y = 128, c;
|
||||
Uint8* buffer = stbi_load_from_file(f, &x, &y, &c, 4);
|
||||
debug_texture = SDL_CreateTexture(debug_renderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, 128, 128);
|
||||
SDL_UpdateTexture(debug_texture, NULL, buffer, 128 * sizeof(Uint32));
|
||||
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_BLEND);
|
||||
stbi_image_free(buffer);
|
||||
fclose(f);
|
||||
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_BLEND);*/
|
||||
|
||||
// [RZC 15-04-2021] New version using 1 bit BMP
|
||||
debug_texture = SDL_CreateTextureFromSurface(debug_renderer, SDL_LoadBMP_RW(SDL_RWFromMem(font_bmp, font_bmp_len), 1));
|
||||
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_ADD);
|
||||
visible = true;
|
||||
}
|
||||
|
||||
|
||||
2
debug.h
2
debug.h
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include <SDL.h>
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
void debug_init(unsigned char* mem, const bool window_shown = false);
|
||||
void debug_update(const bool force = true);
|
||||
|
||||
187
font_bmp.h
Normal file
187
font_bmp.h
Normal file
@@ -0,0 +1,187 @@
|
||||
#pragma once
|
||||
|
||||
unsigned char font_bmp[] = {
|
||||
0x42, 0x4d, 0x82, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00,
|
||||
0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
|
||||
0x00, 0x00, 0x23, 0x2e, 0x00, 0x00, 0x23, 0x2e, 0x00, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x18, 0x18,
|
||||
0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x28, 0x82, 0x22, 0x88, 0x00, 0x18,
|
||||
0x18, 0x00, 0x18, 0x3c, 0x30, 0x0c, 0xff, 0x18, 0x80, 0x02, 0x28, 0x44,
|
||||
0x24, 0x48, 0x18, 0x30, 0x3c, 0x00, 0x18, 0x7e, 0x70, 0x0e, 0xff, 0x3c,
|
||||
0xe0, 0x0e, 0x28, 0x28, 0x28, 0x28, 0x3c, 0x18, 0x7e, 0x24, 0x18, 0xff,
|
||||
0xff, 0xff, 0x7e, 0x7e, 0xf8, 0x3e, 0x10, 0x10, 0x90, 0x12, 0x3c, 0x0c,
|
||||
0x18, 0x66, 0xff, 0x18, 0xff, 0xff, 0x3c, 0xff, 0xfe, 0xfe, 0x7c, 0xfe,
|
||||
0x7c, 0x7c, 0x3c, 0x18, 0x18, 0xff, 0x7e, 0x18, 0x70, 0x0e, 0x18, 0xff,
|
||||
0xf8, 0x3e, 0x92, 0x10, 0x12, 0x90, 0x18, 0xff, 0x7e, 0x66, 0x3c, 0x18,
|
||||
0x30, 0x0c, 0x00, 0x00, 0xe0, 0x0e, 0x38, 0x38, 0x38, 0x38, 0x3c, 0xff,
|
||||
0x3c, 0x24, 0x18, 0x18, 0x10, 0x08, 0x00, 0x00, 0x80, 0x02, 0x38, 0x38,
|
||||
0x38, 0x38, 0x00, 0x3c, 0x18, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x78, 0x18, 0x38, 0x70, 0x99, 0xd6, 0xff, 0xff,
|
||||
0x38, 0x10, 0x10, 0x38, 0x3c, 0x3c, 0x7e, 0x7e, 0xcc, 0x7e, 0x7c, 0xf8,
|
||||
0x5a, 0x7c, 0xc3, 0xbd, 0x10, 0x38, 0x38, 0x10, 0x66, 0x7e, 0x66, 0x7e,
|
||||
0xcc, 0x18, 0x3c, 0x78, 0x24, 0x38, 0xbd, 0xc3, 0xfe, 0x7c, 0x7c, 0xfe,
|
||||
0xc3, 0xff, 0x66, 0x7e, 0xcc, 0x3c, 0x0c, 0x18, 0xc3, 0x38, 0xff, 0xff,
|
||||
0xfe, 0xfe, 0xfe, 0xfe, 0xc3, 0xff, 0x66, 0x7e, 0x78, 0x66, 0x0c, 0x1b,
|
||||
0xc3, 0x38, 0x99, 0x99, 0xfe, 0x7c, 0xfe, 0x7c, 0x66, 0x7e, 0x66, 0x7e,
|
||||
0x0d, 0x66, 0x0c, 0x1e, 0x24, 0x38, 0xff, 0xff, 0x38, 0x38, 0xfe, 0x38,
|
||||
0x3c, 0x3c, 0x7e, 0x7e, 0x07, 0x66, 0x0c, 0x1c, 0x5a, 0x38, 0x7e, 0x7e,
|
||||
0x38, 0x10, 0x6c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3c, 0x0c, 0x18,
|
||||
0x99, 0x10, 0x00, 0x03, 0xff, 0xc0, 0x80, 0x01, 0xff, 0xff, 0x00, 0x05,
|
||||
0x55, 0x50, 0x00, 0x01, 0xaa, 0xaa, 0x00, 0x03, 0xff, 0xc0, 0xc0, 0x03,
|
||||
0x7f, 0xfe, 0x00, 0x0a, 0xaa, 0xa0, 0x80, 0x02, 0x55, 0x54, 0x00, 0x03,
|
||||
0x00, 0xc0, 0xe0, 0x07, 0x3f, 0xfc, 0x00, 0x05, 0x55, 0x50, 0x40, 0x05,
|
||||
0x2a, 0xa8, 0x00, 0x03, 0x00, 0xc0, 0xf0, 0x0f, 0x1f, 0xf8, 0x00, 0x0a,
|
||||
0xaa, 0xa0, 0xa0, 0x0a, 0x15, 0x50, 0x00, 0x03, 0x00, 0xc0, 0xf8, 0x1f,
|
||||
0x0f, 0xf0, 0x55, 0x05, 0x00, 0x50, 0x50, 0x15, 0x0a, 0xa0, 0x00, 0x03,
|
||||
0x00, 0xc0, 0xfc, 0x3f, 0x07, 0xe0, 0xaa, 0x0a, 0x00, 0xa0, 0xa8, 0x2a,
|
||||
0x05, 0x40, 0xff, 0x03, 0x00, 0xc0, 0xfe, 0x7f, 0x03, 0xc0, 0x55, 0x05,
|
||||
0x00, 0x50, 0x54, 0x55, 0x02, 0x80, 0xff, 0x03, 0x00, 0xc0, 0xff, 0xff,
|
||||
0x01, 0x80, 0xaa, 0x0a, 0x00, 0xa0, 0xaa, 0xaa, 0x01, 0x00, 0x00, 0x00,
|
||||
0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xc3, 0xc0, 0x03,
|
||||
0x33, 0x55, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x0c, 0x3c, 0x30, 0x0c, 0x30,
|
||||
0x3c, 0xe7, 0xe0, 0x07, 0x33, 0xaa, 0x00, 0x00, 0x06, 0x60, 0x00, 0x06,
|
||||
0x66, 0x60, 0x06, 0x60, 0x66, 0x7e, 0x70, 0x0e, 0xcc, 0x55, 0x80, 0x01,
|
||||
0x03, 0xc0, 0x81, 0x03, 0xc3, 0xc0, 0x83, 0xc1, 0xc3, 0x3c, 0x38, 0x1c,
|
||||
0xcc, 0xaa, 0xc0, 0x03, 0x01, 0x80, 0xc3, 0x03, 0x81, 0xc0, 0xc1, 0x83,
|
||||
0xc3, 0x3c, 0x1c, 0x38, 0x33, 0x55, 0x60, 0x06, 0x00, 0x00, 0x66, 0x06,
|
||||
0x00, 0x60, 0x60, 0x06, 0x66, 0x7e, 0x0e, 0x70, 0x33, 0xaa, 0x30, 0x0c,
|
||||
0x00, 0x00, 0x3c, 0x0c, 0x00, 0x30, 0x30, 0x0c, 0x3c, 0xe7, 0x07, 0xe0,
|
||||
0xcc, 0x55, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18,
|
||||
0x18, 0xc3, 0x03, 0xc0, 0xcc, 0xaa, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x60, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x73, 0xf8,
|
||||
0x3c, 0x3c, 0x1e, 0x38, 0xc6, 0x60, 0x6c, 0x70, 0x60, 0x60, 0xc7, 0x7e,
|
||||
0xfe, 0xee, 0xde, 0xc6, 0x66, 0x66, 0x30, 0x6c, 0x6c, 0x7c, 0x6c, 0xd8,
|
||||
0x3c, 0x3c, 0x6c, 0xdb, 0xc6, 0x6c, 0xcc, 0xc6, 0x66, 0x66, 0x7c, 0xc6,
|
||||
0x38, 0x66, 0x6c, 0xd8, 0x66, 0x66, 0x38, 0xdb, 0x60, 0xc6, 0xde, 0xfc,
|
||||
0x3c, 0x3c, 0x30, 0xfe, 0x30, 0x66, 0xfe, 0x7e, 0x3c, 0x66, 0x18, 0xc3,
|
||||
0x30, 0xc6, 0x73, 0xc6, 0x66, 0x60, 0x1e, 0xc6, 0x60, 0x66, 0x00, 0x00,
|
||||
0x0c, 0x0c, 0x3c, 0x66, 0x60, 0xc6, 0x00, 0xc6, 0x66, 0x60, 0x00, 0x6c,
|
||||
0xc0, 0x00, 0x00, 0x00, 0x06, 0x06, 0xe6, 0x00, 0xc6, 0x7c, 0x00, 0x7c,
|
||||
0x00, 0x3c, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00,
|
||||
0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x83, 0x38, 0x34,
|
||||
0xf0, 0x00, 0x04, 0x1e, 0x02, 0x66, 0x18, 0x00, 0x3c, 0x18, 0x00, 0x6e,
|
||||
0x00, 0x84, 0x44, 0x34, 0x18, 0x00, 0x1e, 0x08, 0x0f, 0x66, 0x18, 0x06,
|
||||
0x66, 0x18, 0x00, 0x76, 0x00, 0x84, 0xba, 0x34, 0x38, 0x00, 0x54, 0x44,
|
||||
0xea, 0x66, 0x00, 0x06, 0x66, 0x18, 0xc6, 0x66, 0x00, 0xee, 0xa2, 0x74,
|
||||
0x6c, 0x00, 0x4c, 0x52, 0x16, 0xdc, 0x7e, 0x7e, 0x30, 0x18, 0x6c, 0x00,
|
||||
0x00, 0x94, 0xba, 0xf4, 0x38, 0x0c, 0x44, 0x4c, 0x62, 0x00, 0x00, 0x00,
|
||||
0x18, 0x18, 0x38, 0x4c, 0x66, 0x90, 0x44, 0xf4, 0x30, 0x18, 0xc0, 0xc0,
|
||||
0x10, 0x4c, 0x18, 0x00, 0x00, 0x00, 0x10, 0x32, 0x66, 0xe0, 0x38, 0x7e,
|
||||
0x1e, 0x18, 0x40, 0x40, 0xe0, 0x32, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00,
|
||||
0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
|
||||
0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00,
|
||||
0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18,
|
||||
0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
|
||||
0x1f, 0x0f, 0x18, 0x18, 0x1f, 0x1f, 0xf8, 0xf0, 0xff, 0xff, 0xf8, 0xf8,
|
||||
0xff, 0xff, 0x18, 0x18, 0x1f, 0x1f, 0x18, 0x18, 0x0f, 0x1f, 0xf8, 0xf8,
|
||||
0xff, 0xff, 0xf0, 0xf8, 0xff, 0xff, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18,
|
||||
0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18,
|
||||
0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18,
|
||||
0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18,
|
||||
0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0,
|
||||
0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
|
||||
0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff,
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f,
|
||||
0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0,
|
||||
0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0,
|
||||
0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0,
|
||||
0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0,
|
||||
0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0,
|
||||
0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0,
|
||||
0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0,
|
||||
0x0f, 0xff, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x60, 0x06, 0x60, 0x7c, 0x0e, 0x3e,
|
||||
0x18, 0x36, 0x66, 0x0c, 0x7e, 0x0e, 0x18, 0x70, 0x00, 0xcc, 0x7c, 0x3e,
|
||||
0x60, 0x06, 0x18, 0x66, 0x3c, 0x3e, 0x3c, 0x3e, 0x30, 0x18, 0x18, 0x18,
|
||||
0x00, 0x33, 0x66, 0x66, 0x60, 0x3c, 0x18, 0x66, 0x66, 0x7f, 0x18, 0x66,
|
||||
0x18, 0x18, 0x18, 0x18, 0x00, 0xcc, 0x66, 0x66, 0x66, 0x60, 0x18, 0x66,
|
||||
0x66, 0x6b, 0x3c, 0x66, 0x0c, 0x70, 0x18, 0x0e, 0x00, 0x33, 0x7c, 0x3e,
|
||||
0x7c, 0x3e, 0x7e, 0x66, 0x66, 0x63, 0x66, 0x66, 0x7e, 0x18, 0x18, 0x18,
|
||||
0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0x18, 0x18, 0xdc, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x18, 0x70, 0x76, 0xcc, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x3e, 0x7c, 0x3c, 0x3e, 0x3c, 0x18, 0x06, 0x66, 0x3c,
|
||||
0x06, 0x66, 0x3c, 0x63, 0x66, 0x3c, 0x00, 0x66, 0x66, 0x60, 0x66, 0x60,
|
||||
0x18, 0x3e, 0x66, 0x18, 0x06, 0x6c, 0x18, 0x6b, 0x66, 0x66, 0x00, 0x3e,
|
||||
0x66, 0x60, 0x66, 0x7e, 0x18, 0x66, 0x66, 0x18, 0x06, 0x78, 0x18, 0x7f,
|
||||
0x66, 0x66, 0x00, 0x06, 0x7c, 0x60, 0x3e, 0x66, 0x3e, 0x66, 0x7c, 0x38,
|
||||
0x06, 0x6c, 0x18, 0x7f, 0x66, 0x66, 0x0c, 0x3c, 0x60, 0x3c, 0x06, 0x3c,
|
||||
0x18, 0x3e, 0x60, 0x00, 0x00, 0x60, 0x18, 0x66, 0x7c, 0x3c, 0x18, 0x00,
|
||||
0x60, 0x00, 0x06, 0x00, 0x0e, 0x00, 0x60, 0x18, 0x06, 0x60, 0x38, 0x00,
|
||||
0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x36,
|
||||
0x66, 0x3c, 0x18, 0x7e, 0x18, 0x63, 0x66, 0x18, 0x7e, 0x1e, 0x06, 0x78,
|
||||
0x00, 0xff, 0x60, 0x6c, 0x6c, 0x06, 0x18, 0x66, 0x3c, 0x77, 0x66, 0x18,
|
||||
0x60, 0x18, 0x0c, 0x18, 0x00, 0x00, 0x7c, 0x66, 0x7c, 0x06, 0x18, 0x66,
|
||||
0x66, 0x7f, 0x3c, 0x18, 0x30, 0x18, 0x18, 0x18, 0x63, 0x00, 0x66, 0x66,
|
||||
0x66, 0x3c, 0x18, 0x66, 0x66, 0x6b, 0x3c, 0x3c, 0x18, 0x18, 0x30, 0x18,
|
||||
0x36, 0x00, 0x66, 0x66, 0x66, 0x60, 0x18, 0x66, 0x66, 0x63, 0x66, 0x66,
|
||||
0x0c, 0x18, 0x60, 0x18, 0x1c, 0x00, 0x7c, 0x3c, 0x7c, 0x3c, 0x7e, 0x66,
|
||||
0x66, 0x63, 0x66, 0x66, 0x7e, 0x1e, 0x40, 0x78, 0x08, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x66, 0x7c, 0x3c, 0x78, 0x7e,
|
||||
0x60, 0x3e, 0x66, 0x7e, 0x3c, 0x66, 0x7e, 0x63, 0x66, 0x3c, 0x60, 0x7e,
|
||||
0x66, 0x66, 0x6c, 0x60, 0x60, 0x66, 0x66, 0x18, 0x66, 0x6c, 0x60, 0x63,
|
||||
0x6e, 0x66, 0x6e, 0x66, 0x66, 0x60, 0x66, 0x60, 0x60, 0x6e, 0x66, 0x18,
|
||||
0x06, 0x78, 0x60, 0x6b, 0x7e, 0x66, 0x6e, 0x66, 0x7c, 0x60, 0x66, 0x7c,
|
||||
0x7c, 0x60, 0x7e, 0x18, 0x06, 0x78, 0x60, 0x7f, 0x7e, 0x66, 0x66, 0x3c,
|
||||
0x66, 0x66, 0x6c, 0x60, 0x60, 0x60, 0x66, 0x18, 0x06, 0x6c, 0x60, 0x77,
|
||||
0x76, 0x66, 0x3c, 0x18, 0x7c, 0x3c, 0x78, 0x7e, 0x7e, 0x3e, 0x66, 0x7e,
|
||||
0x06, 0x66, 0x60, 0x63, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3c, 0x7e, 0x7e, 0x3c, 0x0c, 0x3c, 0x3c, 0x30, 0x3c, 0x38,
|
||||
0x18, 0x18, 0x06, 0x00, 0x60, 0x18, 0x66, 0x18, 0x30, 0x66, 0x7e, 0x66,
|
||||
0x66, 0x30, 0x66, 0x0c, 0x18, 0x18, 0x0c, 0x7e, 0x30, 0x00, 0x76, 0x18,
|
||||
0x18, 0x0c, 0x6c, 0x06, 0x66, 0x18, 0x66, 0x06, 0x00, 0x00, 0x18, 0x00,
|
||||
0x18, 0x18, 0x6e, 0x18, 0x0c, 0x18, 0x3c, 0x7c, 0x7c, 0x0c, 0x3c, 0x3e,
|
||||
0x18, 0x18, 0x30, 0x00, 0x0c, 0x0c, 0x66, 0x38, 0x66, 0x0c, 0x1c, 0x60,
|
||||
0x60, 0x06, 0x66, 0x66, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x66, 0x3c, 0x18,
|
||||
0x3c, 0x7e, 0x0c, 0x7e, 0x3c, 0x7e, 0x3c, 0x3c, 0x00, 0x00, 0x0c, 0x00,
|
||||
0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x06, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18,
|
||||
0x00, 0x66, 0x18, 0x46, 0x3b, 0x00, 0x0e, 0x70, 0x00, 0x00, 0x18, 0x00,
|
||||
0x18, 0x40, 0x00, 0x00, 0x00, 0xff, 0x7c, 0x66, 0x66, 0x00, 0x1c, 0x38,
|
||||
0x66, 0x18, 0x18, 0x00, 0x18, 0x60, 0x00, 0x18, 0x00, 0x66, 0x06, 0x30,
|
||||
0x6f, 0x00, 0x18, 0x18, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x18,
|
||||
0x66, 0x66, 0x3c, 0x18, 0x38, 0x18, 0x18, 0x18, 0xff, 0x7e, 0x00, 0x7e,
|
||||
0x00, 0x18, 0x00, 0x18, 0x66, 0xff, 0x60, 0x6c, 0x1c, 0x18, 0x1c, 0x38,
|
||||
0x3c, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x18, 0x66, 0x66, 0x3e, 0x66,
|
||||
0x36, 0x18, 0x0e, 0x70, 0x66, 0x18, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
|
||||
0x00, 0x00, 0x18, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xff, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0xe7, 0x00, 0xff, 0x18,
|
||||
0x00, 0x3c, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x66, 0x7e, 0x7e, 0x66, 0x31,
|
||||
0x66, 0x03, 0x66, 0x18, 0x18, 0x66, 0xc3, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3,
|
||||
0xdb, 0xdb, 0xc3, 0x7b, 0x66, 0x03, 0x3c, 0x3c, 0x00, 0xc3, 0xc3, 0xdb,
|
||||
0xdb, 0xc3, 0xc3, 0xdf, 0xdb, 0xdb, 0xfb, 0xce, 0x66, 0x03, 0x18, 0x3c,
|
||||
0x18, 0xc3, 0xfb, 0xdb, 0xdb, 0xdf, 0xff, 0xdb, 0xdf, 0xfb, 0xdb, 0x1e,
|
||||
0x66, 0xff, 0x18, 0x3c, 0x30, 0xff, 0xdb, 0xfb, 0xdf, 0xdb, 0xc3, 0xdb,
|
||||
0xc3, 0xc3, 0xdb, 0x33, 0x66, 0x03, 0x3c, 0x3c, 0x66, 0xc3, 0xdb, 0xc3,
|
||||
0xc3, 0xdb, 0xc3, 0x7e, 0x66, 0x66, 0x7e, 0x01, 0x66, 0x03, 0x66, 0x18,
|
||||
0x66, 0x66, 0xdb, 0xc3, 0xc3, 0xdb, 0xff, 0x3c, 0x3c, 0x3c, 0x3c, 0x00,
|
||||
0x7e, 0x03, 0xff, 0x18, 0x3c, 0x3c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0,
|
||||
0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00,
|
||||
0x3c, 0x3c, 0xc3, 0xc0, 0x18, 0x03, 0x30, 0xc3, 0x30, 0xe7, 0x30, 0x0c,
|
||||
0x3c, 0x18, 0x3c, 0x30, 0x66, 0x66, 0xc3, 0xc0, 0x18, 0x03, 0x18, 0xe7,
|
||||
0x78, 0x24, 0x60, 0x06, 0x7e, 0x18, 0x7e, 0x60, 0xff, 0xc3, 0xc3, 0xc0,
|
||||
0x18, 0x03, 0x0c, 0xdb, 0xcc, 0xff, 0xff, 0xff, 0xdb, 0x18, 0xdb, 0xfe,
|
||||
0xdb, 0xdb, 0xc3, 0xc0, 0x18, 0x03, 0x7e, 0xdb, 0x06, 0xc3, 0x60, 0x06,
|
||||
0x18, 0xdb, 0x99, 0x63, 0xdb, 0xdb, 0xc3, 0xc0, 0x18, 0x03, 0x30, 0xe7,
|
||||
0x03, 0xc3, 0x30, 0x0c, 0x18, 0x7e, 0x3c, 0x33, 0xff, 0xc3, 0xc3, 0xc0,
|
||||
0x18, 0x03, 0x18, 0xc3, 0x01, 0x66, 0x00, 0x00, 0x18, 0x3c, 0x5a, 0x03,
|
||||
0x66, 0x66, 0xff, 0xff, 0x18, 0x03, 0x0c, 0xff, 0x00, 0x3c, 0x00, 0x00,
|
||||
0x18, 0x18, 0x18, 0x00, 0x3c, 0x3c
|
||||
};
|
||||
unsigned int font_bmp_len = 2178;
|
||||
12
main.cpp
12
main.cpp
@@ -3,7 +3,7 @@
|
||||
#include "vm.h"
|
||||
#include "vdp.h"
|
||||
#include "sound.h"
|
||||
#include <SDL.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include "debug.h"
|
||||
|
||||
#define BTN_ANY 0
|
||||
@@ -39,13 +39,13 @@ unsigned char input_data_out() {
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
// Inicialitzar la m<>quina virtual (li arriba el arxiu amb el programa per linea de comandos)
|
||||
// Inicialitzar la m<>quina virtual (li arriba el arxiu amb el programa per linea de comandos)
|
||||
vm_init(argc < 2 ? nullptr : argv[1]); // "test.bas"
|
||||
|
||||
// Inicialitzar el procesador gr<67>fic
|
||||
// Inicialitzar el procesador gr<67>fic
|
||||
vdp_init();
|
||||
|
||||
// Registrar els ports d'entrada i eixida del procesador gr<67>fic
|
||||
// Registrar els ports d'entrada i eixida del procesador gr<67>fic
|
||||
vm_register_out_port(10, vdp_data_out);
|
||||
vm_register_out_port(11, vdp_cmd_out);
|
||||
vm_register_in_port(12, vdp_in);
|
||||
@@ -54,10 +54,10 @@ int main(int argc, char** argv) {
|
||||
vm_register_out_port(20, input_data_in);
|
||||
vm_register_in_port(21, input_data_out);
|
||||
|
||||
// Inicialitzar el procesador de s<>
|
||||
// Inicialitzar el procesador de s<>
|
||||
sound_init();
|
||||
|
||||
// Registrar els ports d'entrada i eixida del procesador de s<>
|
||||
// Registrar els ports d'entrada i eixida del procesador de s<>
|
||||
vm_register_out_port(30, sound_data_out);
|
||||
vm_register_out_port(31, sound_cmd_out);
|
||||
vm_register_in_port(32, sound_in);
|
||||
|
||||
22
paco.sln
22
paco.sln
@@ -1,22 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "paco", "paco.vcxproj", "{E0E409C8-8E79-4688-A9FB-29BD309B1B52}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0E409C8-8E79-4688-A9FB-29BD309B1B52}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0E409C8-8E79-4688-A9FB-29BD309B1B52}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0E409C8-8E79-4688-A9FB-29BD309B1B52}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0E409C8-8E79-4688-A9FB-29BD309B1B52}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
111
paco.vcxproj
111
paco.vcxproj
@@ -1,111 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E0E409C8-8E79-4688-A9FB-29BD309B1B52}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>paco</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>C:\dev\lib\sdl2\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\dev\lib\sdl2\lib\x86;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>C:\dev\lib\sdl2\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\dev\lib\sdl2\lib\x86;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="debug.cpp" />
|
||||
<ClCompile Include="error.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="parser.cpp" />
|
||||
<ClCompile Include="sound.cpp" />
|
||||
<ClCompile Include="stack.cpp" />
|
||||
<ClCompile Include="tokenizer.cpp" />
|
||||
<ClCompile Include="vdp.cpp" />
|
||||
<ClCompile Include="vm.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="constants.h" />
|
||||
<ClInclude Include="debug.h" />
|
||||
<ClInclude Include="error.h" />
|
||||
<ClInclude Include="font.h" />
|
||||
<ClInclude Include="parser.h" />
|
||||
<ClInclude Include="sound.h" />
|
||||
<ClInclude Include="stack.h" />
|
||||
<ClInclude Include="stb_image.h" />
|
||||
<ClInclude Include="tokenizer.h" />
|
||||
<ClInclude Include="vdp.h" />
|
||||
<ClInclude Include="vm.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,81 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stack.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="vm.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="vdp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="error.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="parser.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tokenizer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="debug.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="sound.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="vm.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stack.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stb_image.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="vdp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="font.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tokenizer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="error.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="parser.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="constants.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="debug.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sound.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "sound.h"
|
||||
#include <SDL.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
6845
stb_image.h
6845
stb_image.h
File diff suppressed because it is too large
Load Diff
4
vdp.cpp
4
vdp.cpp
@@ -1,6 +1,4 @@
|
||||
#include <SDL.h>
|
||||
//#define STB_IMAGE_IMPLEMENTATION
|
||||
//#include "stb_image.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <string.h>
|
||||
#include "font.h"
|
||||
#include "error.h"
|
||||
|
||||
Reference in New Issue
Block a user