diff --git a/data/Tupfile.lua b/data/Tupfile.lua index de983e0e29..659accd631 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -411,6 +411,7 @@ tup.append_table(img_files, { {"GAMES/FREECELL", PROGS .. "/games/freecell/freecell"}, {"GAMES/GOMOKU", PROGS .. "/games/gomoku/trunk/gomoku"}, {"GAMES/KLAVISHA", PROGS .. "/games/klavisha/trunk/klavisha"}, + {"GAMES/LIGHTS", PROGS .. "/games/sq_game/trunk/SQ_GAME"}, {"GAMES/LINES", PROGS .. "/games/lines/lines"}, {"GAMES/MSQUARE", PROGS .. "/games/MSquare/trunk/MSquare"}, {"GAMES/PIPES", PROGS .. "/games/pipes/pipes"}, @@ -418,7 +419,6 @@ tup.append_table(img_files, { {"GAMES/PONG3", PROGS .. "/games/pong3/trunk/pong3"}, {"GAMES/RSQUARE", PROGS .. "/games/rsquare/trunk/rsquare"}, {"GAMES/SNAKE", PROGS .. "/games/snake/trunk/snake"}, - {"GAMES/SQ_GAME", PROGS .. "/games/sq_game/trunk/SQ_GAME"}, {"GAMES/SUDOKU", PROGS .. "/games/sudoku/trunk/sudoku"}, {"GAMES/SW", PROGS .. "/games/sw/trunk/sw"}, {"GAMES/TANKS", PROGS .. "/games/tanks/trunk/tanks"}, diff --git a/data/common/icons32.png b/data/common/icons32.png index e681127023..686da88690 100644 Binary files a/data/common/icons32.png and b/data/common/icons32.png differ diff --git a/data/common/settings/game_center.ini b/data/common/settings/game_center.ini index 6b68a71ce7..fbcab898be 100644 --- a/data/common/settings/game_center.ini +++ b/data/common/settings/game_center.ini @@ -3,6 +3,20 @@ window_width=750 window_title=KolibriOS Game Center default_icon=35 +[Casual] +2048=/kolibrios/games/2048/2048,53 +Fara=/kolibrios/games/fara/fara,42 +MarbleMatch=/kolibrios/games/MarbleMatch3/MarbleMatch3 +Tetris=/sys/games/tetris,47 +Pipes=/sys/games/pipes,26 +Snake=/sys/games/snake,32 +Xonix=/sys/games/xonix,21 +RedSquare=/sys/games/rsquare +Freecell=/sys/games/freecell,68 +Pong=/sys/games/pong,12 +Pong3=/sys/games/pong3,12 +Arcanii=/kolibrios/games/arcanii,12 + [Arcade] LaserTank=/kolibrios/games/lasertank/lasertank,72 Heliothryx=/kolibrios/games/heliothryx/heliothryx @@ -27,6 +41,11 @@ BabyPainter=/kolibrios/games/BabyPainter,87 Klavisha=/sys/games/klavisha,69 Millioneer=/sys/games/whowtbam +[3D Shooter] +Quake=/kolibrios/games/quake/sdlquake,56 +DOOM1=/kolibrios/games/doom1/doom,43 +; DOOM2=/kolibrios/games/doom2/doom,43 + [Logical] Clicks=/sys/games/clicks,18 Checkers=/sys/games/checkers,20 @@ -37,26 +56,9 @@ Knight=/kolibrios/games/knight,82 15=/sys/games/15,34 Gomoku=/sys/games/gomoku,24 Reversi=/sys/games/reversi -C4=/sys/games/c4 +C4=/sys/games/c4,100 +Lights=/sys/games/lights,99 Square=/sys/games/msquare,25 Memory=/sys/games/mblocks Lines=/sys/games/lines,59 -[Casual] -2048=/kolibrios/games/2048/2048,53 -Fara=/kolibrios/games/fara/fara,42 -MarbleMatch=/kolibrios/games/MarbleMatch3/MarbleMatch3 -Tetris=/sys/games/tetris,47 -Pipes=/sys/games/pipes,26 -Snake=/sys/games/snake,32 -Xonix=/sys/games/xonix,21 -RedSquare=/sys/games/rsquare -Freecell=/sys/games/freecell,68 -Pong=/sys/games/pong,12 -Pong3=/sys/games/pong3,12 -Arcanii=/kolibrios/games/arcanii,12 - -[3D Shooter] -Quake=/kolibrios/games/quake/sdlquake,56 -DOOM1=/kolibrios/games/doom1/doom,43 -; DOOM2=/kolibrios/games/doom2/doom,43 diff --git a/programs/cmm/iconedit/iconedit.c b/programs/cmm/iconedit/iconedit.c index 3cb79c5245..3028eedc2c 100644 --- a/programs/cmm/iconedit/iconedit.c +++ b/programs/cmm/iconedit/iconedit.c @@ -508,14 +508,12 @@ void DrawActiveColor(dword iny) DrawFrame(right_bar.x, outy, CELL, CELL, NULL); DrawBar(right_bar.x+2, outy+2, CELL-4, CELL-4, color1); sprintf(#param, "%A", color1); - EDI = system.color.work; - WriteText(right_bar.x + 30, outy + 3, 0xD0, system.color.work_text, #param+4); + WriteTextWithBg(right_bar.x+30, outy+3, 0xD0, system.color.work_text, #param+4, system.color.work); DrawFrame(right_bar.x+110, outy, CELL, CELL, NULL); DrawBar(right_bar.x+110+2, outy+2, CELL-4, CELL-4, color2); sprintf(#param, "%A", color2); - EDI = system.color.work; - WriteText(right_bar.x+110 + 30, outy + 3, 0xD0, system.color.work_text, #param+4); + WriteTextWithBg(right_bar.x+30+110, outy+3, 0xD0, system.color.work_text, #param+4, system.color.work); DrawCurrentColorGradientByLightness(); } diff --git a/programs/cmm/lib/gui/checkbox.h b/programs/cmm/lib/gui/checkbox.h index fca19b145f..91e44f6cdd 100644 --- a/programs/cmm/lib/gui/checkbox.h +++ b/programs/cmm/lib/gui/checkbox.h @@ -62,8 +62,7 @@ struct checkbox x=_x; y=_y; DefineButton(x-1, y-1, strlen(text)*8 + SIZE + 17, SIZE+2, id+BT_HIDE+BT_NOFRAME, 0); - EDI = system.color.work; - WriteText(x+SIZE+8, SIZE / 2 + y -7, 0xD0, system.color.work_text, text); + WriteTextWithBg(x+SIZE+8, SIZE / 2 + y -7, 0xD0, system.color.work_text, text, system.color.work); DrawRectangle(x, y, SIZE, SIZE, system.color.work_graph); if (checked == 0) { diff --git a/programs/cmm/lib/gui/more_less_box.h b/programs/cmm/lib/gui/more_less_box.h index 6c8d70214e..cc68aca2be 100644 --- a/programs/cmm/lib/gui/more_less_box.h +++ b/programs/cmm/lib/gui/more_less_box.h @@ -53,8 +53,7 @@ DrawCaptButton(VALUE_FIELD_W + x + 1, y, SIZE, SIZE, id_inc, system.color.work_button, system.color.work_button_text, "+"); DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, id_dec, system.color.work_button, system.color.work_button_text, "-"); - EDI = system.color.work; - WriteText(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, system.color.work_text, text); + WriteTextWithBg(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, system.color.work_text, text, system.color.work); DrawRectangle3D(x-1,y-1,VALUE_FIELD_W+SIZE+SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light); } diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index a3694c597b..2b1e36ec6e 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -458,12 +458,14 @@ inline fastcall dword SetWindowLayerBehaviour(EDX, ESI) :dword WriteBufText(dword x,y,byte fontType, dword color, str_offset, buf_offset) { - EAX = 4; - EBX = x<<16+y; - ECX = fontType<<24+color; - EDX = str_offset; EDI = buf_offset; - $int 0x40; + WriteText(x,y, fontType, color, str_offset); +} + +:void WriteTextWithBg(dword x,y,byte fontType, dword color, str_offset, bgcolor) +{ + EDI = bgcolor; + WriteText(x,y, fontType, color, str_offset); } :void WriteNumber(dword x,y,byte fontType, dword color, count, number_or_offset) diff --git a/programs/cmm/liza/settings.c b/programs/cmm/liza/settings.c index 047218c329..a25802cc06 100644 --- a/programs/cmm/liza/settings.c +++ b/programs/cmm/liza/settings.c @@ -99,8 +99,9 @@ void DrawOptionsWindow() WriteText(ELEM_X, y.inc(20), 0x81, system.color.work_text, "Network settings"); automatic.draw(ELEM_X, y.inc(65)); - EDI = system.color.work; - for (i=0; i<4; i++) WriteText(ELEM_X+40, i*35+POP_server_box.top + 3, 0xD0, system.color.work_text, text1[i]); + for (i=0; i<4; i++) { + WriteTextWithBg(ELEM_X+40, i*35+POP_server_box.top + 3, 0xD0, system.color.work_text, text1[i], system.color.work); + } DrawEditBox(#POP_server_box); DrawEditBox(#POP_server_port_box); DrawEditBox(#SMTP_server_box); diff --git a/programs/cmm/sysmon/sysmon.c b/programs/cmm/sysmon/sysmon.c index 5a14dcbb46..1793970694 100644 --- a/programs/cmm/sysmon/sysmon.c +++ b/programs/cmm/sysmon/sysmon.c @@ -138,15 +138,19 @@ void main() default: MonitorCpu(); + //MonitorRam(); ram.draw_progress( GetFreeRAM()*ram.w/GetTotalRAM(), GetTotalRAM()-GetFreeRAM()/1024, GetFreeRAM()/1024, "M" ); + DrawBar(ram.x+ram.w-96, ram.y-25, 96, 20, system.color.work); + sprintf(#param, "%i KiB", GetTotalRAM()-GetFreeRAM()); + WriteText(ram.x+ram.w-calc(strlen(#param)*8), ram.y-25, 0x90, system.color.work_text, #param); - dir_size.get("/rd/1"); - + //MonitorRd(); + dir_size.get("/rd/1"); dir_size.bytes += dir_size.files/2 + 32 * 512; //file attr size + FAT table size dir_size.bytes /= 1024; //convert to KiB dir_size.bytes = 1440 - dir_size.bytes; @@ -157,6 +161,7 @@ void main() "K" ); + //MonitorTmp(); if (tmp_size[0]) { dir_size.get("/tmp0/1"); dir_size.bytes += dir_size.files/2 + 32 * 512; //file attr size + FAT table size diff --git a/programs/games/snake/trunk/snake.ini b/programs/games/snake/trunk/snake.ini index d147abe0c8..12819c45f7 100644 --- a/programs/games/snake/trunk/snake.ini +++ b/programs/games/snake/trunk/snake.ini @@ -61,7 +61,7 @@ Decorations = 3 ; 10 = corners_outer ; 11 = corners_crosses Background_color = 0,0,0 -Decorations_color = 170,170,0 +Decorations_color = 35,35,0 Snake_color = 17,17,255 Snake_head_color = 107,107,255 ; by default Snake_head_color is equal to Snake_color, so the snake has no head diff --git a/programs/games/sq_game/trunk/SQ_GAME.ASM b/programs/games/sq_game/trunk/SQ_GAME.ASM index e0ddaf0d34..148246ee28 100644 --- a/programs/games/sq_game/trunk/SQ_GAME.ASM +++ b/programs/games/sq_game/trunk/SQ_GAME.ASM @@ -2,18 +2,21 @@ ; Author: Alexei Ershov aka ealex ; E-mail: e-al[at]yandex[dot]ru ; Fidonet: 2:469/335.38 +; slightly updated by leency and renamed to Lights +; https://en.wikipedia.org/wiki/Lights_Out_(game) ; slightly optimized by diamond ; english translation by diamond (two strings in end of source) - BtnSize equ 32 ; размер кнопки - BtnSpace equ 10 ; промежуток между кнопками + BtnSize equ 36 ; размер кнопки + BtnSpace equ 0 ; промежуток между кнопками NofBtn equ 4 ; размер поля (3-15) Color1 equ 0xcc0000 Color2 equ 0x00cc00 FieldSize = (BtnSize+BtnSpace)*NofBtn + BtnSpace*3 center = FieldSize / 2 + margin = 20 use32 ; включить 32-битный режим ассемблера @@ -28,7 +31,7 @@ dd 0x0 ; адрес буфера для параметров (не используется) dd 0x0 ; зарезервировано -include 'macros.inc' ; макросы облегчают жизнь ассемблерщиков! +include '../../../macros.inc' ; макросы облегчают жизнь ассемблерщиков! START: @@ -130,16 +133,16 @@ button: Draw_Window: mcall 12, 1 - mcall 0, 200*65536+FieldSize,\ - 200*65536+FieldSize+20+20+20,\ - 0x14AABBCC, 0x805080D0, header + mcall 0, 200*65536+FieldSize+margin*2,\ + 200*65536+FieldSize+28+margin*3,\ + 0x14DDD7CF, 0x805080D0, header - mcall 8, BtnSpace*2*65536 + 83,\ - (FieldSize+BtnSpace+20)*65536+ 15, 2 - mcall 4, (BtnSpace*2+3)*65536+(BtnSize+BtnSpace)*NofBtn+BtnSpace*4+20+4,\ - 0x10DDEEFF, strNew, strNew_e - strNew - mcall 4, (center - 25) * 65536 + 30, 0, strMovs, strMovs_e - strMovs - mcall 47, 4*65536+1, moves, (center + 2 ) * 65536 + 30, 0 + mcall 8, (BtnSpace*2+margin)*65536 + 83,\ + (FieldSize+BtnSpace+margin*2+10)*65536+ 22, 2 + mcall 4, (BtnSpace*2+3+margin)*65536+(FieldSize+BtnSpace+margin*2)+14,\ + 0x90DDEEFF, strNew + mcall 4, (center - 25+margin) * 65536 + 30, 0x80000000, strMovs + mcall 47, 4*65536+1, moves, (center + 2+margin ) * 65536 + 30, 0 @@ -155,7 +158,7 @@ buttons: ; test ah, ah ; если ah = 0, начинаем новый ряд jnz @f add ecx, (BtnSize+BtnSpace)*65536 - mov ebx, BtnSpace*2*65536+BtnSize + mov ebx, (BtnSpace*2+margin)*65536+BtnSize+1 @@: mov esi, Color1 ; байт по адресу cmp byte [field-NofBtn+edx], 0 ; field-NofBtn+номер_кнопки @@ -223,20 +226,14 @@ field db NofBtn * NofBtn dup(0) moves dd 0 generator dd 0 +header db 'Lights',0 + if lang eq ru -header db 'CQ game',0 -header_e: -strMovs db 'ХОД' ; 'ХОД' -strMovs_e: -strNew db 'Новая игра' ; 'Новая игра' -strNew_e: +strMovs db 'ХОД',0 +strNew db 'Новая игра',0 else -header db 'CQ game',0 -header_e: -strMovs db 'MOVE' -strMovs_e: -strNew db ' New game' -strNew_e: +strMovs db 'MOVE',0 +strNew db ' New game',0 end if diff --git a/programs/games/sudoku/trunk/build_en.bat b/programs/games/sudoku/trunk/build_en.bat new file mode 100644 index 0000000000..edaf63e608 --- /dev/null +++ b/programs/games/sudoku/trunk/build_en.bat @@ -0,0 +1,5 @@ +@erase lang.inc +@echo lang fix en >lang.inc +@fasm sudoku.asm sudoku +@erase lang.inc +@pause \ No newline at end of file diff --git a/programs/games/sudoku/trunk/sudoku.asm b/programs/games/sudoku/trunk/sudoku.asm index 519cfe2090..885d5b69a0 100644 --- a/programs/games/sudoku/trunk/sudoku.asm +++ b/programs/games/sudoku/trunk/sudoku.asm @@ -249,7 +249,7 @@ still: bt [flags],9 jnc @f add esi,40 -@@: mcall 67,100,100,(24*9+12), +@@: mcall 67,-1,-1,(24*9+12), jmp still key: mcall 2