no message

This commit is contained in:
BADIM-PC\Vadim committed 2018-01-24 12:20:05 +03:00
1 parent 6cc4560cdc
commit ee5830b613
18 files changed
+1365 -833

No files matched your search

+5 -1
View File
@@ -241,6 +241,9 @@ bin/menu.o: src/menu.c $(TIC80_H) $(TIC_H)
bin/surf.o: src/surf.c $(TIC80_H) $(TIC_H)
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
bin/main.o: src/main.c src/keycodes.c $(TIC80_H) $(TIC_H)
$(CC) $< $(OPT) $(INCLUDES) -c -o $@
TIC_O=\
bin/studio.o \
bin/console.o \
@@ -265,7 +268,8 @@ TIC_O=\
bin/net.o \
bin/dialog.o \
bin/menu.o \
bin/surf.o
bin/surf.o \
bin/main.o
bin/tic80.o: src/tic80.c $(TIC80_H)
$(CC) $< $(OPT) $(INCLUDES) -DTIC80_SHARED -c -o $@
+1 -1
View File
@@ -1 +1 @@
0x78, 0xda, 0xec, 0xbd, 0x09, 0x77, 0xe2, 0x48, 0xb3, 0x20, 0xfa, 0x57, 0xdc, 0x9c, 0x7e, 0x35, 0xa6, 0x45, 0x1b, 0x49, 0xec, 0xe5, 0xa6, 0xfb, 0x48, 0x42, 0xec, 0xfb, 0x0e, 0x6e, 0x4f, 0x1d, 0x21, 0x09, 0x10, 0x68, 0x01, 0x2d, 0x08, 0xa8, 0xf2, 0xfd, 0xed, 0x93, 0x91, 0x5a, 0x10, 0x18, 0xbb, 0xeb, 0xbb, 0xdf, 0x7d, 0x6f, 0xe6, 0x9d, 0x3b, 0xd5, 0xa7, 0x6d, 0x65, 0x46, 0x46, 0x64, 0x64, 0x64, 0x6c, 0xb9, 0x48, 0x3e, 0x08, 0xe6, 0x43, 0xcb, 0x90, 0x1c, 0x55, 0x2e, 0xda, 0xa7, 0x9d, 0x6c, 0x2c, 0xfd, 0xd2, 0x2f, 0xc5, 0x62, 0xcc, 0xd1, 0x25, 0x79, 0xa9, 0xe8, 0xb2, 0x14, 0xfb, 0xcb, 0xab, 0xfc, 0xfa, 0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 0xfb, 0xa3, 0xfd, 0xc3, 0xd4, 0x60, 0xe5, 0x1f, 0x6b, 0x5f, 0x06, 0xfd, 0x29, 0x24, 0x52, 0xce, 0x1f, 0x15, 0xf8, 0x72, 0x01, 0xbc, 0x55, 0xfd, 0xa1, 0x73, 0x1f, 0x8c, 0xa1, 0xb5, 0xf0, 0xe1, 0xc3, 0x7f, 0x93, 0xe4, 0xf6, 0xd5, 0x4e, 0x2a, 0x10, 0x48, 0xa2, 0x96, 0xff, 0x12, 0xca, 0xd8, 0xfb, 0x7e, 0x74, 0x53, 0xbe, 0x6c, 0x13, 0x47, 0xab, 0xb7, 0xe3, 0x68, 0xb0, 0x07, 0xe5, 0x71, 0xfc, 0x97, 0xb7, 0x36, 0x1b, 0xdb, 0xaf, 0x5d, 0x2f, 0xbc, 0xf2, 0x9e, 0xb0, 0x58, 0x93, 0x4b, 0xcf, 0xdc, 0x99, 0x1a, 0x17, 0x40, 0xf5, 0x67, 0x53, 0x50, 0xbc, 0x09, 0x70, 0x16, 0x29, 0Line truncated
+162 -162
View File
@@ -1052,40 +1052,40 @@ static void processMouse(Code* code)
static void textEditTick(Code* code)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_MOUSEWHEEL:
{
enum{Scroll = 3};
s32 delta = event->wheel.y > 0 ? -Scroll : Scroll;
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_MOUSEWHEEL:
// {
// enum{Scroll = 3};
// s32 delta = event->wheel.y > 0 ? -Scroll : Scroll;
code->scroll.y += delta;
// code->scroll.y += delta;
normalizeScroll(code);
}
break;
case SDL_KEYDOWN:
processKeydown(code, event->key.keysym.sym);
break;
case SDL_TEXTINPUT:
// normalizeScroll(code);
// }
// break;
// case SDL_KEYDOWN:
// processKeydown(code, event->key.keysym.sym);
// break;
// case SDL_TEXTINPUT:
#if defined(__LINUX__)
if(!(SDL_GetModState() & KMOD_LALT))
#endif
// #if defined(__LINUX__)
// if(!(SDL_GetModState() & KMOD_LALT))
// #endif
if(strlen(event->text.text) == 1)
{
// if(strlen(event->text.text) == 1)
// {
inputSymbol(code, *event->text.text);
updateEditor(code);
}
break;
}
}
// inputSymbol(code, *event->text.text);
// updateEditor(code);
// }
// break;
// }
// }
processGestures(code);
processMouse(code);
@@ -1146,54 +1146,54 @@ static char* downStrStr(const char* start, const char* from, const char* substr)
static void textFindTick(Code* code)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
switch(event->key.keysym.sym)
{
case SDLK_RETURN:
setCodeMode(code, TEXT_EDIT_MODE);
break;
case SDLK_UP:
case SDLK_LEFT:
case SDLK_DOWN:
case SDLK_RIGHT:
if(*code->popup.text)
{
SDL_Keycode keycode = event->key.keysym.sym;
bool reverse = keycode == SDLK_UP || keycode == SDLK_LEFT;
char* (*func)(const char*, const char*, const char*) = reverse ? upStrStr : downStrStr;
char* from = reverse ? SDL_min(code->cursor.position, code->cursor.selection) : SDL_max(code->cursor.position, code->cursor.selection);
char* pos = func(code->src, from, code->popup.text);
updateFindCode(code, pos);
}
break;
case SDLK_BACKSPACE:
if(*code->popup.text)
{
code->popup.text[strlen(code->popup.text)-1] = '\0';
updateFindCode(code, strstr(code->src, code->popup.text));
}
break;
default: break;
}
break;
case SDL_TEXTINPUT:
if(strlen(event->text.text) == 1)
{
if(strlen(code->popup.text) + 1 < sizeof code->popup.text)
{
strcat(code->popup.text, event->text.text);
updateFindCode(code, strstr(code->src, code->popup.text));
}
}
break;
default: break;
}
}
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// switch(event->key.keysym.sym)
// {
// case SDLK_RETURN:
// setCodeMode(code, TEXT_EDIT_MODE);
// break;
// case SDLK_UP:
// case SDLK_LEFT:
// case SDLK_DOWN:
// case SDLK_RIGHT:
// if(*code->popup.text)
// {
// SDL_Keycode keycode = event->key.keysym.sym;
// bool reverse = keycode == SDLK_UP || keycode == SDLK_LEFT;
// char* (*func)(const char*, const char*, const char*) = reverse ? upStrStr : downStrStr;
// char* from = reverse ? SDL_min(code->cursor.position, code->cursor.selection) : SDL_max(code->cursor.position, code->cursor.selection);
// char* pos = func(code->src, from, code->popup.text);
// updateFindCode(code, pos);
// }
// break;
// case SDLK_BACKSPACE:
// if(*code->popup.text)
// {
// code->popup.text[strlen(code->popup.text)-1] = '\0';
// updateFindCode(code, strstr(code->src, code->popup.text));
// }
// break;
// default: break;
// }
// break;
// case SDL_TEXTINPUT:
// if(strlen(event->text.text) == 1)
// {
// if(strlen(code->popup.text) + 1 < sizeof code->popup.text)
// {
// strcat(code->popup.text, event->text.text);
// updateFindCode(code, strstr(code->src, code->popup.text));
// }
// }
// break;
// default: break;
// }
// }
code->tic->api.clear(code->tic, getConfig()->theme.code.bg);
@@ -1223,45 +1223,45 @@ static void updateGotoCode(Code* code)
static void textGoToTick(Code* code)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
switch(event->key.keysym.sym)
{
case SDLK_RETURN:
if(*code->popup.text)
updateGotoCode(code);
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// switch(event->key.keysym.sym)
// {
// case SDLK_RETURN:
// if(*code->popup.text)
// updateGotoCode(code);
setCodeMode(code, TEXT_EDIT_MODE);
break;
case SDLK_BACKSPACE:
if(*code->popup.text)
{
code->popup.text[strlen(code->popup.text)-1] = '\0';
updateGotoCode(code);
}
break;
default: break;
}
break;
case SDL_TEXTINPUT:
if(strlen(event->text.text) == 1)
{
char sym = *event->text.text;
// setCodeMode(code, TEXT_EDIT_MODE);
// break;
// case SDLK_BACKSPACE:
// if(*code->popup.text)
// {
// code->popup.text[strlen(code->popup.text)-1] = '\0';
// updateGotoCode(code);
// }
// break;
// default: break;
// }
// break;
// case SDL_TEXTINPUT:
// if(strlen(event->text.text) == 1)
// {
// char sym = *event->text.text;
if(strlen(code->popup.text)+1 < sizeof code->popup.text && sym >= '0' && sym <= '9')
{
strcat(code->popup.text, event->text.text);
updateGotoCode(code);
}
}
break;
default: break;
}
}
// if(strlen(code->popup.text)+1 < sizeof code->popup.text && sym >= '0' && sym <= '9')
// {
// strcat(code->popup.text, event->text.text);
// updateGotoCode(code);
// }
// }
// break;
// default: break;
// }
// }
code->tic->api.clear(code->tic, getConfig()->theme.code.bg);
@@ -1321,55 +1321,55 @@ static void drawOutlineBar(Code* code, s32 x, s32 y)
static void textOutlineTick(Code* code)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
switch(event->key.keysym.sym)
{
case SDLK_UP:
if(code->outline.index > 0)
{
code->outline.index--;
updateOutlineCode(code);
}
break;
case SDLK_DOWN:
if(code->outline.index < OUTLINE_SIZE - 1 && code->outline.items[code->outline.index + 1].pos)
{
code->outline.index++;
updateOutlineCode(code);
}
break;
case SDLK_RETURN:
updateOutlineCode(code);
setCodeMode(code, TEXT_EDIT_MODE);
break;
case SDLK_BACKSPACE:
if(*code->popup.text)
{
code->popup.text[strlen(code->popup.text)-1] = '\0';
setOutlineMode(code);
}
break;
default: break;
}
break;
case SDL_TEXTINPUT:
if(strlen(event->text.text) == 1)
{
if(strlen(code->popup.text) + 1 < sizeof code->popup.text)
{
strcat(code->popup.text, event->text.text);
setOutlineMode(code);
}
}
break;
default: break;
}
}
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// switch(event->key.keysym.sym)
// {
// case SDLK_UP:
// if(code->outline.index > 0)
// {
// code->outline.index--;
// updateOutlineCode(code);
// }
// break;
// case SDLK_DOWN:
// if(code->outline.index < OUTLINE_SIZE - 1 && code->outline.items[code->outline.index + 1].pos)
// {
// code->outline.index++;
// updateOutlineCode(code);
// }
// break;
// case SDLK_RETURN:
// updateOutlineCode(code);
// setCodeMode(code, TEXT_EDIT_MODE);
// break;
// case SDLK_BACKSPACE:
// if(*code->popup.text)
// {
// code->popup.text[strlen(code->popup.text)-1] = '\0';
// setOutlineMode(code);
// }
// break;
// default: break;
// }
// break;
// case SDL_TEXTINPUT:
// if(strlen(event->text.text) == 1)
// {
// if(strlen(code->popup.text) + 1 < sizeof code->popup.text)
// {
// strcat(code->popup.text, event->text.text);
// setOutlineMode(code);
// }
// }
// break;
// default: break;
// }
// }
code->tic->api.clear(code->tic, getConfig()->theme.code.bg);
+68 -68
View File
@@ -2537,81 +2537,81 @@ static void checkNewVersion(Console* console)
static void tick(Console* console)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_MOUSEWHEEL:
{
enum{Scroll = 3};
s32 delta = event->wheel.y > 0 ? -Scroll : Scroll;
setScroll(console, console->scroll.pos + delta);
}
break;
case SDL_KEYDOWN:
{
switch(event->key.keysym.sym)
{
case SDLK_UP:
onHistoryUp(console);
break;
case SDLK_DOWN:
onHistoryDown(console);
break;
case SDLK_RIGHT:
{
console->inputPosition++;
size_t len = strlen(console->inputBuffer);
if(console->inputPosition > len)
console->inputPosition = len;
}
break;
case SDLK_LEFT:
{
if(console->inputPosition > 0)
console->inputPosition--;
}
break;
case SDLK_RETURN: processConsoleCommand(console); break;
case SDLK_BACKSPACE: processConsoleBackspace(console); break;
case SDLK_DELETE: processConsoleDel(console); break;
case SDLK_HOME: processConsoleHome(console); break;
case SDLK_END: processConsoleEnd(console); break;
case SDLK_TAB: processConsoleTab(console); break;
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_MOUSEWHEEL:
// {
// enum{Scroll = 3};
// s32 delta = event->wheel.y > 0 ? -Scroll : Scroll;
// setScroll(console, console->scroll.pos + delta);
// }
// break;
// case SDL_KEYDOWN:
// {
// switch(event->key.keysym.sym)
// {
// case SDLK_UP:
// onHistoryUp(console);
// break;
// case SDLK_DOWN:
// onHistoryDown(console);
// break;
// case SDLK_RIGHT:
// {
// console->inputPosition++;
// size_t len = strlen(console->inputBuffer);
// if(console->inputPosition > len)
// console->inputPosition = len;
// }
// break;
// case SDLK_LEFT:
// {
// if(console->inputPosition > 0)
// console->inputPosition--;
// }
// break;
// case SDLK_RETURN: processConsoleCommand(console); break;
// case SDLK_BACKSPACE: processConsoleBackspace(console); break;
// case SDLK_DELETE: processConsoleDel(console); break;
// case SDLK_HOME: processConsoleHome(console); break;
// case SDLK_END: processConsoleEnd(console); break;
// case SDLK_TAB: processConsoleTab(console); break;
default: break;
}
// default: break;
// }
scrollConsole(console);
console->cursor.delay = CONSOLE_CURSOR_DELAY;
}
break;
case SDL_TEXTINPUT:
{
const char* symbol = event->text.text;
// scrollConsole(console);
// console->cursor.delay = CONSOLE_CURSOR_DELAY;
// }
// break;
// case SDL_TEXTINPUT:
// {
// const char* symbol = event->text.text;
if(strlen(symbol) == 1)
{
char sym = *symbol;
// if(strlen(symbol) == 1)
// {
// char sym = *symbol;
size_t size = strlen(console->inputBuffer);
// size_t size = strlen(console->inputBuffer);
if(size < sizeof(console->inputBuffer))
{
char* pos = console->inputBuffer + console->inputPosition;
memmove(pos + 1, pos, strlen(pos));
// if(size < sizeof(console->inputBuffer))
// {
// char* pos = console->inputBuffer + console->inputPosition;
// memmove(pos + 1, pos, strlen(pos));
*(console->inputBuffer + console->inputPosition) = sym;
console->inputPosition++;
}
}
// *(console->inputBuffer + console->inputPosition) = sym;
// console->inputPosition++;
// }
// }
console->cursor.delay = CONSOLE_CURSOR_DELAY;
}
break;
}
}
// console->cursor.delay = CONSOLE_CURSOR_DELAY;
// }
// break;
// }
// }
processGesture(console);
+10 -10
View File
@@ -191,16 +191,16 @@ static void drawDialog(Dialog* dlg)
static void tick(Dialog* dlg)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
processKeydown(dlg, &event->key.keysym);
break;
}
}
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// processKeydown(dlg, &event->key.keysym);
// break;
// }
// }
if(!dlg->init)
{
+521
View File
@@ -0,0 +1,521 @@
#include "main.h"
#include "studio.h"
#define STUDIO_UI_SCALE 3
#define STUDIO_PIXEL_FORMAT SDL_PIXELFORMAT_ARGB8888
#define TEXTURE_SIZE (TIC80_FULLWIDTH)
#define OFFSET_LEFT ((TIC80_FULLWIDTH-TIC80_WIDTH)/2)
#define OFFSET_TOP ((TIC80_FULLHEIGHT-TIC80_HEIGHT)/2)
static struct
{
SDL_Window* window;
SDL_Renderer* renderer;
SDL_Texture* texture;
struct
{
SDL_AudioSpec spec;
SDL_AudioDeviceID device;
SDL_AudioCVT cvt;
} audio;
bool quitFlag;
bool missedFrame;
} platform;
static void initSound()
{
SDL_AudioSpec want =
{
.freq = 44100,
.format = AUDIO_S16,
.channels = 1,
.userdata = NULL,
};
platform.audio.device = SDL_OpenAudioDevice(NULL, 0, &want, &platform.audio.spec, SDL_AUDIO_ALLOW_ANY_CHANGE);
SDL_BuildAudioCVT(&platform.audio.cvt, want.format, want.channels, platform.audio.spec.freq, platform.audio.spec.format, platform.audio.spec.channels, platform.audio.spec.freq);
if(platform.audio.cvt.needed)
{
platform.audio.cvt.len = platform.audio.spec.freq * sizeof(s16) / TIC_FRAMERATE;
platform.audio.cvt.buf = SDL_malloc(platform.audio.cvt.len * platform.audio.cvt.len_mult);
}
}
static void setWindowIcon()
{
// enum{ Size = 64, TileSize = 16, ColorKey = 14, Cols = TileSize / TIC_SPRITESIZE, Scale = Size/TileSize};
// studio.tic->api.clear(studio.tic, 0);
// u32* pixels = SDL_malloc(Size * Size * sizeof(u32));
// const u32* pal = tic_palette_blit(&studio.tic->config.palette);
// for(s32 j = 0, index = 0; j < Size; j++)
// for(s32 i = 0; i < Size; i++, index++)
// {
// u8 color = getSpritePixel(studio.tic->config.bank0.tiles.data, i/Scale, j/Scale);
// pixels[index] = color == ColorKey ? 0 : pal[color];
// }
// SDL_Surface* surface = SDL_CreateRGBSurfaceFrom(pixels, Size, Size,
// sizeof(s32) * BITS_IN_BYTE, Size * sizeof(s32),
// 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
// SDL_SetWindowIcon(platform.window, surface);
// SDL_FreeSurface(surface);
// SDL_free(pixels);
}
static void updateGamepadParts()
{
// s32 tileSize = TIC_SPRITESIZE;
// s32 offset = 0;
// SDL_Rect rect;
// const s32 JoySize = 3;
// SDL_GetWindowSize(platform.window, &rect.w, &rect.h);
// if(rect.w < rect.h)
// {
// tileSize = rect.w / 2 / JoySize;
// offset = (rect.h * 2 - JoySize * tileSize) / 3;
// }
// else
// {
// tileSize = rect.w / 5 / JoySize;
// offset = (rect.h - JoySize * tileSize) / 2;
// }
// studio.gamepad.part.size = tileSize;
// studio.gamepad.part.axis = (SDL_Point){0, offset};
// studio.gamepad.part.a = (SDL_Point){rect.w - 2*tileSize, 2*tileSize + offset};
// studio.gamepad.part.b = (SDL_Point){rect.w - 1*tileSize, 1*tileSize + offset};
// studio.gamepad.part.x = (SDL_Point){rect.w - 3*tileSize, 1*tileSize + offset};
// studio.gamepad.part.y = (SDL_Point){rect.w - 2*tileSize, 0*tileSize + offset};
}
static void transparentBlit(u32* out, s32 pitch)
{
// const u8* in = studio.tic->ram.vram.screen.data;
// const u8* end = in + sizeof(studio.tic->ram.vram.screen);
// const u32* pal = tic_palette_blit(&studio.tic->config.palette);
// const u32 Delta = (pitch/sizeof *out - TIC80_WIDTH);
// s32 col = 0;
// while(in != end)
// {
// u8 low = *in & 0x0f;
// u8 hi = (*in & 0xf0) >> TIC_PALETTE_BPP;
// *out++ = low ? (*(pal + low) | 0xff000000) : 0;
// *out++ = hi ? (*(pal + hi) | 0xff000000) : 0;
// in++;
// col += BITS_IN_BYTE / TIC_PALETTE_BPP;
// if (col == TIC80_WIDTH)
// {
// col = 0;
// out += Delta;
// }
// }
}
static void initTouchGamepad()
{
// if (!platform.renderer)
// return;
// studio.tic->api.map(studio.tic, &studio.tic->config.bank0.map, &studio.tic->config.bank0.tiles, 0, 0, TIC_MAP_SCREEN_WIDTH, TIC_MAP_SCREEN_HEIGHT, 0, 0, -1, 1);
// if(!studio.gamepad.texture)
// {
// studio.gamepad.texture = SDL_CreateTexture(platform.renderer, STUDIO_PIXEL_FORMAT, SDL_TEXTUREACCESS_STREAMING, TEXTURE_SIZE, TEXTURE_SIZE);
// SDL_SetTextureBlendMode(studio.gamepad.texture, SDL_BLENDMODE_BLEND);
// }
// {
// void* pixels = NULL;
// s32 pitch = 0;
// SDL_LockTexture(studio.gamepad.texture, NULL, &pixels, &pitch);
// transparentBlit(pixels, pitch);
// SDL_UnlockTexture(studio.gamepad.texture);
// }
// updateGamepadParts();
}
static SDL_Event* pollEvent()
{
static SDL_Event event;
if(SDL_PollEvent(&event))
{
switch(event.type)
{
// case SDL_KEYDOWN:
// if(processShortcuts(&event.key)) return NULL;
// break;
// case SDL_JOYDEVICEADDED:
// {
// s32 id = event.jdevice.which;
// if (id < TIC_GAMEPADS)
// {
// if(studio.joysticks[id])
// SDL_JoystickClose(studio.joysticks[id]);
// studio.joysticks[id] = SDL_JoystickOpen(id);
// }
// }
// break;
// case SDL_JOYDEVICEREMOVED:
// {
// s32 id = event.jdevice.which;
// if (id < TIC_GAMEPADS && studio.joysticks[id])
// {
// SDL_JoystickClose(studio.joysticks[id]);
// studio.joysticks[id] = NULL;
// }
// }
// break;
// case SDL_WINDOWEVENT:
// switch(event.window.event)
// {
// case SDL_WINDOWEVENT_RESIZED: updateGamepadParts(); break;
// case SDL_WINDOWEVENT_FOCUS_GAINED:
// #if defined(TIC80_PRO)
// if(studio.mode != TIC_START_MODE)
// {
// Console* console = studio.console;
// u64 mdate = fsMDate(console->fs, console->romName);
// if(studio.cart.mdate && mdate > studio.cart.mdate)
// {
// if(studioCartChanged())
// {
// static const char* Rows[] =
// {
// "",
// "CART HAS CHANGED!",
// "",
// "DO YOU WANT",
// "TO RELOAD IT?"
// };
// showDialog(Rows, COUNT_OF(Rows), reloadConfirm, NULL);
// }
// else console->updateProject(console);
// }
// }
// #endif
// {
// Code* code = studio.editor[studio.bank.index.code].code;
// studio.console->codeLiveReload.reload(studio.console, code->src);
// if(studio.console->codeLiveReload.active && code->update)
// code->update(code);
// }
// break;
// }
// break;
// case SDL_FINGERUP:
// showSoftKeyboard();
// break;
case SDL_QUIT:
platform.quitFlag = true;
// exitStudio();
break;
default:
break;
}
return &event;
}
// if(studio.mode != TIC_RUN_MODE)
// processGesture();
// if(!studio.gesture.active)
// processMouse();
// if(studio.mode == TIC_RUN_MODE)
// {
// if(studio.tic->input.gamepad) processGamepadInput();
// if(studio.tic->input.mouse) processMouseInput();
// if(studio.tic->input.keyboard) processKeyboardInput();
// }
// else
// {
// processGamepadInput();
// }
return NULL;
}
static void calcTextureRect(SDL_Rect* rect)
{
SDL_GetWindowSize(platform.window, &rect->w, &rect->h);
if (rect->w * TIC80_HEIGHT < rect->h * TIC80_WIDTH)
{
s32 discreteWidth = rect->w - rect->w % TIC80_WIDTH;
s32 discreteHeight = TIC80_HEIGHT * discreteWidth / TIC80_WIDTH;
rect->x = (rect->w - discreteWidth) / 2;
rect->y = rect->w > rect->h
? (rect->h - discreteHeight) / 2
: OFFSET_LEFT*discreteWidth/TIC80_WIDTH;
rect->w = discreteWidth;
rect->h = discreteHeight;
}
else
{
s32 discreteHeight = rect->h - rect->h % TIC80_HEIGHT;
s32 discreteWidth = TIC80_WIDTH * discreteHeight / TIC80_HEIGHT;
rect->x = (rect->w - discreteWidth) / 2;
rect->y = (rect->h - discreteHeight) / 2;
rect->w = discreteWidth;
rect->h = discreteHeight;
}
}
static void blitTexture()
{
// tic_mem* tic = studio.tic;
SDL_Rect rect = {0, 0, 0, 0};
calcTextureRect(&rect);
void* pixels = NULL;
s32 pitch = 0;
SDL_LockTexture(platform.texture, NULL, &pixels, &pitch);
studioTick(pixels);
// tic_scanline scanline = NULL;
// tic_overlap overlap = NULL;
// void* data = NULL;
// switch(studio.mode)
// {
// case TIC_RUN_MODE:
// scanline = tic->api.scanline;
// overlap = tic->api.overlap;
// break;
// case TIC_SPRITE_MODE:
// {
// Sprite* sprite = studio.editor[studio.bank.index.sprites].sprite;
// overlap = sprite->overlap;
// data = sprite;
// }
// break;
// case TIC_MAP_MODE:
// {
// Map* map = studio.editor[studio.bank.index.map].map;
// overlap = map->overlap;
// data = map;
// }
// break;
// default:
// break;
// }
// tic->api.blit(tic, scanline, overlap, data);
// SDL_memcpy(pixels, tic->screen, sizeof tic->screen);
// recordFrame(pixels);
// drawDesyncLabel(pixels);
SDL_UnlockTexture(platform.texture);
{
enum {Header = OFFSET_TOP};
SDL_Rect srcRect = {0, 0, TIC80_FULLWIDTH, Header};
SDL_Rect dstRect = {0};
SDL_GetWindowSize(platform.window, &dstRect.w, &dstRect.h);
dstRect.h = rect.y;
SDL_RenderCopy(platform.renderer, platform.texture, &srcRect, &dstRect);
}
{
enum {Header = OFFSET_TOP};
SDL_Rect srcRect = {0, TIC80_FULLHEIGHT - Header, TIC80_FULLWIDTH, Header};
SDL_Rect dstRect = {0};
SDL_GetWindowSize(platform.window, &dstRect.w, &dstRect.h);
dstRect.y = rect.y + rect.h;
dstRect.h = rect.y;
SDL_RenderCopy(platform.renderer, platform.texture, &srcRect, &dstRect);
}
{
enum {Header = OFFSET_TOP};
enum {Left = OFFSET_LEFT};
SDL_Rect srcRect = {0, Header, Left, TIC80_HEIGHT};
SDL_Rect dstRect = {0};
SDL_GetWindowSize(platform.window, &dstRect.w, &dstRect.h);
dstRect.y = rect.y;
dstRect.h = rect.h;
SDL_RenderCopy(platform.renderer, platform.texture, &srcRect, &dstRect);
}
{
enum {Top = OFFSET_TOP};
enum {Left = OFFSET_LEFT};
SDL_Rect srcRect = {Left, Top, TIC80_WIDTH, TIC80_HEIGHT};
SDL_RenderCopy(platform.renderer, platform.texture, &srcRect, &rect);
}
}
static void tick()
{
pollEvent();
// if(!studio.fs) return;
// if(studio.quitFlag)
// {
// #if defined __EMSCRIPTEN__
// studio.tic->api.clear(studio.tic, TIC_COLOR_BG);
// blitTexture();
// emscripten_cancel_main_loop();
// #endif
// return;
// }
// SDL_SystemCursor cursor = studio.mouse.system;
// studio.mouse.system = SDL_SYSTEM_CURSOR_ARROW;
SDL_RenderClear(platform.renderer);
// if(studio.mode == TIC_RUN_MODE && studio.tic->input.gamepad)
// renderGamepad();
// if(studio.mode == TIC_MENU_MODE || studio.mode == TIC_SURF_MODE)
// renderGamepad();
// if(studio.mouse.system != cursor)
// SDL_SetCursor(SDL_CreateSystemCursor(studio.mouse.system));
blitTexture();
SDL_RenderPresent(platform.renderer);
// blitSound();
}
s32 main(s32 argc, char **argv)
{
SDL_SetHint(SDL_HINT_WINRT_HANDLE_BACK_BUTTON, "1");
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
initSound();
platform.window = SDL_CreateWindow( TIC_TITLE, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
(TIC80_FULLWIDTH) * STUDIO_UI_SCALE,
(TIC80_FULLHEIGHT) * STUDIO_UI_SCALE,
SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE
#if defined(__CHIP__)
| SDL_WINDOW_FULLSCREEN_DESKTOP
#endif
);
// set the window icon before renderer is created (issues on Linux)
setWindowIcon();
platform.renderer = SDL_CreateRenderer(platform.window, -1,
#if defined(__CHIP__)
SDL_RENDERER_SOFTWARE
#elif defined(__EMSCRIPTEN__)
SDL_RENDERER_ACCELERATED
#else
SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC//(getConfig()->useVsync ? SDL_RENDERER_PRESENTVSYNC : 0)
#endif
);
platform.texture = SDL_CreateTexture(platform.renderer, STUDIO_PIXEL_FORMAT, SDL_TEXTUREACCESS_STREAMING, TEXTURE_SIZE, TEXTURE_SIZE);
initTouchGamepad();
studioInit(argc, argv);
#if defined(__EMSCRIPTEN__)
emscripten_set_main_loop(emstick, TIC_FRAMERATE, 1);
#else
{
bool useDelay = false;
{
SDL_RendererInfo info;
SDL_DisplayMode mode;
SDL_GetRendererInfo(platform.renderer, &info);
SDL_GetCurrentDisplayMode(SDL_GetWindowDisplayIndex(platform.window), &mode);
useDelay = !(info.flags & SDL_RENDERER_PRESENTVSYNC) || mode.refresh_rate > TIC_FRAMERATE;
}
u64 nextTick = SDL_GetPerformanceCounter();
const u64 Delta = SDL_GetPerformanceFrequency() / TIC_FRAMERATE;
while (!platform.quitFlag)
{
platform.missedFrame = false;
nextTick += Delta;
tick();
{
s64 delay = nextTick - SDL_GetPerformanceCounter();
if(delay < 0)
{
nextTick -= delay;
platform.missedFrame = true;
}
else
{
if(useDelay || SDL_GetWindowFlags(platform.window) & SDL_WINDOW_MINIMIZED)
{
u32 time = (u32)(delay * 1000 / SDL_GetPerformanceFrequency());
if(time >= 10)
SDL_Delay(time);
}
}
}
}
}
#endif
studioClose();
SDL_DestroyTexture(platform.texture);
SDL_DestroyRenderer(platform.renderer);
SDL_DestroyWindow(platform.window);
SDL_CloseAudioDevice(platform.audio.device);
return 0;
}
+1
View File
@@ -0,0 +1 @@
#pragma once
+13 -13
View File
@@ -1100,19 +1100,19 @@ static void tick(Map* map)
{
map->tickCounter++;
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
processKeydown(map, event->key.keysym.sym);
break;
case SDL_KEYUP:
processKeyup(map, event->key.keysym.sym);
break;
}
}
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// processKeydown(map, event->key.keysym.sym);
// break;
// case SDL_KEYUP:
// processKeyup(map, event->key.keysym.sym);
// break;
// }
// }
processKeyboard(map);
processGesture(map);
+10 -10
View File
@@ -458,16 +458,16 @@ static void tick(Menu* menu)
{
menu->ticks++;
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYUP:
processKeydown(menu, &event->key.keysym);
break;
}
}
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYUP:
// processKeydown(menu, &event->key.keysym);
// break;
// }
// }
if(getStudioMode() != TIC_MENU_MODE)
return;
+28 -28
View File
@@ -1529,8 +1529,8 @@ static void drawMusicToolbar(Music* music)
static void drawPianoLayout(Music* music)
{
SDL_Event* event = NULL;
while ((event = pollEvent())){}
// SDL_Event* event = NULL;
// while ((event = pollEvent())){}
music->tic->api.clear(music->tic, (tic_color_gray));
@@ -1571,34 +1571,34 @@ static void scrollNotes(Music* music, s32 delta)
static void drawTrackerLayout(Music* music)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch (event->type)
{
case SDL_MOUSEWHEEL:
if(SDL_GetModState() & TIC_MOD_CTRL)
{
scrollNotes(music, event->wheel.y > 0 ? 1 : -1);
}
else
{
enum{Scroll = NOTES_PER_BEET};
s32 delta = event->wheel.y > 0 ? -Scroll : Scroll;
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch (event->type)
// {
// case SDL_MOUSEWHEEL:
// if(SDL_GetModState() & TIC_MOD_CTRL)
// {
// scrollNotes(music, event->wheel.y > 0 ? 1 : -1);
// }
// else
// {
// enum{Scroll = NOTES_PER_BEET};
// s32 delta = event->wheel.y > 0 ? -Scroll : Scroll;
music->tracker.scroll += delta;
// music->tracker.scroll += delta;
updateScroll(music);
}
break;
case SDL_KEYDOWN:
processKeydown(music, &event->key.keysym);
break;
case SDL_KEYUP:
processKeyup(music, &event->key.keysym);
break;
}
}
// updateScroll(music);
// }
// break;
// case SDL_KEYDOWN:
// processKeydown(music, &event->key.keysym);
// break;
// case SDL_KEYUP:
// processKeyup(music, &event->key.keysym);
// break;
// }
// }
if(music->tracker.follow)
{
+2 -2
View File
@@ -86,7 +86,7 @@ static void initPMemName(Run* run)
static void tick(Run* run)
{
while(pollEvent());
// while(pollEvent());
if (getStudioMode() != TIC_RUN_MODE)
return;
@@ -169,7 +169,7 @@ static void preseed()
static bool forceExit(void* data)
{
while(pollEvent());
// while(pollEvent());
return getStudioMode() != TIC_RUN_MODE;
}
+20 -20
View File
@@ -823,16 +823,16 @@ static void drawSfxToolbar(Sfx* sfx)
static void envelopesTick(Sfx* sfx)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
processKeydown(sfx, event->key.keysym.sym);
break;
}
}
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// processKeydown(sfx, event->key.keysym.sym);
// break;
// }
// }
processKeyboard(sfx);
@@ -954,16 +954,16 @@ static void drawWaveformCanvas(Sfx* sfx, s32 x, s32 y)
static void waveformTick(Sfx* sfx)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
processWaveformKeydown(sfx, event->key.keysym.sym);
break;
}
}
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// processWaveformKeydown(sfx, event->key.keysym.sym);
// break;
// }
// }
processKeyboard(sfx);
+22 -22
View File
@@ -1589,30 +1589,30 @@ static void drawSpriteToolbar(Sprite* sprite)
static void tick(Sprite* sprite)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
processKeydown(sprite, event->key.keysym.sym);
break;
case SDL_MOUSEWHEEL:
{
s32 size = sprite->size;
s32 delta = event->wheel.y;
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// processKeydown(sprite, event->key.keysym.sym);
// break;
// case SDL_MOUSEWHEEL:
// {
// s32 size = sprite->size;
// s32 delta = event->wheel.y;
if(delta > 0)
{
if(size < (TIC_SPRITESIZE * TIC_SPRITESIZE)) size <<= 1;
}
else if(size > TIC_SPRITESIZE) size >>= 1;
// if(delta > 0)
// {
// if(size < (TIC_SPRITESIZE * TIC_SPRITESIZE)) size <<= 1;
// }
// else if(size > TIC_SPRITESIZE) size >>= 1;
updateSpriteSize(sprite, size);
}
break;
}
}
// updateSpriteSize(sprite, size);
// }
// break;
// }
// }
sprite->tic->api.clear(sprite->tic, (tic_color_gray));
+1 -1
View File
@@ -78,7 +78,7 @@ static void tick(Start* start)
start->initialized = true;
}
while (pollEvent());
// while (pollEvent());
start->tic->api.clear(start->tic, TIC_COLOR_BG);
+484 -483
View File
File diff suppressed because it is too large. Load diff
+6 -1
View File
@@ -122,7 +122,7 @@ typedef enum
TIC_SURF_MODE,
} EditorMode;
SDL_Event* pollEvent();
// SDL_Event* pollEvent();
void setCursor(SDL_SystemCursor id);
s32 getMouseX();
@@ -198,3 +198,8 @@ void runProject();
tic_tiles* getBankTiles();
tic_map* getBankMap();
s32 studioInit(s32 argc, char **argv);
void studioTick(void* pixels);
void studioClose();
+1 -1
View File
@@ -803,7 +803,7 @@ static void tick(Surf* surf)
surf->ticks++;
while (pollEvent());
// while (pollEvent());
tic_mem* tic = surf->tic;
+10 -10
View File
@@ -71,16 +71,16 @@ static void processKeydown(World* world, SDL_Keycode keycode)
static void tick(World* world)
{
SDL_Event* event = NULL;
while ((event = pollEvent()))
{
switch(event->type)
{
case SDL_KEYDOWN:
processKeydown(world, event->key.keysym.sym);
break;
}
}
// SDL_Event* event = NULL;
// while ((event = pollEvent()))
// {
// switch(event->type)
// {
// case SDL_KEYDOWN:
// processKeydown(world, event->key.keysym.sym);
// break;
// }
// }
SDL_memcpy(&world->tic->ram.vram, world->preview, PREVIEW_SIZE);