Mine games v0.61
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 28s
Build system / Build (pull_request) Successful in 5m17s

Optimizations to fix the game into 2048 byte
This commit is contained in:
2025-03-21 03:08:35 +02:00
parent 09769f5e25
commit 831203ff1a
3 changed files with 15 additions and 17 deletions

View File

@@ -102,14 +102,14 @@ void draw_square(int x, y)
SWITCH (get_mark(x, y))
{
CASE 2: tcolor = 0x121288; tchar = '?'; BREAK;
CASE 1: tcolor = 0xd04444; tchar = 'P';
CASE 2: tcolor = 0x10121288; tchar = '?'; BREAK;
CASE 1: tcolor = 0x10d04444; tchar = 'P';
}
IF (get_mark(x,y))
{
EBX = xl + 6 << 16 + yt + 4;
sys_write_text(EBX, tcolor + 0x10000000, #tchar, 1);
sys_write_text(EBX, tcolor, #tchar, 1);
EBX += 0x00010000;
/* Second run - registers are saved */
sys_write_text(EBX, ECX, EDX, ESI);
@@ -122,16 +122,16 @@ void draw_square(int x, y)
{
IF (tval == MINE)
{
tcolor = 0xee1111;
tcolor = 0x10ee1111;
tchar = '*';
}
ELSE
{
tchar = tval + '0';
tcolor = num_colors[tval-1];
tcolor = num_colors[tval-1]+0x10000000;
}
EBX = xl + 7 << 16 + yt + 4;
sys_write_text(EBX, tcolor+0x10000000, #tchar, 1);
sys_write_text(EBX, tcolor, #tchar, 1);
EBX += 0x00010000;
sys_write_text(EBX, ECX, EDX, ESI);
}

View File

@@ -213,18 +213,16 @@ inline fastcall dword sys_put_image(dword EBX, ECX, EDX)
$int 0x40
}
:void sys_put_palette_image(dword inbuf,wh,xy,bits,pal)
inline fastcall void sys_put_palette_image(dword EBX,ECX,EDX,ESI,EDI)
{
$push ebp
EAX = 65;
EBX = inbuf;
ECX = wh;
EDX = xy;
ESI = bits;
EDI = pal;
EBP = 0;
$int 0x40
$pop ebp
}
/*********************************************************
08 = DEFINE BUTTON
ebx [x start]*65536 + [x size]
@@ -1129,7 +1127,7 @@ inline fastcall dword sys_debug_read_char(dword EBX)
}
inline fastcall dword window_move_size(dword EBX,ECX,EDX,ESI){
inline fastcall dword sys_window_move_size(dword EBX,ECX,EDX,ESI){
EAX = 67;
$int 0x40
}

View File

@@ -26,7 +26,7 @@
//? define DEBUG 1
? print "\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ"
? print "\n<> KolibriOS MineSweeper v0.60 <20>"
? print "\n<> KolibriOS MineSweeper v0.61 <20>"
? print "\n<> (C) Leency (leency@mail.ru) 2010-2025 <20>"
? print "\n<> (C) Ivan Poddubny (ivan-yar@bk.ru) 2003,2004 <20>"
? print "\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n"
@@ -79,7 +79,7 @@ byte stop_game = FALSE, // game stopped -
firstmine;
ProcessInfo procinfo;
SystemColors colors;
//SystemColors colors;
/************************************** CODE **************************************/
@@ -460,11 +460,11 @@ void main()
ELSE IF (EAX == 1001) // change mode
{
mode++;
if (mode==4) mode=1;
IF (mode==4) mode=1;
//EAX = mode; EAX++; EAX = EAX%3; EAX++; mode = AL;
new_game();
window_move_size(OLD,OLD,xsize+9,ysize);
sys_window_move_size(OLD,OLD,xsize+9,ysize);
CONTINUE;
}
// ELSE IF (EAX == 1002)