17 Commits

Author SHA1 Message Date
6fb31a3ae5 - [FIX] Fallaba al carregar fonts amb format de final de linea de Windows 2026-03-22 17:39:21 +01:00
89496fb8fb - [FIX] El nom dels arxius a pujar a gitea estaba mal 2026-03-21 11:53:41 +01:00
4774a1a806 - [FIX] Scripts de publicació 2026-03-21 11:46:47 +01:00
74cb8cb0f8 VERSIÓ 1.4.8:
- [NEW] draw.surfrot
2026-03-21 10:15:23 +01:00
d573c159fa - [FIX] Arreglat el make de macos
- [NEW] Publicació automàtica de releases
2026-03-20 11:46:11 +01:00
446f588cfe - [WIP] Treballant en que publique a gitea amb la API 2026-03-20 09:17:21 +01:00
8c9c1f2b47 - [WIP] Afegides DLLs de windows per a quan empaquete 2026-03-20 08:37:01 +01:00
6cccd44743 - [FIX] Eliminat un warning en macOS en jfile
- [WIP] Sistema de release automatic
2026-03-20 08:35:28 +01:00
4a3450e116 VERSIÓ 1.4.7
- [NEW] map.cell() per a establir o llegir el tamany dels tiles del mapa
2026-03-19 11:29:08 +01:00
779ef7acb6 VERSIÓ 1.4.6
-[NEW] font.load()
-[NEW] font.current()
-[NEW] font.spacing()
-[NEW] font.DEFAULT
-[NEW] surf.SCREEN
2026-03-18 20:36:14 +01:00
bf34c92e09 VERSIÓ 1.4.5
- [NEW] Afegida funció "sub" al modul estandar "utf8"
2026-03-18 10:33:02 +01:00
9c895a518e VERSIÓ 1.4.4
- [NEW] Nou sistema de fonts funcionant ja internament
2026-03-18 08:58:42 +01:00
e89d596ea4 (Canvi d'ordenador)
- [WIP] Treballant en les fonts
2026-03-17 18:25:17 +01:00
560d67ca3d VERSIÓ 1.4.3
- [NEW] key.text()
- [NEW] key.utf8char()
- [NEW] pal.trans() ara torna el color transparent
- [NEW] pal.subpal(index) i pal.subpal(index,color) ara tornen el color al que estaba abans asignat el index
2026-03-17 13:47:25 +01:00
6f5d90ee49 - [FIX] typo en un #ifdef 2026-03-16 16:27:04 +01:00
d92a903c61 VERSIÓ 1.4.2
- [NEW] excutar "mini --version" torna la versió
- [NEW] executar "mini dura/a/un/data.jf2" usará eixe arxiu jf2
- [NEW] sys.version()
2026-03-16 14:25:47 +01:00
afa022d838 - [FIX] Arerglat mkdir() en Windows
- [FIX] Arreglat glActiveTexture en Windows
2026-03-15 13:10:00 +01:00
23 changed files with 1158 additions and 60 deletions

3
.gitignore vendored
View File

@@ -4,5 +4,6 @@ mini_debug.exe
mini_debug mini_debug
.vscode/* .vscode/*
info.plist info.plist
*.dll
build/* build/*
*.zip
*.tar.gz

View File

@@ -11,13 +11,13 @@ windows_debug:
g++ $(source) -D DEBUG -g -Wall -Os -lmingw32 -lSDL3 -lopengl32 -o "$(executable)_debug.exe" g++ $(source) -D DEBUG -g -Wall -Os -lmingw32 -lSDL3 -lopengl32 -o "$(executable)_debug.exe"
macos: macos:
clang++ $(source) -Wall -Os -std=c++11 -ffunction-sections -fdata-sections -lSDL3 -o "$(executable)" clang++ $(source) -Wall -Os -std=c++17 -Wno-deprecated -ffunction-sections -fdata-sections -lSDL3 -framework OpenGL -o "$(executable)"
macos_debug: macos_debug:
clang++ $(source) -D DEBUG -g -Wall -Os -std=c++11 -ffunction-sections -fdata-sections -lSDL3 -o "$(executable)_debug" clang++ $(source) -D DEBUG -g -Wall -Os -std=c++17 -Wno-deprecated -ffunction-sections -fdata-sections -lSDL3 -framework OpenGL -o "$(executable)_debug"
macos_bundle: macos_bundle:
clang++ $(source) -D MACOS_BUNDLE -Wall -Os -std=c++11 -framework SDL3 -F /Library/Frameworks -ffunction-sections -fdata-sections -o mini_bundle -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.12 clang++ $(source) -D MACOS_BUNDLE -Wall -Os -std=c++17 -Wno-deprecated -framework SDL3 -framework OpenGL -F /Library/Frameworks -ffunction-sections -fdata-sections -o mini_bundle -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.12
linux: linux:
g++ $(source) -D LUA_USE_LINUX -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lSDL3 -lGL -o "$(executable)" g++ $(source) -D LUA_USE_LINUX -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lSDL3 -lGL -o "$(executable)"

BIN
bin/SDL3.dll Normal file

Binary file not shown.

BIN
bin/libgcc_s_seh-1.dll Normal file

Binary file not shown.

BIN
bin/libstdc++-6.dll Normal file

Binary file not shown.

BIN
bin/libwinpthread-1.dll Normal file

Binary file not shown.

9
data/font.fnt Normal file
View File

@@ -0,0 +1,9 @@
bitmap=font.gif
48: 0 0 7 7 0 # 0
49: 8 0 4 7 0 # 1
50: 16 0 7 7 0 # 2
51: 24 0 7 7 0 # 3
52: 32 0 7 7 0 # 4
53: 40 0 7 7 0 # 5
54: 48 0 7 7 0 # 6
55: 56 0 7 7 0 # 7

BIN
data/font.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

View File

@@ -1,6 +1,7 @@
require "ia.other" --require "ia.other"
x=0 x=0
rot=0
function mini.init() function mini.init()
s = surf.load("gfx/logo.gif") s = surf.load("gfx/logo.gif")
@@ -16,11 +17,12 @@ function mini.init()
end end
print("========================") print("========================")
f = font.load("font.fnt")
end end
function mini.update() function mini.update()
surf.cls(0) surf.cls(0)
draw.surf(0, 0, 160, 144, 0, 0) draw.surfrot(0, 0, 160, 144, 120, 78, rot)
draw.text("PRESS START", 60, 110, 28) draw.text("PRESS START", 60, 110, 28)
if key.press(key.ESCAPE) then sys.quit() end if key.press(key.ESCAPE) then sys.quit() end
@@ -41,5 +43,11 @@ function mini.update()
local mx, my = mouse.pos() local mx, my = mouse.pos()
draw.rectf(mx, my, 4, 4, 8) draw.rectf(mx, my, 4, 4, 8)
draw.text(mx .. " " .. my, 1, 8, 8) draw.text(mx .. " " .. my, 1, 8, 8)
draw.text(other.peiv(),1,100,4) --draw.text(other.peiv(),1,100,4)
font.current(f)
font.spacing(0)
draw.text("0146",100,50,28)
font.current(font.DEFAULT)
rot=rot+1
end end

130
default_font.fnt Normal file
View File

@@ -0,0 +1,130 @@
bitmap=default_font
32: 0 0 3 5 0 #
33: 4 0 3 5 0 # !
34: 8 0 3 5 0 # "
35: 12 0 3 5 0 # #
36: 16 0 3 5 0 # $
37: 20 0 3 5 0 # %
38: 24 0 3 5 0 # &
39: 28 0 3 5 0 # '
40: 32 0 3 5 0 # (
41: 36 0 3 5 0 # )
42: 40 0 3 5 0 # *
43: 44 0 3 5 0 # +
44: 48 0 3 5 0 # ,
45: 52 0 3 5 0 # -
46: 56 0 3 5 0 # .
47: 60 0 3 5 0 # /
48: 0 6 3 5 0 # 0
49: 4 6 3 5 0 # 1
50: 8 6 3 5 0 # 2
51: 12 6 3 5 0 # 3
52: 16 6 3 5 0 # 4
53: 20 6 3 5 0 # 5
54: 24 6 3 5 0 # 6
55: 28 6 3 5 0 # 7
56: 32 6 3 5 0 # 8
57: 36 6 3 5 0 # 9
58: 40 6 3 5 0 # :
59: 44 6 3 5 0 # ;
60: 48 6 3 5 0 # <
61: 52 6 3 5 0 # =
62: 56 6 3 5 0 # >
63: 60 6 3 5 0 # ?
64: 0 12 3 5 0 # @
65: 4 12 3 5 0 # A
66: 8 12 3 5 0 # B
67: 12 12 3 5 0 # C
68: 16 12 3 5 0 # D
69: 20 12 3 5 0 # E
70: 24 12 3 5 0 # F
71: 28 12 3 5 0 # G
72: 32 12 3 5 0 # H
73: 36 12 3 5 0 # I
74: 40 12 3 5 0 # J
75: 44 12 3 5 0 # K
76: 48 12 3 5 0 # L
77: 52 12 3 5 0 # M
78: 56 12 3 5 0 # N
79: 60 12 3 5 0 # O
80: 0 18 3 5 0 # P
81: 4 18 3 5 0 # Q
82: 8 18 3 5 0 # R
83: 12 18 3 5 0 # S
84: 16 18 3 5 0 # T
85: 20 18 3 5 0 # U
86: 24 18 3 5 0 # V
87: 28 18 3 5 0 # W
88: 32 18 3 5 0 # X
89: 36 18 3 5 0 # Y
90: 40 18 3 5 0 # Z
91: 44 18 3 5 0 # [
92: 48 18 3 5 0 # \
93: 52 18 3 5 0 # ]
94: 56 18 3 5 0 # ^
95: 60 18 3 5 0 # _
96: 0 24 3 5 0 # `
97: 4 24 3 5 0 # a
98: 8 24 3 5 0 # b
99: 12 24 3 5 0 # c
100: 16 24 3 5 0 # d
101: 20 24 3 5 0 # e
102: 24 24 3 5 0 # f
103: 28 24 3 5 0 # g
104: 32 24 3 5 0 # h
105: 36 24 3 5 0 # i
106: 40 24 3 5 0 # j
107: 44 24 3 5 0 # k
108: 48 24 3 5 0 # l
109: 52 24 3 5 0 # m
110: 56 24 3 5 0 # n
111: 60 24 3 5 0 # o
112: 0 30 3 5 0 # p
113: 4 30 3 5 0 # q
114: 8 30 3 5 0 # r
115: 12 30 3 5 0 # s
116: 16 30 3 5 0 # t
117: 20 30 3 5 0 # u
118: 24 30 3 5 0 # v
119: 28 30 3 5 0 # w
120: 32 30 3 5 0 # x
121: 36 30 3 5 0 # y
122: 40 30 3 5 0 # z
123: 44 30 3 5 0 # {
124: 48 30 3 5 0 # |
125: 52 30 3 5 0 # }
126: 56 30 3 5 0 # ~
127: 60 30 3 5 0 # ⌂ (DEL placeholder)
# Extended characters
161: 0 36 3 5 0 # ¡
191: 4 36 3 5 0 # ¿
192: 8 36 3 8 3 # À
193: 12 36 3 8 3 # Á
200: 16 36 3 8 3 # È
201: 20 36 3 8 3 # É
204: 24 36 3 8 3 # Ì
205: 28 36 3 8 3 # Í
210: 32 36 3 8 3 # Ò
211: 36 36 3 8 3 # Ó
217: 40 36 3 8 3 # Ù
218: 44 36 3 8 3 # Ú
209: 48 36 3 7 2 # Ñ
241: 52 36 3 6 1 # ñ
199: 56 36 3 5 0 # Ç
231: 60 36 3 5 0 # ç
224: 0 45 3 7 2 # à
225: 4 45 3 7 2 # á
232: 8 45 3 7 2 # è
233: 12 45 3 7 2 # é
236: 16 45 3 7 2 # ì
237: 20 45 3 7 2 # í
242: 24 45 3 7 2 # ò
243: 28 45 3 7 2 # ó
249: 32 45 3 7 2 # ù
250: 36 45 3 7 2 # ú

BIN
default_font.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

223
default_font_fnt.h Normal file
View File

@@ -0,0 +1,223 @@
unsigned char default_font_fnt[] = {
0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x3d, 0x64, 0x65, 0x66, 0x61, 0x75,
0x6c, 0x74, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x0a, 0x33, 0x32, 0x3a, 0x20,
0x30, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x20,
0x23, 0x20, 0x20, 0x0a, 0x33, 0x33, 0x3a, 0x20, 0x34, 0x20, 0x30, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x20, 0x23, 0x20, 0x21, 0x0a,
0x33, 0x34, 0x3a, 0x20, 0x38, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20,
0x30, 0x20, 0x20, 0x20, 0x23, 0x20, 0x22, 0x0a, 0x33, 0x35, 0x3a, 0x20,
0x31, 0x32, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20,
0x23, 0x20, 0x23, 0x0a, 0x33, 0x36, 0x3a, 0x20, 0x31, 0x36, 0x20, 0x30,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x24, 0x0a,
0x33, 0x37, 0x3a, 0x20, 0x32, 0x30, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x25, 0x0a, 0x33, 0x38, 0x3a, 0x20,
0x32, 0x34, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20,
0x23, 0x20, 0x26, 0x0a, 0x33, 0x39, 0x3a, 0x20, 0x32, 0x38, 0x20, 0x30,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x27, 0x0a,
0x34, 0x30, 0x3a, 0x20, 0x33, 0x32, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x28, 0x0a, 0x34, 0x31, 0x3a, 0x20,
0x33, 0x36, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20,
0x23, 0x20, 0x29, 0x0a, 0x34, 0x32, 0x3a, 0x20, 0x34, 0x30, 0x20, 0x30,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x2a, 0x0a,
0x34, 0x33, 0x3a, 0x20, 0x34, 0x34, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x2b, 0x0a, 0x34, 0x34, 0x3a, 0x20,
0x34, 0x38, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20,
0x23, 0x20, 0x2c, 0x0a, 0x34, 0x35, 0x3a, 0x20, 0x35, 0x32, 0x20, 0x30,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x2d, 0x0a,
0x34, 0x36, 0x3a, 0x20, 0x35, 0x36, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x2e, 0x0a, 0x34, 0x37, 0x3a, 0x20,
0x36, 0x30, 0x20, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20,
0x23, 0x20, 0x2f, 0x0a, 0x0a, 0x34, 0x38, 0x3a, 0x20, 0x30, 0x20, 0x36,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x20, 0x23, 0x20, 0x30,
0x0a, 0x34, 0x39, 0x3a, 0x20, 0x34, 0x20, 0x36, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x20, 0x20, 0x23, 0x20, 0x31, 0x0a, 0x35, 0x30, 0x3a,
0x20, 0x38, 0x20, 0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20,
0x20, 0x23, 0x20, 0x32, 0x0a, 0x35, 0x31, 0x3a, 0x20, 0x31, 0x32, 0x20,
0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x33,
0x0a, 0x35, 0x32, 0x3a, 0x20, 0x31, 0x36, 0x20, 0x36, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x34, 0x0a, 0x35, 0x33, 0x3a,
0x20, 0x32, 0x30, 0x20, 0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20,
0x20, 0x23, 0x20, 0x35, 0x0a, 0x35, 0x34, 0x3a, 0x20, 0x32, 0x34, 0x20,
0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x36,
0x0a, 0x35, 0x35, 0x3a, 0x20, 0x32, 0x38, 0x20, 0x36, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x37, 0x0a, 0x35, 0x36, 0x3a,
0x20, 0x33, 0x32, 0x20, 0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20,
0x20, 0x23, 0x20, 0x38, 0x0a, 0x35, 0x37, 0x3a, 0x20, 0x33, 0x36, 0x20,
0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x39,
0x0a, 0x35, 0x38, 0x3a, 0x20, 0x34, 0x30, 0x20, 0x36, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x3a, 0x0a, 0x35, 0x39, 0x3a,
0x20, 0x34, 0x34, 0x20, 0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20,
0x20, 0x23, 0x20, 0x3b, 0x0a, 0x36, 0x30, 0x3a, 0x20, 0x34, 0x38, 0x20,
0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x3c,
0x0a, 0x36, 0x31, 0x3a, 0x20, 0x35, 0x32, 0x20, 0x36, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x3d, 0x0a, 0x36, 0x32, 0x3a,
0x20, 0x35, 0x36, 0x20, 0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20,
0x20, 0x23, 0x20, 0x3e, 0x0a, 0x36, 0x33, 0x3a, 0x20, 0x36, 0x30, 0x20,
0x36, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x3f,
0x0a, 0x0a, 0x36, 0x34, 0x3a, 0x20, 0x30, 0x20, 0x31, 0x32, 0x20, 0x33,
0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x40, 0x0a, 0x36, 0x35,
0x3a, 0x20, 0x34, 0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30,
0x20, 0x20, 0x23, 0x20, 0x41, 0x0a, 0x36, 0x36, 0x3a, 0x20, 0x38, 0x20,
0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20,
0x42, 0x0a, 0x36, 0x37, 0x3a, 0x20, 0x31, 0x32, 0x20, 0x31, 0x32, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x43, 0x0a, 0x36, 0x38,
0x3a, 0x20, 0x31, 0x36, 0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20,
0x30, 0x20, 0x23, 0x20, 0x44, 0x0a, 0x36, 0x39, 0x3a, 0x20, 0x32, 0x30,
0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20,
0x45, 0x0a, 0x37, 0x30, 0x3a, 0x20, 0x32, 0x34, 0x20, 0x31, 0x32, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x46, 0x0a, 0x37, 0x31,
0x3a, 0x20, 0x32, 0x38, 0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20,
0x30, 0x20, 0x23, 0x20, 0x47, 0x0a, 0x37, 0x32, 0x3a, 0x20, 0x33, 0x32,
0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20,
0x48, 0x0a, 0x37, 0x33, 0x3a, 0x20, 0x33, 0x36, 0x20, 0x31, 0x32, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x49, 0x0a, 0x37, 0x34,
0x3a, 0x20, 0x34, 0x30, 0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20,
0x30, 0x20, 0x23, 0x20, 0x4a, 0x0a, 0x37, 0x35, 0x3a, 0x20, 0x34, 0x34,
0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20,
0x4b, 0x0a, 0x37, 0x36, 0x3a, 0x20, 0x34, 0x38, 0x20, 0x31, 0x32, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x4c, 0x0a, 0x37, 0x37,
0x3a, 0x20, 0x35, 0x32, 0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20,
0x30, 0x20, 0x23, 0x20, 0x4d, 0x0a, 0x37, 0x38, 0x3a, 0x20, 0x35, 0x36,
0x20, 0x31, 0x32, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20,
0x4e, 0x0a, 0x37, 0x39, 0x3a, 0x20, 0x36, 0x30, 0x20, 0x31, 0x32, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x4f, 0x0a, 0x0a, 0x38,
0x30, 0x3a, 0x20, 0x30, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35, 0x20,
0x30, 0x20, 0x20, 0x23, 0x20, 0x50, 0x0a, 0x38, 0x31, 0x3a, 0x20, 0x34,
0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23,
0x20, 0x51, 0x0a, 0x38, 0x32, 0x3a, 0x20, 0x38, 0x20, 0x31, 0x38, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x52, 0x0a, 0x38,
0x33, 0x3a, 0x20, 0x31, 0x32, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x23, 0x20, 0x53, 0x0a, 0x38, 0x34, 0x3a, 0x20, 0x31,
0x36, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23,
0x20, 0x54, 0x0a, 0x38, 0x35, 0x3a, 0x20, 0x32, 0x30, 0x20, 0x31, 0x38,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x55, 0x0a, 0x38,
0x36, 0x3a, 0x20, 0x32, 0x34, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x23, 0x20, 0x56, 0x0a, 0x38, 0x37, 0x3a, 0x20, 0x32,
0x38, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23,
0x20, 0x57, 0x0a, 0x38, 0x38, 0x3a, 0x20, 0x33, 0x32, 0x20, 0x31, 0x38,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x58, 0x0a, 0x38,
0x39, 0x3a, 0x20, 0x33, 0x36, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x23, 0x20, 0x59, 0x0a, 0x39, 0x30, 0x3a, 0x20, 0x34,
0x30, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23,
0x20, 0x5a, 0x0a, 0x39, 0x31, 0x3a, 0x20, 0x34, 0x34, 0x20, 0x31, 0x38,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x5b, 0x0a, 0x39,
0x32, 0x3a, 0x20, 0x34, 0x38, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x23, 0x20, 0x5c, 0x0a, 0x39, 0x33, 0x3a, 0x20, 0x35,
0x32, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23,
0x20, 0x5d, 0x0a, 0x39, 0x34, 0x3a, 0x20, 0x35, 0x36, 0x20, 0x31, 0x38,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x5e, 0x0a, 0x39,
0x35, 0x3a, 0x20, 0x36, 0x30, 0x20, 0x31, 0x38, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x23, 0x20, 0x5f, 0x0a, 0x0a, 0x39, 0x36, 0x3a, 0x20,
0x30, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20,
0x23, 0x20, 0x60, 0x0a, 0x39, 0x37, 0x3a, 0x20, 0x34, 0x20, 0x32, 0x34,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x61, 0x0a,
0x39, 0x38, 0x3a, 0x20, 0x38, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x62, 0x0a, 0x39, 0x39, 0x3a, 0x20,
0x31, 0x32, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20,
0x23, 0x20, 0x63, 0x0a, 0x31, 0x30, 0x30, 0x3a, 0x20, 0x31, 0x36, 0x20,
0x32, 0x34, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x64,
0x0a, 0x31, 0x30, 0x31, 0x3a, 0x20, 0x32, 0x30, 0x20, 0x32, 0x34, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x65, 0x0a, 0x31, 0x30,
0x32, 0x3a, 0x20, 0x32, 0x34, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x23, 0x20, 0x66, 0x0a, 0x31, 0x30, 0x33, 0x3a, 0x20,
0x32, 0x38, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20,
0x23, 0x20, 0x67, 0x0a, 0x31, 0x30, 0x34, 0x3a, 0x20, 0x33, 0x32, 0x20,
0x32, 0x34, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x68,
0x0a, 0x31, 0x30, 0x35, 0x3a, 0x20, 0x33, 0x36, 0x20, 0x32, 0x34, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x69, 0x0a, 0x31, 0x30,
0x36, 0x3a, 0x20, 0x34, 0x30, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x23, 0x20, 0x6a, 0x0a, 0x31, 0x30, 0x37, 0x3a, 0x20,
0x34, 0x34, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20,
0x23, 0x20, 0x6b, 0x0a, 0x31, 0x30, 0x38, 0x3a, 0x20, 0x34, 0x38, 0x20,
0x32, 0x34, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x6c,
0x0a, 0x31, 0x30, 0x39, 0x3a, 0x20, 0x35, 0x32, 0x20, 0x32, 0x34, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x6d, 0x0a, 0x31, 0x31,
0x30, 0x3a, 0x20, 0x35, 0x36, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x23, 0x20, 0x6e, 0x0a, 0x31, 0x31, 0x31, 0x3a, 0x20,
0x36, 0x30, 0x20, 0x32, 0x34, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20,
0x23, 0x20, 0x6f, 0x0a, 0x0a, 0x31, 0x31, 0x32, 0x3a, 0x20, 0x30, 0x20,
0x33, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20,
0x70, 0x0a, 0x31, 0x31, 0x33, 0x3a, 0x20, 0x34, 0x20, 0x33, 0x30, 0x20,
0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x71, 0x0a, 0x31,
0x31, 0x34, 0x3a, 0x20, 0x38, 0x20, 0x33, 0x30, 0x20, 0x33, 0x20, 0x35,
0x20, 0x30, 0x20, 0x20, 0x23, 0x20, 0x72, 0x0a, 0x31, 0x31, 0x35, 0x3a,
0x20, 0x31, 0x32, 0x20, 0x33, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30,
0x20, 0x23, 0x20, 0x73, 0x0a, 0x31, 0x31, 0x36, 0x3a, 0x20, 0x31, 0x36,
0x20, 0x33, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20,
0x74, 0x0a, 0x31, 0x31, 0x37, 0x3a, 0x20, 0x32, 0x30, 0x20, 0x33, 0x30,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x75, 0x0a, 0x31,
0x31, 0x38, 0x3a, 0x20, 0x32, 0x34, 0x20, 0x33, 0x30, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x76, 0x0a, 0x31, 0x31, 0x39, 0x3a,
0x20, 0x32, 0x38, 0x20, 0x33, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30,
0x20, 0x23, 0x20, 0x77, 0x0a, 0x31, 0x32, 0x30, 0x3a, 0x20, 0x33, 0x32,
0x20, 0x33, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20,
0x78, 0x0a, 0x31, 0x32, 0x31, 0x3a, 0x20, 0x33, 0x36, 0x20, 0x33, 0x30,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x79, 0x0a, 0x31,
0x32, 0x32, 0x3a, 0x20, 0x34, 0x30, 0x20, 0x33, 0x30, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x7a, 0x0a, 0x31, 0x32, 0x33, 0x3a,
0x20, 0x34, 0x34, 0x20, 0x33, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30,
0x20, 0x23, 0x20, 0x7b, 0x0a, 0x31, 0x32, 0x34, 0x3a, 0x20, 0x34, 0x38,
0x20, 0x33, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20,
0x7c, 0x0a, 0x31, 0x32, 0x35, 0x3a, 0x20, 0x35, 0x32, 0x20, 0x33, 0x30,
0x20, 0x33, 0x20, 0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x7d, 0x0a, 0x31,
0x32, 0x36, 0x3a, 0x20, 0x35, 0x36, 0x20, 0x33, 0x30, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x23, 0x20, 0x7e, 0x0a, 0x31, 0x32, 0x37, 0x3a,
0x20, 0x36, 0x30, 0x20, 0x33, 0x30, 0x20, 0x33, 0x20, 0x35, 0x20, 0x30,
0x20, 0x23, 0x20, 0xe2, 0x8c, 0x82, 0x20, 0x28, 0x44, 0x45, 0x4c, 0x20,
0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x29,
0x0a, 0x0a, 0x23, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64,
0x20, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x73, 0x0a,
0x31, 0x36, 0x31, 0x3a, 0x20, 0x30, 0x20, 0x33, 0x36, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc2, 0xa1, 0x0a,
0x31, 0x39, 0x31, 0x3a, 0x20, 0x34, 0x20, 0x33, 0x36, 0x20, 0x33, 0x20,
0x35, 0x20, 0x30, 0x20, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc2, 0xbf, 0x0a,
0x31, 0x39, 0x32, 0x3a, 0x20, 0x38, 0x20, 0x33, 0x36, 0x20, 0x33, 0x20,
0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x80, 0x0a,
0x31, 0x39, 0x33, 0x3a, 0x20, 0x31, 0x32, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x81, 0x0a,
0x32, 0x30, 0x30, 0x3a, 0x20, 0x31, 0x36, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x88, 0x0a,
0x32, 0x30, 0x31, 0x3a, 0x20, 0x32, 0x30, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x89, 0x0a,
0x32, 0x30, 0x34, 0x3a, 0x20, 0x32, 0x34, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x8c, 0x0a,
0x32, 0x30, 0x35, 0x3a, 0x20, 0x32, 0x38, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x8d, 0x0a,
0x32, 0x31, 0x30, 0x3a, 0x20, 0x33, 0x32, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x92, 0x0a,
0x32, 0x31, 0x31, 0x3a, 0x20, 0x33, 0x36, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x93, 0x0a,
0x32, 0x31, 0x37, 0x3a, 0x20, 0x34, 0x30, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x99, 0x0a,
0x32, 0x31, 0x38, 0x3a, 0x20, 0x34, 0x34, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x38, 0x20, 0x33, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x9a, 0x0a,
0x32, 0x30, 0x39, 0x3a, 0x20, 0x34, 0x38, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x37, 0x20, 0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x91, 0x0a,
0x32, 0x34, 0x31, 0x3a, 0x20, 0x35, 0x32, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x36, 0x20, 0x31, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xb1, 0x0a,
0x31, 0x39, 0x39, 0x3a, 0x20, 0x35, 0x36, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0x87, 0x0a,
0x32, 0x33, 0x31, 0x3a, 0x20, 0x36, 0x30, 0x20, 0x33, 0x36, 0x20, 0x33,
0x20, 0x35, 0x20, 0x30, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xa7, 0x0a,
0x32, 0x32, 0x34, 0x3a, 0x20, 0x30, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20,
0x37, 0x20, 0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xa0, 0x0a, 0x32,
0x32, 0x35, 0x3a, 0x20, 0x34, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37,
0x20, 0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xa1, 0x0a, 0x32, 0x33,
0x32, 0x3a, 0x20, 0x38, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37, 0x20,
0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xa8, 0x0a, 0x32, 0x33, 0x33,
0x3a, 0x20, 0x31, 0x32, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37, 0x20,
0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xa9, 0x0a, 0x32, 0x33, 0x36,
0x3a, 0x20, 0x31, 0x36, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37, 0x20,
0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xac, 0x0a, 0x32, 0x33, 0x37,
0x3a, 0x20, 0x32, 0x30, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37, 0x20,
0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xad, 0x0a, 0x32, 0x34, 0x32,
0x3a, 0x20, 0x32, 0x34, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37, 0x20,
0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xb2, 0x0a, 0x32, 0x34, 0x33,
0x3a, 0x20, 0x32, 0x38, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37, 0x20,
0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xb3, 0x0a, 0x32, 0x34, 0x39,
0x3a, 0x20, 0x33, 0x32, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37, 0x20,
0x32, 0x20, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xb9, 0x0a, 0x32, 0x35, 0x30,
0x3a, 0x20, 0x33, 0x36, 0x20, 0x34, 0x35, 0x20, 0x33, 0x20, 0x37, 0x20,
0x32, 0x20, 0x20, 0x23, 0x20, 0xc3, 0xba, 0x0a, 0x00
};
unsigned int default_font_fnt_len = 2637;

42
default_font_gif.h Normal file
View File

@@ -0,0 +1,42 @@
unsigned char default_font_gif[] = {
0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x40, 0x00, 0x36, 0x00, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x21, 0xf9, 0x04, 0x08, 0x01,
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x36, 0x00,
0x00, 0x02, 0xff, 0x84, 0x1d, 0x08, 0xc9, 0x1b, 0xcd, 0x92, 0x9a, 0x4b,
0xc9, 0x83, 0x73, 0xbe, 0x47, 0xc2, 0xe7, 0x60, 0x11, 0xc5, 0x55, 0xe6,
0xa9, 0x69, 0x25, 0xd5, 0x99, 0xa0, 0xbb, 0x96, 0xd1, 0xbc, 0xbd, 0x62,
0x9a, 0x3e, 0xf4, 0xd5, 0xdc, 0x3e, 0xdf, 0xc2, 0xb1, 0x82, 0x37, 0x8f,
0xc5, 0x11, 0x0b, 0xf6, 0x88, 0x9b, 0xa1, 0xf0, 0x09, 0x8d, 0x4a, 0x73,
0xa0, 0x97, 0x0e, 0x59, 0xd9, 0x75, 0xaa, 0xdc, 0x55, 0xd3, 0x87, 0xed,
0x71, 0x80, 0x10, 0x66, 0xf6, 0x6c, 0x24, 0x21, 0xac, 0x45, 0xd7, 0xda,
0xb3, 0xeb, 0xb6, 0xae, 0x57, 0x9c, 0x77, 0x52, 0x75, 0xa3, 0x4e, 0x64,
0xfe, 0x19, 0x4f, 0x04, 0x97, 0x26, 0x22, 0x47, 0x67, 0x13, 0x47, 0x76,
0xf8, 0x65, 0x36, 0x36, 0xe5, 0xf8, 0x08, 0xf9, 0x65, 0x08, 0x17, 0x12,
0x66, 0x55, 0x36, 0x89, 0xb6, 0x35, 0xb2, 0xa6, 0x89, 0x39, 0xe7, 0xa7,
0x36, 0x68, 0xb4, 0x44, 0xe7, 0x99, 0xc5, 0x25, 0x5a, 0xc9, 0xf6, 0xa6,
0xb6, 0x0a, 0xfa, 0xd9, 0x57, 0x76, 0x04, 0x44, 0xab, 0xe7, 0x56, 0x7a,
0x4a, 0xf9, 0xb1, 0x5b, 0xb8, 0x89, 0x96, 0x0a, 0x1c, 0x5b, 0x19, 0x59,
0x6c, 0x4c, 0x95, 0x56, 0xe7, 0x3b, 0x1c, 0x1b, 0x3c, 0x36, 0x08, 0x7b,
0xaa, 0xa4, 0x2b, 0xfd, 0xc7, 0x32, 0xfb, 0xfb, 0xd1, 0x8a, 0x2b, 0x2d,
0x08, 0xc8, 0x74, 0xc7, 0x47, 0x3a, 0x2d, 0x1c, 0xe6, 0x57, 0x7b, 0x2d,
0xf4, 0x0c, 0x1c, 0x98, 0x9c, 0x87, 0x48, 0x0c, 0x53, 0x13, 0x7e, 0x5c,
0x3f, 0x45, 0x6f, 0x9f, 0x9f, 0x63, 0xd9, 0x7a, 0x09, 0xcf, 0x6b, 0xae,
0x54, 0xb0, 0x78, 0xec, 0xce, 0xad, 0x1a, 0x75, 0x8b, 0x92, 0xb8, 0x61,
0x84, 0x3e, 0xd9, 0x52, 0xa5, 0x6c, 0x5a, 0x2e, 0x86, 0xb0, 0x0a, 0x79,
0xe3, 0xf1, 0x8e, 0x5f, 0xb9, 0x66, 0xa0, 0xfa, 0x3a, 0x7a, 0xfc, 0x58,
0x03, 0x0f, 0xbd, 0x88, 0x58, 0x42, 0x98, 0x62, 0xe6, 0x89, 0x55, 0xa8,
0x6f, 0x28, 0x1b, 0x51, 0x73, 0x97, 0xa8, 0x5d, 0x40, 0x8d, 0x36, 0xf4,
0x00, 0x3c, 0x09, 0x2a, 0x10, 0x39, 0x4d, 0x5b, 0x0a, 0x8a, 0x13, 0x89,
0x49, 0xce, 0x2b, 0x82, 0x25, 0x41, 0x1a, 0x5d, 0x04, 0xcd, 0xda, 0x91,
0x36, 0x4c, 0xe7, 0x08, 0xad, 0xf9, 0x04, 0x9d, 0x54, 0x9d, 0xae, 0xf6,
0x20, 0x65, 0x05, 0xf5, 0xa8, 0x0a, 0x85, 0xe8, 0x12, 0x5a, 0xfc, 0x77,
0xa9, 0x53, 0x4b, 0x6b, 0x2e, 0x71, 0x62, 0x73, 0xc9, 0x6d, 0xec, 0x2c,
0xa1, 0xc8, 0x68, 0x4e, 0x7d, 0x09, 0x77, 0xe5, 0x3e, 0x87, 0x28, 0x6a,
0xa9, 0x55, 0x0a, 0xa9, 0x19, 0x58, 0x4e, 0x87, 0x14, 0x6a, 0xfd, 0x7b,
0xaf, 0x89, 0x8c, 0x3d, 0x4b, 0x96, 0x9a, 0x39, 0xf6, 0x76, 0x65, 0xe2,
0xae, 0x80, 0x1b, 0xe7, 0xfd, 0x6a, 0x89, 0xc6, 0xc1, 0x6a, 0xf5, 0x38,
0x12, 0xb3, 0x0b, 0x17, 0xdf, 0x3d, 0x5f, 0xe9, 0x00, 0x8d, 0xcd, 0xa7,
0x37, 0xb2, 0xdb, 0x9e, 0x44, 0x1d, 0x9b, 0x3e, 0xed, 0xb8, 0x00, 0x00,
0x3b
};
unsigned int default_font_gif_len = 457;

27
do_release.bat Normal file
View File

@@ -0,0 +1,27 @@
@echo off
REM Comprobar parámetro
IF "%1"=="" (
echo Uso: build_windows.bat ^<PARAMETRO^>
exit /b 1
)
set PARAM=%1
echo Compilando windows...
make windows || exit /b 1
echo Compilando windows_debug...
make windows_debug || exit /b 1
echo Creando paquetes...
REM Crear ZIP release con mini.exe + DLLs
tar -a -c -f mini_%PARAM%_windows_release.zip mini.exe bin\*.dll || exit /b 1
REM Crear ZIP debug solo con mini_debug.exe
tar -a -c -f mini_%PARAM%_windows_debug.zip mini_debug.exe bin\*.dll || exit /b 1
echo Paquetes generados:
echo mini_%PARAM%_windows_release.zip
echo mini_%PARAM%_windows_debug.zip

41
do_release.sh Executable file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
set -e
#if [ -z "$1" ]; then
# echo "Uso: $0 <PARAMETRO>"
# exit 1
#fi
# Leer versión desde version.h
VERSION=$(grep '#define MINI_VERSION' version.h | sed 's/.*"\(.*\)".*/\1/')
echo "Versión detectada: $VERSION"
#PARAM=$1
# Datos Windows
WIN_USER="raimon"
WIN_HOST="192.168.1.51"
WIN_PATH_SSH="C:\Users\raimon\dev\mini"
WIN_PATH_SCP="C:/Users/Raimon/dev/mini"
echo "=== Compilando Linux ==="
make linux
make linux_debug
echo "=== Empaquetando Linux ==="
tar -czf mini_v${VERSION}_linux_release.tar.gz mini
tar -czf mini_v${VERSION}_linux_debug.tar.gz mini_debug
echo "=== Ejecutando build remoto Windows ==="
ssh ${WIN_USER}@${WIN_HOST} "cd ${WIN_PATH_SSH} && do_release.bat v${VERSION}"
echo "=== Copiando ZIPs desde Windows ==="
scp ${WIN_USER}@${WIN_HOST}:"${WIN_PATH_SCP}/mini_v${VERSION}_windows_release.zip" .
scp ${WIN_USER}@${WIN_HOST}:"${WIN_PATH_SCP}/mini_v${VERSION}_windows_debug.zip" .
echo "=== Build completado correctamente ==="
echo "Generados:"
echo " mini_v${VERSION}_linux_release.tar.gz"
echo " mini_v${VERSION}_linux_debug.tar.gz"
echo " mini_v${VERSION}_windows_release.zip"
echo " mini_v${VERSION}_windows_debug.zip"

View File

@@ -78,10 +78,11 @@ bool file_getdictionary() {
fi.read( (char*)&file_size, 4 ); fi.read( (char*)&file_size, 4 );
uint8_t path_size; uint8_t path_size;
fi.read( (char*)&path_size, 1 ); fi.read( (char*)&path_size, 1 );
char file_name[path_size+1]; char *file_name = (char*)malloc(path_size+1);
fi.read( file_name, path_size ); fi.read( file_name, path_size );
file_name[path_size] = 0; file_name[path_size] = 0;
std::string filename = file_name; std::string filename = file_name;
free(file_name);
toc.push_back({filename, file_size, file_offset}); toc.push_back({filename, file_size, file_offset});
} }
fi.close(); fi.close();
@@ -278,7 +279,11 @@ bool file_createFolder(const char* name) {
char tmp[256]; char tmp[256];
strcpy(tmp, "./"); strcpy(tmp, "./");
strcat(tmp, name); strcat(tmp, name);
#ifdef _WIN32
return mkdir(tmp)==0;
#else
return mkdir(tmp, 0755)==0; return mkdir(tmp, 0755)==0;
#endif
} }
static bool has_extension(const std::string &name, const char *ext) static bool has_extension(const std::string &name, const char *ext)

