diff --git a/bin/assets/config.tic.dat b/bin/assets/config.tic.dat index bf74f97..0cfa572 100644 --- a/bin/assets/config.tic.dat +++ b/bin/assets/config.tic.dat @@ -1 +1 @@ -0x78, 0xda, 0xed, 0x19, 0x4b, 0x6c, 0x1b, 0xc7, 0x75, 0x1d, 0x3b, 0x69, 0xc8, 0xb8, 0x1e, 0x0b, 0x28, 0x82, 0x7e, 0xd2, 0x66, 0xa1, 0xa6, 0x2d, 0x29, 0x91, 0x14, 0x45, 0x4a, 0xaa, 0x6b, 0x77, 0x9b, 0xca, 0x22, 0x2d, 0xa9, 0x91, 0x44, 0x43, 0x12, 0xe3, 0x06, 0x46, 0xa2, 0xae, 0xc8, 0xa5, 0x44, 0x84, 0xe2, 0xaa, 0xbb, 0xa4, 0x25, 0x39, 0x10, 0x10, 0x04, 0x08, 0xa0, 0x9e, 0xdc, 0x83, 0x0b, 0x54, 0x27, 0xa5, 0xc8, 0x4d, 0xbd, 0xf4, 0xe2, 0x4b, 0x75, 0x30, 0x5a, 0xf4, 0xd2, 0x02, 0x2d, 0x8a, 0xa0, 0xe8, 0xa1, 0x28, 0x7a, 0x29, 0x7a, 0xa5, 0xe7, 0x64, 0xd4, 0x08, 0x90, 0xed, 0x7b, 0x33, 0xb3, 0xcb, 0xfd, 0xcc, 0x52, 0x0e, 0x90, 0xf4, 0xa4, 0x59, 0x0d, 0xe7, 0xf3, 0xe6, 0xbd, 0x79, 0xff, 0x99, 0x5d, 0x9d, 0xfb, 0xe0, 0x39, 0xe5, 0x13, 0x07, 0xca, 0xf0, 0xf0, 0xf0, 0xbd, 0x83, 0x83, 0x83, 0x7b, 0xd8, 0xc2, 0xf0, 0x9e, 0x43, 0xbd, 0xea, 0x38, 0x8f, 0x7a, 0xc3, 0xc3, 0x4e, 0xef, 0xe0, 0x80, 0xf6, 0x86, 0xdf, 0xa3, 0x3d, 0xe7, 0x1e, 0x75, 0xe8, 0x3d, 0x4a, 0xdd, 0xca, 0xf0, 0x87, 0x86, 0x86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, 0x7b, 0x1a, 0x7b, 0x91, 0xc9, 0x8a, 0x11, 0xdc, 0xa8, 0x13, 0xae, 0x62, 0x35, 0x66, 0x77, 0x06, 0x18, 0xf3, 0x28, 0xec, 0x70, 0x0a, 0x9b, 0x98, 0xf7, 0x92, 0x09, 0x6f, 0xa3, 0x96, 0x69, 0xe1, 0x9d, 0x43, 0xc3, 0x30, 0x41, 0x9b, 0x8c, 0x30, 0x13, 0x85, 0xf8, 0xc0, 0x5d, 0xfd, 0x18, 0xf0, 0xbe, 0x00, 0x74, 0x27, 0xc4, 0xfd, 0x2d, 0x15, 0x26, 0x96, 0x76, 0x7d, 0x7a, 0x3f, 0xf9, 0xe6, 0x9b, 0xc9, 0xff, 0x01, 0x20, 0x6f, 0x23, 0xd5, \ No newline at end of file +0x78, 0xda, 0xed, 0x18, 0x4b, 0x6c, 0x1b, 0xc7, 0x75, 0xfd, 0x49, 0x1a, 0x32, 0xae, 0xc7, 0x02, 0x8a, 0xa0, 0x9f, 0xb4, 0x59, 0xa8, 0x69, 0x4b, 0x4a, 0x24, 0x45, 0x91, 0x92, 0xea, 0xda, 0xdd, 0xa6, 0xb2, 0x48, 0x4b, 0x6a, 0xf4, 0x83, 0x24, 0xc6, 0x0d, 0x8c, 0x44, 0x5d, 0x91, 0x4b, 0x89, 0x08, 0xc5, 0x55, 0x77, 0x49, 0x4b, 0x72, 0x20, 0x20, 0x08, 0x10, 0x40, 0x3d, 0xb9, 0x07, 0x17, 0xa8, 0x0e, 0x85, 0x52, 0xf8, 0xa6, 0x5e, 0x7a, 0xf1, 0xa5, 0x3a, 0x18, 0xed, 0xad, 0x05, 0x5a, 0x14, 0x41, 0xd1, 0x43, 0x51, 0xf4, 0x52, 0xf4, 0x4a, 0xef, 0xc9, 0xa8, 0x11, 0x20, 0xd3, 0xf7, 0x66, 0x76, 0x97, 0xb3, 0xbb, 0xb3, 0x94, 0x03, 0x24, 0x3d, 0x69, 0x96, 0xc3, 0xf9, 0xbc, 0x79, 0x6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2a, 0xad, 0x82, 0x6c, 0xbd, 0x4b, 0x3e, 0xdc, 0x95, 0xf2, 0x2c, 0x08, 0xfd, 0x8b, 0xb1, 0x48, 0x89, 0xe9, 0x03, 0x92, 0x8c, 0xd5, 0xd6, 0x36, 0x9a, 0x6b, 0x37, 0x2d, 0x7d, 0x83, 0xbd, 0x3a, 0xc1, 0xa5, 0x80, 0x1f, 0xcd, 0xec, 0xcd, 0x28, 0xc3, 0xdf, 0x85, 0x50, 0x34, 0xb6, 0x34, 0xb7, 0xa7, 0xb1, 0x17, 0x99, 0xac, 0x3b, 0x82, 0x1b, 0x75, 0xc2, 0x53, 0xac, 0xc6, 0xec, 0xce, 0x00, 0x23, 0x3e, 0x85, 0x1d, 0x4e, 0x61, 0x13, 0xf3, 0x5e, 0x32, 0xe1, 0x6f, 0xd4, 0x34, 0x2d, 0xbc, 0x73, 0x68, 0x18, 0x26, 0x68, 0x93, 0x21, 0x66, 0xa2, 0x10, 0x1f, 0xb8, 0xab, 0x88, 0x01, 0xef, 0x0b, 0x40, 0x77, 0xcc, 0xbd, 0xbf, 0xa5, 0xc2, 0xc4, 0xd2, 0x9e, 0x4f, 0xef, 0x27, 0xdf, 0x7a, 0x2b, 0xf9, 0x3f, 0x2a, 0xad, 0x1b, 0xdf, \ No newline at end of file diff --git a/config.tic b/config.tic index 4f501af..5e0e368 100644 Binary files a/config.tic and b/config.tic differ diff --git a/src/code.c b/src/code.c index cac3542..28ea588 100644 --- a/src/code.c +++ b/src/code.c @@ -27,19 +27,16 @@ #define TEXT_CURSOR_DELAY (TIC_FRAMERATE / 2) #define TEXT_CURSOR_BLINK_PERIOD TIC_FRAMERATE - -static inline s32 TextBufferHeight(const tic_mem* tic) -{ - return ((TIC80_HEIGHT - TOOLBAR_SIZE - TextHeight(tic)) / TextHeight(tic)); -} +#define TEXT_BUFFER_WIDTH STUDIO_TEXT_BUFFER_WIDTH +#define TEXT_BUFFER_HEIGHT ((TIC80_HEIGHT - TOOLBAR_SIZE - STUDIO_TEXT_HEIGHT) / STUDIO_TEXT_HEIGHT) struct OutlineItem { - char name[TIC80_WIDTH]; + char name[STUDIO_TEXT_BUFFER_WIDTH]; char* pos; }; -#define OUTLINE_SIZE (TIC80_HEIGHT) +#define OUTLINE_SIZE ((TIC80_HEIGHT - TOOLBAR_SIZE*2)/TIC_FONT_HEIGHT) #define OUTLINE_ITEMS_SIZE (OUTLINE_SIZE * sizeof(OutlineItem)) static void history(Code* code) @@ -50,35 +47,29 @@ static void history(Code* code) static void drawStatus(Code* code) { - tic_mem* tic = code->tic; - const s32 Height = tic->font.height + 1; - - tic->api.rect(tic, 0, TIC80_HEIGHT - Height, TIC80_WIDTH, Height, (tic_color_white)); - tic->api.fixed_text(tic, code->status.left, 0, TIC80_HEIGHT - tic->font.height, getConfig()->theme.code.bg); - tic->api.fixed_text(tic, code->status.right, TIC80_WIDTH - (strlen(code->status.right) * tic->font.width), - TIC80_HEIGHT - tic->font.height, getConfig()->theme.code.bg); + const s32 Height = TIC_FONT_HEIGHT + 1; + code->tic->api.rect(code->tic, 0, TIC80_HEIGHT - Height, TIC80_WIDTH, Height, (tic_color_white)); + code->tic->api.fixed_text(code->tic, code->status, 0, TIC80_HEIGHT - TIC_FONT_HEIGHT, getConfig()->theme.code.bg, false); } static void drawCursor(Code* code, s32 x, s32 y, char symbol) { - tic_mem* tic = code->tic; bool inverse = code->cursor.delay || code->tickCounter % TEXT_CURSOR_BLINK_PERIOD < TEXT_CURSOR_BLINK_PERIOD / 2; if(inverse) { - code->tic->api.rect(code->tic, x-1, y-1, tic->font.width+1, tic->font.height+1, getConfig()->theme.code.cursor); + code->tic->api.rect(code->tic, x-1, y-1, (code->altFont ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH)+1, TIC_FONT_HEIGHT+1, getConfig()->theme.code.cursor); if(symbol) - code->tic->api.draw_char(code->tic, symbol, x, y, getConfig()->theme.code.bg); + code->tic->api.draw_char(code->tic, symbol, x, y, getConfig()->theme.code.bg, code->altFont); } } static void drawCode(Code* code, bool withCursor) { - tic_mem* tic = code->tic; - s32 xStart = code->rect.x - code->scroll.x * TextWidth(tic); + s32 xStart = code->rect.x - code->scroll.x * (code->altFont ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH); s32 x = xStart; - s32 y = code->rect.y - code->scroll.y * TextHeight(tic); + s32 y = code->rect.y - code->scroll.y * STUDIO_TEXT_HEIGHT; char* pointer = code->src; u8* colorPointer = code->colorBuffer; @@ -92,16 +83,16 @@ static void drawCode(Code* code, bool withCursor) { char symbol = *pointer; - if(x >= -tic->font.width && x < TIC80_WIDTH && y >= -tic->font.height && y < TIC80_HEIGHT ) + if(x >= -TIC_FONT_WIDTH && x < TIC80_WIDTH && y >= -TIC_FONT_HEIGHT && y < TIC80_HEIGHT ) { if(code->cursor.selection && pointer >= selection.start && pointer < selection.end) - code->tic->api.rect(code->tic, x-1, y-1, tic->font.width+1, tic->font.height+1, getConfig()->theme.code.select); + code->tic->api.rect(code->tic, x-1, y-1, TIC_FONT_WIDTH+1, TIC_FONT_HEIGHT+1, getConfig()->theme.code.select); else if(getConfig()->theme.code.shadow) { - code->tic->api.draw_char(code->tic, symbol, x+1, y+1, 0); + code->tic->api.draw_char(code->tic, symbol, x+1, y+1, 0, code->altFont); } - code->tic->api.draw_char(code->tic, symbol, x, y, *colorPointer); + code->tic->api.draw_char(code->tic, symbol, x, y, *colorPointer, code->altFont); } if(code->cursor.position == pointer) @@ -110,9 +101,9 @@ static void drawCode(Code* code, bool withCursor) if(symbol == '\n') { x = xStart; - y += TextHeight(tic); + y += STUDIO_TEXT_HEIGHT; } - else x += TextWidth(tic); + else x += (code->altFont ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH); pointer++; colorPointer++; @@ -168,31 +159,34 @@ static void removeInvalidChars(char* code) static void updateEditor(Code* code) { - tic_mem* tic = code->tic; - s32 column = 0; s32 line = 0; getCursorPosition(code, &column, &line); if(column < code->scroll.x) code->scroll.x = column; - else if(column >= code->scroll.x + BufferWidth(tic)) - code->scroll.x = column - BufferWidth(tic) + 1; + else if(column >= code->scroll.x + TEXT_BUFFER_WIDTH) + code->scroll.x = column - TEXT_BUFFER_WIDTH + 1; if(line < code->scroll.y) code->scroll.y = line; - else if(line >= code->scroll.y + TextBufferHeight(tic)) - code->scroll.y = line - TextBufferHeight(tic) + 1; + else if(line >= code->scroll.y + TEXT_BUFFER_HEIGHT) + code->scroll.y = line - TEXT_BUFFER_HEIGHT + 1; code->cursor.delay = TEXT_CURSOR_DELAY; // update status { + memset(code->status, ' ', sizeof code->status - 1); + + char status[STUDIO_TEXT_BUFFER_WIDTH]; s32 count = getLinesCount(code); - sprintf(code->status.left, "line %i/%i col %i", line + 1, count + 1, column + 1); + sprintf(status, "line %i/%i col %i", line + 1, count + 1, column + 1); + memcpy(code->status, status, strlen(status)); size_t codeLen = strlen(code->src); - sprintf(code->status.right, "%i/%i", (u32)codeLen, TIC_CODE_SIZE); + sprintf(status, "%i/%i", (u32)codeLen, TIC_CODE_SIZE); memset(code->src + codeLen, '\0', TIC_CODE_SIZE - codeLen); + memcpy(code->status + sizeof code->status - strlen(status) - 1, status, strlen(status)); } } @@ -409,21 +403,19 @@ static void goCodeEnd(Code *code) static void pageUp(Code* code) { - tic_mem* tic = code->tic; s32 column = 0; s32 line = 0; getCursorPosition(code, &column, &line); - setCursorPosition(code, column, line > TextBufferHeight(tic) ? line - TextBufferHeight(tic) : 0); + setCursorPosition(code, column, line > TEXT_BUFFER_HEIGHT ? line - TEXT_BUFFER_HEIGHT : 0); } static void pageDown(Code* code) { - tic_mem* tic = code->tic; s32 column = 0; s32 line = 0; getCursorPosition(code, &column, &line); s32 lines = getLinesCount(code); - setCursorPosition(code, column, line < lines - TextBufferHeight(tic) ? line + TextBufferHeight(tic) : lines); + setCursorPosition(code, column, line < lines - TEXT_BUFFER_HEIGHT ? line + TEXT_BUFFER_HEIGHT : lines); } static bool replaceSelection(Code* code) @@ -734,12 +726,10 @@ static void normalizeScroll(Code* code) static void centerScroll(Code* code) { - tic_mem* tic = code->tic; - s32 col, line; getCursorPosition(code, &col, &line); - code->scroll.x = col - BufferWidth(tic) / 2; - code->scroll.y = line - TextBufferHeight(tic) / 2; + code->scroll.x = col - TEXT_BUFFER_WIDTH / 2; + code->scroll.y = line - TEXT_BUFFER_HEIGHT / 2; normalizeScroll(code); } @@ -782,8 +772,8 @@ static void initOutlineMode(Code* code) tic_mem* tic = code->tic; - char buffer[TIC80_WIDTH] = {0}; - char filter[TIC80_WIDTH] = {0}; + char buffer[STUDIO_TEXT_BUFFER_WIDTH] = {0}; + char filter[STUDIO_TEXT_BUFFER_WIDTH] = {0}; strncpy(filter, code->popup.text, sizeof(filter)); ticStrlwr(filter); @@ -802,8 +792,8 @@ static void initOutlineMode(Code* code) if(out < end) { out->pos = code->src + item->pos; - memset(out->name, 0, TIC80_WIDTH); - memcpy(out->name, out->pos, MIN(item->size, TIC80_WIDTH-1)); + memset(out->name, 0, STUDIO_TEXT_BUFFER_WIDTH); + memcpy(out->name, out->pos, MIN(item->size, STUDIO_TEXT_BUFFER_WIDTH-1)); if(*filter) { @@ -976,8 +966,8 @@ static void processMouse(Code* code) { if(checkMouseDown(&code->rect, tic_mouse_right)) { - code->scroll.x = (code->scroll.start.x - getMouseX()) / TextWidth(tic); - code->scroll.y = (code->scroll.start.y - getMouseY()) / TextHeight(tic); + code->scroll.x = (code->scroll.start.x - getMouseX()) / (code->altFont ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH); + code->scroll.y = (code->scroll.start.y - getMouseY()) / STUDIO_TEXT_HEIGHT; normalizeScroll(code); } @@ -990,8 +980,8 @@ static void processMouse(Code* code) s32 mx = getMouseX(); s32 my = getMouseY(); - s32 x = (mx - code->rect.x) / TextWidth(tic); - s32 y = (my - code->rect.y) / TextHeight(tic); + s32 x = (mx - code->rect.x) / (code->altFont ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH); + s32 y = (my - code->rect.y) / STUDIO_TEXT_HEIGHT; char* position = code->cursor.position; setCursorPosition(code, x + code->scroll.x, y + code->scroll.y); @@ -1019,8 +1009,8 @@ static void processMouse(Code* code) { code->scroll.active = true; - code->scroll.start.x = getMouseX() + code->scroll.x * TextWidth(tic); - code->scroll.start.y = getMouseY() + code->scroll.y * TextHeight(tic); + code->scroll.start.x = getMouseX() + code->scroll.x * (code->altFont ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH); + code->scroll.start.y = getMouseY() + code->scroll.y * STUDIO_TEXT_HEIGHT; } } @@ -1068,16 +1058,14 @@ static void textEditTick(Code* code) static void drawPopupBar(Code* code, const char* title) { - tic_mem* tic = code->tic; - enum {TextY = TOOLBAR_SIZE + 1}; - code->tic->api.rect(code->tic, 0, TOOLBAR_SIZE, TIC80_WIDTH, tic->font.height + 1, (tic_color_blue)); - code->tic->api.fixed_text(code->tic, title, 0, TextY, (tic_color_white)); + code->tic->api.rect(code->tic, 0, TOOLBAR_SIZE, TIC80_WIDTH, TIC_FONT_HEIGHT + 1, (tic_color_blue)); + code->tic->api.fixed_text(code->tic, title, 0, TextY, (tic_color_white), false); - code->tic->api.fixed_text(code->tic, code->popup.text, (s32)strlen(title)*tic->font.width, TextY, (tic_color_white)); + code->tic->api.fixed_text(code->tic, code->popup.text, (s32)strlen(title)*TIC_FONT_WIDTH, TextY, (tic_color_white), false); - drawCursor(code, (s32)(strlen(title) + strlen(code->popup.text)) * tic->font.width, TextY, ' '); + drawCursor(code, (s32)(strlen(title) + strlen(code->popup.text)) * TIC_FONT_WIDTH, TextY, ' '); } static void updateFindCode(Code* code, char* pos) @@ -1215,8 +1203,8 @@ static void textGoToTick(Code* code) tic->api.clear(tic, getConfig()->theme.code.bg); if(code->jump.line >= 0) - tic->api.rect(tic, 0, (code->jump.line - code->scroll.y) * (tic->font.height+1) + TOOLBAR_SIZE, - TIC80_WIDTH, tic->font.height+2, getConfig()->theme.code.select); + tic->api.rect(tic, 0, (code->jump.line - code->scroll.y) * (TIC_FONT_HEIGHT+1) + TOOLBAR_SIZE, + TIC80_WIDTH, TIC_FONT_HEIGHT+2, getConfig()->theme.code.select); drawCode(code, false); drawPopupBar(code, " GOTO:"); @@ -1225,14 +1213,12 @@ static void textGoToTick(Code* code) static void drawOutlineBar(Code* code, s32 x, s32 y) { - tic_mem* tic = code->tic; - tic_rect rect = {x, y, TIC80_WIDTH - x, TIC80_HEIGHT - y}; if(checkMousePos(&rect)) { s32 mx = getMouseY() - rect.y; - mx /= TextHeight(tic); + mx /= STUDIO_TEXT_HEIGHT; if(mx < OUTLINE_SIZE && code->outline.items[mx].pos) { @@ -1258,22 +1244,20 @@ static void drawOutlineBar(Code* code, s32 x, s32 y) if(ptr->pos) { - code->tic->api.rect(code->tic, rect.x - 1, rect.y + code->outline.index*TextHeight(tic), - rect.w + 1, tic->font.height + 1, (tic_color_red)); + code->tic->api.rect(code->tic, rect.x - 1, rect.y + code->outline.index*STUDIO_TEXT_HEIGHT, + rect.w + 1, TIC_FONT_HEIGHT + 1, (tic_color_red)); while(ptr->pos) { - code->tic->api.fixed_text(code->tic, ptr->name, x, y, (tic_color_white)); + code->tic->api.fixed_text(code->tic, ptr->name, x, y, (tic_color_white), false); ptr++; - y += TextHeight(tic); + y += STUDIO_TEXT_HEIGHT; } } - else code->tic->api.fixed_text(code->tic, "(empty)", x, y, (tic_color_white)); + else code->tic->api.fixed_text(code->tic, "(empty)", x, y, (tic_color_white), false); } static void textOutlineTick(Code* code) { - tic_mem* tic = code->tic; - if(keyWasPressed(tic_key_up)) { if(code->outline.index > 0) @@ -1321,7 +1305,33 @@ static void textOutlineTick(Code* code) drawCode(code, false); drawPopupBar(code, " FUNC:"); drawStatus(code); - drawOutlineBar(code, TIC80_WIDTH - 12 * tic->font.width, 2*(tic->font.height+1)); + drawOutlineBar(code, TIC80_WIDTH - 12 * TIC_FONT_WIDTH, 2*(TIC_FONT_HEIGHT+1)); +} + +static void drawFontButton(Code* code, s32 x, s32 y) +{ + tic_mem* tic = code->tic; + + enum {Size = TIC_FONT_WIDTH}; + tic_rect rect = {x, y, Size, Size}; + + bool over = false; + if(checkMousePos(&rect)) + { + setCursor(tic_cursor_hand); + + showTooltip("SWITCH FONT"); + + over = true; + + if(checkMouseClick(&rect, tic_mouse_left)) + { + code->altFont = !code->altFont; + } + } + + + tic->api.draw_char(tic, 'F', x, y, over ? tic_color_dark_gray : tic_color_light_blue, code->altFont); } static void drawCodeToolbar(Code* code) @@ -1408,6 +1418,8 @@ static void drawCodeToolbar(Code* code) drawBitIcon(rect.x, rect.y, Icons + i*BITS_IN_BYTE, active ? (tic_color_white) : (over ? (tic_color_dark_gray) : (tic_color_light_blue))); } + drawFontButton(code, TIC80_WIDTH - (Count+2) * Size, 1); + drawToolbar(code->tic, getConfig()->theme.code.bg, false); } @@ -1471,7 +1483,7 @@ void initCode(Code* code, tic_mem* tic, tic_code* src) .tick = tick, .escape = escape, .cursor = {{src->data, NULL, 0}, NULL, 0}, - .rect = {0, TOOLBAR_SIZE + 1, TIC80_WIDTH, TIC80_HEIGHT - TOOLBAR_SIZE - tic->font.height - 1}, + .rect = {0, TOOLBAR_SIZE + 1, TIC80_WIDTH, TIC80_HEIGHT - TOOLBAR_SIZE - TIC_FONT_HEIGHT - 1}, .scroll = {0, 0, {0, 0}, false}, .tickCounter = 0, .history = NULL, @@ -1488,6 +1500,7 @@ void initCode(Code* code, tic_mem* tic, tic_code* src) .items = code->outline.items, .index = 0, }, + .altFont = true, .event = onStudioEvent, .update = update, }; diff --git a/src/code.h b/src/code.h index 1326111..523f5ab 100644 --- a/src/code.h +++ b/src/code.h @@ -62,11 +62,7 @@ struct Code u8 colorBuffer[TIC_CODE_SIZE]; - struct - { - char left[TIC80_WIDTH]; - char right[TIC80_WIDTH]; - } status; + char status[STUDIO_TEXT_BUFFER_WIDTH+1]; u32 tickCounter; @@ -84,7 +80,7 @@ struct Code struct { - char text[TIC80_WIDTH]; + char text[STUDIO_TEXT_BUFFER_WIDTH - sizeof "FIND:"]; char* prevPos; char* prevSel; @@ -102,6 +98,8 @@ struct Code s32 index; } outline; + bool altFont; + void(*tick)(Code*); void(*escape)(Code*); void(*event)(Code*, StudioEvent); diff --git a/src/config.c b/src/config.c index 11a692b..1aea650 100644 --- a/src/config.c +++ b/src/config.c @@ -206,34 +206,6 @@ static void readCodeTheme(Config* config, lua_State* lua) lua_pop(lua, 1); } -static void readFontTheme(Config* config, lua_State* lua) -{ - lua_getfield(lua, -1, "FONT"); - - if(lua_type(lua, -1) == LUA_TTABLE) - { - { - lua_getfield(lua, -1, "WIDTH"); - - if(lua_isinteger(lua, -1)) - config->data.theme.font.width = lua_tointeger(lua, -1); - - lua_pop(lua, 1); - } - - { - lua_getfield(lua, -1, "HEIGHT"); - - if(lua_isinteger(lua, -1)) - config->data.theme.font.height = lua_tointeger(lua, -1); - - lua_pop(lua, 1); - } - } - - lua_pop(lua, 1); -} - static void readGamepadTheme(Config* config, lua_State* lua) { lua_getfield(lua, -1, "GAMEPAD"); @@ -267,7 +239,6 @@ static void readTheme(Config* config, lua_State* lua) readCursorTheme(config, lua); readCodeTheme(config, lua); readGamepadTheme(config, lua); - readFontTheme(config, lua); } lua_pop(lua, 1); diff --git a/src/console.c b/src/console.c index 33476b3..d59157c 100644 --- a/src/console.c +++ b/src/console.c @@ -45,7 +45,10 @@ #define CONSOLE_ERROR_TEXT_COLOR ((tic_color_red)) #define CONSOLE_CURSOR_BLINK_PERIOD (TIC_FRAMERATE) #define CONSOLE_CURSOR_DELAY (TIC_FRAMERATE / 2) +#define CONSOLE_BUFFER_WIDTH (STUDIO_TEXT_BUFFER_WIDTH) +#define CONSOLE_BUFFER_HEIGHT (STUDIO_TEXT_BUFFER_HEIGHT) #define CONSOLE_BUFFER_SCREENS 64 +#define CONSOLE_BUFFER_SIZE (CONSOLE_BUFFER_WIDTH * CONSOLE_BUFFER_HEIGHT * CONSOLE_BUFFER_SCREENS) typedef enum { @@ -114,11 +117,7 @@ static const char DefaultJSTicPath[] = TIC_LOCAL "default_js.tic"; #if defined(TIC_BUILD_WITH_WREN) static const char DefaultWrenTicPath[] = TIC_LOCAL "default_wren.tic"; #endif - -static inline s32 BufferSize(const tic_mem* tic) -{ - return BufferWidth(tic) * BufferHeight(tic) * CONSOLE_BUFFER_SCREENS; -} + static const char* getName(const char* name, const char* ext) { @@ -140,33 +139,29 @@ static const char* getCartName(const char* name) return getName(name, CART_EXT); } -static void scrollBuffer(tic_mem* tic, char* buffer) +static void scrollBuffer(char* buffer) { - memmove(buffer, buffer + BufferWidth(tic), BufferSize(tic) - BufferWidth(tic)); - memset(buffer + BufferSize(tic) - BufferWidth(tic), 0, BufferWidth(tic)); + memmove(buffer, buffer + CONSOLE_BUFFER_WIDTH, CONSOLE_BUFFER_SIZE - CONSOLE_BUFFER_WIDTH); + memset(buffer + CONSOLE_BUFFER_SIZE - CONSOLE_BUFFER_WIDTH, 0, CONSOLE_BUFFER_WIDTH); } static void scrollConsole(Console* console) { - tic_mem* tic = console->tic; - - while(console->cursor.y >= BufferHeight(tic) * CONSOLE_BUFFER_SCREENS) + while(console->cursor.y >= CONSOLE_BUFFER_HEIGHT * CONSOLE_BUFFER_SCREENS) { - scrollBuffer(tic, console->buffer); - scrollBuffer(tic, (char*)console->colorBuffer); + scrollBuffer(console->buffer); + scrollBuffer((char*)console->colorBuffer); console->cursor.y--; } - s32 minScroll = console->cursor.y - BufferHeight(tic) + 1; + s32 minScroll = console->cursor.y - CONSOLE_BUFFER_HEIGHT + 1; if(console->scroll.pos < minScroll) console->scroll.pos = minScroll; } static void consolePrint(Console* console, const char* text, u8 color) { - tic_mem* tic = console->tic; - printf("%s", text); const char* textPointer = text; @@ -185,13 +180,13 @@ static void consolePrint(Console* console, const char* text, u8 color) } else { - s32 offset = console->cursor.x + console->cursor.y * BufferWidth(tic); + s32 offset = console->cursor.x + console->cursor.y * CONSOLE_BUFFER_WIDTH; *(console->buffer + offset) = symbol; *(console->colorBuffer + offset) = color; console->cursor.x++; - if(console->cursor.x >= BufferWidth(tic)) + if(console->cursor.x >= CONSOLE_BUFFER_WIDTH) { console->cursor.x = 0; console->cursor.y++; @@ -241,22 +236,20 @@ static void commandDone(Console* console) static void drawCursor(Console* console, s32 x, s32 y, u8 symbol) { - tic_mem* tic = console->tic; bool inverse = console->cursor.delay || console->tickCounter % CONSOLE_CURSOR_BLINK_PERIOD < CONSOLE_CURSOR_BLINK_PERIOD / 2; if(inverse) - console->tic->api.rect(console->tic, x-1, y-1, tic->font.width+1, tic->font.height+1, CONSOLE_CURSOR_COLOR); + console->tic->api.rect(console->tic, x-1, y-1, TIC_FONT_WIDTH+1, TIC_FONT_HEIGHT+1, CONSOLE_CURSOR_COLOR); - console->tic->api.draw_char(console->tic, symbol, x, y, inverse ? TIC_COLOR_BG : CONSOLE_FRONT_TEXT_COLOR); + console->tic->api.draw_char(console->tic, symbol, x, y, inverse ? TIC_COLOR_BG : CONSOLE_FRONT_TEXT_COLOR, false); } static void drawConsoleText(Console* console) { - tic_mem* tic = console->tic; - char* pointer = console->buffer + console->scroll.pos * BufferWidth(tic); - u8* colorPointer = console->colorBuffer + console->scroll.pos * BufferWidth(tic); + char* pointer = console->buffer + console->scroll.pos * CONSOLE_BUFFER_WIDTH; + u8* colorPointer = console->colorBuffer + console->scroll.pos * CONSOLE_BUFFER_WIDTH; - const char* end = console->buffer + BufferSize(tic); + const char* end = console->buffer + CONSOLE_BUFFER_SIZE; s32 x = 0; s32 y = 0; @@ -266,9 +259,9 @@ static void drawConsoleText(Console* console) u8 color = *colorPointer++; if(symbol) - console->tic->api.draw_char(console->tic, symbol, x * TextWidth(tic), y * TextHeight(tic), color); + console->tic->api.draw_char(console->tic, symbol, x * STUDIO_TEXT_WIDTH, y * STUDIO_TEXT_HEIGHT, color, false); - if(++x == BufferWidth(tic)) + if(++x == CONSOLE_BUFFER_WIDTH) { y++; x = 0; @@ -278,9 +271,8 @@ static void drawConsoleText(Console* console) static void drawConsoleInputText(Console* console) { - tic_mem* tic = console->tic; - s32 x = console->cursor.x * TextWidth(tic); - s32 y = (console->cursor.y - console->scroll.pos) * TextHeight(tic); + s32 x = console->cursor.x * STUDIO_TEXT_WIDTH; + s32 y = (console->cursor.y - console->scroll.pos) * STUDIO_TEXT_HEIGHT; const char* pointer = console->inputBuffer; const char* end = pointer + strlen(console->inputBuffer); @@ -293,14 +285,14 @@ static void drawConsoleInputText(Console* console) if(console->inputPosition == index) drawCursor(console, x, y, symbol); else - console->tic->api.draw_char(console->tic, symbol, x, y, CONSOLE_FRONT_TEXT_COLOR); + console->tic->api.draw_char(console->tic, symbol, x, y, CONSOLE_FRONT_TEXT_COLOR, false); index++; - x += TextWidth(tic); - if(x == (BufferWidth(tic) * TextWidth(tic))) + x += STUDIO_TEXT_WIDTH; + if(x == (CONSOLE_BUFFER_WIDTH * STUDIO_TEXT_WIDTH)) { - y += TextHeight(tic); + y += STUDIO_TEXT_HEIGHT; x = 0; } @@ -1382,9 +1374,8 @@ static void onConsoleFolderCommand(Console* console, const char* param) static void onConsoleClsCommand(Console* console, const char* param) { - tic_mem* tic = console->tic; - memset(console->buffer, 0, BufferSize(tic)); - memset(console->colorBuffer, TIC_COLOR_BG, BufferSize(tic)); + memset(console->buffer, 0, CONSOLE_BUFFER_SIZE); + memset(console->colorBuffer, TIC_COLOR_BG, CONSOLE_BUFFER_SIZE); console->scroll.pos = 0; console->cursor.x = console->cursor.y = 0; @@ -2325,8 +2316,6 @@ static void onConsoleDelCommand(Console* console, const char* param) static void printTable(Console* console, const char* text) { - tic_mem* tic = console->tic; - printf("%s", text); const char* textPointer = text; @@ -2345,7 +2334,7 @@ static void printTable(Console* console, const char* text) } else { - s32 offset = console->cursor.x + console->cursor.y * BufferWidth(tic); + s32 offset = console->cursor.x + console->cursor.y * CONSOLE_BUFFER_WIDTH; *(console->buffer + offset) = symbol; u8 color = 0; @@ -2365,7 +2354,7 @@ static void printTable(Console* console, const char* text) console->cursor.x++; - if(console->cursor.x >= BufferWidth(tic)) + if(console->cursor.x >= CONSOLE_BUFFER_WIDTH) { console->cursor.x = 0; console->cursor.y++; @@ -2377,7 +2366,7 @@ static void printTable(Console* console, const char* text) static void printRamInfo(Console* console, s32 addr, const char* name, s32 size) { - char buf[TIC80_WIDTH]; + char buf[STUDIO_TEXT_BUFFER_WIDTH]; sprintf(buf, "\n| %05X | %-17s | %-5i |", addr, name, size); printTable(console, buf); } @@ -3129,8 +3118,8 @@ static bool checkUIScale(Console* console, const char* param, const char* value) void initConsole(Console* console, tic_mem* tic, FileSystem* fs, Config* config, s32 argc, char **argv) { - if(!console->buffer) console->buffer = malloc(BufferSize(tic)); - if(!console->colorBuffer) console->colorBuffer = malloc(BufferSize(tic)); + if(!console->buffer) console->buffer = malloc(CONSOLE_BUFFER_SIZE); + if(!console->colorBuffer) console->colorBuffer = malloc(CONSOLE_BUFFER_SIZE); if(!console->embed.file) console->embed.file = malloc(sizeof(tic_cartridge)); *console = (Console) @@ -3182,8 +3171,8 @@ void initConsole(Console* console, tic_mem* tic, FileSystem* fs, Config* config, .crtMonitor = false, }; - memset(console->buffer, 0, BufferSize(tic)); - memset(console->colorBuffer, TIC_COLOR_BG, BufferSize(tic)); + memset(console->buffer, 0, CONSOLE_BUFFER_SIZE); + memset(console->colorBuffer, TIC_COLOR_BG, CONSOLE_BUFFER_SIZE); memset(console->codeLiveReload.fileName, 0, FILENAME_MAX); diff --git a/src/console.h b/src/console.h index 0a0933b..b6a0541 100644 --- a/src/console.h +++ b/src/console.h @@ -78,7 +78,7 @@ struct Console char* buffer; u8* colorBuffer; - char inputBuffer[TIC80_WIDTH]; + char inputBuffer[STUDIO_TEXT_BUFFER_WIDTH * STUDIO_TEXT_BUFFER_HEIGHT]; size_t inputPosition; tic_mem* tic; diff --git a/src/dialog.c b/src/dialog.c index 6c19cf6..f46d2e6 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -57,8 +57,8 @@ static void drawButton(Dialog* dlg, const char* label, s32 x, s32 y, u8 color, u tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, (tic_color_white)); } - s32 size = tic->api.text(tic, label, 0, -tic->font.height, 0); - tic->api.text(tic, label, rect.x + (BtnWidth - size+1)/2, rect.y + (down?3:2), over ? overColor : color); + s32 size = tic->api.text(tic, label, 0, -TIC_FONT_HEIGHT, 0, false); + tic->api.text(tic, label, rect.x + (BtnWidth - size+1)/2, rect.y + (down?3:2), over ? overColor : color, false); if(dlg->focus == id) { @@ -162,8 +162,8 @@ static void drawDialog(Dialog* dlg) { static const char Label[] = "WARNING!"; - s32 size = tic->api.text(tic, Label, 0, -tic->font.height, 0); - tic->api.text(tic, Label, rect.x + (Width - size)/2, rect.y-(TOOLBAR_SIZE-2), (tic_color_gray)); + s32 size = tic->api.text(tic, Label, 0, -TIC_FONT_HEIGHT, 0, false); + tic->api.text(tic, Label, rect.x + (Width - size)/2, rect.y-(TOOLBAR_SIZE-2), (tic_color_gray), false); } { @@ -174,12 +174,12 @@ static void drawDialog(Dialog* dlg) { for(s32 i = 0; i < dlg->rows; i++) { - s32 size = tic->api.text(tic, dlg->text[i], 0, -tic->font.height, 0); + s32 size = tic->api.text(tic, dlg->text[i], 0, -TIC_FONT_HEIGHT, 0, false); s32 x = rect.x + (Width - size)/2; - s32 y = rect.y + (tic->font.height+1)*(i+1); - tic->api.text(tic, dlg->text[i], x, y+1, (tic_color_black)); - tic->api.text(tic, dlg->text[i], x, y, (tic_color_white)); + s32 y = rect.y + (TIC_FONT_HEIGHT+1)*(i+1); + tic->api.text(tic, dlg->text[i], x, y+1, (tic_color_black), false); + tic->api.text(tic, dlg->text[i], x, y, (tic_color_white), false); } } diff --git a/src/jsapi.c b/src/jsapi.c index 388e7b8..1910369 100644 --- a/src/jsapi.c +++ b/src/jsapi.c @@ -63,8 +63,9 @@ static duk_ret_t duk_print(duk_context* duk) s32 color = duk_is_null_or_undefined(duk, 3) ? (TIC_PALETTE_SIZE-1) : duk_to_int(duk, 3); bool fixed = duk_is_null_or_undefined(duk, 4) ? false : duk_to_boolean(duk, 4); s32 scale = duk_is_null_or_undefined(duk, 5) ? 1 : duk_to_int(duk, 5); + bool alt = duk_is_null_or_undefined(duk, 6) ? false : duk_to_boolean(duk, 6); - s32 size = memory->api.text_ex(memory, text ? text : "nil", x, y, color, fixed, scale); + s32 size = memory->api.text_ex(memory, text ? text : "nil", x, y, color, fixed, scale, alt); duk_push_uint(duk, size); @@ -611,6 +612,7 @@ static duk_ret_t duk_font(duk_context* duk) s32 height = duk_is_null_or_undefined(duk, 5) ? TIC_SPRITESIZE : duk_to_int(duk, 5); bool fixed = duk_is_null_or_undefined(duk, 6) ? false : duk_to_boolean(duk, 6); s32 scale = duk_is_null_or_undefined(duk, 7) ? 1 : duk_to_int(duk, 7); + bool alt = duk_is_null_or_undefined(duk, 8) ? false : duk_to_boolean(duk, 8); if(scale == 0) { @@ -618,7 +620,7 @@ static duk_ret_t duk_font(duk_context* duk) return 1; } - s32 size = drawText(memory, text, x, y, width, height, chromakey, scale, fixed ? drawSpriteFont : drawFixedSpriteFont); + s32 size = drawText(memory, text, x, y, width, height, chromakey, scale, fixed ? drawSpriteFont : drawFixedSpriteFont, alt); duk_push_int(duk, size); diff --git a/src/luaapi.c b/src/luaapi.c index 1a61080..0a49020 100644 --- a/src/luaapi.c +++ b/src/luaapi.c @@ -933,6 +933,7 @@ static s32 lua_font(lua_State* lua) u8 chromakey = 0; bool fixed = false; s32 scale = 1; + bool alt = false; if(top >= 3) { @@ -955,6 +956,11 @@ static s32 lua_font(lua_State* lua) if(top >= 8) { scale = getLuaNumber(lua, 8); + + if(top >= 9) + { + alt = lua_toboolean(lua, 9); + } } } } @@ -967,7 +973,7 @@ static s32 lua_font(lua_State* lua) return 1; } - s32 size = drawText(memory, text, x, y, width, height, chromakey, scale, fixed ? drawSpriteFont : drawFixedSpriteFont); + s32 size = drawText(memory, text, x, y, width, height, chromakey, scale, fixed ? drawSpriteFont : drawFixedSpriteFont, alt); lua_pushinteger(lua, size); @@ -991,6 +997,7 @@ static s32 lua_print(lua_State* lua) s32 color = TIC_PALETTE_SIZE-1; bool fixed = false; s32 scale = 1; + bool alt = false; const char* text = printString(lua, 1); @@ -1010,6 +1017,11 @@ static s32 lua_print(lua_State* lua) if(top >= 6) { scale = getLuaNumber(lua, 6); + + if(top >= 7) + { + alt = lua_toboolean(lua, 7); + } } } } @@ -1021,7 +1033,7 @@ static s32 lua_print(lua_State* lua) return 1; } - s32 size = memory->api.text_ex(memory, text ? text : "nil", x, y, color, fixed, scale); + s32 size = memory->api.text_ex(memory, text ? text : "nil", x, y, color, fixed, scale, alt); lua_pushinteger(lua, size); diff --git a/src/machine.h b/src/machine.h index 56297d8..7da7121 100644 --- a/src/machine.h +++ b/src/machine.h @@ -163,10 +163,10 @@ typedef struct } tic_machine; -typedef s32(DrawCharFunc)(tic_mem* memory, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale); -s32 drawText(tic_mem* memory, const char* text, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale, DrawCharFunc* func); -s32 drawSpriteFont(tic_mem* memory, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 chromakey, s32 scale); -s32 drawFixedSpriteFont(tic_mem* memory, u8 index, s32 x, s32 y, s32 width, s32 height, u8 chromakey, s32 scale); +typedef s32(DrawCharFunc)(tic_mem* memory, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale, bool alt); +s32 drawText(tic_mem* memory, const char* text, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale, DrawCharFunc* func, bool alt); +s32 drawSpriteFont(tic_mem* memory, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 chromakey, s32 scale, bool alt); +s32 drawFixedSpriteFont(tic_mem* memory, u8 index, s32 x, s32 y, s32 width, s32 height, u8 chromakey, s32 scale, bool alt); void parseCode(const tic_script_config* config, const char* start, u8* color, const tic_code_theme* theme); #if defined(TIC_BUILD_WITH_LUA) diff --git a/src/map.c b/src/map.c index 2f1d2fa..070d964 100644 --- a/src/map.c +++ b/src/map.c @@ -328,17 +328,15 @@ static void drawTileIndex(Map* map, s32 x, s32 y) { char buf[] = "#999"; sprintf(buf, "#%03i", index); - map->tic->api.text(map->tic, buf, x, y, (tic_color_light_blue)); + map->tic->api.text(map->tic, buf, x, y, (tic_color_light_blue), false); } } static void drawMapToolbar(Map* map, s32 x, s32 y) { - tic_mem* tic = map->tic; - map->tic->api.rect(map->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white)); - drawTileIndex(map, TIC80_WIDTH/2 - tic->font.width, y); + drawTileIndex(map, TIC80_WIDTH/2 - TIC_FONT_WIDTH, y); x = drawSheetButton(map, TIC80_WIDTH, 0); x = drawFillButton(map, x, 0); @@ -419,8 +417,6 @@ static void drawSheetOvr(Map* map, s32 x, s32 y) static void drawCursorPos(Map* map, s32 x, s32 y) { - tic_mem* tic = map->tic; - char pos[] = "999:999"; s32 tx = 0, ty = 0; @@ -428,16 +424,16 @@ static void drawCursorPos(Map* map, s32 x, s32 y) sprintf(pos, "%03i:%03i", tx, ty); - s32 width = map->tic->api.text(map->tic, pos, TIC80_WIDTH, 0, (tic_color_gray)); + s32 width = map->tic->api.text(map->tic, pos, TIC80_WIDTH, 0, (tic_color_gray), false); s32 px = x + (TIC_SPRITESIZE + 3); if(px + width >= TIC80_WIDTH) px = x - (width + 2); - s32 py = y - (tic->font.height + 2); + s32 py = y - (TIC_FONT_HEIGHT + 2); if(py <= TOOLBAR_SIZE) py = y + (TIC_SPRITESIZE + 3); - map->tic->api.rect(map->tic, px - 1, py - 1, width + 1, tic->font.height + 1, (tic_color_white)); - map->tic->api.text(map->tic, pos, px, py, (tic_color_light_blue)); + map->tic->api.rect(map->tic, px - 1, py - 1, width + 1, TIC_FONT_HEIGHT + 1, (tic_color_white)); + map->tic->api.text(map->tic, pos, px, py, (tic_color_light_blue), false); } static void setMapSprite(Map* map, s32 x, s32 y) @@ -1064,14 +1060,13 @@ static void processKeyboard(Map* map) static void tick(Map* map) { - tic_mem* tic = map->tic; map->tickCounter++; processKeyboard(map); map->tic->api.clear(map->tic, TIC_COLOR_BG); drawSheet(map, TIC80_WIDTH - TIC_SPRITESHEET_SIZE - 1, TOOLBAR_SIZE); - drawMapToolbar(map, TIC80_WIDTH - 9*tic->font.width, 1); + drawMapToolbar(map, TIC80_WIDTH - 9*TIC_FONT_WIDTH, 1); drawToolbar(map->tic, TIC_COLOR_BG, false); } diff --git a/src/menu.c b/src/menu.c index 0fb2350..ce5ebf1 100644 --- a/src/menu.c +++ b/src/menu.c @@ -119,8 +119,8 @@ static void drawDialog(Menu* menu) { static const char Label[] = "GAME MENU"; - s32 size = tic->api.text(tic, Label, 0, -tic->font.height, 0); - tic->api.text(tic, Label, rect.x + (DIALOG_WIDTH - size)/2, rect.y-(TOOLBAR_SIZE-2), (tic_color_gray)); + s32 size = tic->api.text(tic, Label, 0, -TIC_FONT_HEIGHT, 0, false); + tic->api.text(tic, Label, rect.x + (DIALOG_WIDTH - size)/2, rect.y-(TOOLBAR_SIZE-2), (tic_color_gray), false); } { @@ -157,7 +157,7 @@ static void drawTabDisabled(Menu* menu, s32 x, s32 y, s32 id) { char buf[] = "#1"; sprintf(buf, "#%i", id+1); - tic->api.fixed_text(tic, buf, x+2, y, (over ? tic_color_light_blue : tic_color_gray)); + tic->api.fixed_text(tic, buf, x+2, y, (over ? tic_color_light_blue : tic_color_gray), false); } } @@ -174,7 +174,7 @@ static void drawTab(Menu* menu, s32 x, s32 y, s32 id) { char buf[] = "#1"; sprintf(buf, "#%i", id+1); - tic->api.fixed_text(tic, buf, x+2, y, (tic_color_gray)); + tic->api.fixed_text(tic, buf, x+2, y, (tic_color_gray), false); } } @@ -221,7 +221,7 @@ static void drawPlayerButtons(Menu* menu, s32 x, s32 y) if(strlen(label) > MaxChars) label[MaxChars] = '\0'; - tic->api.text(tic, label, rect.x+10, rect.y+2, (over ? tic_color_gray : tic_color_black)); + tic->api.text(tic, label, rect.x+10, rect.y+2, (over ? tic_color_gray : tic_color_black), false); } } @@ -253,7 +253,7 @@ static void drawGamepadMenu(Menu* menu) static const char Label[] = "BACK"; - tic_rect rect = {dlgRect.x + 25, dlgRect.y + 56, (sizeof(Label)-1)*tic->font.width, tic->font.height}; + tic_rect rect = {dlgRect.x + 25, dlgRect.y + 56, (sizeof(Label)-1)*TIC_FONT_WIDTH, TIC_FONT_HEIGHT}; bool over = false; bool down = false; @@ -280,12 +280,12 @@ static void drawGamepadMenu(Menu* menu) if(down) { - tic->api.text(tic, Label, rect.x, rect.y+1, (tic_color_light_blue)); + tic->api.text(tic, Label, rect.x, rect.y+1, (tic_color_light_blue), false); } else { - tic->api.text(tic, Label, rect.x, rect.y+1, (tic_color_black)); - tic->api.text(tic, Label, rect.x, rect.y, (over ? tic_color_light_blue : tic_color_white)); + tic->api.text(tic, Label, rect.x, rect.y+1, (tic_color_black), false); + tic->api.text(tic, Label, rect.x, rect.y, (over ? tic_color_light_blue : tic_color_white), false); } { @@ -321,7 +321,7 @@ static void drawMainMenu(Menu* menu) { if(!*Rows[i])continue; - tic_rect label = {rect.x + 22, rect.y + (tic->font.height+1)*i + 16, 86, tic->font.height+1}; + tic_rect label = {rect.x + 22, rect.y + (TIC_FONT_HEIGHT+1)*i + 16, 86, TIC_FONT_HEIGHT+1}; bool over = false; bool down = false; @@ -346,12 +346,12 @@ static void drawMainMenu(Menu* menu) if(down) { - tic->api.text(tic, Rows[i], label.x, label.y+1, (tic_color_light_blue)); + tic->api.text(tic, Rows[i], label.x, label.y+1, (tic_color_light_blue), false); } else { - tic->api.text(tic, Rows[i], label.x, label.y+1, (tic_color_black)); - tic->api.text(tic, Rows[i], label.x, label.y, (over ? tic_color_light_blue : tic_color_white)); + tic->api.text(tic, Rows[i], label.x, label.y+1, (tic_color_black), false); + tic->api.text(tic, Rows[i], label.x, label.y, (over ? tic_color_light_blue : tic_color_white), false); } if(i == menu->main.focus) diff --git a/src/music.c b/src/music.c index 00f38b6..957ba85 100644 --- a/src/music.c +++ b/src/music.c @@ -66,7 +66,6 @@ static void drawDownBorder(Music* music, s32 x, s32 y, s32 w, s32 h) static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music*, s32, s32 channel), s32 channel) { - tic_mem* tic = music->tic; static const u8 LeftArrow[] = { 0b00100000, @@ -91,12 +90,8 @@ static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music* 0b00000000, }; - enum{ArrowWidth = 4, ArrowHeight = 6}; - - x -= ArrowWidth + 2; - { - tic_rect rect = { x, y, ArrowWidth, ArrowHeight }; + tic_rect rect = { x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT }; bool over = false; bool down = false; @@ -116,9 +111,9 @@ static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music* } { - x += ArrowWidth + 2; + x += TIC_FONT_WIDTH; - tic_rect rect = { x-1, y-1, tic->font.width*2+1, tic->font.height+1 }; + tic_rect rect = { x-1, y-1, TIC_FONT_WIDTH*2+1, TIC_FONT_HEIGHT+1 }; if (checkMousePos(&rect)) { @@ -130,7 +125,7 @@ static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music* music->tracker.col = channel * CHANNEL_COLS; s32 mx = getMouseX() - rect.x; - music->tracker.patternCol = mx / tic->font.width; + music->tracker.patternCol = mx / TIC_FONT_WIDTH; } } @@ -139,18 +134,18 @@ static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music* if(music->tracker.row == -1 && music->tracker.col / CHANNEL_COLS == channel) { - music->tic->api.rect(music->tic, x - 1 + music->tracker.patternCol * tic->font.width, y - 1, tic->font.width + 1, tic->font.height + 1, (tic_color_red)); + music->tic->api.rect(music->tic, x - 1 + music->tracker.patternCol * TIC_FONT_WIDTH, y - 1, TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, (tic_color_red)); } char val[] = "99"; sprintf(val, "%02i", value); - music->tic->api.fixed_text(music->tic, val, x, y, (tic_color_white)); + music->tic->api.fixed_text(music->tic, val, x, y, (tic_color_white), false); } { - x += 2*tic->font.width; + x += 2*TIC_FONT_WIDTH; - tic_rect rect = { x, y, ArrowWidth, ArrowHeight }; + tic_rect rect = { x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT }; bool over = false; bool down = false; @@ -172,14 +167,13 @@ static void drawEditbox(Music* music, s32 x, s32 y, s32 value, void(*set)(Music* static void drawSwitch(Music* music, s32 x, s32 y, const char* label, s32 value, void(*set)(Music*, s32, void* data), void* data) { - tic_mem* tic = music->tic; static const u8 LeftArrow[] = { - 0b00100000, - 0b01100000, - 0b11100000, - 0b01100000, - 0b00100000, + 0b00010000, + 0b00110000, + 0b01110000, + 0b00110000, + 0b00010000, 0b00000000, 0b00000000, 0b00000000, @@ -187,25 +181,23 @@ static void drawSwitch(Music* music, s32 x, s32 y, const char* label, s32 value, static const u8 RightArrow[] = { - 0b10000000, - 0b11000000, - 0b11100000, - 0b11000000, - 0b10000000, + 0b01000000, + 0b01100000, + 0b01110000, + 0b01100000, + 0b01000000, 0b00000000, 0b00000000, 0b00000000, }; - enum{ArrowWidth = 4, ArrowHeight = 6}; - - music->tic->api.text(music->tic, label, x, y+1, (tic_color_black)); - music->tic->api.text(music->tic, label, x, y, (tic_color_white)); + music->tic->api.text(music->tic, label, x, y+1, (tic_color_black), false); + music->tic->api.text(music->tic, label, x, y, (tic_color_white), false); { - x += (s32)strlen(label)*tic->font.width + 1; + x += (s32)strlen(label)*TIC_FONT_WIDTH; - tic_rect rect = { x, y, ArrowWidth, ArrowHeight}; + tic_rect rect = { x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT }; bool over = false; bool down = false; @@ -226,17 +218,16 @@ static void drawSwitch(Music* music, s32 x, s32 y, const char* label, s32 value, } { - x += ArrowWidth; char val[] = "999"; sprintf(val, "%02i", value); - music->tic->api.fixed_text(music->tic, val, x, y+1, (tic_color_black)); - music->tic->api.fixed_text(music->tic, val, x, y, (tic_color_white)); + music->tic->api.fixed_text(music->tic, val, x + TIC_FONT_WIDTH, y+1, (tic_color_black), false); + music->tic->api.fixed_text(music->tic, val, x += TIC_FONT_WIDTH, y, (tic_color_white), false); } { - x += (value > 99 ? 3 : 2)*tic->font.width; + x += (value > 99 ? 3 : 2)*TIC_FONT_WIDTH; - tic_rect rect = { x, y, ArrowWidth, ArrowHeight}; + tic_rect rect = { x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT }; bool over = false; bool down = false; @@ -1114,28 +1105,24 @@ static void setRows(Music* music, s32 delta, void* data) static void drawTopPanel(Music* music, s32 x, s32 y) { - tic_mem* tic = music->tic; tic_track* track = getTrack(music); drawSwitch(music, x, y, "TRACK", music->track, setIndex, NULL); - drawSwitch(music, x += tic->font.width * 10, y, "TEMPO", track->tempo + DEFAULT_TEMPO, setTempo, NULL); - drawSwitch(music, x += tic->font.width * 11, y, "SPD", track->speed + DEFAULT_SPEED, setSpeed, NULL); - drawSwitch(music, x += tic->font.width * 8, y, "ROWS", MUSIC_PATTERN_ROWS - track->rows, setRows, NULL); + drawSwitch(music, x += TIC_FONT_WIDTH * 10, y, "TEMPO", track->tempo + DEFAULT_TEMPO, setTempo, NULL); + drawSwitch(music, x += TIC_FONT_WIDTH * 11, y, "SPD", track->speed + DEFAULT_SPEED, setSpeed, NULL); + drawSwitch(music, x += TIC_FONT_WIDTH * 8, y, "ROWS", MUSIC_PATTERN_ROWS - track->rows, setRows, NULL); } static void drawTrackerFrames(Music* music, s32 x, s32 y) { - tic_mem* tic = music->tic; - enum { Border = 1, + Width = TIC_FONT_WIDTH * 2 + Border, }; - s32 width = tic->font.width * 2 + Border; - { - tic_rect rect = { x - Border, y - Border, width, MUSIC_FRAMES * tic->font.height + Border }; + tic_rect rect = { x - Border, y - Border, Width, MUSIC_FRAMES * TIC_FONT_HEIGHT + Border }; if (checkMousePos(&rect)) { @@ -1144,7 +1131,7 @@ static void drawTrackerFrames(Music* music, s32 x, s32 y) if (checkMouseDown(&rect, tic_mouse_left)) { s32 my = getMouseY() - rect.y - Border; - music->tracker.frame = my / tic->font.height; + music->tracker.frame = my / TIC_FONT_HEIGHT; } } @@ -1168,26 +1155,26 @@ static void drawTrackerFrames(Music* music, s32 x, s32 y) 0b00000000, }; - drawBitIcon(x - 7, y + i*tic->font.height, Icon, tic_color_black); - drawBitIcon(x - 7, y - 1 + i*tic->font.height, Icon, tic_color_white); + drawBitIcon(x - TIC_FONT_WIDTH-1, y + i*TIC_FONT_HEIGHT, Icon, tic_color_black); + drawBitIcon(x - TIC_FONT_WIDTH-1, y - 1 + i*TIC_FONT_HEIGHT, Icon, tic_color_white); } if (i == music->tracker.frame) { - music->tic->api.rect(music->tic, x - 1, y - 1 + i*tic->font.height, width, tic->font.height + 1, (tic_color_white)); + music->tic->api.rect(music->tic, x - 1, y - 1 + i*TIC_FONT_HEIGHT, Width, TIC_FONT_HEIGHT + 1, (tic_color_white)); } char buf[] = "99"; sprintf(buf, "%02i", i); - music->tic->api.fixed_text(music->tic, buf, x, y + i*tic->font.height, (tic_color_dark_gray)); + music->tic->api.fixed_text(music->tic, buf, x, y + i*TIC_FONT_HEIGHT, (tic_color_dark_gray), false); } if(music->tracker.row >= 0) { char buf[] = "99"; sprintf(buf, "%02i", music->tracker.row); - music->tic->api.fixed_text(music->tic, buf, x, y - 10, (tic_color_black)); - music->tic->api.fixed_text(music->tic, buf, x, y - 11, (tic_color_white)); + music->tic->api.fixed_text(music->tic, buf, x, y - 10, (tic_color_black), false); + music->tic->api.fixed_text(music->tic, buf, x, y - 11, (tic_color_white), false); } } @@ -1213,12 +1200,11 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel) enum { Border = 1, - Rows = TRACKER_ROWS, + Rows = TRACKER_ROWS, + Width = TIC_FONT_WIDTH * 8 + Border, }; - s32 width = tic->font.width * 8 + Border; - - tic_rect rect = {x - Border, y - Border, width, Rows*tic->font.height + Border}; + tic_rect rect = {x - Border, y - Border, Width, Rows*TIC_FONT_HEIGHT + Border}; if(checkMousePos(&rect)) { @@ -1229,8 +1215,8 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel) s32 mx = getMouseX() - rect.x - Border; s32 my = getMouseY() - rect.y - Border; - s32 col = music->tracker.col = channel * CHANNEL_COLS + mx / tic->font.width; - s32 row = music->tracker.row = my / tic->font.height + music->tracker.scroll; + s32 col = music->tracker.col = channel * CHANNEL_COLS + mx / TIC_FONT_WIDTH; + s32 row = music->tracker.row = my / TIC_FONT_HEIGHT + music->tracker.scroll; if(music->tracker.select.drag) { @@ -1266,11 +1252,11 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel) for (s32 i = start, pos = 0; i < end; i++, pos++) { - s32 rowy = y + pos*tic->font.height; + s32 rowy = y + pos*TIC_FONT_HEIGHT; if (i == music->tracker.row) { - music->tic->api.rect(music->tic, x - 1, rowy - 1, width, tic->font.height + 1, (tic_color_dark_red)); + music->tic->api.rect(music->tic, x - 1, rowy - 1, Width, TIC_FONT_HEIGHT + 1, (tic_color_dark_red)); } // draw selection @@ -1280,13 +1266,13 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel) if (rect.h > 1 && i >= rect.y && i < rect.y + rect.h) { s32 sx = x - 1; - tic->api.rect(tic, sx, rowy - 1, CHANNEL_COLS * tic->font.width + 1, tic->font.height + 1, (tic_color_yellow)); + tic->api.rect(tic, sx, rowy - 1, CHANNEL_COLS * TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, (tic_color_yellow)); } } if (checkPlayRow(music, i)) { - music->tic->api.rect(music->tic, x - 1, rowy - 1, width, tic->font.height + 1, (tic_color_white)); + music->tic->api.rect(music->tic, x - 1, rowy - 1, Width, TIC_FONT_HEIGHT + 1, (tic_color_white)); } char rowStr[] = "--------"; @@ -1315,30 +1301,30 @@ static void drawTrackerChannel(Music* music, s32 x, s32 y, s32 channel) bool beetRow = i % NOTES_PER_BEET == 0; - for (s32 c = 0, colx = x; c < sizeof rowStr - 1; c++, colx += tic->font.width) + for (s32 c = 0, colx = x; c < sizeof rowStr - 1; c++, colx += TIC_FONT_WIDTH) { char sym = rowStr[c]; const u8* colors = beetRow || sym != '-' ? Colors : DarkColors; - music->tic->api.draw_char(music->tic, sym, colx, rowy, colors[ColorIndexes[c]]); + music->tic->api.draw_char(music->tic, sym, colx, rowy, colors[ColorIndexes[c]], false); } } } - else music->tic->api.fixed_text(music->tic, rowStr, x, rowy, (tic_color_dark_gray)); + else music->tic->api.fixed_text(music->tic, rowStr, x, rowy, (tic_color_dark_gray), false); if (i == music->tracker.row) { if (music->tracker.col / CHANNEL_COLS == channel) { s32 col = music->tracker.col % CHANNEL_COLS; - s32 colx = x - 1 + col * tic->font.width; - music->tic->api.rect(music->tic, colx, rowy - 1, tic->font.width + 1, tic->font.height + 1, (tic_color_red)); - music->tic->api.draw_char(music->tic, rowStr[col], colx + 1, rowy, (tic_color_black)); + s32 colx = x - 1 + col * TIC_FONT_WIDTH; + music->tic->api.rect(music->tic, colx, rowy - 1, TIC_FONT_WIDTH + 1, TIC_FONT_HEIGHT + 1, (tic_color_red)); + music->tic->api.draw_char(music->tic, rowStr[col], colx + 1, rowy, (tic_color_black), false); } } if (i % NOTES_PER_BEET == 0) - music->tic->api.pixel(music->tic, x - 4, y + pos*tic->font.height + 2, (tic_color_black)); + music->tic->api.pixel(music->tic, x - 4, y + pos*TIC_FONT_HEIGHT + 2, (tic_color_black)); } } @@ -1358,12 +1344,12 @@ static void drawTumbler(Music* music, s32 x, s32 y, s32 index) if(checkMouseClick(&rect, tic_mouse_left)) { - if (tic->api.key(tic, tic_key_ctrl)) - { - for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++) - music->tracker.patterns[i] = i == index; - } - else music->tracker.patterns[index] = !music->tracker.patterns[index]; + // if (SDL_GetModState() & KMOD_CTRL) + // { + // for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++) + // music->tracker.patterns[i] = i == index; + // } + // else music->tracker.patterns[index] = !music->tracker.patterns[index]; } } @@ -1373,25 +1359,21 @@ static void drawTumbler(Music* music, s32 x, s32 y, s32 index) static void drawTracker(Music* music, s32 x, s32 y) { - tic_mem* tic = music->tic; - drawTrackerFrames(music, x, y); - enum{Gap = 6, Cols = 8}; + x += TIC_FONT_WIDTH * 3; - x += tic->font.width * 2 + Gap; - - s32 channelWidth = tic->font.width * Cols + Gap; + enum{ChannelWidth = TIC_FONT_WIDTH * 9}; for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++) { s32 patternId = tic_tool_get_pattern_id(getTrack(music), music->tracker.frame, i); - drawEditbox(music, x + channelWidth * i + 3*tic->font.width, y - 11, patternId, setChannelPattern, i); - drawTumbler(music, x + channelWidth * (i+1) - 4 - Gap, y - 11, i); + drawEditbox(music, x + ChannelWidth * i + 2*TIC_FONT_WIDTH, y - 11, patternId, setChannelPattern, i); + drawTumbler(music, x + ChannelWidth * i + 7*TIC_FONT_WIDTH, y - 11, i); } for (s32 i = 0; i < TIC_SOUND_CHANNELS; i++) - drawTrackerChannel(music, x + channelWidth * i, y, i); + drawTrackerChannel(music, x + ChannelWidth * i, y, i); } static void enableFollowMode(Music* music) @@ -1535,11 +1517,10 @@ static void drawMusicToolbar(Music* music) static void drawPianoLayout(Music* music) { - tic_mem* tic = music->tic; music->tic->api.clear(music->tic, (tic_color_gray)); static const char Wip[] = "PIANO MODE - WORK IN PROGRESS..."; - music->tic->api.fixed_text(music->tic, Wip, (TIC80_WIDTH - (sizeof Wip - 1) * tic->font.width) / 2, TIC80_HEIGHT / 2, (tic_color_white)); + music->tic->api.fixed_text(music->tic, Wip, (TIC80_WIDTH - (sizeof Wip - 1) * TIC_FONT_WIDTH) / 2, TIC80_HEIGHT / 2, (tic_color_white), false); } static void scrollNotes(Music* music, s32 delta) diff --git a/src/sfx.c b/src/sfx.c index 19e72b1..9413091 100644 --- a/src/sfx.c +++ b/src/sfx.c @@ -39,15 +39,13 @@ static void drawSwitch(Sfx* sfx, s32 x, s32 y, const char* label, s32 value, void(*set)(Sfx*, s32)) { - tic_mem* tic = sfx->tic; - static const u8 LeftArrow[] = { - 0b00100000, - 0b01100000, - 0b11100000, - 0b01100000, - 0b00100000, + 0b00010000, + 0b00110000, + 0b01110000, + 0b00110000, + 0b00010000, 0b00000000, 0b00000000, 0b00000000, @@ -55,24 +53,22 @@ static void drawSwitch(Sfx* sfx, s32 x, s32 y, const char* label, s32 value, voi static const u8 RightArrow[] = { - 0b10000000, - 0b11000000, - 0b11100000, - 0b11000000, - 0b10000000, + 0b01000000, + 0b01100000, + 0b01110000, + 0b01100000, + 0b01000000, 0b00000000, 0b00000000, 0b00000000, }; - enum{ArrowWidth = 4, ArrowHeight = 6}; - - sfx->tic->api.text(sfx->tic, label, x, y, (tic_color_white)); + sfx->tic->api.text(sfx->tic, label, x, y, (tic_color_white), false); { - x += (s32)strlen(label)*tic->font.width; + x += (s32)strlen(label)*TIC_FONT_WIDTH; - tic_rect rect = {x, y, ArrowWidth, ArrowHeight}; + tic_rect rect = {x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT}; if(checkMousePos(&rect)) { @@ -88,13 +84,13 @@ static void drawSwitch(Sfx* sfx, s32 x, s32 y, const char* label, s32 value, voi { char val[] = "99"; sprintf(val, "%02i", value); - sfx->tic->api.fixed_text(sfx->tic, val, x += ArrowWidth, y, (tic_color_white)); + sfx->tic->api.fixed_text(sfx->tic, val, x += TIC_FONT_WIDTH, y, (tic_color_white), false); } { - x += 2*tic->font.width; + x += 2*TIC_FONT_WIDTH; - tic_rect rect = {x, y, ArrowWidth, ArrowHeight}; + tic_rect rect = {x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT}; if(checkMousePos(&rect)) { @@ -129,8 +125,7 @@ static void setSpeed(Sfx* sfx, s32 delta) static void drawTopPanel(Sfx* sfx, s32 x, s32 y) { - tic_mem* tic = sfx->tic; - const s32 Gap = 8*tic->font.width; + const s32 Gap = 8*TIC_FONT_WIDTH; drawSwitch(sfx, x, y, "IDX", sfx->index, setIndex); @@ -161,16 +156,15 @@ static void setLoopSize(Sfx* sfx, s32 delta) static void drawLoopPanel(Sfx* sfx, s32 x, s32 y) { - tic_mem* tic = sfx->tic; - sfx->tic->api.text(sfx->tic, "LOOP:", x, y, (tic_color_dark_gray)); + sfx->tic->api.text(sfx->tic, "LOOP:", x, y, (tic_color_dark_gray), false); enum {Gap = 2}; tic_sample* effect = getEffect(sfx); tic_sound_loop* loop = effect->loops + sfx->canvasTab; - drawSwitch(sfx, x, y += Gap + tic->font.height, "", loop->size, setLoopSize); - drawSwitch(sfx, x, y += Gap + tic->font.height, "", loop->start, setLoopStart); + drawSwitch(sfx, x, y += Gap + TIC_FONT_HEIGHT, "", loop->size, setLoopSize); + drawSwitch(sfx, x, y += Gap + TIC_FONT_HEIGHT, "", loop->start, setLoopStart); } static tic_waveform* getWaveformById(Sfx* sfx, s32 i) @@ -293,16 +287,15 @@ static void drawWaveButtons(Sfx* sfx, s32 x, s32 y) static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y) { - tic_mem* tic = sfx->tic; static const char* Labels[] = {"WAVE", "VOLUME", "ARPEGG", "PITCH"}; - s32 height = tic->font.height+2; + enum {Height = TIC_FONT_HEIGHT+2}; - for(s32 i = 0, sy = y; i < COUNT_OF(Labels); sy += height, i++) + for(s32 i = 0, sy = y; i < COUNT_OF(Labels); sy += Height, i++) { - s32 size = sfx->tic->api.text(sfx->tic, Labels[i], 0, -tic->font.height, (tic_color_black)); + s32 size = sfx->tic->api.text(sfx->tic, Labels[i], 0, -TIC_FONT_HEIGHT, (tic_color_black), false); - tic_rect rect = {x - size, sy, size, tic->font.height}; + tic_rect rect = {x - size, sy, size, TIC_FONT_HEIGHT}; if(checkMousePos(&rect)) { @@ -314,7 +307,7 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y) } } - sfx->tic->api.text(sfx->tic, Labels[i], rect.x, rect.y, i == sfx->canvasTab ? (tic_color_white) : (tic_color_dark_gray)); + sfx->tic->api.text(sfx->tic, Labels[i], rect.x, rect.y, i == sfx->canvasTab ? (tic_color_white) : (tic_color_dark_gray), false); } tic_sample* effect = getEffect(sfx); @@ -324,8 +317,8 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y) case SFX_PITCH_TAB: { static const char Label[] = "x16"; - s32 width = (sizeof Label - 1) * tic->font.width; - tic_rect rect = {(x - width)/2, y + height * 6, width, tic->font.height}; + enum{Width = (sizeof Label - 1) * TIC_FONT_WIDTH}; + tic_rect rect = {(x - Width)/2, y + Height * 6, Width, TIC_FONT_HEIGHT}; if(checkMousePos(&rect)) { @@ -335,14 +328,14 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y) effect->pitch16x++; } - sfx->tic->api.fixed_text(sfx->tic, Label, rect.x, rect.y, (effect->pitch16x ? tic_color_white : tic_color_dark_gray)); + sfx->tic->api.fixed_text(sfx->tic, Label, rect.x, rect.y, (effect->pitch16x ? tic_color_white : tic_color_dark_gray), false); } break; case SFX_ARPEGGIO_TAB: { static const char Label[] = "DOWN"; - s32 width = (sizeof Label - 1) * tic->font.width; - tic_rect rect = {(x - width)/2, y + height * 6, width, tic->font.height}; + enum{Width = (sizeof Label - 1) * TIC_FONT_WIDTH}; + tic_rect rect = {(x - Width)/2, y + Height * 6, Width, TIC_FONT_HEIGHT}; if(checkMousePos(&rect)) { @@ -352,7 +345,7 @@ static void drawCanvasTabs(Sfx* sfx, s32 x, s32 y) effect->reverse++; } - sfx->tic->api.text(sfx->tic, Label, rect.x, rect.y, (effect->reverse ? tic_color_white : tic_color_dark_gray)); + sfx->tic->api.text(sfx->tic, Label, rect.x, rect.y, (effect->reverse ? tic_color_white : tic_color_dark_gray), false); } break; default: break; @@ -521,19 +514,18 @@ static void drawPiano(Sfx* sfx, s32 x, s32 y) static void drawOctavePanel(Sfx* sfx, s32 x, s32 y) { - tic_mem* tic = sfx->tic; tic_sample* effect = getEffect(sfx); static const char Label[] = "OCT"; - sfx->tic->api.text(sfx->tic, Label, x, y, (tic_color_white)); + sfx->tic->api.text(sfx->tic, Label, x, y, (tic_color_white), false); - x += sizeof(Label)*tic->font.width; + x += sizeof(Label)*TIC_FONT_WIDTH; enum {Gap = 5}; for(s32 i = 0; i < OCTAVES; i++) { - tic_rect rect = {x + i * (tic->font.width + Gap), y, tic->font.width, tic->font.height}; + tic_rect rect = {x + i * (TIC_FONT_WIDTH + Gap), y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT}; if(checkMousePos(&rect)) { @@ -545,7 +537,7 @@ static void drawOctavePanel(Sfx* sfx, s32 x, s32 y) } } - sfx->tic->api.draw_char(sfx->tic, i + '1', rect.x, rect.y, (i == effect->octave ? tic_color_white : tic_color_dark_gray)); + sfx->tic->api.draw_char(sfx->tic, i + '1', rect.x, rect.y, (i == effect->octave ? tic_color_white : tic_color_dark_gray), false); } } @@ -789,14 +781,13 @@ static void drawModeTabs(Sfx* sfx) static void drawSfxToolbar(Sfx* sfx) { - tic_mem* tic = sfx->tic; sfx->tic->api.rect(sfx->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white)); - s32 width = 3 * tic->font.width; - s32 x = TIC80_WIDTH - width - TIC_SPRITESIZE*3; + enum{Width = 3 * TIC_FONT_WIDTH}; + s32 x = TIC80_WIDTH - Width - TIC_SPRITESIZE*3; s32 y = 1; - tic_rect rect = {x, y, width, tic->font.height}; + tic_rect rect = {x, y, Width, TIC_FONT_HEIGHT}; bool over = false; if(checkMousePos(&rect)) @@ -819,7 +810,7 @@ static void drawSfxToolbar(Sfx* sfx) char buf[] = "C#4"; sprintf(buf, "%s%i", Notes[effect->note], effect->octave+1); - sfx->tic->api.fixed_text(sfx->tic, buf, x, y, (over ? tic_color_dark_gray : tic_color_light_blue)); + sfx->tic->api.fixed_text(sfx->tic, buf, x, y, (over ? tic_color_dark_gray : tic_color_light_blue), false); } drawModeTabs(sfx); @@ -827,7 +818,6 @@ static void drawSfxToolbar(Sfx* sfx) static void envelopesTick(Sfx* sfx) { - tic_mem* tic = sfx->tic; processKeyboard(sfx); processEnvelopesKeyboard(sfx); @@ -840,13 +830,13 @@ static void envelopesTick(Sfx* sfx) drawToolbar(sfx->tic, TIC_COLOR_BG, false); drawTopPanel(sfx, Start, TOOLBAR_SIZE + Gap); - drawCanvasTabs(sfx, Start-Gap, TOOLBAR_SIZE + Gap + tic->font.height+2); + drawCanvasTabs(sfx, Start-Gap, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+2); if(sfx->canvasTab == SFX_WAVE_TAB) - drawWaveButtons(sfx, Start + CANVAS_WIDTH + Gap-1, TOOLBAR_SIZE + Gap + tic->font.height+2); + drawWaveButtons(sfx, Start + CANVAS_WIDTH + Gap-1, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+2); - drawLoopPanel(sfx, Gap, TOOLBAR_SIZE + Gap + tic->font.height+92); - drawCanvas(sfx, Start-1, TOOLBAR_SIZE + Gap + tic->font.height + 1); - drawOctavePanel(sfx, Start + Gap + PIANO_WIDTH + Gap-1, TIC80_HEIGHT - tic->font.height - (PIANO_HEIGHT - tic->font.height)/2 - Gap); + drawLoopPanel(sfx, Gap, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT+92); + drawCanvas(sfx, Start-1, TOOLBAR_SIZE + Gap + TIC_FONT_HEIGHT + 1); + drawOctavePanel(sfx, Start + Gap + PIANO_WIDTH + Gap-1, TIC80_HEIGHT - TIC_FONT_HEIGHT - (PIANO_HEIGHT - TIC_FONT_HEIGHT)/2 - Gap); } static void drawWaveformBar(Sfx* sfx, s32 x, s32 y) diff --git a/src/sprite.c b/src/sprite.c index c35dfda..6b5afa4 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -359,17 +359,15 @@ static void drawBrushSlider(Sprite* sprite, s32 x, s32 y) static void drawCanvas(Sprite* sprite, s32 x, s32 y) { - tic_mem* tic = sprite->tic; - if(!hasCanvasSelection(sprite)) { char buf[] = "#255"; sprintf(buf, "#%03i", sprite->index); - s32 ix = x + (CANVAS_SIZE - 4*tic->font.width)/2; + s32 ix = x + (CANVAS_SIZE - 4*TIC_FONT_WIDTH)/2; s32 iy = TIC_SPRITESIZE + 2; - sprite->tic->api.text(sprite->tic, buf, ix, iy+1, (tic_color_black)); - sprite->tic->api.text(sprite->tic, buf, ix, iy, (tic_color_white)); + sprite->tic->api.text(sprite->tic, buf, ix, iy+1, (tic_color_black), false); + sprite->tic->api.text(sprite->tic, buf, ix, iy, (tic_color_white), false); } sprite->tic->api.rect_border(sprite->tic, x-1, y-1, CANVAS_SIZE+2, CANVAS_SIZE+2, (tic_color_white)); @@ -694,7 +692,7 @@ static void drawRGBSlider(Sprite* sprite, s32 x, s32 y, u8* value) { char buf[] = "FF"; sprintf(buf, "%02X", *value); - sprite->tic->api.text(sprite->tic, buf, x - 18, y - 2, (tic_color_dark_gray)); + sprite->tic->api.text(sprite->tic, buf, x - 18, y - 2, (tic_color_dark_gray), false); } } @@ -1494,7 +1492,6 @@ static void processKeyboard(Sprite* sprite) static void drawSpriteToolbar(Sprite* sprite) { - tic_mem* tic = sprite->tic; sprite->tic->api.rect(sprite->tic, 0, 0, TIC80_WIDTH, TOOLBAR_SIZE, (tic_color_white)); // draw sprite size control @@ -1536,9 +1533,9 @@ static void drawSpriteToolbar(Sprite* sprite) { static const char Label[] = "BG"; - tic_rect rect = {TIC80_WIDTH - 2 * tic->font.width - 2, 0, 2 * tic->font.width + 1, TIC_SPRITESIZE-1}; + tic_rect rect = {TIC80_WIDTH - 2 * TIC_FONT_WIDTH - 2, 0, 2 * TIC_FONT_WIDTH + 1, TIC_SPRITESIZE-1}; sprite->tic->api.rect(sprite->tic, rect.x, rect.y, rect.w, rect.h, bg ? (tic_color_black) : (tic_color_gray)); - sprite->tic->api.fixed_text(sprite->tic, Label, rect.x+1, rect.y+1, (tic_color_white)); + sprite->tic->api.fixed_text(sprite->tic, Label, rect.x+1, rect.y+1, (tic_color_white), false); if(checkMousePos(&rect)) { @@ -1556,9 +1553,9 @@ static void drawSpriteToolbar(Sprite* sprite) { static const char Label[] = "FG"; - tic_rect rect = {TIC80_WIDTH - 4 * tic->font.width - 4, 0, 2 * tic->font.width + 1, TIC_SPRITESIZE-1}; + tic_rect rect = {TIC80_WIDTH - 4 * TIC_FONT_WIDTH - 4, 0, 2 * TIC_FONT_WIDTH + 1, TIC_SPRITESIZE-1}; sprite->tic->api.rect(sprite->tic, rect.x, rect.y, rect.w, rect.h, bg ? (tic_color_gray) : (tic_color_black)); - sprite->tic->api.fixed_text(sprite->tic, Label, rect.x+1, rect.y+1, (tic_color_white)); + sprite->tic->api.fixed_text(sprite->tic, Label, rect.x+1, rect.y+1, (tic_color_white), false); if(checkMousePos(&rect)) { diff --git a/src/start.c b/src/start.c index 7a4690f..07a9c58 100644 --- a/src/start.c +++ b/src/start.c @@ -24,25 +24,23 @@ static void reset(Start* start) { - tic_mem* tic = start->tic; - u8* tile = (u8*)tic->ram.tiles.data; + u8* tile = (u8*)start->tic->ram.tiles.data; - tic->api.clear(tic, (tic_color_black)); + start->tic->api.clear(start->tic, (tic_color_black)); static const u8 Reset[] = {0x00, 0x06, 0x96, 0x00}; u8 val = Reset[sizeof(Reset) * (start->ticks % TIC_FRAMERATE) / TIC_FRAMERATE]; for(s32 i = 0; i < sizeof(tic_tile); i++) tile[i] = val; - tic->api.map(tic, &tic->ram.map, &tic->ram.tiles, 0, 0, TIC_MAP_SCREEN_WIDTH, TIC_MAP_SCREEN_HEIGHT + (TIC80_HEIGHT % TIC_SPRITESIZE ? 1 : 0), 0, 0, -1, 1); + start->tic->api.map(start->tic, &start->tic->ram.map, &start->tic->ram.tiles, 0, 0, TIC_MAP_SCREEN_WIDTH, TIC_MAP_SCREEN_HEIGHT + (TIC80_HEIGHT % TIC_SPRITESIZE ? 1 : 0), 0, 0, -1, 1); } static void drawHeader(Start* start) { - tic_mem* tic = start->tic; - tic->api.fixed_text(tic, TIC_NAME_FULL, TextWidth(tic), TextHeight(tic), (tic_color_white)); - tic->api.fixed_text(tic, TIC_VERSION_LABEL, (sizeof(TIC_NAME_FULL) + 1) * TextWidth(tic), TextHeight(tic), (tic_color_dark_gray)); - tic->api.fixed_text(tic, TIC_COPYRIGHT, TextWidth(tic), TextHeight(tic)*2, (tic_color_dark_gray)); + start->tic->api.fixed_text(start->tic, TIC_NAME_FULL, STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT, (tic_color_white), false); + start->tic->api.fixed_text(start->tic, TIC_VERSION_LABEL, (sizeof(TIC_NAME_FULL) + 1) * STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT, (tic_color_dark_gray), false); + start->tic->api.fixed_text(start->tic, TIC_COPYRIGHT, STUDIO_TEXT_WIDTH, STUDIO_TEXT_HEIGHT*2, (tic_color_dark_gray), false); } static void header(Start* start) @@ -59,10 +57,9 @@ static void header(Start* start) static void end(Start* start) { - tic_mem* tic = start->tic; if(start->play) { - tic->api.sfx_stop(tic, 0); + start->tic->api.sfx_stop(start->tic, 0); start->play = false; } @@ -73,8 +70,6 @@ static void end(Start* start) static void tick(Start* start) { - tic_mem* tic = start->tic; - if(!start->initialized) { start->phase = 1; @@ -83,7 +78,7 @@ static void tick(Start* start) start->initialized = true; } - tic->api.clear(tic, TIC_COLOR_BG); + start->tic->api.clear(start->tic, TIC_COLOR_BG); static void(*const steps[])(Start*) = {reset, header, end}; diff --git a/src/studio.c b/src/studio.c index 37989c5..aef234e 100644 --- a/src/studio.c +++ b/src/studio.c @@ -133,12 +133,12 @@ static struct struct { s32 counter; - char message[TIC80_WIDTH]; + char message[STUDIO_TEXT_BUFFER_WIDTH]; } popup; struct { - char text[TIC80_WIDTH]; + char text[STUDIO_TEXT_BUFFER_WIDTH]; } tooltip; struct @@ -436,7 +436,7 @@ static void drawExtrabar(tic_mem* tic) { enum {Size = 7}; - s32 x = (COUNT_OF(Modes) + 1) * Size + 102; + s32 x = (COUNT_OF(Modes) + 1) * Size + 17 * TIC_FONT_WIDTH; s32 y = 0; static const u8 Icons[] = @@ -532,7 +532,7 @@ static void drawBankIcon(s32 x, s32 y) { tic_mem* tic = impl.studio.tic; - tic_rect rect = {x, y, tic->font.width, tic->font.height}; + tic_rect rect = {x, y, TIC_FONT_WIDTH, TIC_FONT_HEIGHT}; static const u8 Icon[] = { @@ -574,11 +574,9 @@ static void drawBankIcon(s32 x, s32 y) enum{Size = TOOLBAR_SIZE}; - x += Size+2; - for(s32 i = 0; i < TIC_EDITOR_BANKS; i++) { - tic_rect rect = {x + i*Size, 0, Size, Size}; + tic_rect rect = {x + 2 + (i+1)*Size, 0, Size, Size}; bool over = false; if(checkMousePos(&rect)) @@ -597,7 +595,7 @@ static void drawBankIcon(s32 x, s32 y) if(i == impl.bank.indexes[mode]) tic->api.rect(tic, rect.x, rect.y, rect.w, rect.h, tic_color_red); - tic->api.draw_char(tic, '0' + i, rect.x+(Size-tic->font.width+1)/2, rect.y+1, i == impl.bank.indexes[mode] ? tic_color_white : over ? tic_color_red : tic_color_peach); + tic->api.draw_char(tic, '0' + i, rect.x+1, rect.y+1, i == impl.bank.indexes[mode] ? tic_color_white : over ? tic_color_red : tic_color_peach, false); } @@ -614,7 +612,7 @@ static void drawBankIcon(s32 x, s32 y) 0b00000000, }; - tic_rect rect = {x + 2 + TIC_EDITOR_BANKS*Size, 0, Size, Size}; + tic_rect rect = {x + 4 + (TIC_EDITOR_BANKS+1)*Size, 0, Size, Size}; bool over = false; @@ -766,11 +764,11 @@ void drawToolbar(tic_mem* tic, u8 color, bool bg) { if(strlen(impl.tooltip.text)) { - impl.studio.tic->api.text(tic, impl.tooltip.text, TextOffset, 1, (tic_color_black)); + impl.studio.tic->api.text(tic, impl.tooltip.text, TextOffset, 1, (tic_color_black), false); } else { - impl.studio.tic->api.text(tic, Names[mode], TextOffset, 1, (tic_color_dark_gray)); + impl.studio.tic->api.text(tic, Names[mode], TextOffset, 1, (tic_color_dark_gray), false); } } } @@ -1524,8 +1522,6 @@ static void recordFrame(u32* pixels) static void drawPopup() { - tic_mem* tic = impl.studio.tic; - if(impl.popup.counter > 0) { impl.popup.counter--; @@ -1535,14 +1531,14 @@ static void drawPopup() enum{Dur = TIC_FRAMERATE/2}; if(impl.popup.counter < Dur) - anim = -((Dur - impl.popup.counter) * (tic->font.height+1) / Dur); + anim = -((Dur - impl.popup.counter) * (TIC_FONT_HEIGHT+1) / Dur); else if(impl.popup.counter >= (POPUP_DUR - Dur)) - anim = (((POPUP_DUR - Dur) - impl.popup.counter) * (tic->font.height+1) / Dur); + anim = (((POPUP_DUR - Dur) - impl.popup.counter) * (TIC_FONT_HEIGHT+1) / Dur); - impl.studio.tic->api.rect(impl.studio.tic, 0, anim, TIC80_WIDTH, tic->font.height+1, (tic_color_red)); + impl.studio.tic->api.rect(impl.studio.tic, 0, anim, TIC80_WIDTH, TIC_FONT_HEIGHT+1, (tic_color_red)); impl.studio.tic->api.text(impl.studio.tic, impl.popup.message, - (s32)(TIC80_WIDTH - strlen(impl.popup.message)*tic->font.width)/2, - anim + 1, (tic_color_white)); + (s32)(TIC80_WIDTH - strlen(impl.popup.message)*TIC_FONT_WIDTH)/2, + anim + 1, (tic_color_white), false); } } @@ -1630,12 +1626,7 @@ static void renderStudio() static void updateSystemFont() { - tic_mem* tic = impl.studio.tic; - - memset(tic->font.data, 0, sizeof tic->font.data); - - tic->font.width = impl.config->data.theme.font.width; - tic->font.height = impl.config->data.theme.font.height; + memset(impl.studio.tic->font.data, 0, sizeof(tic_font)); for(s32 i = 0; i < TIC_FONT_CHARS; i++) for(s32 y = 0; y < TIC_SPRITESIZE; y++) diff --git a/src/studio.h b/src/studio.h index 5a8ee6d..aecf933 100644 --- a/src/studio.h +++ b/src/studio.h @@ -38,7 +38,10 @@ #define TIC_CACHE TIC_LOCAL "cache/" #define TOOLBAR_SIZE 7 -#define TEXT_LINE_SPACE 1 +#define STUDIO_TEXT_WIDTH (TIC_FONT_WIDTH) +#define STUDIO_TEXT_HEIGHT (TIC_FONT_HEIGHT+1) +#define STUDIO_TEXT_BUFFER_WIDTH (TIC80_WIDTH / STUDIO_TEXT_WIDTH) +#define STUDIO_TEXT_BUFFER_HEIGHT (TIC80_HEIGHT / STUDIO_TEXT_HEIGHT) #define TIC_COLOR_BG (tic_color_black) #define DEFAULT_CHMOD 0755 @@ -160,8 +163,3 @@ bool anyKeyWasPressed(); const StudioConfig* getConfig(); System* getSystem(); - -inline s32 TextWidth(const tic_mem* tic) { return tic->font.width; } -inline s32 TextHeight(const tic_mem* tic) { return tic->font.height + TEXT_LINE_SPACE; } -inline s32 BufferWidth(const tic_mem* tic) { return TIC80_WIDTH/TextWidth(tic); } -inline s32 BufferHeight(const tic_mem* tic) { return TIC80_HEIGHT/TextHeight(tic); } diff --git a/src/surf.c b/src/surf.c index 67400bd..ab08f16 100644 --- a/src/surf.c +++ b/src/surf.c @@ -193,9 +193,9 @@ static void drawTopToolbar(Surf* surf, s32 x, s32 y) sprintf(label, "%s", "TIC-80 SURF"); s32 xl = x + MAIN_OFFSET; - s32 yl = y + (Height - tic->font.height)/2; - tic->api.text(tic, label, xl, yl+1, tic_color_black); - tic->api.text(tic, label, xl, yl, tic_color_white); + s32 yl = y + (Height - TIC_FONT_HEIGHT)/2; + tic->api.text(tic, label, xl, yl+1, tic_color_black, false); + tic->api.text(tic, label, xl, yl, tic_color_white, false); } enum{Gap = 10, TipX = 150, SelectWidth = 54}; @@ -204,15 +204,15 @@ static void drawTopToolbar(Surf* surf, s32 x, s32 y) tic->api.sprite_ex(tic, &getConfig()->cart->bank0.tiles, 12, TipX, y+1, 1, 1, &colorkey, 1, 1, tic_no_flip, tic_no_rotate); { static const char Label[] = "SELECT"; - tic->api.text(tic, Label, TipX + Gap, y+3, tic_color_black); - tic->api.text(tic, Label, TipX + Gap, y+2, tic_color_white); + tic->api.text(tic, Label, TipX + Gap, y+3, tic_color_black, false); + tic->api.text(tic, Label, TipX + Gap, y+2, tic_color_white, false); } tic->api.sprite_ex(tic, &getConfig()->cart->bank0.tiles, 13, TipX + SelectWidth, y + 1, 1, 1, &colorkey, 1, 1, tic_no_flip, tic_no_rotate); { static const char Label[] = "BACK"; - tic->api.text(tic, Label, TipX + Gap + SelectWidth, y +3, tic_color_black); - tic->api.text(tic, Label, TipX + Gap + SelectWidth, y +2, tic_color_white); + tic->api.text(tic, Label, TipX + Gap + SelectWidth, y +3, tic_color_black, false); + tic->api.text(tic, Label, TipX + Gap + SelectWidth, y +2, tic_color_white, false); } } @@ -231,9 +231,9 @@ static void drawBottomToolbar(Surf* surf, s32 x, s32 y) sprintf(label, "/%s", dir); s32 xl = x + MAIN_OFFSET; - s32 yl = y + (Height - tic->font.height)/2; - tic->api.text(tic, label, xl, yl+1, tic_color_black); - tic->api.text(tic, label, xl, yl, tic_color_white); + s32 yl = y + (Height - TIC_FONT_HEIGHT)/2; + tic->api.text(tic, label, xl, yl+1, tic_color_black, false); + tic->api.text(tic, label, xl, yl, tic_color_white, false); } #ifdef CAN_OPEN_URL @@ -247,8 +247,8 @@ static void drawBottomToolbar(Surf* surf, s32 x, s32 y) tic->api.sprite_ex(tic, &getConfig()->cart->bank0.tiles, 15, TipX + SelectWidth, y + 1, 1, 1, &colorkey, 1, 1, tic_no_flip, tic_no_rotate); { static const char Label[] = "WEBSITE"; - tic->api.text(tic, Label, TipX + Gap + SelectWidth, y +3, tic_color_black); - tic->api.text(tic, Label, TipX + Gap + SelectWidth, y +2, tic_color_white); + tic->api.text(tic, Label, TipX + Gap + SelectWidth, y +3, tic_color_black, false); + tic->api.text(tic, Label, TipX + Gap + SelectWidth, y +2, tic_color_white, false); } } #endif @@ -327,18 +327,18 @@ static void drawMenu(Surf* surf, s32 x, s32 y, bool bg) { const char* name = surf->menu.items[i].label; - s32 ym = Height * i + y - surf->menu.pos*MENU_HEIGHT - surf->menu.anim + (MENU_HEIGHT - tic->font.height)/2; + s32 ym = Height * i + y - surf->menu.pos*MENU_HEIGHT - surf->menu.anim + (MENU_HEIGHT - TIC_FONT_HEIGHT)/2; if(bg) { - s32 size = tic->api.text(tic, name, 0, -tic->font.height, 0); + s32 size = tic->api.text(tic, name, 0, -TIC_FONT_HEIGHT, 0, false); - drawInverseRect(tic, x + MAIN_OFFSET - 1, ym-1, size+1, tic->font.height+2); + drawInverseRect(tic, x + MAIN_OFFSET - 1, ym-1, size+1, TIC_FONT_HEIGHT+2); } else { - tic->api.text(tic, name, x + MAIN_OFFSET, ym + 1, tic_color_black); - tic->api.text(tic, name, x + MAIN_OFFSET, ym, tic_color_white); + tic->api.text(tic, name, x + MAIN_OFFSET, ym + 1, tic_color_black, false); + tic->api.text(tic, name, x + MAIN_OFFSET, ym, tic_color_white, false); } } } @@ -837,8 +837,8 @@ static void tick(Surf* surf) else { static const char Label[] = "You don't have any files..."; - s32 size = tic->api.text(tic, Label, 0, -tic->font.height, tic_color_white); - tic->api.text(tic, Label, (TIC80_WIDTH - size) / 2, (TIC80_HEIGHT - tic->font.height)/2, tic_color_white); + s32 size = tic->api.text(tic, Label, 0, -TIC_FONT_HEIGHT, tic_color_white, false); + tic->api.text(tic, Label, (TIC80_WIDTH - size) / 2, (TIC80_HEIGHT - TIC_FONT_HEIGHT)/2, tic_color_white, false); } } diff --git a/src/system.h b/src/system.h index 7c26ac3..c9490e1 100644 --- a/src/system.h +++ b/src/system.h @@ -63,12 +63,6 @@ typedef struct } gamepad; - struct - { - s32 width; - s32 height; - } font; - } theme; s32 gifScale; diff --git a/src/tic.c b/src/tic.c index 8e21f16..269953b 100644 --- a/src/tic.c +++ b/src/tic.c @@ -147,11 +147,11 @@ static void runNoise(blip_buffer_t* blip, tic_sound_register* reg, tic_sound_reg } } -static void resetPalette(tic_mem* tic) +static void resetPalette(tic_mem* memory) { static const u8 DefaultMapping[] = {16, 50, 84, 118, 152, 186, 220, 254}; - memcpy(tic->ram.vram.palette.data, tic->cart.bank0.palette.data, sizeof(tic_palette)); - memcpy(tic->ram.vram.mapping, DefaultMapping, sizeof DefaultMapping); + memcpy(memory->ram.vram.palette.data, memory->cart.bank0.palette.data, sizeof(tic_palette)); + memcpy(memory->ram.vram.mapping, DefaultMapping, sizeof DefaultMapping); } static inline u8 mapColor(tic_mem* tic, u8 color) @@ -214,19 +214,19 @@ static u8 getPixel(tic_machine* machine, s32 x, s32 y) return machine->state.getpix(&machine->memory, x, y); } -static void drawHLineDma(tic_mem* tic, s32 xl, s32 xr, s32 y, u8 color) +static void drawHLineDma(tic_mem* memory, s32 xl, s32 xr, s32 y, u8 color) { color = color << 4 | color; if (xl >= xr) return; if (xl & 1) { - tic_tool_poke4(&tic->ram.vram.screen.data, y * TIC80_WIDTH + xl, color); + tic_tool_poke4(&memory->ram.vram.screen.data, y * TIC80_WIDTH + xl, color); xl++; } s32 count = (xr - xl) >> 1; - u8 *screen = tic->ram.vram.screen.data + ((y * TIC80_WIDTH + xl) >> 1); + u8 *screen = memory->ram.vram.screen.data + ((y * TIC80_WIDTH + xl) >> 1); for(s32 i = 0; i < count; i++) *screen++ = color; if (xr & 1) { - tic_tool_poke4(&tic->ram.vram.screen.data, y * TIC80_WIDTH + xr - 1, color); + tic_tool_poke4(&memory->ram.vram.screen.data, y * TIC80_WIDTH + xr - 1, color); } } @@ -377,9 +377,9 @@ static void resetSfx(Channel* channel) channel->tick = -1; } -static void channelSfx(tic_mem* tic, s32 index, s32 note, s32 octave, s32 duration, Channel* c, s32 volume, s32 speed) +static void channelSfx(tic_mem* memory, s32 index, s32 note, s32 octave, s32 duration, Channel* c, s32 volume, s32 speed) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; c->volume = volume; @@ -401,34 +401,34 @@ static void channelSfx(tic_mem* tic, s32 index, s32 note, s32 octave, s32 durati resetSfx(c); } -static void musicSfx(tic_mem* tic, s32 index, s32 note, s32 octave, s32 volume, s32 channel) +static void musicSfx(tic_mem* memory, s32 index, s32 note, s32 octave, s32 volume, s32 channel) { - tic_machine* machine = (tic_machine*)tic; - channelSfx(tic, index, note, octave, -1, &machine->state.music.channels[channel], MAX_VOLUME - volume, SFX_DEF_SPEED); + tic_machine* machine = (tic_machine*)memory; + channelSfx(memory, index, note, octave, -1, &machine->state.music.channels[channel], MAX_VOLUME - volume, SFX_DEF_SPEED); } -static void resetMusic(tic_mem* tic) +static void resetMusic(tic_mem* memory) { for (s32 c = 0; c < TIC_SOUND_CHANNELS; c++) - musicSfx(tic, -1, 0, 0, 0, c); + musicSfx(memory, -1, 0, 0, 0, c); } static void setMusic(tic_machine* machine, s32 index, s32 frame, s32 row, bool loop) { - tic_mem* tic = (tic_mem*)machine; + tic_mem* memory = (tic_mem*)machine; - tic->ram.music_pos.track = index; + memory->ram.music_pos.track = index; if(index < 0) { machine->state.music.play = MusicStop; - resetMusic(tic); + resetMusic(memory); } else { - tic->ram.music_pos.row = row; - tic->ram.music_pos.frame = frame < 0 ? 0 : frame; - tic->ram.music_pos.flag.loop = loop; + memory->ram.music_pos.row = row; + memory->ram.music_pos.frame = frame < 0 ? 0 : frame; + memory->ram.music_pos.flag.loop = loop; machine->state.music.play = MusicPlay; const tic_track* track = &machine->sound.music->tracks.data[index]; @@ -436,9 +436,9 @@ static void setMusic(tic_machine* machine, s32 index, s32 frame, s32 row, bool l } } -static void api_music(tic_mem* tic, s32 index, s32 frame, s32 row, bool loop) +static void api_music(tic_mem* memory, s32 index, s32 frame, s32 row, bool loop) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; setMusic(machine, index, frame, row, loop); @@ -446,10 +446,10 @@ static void api_music(tic_mem* tic, s32 index, s32 frame, s32 row, bool loop) machine->state.music.play = MusicPlay; } -static void soundClear(tic_mem* tic) +static void soundClear(tic_mem* memory) { { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; Channel channel = { @@ -474,7 +474,7 @@ static void soundClear(tic_mem* tic) memcpy(machine->state.music.channels+i, &channel, sizeof channel); { - tic_sound_register* reg = &tic->ram.registers[i]; + tic_sound_register* reg = &memory->ram.registers[i]; memset(reg, 0, sizeof(tic_sound_register)); } @@ -484,17 +484,17 @@ static void soundClear(tic_mem* tic) } } - api_music(tic, -1, 0, 0, false); + api_music(memory, -1, 0, 0, false); } - memset(tic->samples.buffer, 0, tic->samples.size); + memset(memory->samples.buffer, 0, memory->samples.size); } -static void updateSaveid(tic_mem* tic); +static void updateSaveid(tic_mem* memory); -static void api_clip(tic_mem* tic, s32 x, s32 y, s32 width, s32 height) +static void api_clip(tic_mem* memory, s32 x, s32 y, s32 width, s32 height) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; machine->state.clip.l = x; machine->state.clip.t = y; @@ -507,17 +507,17 @@ static void api_clip(tic_mem* tic, s32 x, s32 y, s32 width, s32 height) if(machine->state.clip.b > TIC80_HEIGHT) machine->state.clip.b = TIC80_HEIGHT; } -static void api_reset(tic_mem* tic) +static void api_reset(tic_mem* memory) { - resetPalette(tic); + resetPalette(memory); - memset(&tic->ram.vram.vars, 0, sizeof tic->ram.vram.vars); + memset(&memory->ram.vram.vars, 0, sizeof memory->ram.vram.vars); - api_clip(tic, 0, 0, TIC80_WIDTH, TIC80_HEIGHT); + api_clip(memory, 0, 0, TIC80_WIDTH, TIC80_HEIGHT); - soundClear(tic); + soundClear(memory); - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; machine->state.initialized = false; machine->state.scanline = NULL; machine->state.ovr.callback = NULL; @@ -526,64 +526,64 @@ static void api_reset(tic_mem* tic) machine->state.getpix = getPixelDma; machine->state.drawhline = drawHLineDma; - updateSaveid(tic); + updateSaveid(memory); } -static void api_pause(tic_mem* tic) +static void api_pause(tic_mem* memory) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; memcpy(&machine->pause.state, &machine->state, sizeof(MachineState)); - memcpy(&machine->pause.ram, &tic->ram, sizeof(tic_ram)); + memcpy(&machine->pause.ram, &memory->ram, sizeof(tic_ram)); machine->pause.time.start = machine->data->start; machine->pause.time.paused = machine->data->counter(); } -static void api_resume(tic_mem* tic) +static void api_resume(tic_mem* memory) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; if (machine->data) { memcpy(&machine->state, &machine->pause.state, sizeof(MachineState)); - memcpy(&tic->ram, &machine->pause.ram, sizeof(tic_ram)); + memcpy(&memory->ram, &machine->pause.ram, sizeof(tic_ram)); machine->data->start = machine->pause.time.start + machine->data->counter() - machine->pause.time.paused; } } -void tic_close(tic_mem* tic) +void tic_close(tic_mem* memory) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; machine->state.initialized = false; #if defined(TIC_BUILD_WITH_LUA) - getLuaScriptConfig()->close(tic); + getLuaScriptConfig()->close(memory); # if defined(TIC_BUILD_WITH_MOON) - getMoonScriptConfig()->close(tic); + getMoonScriptConfig()->close(memory); # endif # if defined(TIC_BUILD_WITH_FENNEL) - getFennelConfig()->close(tic); + getFennelConfig()->close(memory); # endif #endif /* defined(TIC_BUILD_WITH_LUA) */ #if defined(TIC_BUILD_WITH_JS) - getJsScriptConfig()->close(tic); + getJsScriptConfig()->close(memory); #endif #if defined(TIC_BUILD_WITH_WREN) - getWrenScriptConfig()->close(tic); + getWrenScriptConfig()->close(memory); #endif blip_delete(machine->blip); - free(tic->samples.buffer); + free(memory->samples.buffer); free(machine); } @@ -591,49 +591,49 @@ void tic_close(tic_mem* tic) // API //////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -static void api_rect(tic_mem* tic, s32 x, s32 y, s32 width, s32 height, u8 color) +static void api_rect(tic_mem* memory, s32 x, s32 y, s32 width, s32 height, u8 color) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; drawRect(machine, x, y, width, height, color); } -static void api_clear(tic_mem* tic, u8 color) +static void api_clear(tic_mem* memory, u8 color) { static const Clip EmptyClip = {0, 0, TIC80_WIDTH, TIC80_HEIGHT}; - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; if(memcmp(&machine->state.clip, &EmptyClip, sizeof(Clip)) == 0) { color &= 0b00001111; - memset(tic->ram.vram.screen.data, color | (color << TIC_PALETTE_BPP), sizeof(tic->ram.vram.screen.data)); + memset(memory->ram.vram.screen.data, color | (color << TIC_PALETTE_BPP), sizeof(memory->ram.vram.screen.data)); } else { - api_rect(tic, machine->state.clip.l, machine->state.clip.t, machine->state.clip.r - machine->state.clip.l, machine->state.clip.b - machine->state.clip.t, color); + api_rect(memory, machine->state.clip.l, machine->state.clip.t, machine->state.clip.r - machine->state.clip.l, machine->state.clip.b - machine->state.clip.t, color); } } -static s32 drawChar(tic_mem* tic, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale) +static s32 drawChar(tic_mem* memory, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale, bool alt) { - const u8* ptr = tic->font.data + symbol*BITS_IN_BYTE; + const u8* ptr = memory->font.data + (symbol + (alt ? TIC_FONT_CHARS / 2 : 0))*BITS_IN_BYTE; x += (BITS_IN_BYTE - 1)*scale; - for(s32 i = 0, ys = y; i < tic->font.height; i++, ptr++, ys += scale) - for(s32 col = BITS_IN_BYTE - tic->font.width, xs = x - col; col < BITS_IN_BYTE; col++, xs -= scale) + for(s32 i = 0, ys = y; i < TIC_FONT_HEIGHT; i++, ptr++, ys += scale) + for(s32 col = BITS_IN_BYTE - (alt ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH), xs = x - col; col < BITS_IN_BYTE; col++, xs -= scale) if(*ptr & 1 << col) - api_rect(tic, xs, ys, scale, scale, color); + api_rect(memory, xs, ys, scale, scale, color); - return tic->font.width*scale; + return (alt ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH)*scale; } -static s32 api_draw_char(tic_mem* tic, u8 symbol, s32 x, s32 y, u8 color) +static s32 api_draw_char(tic_mem* memory, u8 symbol, s32 x, s32 y, u8 color, bool alt) { - return drawChar(tic, symbol, x, y, tic->font.width, tic->font.height, color, 1); + return drawChar(memory, symbol, x, y, alt ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH, TIC_FONT_HEIGHT, color, 1, alt); } -s32 drawText(tic_mem* tic, const char* text, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale, DrawCharFunc* func) +s32 drawText(tic_mem* memory, const char* text, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale, DrawCharFunc* func, bool alt) { s32 pos = x; s32 max = x; @@ -649,69 +649,71 @@ s32 drawText(tic_mem* tic, const char* text, s32 x, s32 y, s32 width, s32 height pos = x; y += height * scale; } - else pos += func(tic, sym, pos, y, width, height, color, scale); + else pos += func(memory, sym, pos, y, width, height, color, scale, alt); } return pos > max ? pos - x : max - x; } -static s32 api_fixed_text(tic_mem* tic, const char* text, s32 x, s32 y, u8 color) +static s32 api_fixed_text(tic_mem* memory, const char* text, s32 x, s32 y, u8 color, bool alt) { - return drawText(tic, text, x, y, tic->font.width, tic->font.height, color, 1, drawChar); + return drawText(memory, text, x, y, alt ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH, TIC_FONT_HEIGHT, color, 1, drawChar, alt); } -static s32 drawNonFixedChar(tic_mem* tic, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale) +static s32 drawNonFixedChar(tic_mem* memory, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 color, s32 scale, bool alt) { - const u8* ptr = tic->font.data + (symbol)*BITS_IN_BYTE; + const u8* ptr = memory->font.data + (symbol)*BITS_IN_BYTE + (alt ? TIC_FONT_CHARS / 2 : 0); + + const s32 FontWidth = alt ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH; s32 start = 0; - s32 end = tic->font.width; + s32 end = FontWidth; s32 i = 0; - for(s32 col = 0; col < tic->font.width; col++) + for(s32 col = 0; col < FontWidth; col++) { - for(i = 0; i < tic->font.height; i++) + for(i = 0; i < TIC_FONT_HEIGHT; i++) if(*(ptr + i) & 0b10000000 >> col) break; - if(i < tic->font.height) break; else start++; + if(i < TIC_FONT_HEIGHT) break; else start++; } x -= start * scale; - for(s32 col = tic->font.width - 1; col >= start; col--) + for(s32 col = FontWidth - 1; col >= start; col--) { - for(i = 0; i < tic->font.height; i++) + for(i = 0; i < TIC_FONT_HEIGHT; i++) if(*(ptr + i) & 0b10000000 >> col) break; - if(i < tic->font.height) break; else end--; + if(i < TIC_FONT_HEIGHT) break; else end--; } - for(s32 ys = y, i = 0; i < tic->font.height; i++, ptr++, ys += scale) + for(s32 ys = y, i = 0; i < TIC_FONT_HEIGHT; i++, ptr++, ys += scale) for(s32 col = start, xs = x + start*scale; col < end; col++, xs += scale) if(*ptr & 0b10000000 >> col) - api_rect(tic, xs, ys, scale, scale, color); + api_rect(memory, xs, ys, scale, scale, color); s32 size = end - start; - return (size ? size + 1 : tic->font.width - 2) * scale; + return (size ? size + 1 : FontWidth - 2) * scale; } -static s32 api_text(tic_mem* tic, const char* text, s32 x, s32 y, u8 color) +static s32 api_text(tic_mem* memory, const char* text, s32 x, s32 y, u8 color, bool alt) { - return drawText(tic, text, x, y, tic->font.width, tic->font.height, color, 1, drawNonFixedChar); + return drawText(memory, text, x, y, alt ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH, TIC_FONT_HEIGHT, color, 1, drawNonFixedChar, alt); } -static s32 api_text_ex(tic_mem* tic, const char* text, s32 x, s32 y, u8 color, bool fixed, s32 scale) +static s32 api_text_ex(tic_mem* memory, const char* text, s32 x, s32 y, u8 color, bool fixed, s32 scale, bool alt) { - return drawText(tic, text, x, y, tic->font.width, tic->font.height, color, scale, fixed ? drawChar : drawNonFixedChar); + return drawText(memory, text, x, y, alt ? TIC_ALTFONT_WIDTH : TIC_FONT_WIDTH, TIC_FONT_HEIGHT, color, scale, fixed ? drawChar : drawNonFixedChar, alt); } -static void drawSprite(tic_mem* tic, const tic_tiles* src, s32 index, s32 x, s32 y, u8* colors, s32 count, s32 scale, tic_flip flip, tic_rotate rotate) +static void drawSprite(tic_mem* memory, const tic_tiles* src, s32 index, s32 x, s32 y, u8* colors, s32 count, s32 scale, tic_flip flip, tic_rotate rotate) { if(index < TIC_SPRITES) - drawTile((tic_machine*)tic, src->data + index, x, y, colors, count, scale, flip, rotate); + drawTile((tic_machine*)memory, src->data + index, x, y, colors, count, scale, flip, rotate); } -static void api_sprite_ex(tic_mem* tic, const tic_tiles* src, s32 index, s32 x, s32 y, s32 w, s32 h, u8* colors, s32 count, s32 scale, tic_flip flip, tic_rotate rotate) +static void api_sprite_ex(tic_mem* memory, const tic_tiles* src, s32 index, s32 x, s32 y, s32 w, s32 h, u8* colors, s32 count, s32 scale, tic_flip flip, tic_rotate rotate) { s32 step = TIC_SPRITESIZE * scale; @@ -746,23 +748,23 @@ static void api_sprite_ex(tic_mem* tic, const tic_tiles* src, s32 index, s32 x, enum {Cols = TIC_SPRITESHEET_SIZE / TIC_SPRITESIZE}; if(rotate==0 || rotate==2) - drawSprite(tic, src, index + mx+my*Cols, x+i*step, y+j*step, colors, count, scale, flip, rotate); + drawSprite(memory, src, index + mx+my*Cols, x+i*step, y+j*step, colors, count, scale, flip, rotate); else - drawSprite(tic, src, index + mx+my*Cols, x+j*step, y+i*step, colors, count, scale, flip, rotate); + drawSprite(memory, src, index + mx+my*Cols, x+j*step, y+i*step, colors, count, scale, flip, rotate); } } } -s32 drawSpriteFont(tic_mem* tic, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 chromakey, s32 scale) +s32 drawSpriteFont(tic_mem* memory, u8 symbol, s32 x, s32 y, s32 width, s32 height, u8 chromakey, s32 scale, bool alt) { - api_sprite_ex(tic, &tic->ram.sprites, symbol, x, y, 1, 1, &chromakey, 1, scale, tic_no_flip, tic_no_rotate); + api_sprite_ex(memory, &memory->ram.sprites, symbol, x, y, 1, 1, &chromakey, 1, scale, tic_no_flip, tic_no_rotate); return width * scale; } -s32 drawFixedSpriteFont(tic_mem* tic, u8 index, s32 x, s32 y, s32 width, s32 height, u8 chromakey, s32 scale) +s32 drawFixedSpriteFont(tic_mem* memory, u8 index, s32 x, s32 y, s32 width, s32 height, u8 chromakey, s32 scale, bool alt) { - const u8* ptr = tic->ram.sprites.data[index].data; + const u8* ptr = memory->ram.sprites.data[index].data; enum {Size = TIC_SPRITESIZE}; @@ -795,7 +797,7 @@ s32 drawFixedSpriteFont(tic_mem* tic, u8 index, s32 x, s32 y, s32 width, s32 hei u8 color = tic_tool_peek4(ptr, col + row * Size); if(color != chromakey) - api_rect(tic, xs, ys, scale, scale, color); + api_rect(memory, xs, ys, scale, scale, color); } } @@ -803,23 +805,23 @@ s32 drawFixedSpriteFont(tic_mem* tic, u8 index, s32 x, s32 y, s32 width, s32 hei return (size ? size + 1 : width) * scale; } -static void api_pixel(tic_mem* tic, s32 x, s32 y, u8 color) +static void api_pixel(tic_mem* memory, s32 x, s32 y, u8 color) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; setPixel(machine, x, y, color); } -static u8 api_get_pixel(tic_mem* tic, s32 x, s32 y) +static u8 api_get_pixel(tic_mem* memory, s32 x, s32 y) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; return getPixel(machine, x, y); } -static void api_rect_border(tic_mem* tic, s32 x, s32 y, s32 width, s32 height, u8 color) +static void api_rect_border(tic_mem* memory, s32 x, s32 y, s32 width, s32 height, u8 color) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; drawRectBorder(machine, x, y, width, height, color); } @@ -865,9 +867,9 @@ static void setSideTexPixel(s32 x, s32 y, float u, float v) } } -static void api_circle(tic_mem* tic, s32 xm, s32 ym, s32 radius, u8 color) +static void api_circle(tic_mem* memory, s32 xm, s32 ym, s32 radius, u8 color) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; initSidesBuffer(); @@ -895,23 +897,23 @@ static void api_circle(tic_mem* tic, s32 xm, s32 ym, s32 radius, u8 color) } } -static void api_circle_border(tic_mem* tic, s32 xm, s32 ym, s32 radius, u8 color) +static void api_circle_border(tic_mem* memory, s32 xm, s32 ym, s32 radius, u8 color) { s32 r = radius; s32 x = -r, y = 0, err = 2-2*r; do { - api_pixel(tic, xm-x, ym+y, color); - api_pixel(tic, xm-y, ym-x, color); - api_pixel(tic, xm+x, ym-y, color); - api_pixel(tic, xm+y, ym+x, color); + api_pixel(memory, xm-x, ym+y, color); + api_pixel(memory, xm-y, ym-x, color); + api_pixel(memory, xm+x, ym-y, color); + api_pixel(memory, xm+y, ym+x, color); r = err; if (r <= y) err += ++y*2+1; if (r > x || err > y) err += ++x*2+1; } while (x < 0); } -typedef void(*linePixelFunc)(tic_mem* tic, s32 x, s32 y, u8 color); -static void ticLine(tic_mem* tic, s32 x0, s32 y0, s32 x1, s32 y1, u8 color, linePixelFunc func) +typedef void(*linePixelFunc)(tic_mem* memory, s32 x, s32 y, u8 color); +static void ticLine(tic_mem* memory, s32 x0, s32 y0, s32 x1, s32 y1, u8 color, linePixelFunc func) { s32 dx = abs(x1 - x0), sx = x0 < x1 ? 1 : -1; s32 dy = abs(y1 - y0), sy = y0 < y1 ? 1 : -1; @@ -919,7 +921,7 @@ static void ticLine(tic_mem* tic, s32 x0, s32 y0, s32 x1, s32 y1, u8 color, line for(;;) { - func(tic, x0, y0, color); + func(memory, x0, y0, color); if (x0 == x1 && y0 == y1) break; e2 = err; if (e2 >-dx) { err -= dy; x0 += sx; } @@ -927,20 +929,20 @@ static void ticLine(tic_mem* tic, s32 x0, s32 y0, s32 x1, s32 y1, u8 color, line } } -static void triPixelFunc(tic_mem* tic, s32 x, s32 y, u8 color) +static void triPixelFunc(tic_mem* memory, s32 x, s32 y, u8 color) { setSidePixel(x, y); } -static void api_tri(tic_mem* tic, s32 x1, s32 y1, s32 x2, s32 y2, s32 x3, s32 y3, u8 color) +static void api_tri(tic_mem* memory, s32 x1, s32 y1, s32 x2, s32 y2, s32 x3, s32 y3, u8 color) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; initSidesBuffer(); - ticLine(tic, x1, y1, x2, y2, color, triPixelFunc); - ticLine(tic, x2, y2, x3, y3, color, triPixelFunc); - ticLine(tic, x3, y3, x1, y1, color, triPixelFunc); + ticLine(memory, x1, y1, x2, y2, color, triPixelFunc); + ticLine(memory, x2, y2, x3, y3, color, triPixelFunc); + ticLine(memory, x3, y3, x1, y1, color, triPixelFunc); u8 final_color = mapColor(&machine->memory, color); s32 yt = max(machine->state.clip.t, min(y1, min(y2, y3))); @@ -960,7 +962,7 @@ typedef struct } TexVert; -static void ticTexLine(tic_mem* tic, TexVert *v0, TexVert *v1) +static void ticTexLine(tic_mem* memory, TexVert *v0, TexVert *v1) { TexVert *top = v0; TexVert *bot = v1; @@ -1012,12 +1014,12 @@ static void ticTexLine(tic_mem* tic, TexVert *v0, TexVert *v1) } } -static void api_textri(tic_mem* tic, float x1, float y1, float x2, float y2, float x3, float y3, float u1, float v1, float u2, float v2, float u3, float v3, bool use_map, u8 chroma) +static void api_textri(tic_mem* memory, float x1, float y1, float x2, float y2, float x3, float y3, float u1, float v1, float u2, float v2, float u3, float v3, bool use_map, u8 chroma) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; TexVert V0, V1, V2; - const u8* ptr = tic->ram.tiles.data[0].data; - const u8* map = tic->ram.map.data; + const u8* ptr = memory->ram.tiles.data[0].data; + const u8* map = memory->ram.map.data; V0.x = x1; V0.y = y1; V0.u = u1; V0.v = v1; V1.x = x2; V1.y = y2; V1.u = u2; V1.v = v2; @@ -1041,9 +1043,9 @@ static void api_textri(tic_mem* tic, float x1, float y1, float x2, float y2, flo // fill the buffer initSidesBuffer(); // parse each line and decide where in the buffer to store them ( left or right ) - ticTexLine(tic, &V0, &V1); - ticTexLine(tic, &V1, &V2); - ticTexLine(tic, &V2, &V0); + ticTexLine(memory, &V0, &V1); + ticTexLine(memory, &V1, &V2); + ticTexLine(memory, &V2, &V0); for (s32 y = 0; y < TIC80_HEIGHT; y++) { @@ -1110,38 +1112,38 @@ static void api_textri(tic_mem* tic, float x1, float y1, float x2, float y2, flo } -static void api_sprite(tic_mem* tic, const tic_tiles* src, s32 index, s32 x, s32 y, u8* colors, s32 count) +static void api_sprite(tic_mem* memory, const tic_tiles* src, s32 index, s32 x, s32 y, u8* colors, s32 count) { - drawSprite(tic, src, index, x, y, colors, count, 1, tic_no_flip, tic_no_rotate); + drawSprite(memory, src, index, x, y, colors, count, 1, tic_no_flip, tic_no_rotate); } -static void api_map(tic_mem* tic, const tic_map* src, const tic_tiles* tiles, s32 x, s32 y, s32 width, s32 height, s32 sx, s32 sy, u8 chromakey, s32 scale) +static void api_map(tic_mem* memory, const tic_map* src, const tic_tiles* tiles, s32 x, s32 y, s32 width, s32 height, s32 sx, s32 sy, u8 chromakey, s32 scale) { - drawMap((tic_machine*)tic, src, tiles, x, y, width, height, sx, sy, chromakey, scale, NULL, NULL); + drawMap((tic_machine*)memory, src, tiles, x, y, width, height, sx, sy, chromakey, scale, NULL, NULL); } -static void api_remap(tic_mem* tic, const tic_map* src, const tic_tiles* tiles, s32 x, s32 y, s32 width, s32 height, s32 sx, s32 sy, u8 chromakey, s32 scale, RemapFunc remap, void* data) +static void api_remap(tic_mem* memory, const tic_map* src, const tic_tiles* tiles, s32 x, s32 y, s32 width, s32 height, s32 sx, s32 sy, u8 chromakey, s32 scale, RemapFunc remap, void* data) { - drawMap((tic_machine*)tic, src, tiles, x, y, width, height, sx, sy, chromakey, scale, remap, data); + drawMap((tic_machine*)memory, src, tiles, x, y, width, height, sx, sy, chromakey, scale, remap, data); } -static void api_map_set(tic_mem* tic, tic_map* src, s32 x, s32 y, u8 value) +static void api_map_set(tic_mem* memory, tic_map* src, s32 x, s32 y, u8 value) { if(x < 0 || x >= TIC_MAP_WIDTH || y < 0 || y >= TIC_MAP_HEIGHT) return; *(src->data + y * TIC_MAP_WIDTH + x) = value; } -static u8 api_map_get(tic_mem* tic, const tic_map* src, s32 x, s32 y) +static u8 api_map_get(tic_mem* memory, const tic_map* src, s32 x, s32 y) { if(x < 0 || x >= TIC_MAP_WIDTH || y < 0 || y >= TIC_MAP_HEIGHT) return 0; return *(src->data + y * TIC_MAP_WIDTH + x); } -static void api_line(tic_mem* tic, s32 x0, s32 y0, s32 x1, s32 y1, u8 color) +static void api_line(tic_mem* memory, s32 x0, s32 y0, s32 x1, s32 y1, u8 color) { - ticLine(tic, x0, y0, x1, y1, color, api_pixel); + ticLine(memory, x0, y0, x1, y1, color, api_pixel); } static s32 calcLoopPos(const tic_sound_loop* loop, s32 pos) @@ -1162,9 +1164,9 @@ static s32 calcLoopPos(const tic_sound_loop* loop, s32 pos) return offset; } -static void sfx(tic_mem* tic, s32 index, s32 freq, Channel* channel, tic_sound_register* reg) +static void sfx(tic_mem* memory, s32 index, s32 freq, Channel* channel, tic_sound_register* reg) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; if(channel->duration > 0) channel->duration--; @@ -1208,13 +1210,13 @@ static void sfx(tic_mem* tic, s32 index, s32 freq, Channel* channel, tic_sound_r } } -static void processMusic(tic_mem* tic) +static void processMusic(tic_mem* memory) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; if(machine->state.music.play == MusicStop) return; - const tic_track* track = &machine->sound.music->tracks.data[tic->ram.music_pos.track]; + const tic_track* track = &machine->sound.music->tracks.data[memory->ram.music_pos.track]; s32 row = machine->state.music.ticks * (track->tempo + DEFAULT_TEMPO) * DEFAULT_SPEED / (track->speed + DEFAULT_SPEED) / NOTES_PER_MUNUTE; s32 rows = MUSIC_PATTERN_ROWS - track->rows; @@ -1222,19 +1224,19 @@ static void processMusic(tic_mem* tic) { row = 0; machine->state.music.ticks = 0; - resetMusic(tic); + resetMusic(memory); if(machine->state.music.play == MusicPlay) { - tic->ram.music_pos.frame++; + memory->ram.music_pos.frame++; - if(tic->ram.music_pos.frame >= MUSIC_FRAMES) + if(memory->ram.music_pos.frame >= MUSIC_FRAMES) { - if(tic->ram.music_pos.flag.loop) - tic->ram.music_pos.frame = 0; + if(memory->ram.music_pos.flag.loop) + memory->ram.music_pos.frame = 0; else { - api_music(tic, -1, 0, 0, false); + api_music(memory, -1, 0, 0, false); return; } } @@ -1242,15 +1244,15 @@ static void processMusic(tic_mem* tic) { s32 val = 0; for (s32 c = 0; c < TIC_SOUND_CHANNELS; c++) - val += tic_tool_get_pattern_id(track, tic->ram.music_pos.frame, c); + val += tic_tool_get_pattern_id(track, memory->ram.music_pos.frame, c); if(!val) { - if(tic->ram.music_pos.flag.loop) - tic->ram.music_pos.frame = 0; + if(memory->ram.music_pos.flag.loop) + memory->ram.music_pos.frame = 0; else { - api_music(tic, -1, 0, 0, false); + api_music(memory, -1, 0, 0, false); return; } } @@ -1258,37 +1260,37 @@ static void processMusic(tic_mem* tic) } else if(machine->state.music.play == MusicPlayFrame) { - if(!tic->ram.music_pos.flag.loop) + if(!memory->ram.music_pos.flag.loop) { - api_music(tic, -1, 0, 0, false); + api_music(memory, -1, 0, 0, false); return; } } } - if (row != tic->ram.music_pos.row) + if (row != memory->ram.music_pos.row) { - tic->ram.music_pos.row = row; + memory->ram.music_pos.row = row; for (s32 channel = 0; channel < TIC_SOUND_CHANNELS; channel++) { - s32 patternId = tic_tool_get_pattern_id(track, tic->ram.music_pos.frame, channel); + s32 patternId = tic_tool_get_pattern_id(track, memory->ram.music_pos.frame, channel); if (!patternId) continue; const tic_track_pattern* pattern = &machine->sound.music->patterns.data[patternId - PATTERN_START]; - s32 note = pattern->rows[tic->ram.music_pos.row].note; + s32 note = pattern->rows[memory->ram.music_pos.row].note; if (note > NoteNone) { - musicSfx(tic, -1, 0, 0, 0, channel); + musicSfx(memory, -1, 0, 0, 0, channel); if (note >= NoteStart) { - s32 octave = pattern->rows[tic->ram.music_pos.row].octave; + s32 octave = pattern->rows[memory->ram.music_pos.row].octave; s32 sfx = (pattern->rows[row].sfxhi << MUSIC_SFXID_LOW_BITS) | pattern->rows[row].sfxlow; - s32 volume = pattern->rows[tic->ram.music_pos.row].volume; - musicSfx(tic, sfx, note - NoteStart, octave, volume, channel); + s32 volume = pattern->rows[memory->ram.music_pos.row].volume; + musicSfx(memory, sfx, note - NoteStart, octave, volume, channel); } } } @@ -1299,7 +1301,7 @@ static void processMusic(tic_mem* tic) Channel* c = &machine->state.music.channels[i]; if(c->index >= 0) - sfx(tic, c->index, c->freq, c, &tic->ram.registers[i]); + sfx(memory, c->index, c->freq, c, &memory->ram.registers[i]); } machine->state.music.ticks++; @@ -1321,24 +1323,24 @@ static bool isKeyPressed(const tic80_keyboard* input, tic_key key) return false; } -static void api_tick_start(tic_mem* tic, const tic_sfx* sfxsrc, const tic_music* music) +static void api_tick_start(tic_mem* memory, const tic_sfx* sfxsrc, const tic_music* music) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; machine->sound.sfx = sfxsrc; machine->sound.music = music; for (s32 i = 0; i < TIC_SOUND_CHANNELS; ++i ) - memset(&tic->ram.registers[i], 0, sizeof(tic_sound_register)); + memset(&memory->ram.registers[i], 0, sizeof(tic_sound_register)); - processMusic(tic); + processMusic(memory); for (s32 i = 0; i < TIC_SOUND_CHANNELS; ++i ) { Channel* c = &machine->state.channels[i]; if(c->index >= 0) - sfx(tic, c->index, c->freq, c, &tic->ram.registers[i]); + sfx(memory, c->index, c->freq, c, &memory->ram.registers[i]); } // process gamepad @@ -1346,7 +1348,7 @@ static void api_tick_start(tic_mem* tic, const tic_sfx* sfxsrc, const tic_music* { u32 mask = 1 << i; u32 prevDown = machine->state.gamepads.previous.data & mask; - u32 down = tic->ram.input.gamepads.data & mask; + u32 down = memory->ram.input.gamepads.data & mask; u32* hold = &machine->state.gamepads.holds[i]; if(prevDown && prevDown == down) (*hold)++; @@ -1357,7 +1359,7 @@ static void api_tick_start(tic_mem* tic, const tic_sfx* sfxsrc, const tic_music* for(s32 i = 0; i < tic_keys_count; i++) { bool prevDown = isKeyPressed(&machine->state.keyboard.previous, i); - bool down = isKeyPressed(&tic->ram.input.keyboard, i); + bool down = isKeyPressed(&memory->ram.input.keyboard, i); u32* hold = &machine->state.keyboard.holds[i]; @@ -1371,9 +1373,9 @@ static void api_tick_start(tic_mem* tic, const tic_sfx* sfxsrc, const tic_music* machine->state.drawhline = drawHLineDma; } -static void api_tick_end(tic_mem* tic) +static void api_tick_end(tic_mem* memory) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; machine->state.gamepads.previous.data = machine->memory.ram.input.gamepads.data; machine->state.keyboard.previous.data = machine->memory.ram.input.keyboard.data; @@ -1381,7 +1383,7 @@ static void api_tick_end(tic_mem* tic) enum {EndTime = CLOCKRATE / TIC_FRAMERATE}; for (s32 i = 0; i < TIC_SOUND_CHANNELS; ++i ) { - tic_sound_register* reg = &tic->ram.registers[i]; + tic_sound_register* reg = &memory->ram.registers[i]; tic_sound_register_data* data = &machine->state.registers[i]; isNoiseWaveform(®->waveform) @@ -1400,34 +1402,34 @@ static void api_tick_end(tic_mem* tic) } -static tic_sfx_pos api_sfx_pos(tic_mem* tic, s32 channel) +static tic_sfx_pos api_sfx_pos(tic_mem* memory, s32 channel) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; Channel* c = &machine->state.channels[channel]; return c->pos; } -static void api_sfx_ex(tic_mem* tic, s32 index, s32 note, s32 octave, s32 duration, s32 channel, s32 volume, s32 speed) +static void api_sfx_ex(tic_mem* memory, s32 index, s32 note, s32 octave, s32 duration, s32 channel, s32 volume, s32 speed) { - tic_machine* machine = (tic_machine*)tic; - channelSfx(tic, index, note, octave, duration, &machine->state.channels[channel], volume, speed); + tic_machine* machine = (tic_machine*)memory; + channelSfx(memory, index, note, octave, duration, &machine->state.channels[channel], volume, speed); } -static void api_sfx(tic_mem* tic, s32 index, s32 note, s32 octave, s32 duration, s32 channel) +static void api_sfx(tic_mem* memory, s32 index, s32 note, s32 octave, s32 duration, s32 channel) { - api_sfx_ex(tic, index, note, octave, duration, channel, MAX_VOLUME, SFX_DEF_SPEED); + api_sfx_ex(memory, index, note, octave, duration, channel, MAX_VOLUME, SFX_DEF_SPEED); } -static void api_sfx_stop(tic_mem* tic, s32 channel) +static void api_sfx_stop(tic_mem* memory, s32 channel) { - api_sfx(tic, -1, 0, 0, -1, channel); + api_sfx(memory, -1, 0, 0, -1, channel); } -static void api_music_frame(tic_mem* tic, s32 index, s32 frame, s32 row, bool loop) +static void api_music_frame(tic_mem* memory, s32 index, s32 frame, s32 row, bool loop) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; setMusic(machine, index, frame, row, loop); @@ -1496,11 +1498,11 @@ static void api_sync(tic_mem* tic, u32 mask, s32 bank, bool toCart) machine->state.synced |= mask; } -static void cart2ram(tic_mem* tic) +static void cart2ram(tic_mem* memory) { - api_sync(tic, 0, 0, false); + api_sync(memory, 0, 0, false); - initCover(tic); + initCover(memory); } static const char* readMetatag(const char* code, const char* tag, const char* comment) @@ -1595,18 +1597,18 @@ static const tic_script_config* getScriptConfig(const char* code) #endif } -static const tic_script_config* api_get_script_config(tic_mem* tic) +static const tic_script_config* api_get_script_config(tic_mem* memory) { - return getScriptConfig(tic->cart.bank0.code.data); + return getScriptConfig(memory->cart.bank0.code.data); } -static void updateSaveid(tic_mem* tic) +static void updateSaveid(tic_mem* memory) { - memset(tic->saveid, 0, sizeof tic->saveid); - const char* saveid = readMetatag(tic->cart.bank0.code.data, "saveid", api_get_script_config(tic)->singleComment); + memset(memory->saveid, 0, sizeof memory->saveid); + const char* saveid = readMetatag(memory->cart.bank0.code.data, "saveid", api_get_script_config(memory)->singleComment); if(saveid) { - strncpy(tic->saveid, saveid, TIC_SAVEID_SIZE-1); + strncpy(memory->saveid, saveid, TIC_SAVEID_SIZE-1); free((void*)saveid); } } @@ -1682,25 +1684,25 @@ static void api_tick(tic_mem* tic, tic_tick_data* data) machine->state.tick(tic); } -static void api_scanline(tic_mem* tic, s32 row, void* data) +static void api_scanline(tic_mem* memory, s32 row, void* data) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; if(machine->state.initialized) - machine->state.scanline(tic, row, data); + machine->state.scanline(memory, row, data); } -static void api_overline(tic_mem* tic, void* data) +static void api_overline(tic_mem* memory, void* data) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; if(machine->state.initialized) - machine->state.ovr.callback(tic, data); + machine->state.ovr.callback(memory, data); } -static double api_time(tic_mem* tic) +static double api_time(tic_mem* memory) { - tic_machine* machine = (tic_machine*)tic; + tic_machine* machine = (tic_machine*)memory; return (double)((machine->data->counter() - machine->data->start)*1000)/machine->data->freq(); } diff --git a/src/tic.h b/src/tic.h index 33bd513..8502184 100644 --- a/src/tic.h +++ b/src/tic.h @@ -53,6 +53,9 @@ #define TIC_VRAM_SIZE (16*1024) //16K #define TIC_RAM_SIZE (80*1024) //80K +#define TIC_FONT_WIDTH 6 +#define TIC_FONT_HEIGHT 6 +#define TIC_ALTFONT_WIDTH 4 #define TIC_PALETTE_BPP 4 #define TIC_PALETTE_SIZE (1 << TIC_PALETTE_BPP) #define TIC_FRAMERATE 60 @@ -109,6 +112,7 @@ #define TIC_GAMEPADS (sizeof(tic80_gamepads) / sizeof(tic80_gamepad)) #define SFX_NOTES {"C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-"} +#define TIC_FONT_CHARS 256 enum { @@ -350,6 +354,11 @@ typedef struct tic_cover_image cover; } tic_cartridge; +typedef struct +{ + u8 data[TIC_FONT_CHARS * BITS_IN_BYTE]; +} tic_font; + typedef struct { u8 data[TIC80_WIDTH * TIC80_HEIGHT * TIC_PALETTE_BPP / BITS_IN_BYTE]; diff --git a/src/tic80.c b/src/tic80.c index 82f577a..f92f6b3 100644 --- a/src/tic80.c +++ b/src/tic80.c @@ -73,15 +73,11 @@ tic80* tic80_create(s32 samplerate) { memset(tic80, 0, sizeof(tic80_local)); - tic_mem* tic = tic80->memory = tic_create(samplerate); + tic80->memory = tic_create(samplerate); { - enum{FontWidth = 6, FontHeight = 6}; - static const u8 Font[] = {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, 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, 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, 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, 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, 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, 0x30, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0xf8, 0x50, 0xf8, 0x50, 0x00, 0x00, 0x00, 0x78, 0xa0, 0x70, 0x28, 0xf0, 0x00, 0x00, 0x00, 0x88, 0x10, 0x20, 0x40, 0x88, 0x00, 0x00, 0x00, 0x40, 0xa0, 0x68, 0x90, 0x68, 0x00, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x40, 0x40, 0x20, 0x00, 0x00, 0x00, 0x40, 0x20, 0x20, 0x20, 0x40, 0x00, 0x00, 0x00, 0x20, 0xa8, 0x70, 0xa8, 0x20, 0x00, 0x00, 0x00, 0x00, 0x20, 0x70, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x70, 0xc8, 0xc8, 0xc8, 0x70, 0x00, 0x00, 0x00, 0x30, 0x70, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0xf0, 0x18, 0x70, 0xc0, 0xf8, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x30, 0x98, 0x70, 0x00, 0x00, 0x00, 0x30, 0x70, 0xd0, 0xf8, 0x10, 0x00, 0x00, 0x00, 0xf8, 0xc0, 0xf0, 0x18, 0xf0, 0x00, 0x00, 0x00, 0x70, 0xc0, 0xf0, 0xc8, 0x70, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x30, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x70, 0xc8, 0x70, 0xc8, 0x70, 0x00, 0x00, 0x00, 0x70, 0xc8, 0x78, 0x08, 0x70, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x60, 0x20, 0x40, 0x00, 0x00, 0x10, 0x20, 0x40, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x20, 0x40, 0x00, 0x00, 0x00, 0x78, 0x18, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, 0xa8, 0xb8, 0x80, 0x70, 0x00, 0x00, 0x00, 0x70, 0xc8, 0xc8, 0xf8, 0xc8, 0x00, 0x00, 0x00, 0xf0, 0xc8, 0xf0, 0xc8, 0xf0, 0x00, 0x00, 0x00, 0x70, 0xc8, 0xc0, 0xc8, 0x70, 0x00, 0x00, 0x00, 0xf0, 0xc8, 0xc8, 0xc8, 0xf0, 0x00, 0x00, 0x00, 0xf8, 0xc0, 0xf0, 0xc0, 0xf8, 0x00, 0x00, 0x00, 0xf8, 0xc0, 0xf0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x78, 0xc0, 0xd8, 0xc8, 0x78, 0x00, 0x00, 0x00, 0xc8, 0xc8, 0xf8, 0xc8, 0xc8, 0x00, 0x00, 0x00, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0xd8, 0x70, 0x00, 0x00, 0x00, 0xc8, 0xd0, 0xe0, 0xd0, 0xc8, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xf8, 0x00, 0x00, 0x00, 0xd8, 0xf8, 0xf8, 0xa8, 0x88, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0xf8, 0xd8, 0xc8, 0x00, 0x00, 0x00, 0x70, 0xc8, 0xc8, 0xc8, 0x70, 0x00, 0x00, 0x00, 0xf0, 0xc8, 0xc8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x70, 0xc8, 0xc8, 0xc8, 0x70, 0x08, 0x00, 0x00, 0xf0, 0xc8, 0xc8, 0xf0, 0xc8, 0x00, 0x00, 0x00, 0x78, 0xe0, 0x70, 0x38, 0xf0, 0x00, 0x00, 0x00, 0x78, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0xc8, 0xc8, 0xc8, 0xc8, 0x70, 0x00, 0x00, 0x00, 0xc8, 0xc8, 0xc8, 0x70, 0x20, 0x00, 0x00, 0x00, 0x88, 0xa8, 0xf8, 0xf8, 0xd8, 0x00, 0x00, 0x00, 0xc8, 0xc8, 0x70, 0xc8, 0xc8, 0x00, 0x00, 0x00, 0x68, 0x68, 0x78, 0x30, 0x30, 0x00, 0x00, 0x00, 0xf8, 0x30, 0x60, 0xc0, 0xf8, 0x00, 0x00, 0x00, 0x60, 0x40, 0x40, 0x40, 0x60, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0x60, 0x20, 0x20, 0x20, 0x60, 0x00, 0x00, 0x00, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x98, 0x98, 0x78, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xc8, 0xc8, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x78, 0xe0, 0xe0, 0x78, 0x00, 0x00, 0x00, 0x18, 0x78, 0x98, 0x98, 0x78, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0xe0, 0x70, 0x00, 0x00, 0x00, 0x38, 0x60, 0xf8, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x70, 0x98, 0xf8, 0x18, 0x70, 0x00, 0x00, 0xc0, 0xf0, 0xc8, 0xc8, 0xc8, 0x00, 0x00, 0x00, 0x30, 0x00, 0x70, 0x30, 0x78, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x18, 0x98, 0x70, 0x00, 0x00, 0xc0, 0xc8, 0xf0, 0xc8, 0xc8, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x38, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf8, 0xa8, 0xa8, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc8, 0xc8, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x70, 0xc8, 0xc8, 0x70, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc8, 0xc8, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x78, 0x98, 0x98, 0x78, 0x18, 0x00, 0x00, 0x00, 0xf0, 0xc8, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x78, 0xe0, 0x38, 0xf0, 0x00, 0x00, 0x00, 0x60, 0xf8, 0x60, 0x60, 0x38, 0x00, 0x00, 0x00, 0x00, 0x98, 0x98, 0x98, 0x78, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xc8, 0xd0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x88, 0xa8, 0xf8, 0xd8, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x70, 0x70, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x98, 0x98, 0x78, 0x18, 0x70, 0x00, 0x00, 0x00, 0xf8, 0x30, 0x60, 0xf8, 0x00, 0x00, 0x00, 0x30, 0x20, 0x60, 0x20, 0x30, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x60, 0x20, 0x30, 0x20, 0x60, 0x00, 0x00, 0x00, 0x00, 0x28, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - memcpy(tic->font.data, Font, sizeof tic->font.data); - tic->font.width = FontWidth; - tic->font.height = FontHeight; + memcpy(tic80->memory->font.data, Font, sizeof(tic_font)); } return &tic80->tic; diff --git a/src/ticapi.h b/src/ticapi.h index 8128d9d..66f21f0 100644 --- a/src/ticapi.h +++ b/src/ticapi.h @@ -24,8 +24,6 @@ #include "tic.h" -#define TIC_FONT_CHARS 128 - typedef struct { u8 index; tic_flip flip; tic_rotate rotate; } RemapResult; typedef void(*RemapFunc)(void*, s32 x, s32 y, RemapResult* result); typedef struct @@ -123,10 +121,10 @@ struct tic_script_config typedef struct { - s32 (*draw_char) (tic_mem* memory, u8 symbol, s32 x, s32 y, u8 color); - s32 (*text) (tic_mem* memory, const char* text, s32 x, s32 y, u8 color); - s32 (*fixed_text) (tic_mem* memory, const char* text, s32 x, s32 y, u8 color); - s32 (*text_ex) (tic_mem* memory, const char* text, s32 x, s32 y, u8 color, bool fixed, s32 scale); + s32 (*draw_char) (tic_mem* memory, u8 symbol, s32 x, s32 y, u8 color, bool alt); + s32 (*text) (tic_mem* memory, const char* text, s32 x, s32 y, u8 color, bool alt); + s32 (*fixed_text) (tic_mem* memory, const char* text, s32 x, s32 y, u8 color, bool alt); + s32 (*text_ex) (tic_mem* memory, const char* text, s32 x, s32 y, u8 color, bool fixed, s32 scale, bool alt); void (*clear) (tic_mem* memory, u8 color); void (*pixel) (tic_mem* memory, s32 x, s32 y, u8 color); u8 (*get_pixel) (tic_mem* memory, s32 x, s32 y); @@ -176,6 +174,7 @@ struct tic_mem { tic_ram ram; tic_cartridge cart; + tic_font font; tic_api api; tic_persistent persistent; @@ -200,13 +199,6 @@ struct tic_mem } samples; u32 screen[TIC80_FULLWIDTH * TIC80_FULLHEIGHT]; - - struct - { - u8 data[TIC_FONT_CHARS * BITS_IN_BYTE]; - s32 width; - s32 height; - } font; }; tic_mem* tic_create(s32 samplerate); diff --git a/src/wrenapi.c b/src/wrenapi.c index edbfc6f..2267ef2 100644 --- a/src/wrenapi.c +++ b/src/wrenapi.c @@ -397,7 +397,9 @@ static void wren_print(WrenVM* vm) return; } - s32 size = memory->api.text_ex(memory, text, x, y, color, fixed, scale); + bool alt = wrenGetSlotBool(vm, 7); + + s32 size = memory->api.text_ex(memory, text, x, y, color, fixed, scale, alt); wrenSetSlotDouble(vm, 0, size); } @@ -422,6 +424,7 @@ static void wren_font(WrenVM* vm) u8 chromakey = 0; bool fixed = false; s32 scale = 1; + bool alt = false; if(top > 3) { @@ -444,6 +447,11 @@ static void wren_font(WrenVM* vm) if(top > 8) { scale = getWrenNumber(vm, 8); + + if(top > 9) + { + alt = wrenGetSlotBool(vm, 9); + } } } } @@ -456,7 +464,7 @@ static void wren_font(WrenVM* vm) return; } - s32 size = drawText(memory, text ? text : "null", x, y, width, height, chromakey, scale, fixed ? drawSpriteFont : drawFixedSpriteFont); + s32 size = drawText(memory, text ? text : "null", x, y, width, height, chromakey, scale, fixed ? drawSpriteFont : drawFixedSpriteFont, alt); wrenSetSlotDouble(vm, 0, size); } }