appearance: WiP of adding screensaver tab

various small changes

git-svn-id: svn://kolibrios.org@9453 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-12-21 17:22:15 +00:00
parent f1469998c7
commit bcdd96a753
13 changed files with 117 additions and 104 deletions

View File

@ -440,9 +440,6 @@ tup.append_table(img_files, {
{"3D/RAY", PROGS .. "/demos/ray/ray"}, {"3D/RAY", PROGS .. "/demos/ray/ray"},
{"3D/VIEW3DS", PROGS .. "/demos/view3ds/view3ds"}, {"3D/VIEW3DS", PROGS .. "/demos/view3ds/view3ds"},
{"DEMOS/BCDCLK", PROGS .. "/demos/bcdclk/trunk/bcdclk"}, {"DEMOS/BCDCLK", PROGS .. "/demos/bcdclk/trunk/bcdclk"},
{"DEMOS/CIRCLE", PROGS .. "/develop/examples/circle/trunk/circle"},
{"DEMOS/COLORREF", PROGS .. "/demos/colorref/trunk/colorref"},
{"DEMOS/CSLIDE", PROGS .. "/demos/cslide/trunk/cslide"},
{"DEMOS/EYES", PROGS .. "/demos/eyes/trunk/eyes"}, {"DEMOS/EYES", PROGS .. "/demos/eyes/trunk/eyes"},
{"DEMOS/FIREWORK", PROGS .. "/demos/firework/trunk/firework"}, {"DEMOS/FIREWORK", PROGS .. "/demos/firework/trunk/firework"},
{"DEMOS/MOVBACK", PROGS .. "/demos/movback/trunk/movback"}, {"DEMOS/MOVBACK", PROGS .. "/demos/movback/trunk/movback"},
@ -465,7 +462,10 @@ tup.append_table(img_files, {
{"DEVELOP/KEYASCII", PROGS .. "/develop/keyascii/trunk/keyascii"}, {"DEVELOP/KEYASCII", PROGS .. "/develop/keyascii/trunk/keyascii"},
{"DEVELOP/MTDBG", PROGS .. "/develop/mtdbg/mtdbg"}, {"DEVELOP/MTDBG", PROGS .. "/develop/mtdbg/mtdbg"},
{"DEVELOP/SCANCODE", PROGS .. "/develop/scancode/trunk/scancode"}, {"DEVELOP/SCANCODE", PROGS .. "/develop/scancode/trunk/scancode"},
{"DEVELOP/EXAMPLES/CIRCLE", PROGS .. "/develop/examples/circle/trunk/circle"},
{"DEVELOP/EXAMPLES/COLORREF", PROGS .. "/demos/colorref/trunk/colorref"},
{"DEVELOP/EXAMPLES/CONGET", PROGS .. "/develop/libraries/console_coff/examples/test_gets"}, {"DEVELOP/EXAMPLES/CONGET", PROGS .. "/develop/libraries/console_coff/examples/test_gets"},
{"DEVELOP/EXAMPLES/CSLIDE", PROGS .. "/demos/cslide/trunk/cslide"},
{"DEVELOP/EXAMPLES/THREAD", PROGS .. "/develop/examples/thread/trunk/thread"}, {"DEVELOP/EXAMPLES/THREAD", PROGS .. "/develop/examples/thread/trunk/thread"},
{"DEVELOP/EXAMPLES/USE_MB", PROGS .. "/demos/use_mb/use_mb"}, {"DEVELOP/EXAMPLES/USE_MB", PROGS .. "/demos/use_mb/use_mb"},
{"File Managers/KFAR", PROGS .. "/fs/kfar/trunk/kfar"}, {"File Managers/KFAR", PROGS .. "/fs/kfar/trunk/kfar"},

View File

@ -17,6 +17,7 @@ PCI=on
[screensaver] [screensaver]
timeout=10 ;in minutes timeout=10 ;in minutes
program=/sys/demos/spiral program=/sys/demos/spiral
available=3d/crownscr;demos/web;demos/zeroline;demos/spiral
[style] [style]
buttons_gradient=1 buttons_gradient=1

View File

@ -15,9 +15,7 @@
53 Run |run 53 Run |run
04 Shut down |end 04 Shut down |end
#1 **** DEMOS #1 **** DEMOS
16 Circle |demos/circle
16 Fractal |demos/tinyfrac 16 Fractal |demos/tinyfrac
16 Color demo |demos/colorref
16 Eyes |demos/eyes 16 Eyes |demos/eyes
16 Tube |demos/tube 16 Tube |demos/tube
16 Plasma |demos/plasma 16 Plasma |demos/plasma
@ -50,6 +48,7 @@
11 Fplay Video * |/kolibrios/media/fplay 11 Fplay Video * |/kolibrios/media/fplay
#5 **** DEV #5 **** DEV
54 Flat Assembler |develop/fasm 54 Flat Assembler |develop/fasm
03 Example.asm |example.asm
49 Debugger |develop/mtdbg 49 Debugger |develop/mtdbg
13 Debug Board |develop/board 13 Debug Board |develop/board
09 KPack Archiver |kpack 09 KPack Archiver |kpack

View File

@ -15,9 +15,7 @@
53 ‡ ¯ã᪠¯à®£à ¬¬ë |run 53 ‡ ¯ã᪠¯à®£à ¬¬ë |run
04 ‡ ¢¥à襭¨¥ à ¡®âë |end 04 ‡ ¢¥à襭¨¥ à ¡®âë |end
#1 **** 2D „¥¬ª¨ #1 **** 2D „¥¬ª¨
16 Šà㦮ª |demos/circle
16 ”ࠪ⠫ Œ ­¤¥«ì¡à®â  |demos/tinyfrac 16 ”ࠪ⠫ Œ ­¤¥«ì¡à®â  |demos/tinyfrac
16 –¢¥â  |demos/colorref
16 ƒ« §  |demos/eyes 16 ƒ« §  |demos/eyes
16 ’àã¡  |demos/tube 16 ’àã¡  |demos/tube
16 Plasma |demos/plasma 16 Plasma |demos/plasma
@ -50,6 +48,7 @@
11 ‚¨¤¥®¯«¥¥à Fplay * |/kolibrios/media/fplay 11 ‚¨¤¥®¯«¥¥à Fplay * |/kolibrios/media/fplay
#5 **** <20> §à ¡®âª  #5 **** <20> §à ¡®âª 
54 Flat Assembler |develop/fasm 54 Flat Assembler |develop/fasm
03 Example.asm |example.asm
09 “¯ ª®¢é¨ª KPack |kpack 09 “¯ ª®¢é¨ª KPack |kpack
49 Žâ« ¤ç¨ª |develop/mtdbg 49 Žâ« ¤ç¨ª |develop/mtdbg
13 „®áª  ®â« ¤ª¨ |develop/board 13 „®áª  ®â« ¤ª¨ |develop/board

View File

@ -1,7 +1,6 @@
#define MEMSIZE 4096*20 #define MEMSIZE 4096*20
#include "..\lib\strings.h" #include "..\lib\strings.h"
#include "..\lib\mem.h" #include "..\lib\mem.h"
#include "..\lib\io.h"
#include "..\lib\gui.h" #include "..\lib\gui.h"
#include "..\lib\obj\proc_lib.h" #include "..\lib\obj\proc_lib.h"
#include "..\lib\patterns\simple_open_dialog.h" #include "..\lib\patterns\simple_open_dialog.h"

View File

@ -14,6 +14,7 @@
#include "../lib/patterns/select_list.h" #include "../lib/patterns/select_list.h"
#include "../lib/patterns/simple_open_dialog.h" #include "../lib/patterns/simple_open_dialog.h"
#include "../lib/patterns/restart_process.h"
#include "ui_elements_preview.h" #include "ui_elements_preview.h"
@ -25,35 +26,39 @@
#ifdef LANG_RUS #ifdef LANG_RUS
?define WINDOW_HEADER "<EFBFBD> áâனª¨ ®ä®à¬«¥­¨ï" ?define WINDOW_HEADER "<EFBFBD> áâனª¨ ®ä®à¬«¥­¨ï"
?define T_SKINS " ‘â¨«ì ®ª®­"
?define T_WALLPAPERS " Ž¡®¨"
?define T_SELECT_FOLDER "‚ë¡à âì ¯ ¯ªã" ?define T_SELECT_FOLDER "‚ë¡à âì ¯ ¯ªã"
?define MENU_LIST "Žâªàëâì ä ©« |Enter\n“¤ «¨âì ä ©« |Del" ?define MENU_LIST "Žâªàëâì ä ©« |Enter\n“¤ «¨âì ä ©« |Del"
?define T_PICTURE_MODE " <20>®«®¦¥­¨¥ ª à⨭ª¨ " ?define T_PICTURE_MODE " <20>®«®¦¥­¨¥ ª à⨭ª¨ "
?define T_CHECKBOX_STRETCH "<EFBFBD> áâï­ãâì" ?define T_CHECKBOX_STRETCH "<EFBFBD> áâï­ãâì"
?define T_CHECKBOX_TILED "‡ ¬®áâ¨âì" ?define T_CHECKBOX_TILED "‡ ¬®áâ¨âì"
?define T_UPDATE_DOCK "Ž¡­®¢«ïâì Dock-¯ ­¥«ì" ?define T_UPDATE_DOCK "Ž¡­®¢«ïâì Dock-¯ ­¥«ì"
char t_skins[] = " ‘â¨«ì ®ª®­";
char t_wallpapers[] = " Ž¡®¨";
char t_screensaver[] = " ‘ªà¨­á¥©¢¥à";
#else #else
?define WINDOW_HEADER "Appearance" ?define WINDOW_HEADER "Appearance"
?define T_SKINS " Skins"
?define T_WALLPAPERS " Wallpapers"
?define T_SELECT_FOLDER "Select folder" ?define T_SELECT_FOLDER "Select folder"
?define MENU_LIST "Open file |Enter\nDelete file |Del" ?define MENU_LIST "Open file |Enter\nDelete file |Del"
?define T_PICTURE_MODE " Picture Mode " ?define T_PICTURE_MODE " Picture Mode "
?define T_CHECKBOX_STRETCH "Stretch" ?define T_CHECKBOX_STRETCH "Stretch"
?define T_CHECKBOX_TILED "Tiled" ?define T_CHECKBOX_TILED "Tiled"
?define T_UPDATE_DOCK "Update Dock" ?define T_UPDATE_DOCK "Update Dock"
char t_skins[] = " Skins";
char t_wallpapers[] = " Wallpapers";
char t_screensaver[] = " Screensaver";
#endif #endif
#define PANEL_H 40 #define WIN_W 621
#define PANEL_H 58
#define LP 10 //LIST_PADDING #define LP 10 //LIST_PADDING
char skins_folder_path[4096]; char skins_folder_path[4096];
char wallp_folder_path[4096]; char wallp_folder_path[4096];
signed int active_skin=-1, active_wallpaper=-1; signed int active_skin=-1, active_wallpaper=-1, active_screensaver=-1;
enum { enum {
BASE_TAB_BUTTON_ID=2, BASE_TAB_BUTTON_ID=3,
BTN_SELECT_WALLP_FOLDER=10 }; BTN_SELECT_WALLP_FOLDER=10,
BTN_TEST_SCREENSAVER };
char folder_path[4096]; char folder_path[4096];
char cur_file_path[4096]; char cur_file_path[4096];
@ -61,14 +66,17 @@ char cur_skin_path[4096];
char temp_filename[4096]; char temp_filename[4096];
int files_mas[400]; int files_mas[400];
_ini ini = { "/sys/settings/system.ini", "style" };
int cur; int cur;
proc_info Form; proc_info Form;
block skp; block skp;
enum {SKINS, WALLPAPERS}; enum {SKINS, WALLPAPERS, SCREENSAVERS};
_tabs tabs = { LP, LP, NULL, BASE_TAB_BUTTON_ID }; _tabs tabs = { -sizeof(t_skins)-sizeof(t_wallpapers)-sizeof(t_screensaver)-3*8+WIN_W
- TAB_PADDING / 2, LP, NULL, BASE_TAB_BUTTON_ID };
checkbox update_docky = { T_UPDATE_DOCK, false }; checkbox update_docky = { T_UPDATE_DOCK, false };
@ -86,11 +94,11 @@ checkbox optionbox_tiled = { T_CHECKBOX_TILED, false };
void GetRealFolderPathes() void GetRealFolderPathes()
{ {
char real_skin_path[4096]; char real_kolibrios_path[4096];
SetCurDir("/kolibrios"); SetCurDir("/kolibrios");
GetCurDir(#real_skin_path, sizeof(real_skin_path)); GetCurDir(#real_kolibrios_path, sizeof(real_kolibrios_path));
sprintf(#skins_folder_path, "%s/res/skins", #real_skin_path); miniprintf(#skins_folder_path, "%s/res/skins", #real_kolibrios_path);
sprintf(#wallp_folder_path, "%s/res/wallpapers", #real_skin_path); miniprintf(#wallp_folder_path, "%s/res/wallpapers", #real_kolibrios_path);
} }
void main() void main()
@ -105,8 +113,9 @@ void main()
o_dialog.type = 2; //select folder o_dialog.type = 2; //select folder
OpenDialog_init stdcall (#o_dialog); OpenDialog_init stdcall (#o_dialog);
tabs.add(T_SKINS, #EventTabSkinsClick); tabs.add(#t_skins, #EventTabSkinsClick);
tabs.add(T_WALLPAPERS, #EventTabWallpappersClick); tabs.add(#t_wallpapers, #EventTabWallpappersClick);
tabs.add(#t_screensaver, #EventTabScreensaverClick);
tabs.draw_active_tab(); tabs.draw_active_tab();
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
@ -145,8 +154,14 @@ void main()
GetKeys(); GetKeys();
if (select_list.ProcessKey(key_scancode)) EventApply(); if (select_list.ProcessKey(key_scancode)) EventApply();
if (key_scancode==SCAN_CODE_ENTER) EventOpenFile(); if (key_scancode==SCAN_CODE_ENTER) EventOpenFile();
if (key_scancode==SCAN_CODE_TAB) tabs.click(tabs.active_tab ^ 1);
if (key_scancode==SCAN_CODE_DEL) EventDeleteFile(); if (key_scancode==SCAN_CODE_DEL) EventDeleteFile();
if (key_scancode==SCAN_CODE_TAB) {
id = tabs.active_tab+1;
if(id==3)id=0;
tabs.click(id + tabs.base_id);
draw_window();
break;
}
if (! edit_cmm.flags & ed_focus) && (! edit_st.flags & ed_focus) if (! edit_cmm.flags & ed_focus) && (! edit_st.flags & ed_focus)
for (id=select_list.cur_y+1; id<select_list.count; id++) for (id=select_list.cur_y+1; id<select_list.count; id++)
@ -177,7 +192,7 @@ void main()
void draw_window() void draw_window()
{ {
sc.get(); sc.get();
DefineAndDrawWindow(screen.width-600/2,80,630,504+skin_height,0x34,sc.work,WINDOW_HEADER,0); DefineAndDrawWindow(screen.width-600/2,80,WIN_W+9,504+skin_height,0x34,sc.work,WINDOW_HEADER,0);
GetProcessInfo(#Form, SelfInfo); GetProcessInfo(#Form, SelfInfo);
IF (Form.status_window&ROLLED_UP) return; IF (Form.status_window&ROLLED_UP) return;
DrawWindowContent(); DrawWindowContent();
@ -186,50 +201,51 @@ void draw_window()
void DrawWindowContent() void DrawWindowContent()
{ {
int id; int id;
int list_w;
sc.get(); sc.get();
if (tabs.active_tab == SKINS) list_w=250; else list_w=350; //tabs.w = Form.cwidth-LP-LP;
tabs.w = Form.cwidth-LP-LP;
tabs.draw(); tabs.draw();
draw_icon_16w(tabs.x + TAB_PADDING, 15, 17); draw_icon_16w(tabs.x + TAB_PADDING, 15, 17);
draw_icon_16w(strlen(T_SKINS)*8 + tabs.x + TAB_PADDING + TAB_PADDING, 15, 6); draw_icon_16w(sizeof(t_skins)-1*8 + TAB_PADDING + TAB_PADDING + tabs.x, 15, 6);
draw_icon_16w(sizeof(t_wallpapers)+sizeof(t_skins)-2*8 + TAB_PADDING + TAB_PADDING + TAB_PADDING + tabs.x, 15, 61);
id = select_list.cur_y; id = select_list.cur_y;
#define LIST_W 280
SelectList_Init( SelectList_Init(
tabs.x+TAB_PADDING, LP + TAB_PADDING,
tabs.y+TAB_HEIGHT+TAB_PADDING, PANEL_H,
list_w, LIST_W,
Form.cheight-LP-LP - TAB_PADDING - TAB_PADDING - TAB_HEIGHT Form.cheight-LP-LP - TAB_PADDING - PANEL_H
); );
select_list.cur_y = id; select_list.cur_y = id;
skp.set_size( skp.set_size(
select_list.x + select_list.w + TAB_PADDING + scroll1.size_x + 20, LP + TAB_PADDING + LIST_W + TAB_PADDING + 30,
select_list.y + 30 + 50, PANEL_H,
list_w, WIN_W - 400,
230 //select_list.h - 50 - 50 230 //select_list.h - 50 - 50
); );
SelectList_Draw(); SelectList_Draw();
SelectList_DrawBorder(); SelectList_DrawBorder();
//DrawWideRectangle(0, 0, Form.cwidth, Form.cheight, LP, sc.work);
if (tabs.active_tab == SKINS) if (tabs.active_tab == SKINS)
{ {
update_docky.draw(skp.x, select_list.y+15); DrawFrame(skp.x, PANEL_H+5, skp.w, skp.h, " Components Preview ");
DrawFrame(skp.x, skp.y, skp.w, skp.h, " Components Preview "); DrawUiElementsPreview(skp.x+20, PANEL_H+5, skp.h);
DrawUiElementsPreview(skp.x+20, skp.y, skp.h); if (CheckProcessExists("@DOCKY")) update_docky.draw(skp.x, PANEL_H+250);
} }
if (tabs.active_tab == WALLPAPERS) if (tabs.active_tab == WALLPAPERS)
{ {
skp.x -= TAB_PADDING + 3; DrawFrame(skp.x, PANEL_H+5, 180, 80, T_PICTURE_MODE);
DrawStandartCaptButton(skp.x, select_list.y, BTN_SELECT_WALLP_FOLDER, T_SELECT_FOLDER); optionbox_stretch.draw(skp.x+14, PANEL_H+25);
DrawFrame(skp.x, select_list.y+50, 180, 80, T_PICTURE_MODE); optionbox_tiled.draw(skp.x+14, PANEL_H+52);
optionbox_stretch.draw(skp.x+14, select_list.y+70); DrawStandartCaptButton(skp.x, PANEL_H+100, BTN_SELECT_WALLP_FOLDER, T_SELECT_FOLDER);
optionbox_tiled.draw(skp.x+14, select_list.y+97); }
if (tabs.active_tab == SCREENSAVERS)
{
DrawStandartCaptButton(skp.x, PANEL_H, BTN_TEST_SCREENSAVER, "Test");
} }
} }
@ -332,6 +348,12 @@ void EventTabWallpappersClick()
ActivateTab(active_wallpaper); ActivateTab(active_wallpaper);
} }
void EventTabScreensaverClick()
{
//strcpy(#folder_path, #wallp_folder_path);
ActivateTab(active_screensaver);
}
void EventDeleteFile() void EventDeleteFile()
{ {
io.del(#cur_file_path); io.del(#cur_file_path);
@ -342,7 +364,8 @@ void EventDeleteFile()
void EventSetNewCurrent() void EventSetNewCurrent()
{ {
cur = select_list.cur_y; cur = select_list.cur_y;
sprintf(#cur_file_path,"%s/%s",#folder_path,io.dir.position(files_mas[cur])); miniprintf(#cur_file_path,"%s/",#folder_path);
strcat(#cur_file_path, io.dir.position(files_mas[cur]));
} }
void EventSelectWallpFolder() void EventSelectWallpFolder()
@ -368,7 +391,6 @@ void EventSetWallpMode_Tiled()
EventApply(); EventApply();
} }
#include "..\lib\patterns\restart_process.h"
void EventApply() void EventApply()
{ {
char kivpath[4096+10]; char kivpath[4096+10];
@ -384,9 +406,8 @@ void EventApply()
if (tabs.active_tab==WALLPAPERS) if (tabs.active_tab==WALLPAPERS)
{ {
SelectList_Draw(); SelectList_Draw();
if (optionbox_stretch.checked) strcpy(#kivpath, "\\S__"); if (optionbox_stretch.checked) miniprintf(#kivpath, "\\S__%s", #cur_file_path);
if (optionbox_tiled.checked) strcpy(#kivpath, "\\T__"); if (optionbox_tiled.checked) miniprintf(#kivpath, "\\T__%s", #cur_file_path);
strcat(#kivpath, #cur_file_path);
RunProgram("/sys/media/kiv", #kivpath); RunProgram("/sys/media/kiv", #kivpath);
} }
} }
@ -406,7 +427,6 @@ void EventOpenFile()
if (tabs.active_tab==WALLPAPERS) RunProgram("/sys/media/kiv", #cur_file_path); if (tabs.active_tab==WALLPAPERS) RunProgram("/sys/media/kiv", #cur_file_path);
} }
_ini ini = { "/sys/settings/system.ini", "style" };
void EventExit() void EventExit()
{ {
if (cur_skin_path) ini.SetString("skin", #cur_skin_path, strlen(#cur_skin_path)); if (cur_skin_path) ini.SetString("skin", #cur_skin_path, strlen(#cur_skin_path));

View File

@ -11,8 +11,7 @@ edit_box edit_st = {180,NULL,NULL,0xffffff,0x94AECE,0xFFFfff,0xffffff,
void DrawUiElementsPreview(dword x,y,h) void DrawUiElementsPreview(dword x,y,h)
{ {
incn y2; incn y2;
y2.n = y; spinbox1.draw(x, y2.set(y+30));
spinbox1.draw(x, y2.inc(30));
WriteText(x, y2.inc(30), 0x90, sc.work_text, "C-- Edit"); WriteText(x, y2.inc(30), 0x90, sc.work_text, "C-- Edit");
DrawEditBoxPos(x, y2.inc(20), #edit_cmm); DrawEditBoxPos(x, y2.inc(20), #edit_cmm);
WriteText(x, y2.inc(35), 0x90, sc.work_text, "Strandard Edit"); WriteText(x, y2.inc(35), 0x90, sc.work_text, "Strandard Edit");

View File

@ -1,6 +1,5 @@
#define MEMSIZE 4096*10 #define MEMSIZE 1024*40
#include "../lib/io.h"
#include "../lib/list_box.h" #include "../lib/list_box.h"
#include "../lib/gui.h" #include "../lib/gui.h"
#include "../lib/fs.h" #include "../lib/fs.h"

View File

@ -1,6 +1,5 @@
#define MEMSIZE 4096*10 #define MEMSIZE 1024*40
#include "../lib/io.h"
#include "../lib/window.h" #include "../lib/window.h"
#include "../lib/timers.h" #include "../lib/timers.h"

View File

@ -11,9 +11,9 @@
int base_id; int base_id;
int active_tab; int active_tab;
char names[640];
int count; int count;
dword events[10]; dword events[10];
dword names[10];
int click(); int click();
void draw(); void draw();
@ -33,7 +33,7 @@
} }
for (i=0; i<count; i++) { for (i=0; i<count; i++) {
xx += draw_button(xx + TAB_PADDING, i, i*NAME_SIZE + #names) + TAB_PADDING; xx += draw_button(xx + TAB_PADDING, i, names[i]) + TAB_PADDING;
} }
} }
@ -44,7 +44,7 @@
:void _tabs::add(dword text, event) :void _tabs::add(dword text, event)
{ {
strcpy(count*NAME_SIZE + #names, text); names[count] = text;
events[count] = event; events[count] = event;
count++; count++;
} }

View File

@ -1,6 +1,5 @@
#define MEMSIZE 1024*160 #define MEMSIZE 1024*160
#include "../lib/io.h"
#include "../lib/gui.h" #include "../lib/gui.h"
#include "../lib/copyf.h" #include "../lib/copyf.h"

View File

@ -8,7 +8,6 @@
#include "../lib/gui.h" #include "../lib/gui.h"
#include "../lib/list_box.h" #include "../lib/list_box.h"
#include "../lib/io.h"
#include "../lib/collection.h" #include "../lib/collection.h"
#include "../lib/patterns/restart_process.h" #include "../lib/patterns/restart_process.h"

View File

@ -3,7 +3,7 @@
// autobuild does not create lang.h, but defines LANG_{RUS,ENG} directly // autobuild does not create lang.h, but defines LANG_{RUS,ENG} directly
#include "lang.h" #include "lang.h"
#endif #endif
#include "system/kolibri.h" #include "system/kolibri.h"
#include "system/stdlib.h" #include "system/stdlib.h"
#include "system/string.h" #include "system/string.h"
@ -33,7 +33,7 @@ int main_tecla, hay_tecla;
int SSCS = 0; int SSCS = 0;
int debug=0, scanl=0; int debug=0, scanl=0;
int frame_counter; int frame_counter;
int target_cycle; int target_cycle;
Z80Regs spectrumZ80; Z80Regs spectrumZ80;
@ -238,32 +238,32 @@ file.p21 = filename;
kol_file_70(&file); kol_file_70(&file);
regs->I = buffer[ 0]; regs->I = buffer[ 0];
regs->HLs.B.l = buffer[ 1]; regs->HLs.B.l = buffer[ 1];
regs->HLs.B.h = buffer[ 2]; regs->HLs.B.h = buffer[ 2];
regs->DEs.B.l = buffer[ 3]; regs->DEs.B.l = buffer[ 3];
regs->DEs.B.h = buffer[ 4]; regs->DEs.B.h = buffer[ 4];
regs->BCs.B.l = buffer[ 5]; regs->BCs.B.l = buffer[ 5];
regs->BCs.B.h = buffer[ 6]; regs->BCs.B.h = buffer[ 6];
regs->AFs.B.l = buffer[ 7]; regs->AFs.B.l = buffer[ 7];
regs->AFs.B.h = buffer[ 8]; regs->AFs.B.h = buffer[ 8];
regs->HL.B.l = buffer[ 9]; regs->HL.B.l = buffer[ 9];
regs->HL.B.h = buffer[10]; regs->HL.B.h = buffer[10];
regs->DE.B.l = buffer[11]; regs->DE.B.l = buffer[11];
regs->DE.B.h = buffer[12]; regs->DE.B.h = buffer[12];
regs->BC.B.l = buffer[13]; regs->BC.B.l = buffer[13];
regs->BC.B.h = buffer[14]; regs->BC.B.h = buffer[14];
regs->IY.B.l = buffer[15]; regs->IY.B.l = buffer[15];
regs->IY.B.h = buffer[16]; regs->IY.B.h = buffer[16];
regs->IX.B.l = buffer[17]; regs->IX.B.l = buffer[17];
regs->IX.B.h = buffer[18]; regs->IX.B.h = buffer[18];
regs->IFF1 = regs->IFF2 = (buffer[19]&0x04) >>2; regs->IFF1 = regs->IFF2 = (buffer[19]&0x04) >>2;
regs->R.W = buffer[20]; regs->R.W = buffer[20];
regs->AF.B.l = buffer[21]; regs->AF.B.l = buffer[21];
regs->AF.B.h = buffer[22]; regs->AF.B.h = buffer[22];
regs->SP.B.l =buffer[23]; regs->SP.B.l =buffer[23];
regs->SP.B.h =buffer[24]; regs->SP.B.h =buffer[24];
regs->IM = buffer[25]; regs->IM = buffer[25];
regs->BorderColor = buffer[26]; regs->BorderColor = buffer[26];
file.p00 = 0; file.p00 = 0;
@ -276,9 +276,9 @@ file.p21 = filename;
kol_file_70(&file); kol_file_70(&file);
regs->PC.B.l = Z80MemRead(regs->SP.W, regs); regs->PC.B.l = Z80MemRead(regs->SP.W, regs);
regs->SP.W++; regs->SP.W++;
regs->PC.B.h = Z80MemRead(regs->SP.W, regs); regs->PC.B.h = Z80MemRead(regs->SP.W, regs);
regs->SP.W++; regs->SP.W++;
} }
@ -316,10 +316,10 @@ buffer[20] = regs->R.W & 0xFF;
buffer[21] = regs->AF.B.l; buffer[21] = regs->AF.B.l;
buffer[22] = regs->AF.B.h; buffer[22] = regs->AF.B.h;
sptmpl = Z80MemRead( regs->SP.W-1, regs ); sptmpl = Z80MemRead( regs->SP.W-1, regs );
sptmph = Z80MemRead( regs->SP.W-2, regs ); sptmph = Z80MemRead( regs->SP.W-2, regs );
Z80MemWrite( --(regs->SP.W), regs->PC.B.h, regs); Z80MemWrite( --(regs->SP.W), regs->PC.B.h, regs);
Z80MemWrite( --(regs->SP.W), regs->PC.B.l, regs); Z80MemWrite( --(regs->SP.W), regs->PC.B.l, regs);
buffer[23] = regs->SP.B.l; buffer[23] = regs->SP.B.l;
@ -347,9 +347,9 @@ file.p21 = filename;
kol_file_70(&file); kol_file_70(&file);
regs->SP.W += 2; regs->SP.W += 2;
Z80MemWrite( regs->SP.W-1, sptmpl, regs ); Z80MemWrite( regs->SP.W-1, sptmpl, regs );
Z80MemWrite( regs->SP.W-2, sptmph, regs ); Z80MemWrite( regs->SP.W-2, sptmph, regs );
} }
@ -379,7 +379,7 @@ kol_file_70(&file);
void wnd_draw() void wnd_draw()
{ {
kol_paint_start(); kol_paint_start();
kol_wnd_define( (screen_w-540)/2, (screen_h-440)/2, 540, 440, 0x34b0b0b0, 0x34b0b0b0, WND_CAPTION); kol_wnd_define( (screen_w-540)/2, (screen_h-440)/2, 540, 440, 0x74b0b0b0, 0x74b0b0b0, WND_CAPTION);
screen_print(&spectrumZ80); screen_print(&spectrumZ80);
kol_paint_image((540 - screen_a_w)/2-5, kol_paint_image((540 - screen_a_w)/2-5,
(440 - screen_a_h-kol_skin_height())/2, (440 - screen_a_h-kol_skin_height())/2,
@ -414,9 +414,9 @@ spectrumZ80.RAM = (char*) malloc(64*1024);
memcpy(spectrumZ80.RAM, BIOS48, 16*1024); memcpy(spectrumZ80.RAM, BIOS48, 16*1024);
Z80Reset( &spectrumZ80, 69888 ); Z80Reset( &spectrumZ80, 69888 );
Z80FlagTables(); Z80FlagTables();
fila[1][1] = fila[1][2] = fila[2][2] = fila[3][2] = fila[4][2] = fila[1][1] = fila[1][2] = fila[2][2] = fila[3][2] = fila[4][2] =
fila[4][1] = fila[3][1] = fila[2][1] = 0xFF; fila[4][1] = fila[3][1] = fila[2][1] = 0xFF;
debug = 0; debug = 0;