View File

@@ -48,6 +48,8 @@ namespace shader
PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog; PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
PFNGLUSEPROGRAMPROC glUseProgram; PFNGLUSEPROGRAMPROC glUseProgram;
PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation; PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation;
PFNGLACTIVETEXTUREPROC glActiveTexture;
bool initGLExtensions() { bool initGLExtensions() {
glCreateShader = (PFNGLCREATESHADERPROC)SDL_GL_GetProcAddress("glCreateShader"); glCreateShader = (PFNGLCREATESHADERPROC)SDL_GL_GetProcAddress("glCreateShader");
@@ -65,6 +67,7 @@ namespace shader
glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)SDL_GL_GetProcAddress("glGetProgramInfoLog"); glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)SDL_GL_GetProcAddress("glGetProgramInfoLog");
glUseProgram = (PFNGLUSEPROGRAMPROC)SDL_GL_GetProcAddress("glUseProgram"); glUseProgram = (PFNGLUSEPROGRAMPROC)SDL_GL_GetProcAddress("glUseProgram");
glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)SDL_GL_GetProcAddress("glGetUniformLocation"); glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)SDL_GL_GetProcAddress("glGetUniformLocation");
glActiveTexture = (PFNGLACTIVETEXTUREPROC)SDL_GL_GetProcAddress("glActiveTexture");
return glCreateShader && glShaderSource && glCompileShader && glGetShaderiv && return glCreateShader && glShaderSource && glCompileShader && glGetShaderiv &&
glGetShaderInfoLog && glDeleteShader && glAttachShader && glCreateProgram && glGetShaderInfoLog && glDeleteShader && glAttachShader && glCreateProgram &&

149
lua.cpp
View File

@@ -218,6 +218,20 @@ extern "C" {
} }
} }
static int cpp_map_cell(lua_State *L) {
if (lua_gettop(L)==2) {
int celx = luaL_checknumber(L, 1);
int cely = luaL_checknumber(L, 2);
settilesize(celx, cely);
lua_pushinteger(L, mget(celx, cely));
return 0;
} else {
lua_pushinteger(L, gettilew());
lua_pushinteger(L, gettileh());
return 2;
}
}
// palette // palette
// =============================================== // ===============================================
@@ -310,12 +324,14 @@ extern "C" {
break; break;
case 1: case 1:
index = luaL_checkinteger(L, 1); index = luaL_checkinteger(L, 1);
subpal(index,index); lua_pushinteger(L, subpal(index,index));
return 1;
break; break;
case 2: case 2:
index = luaL_checkinteger(L, 1); index = luaL_checkinteger(L, 1);
color = luaL_checkinteger(L, 2); color = luaL_checkinteger(L, 2);
subpal(index, color); lua_pushinteger(L, subpal(index, color));
return 1;
break; break;
case 3: case 3:
index = luaL_checkinteger(L, 1); index = luaL_checkinteger(L, 1);
@@ -561,7 +577,11 @@ extern "C" {
int dx = luaL_checknumber(L, 5); int dx = luaL_checknumber(L, 5);
int dy = luaL_checknumber(L, 6); int dy = luaL_checknumber(L, 6);
float a = luaL_checknumber(L, 7); float a = luaL_checknumber(L, 7);
blit_r(sx, sy, sw, sh, dx, dy, a); int dw = luaL_optnumber(L, 8, 0);
int dh = luaL_optnumber(L, 9, 0);
bool flip_x = lua_toboolean(L, 10);
bool flip_y = lua_toboolean(L, 11);
blit_r(sx, sy, sw, sh, dx, dy, dw, dh, flip_x, flip_y, a);
return 0; return 0;
} }
@@ -808,6 +828,10 @@ extern "C" {
} }
} }
static int cpp_sys_version(lua_State *L) {
lua_pushstring(L, MINI_VERSION);
return 1;
}
// win // win
// =============================================== // ===============================================
@@ -882,6 +906,54 @@ extern "C" {
} }
// font
// ===============================================
static int cpp_font_load(lua_State *L) {
const char* str = luaL_checkstring(L, 1);
uint8_t s = loadfont(str);
if (s==255) {
luaL_error(L, "Error while loading font: Max fonts reached");
return 0;
}
lua_pushinteger(L, s);
return 1;
}
static int cpp_font_current(lua_State *L) {
const int numargs = lua_gettop(L);
switch (numargs) {
case 0: {
lua_pushinteger(L, getfont());
return 1;
}
case 1: {
uint8_t font = luaL_checkinteger(L, 1);
setfont(font);
return 0;
}
default:
return luaL_error(L, "Function 'font.current' Unexpected number of parameters.");
};
}
static int cpp_font_spacing(lua_State *L) {
const int numargs = lua_gettop(L);
switch (numargs) {
case 0: {
lua_pushinteger(L, getfontspacing());
return 1;
}
case 1: {
uint8_t spacing = luaL_checkinteger(L, 1);
setfontspacing(spacing);
return 0;
}
default:
return luaL_error(L, "Function 'font.spacing' Unexpected number of parameters.");
};
}
// mouse // mouse
// =============================================== // ===============================================
@@ -952,6 +1024,16 @@ extern "C" {
return 1; return 1;
} }
static int cpp_key_text(lua_State *L) {
textenable(lua_toboolean(L, 1));
return 0;
}
static int cpp_key_utf8char(lua_State *L) {
lua_pushstring(L, textinput());
return 1;
}
// pad // pad
// =============================================== // ===============================================
@@ -977,8 +1059,50 @@ extern "C" {
return 1; return 1;
} }
static int cpp_utf8_sub(lua_State *L) {
size_t slen;
const char *s = luaL_checklstring(L, 1, &slen);
int i = luaL_checkinteger(L, 2);
int j = luaL_optinteger(L, 3, -1);
// Get utf8.offset
lua_getglobal(L, "utf8");
lua_getfield(L, -1, "offset");
// Compute start byte index
lua_pushvalue(L, 1); // string
lua_pushinteger(L, i); // start index
lua_call(L, 2, 1); // utf8.offset(s, i)
lua_Integer start = lua_tointeger(L, -1);
lua_pop(L, 1);
if (start == 0) {
lua_pushliteral(L, "");
lua_pop(L, 1); // pop utf8 table
return 1;
} }
// Compute end byte index (j+1)
lua_getfield(L, -1, "offset");
lua_pushvalue(L, 1);
lua_pushinteger(L, j + 1);
lua_call(L, 2, 1);
lua_Integer end = lua_tointeger(L, -1);
lua_pop(L, 2); // pop result + utf8 table
if (end == 0) {
// until end of string
lua_pushlstring(L, s + start - 1, slen - (start - 1));
return 1;
}
lua_pushlstring(L, s + start - 1, (end - 1) - (start - 1));
return 1;
}
}
lua_State *L; lua_State *L;
bool is_playing = false; bool is_playing = false;
bool init_exists = false; bool init_exists = false;
@@ -1003,6 +1127,8 @@ void push_lua_funcs() {
lua_pushcfunction(L,cpp_surf_source); lua_setfield(L, -2, "source"); lua_pushcfunction(L,cpp_surf_source); lua_setfield(L, -2, "source");
lua_pushcfunction(L,cpp_surf_cls); lua_setfield(L, -2, "cls"); lua_pushcfunction(L,cpp_surf_cls); lua_setfield(L, -2, "cls");
lua_pushcfunction(L,cpp_surf_pixel); lua_setfield(L, -2, "pixel"); lua_pushcfunction(L,cpp_surf_pixel); lua_setfield(L, -2, "pixel");
lua_pushinteger(L, 0); lua_setfield(L, -2, "SCREEN");
lua_setglobal(L, "surf"); lua_setglobal(L, "surf");
lua_newtable(L); lua_newtable(L);
@@ -1012,6 +1138,7 @@ void push_lua_funcs() {
lua_pushcfunction(L,cpp_map_surf); lua_setfield(L, -2, "surf"); lua_pushcfunction(L,cpp_map_surf); lua_setfield(L, -2, "surf");
lua_pushcfunction(L,cpp_map_draw); lua_setfield(L, -2, "draw"); lua_pushcfunction(L,cpp_map_draw); lua_setfield(L, -2, "draw");
lua_pushcfunction(L,cpp_map_tile); lua_setfield(L, -2, "tile"); lua_pushcfunction(L,cpp_map_tile); lua_setfield(L, -2, "tile");
lua_pushcfunction(L,cpp_map_cell); lua_setfield(L, -2, "cell");
lua_setglobal(L, "map"); lua_setglobal(L, "map");
lua_newtable(L); lua_newtable(L);
@@ -1092,6 +1219,7 @@ void push_lua_funcs() {
lua_pushcfunction(L,cpp_sys_fps); lua_setfield(L, -2, "fps"); lua_pushcfunction(L,cpp_sys_fps); lua_setfield(L, -2, "fps");
lua_pushcfunction(L,cpp_sys_debug); lua_setfield(L, -2, "debug"); lua_pushcfunction(L,cpp_sys_debug); lua_setfield(L, -2, "debug");
lua_pushcfunction(L,cpp_sys_clipboard); lua_setfield(L, -2, "clipboard"); lua_pushcfunction(L,cpp_sys_clipboard); lua_setfield(L, -2, "clipboard");
lua_pushcfunction(L,cpp_sys_version); lua_setfield(L, -2, "version");
lua_pushinteger(L, 0); lua_setfield(L, -2, "UPDATE_ALWAYS"); lua_pushinteger(L, 0); lua_setfield(L, -2, "UPDATE_ALWAYS");
lua_pushinteger(L, 1); lua_setfield(L, -2, "UPDATE_WAIT"); lua_pushinteger(L, 1); lua_setfield(L, -2, "UPDATE_WAIT");
@@ -1111,6 +1239,14 @@ void push_lua_funcs() {
lua_pushcfunction(L,cpp_conf_folder); lua_setfield(L, -2, "folder"); lua_pushcfunction(L,cpp_conf_folder); lua_setfield(L, -2, "folder");
lua_setglobal(L, "config"); lua_setglobal(L, "config");
lua_newtable(L);
lua_pushcfunction(L,cpp_font_load); lua_setfield(L, -2, "load");
lua_pushcfunction(L,cpp_font_current); lua_setfield(L, -2, "current");
lua_pushcfunction(L,cpp_font_spacing); lua_setfield(L, -2, "spacing");
lua_pushinteger(L, 0); lua_setfield(L, -2, "DEFAULT");
lua_setglobal(L, "font");
lua_newtable(L); lua_newtable(L);
lua_pushcfunction(L,cpp_mouse_pos); lua_setfield(L, -2, "pos"); lua_pushcfunction(L,cpp_mouse_pos); lua_setfield(L, -2, "pos");
lua_pushcfunction(L,cpp_mouse_wheel); lua_setfield(L, -2, "wheel"); lua_pushcfunction(L,cpp_mouse_wheel); lua_setfield(L, -2, "wheel");
@@ -1129,6 +1265,8 @@ void push_lua_funcs() {
lua_pushcfunction(L,cpp_key_down); lua_setfield(L, -2, "down"); lua_pushcfunction(L,cpp_key_down); lua_setfield(L, -2, "down");
lua_pushcfunction(L,cpp_key_press); lua_setfield(L, -2, "press"); lua_pushcfunction(L,cpp_key_press); lua_setfield(L, -2, "press");
lua_pushcfunction(L,cpp_key_any); lua_setfield(L, -2, "any"); lua_pushcfunction(L,cpp_key_any); lua_setfield(L, -2, "any");
lua_pushcfunction(L,cpp_key_text); lua_setfield(L, -2, "text");
lua_pushcfunction(L,cpp_key_utf8char); lua_setfield(L, -2, "utf8char");
//lua_setglobal(L, "key"); //lua_setglobal(L, "key");
//lua_newtable(L); //lua_newtable(L);
@@ -1274,6 +1412,11 @@ void push_lua_funcs() {
lua_setglobal(L, "pad"); lua_setglobal(L, "pad");
lua_getglobal(L, "utf8"); // push utf8 table
lua_pushcfunction(L, cpp_utf8_sub); // push C function
lua_setfield(L, -2, "sub"); // utf8.sub = cpp_utf8_sub
lua_pop(L, 1); // pop utf8 table
} }
/* /*

393
mini.cpp
View File

@@ -9,7 +9,11 @@
//#include <vector> //#include <vector>
#include "log.h" #include "log.h"
#include "default_font_gif.h"
#include "default_font_fnt.h"
#define MAX_SURFACES 100 #define MAX_SURFACES 100
#define MAX_FONTS 5
#ifdef MACOS_BUNDLE #ifdef MACOS_BUNDLE
#include <libgen.h> #include <libgen.h>
@@ -26,11 +30,15 @@ struct surface_t {
uint32_t size; uint32_t size;
}; };
struct char_t {
uint8_t x,y,w,h,base;
};
struct font_t { struct font_t {
struct special_char_t { uint8_t character; SDL_Rect glyph; SDL_Point displacement; }; char *name {nullptr};
int8_t spacing; uint8_t surface {0};
SDL_Rect characters[96]; uint8_t spacing {1};
special_char_t specials[64]; char_t chars[256];
}; };
int fps=0; int fps=0;
@@ -52,7 +60,11 @@ surface_t *screen_surface = &surfaces[0];
surface_t *dest_surface = screen_surface; surface_t *dest_surface = screen_surface;
surface_t *source_surface = NULL; surface_t *source_surface = NULL;
surface_t *map_surface = NULL; surface_t *map_surface = NULL;
uint8_t tile_width = 8;
uint8_t tile_height = 8;
font_t fonts[MAX_FONTS];
font_t *current_font;
FILE *file = NULL; FILE *file = NULL;
//uint8_t file_mode = 0; //uint8_t file_mode = 0;
bool file_ignore_comma=true; bool file_ignore_comma=true;
@@ -109,6 +121,8 @@ char base64glyphs[193] = "/h/AqV/hhhh/GMYYMGz/t/eS33H477wsjjswY4IOPHEFFVVVAVAVAV
//Uint8 keymapping[6] = { SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_Z, SDL_SCANCODE_X }; //Uint8 keymapping[6] = { SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_UP, SDL_SCANCODE_DOWN, SDL_SCANCODE_Z, SDL_SCANCODE_X };
const bool *keys; const bool *keys;
Uint8 key_just_pressed = 0; Uint8 key_just_pressed = 0;
static char text_input_buffer[10];
static bool has_text_input = false;
int mouse_x, mouse_y, mouse_wheel; int mouse_x, mouse_y, mouse_wheel;
Uint32 mouse_buttons; Uint32 mouse_buttons;
@@ -272,6 +286,22 @@ uint8_t newsurf(int w, int h) {
return i; return i;
} }
uint8_t loadsurf(uint8_t* buffer, const char* name) {
// Agafar la pròxima textura lliure
unsigned int i = 0;
while (i<MAX_SURFACES && surfaces[i].p != NULL) ++i;
if (i==MAX_SURFACES) return 255;
surfaces[i].p = LoadGif(buffer, &surfaces[i].w, &surfaces[i].h);
surfaces[i].size = surfaces[i].w*surfaces[i].h;
surfaces[i].name = (char*)malloc(strlen(name)+1);
strcpy(surfaces[i].name, name);
log_msg(LOG_INFO, "Buffer '%s' carregat en surface: %i.\n", name, i);
return i;
}
uint8_t loadsurf(const char* filename, const bool external) { uint8_t loadsurf(const char* filename, const bool external) {
// Si el gif ja s'ha carregat en una textura, tornem eixa textura // Si el gif ja s'ha carregat en una textura, tornem eixa textura
for (unsigned int i=0; i<MAX_SURFACES; ++i) for (unsigned int i=0; i<MAX_SURFACES; ++i)
@@ -390,6 +420,106 @@ void shader_init(const char* vshader, const char* fshader)
void shader_enable() { shader::enable(); } void shader_enable() { shader::enable(); }
void shader_disable() { shader::disable(); } void shader_disable() { shader::disable(); }
uint8_t loadfont_from_buffer(const char* buffer, uint8_t index, const char* name) {
if (!buffer) return false;
const char* ptr = buffer;
char line[256];
// --- Read first line ---
{
// Extract line
int len = 0;
while (ptr[len] && ptr[len] != '\n' && len < 255) len++;
memcpy(line, ptr, len);
line[len] = '\0';
ptr += (ptr[len] == '\n') ? len + 1 : len; // Advance pointer
if (len > 0 && line[len - 1] == '\r') line[len - 1] = '\0';
if (strncmp(line, "bitmap=", 7) != 0) return false; // Parse first line
fonts[index].surface = loadsurf(line + 7);
fonts[index].name = (char*)malloc(strlen(name)+1);
strcpy(fonts[index].name, name);
}
// --- Read character lines ---
while (*ptr) {
// Extract next line
int len = 0;
while (ptr[len] && ptr[len] != '\n' && len < 255) len++;
memcpy(line, ptr, len);
line[len] = '\0';
ptr += (ptr[len] == '\n') ? len + 1 : len; // Advance pointer
if (len > 0 && line[len - 1] == '\r') line[len - 1] = '\0';
// Remove comments
char* hash = strchr(line, '#');
if (hash) *hash = '\0';
// Parse
int code, x, y, w, h, base;
if (sscanf(line, "%d: %d %d %d %d %d", &code, &x, &y, &w, &h, &base) == 6) {
if (code >= 0 && code < 256) {
fonts[index].chars[code] = { (uint8_t)x, (uint8_t)y, (uint8_t)w, (uint8_t)h, (uint8_t)base };
}
}
}
return index;
}
uint8_t loadfont(const char *filename) {
// Si la font ja s'ha carregat, tornem eixa font
for (unsigned int i=0; i<MAX_FONTS; ++i)
if (fonts[i].name && strcmp(fonts[i].name, filename)==0) {
log_msg(LOG_INFO, "Carrega de '%s' abortada: Reusant: %i.\n", filename, i);
return i;
}
// Agafar la pròxima textura lliure
unsigned int i = 0;
while (i<MAX_FONTS && fonts[i].name != NULL) ++i;
if (i==MAX_FONTS) return 255;
// Carregar l'arxiu de disc
int size;
char *buffer;
buffer = file_getfilebuffer(filename, size);
// Si no s'ha pogut, petar
if (!buffer) {
log_msg(LOG_FAIL, "Error al intentar obrir l'arxiu '%s'\n", filename);
exit(-1);
return 255;
}
loadfont_from_buffer(buffer, i, filename);
free(buffer);
log_msg(LOG_INFO, "Arxiu '%s' carregat en font: %i.\n", filename, i);
return i;
}
uint8_t getfont() {
for (unsigned int i=0; i<MAX_FONTS; ++i) if (current_font == &fonts[i]) return i;
return 0;
}
void setfont(uint8_t font) {
current_font = &fonts[font];
}
uint8_t getfontspacing() {
return current_font->spacing;
}
void setfontspacing(uint8_t spacing) {
current_font->spacing = spacing;
}
void createDisplay() { void createDisplay() {
if (screen_zoom <= 0) screen_zoom = 1; if (screen_zoom <= 0) screen_zoom = 1;
while (screen_width*screen_zoom > desktop_width || screen_height*screen_zoom > desktop_height) screen_zoom--; while (screen_width*screen_zoom > desktop_width || screen_height*screen_zoom > desktop_height) screen_zoom--;
@@ -459,6 +589,9 @@ int main(int argc,char*argv[]){
if (strcmp(command, "new")==0) { if (strcmp(command, "new")==0) {
createNewProject(); createNewProject();
exit(0); exit(0);
} else if (strcmp(command, "version")==0) {
//createNewProject();
exit(0);
} }
} else if (strstr(argv[1], ".lua")!=nullptr) { } else if (strstr(argv[1], ".lua")!=nullptr) {
file_setresourcefolder("./"); file_setresourcefolder("./");
@@ -466,6 +599,12 @@ int main(int argc,char*argv[]){
strcpy(main_lua_file, argv[1]); strcpy(main_lua_file, argv[1]);
strcpy(window_title, argv[1]); strcpy(window_title, argv[1]);
override_ini = true; override_ini = true;
} else if (strstr(argv[1], ".jf2")!=nullptr) {
file_setresourcefilename(argv[1]);
file_setsource(SOURCE_FILE);
//strcpy(main_lua_file, argv[1]);
//strcpy(window_title, argv[1]);
//override_ini = true;
} else { } else {
char path[256] = "./"; char path[256] = "./";
strcat(path, argv[1]); strcat(path, argv[1]);
@@ -478,6 +617,7 @@ int main(int argc,char*argv[]){
should_exit=false; should_exit=false;
// initfont() // initfont()
int bi = 0; int bi = 0;
for (int ci=0; ci<96; ci+=2) { for (int ci=0; ci<96; ci+=2) {
font[ci] = base64font[bi] - 48 + ( ( base64font[bi+1] - 48 ) << 6) + ( ( ( base64font[bi+2] - 48 ) & 7 ) << 12 ); font[ci] = base64font[bi] - 48 + ( ( base64font[bi+1] - 48 ) << 6) + ( ( ( base64font[bi+2] - 48 ) & 7 ) << 12 );
@@ -526,6 +666,10 @@ int main(int argc,char*argv[]){
reinit(); reinit();
initaudio(); initaudio();
loadsurf(default_font_gif, "default_font");
loadfont_from_buffer((const char*)default_font_fnt, 0, "default_font");
current_font = &fonts[0];
lua_init(main_lua_file); lua_init(main_lua_file);
lua_call_init(); lua_call_init();
@@ -535,26 +679,17 @@ int main(int argc,char*argv[]){
mouse_just_pressed = 0; mouse_just_pressed = 0;
mouse_wheel = 0; mouse_wheel = 0;
double_click = false; double_click = false;
has_text_input = false;
while(!should_exit) { while(!should_exit) {
if (update_mode==UPDATE_WAIT) SDL_WaitEvent(NULL); if (update_mode==UPDATE_WAIT) SDL_WaitEvent(NULL);
else if (update_mode==UPDATE_TIMEOUT) SDL_WaitEventTimeout(NULL, timeout); else if (update_mode==UPDATE_TIMEOUT) SDL_WaitEventTimeout(NULL, timeout);
while(SDL_PollEvent(&mini_eve)) { while(SDL_PollEvent(&mini_eve)) {
if (mini_eve.type == SDL_EVENT_QUIT) { should_exit=true; should_quit=true; break; } if (mini_eve.type == SDL_EVENT_QUIT) { should_exit=true; should_quit=true; break; }
if (mini_eve.type == SDL_EVENT_KEY_DOWN) { if (mini_eve.type == SDL_EVENT_TEXT_INPUT) {
/* SDL_strlcpy(text_input_buffer, mini_eve.text.text, sizeof(text_input_buffer));
if (mini_eve.key.keysym.scancode == SDL_SCANCODE_F2) { has_text_input = true;
screen_zoom+=2; if (screen_zoom>=10) screen_zoom=2;
destroyDisplay();
createDisplay();
char strzoom[3];
file_setconfigvalue("zoom", SDL_itoa(screen_zoom, strzoom, 10));
} else if (mini_eve.key.keysym.scancode == SDL_SCANCODE_F3) {
screen_fullscreen = !screen_fullscreen;
destroyDisplay();
createDisplay();
file_setconfigvalue("fullscreen", screen_fullscreen?"true":"false");
} }
*/ if (mini_eve.type == SDL_EVENT_KEY_DOWN) {
#ifdef DEBUG #ifdef DEBUG
if (mini_eve.key.scancode == SDL_SCANCODE_F12) { if (mini_eve.key.scancode == SDL_SCANCODE_F12) {
if (lua_is_playing()) { if (lua_is_playing()) {
@@ -617,6 +752,8 @@ int main(int argc,char*argv[]){
if (beats>0)beats--; if (beats>0)beats--;
key_just_pressed = 0; key_just_pressed = 0;
mouse_just_pressed = 0; mouse_just_pressed = 0;
has_text_input = false;
text_input_buffer[0] = '\0';
double_click = false; double_click = false;
mouse_wheel = 0; mouse_wheel = 0;
pad_just_pressed = SDL_GAMEPAD_BUTTON_INVALID; pad_just_pressed = SDL_GAMEPAD_BUTTON_INVALID;
@@ -725,8 +862,10 @@ uint8_t gettrans() {
return ds::trans; return ds::trans;
} }
void subpal(uint8_t index, uint8_t color) { uint8_t subpal(uint8_t index, uint8_t color) {
const uint8_t old = ds::draw_palette[SDL_clamp(index,0,255)];
ds::draw_palette[SDL_clamp(index,0,255)] = SDL_clamp(color,0,255); ds::draw_palette[SDL_clamp(index,0,255)] = SDL_clamp(color,0,255);
return old;
} }
void reset_subpal() { void reset_subpal() {
@@ -923,11 +1062,44 @@ void print(const char *str, int x, int y) {
pos++; pos++;
} }
} }
void print(const char *str, int x, int y, uint8_t color) { void old_print(const char *str, int x, int y, uint8_t color) {
ds::pen_color=color; ds::pen_color=color;
print(str, x, y); print(str, x, y);
} }
const uint8_t printchar(uint8_t c, int x, int y) {
char_t &chr = current_font->chars[c];
blit(chr.x, chr.y, chr.w, chr.h, x, y-chr.base);
return chr.w;
}
void print(const char* str, int x, int y, uint8_t color) {
const unsigned char* p = (const unsigned char*)str;
uint8_t cp;
uint8_t xpos = x;
uint8_t old_source = getsource();
setsource(current_font->surface);
uint8_t old_color = ds::draw_palette[1];
ds::draw_palette[1] = color;
uint8_t old_trans = ds::trans;
ds::trans = 0;
while (p[0]!=0) {
if (p[0] < 0x80) {
cp = p[0];
p+=1;
} else if ((p[0] & 0xE0) == 0xC0) {
cp = (p[0] << 6) | (p[1] & 0x3F);
p+=2;
}
xpos += printchar(cp, xpos, y) + current_font->spacing;
}
ds::trans = old_trans;
ds::draw_palette[1] = old_color;
setsource(old_source);
}
void clip(int x, int y, int w, int h) { void clip(int x, int y, int w, int h) {
ds::clp[0] = x; ds::clp[1] = y; ds::clp[2] = w; ds::clp[3] = h; ds::clp[0] = x; ds::clp[1] = y; ds::clp[2] = w; ds::clp[3] = h;
recalculate_clip(); recalculate_clip();
@@ -1140,10 +1312,10 @@ void sset(int x, int y, uint8_t color) {
void spr(uint8_t n, int x, int y, float w, float h, bool flip_x, bool flip_y) { void spr(uint8_t n, int x, int y, float w, float h, bool flip_x, bool flip_y) {
if (!source_surface) return; if (!source_surface) return;
int tx = (n%(source_surface->w >> 3))<<3; int tx = (n%(source_surface->w / tile_width))*tile_width;
int ty = (n/(source_surface->w >> 3))<<3; int ty = (n/(source_surface->w / tile_height))*tile_height;
int tw = w*8 - 1; int tw = w*tile_width - 1;
int th = h*8 - 1; int th = h*tile_height - 1;
//int tx2 = tx1 + tw; //int tx2 = tx1 + tw;
//int ty2 = ty1 + th; //int ty2 = ty1 + th;
int txd = 1; int txd = 1;
@@ -1181,6 +1353,7 @@ void blit(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, bool f
} }
} }
/*
void blit_r(int sx, int sy, int sw, int sh, int x, int y, float a) void blit_r(int sx, int sy, int sw, int sh, int x, int y, float a)
{ {
const int x0 = sw>>1; const int x0 = sw>>1;
@@ -1203,6 +1376,142 @@ void blit_r(int sx, int sy, int sw, int sh, int x, int y, float a)
} }
} }
} }
*/
void blit_r(int sx, int sy, int sw, int sh,
int dx, int dy, int dw, int dh,
bool flip_x, bool flip_y,
float angle_deg)
{
if (dw == 0) dw = sw;
if (dh == 0) dh = sh;
// Centro del destino (rectángulo sin rotar)
float dcx = dx + dw * 0.5f;
float dcy = dy + dh * 0.5f;
// Centro del subrectángulo origen
float scx = sx + sw * 0.5f;
float scy = sy + sh * 0.5f;
// Escalado destino -> origen
float inv_scale_x = float(sw) / float(dw);
float inv_scale_y = float(sh) / float(dh);
// Flips integrados en la escala
if (flip_x) inv_scale_x = -inv_scale_x;
if (flip_y) inv_scale_y = -inv_scale_y;
// Ángulo en radianes
float a = angle_deg * 3.14159265f / 180.0f;
float ca = SDL_cosf(a);
float sa = SDL_sinf(a);
// --- 1. Bounding box rotado del rectángulo destino ---
float hx = dw * 0.5f;
float hy = dh * 0.5f;
float vx[4] = { -hx, hx, -hx, hx };
float vy[4] = { -hy, -hy, hy, hy };
float min_x = 1e9f, max_x = -1e9f;
float min_y = 1e9f, max_y = -1e9f;
for (int i = 0; i < 4; ++i) {
float rr_x = vx[i] * ca - vy[i] * sa;
float rr_y = vx[i] * sa + vy[i] * ca;
float dxp = dcx + rr_x;
float dyp = dcy + rr_y;
if (dxp < min_x) min_x = dxp;
if (dxp > max_x) max_x = dxp;
if (dyp < min_y) min_y = dyp;
if (dyp > max_y) max_y = dyp;
}
int bb_x0 = (int)SDL_floorf(min_x);
int bb_x1 = (int)SDL_ceilf (max_x);
int bb_y0 = (int)SDL_floorf(min_y);
int bb_y1 = (int)SDL_ceilf (max_y);
// --- 2. Rotación inversa + escalado + clipping estricto ---
for (int y = bb_y0; y <= bb_y1; ++y) {
for (int x = bb_x0; x <= bb_x1; ++x) {
// Coordenadas relativas al centro destino
float rx = x - dcx;
float ry = y - dcy;
// Rotación inversa
float ux = rx * ca + ry * sa;
float uy = -rx * sa + ry * ca;
// Escalado destino -> origen (con flips)
float sxp = scx + ux * inv_scale_x;
float syp = scy + uy * inv_scale_y;
// Clipping estricto al subrectángulo origen
if (sxp < sx || sxp >= sx + sw ||
syp < sy || syp >= sy + sh)
continue; // no pintamos nada
uint8_t color = sget((int)sxp, (int)syp);
pset(x, y, color);
}
}
}
/*void blit_r(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, bool flip_x, bool flip_y, float angle_deg)
{
if (dw == 0) dw = sw;
if (dh == 0) dh = sh;
// Escalado origen→destino
float sdx = float(sw) / float(dw);
float sdy = float(sh) / float(dh);
// Centro del destino
float dcx = dx + dw * 0.5f;
float dcy = dy + dh * 0.5f;
// Centro del origen
float scx = sx + sw * 0.5f;
float scy = sy + sh * 0.5f;
// Flips: invertir escala
if (flip_x) sdx = -sdx;
if (flip_y) sdy = -sdy;
// Ángulo en radianes
float a = angle_deg * 3.14159265f / 180.0f;
float ca = SDL_cosf(a);
float sa = SDL_sinf(a);
// Bucle principal
for (int y = dy; y < dy + dh; ++y) {
for (int x = dx; x < dx + dw; ++x) {
// Coordenadas destino relativas al centro
float rx = x - dcx;
float ry = y - dcy;
// Rotación inversa (para muestreo)
float orx = rx * ca + ry * sa;
float ory = -rx * sa + ry * ca;
// Convertir a coordenadas de la fuente
float sxp = scx + orx * sdx;
float syp = scy + ory * sdy;
// Muestreo nearest neighbor
uint8_t color = sget(int(sxp), int(syp));
pset(x, y, color);
}
}
}*/
void tline(int x0, int y0, int x1, int y1, float mx, float my, float mdx, float mdy) { void tline(int x0, int y0, int x1, int y1, float mx, float my, float mdx, float mdy) {
int x, y; int x, y;
@@ -1276,6 +1585,13 @@ void mset(int celx, int cely, uint8_t snum) {
TILES(celx, cely) = snum; TILES(celx, cely) = snum;
} }
uint8_t gettilew() { return tile_width; }
uint8_t gettileh() { return tile_height; }
void settilesize(int w, int h) {
tile_width = w;
tile_height = h;
}
void map() { //int celx, int cely, int sx, int sy, uint8_t celw, uint8_t celh, uint8_t layer) { void map() { //int celx, int cely, int sx, int sy, uint8_t celw, uint8_t celh, uint8_t layer) {
if (map_surface==NULL) return; if (map_surface==NULL) return;
int celw = map_surface->w;// >> 3; int celw = map_surface->w;// >> 3;
@@ -1284,28 +1600,28 @@ void map() { //int celx, int cely, int sx, int sy, uint8_t celw, uint8_t celh, u
int cely = 0; int cely = 0;
//if (celw <= 0 || celh <= 0 || celw >= TILES_WIDTH || celh >= TILES_HEIGHT) return; //if (celw <= 0 || celh <= 0 || celw >= TILES_WIDTH || celh >= TILES_HEIGHT) return;
int sx = ds::origin[0]; int sy = ds::origin[1]; int sx = ds::origin[0]; int sy = ds::origin[1];
if (sx+celw*8 < ds::clip[0] || sx > ds::clip[2] || sy+celh*8 < ds::clip[1] || sy > ds::clip[3]) return; if (sx+celw*tile_width < ds::clip[0] || sx > ds::clip[2] || sy+celh*tile_height < ds::clip[1] || sy > ds::clip[3]) return;
if (sx<0) { if (sx<0) {
int diff = -sx/8; int diff = -sx/tile_width;
celx += diff; celx += diff;
celw -= diff; celw -= diff;
sx += diff*8; sx += diff*tile_width;
} }
if (sy<0) { if (sy<0) {
int diff = -sy/8; int diff = -sy/tile_height;
cely += diff; cely += diff;
celh -= diff; celh -= diff;
sy += diff*8; sy += diff*tile_height;
} }
sx -= ds::origin[0]; sy -= ds::origin[1]; sx -= ds::origin[0]; sy -= ds::origin[1];
for (int y=0; y<celh; ++y) { for (int y=0; y<celh; ++y) {
for (int x=0; x<celw; ++x) { for (int x=0; x<celw; ++x) {
const uint8_t tile = mget(celx+x, cely+y); const uint8_t tile = mget(celx+x, cely+y);
if (tile==0) continue; if (tile==0) continue;
const int fx = sx+(x*8)+ds::origin[0]; const int fx = sx+(x*tile_width)+ds::origin[0];
const int fy = sy+(y*8)+ds::origin[1]; const int fy = sy+(y*tile_height)+ds::origin[1];
if ( (fx+8<ds::clip[0]) || (fy+8<ds::clip[1]) || (fx>ds::clip[2]) || (fy>ds::clip[3]) ) continue; if ( (fx+tile_width<ds::clip[0]) || (fy+tile_height<ds::clip[1]) || (fx>ds::clip[2]) || (fy>ds::clip[3]) ) continue;
spr(tile, sx+x*8, sy+y*8); spr(tile, sx+x*tile_width, sy+y*tile_height);
} }
} }
} }
@@ -1334,6 +1650,17 @@ bool anykey() {
return something_pressed; return something_pressed;
} }
void textenable(const bool enable) {
if (enable)
SDL_StartTextInput(mini_win);
else
SDL_StopTextInput(mini_win);
}
const char* textinput() {
return has_text_input ? text_input_buffer : nullptr;
}
bool pad(int8_t i) { bool pad(int8_t i) {
if (!gamepad) return false; if (!gamepad) return false;
return SDL_GetGamepadButton(gamepad, SDL_GamepadButton(i)) == 1; return SDL_GetGamepadButton(gamepad, SDL_GamepadButton(i)) == 1;

16
mini.h
View File

@@ -142,6 +142,12 @@ void shader_init(const char* vshader, const char* fshader);
void shader_enable(); void shader_enable();
void shader_disable(); void shader_disable();
uint8_t loadfont(const char *filename);
uint8_t getfont();
void setfont(uint8_t font);
uint8_t getfontspacing();
void setfontspacing(uint8_t spacing);
void cls(uint8_t color=0); void cls(uint8_t color=0);
void color(uint8_t color=6); void color(uint8_t color=6);
void bcolor(uint8_t color=0); void bcolor(uint8_t color=0);
@@ -152,7 +158,7 @@ void setcolor(uint8_t index, uint32_t color);
uint32_t getcolor(uint8_t index); uint32_t getcolor(uint8_t index);
void settrans(uint8_t index); void settrans(uint8_t index);
uint8_t gettrans(); uint8_t gettrans();
void subpal(uint8_t index, uint8_t color); uint8_t subpal(uint8_t index, uint8_t color);
void reset_subpal(); void reset_subpal();
void set_draw_mode(uint8_t mode); void set_draw_mode(uint8_t mode);
@@ -211,7 +217,8 @@ void sset(int x, int y, uint8_t color);
void spr(uint8_t n, int x, int y, float w = 1.0f, float h = 1.0f, bool flip_x = false, bool flip_y = false); void spr(uint8_t n, int x, int y, float w = 1.0f, float h = 1.0f, bool flip_x = false, bool flip_y = false);
void blit(int sx, int sy, int sw, int sh, int dx, int dy, int dw=0, int dh=0, bool flip_x = false, bool flip_y = false, bool invert = false); void blit(int sx, int sy, int sw, int sh, int dx, int dy, int dw=0, int dh=0, bool flip_x = false, bool flip_y = false, bool invert = false);
void blit_r(int sx, int sy, int sw, int sh, int x, int y, float a); //void blit_r(int sx, int sy, int sw, int sh, int x, int y, float a);
void blit_r(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, bool flip_x, bool flip_y, float angle_deg);
void tline(int x0, int y0, int x1, int y1, float mx, float my, float mdx=0.125f, float mdy=0.0f); void tline(int x0, int y0, int x1, int y1, float mx, float my, float mdx=0.125f, float mdy=0.0f);
void thline(int x0, int y, int x1, float mx, float my, float mdx=0.125f, float mdy=0.0f); void thline(int x0, int y, int x1, float mx, float my, float mdx=0.125f, float mdy=0.0f);
@@ -219,12 +226,17 @@ void tvline(int x, int y0, int y1, float mx, float my, float mdx=0.0f, float mdy
uint8_t mget(int celx, int cely); uint8_t mget(int celx, int cely);
void mset(int celx, int cely, uint8_t snum); void mset(int celx, int cely, uint8_t snum);
uint8_t gettilew();
uint8_t gettileh();
void settilesize(int w, int h);
void map(); //int celx, int cely, int sx, int sy, uint8_t celw, uint8_t celh, uint8_t layer=0); void map(); //int celx, int cely, int sx, int sy, uint8_t celw, uint8_t celh, uint8_t layer=0);
bool btn(uint8_t i); bool btn(uint8_t i);
int wbtnp(); int wbtnp();
bool btnp(uint8_t i); bool btnp(uint8_t i);
bool anykey(); bool anykey();
void textenable(const bool enable);
const char *textinput();
bool pad(int8_t i); bool pad(int8_t i);
bool padp(int8_t i); bool padp(int8_t i);

57
publish_gitea.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
set -e
#if [ -z "$1" ]; then
# echo "Uso: $0 <PARAMETRO>"
# exit 1
#fi
GITEA_TOKEN="eb44d9c0142f5038c61c5afd17f5a41177bfaedc"
if [ -z "$GITEA_TOKEN" ]; then
echo "ERROR: Debes exportar GITEA_TOKEN"
exit 1
fi
# Leer versión desde version.h
VERSION=$(grep '#define MINI_VERSION' version.h | sed 's/.*"\(.*\)".*/\1/')
echo "Versión detectada: $VERSION"
#PARAM=$1
API="https://gitea.sustancia.synology.me/api/v1"
REPO="JailDoctor/mini"
echo "=== Creando release ${VERSION} en Gitea ==="
RELEASE_ID=$(curl -s -X POST "${API}/repos/${REPO}/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"${VERSION}\",
\"name\": \"Release ${VERSION}\",
\"draft\": false,
\"prerelease\": false
}" | jq -r '.id')
if [ "$RELEASE_ID" = "null" ]; then
echo "ERROR: No se pudo crear el release"
exit 1
fi
echo "Release creado con ID: $RELEASE_ID"
echo "=== Subiendo artefactos ==="
for f in mini_v${VERSION}_linux_release.tar.gz \
mini_v${VERSION}_linux_debug.tar.gz \
mini_v${VERSION}_windows_release.zip \
mini_v${VERSION}_windows_debug.zip
do
echo "Subiendo $f..."
curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@${f}" \
"${API}/repos/${REPO}/releases/${RELEASE_ID}/assets" > /dev/null
done
echo "=== Publicación completada ==="

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define MINI_VERSION "1.4.1" #define MINI_VERSION "1.4.9"

View File

@@ -4,6 +4,7 @@
mini = {} mini = {}
---@class surf ---@class surf
---@field surf.SCREEN number
surf = {} surf = {}
---@param w number ---@param w number
@@ -72,6 +73,9 @@ function surf.pixel(x, y) end
---Set the color for pixel (x,y) on the target surface. ---Set the color for pixel (x,y) on the target surface.
function surf.pixel(x, y, color) end function surf.pixel(x, y, color) end
surf.SCREEN = 0
---@class map ---@class map
map = {} map = {}
@@ -98,6 +102,15 @@ function map.tile(x, y) end
---Set the tile at the position (x,y) in the current tilemap ---Set the tile at the position (x,y) in the current tilemap
function map.tile(x, y, tile) end function map.tile(x, y, tile) end
---@param w number
---@param h number
---Set current tile size
function map.cell(w, h) end
---@return number w, number h
---Set current tile size
function map.cell() end
---@class pal ---@class pal
pal = {} pal = {}
@@ -122,6 +135,10 @@ function pal.color(index) end
---Set (r,g,b) color for the specified index in the current palette ---Set (r,g,b) color for the specified index in the current palette
function pal.color(index, r, g, b) end function pal.color(index, r, g, b) end
---@return number index
---Get the index specified as transparent color
function pal.trans() end
---@param index number ---@param index number
---Set the index specified as transparent color ---Set the index specified as transparent color
function pal.trans(index) end function pal.trans(index) end
@@ -130,12 +147,16 @@ function pal.trans(index) end
function pal.subpal() end function pal.subpal() end
---@param index number ---@param index number
---Reset the specified subpalette index to its default palette index ---@return number index
---Reset the specified subpalette index to its default palette index,
---returns the previously mapped index
function pal.subpal(index) end function pal.subpal(index) end
---@param index number ---@param index number
---@param color number ---@param color number
---Set the specified subpalette index to the specified palette index ---@return number index
---Set the specified subpalette index to the specified palette index,
---returns the previously mapped index
function pal.subpal(index, color) end function pal.subpal(index, color) end
---@param index1 number ---@param index1 number
@@ -299,9 +320,15 @@ function draw.surf(sx, sy, sw, sh, dx, dy, dw, dh, flip_x, flip_y, invert) end
---@param x number ---@param x number
---@param y number ---@param y number
---@param a number ---@param a number
---@optional dw number
---@optional dh number
---@optional boolean flip_x
---@optional boolean flip_y
---@optional boolean invert
---Blit the region starting at (sx,sy) and size (sw, sh) from the source surface ---Blit the region starting at (sx,sy) and size (sw, sh) from the source surface
---to the position (dx, dy) of the target surface, rotating it by a degrees ---to the position (dx, dy) of the target surface, rotating it by a degrees,
function draw.surfrot(sx, sy, sw, sh, x, y, a) end ---(and optionally of size (dw, dh)) optionally flipping it horizontally or vertically
function draw.surfrot(sx, sy, sw, sh, x, y, a, dw, dh, flip_x, flip_y) end
---@param text string ---@param text string
---@param x number ---@param x number
@@ -310,13 +337,6 @@ function draw.surfrot(sx, sy, sw, sh, x, y, a) end
---Draw text to (x,y) using the specified color ---Draw text to (x,y) using the specified color
function draw.text(text, x, y, color) end function draw.text(text, x, y, color) end
---@param text number
---@param x number
---@param y number
---@param color number
---Draw text to (x,y) using the specified color
function draw.text(text, x, y, color) end
---@param mode number ---@param mode number
---Specify the mode for the drawing functions ---Specify the mode for the drawing functions
function draw.mode(mode) end function draw.mode(mode) end
@@ -486,6 +506,10 @@ function sys.clipboard(value) end
---Returns true if running on debug version of mini. False otherwise. ---Returns true if running on debug version of mini. False otherwise.
function sys.debug() end function sys.debug() end
---@return string
---Returns the current mini version as a string.
function sys.version() end
---@class win ---@class win
win = {} win = {}
@@ -538,6 +562,34 @@ function config.key(key) end
function config.folder() end function config.folder() end
---@class font
---@field font.DEFAULT number
font = {}
---@param filename string
---@return number fnt
---Loads a font from a file
function font.load(filename) end
---@return number fnt
---Gets the currently selected font
function font.current() end
---@param fnt number
---Sets the specified font as selected
function font.current(fnt) end
---@return number value
---Gets the currently selected font's spacing
function font.spacing() end
---@param value number
---Sets the currently selected font's spacing
function font.spacing(value) end
font.DEFAULT = 0
---@class mouse ---@class mouse
---@field mouse.LEFT number ---@field mouse.LEFT number
---@field mouse.MIDDLE number ---@field mouse.MIDDLE number
@@ -604,6 +656,14 @@ function key.press(key) end
---Returns whether any keyboard key has just been pressed ---Returns whether any keyboard key has just been pressed
function key.any() end function key.any() end
---@param enable boolean
---Enable or disable utf8 text input
function key.text(enable) end
---@return string
---Returns a string with the utf-8 character sequence pressed. Only when utf8 is enabled
function key.utf8char() end
---@class pad ---@class pad
---@field pad.INVALID number ---@field pad.INVALID number
@@ -888,3 +948,13 @@ key.RCTRL = 228
key.RSHIFT = 229 key.RSHIFT = 229
key.RALT = 230 key.RALT = 230
key.RGUI = 231 key.RGUI = 231
---@class utf8
utf8 = {}
---@param str string
---@param startchr number
---@param endchr number
---@return string
---Returns whether the specified keyboard key is down
function utf8.sub(str, startchr, endchr) end