Compare commits
8 Commits
6510440a68
...
7008257a3d
Author | SHA1 | Date | |
---|---|---|---|
7008257a3d | |||
|
3eb02af5fd | ||
|
83d8146ad1 | ||
|
1974f45c50 | ||
36ce6f0b74 | |||
4701a15222 | |||
61277f8822 | |||
abb7442055 |
@@ -462,7 +462,7 @@ tup.append_table(img_files, {
|
||||
{"DEMOS/SPIRAL", VAR_PROGS .. "/demos/spiral/spiral"},
|
||||
{"DEMOS/TINYFRAC", VAR_PROGS .. "/demos/tinyfrac/trunk/tinyfrac"},
|
||||
{"DEMOS/TRANTEST", VAR_PROGS .. "/demos/trantest/trunk/trantest"},
|
||||
{"DEMOS/TUBE", VAR_PROGS .. "/demos/tube/trunk/tube"},
|
||||
{"DEMOS/TUBE", VAR_PROGS .. "/demos/tube/tube"},
|
||||
{"DEMOS/UNVWATER", VAR_PROGS .. "/demos/unvwater/trunk/unvwater"},
|
||||
{"DEMOS/WEB", VAR_PROGS .. "/demos/web/trunk/web"},
|
||||
{"DEMOS/ZEROLINE", VAR_PROGS .. "/demos/zeroline/trunk/zeroline"},
|
||||
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 700 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 809 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 19 KiB |
@@ -11,9 +11,9 @@ TODO:
|
||||
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
|
||||
*/
|
||||
|
||||
#define ABOUT_TITLE "EOLITE 5.27"
|
||||
#define TITLE_EOLITE "Eolite File Manager 5.27"
|
||||
#define TITLE_KFM "Kolibri File Manager 2.27";
|
||||
#define ABOUT_TITLE "EOLITE 5.28"
|
||||
#define TITLE_EOLITE "Eolite File Manager 5.28"
|
||||
#define TITLE_KFM "Kolibri File Manager 2.28";
|
||||
|
||||
#define MEMSIZE 1024 * 250
|
||||
#include "../lib/clipboard.h"
|
||||
@@ -542,14 +542,11 @@ void draw_window()
|
||||
static int rand_n;
|
||||
if (!rand_n) && (Form.width + 1 != screen.w) rand_n = random(80);
|
||||
|
||||
if (show_status_bar.checked) {
|
||||
#define STBAR_EOLITE_H 16
|
||||
#define STBAR_KFM_H 21
|
||||
if (efm) status_bar_h = STBAR_KFM_H;
|
||||
else status_bar_h = STBAR_EOLITE_H;
|
||||
} else {
|
||||
status_bar_h = 0;
|
||||
}
|
||||
#define STBAR_EOLITE_H 16
|
||||
#define STBAR_KFM_H 21
|
||||
if (efm) status_bar_h = STBAR_KFM_H;
|
||||
else status_bar_h = STBAR_EOLITE_H;
|
||||
|
||||
if (efm) title = TITLE_KFM; else title = TITLE_EOLITE;
|
||||
DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0);
|
||||
GetProcessInfo(#Form, SelfInfo);
|
||||
@@ -597,7 +594,7 @@ void draw_window()
|
||||
}
|
||||
//main rectangles
|
||||
DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,sc.line);
|
||||
DrawBar(0,39,1,-show_status_bar.checked*status_bar_h + Form.cheight - 40, sc.work);
|
||||
DrawBar(0,39,1,-status_bar_h + Form.cheight - 40, sc.work);
|
||||
EBX = Form.cwidth-1 * 65536 + 1;
|
||||
$int 64
|
||||
for (i=0; i<6; i++) DrawBar(0, 34+i, Form.cwidth, 1, MixColors(sc.dark, sc.work, i*10));
|
||||
@@ -652,17 +649,13 @@ void DrawStatusBar()
|
||||
{
|
||||
char status_bar_str[80];
|
||||
int go_up_folder_exists=0;
|
||||
dword topcolor;
|
||||
|
||||
if (show_status_bar.checked) topcolor=sc.light; else topcolor=sc.work;
|
||||
DrawBar(0, Form.cheight - status_bar_h-1, Form.cwidth, 1, topcolor);
|
||||
|
||||
DrawBar(0, Form.cheight - status_bar_h-1, Form.cwidth, 1, sc.light);
|
||||
if (efm) {
|
||||
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, 2, sc.work);
|
||||
DrawBar(0, Form.cheight - 2, Form.cwidth, 2, EDX);
|
||||
DrawBar(Form.cwidth-1, Form.cheight - 19, 1, 17, EDX);
|
||||
DrawFuncButtonsInKfm();
|
||||
} else if (show_status_bar.checked) {
|
||||
} else {
|
||||
if (files.count>0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1;
|
||||
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work);
|
||||
sprintf(#status_bar_str, T_STATUS_EVEMENTS, folder_count-go_up_folder_exists, files.count-folder_count);
|
||||
@@ -1116,7 +1109,6 @@ void EventClosePopinForm()
|
||||
void ShowPopinForm(byte _popin_type)
|
||||
{
|
||||
int popinx;
|
||||
popin_string[0] = -1;
|
||||
switch(_popin_type) {
|
||||
case POPIN_PATH:
|
||||
edit_box_set_text stdcall (#popin_text, path);
|
||||
@@ -1131,6 +1123,7 @@ void ShowPopinForm(byte _popin_type)
|
||||
DrawEolitePopup(T_CREATE, T_CANCEL);
|
||||
break;
|
||||
case POPIN_RENAME:
|
||||
if (itdir) && (streq(#file_name,"..")) return;
|
||||
edit_box_set_text stdcall (#popin_text, #file_name);
|
||||
DrawEolitePopup(T_RENAME, T_CANCEL);
|
||||
break;
|
||||
@@ -1188,7 +1181,7 @@ void FnProcess(byte N)
|
||||
if (files.count) ShowPopinForm(POPIN_RENAME);
|
||||
break;
|
||||
case 3:
|
||||
if (files.count) && (!itdir) RunProgram("/kolibrios/utils/quark", #file_path);
|
||||
if (files.count) && (!itdir) RunProgram("/sys/develop/heed", #file_path);
|
||||
break;
|
||||
case 4:
|
||||
if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path);
|
||||
|
@@ -42,7 +42,7 @@ void about_dialog()
|
||||
about_x = -strlen(ABOUT_TITLE)*18+about_form.cwidth/2;
|
||||
WriteTextB(about_x+2,107,0x82,0xD49CD2,ABOUT_TITLE);
|
||||
WriteTextB(about_x,105,0x82,0x9D129D,ABOUT_TITLE);
|
||||
WriteTextLines(73,163,0x90,sc.work_text," By Leency\nand KolibriOS Team\n 2008-2021",20);
|
||||
WriteTextLines(73,163,0x90,sc.work_text," By Leency\nand KolibriOS Team\n 2008-2025",20);
|
||||
#ifdef LANG_RUS
|
||||
DrawStandartCaptButton(60,about_form.cheight-38,11,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧࠡ<E0A0A7>⪨");
|
||||
#endif
|
||||
|
@@ -38,7 +38,7 @@
|
||||
char *kfm_func = {
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||
"<EFBFBD><EFBFBD>२<EFBFBD><EFBFBD><EFBFBD>.",
|
||||
"<EFBFBD><EFBFBD><EFBFBD>ᬮ<EFBFBD><EFBFBD>",
|
||||
"HEX-<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>",
|
||||
@@ -86,9 +86,9 @@ char *actions[] = {
|
||||
|
||||
#define TITLE_SETT "<22><><EFBFBD><EFBFBD>ன<EFBFBD><E0AEA9>"
|
||||
#define SHOW_DEVICE_CLASS "<22>뢮<EFBFBD><EBA2AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ன<EFBFBD><E0AEA9><EFBFBD>"
|
||||
#define SHOW_STATUS_BAR "<22><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>"
|
||||
#define BIG_ICONS "<22>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>訥 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
#define COLORED_LINES "<22><><EFBFBD>ᢥ稢<E1A2A5><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> ᯨ᪥"
|
||||
#define FONT_BOLD "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
|
||||
#define FONT_SIZE_LABEL "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
#define LIST_LINE_HEIGHT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20> ᯨ᪥"
|
||||
#define SAVE_PATH_AS_DEFAULT "<22><><EFBFBD><EFBFBD>騩 <20><><EFBFBD><EFBFBD>"
|
||||
@@ -137,7 +137,7 @@ char *actions[] = {
|
||||
char *kfm_func = {
|
||||
"Info",
|
||||
"Rename",
|
||||
"View",
|
||||
"HEX View",
|
||||
"Edit",
|
||||
"Copy",
|
||||
"Move",
|
||||
@@ -185,9 +185,9 @@ char *actions[] = {
|
||||
|
||||
#define TITLE_SETT "Settings"
|
||||
#define SHOW_DEVICE_CLASS "Show device class name"
|
||||
#define SHOW_STATUS_BAR "Show status bar"
|
||||
#define BIG_ICONS "Big icons in list"
|
||||
#define COLORED_LINES "Highlight even lines in list"
|
||||
#define FONT_BOLD "Bold font"
|
||||
#define FONT_SIZE_LABEL "Font size"
|
||||
#define LIST_LINE_HEIGHT "List line height"
|
||||
#define SAVE_PATH_AS_DEFAULT "Current path"
|
||||
|
@@ -158,25 +158,27 @@ void _SystemDiscs::DrawOptions(int draw_x)
|
||||
SystemDiscs.Get();
|
||||
|
||||
DrawPopup(draw_x, optionsy, DDW, list.count*KFM2_DEVH, 1, -1, sc.line);
|
||||
EAX = kfont.bold;
|
||||
$push eax
|
||||
|
||||
for (i=0;i<list.count;i++) {
|
||||
strcpy(#dev_name, list.get(i));
|
||||
GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
|
||||
if (strstr(path, #dev_name)!=0) is_active=true; else is_active=false;
|
||||
if (strstr(path, #dev_name)!=0) kfont.bold=true; else kfont.bold=false;
|
||||
|
||||
DrawBar(draw_x, optionsy, DDW, KFM2_DEVH, 0xFFFFFF);
|
||||
DefineButton(draw_x, optionsy, DDW, KFM2_DEVH-1, 100+i+BT_HIDE,0xFFFFFF);
|
||||
PutImage(draw_x + 5, optionsy+2, 18,17, is_active*7+dev_icon*17*18*3+#devices);
|
||||
if (is_active) kfont.bold = true;
|
||||
PutImage(draw_x + 5, optionsy+2, 18,17, kfont.bold*7+dev_icon*17*18*3+#devices);
|
||||
//strncpy(#volume_label, GetVolumeLabel(#dev_name), sizeof(volume_label));
|
||||
strcpy(#label_file_name, #dev_name);
|
||||
//if (dev_name[1]!='k') && (dev_name[2]!='y') {
|
||||
// if (volume_label) sprintf(#label_file_name, "%s [%s]", #dev_name, #volume_label);
|
||||
//}
|
||||
kfont.WriteIntoWindow(draw_x + 24, optionsy+2, 0xFFFfff, 0x000000, kfont.size.pt, #label_file_name+1);
|
||||
kfont.bold = false;
|
||||
optionsy += KFM2_DEVH;
|
||||
}
|
||||
$pop eax
|
||||
kfont.bold = EAX;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -9,9 +9,9 @@ edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x100000
|
||||
more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL };
|
||||
more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT };
|
||||
checkbox show_dev_name = { SHOW_DEVICE_CLASS };
|
||||
checkbox show_status_bar = { SHOW_STATUS_BAR };
|
||||
checkbox big_icons = { BIG_ICONS };
|
||||
checkbox colored_lines = { COLORED_LINES };
|
||||
checkbox bold_font = { FONT_BOLD };
|
||||
|
||||
|
||||
void settings_dialog()
|
||||
@@ -51,8 +51,10 @@ void settings_dialog()
|
||||
break;
|
||||
}
|
||||
show_dev_name.click(id);
|
||||
show_status_bar.click(id);
|
||||
colored_lines.click(id);
|
||||
if (bold_font.click(id)) {
|
||||
kfont.bold^=1;
|
||||
}
|
||||
if (font_size.click(id)) {
|
||||
kfont.size.pt = font_size.value;
|
||||
kfont.changeSIZE();
|
||||
@@ -72,7 +74,7 @@ void settings_dialog()
|
||||
|
||||
case evReDraw:
|
||||
DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400,
|
||||
-efm*42+345+skin_h,0x34,sc.work,TITLE_SETT,0);
|
||||
345+skin_h,0x34,sc.work,TITLE_SETT,0);
|
||||
GetProcessInfo(#Settings, SelfInfo);
|
||||
DrawSettingsCheckBoxes();
|
||||
}
|
||||
@@ -96,10 +98,10 @@ void DrawSettingsCheckBoxes()
|
||||
y.n = 0;
|
||||
if (!efm) {
|
||||
show_dev_name.draw(XXX, y.inc(14));
|
||||
show_status_bar.draw(XXX, y.inc(25));
|
||||
}
|
||||
big_icons.draw(XXX, y.inc(25));
|
||||
colored_lines.draw(XXX, y.inc(25));
|
||||
bold_font.draw(XXX, y.inc(25));
|
||||
font_size.draw(XXX, y.inc(31));
|
||||
line_height.draw(XXX, y.inc(31));
|
||||
|
||||
@@ -121,7 +123,7 @@ void LoadIniSettings()
|
||||
|
||||
files.SetFont(6, 9, 10000000b);
|
||||
show_dev_name.checked = ini.GetInt("ShowDeviceName", true);
|
||||
show_status_bar.checked = ini.GetInt("ShowStatusBar", true);
|
||||
kfont.bold = bold_font.checked = ini.GetInt("BoldFont", false);
|
||||
big_icons.checked = ini.GetInt("BigIcons", false); BigIconsSwitch();
|
||||
colored_lines.checked = ini.GetInt("ColoredLines", true);
|
||||
kfont.size.pt = ini.GetInt("FontSize", 13);
|
||||
@@ -141,7 +143,7 @@ void LoadIniSettings()
|
||||
void SaveIniSettings()
|
||||
{
|
||||
ini.SetInt("ShowDeviceName", show_dev_name.checked);
|
||||
ini.SetInt("ShowStatusBar", show_status_bar.checked);
|
||||
ini.SetInt("BoldFont", bold_font.checked);
|
||||
ini.SetInt("BigIcons", big_icons.checked);
|
||||
ini.SetInt("ColoredLines", colored_lines.checked);
|
||||
ini.SetInt("FontSize", kfont.size.pt);
|
||||
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 85 KiB |
@@ -1,2 +1,2 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
tup.rule("tube.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "tube")
|
||||
tup.rule("tube.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "tube")
|
@@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm tube.asm tube
|
||||
@erase lang.inc
|
||||
@pause
|
@@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru_RU >lang.inc
|
||||
@fasm tube.asm tube
|
||||
@erase lang.inc
|
||||
@pause
|
@@ -1,264 +0,0 @@
|
||||
|
||||
; (<28>) ( ) <20> ) ( ) 256b intro by baze/3SC for Syndeecate 2001
|
||||
; <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> loveC: thanks, Serzh: eat my socks dude ;]
|
||||
; ( ) ( ) ( ) ( ) e-mail: baze@stonline.sk, web: www.3SC.sk
|
||||
|
||||
; Menuet port by VT
|
||||
|
||||
appname equ 'TUBE - FPU'
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd I_END
|
||||
dd 0x40000
|
||||
dd 0x40000
|
||||
dd 0,0
|
||||
|
||||
include '..\..\..\macros.inc'
|
||||
|
||||
START:
|
||||
|
||||
call draw_window
|
||||
|
||||
call init_tube
|
||||
|
||||
push ebx
|
||||
|
||||
still:
|
||||
|
||||
pop ebx
|
||||
|
||||
call MAIN
|
||||
|
||||
push ebx
|
||||
|
||||
mov eax,23
|
||||
mov ebx,1
|
||||
mcall
|
||||
|
||||
cmp eax,1
|
||||
jne no_red
|
||||
call draw_window
|
||||
jmp still
|
||||
no_red:
|
||||
|
||||
cmp eax,0
|
||||
je still
|
||||
|
||||
or eax,-1
|
||||
mcall
|
||||
|
||||
SCREEN equ 160
|
||||
PIXBUF equ 200h
|
||||
EYE equ EYE_P-2
|
||||
|
||||
|
||||
MAIN:
|
||||
|
||||
add bh,10;8
|
||||
mov edi,PIXBUF
|
||||
fadd dword [di-PIXBUF+TEXUV-4]
|
||||
push di
|
||||
mov dx,-80
|
||||
|
||||
TUBEY:
|
||||
|
||||
mov bp,-160
|
||||
|
||||
TUBEX:
|
||||
|
||||
mov si,TEXUV
|
||||
fild word [si-TEXUV+EYE]
|
||||
mov [si],bp
|
||||
fild word [si]
|
||||
mov [si],dx
|
||||
fild word [si]
|
||||
mov cl,2
|
||||
|
||||
ROTATE:
|
||||
|
||||
fld st3
|
||||
fsincos
|
||||
fld st2
|
||||
fmul st0,st1
|
||||
fld st4
|
||||
fmul st0,st3
|
||||
db 0xde,0xe9 ; fsubp st1,st0
|
||||
db 0xd9,0xcb ; fxch st3
|
||||
fmulp st2,st0
|
||||
fmulp st3,st0
|
||||
faddp st2,st0
|
||||
db 0xd9,0xca ; fxch st2
|
||||
|
||||
loop ROTATE
|
||||
|
||||
fld st1
|
||||
db 0xdc,0xc8 ; fmul st0,st
|
||||
fld st1
|
||||
db 0xdc,0xc8 ; fmul st0,st
|
||||
faddp st1,st0
|
||||
fsqrt
|
||||
db 0xde,0xfb ; fdivp st3,st0
|
||||
fpatan
|
||||
fimul word [si-4]
|
||||
fistp word [si]
|
||||
fimul word [si-4]
|
||||
fistp word [si+1]
|
||||
mov si,[si]
|
||||
|
||||
lea ax,[bx+si]
|
||||
add al,ah
|
||||
and al,64
|
||||
mov al,-5
|
||||
jz STORE_1
|
||||
|
||||
shl si,2
|
||||
lea ax,[bx+si]
|
||||
sub al,ah
|
||||
mov al,-16
|
||||
jns STORE_1
|
||||
|
||||
shl si,1
|
||||
mov al,-48
|
||||
|
||||
STORE_1:
|
||||
|
||||
; add al,[ebx+esi+0x80000]
|
||||
add [di],al
|
||||
inc di
|
||||
|
||||
inc bp
|
||||
cmp bp,160
|
||||
|
||||
EYE_P:
|
||||
|
||||
jnz TUBEX
|
||||
inc dx
|
||||
cmp dx,80
|
||||
jnz TUBEY
|
||||
|
||||
call display_image
|
||||
|
||||
pop si
|
||||
mov ch,SCREEN*320/256
|
||||
|
||||
BLUR:
|
||||
|
||||
inc si
|
||||
sar byte [si],2
|
||||
loop BLUR
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
display_image:
|
||||
|
||||
pusha
|
||||
|
||||
mov esi,PIXBUF
|
||||
mov edi,0x10000
|
||||
newp:
|
||||
movzx edx,byte [esi]
|
||||
shl edx,4
|
||||
; mov dh,dl
|
||||
mov [edi],edx
|
||||
|
||||
add edi,3
|
||||
inc esi
|
||||
|
||||
cmp esi,320*160+PIXBUF
|
||||
jbe newp
|
||||
|
||||
mov eax,7
|
||||
mov ecx,320*65536+160
|
||||
xor edx,edx
|
||||
mov ebx,0x10000
|
||||
mcall
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
|
||||
draw_window:
|
||||
|
||||
pusha
|
||||
|
||||
mcall 12, 1
|
||||
mcall 48, 4 ;get skin width
|
||||
lea ecx,[100*65536+164+eax]
|
||||
xor eax,eax
|
||||
mov ebx,100*65536+329
|
||||
mov edx,0x74000000
|
||||
mov edi,title
|
||||
mcall
|
||||
mcall 12, 2
|
||||
popa
|
||||
ret
|
||||
|
||||
title db appname,0
|
||||
|
||||
db 41,0,0xC3,0x3C
|
||||
|
||||
TEXUV:
|
||||
|
||||
init_tube:
|
||||
|
||||
mov ecx,256
|
||||
|
||||
PAL1:
|
||||
|
||||
mov dx,3C8h
|
||||
mov ax,cx
|
||||
inc dx
|
||||
sar al,1
|
||||
js PAL2
|
||||
mul al
|
||||
shr ax,6
|
||||
|
||||
PAL2:
|
||||
|
||||
mov al,0
|
||||
jns PAL3
|
||||
sub al,cl
|
||||
shr al,1
|
||||
shr al,1
|
||||
|
||||
PAL3:
|
||||
|
||||
mov bx,cx
|
||||
mov [ebx+0x1000],bh
|
||||
loop PAL1
|
||||
mov ecx,256
|
||||
|
||||
TEX:
|
||||
|
||||
mov bx,cx
|
||||
add ax,cx
|
||||
rol ax,cl
|
||||
mov dh,al
|
||||
sar dh,5
|
||||
adc dl,dh
|
||||
adc dl,[ebx+255+0x1000]
|
||||
shr dl,1
|
||||
mov [ebx+0x1000],dl
|
||||
not bh
|
||||
mov [ebx+0x1000],dl
|
||||
loop TEX
|
||||
|
||||
fninit
|
||||
fldz
|
||||
|
||||
ret
|
||||
|
||||
|
||||
I_END:
|
||||
|
||||
|
||||
|
||||
|
313
programs/demos/tube/tube.asm
Normal file
@@ -0,0 +1,313 @@
|
||||
; SPDX-License-Identifier: GPL-2.0
|
||||
; Ported tube demo by VT
|
||||
; Copyright (C) 2001 Miloš Bazelides <baze@stonline.sk>
|
||||
; Copyright (C) 2006-2025 KolibriOS team
|
||||
|
||||
; Original comments:
|
||||
; 256b intro by baze/3SC for Syndeecate 2001
|
||||
; loveC: thanks, Serzh: eat my socks dude ;]
|
||||
; e-mail: baze@stonline.sk, web: www.3SC.sk
|
||||
|
||||
; Original source: https://baze.sk/3sc/files/tube.zip
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
dd 1,START,image_end,memory_end,stacktop,0,0
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
|
||||
title db 'Tube - FPU',0
|
||||
|
||||
SCREEN_W dd 640-10 ;10 px for borders
|
||||
SCREEN_H dd 400-10
|
||||
|
||||
align 4
|
||||
START:
|
||||
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||
call OnResize
|
||||
call draw_window
|
||||
call init_tube
|
||||
push ebx
|
||||
|
||||
still:
|
||||
pop ebx
|
||||
call MAIN
|
||||
push ebx
|
||||
|
||||
mcall SF_WAIT_EVENT_TIMEOUT,1
|
||||
|
||||
cmp eax,EV_REDRAW
|
||||
jne no_red
|
||||
call draw_window
|
||||
jmp still
|
||||
no_red:
|
||||
|
||||
or eax,eax
|
||||
jz still
|
||||
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
align 4
|
||||
OnResize:
|
||||
mov ecx,[SCREEN_W]
|
||||
imul ecx,[SCREEN_H]
|
||||
;ecx = SCREEN_W*SCREEN_H
|
||||
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[PIXBUF]
|
||||
mov [PIXBUF],eax
|
||||
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[buf1]
|
||||
mov [buf1],eax
|
||||
lea ecx,[ecx+2*ecx]
|
||||
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[buf2]
|
||||
mov [buf2],eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
MAIN:
|
||||
;edx - coord y
|
||||
;ebp - coord x
|
||||
;edi - pixel buffer
|
||||
add ebx,10 shl 8
|
||||
mov edi,[PIXBUF]
|
||||
fadd dword [TEXUV-4]
|
||||
push edi
|
||||
mov edx,[SCREEN_H]
|
||||
inc edx ;fix (height%2)==1
|
||||
shr edx,1
|
||||
neg edx ;edx=-SCREEN_H/2
|
||||
align 4
|
||||
TUBEY:
|
||||
mov ebp,[SCREEN_W]
|
||||
inc ebp ;fix (width%2)==1
|
||||
shr ebp,1
|
||||
neg ebp ;ebp=-SCREEN_W/2
|
||||
align 4
|
||||
TUBEX:
|
||||
mov esi,TEXUV
|
||||
fild dword [SCREEN_W]
|
||||
fld1
|
||||
fld1
|
||||
faddp
|
||||
fdivp ;st0=SCREEN_W/2
|
||||
mov [esi],ebp
|
||||
fild word [esi]
|
||||
mov [esi],edx
|
||||
fild word [esi]
|
||||
mov cl,2
|
||||
|
||||
ROTATE:
|
||||
fld st3
|
||||
fsincos
|
||||
fld st2
|
||||
fmul st0,st1
|
||||
fld st4
|
||||
fmul st0,st3
|
||||
fsubp st1,st0
|
||||
fxch st3
|
||||
fmulp st2,st0
|
||||
fmulp st3,st0
|
||||
faddp st2,st0
|
||||
fxch st2
|
||||
loop ROTATE
|
||||
|
||||
fld st1
|
||||
fmul st0,st0
|
||||
fld st1
|
||||
fmul st0,st0
|
||||
faddp st1,st0
|
||||
fsqrt
|
||||
|
||||
fdivp st3,st0
|
||||
fpatan
|
||||
fimul word [esi-4]
|
||||
fistp word [esi]
|
||||
fimul word [esi-4]
|
||||
fistp word [esi+1]
|
||||
mov esi,[esi]
|
||||
|
||||
lea eax,[ebx+esi]
|
||||
add al,ah
|
||||
and al,64
|
||||
mov al,-5
|
||||
jz STORE_1
|
||||
|
||||
shl esi,2
|
||||
lea eax,[ebx+esi]
|
||||
sub al,ah
|
||||
mov al,-16
|
||||
jns STORE_1
|
||||
|
||||
shl esi,1
|
||||
mov al,-48
|
||||
|
||||
STORE_1:
|
||||
; add al,[ebx+esi+0x80000]
|
||||
add [edi],al
|
||||
inc edi
|
||||
inc ebp
|
||||
mov eax,[SCREEN_W]
|
||||
shr eax,1 ;eax=SCREEN_W/2
|
||||
cmp ebp,eax
|
||||
|
||||
jnz TUBEX
|
||||
inc edx
|
||||
mov eax,[SCREEN_H]
|
||||
shr eax,1 ;eax=SCREEN_H/2
|
||||
cmp edx,eax
|
||||
jnz TUBEY
|
||||
|
||||
call display_image
|
||||
|
||||
pop esi
|
||||
mov ecx,[SCREEN_W]
|
||||
imul ecx,[SCREEN_H]
|
||||
|
||||
align 4
|
||||
BLUR:
|
||||
inc esi
|
||||
sar byte [esi],2
|
||||
loop BLUR
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
display_image:
|
||||
pusha
|
||||
|
||||
mov esi,[PIXBUF]
|
||||
mov edi,[buf2]
|
||||
mov eax,[SCREEN_W]
|
||||
imul eax,[SCREEN_H]
|
||||
add eax,esi
|
||||
align 4
|
||||
newp:
|
||||
movzx edx,byte [esi]
|
||||
shl edx,4
|
||||
|
||||
mov [edi],edx
|
||||
|
||||
add edi,3
|
||||
inc esi
|
||||
|
||||
cmp esi,eax
|
||||
jbe newp
|
||||
|
||||
xor edx,edx
|
||||
mov ecx,[SCREEN_W]
|
||||
shl ecx,16
|
||||
add ecx,[SCREEN_H]
|
||||
mcall SF_PUT_IMAGE,[buf2]
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pusha
|
||||
|
||||
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||
add eax,[SCREEN_H]
|
||||
lea ecx,[100*65536+4+eax]
|
||||
mov ebx,[SCREEN_W]
|
||||
add ebx,(100 shl 16)+9
|
||||
mcall SF_CREATE_WINDOW,,, 0x73000000,,title
|
||||
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||
add eax,4
|
||||
sub eax,[procinfo.box.height]
|
||||
neg eax
|
||||
cmp eax,[SCREEN_H]
|
||||
je .end_h
|
||||
cmp eax,32 ;min height
|
||||
jge @f
|
||||
mov eax,32
|
||||
@@:
|
||||
mov [SCREEN_H],eax
|
||||
xor eax,eax
|
||||
mov [SCREEN_W],eax
|
||||
.end_h:
|
||||
|
||||
mov eax,[procinfo.box.width]
|
||||
sub eax,9
|
||||
cmp eax,[SCREEN_W]
|
||||
je .resize_end
|
||||
cmp eax,64 ;min width
|
||||
jge @f
|
||||
mov eax,64
|
||||
@@:
|
||||
mov [SCREEN_W],eax
|
||||
|
||||
call OnResize
|
||||
.resize_end:
|
||||
|
||||
mcall SF_REDRAW, SSF_END_DRAW
|
||||
popa
|
||||
ret
|
||||
|
||||
align 4
|
||||
db 41,0,0xC3,0x3C
|
||||
TEXUV:
|
||||
rd 1
|
||||
|
||||
align 4
|
||||
init_tube:
|
||||
mov ecx,256
|
||||
mov edi,[buf1]
|
||||
|
||||
PAL1:
|
||||
mov edx,3C8h
|
||||
mov eax,ecx
|
||||
inc edx
|
||||
sar al,1
|
||||
js PAL2
|
||||
mul al
|
||||
shr ax,6
|
||||
|
||||
PAL2:
|
||||
mov al,0
|
||||
jns PAL3
|
||||
sub al,cl
|
||||
shr al,1
|
||||
shr al,1
|
||||
|
||||
PAL3:
|
||||
mov ebx,ecx
|
||||
mov [ebx+edi],bh
|
||||
loop PAL1
|
||||
mov ecx,256
|
||||
|
||||
TEX:
|
||||
mov bx,cx
|
||||
add ax,cx
|
||||
rol ax,cl
|
||||
mov dh,al
|
||||
sar dh,5
|
||||
adc dl,dh
|
||||
adc dl,[ebx+255+edi]
|
||||
shr dl,1
|
||||
mov [ebx+edi],dl
|
||||
not bh
|
||||
mov [ebx+edi],dl
|
||||
loop TEX
|
||||
|
||||
fninit
|
||||
fldz
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
image_end:
|
||||
|
||||
PIXBUF rd 1
|
||||
buf1 rd 1
|
||||
buf2 rd 1
|
||||
procinfo process_information
|
||||
|
||||
rb 1024
|
||||
align 4
|
||||
stacktop:
|
||||
memory_end:
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 106 KiB |
@@ -2,6 +2,16 @@
|
||||
Main advantages over the old board:
|
||||
* Bigger font
|
||||
* Scrolling (like in other console apps)
|
||||
* K : and L: messages highligting
|
||||
* Messages highligting
|
||||
* K : - kernel messages (K: also supported because some code in kernel prints such)
|
||||
* L: - launcher messages
|
||||
* I: - information
|
||||
* W: - warning
|
||||
* E: - error
|
||||
* S: - success
|
||||
* Three display modes (You can switch modes using `Tab` key)
|
||||
* User messages
|
||||
* Kernel messages
|
||||
* Both kernel and user messages
|
||||
|
||||
Also, like the old board it writes log to /tmp0/1/boardlog.txt (or you can pass another path in args like `/sys/develop/dbgboard /tmp0/1/hgfdhgfh.txt`), you can view log file in cedit by hitting `F2` key
|
||||
|
@@ -2,6 +2,7 @@
|
||||
; DBGBOARD - a console-based debug board
|
||||
; Copyright (C) 2025 KolibriOS team
|
||||
|
||||
|
||||
format binary as ""
|
||||
use32
|
||||
org 0
|
||||
@@ -25,18 +26,37 @@ purge mov,add,sub
|
||||
include '../../KOSfuncs.inc'
|
||||
; include '../../debug-fdo.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../struct.inc'
|
||||
include '../../dll.inc'
|
||||
include '../../if.inc'
|
||||
include '../../string.inc'
|
||||
|
||||
CON_WINDOW_CLOSED = 0x200
|
||||
|
||||
TEXT_COLOR_YELLOW = 14
|
||||
TEXT_COLOR_WHITE = 15
|
||||
TEXT_COLOR_LIGHTGRAY = 7
|
||||
; TEXT_COLOR_LIGHTGREEN = 10
|
||||
TEXT_COLOR_LIGHTGRAY = 7
|
||||
TEXT_COLOR_LIGHTBLUE = 9
|
||||
TEXT_COLOR_LIGHTGREEN = 10
|
||||
TEXT_COLOR_LIGHTCYAN = 11
|
||||
TEXT_COLOR_LIGHTRED = 12
|
||||
TEXT_COLOR_LIGHTMAGENTA = 13
|
||||
TEXT_COLOR_YELLOW = 14
|
||||
TEXT_COLOR_WHITE = 15
|
||||
|
||||
proc set_text_color stdcall uses eax, _color
|
||||
RB_CAPACITY = 4096*6
|
||||
|
||||
MODES_COUNT = 3
|
||||
MODE_USER = 0
|
||||
MODE_KERNEL = 1
|
||||
MODE_BOTH = 2
|
||||
|
||||
struct RING_BUFFER
|
||||
buffer dd ?
|
||||
capacity dd ?
|
||||
pos dd ?
|
||||
bytes_filled dd ?
|
||||
ends
|
||||
|
||||
proc set_text_color stdcall uses eax ecx edx, _color
|
||||
and [_color], 0x0F
|
||||
invoke con_get_flags
|
||||
and eax, 0x3F0
|
||||
@@ -95,12 +115,162 @@ proc write_file stdcall uses ebx, _path, _buf, _count, _pos_lo, _pos_hi, _out_by
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
proc ring_buffer_push_byte stdcall uses eax edx esi edi, _rb, _byte
|
||||
mov esi, [_rb]
|
||||
mov eax, [esi + RING_BUFFER.bytes_filled]
|
||||
.if eax < [esi + RING_BUFFER.capacity]
|
||||
inc [esi + RING_BUFFER.bytes_filled]
|
||||
.endif
|
||||
|
||||
mov edi, [esi + RING_BUFFER.buffer]
|
||||
add edi, [esi + RING_BUFFER.pos]
|
||||
mov eax, [_byte]
|
||||
mov byte [edi], al
|
||||
|
||||
mov eax, [esi + RING_BUFFER.pos]
|
||||
inc eax
|
||||
xor edx, edx
|
||||
div [esi + RING_BUFFER.capacity]
|
||||
mov [esi + RING_BUFFER.pos], edx ; put remainder
|
||||
|
||||
ret
|
||||
endp
|
||||
|
||||
proc print_ring_buffer stdcall uses eax ebx ecx edx esi, _rb
|
||||
mov esi, [_rb]
|
||||
mov eax, [esi + RING_BUFFER.capacity]
|
||||
xor ebx, ebx
|
||||
.if eax = [esi + RING_BUFFER.bytes_filled]
|
||||
mov ebx, [esi + RING_BUFFER.pos]
|
||||
.endif
|
||||
xor ecx, ecx
|
||||
.while ecx < [esi + RING_BUFFER.bytes_filled]
|
||||
mov eax, ebx
|
||||
add eax, ecx
|
||||
xor edx, edx
|
||||
div [esi + RING_BUFFER.capacity]
|
||||
mov eax, [esi + RING_BUFFER.buffer]
|
||||
add eax, edx
|
||||
mov eax, [eax]
|
||||
mov byte [chr], al
|
||||
stdcall print_next_char, chr
|
||||
inc ecx
|
||||
.endw
|
||||
ret
|
||||
endp
|
||||
|
||||
; in - __chr
|
||||
proc push_to_buffers_next_char uses ebx
|
||||
.if [__is_start_line] = 1
|
||||
mov eax, __prefix
|
||||
add eax, [__prefix_index]
|
||||
mov bl, byte [__chr]
|
||||
mov [eax], bl
|
||||
.if [__prefix_index] = 2
|
||||
.if dword [__prefix] = 'K :'
|
||||
mov [current_rb], rb_kernel
|
||||
.elseif dword [__prefix] = 'K: '
|
||||
mov [current_rb], rb_kernel
|
||||
.else
|
||||
mov [current_rb], rb_user
|
||||
.endif
|
||||
mov [__is_start_line], 0
|
||||
mov [__prefix_index], 0
|
||||
movzx eax, byte [__prefix]
|
||||
stdcall ring_buffer_push_byte, [current_rb], eax
|
||||
movzx eax, byte [__prefix + 1]
|
||||
stdcall ring_buffer_push_byte, [current_rb], eax
|
||||
movzx eax, byte [__prefix + 2]
|
||||
stdcall ring_buffer_push_byte, [current_rb], eax
|
||||
mov dword [__prefix], 0
|
||||
.else
|
||||
inc [__prefix_index]
|
||||
.endif
|
||||
.else
|
||||
movzx eax, byte [__chr]
|
||||
stdcall ring_buffer_push_byte, [current_rb], eax
|
||||
.if byte [__chr] = 10
|
||||
mov [__is_start_line], 1
|
||||
mov [current_rb], rb_user
|
||||
.endif
|
||||
.endif
|
||||
ret
|
||||
endp
|
||||
|
||||
; in - chr
|
||||
proc print_next_char uses ebx
|
||||
.if [is_start_line] = 1
|
||||
mov eax, prefix
|
||||
add eax, [prefix_index]
|
||||
mov bl, byte [chr]
|
||||
mov [eax], bl
|
||||
.if [prefix_index] = 2
|
||||
.if dword [prefix] = 'K :'
|
||||
stdcall set_text_color, TEXT_COLOR_YELLOW
|
||||
mov [is_kernel_printing], 1
|
||||
.elseif dword [prefix] = 'K: '
|
||||
stdcall set_text_color, TEXT_COLOR_YELLOW
|
||||
mov [is_kernel_printing], 1
|
||||
.elseif dword [prefix] = 'L: '
|
||||
stdcall set_text_color, TEXT_COLOR_WHITE
|
||||
mov [is_kernel_printing], 0
|
||||
.elseif dword [prefix] = 'I: '
|
||||
stdcall set_text_color, TEXT_COLOR_LIGHTCYAN
|
||||
mov [is_kernel_printing], 0
|
||||
.elseif dword [prefix] = 'W: '
|
||||
stdcall set_text_color, TEXT_COLOR_LIGHTMAGENTA
|
||||
mov [is_kernel_printing], 0
|
||||
.elseif dword [prefix] = 'E: '
|
||||
stdcall set_text_color, TEXT_COLOR_LIGHTRED
|
||||
mov [is_kernel_printing], 0
|
||||
.elseif dword [prefix] = 'S: '
|
||||
stdcall set_text_color, TEXT_COLOR_LIGHTGREEN
|
||||
mov [is_kernel_printing], 0
|
||||
.else
|
||||
stdcall set_text_color, TEXT_COLOR_LIGHTGRAY
|
||||
mov [is_kernel_printing], 0
|
||||
.endif
|
||||
.if [is_kernel_printing]
|
||||
.if [current_mode] = MODE_KERNEL | [current_mode] = MODE_BOTH
|
||||
invoke con_write_asciiz, prefix
|
||||
.endif
|
||||
.else
|
||||
.if [current_mode] = MODE_USER | [current_mode] = MODE_BOTH
|
||||
invoke con_write_asciiz, prefix
|
||||
.endif
|
||||
.endif
|
||||
|
||||
mov [is_start_line], 0
|
||||
mov [prefix_index], 0
|
||||
mov dword [prefix], 0
|
||||
.else
|
||||
inc [prefix_index]
|
||||
.endif
|
||||
.else
|
||||
.if [is_kernel_printing]
|
||||
.if [current_mode] = MODE_KERNEL | [current_mode] = MODE_BOTH
|
||||
invoke con_write_asciiz, chr
|
||||
.endif
|
||||
.else
|
||||
.if [current_mode] = MODE_USER | [current_mode] = MODE_BOTH
|
||||
invoke con_write_asciiz, chr
|
||||
.endif
|
||||
.endif
|
||||
.if byte [chr] = 10
|
||||
mov [is_start_line], 1
|
||||
stdcall set_text_color, TEXT_COLOR_LIGHTGRAY
|
||||
.endif
|
||||
.endif
|
||||
ret
|
||||
endp
|
||||
|
||||
start:
|
||||
;; if there is a second instance of conboard is running then exit
|
||||
;; if there is a second instance of dbgboard is running then exit
|
||||
mcall SF_THREAD_INFO, thread_info, -1
|
||||
stdcall string.copy, thread_info + process_information.process_name, thread_name
|
||||
stdcall string.to_lower_case, thread_name
|
||||
xor edx, edx ; conboard instance count
|
||||
xor edx, edx ; dbgboard instance count
|
||||
xor esi, esi
|
||||
.while esi < 256 ; NOTE: add to macros.inc MAX_THREAD_COUNT = 256
|
||||
mcall SF_THREAD_INFO, thread_info, esi
|
||||
@@ -122,7 +292,10 @@ start:
|
||||
jnz .exit
|
||||
|
||||
invoke con_start, 1
|
||||
invoke con_init, 80, 32, -1, -1, title
|
||||
mov eax, [current_mode]
|
||||
shl eax, 2 ; *4
|
||||
add eax, title_base
|
||||
invoke con_init, 80, 32, -1, -1, [eax]
|
||||
|
||||
.if byte [_cmdline] <> 0
|
||||
mov [log_file_path], _cmdline
|
||||
@@ -137,6 +310,30 @@ start:
|
||||
mov [struct_open_in_notepad.filename], eax
|
||||
mcall SF_FILE, struct_open_in_notepad
|
||||
.endif
|
||||
.if ah = 0x0F ; Tab
|
||||
mov eax, [current_mode]
|
||||
inc eax
|
||||
.if eax >= MODES_COUNT
|
||||
xor eax, eax
|
||||
.endif
|
||||
mov [current_mode], eax
|
||||
shl eax, BSF sizeof.RING_BUFFER ; assert on sizeof, must be power of two
|
||||
add eax, rb_base
|
||||
mov [current_rb], eax
|
||||
mov eax, [current_mode]
|
||||
shl eax, 2 ; *4
|
||||
add eax, title_base
|
||||
invoke con_set_title, [eax]
|
||||
invoke con_cls
|
||||
|
||||
; clear the printer context before printing the ring buffer
|
||||
mov dword [chr], 0
|
||||
mov dword [prefix], 0
|
||||
mov [prefix_index], 0
|
||||
mov [is_start_line], 1
|
||||
mov [is_kernel_printing], 0 ;;
|
||||
stdcall print_ring_buffer, [current_rb]
|
||||
.endif
|
||||
.endif
|
||||
|
||||
mcall SF_BOARD, SSF_DEBUG_READ
|
||||
@@ -145,35 +342,14 @@ start:
|
||||
jz .main_loop_cond
|
||||
.endif
|
||||
mov [chr], al
|
||||
mov [__chr], al
|
||||
|
||||
.if [is_start_line] = 1
|
||||
mov eax, prefix
|
||||
add eax, [prefix_index]
|
||||
mov bl, byte [chr]
|
||||
mov [eax], bl
|
||||
.if [prefix_index] = 2
|
||||
.if dword [prefix] = 'K :'
|
||||
stdcall set_text_color, TEXT_COLOR_YELLOW
|
||||
.elseif dword [prefix] = 'L: '
|
||||
stdcall set_text_color, TEXT_COLOR_WHITE
|
||||
.else
|
||||
stdcall set_text_color, TEXT_COLOR_LIGHTGRAY
|
||||
.endif
|
||||
mov [is_start_line], 0
|
||||
mov [prefix_index], 0
|
||||
invoke con_write_asciiz, prefix
|
||||
mov dword [prefix], 0
|
||||
.else
|
||||
inc [prefix_index]
|
||||
.endif
|
||||
.else
|
||||
invoke con_write_asciiz, chr
|
||||
.if byte [chr] = 10
|
||||
mov [is_start_line], 1
|
||||
stdcall set_text_color, TEXT_COLOR_LIGHTGRAY
|
||||
.endif
|
||||
.endif
|
||||
stdcall ring_buffer_push_byte, rb_both, eax ; we always push to "both" buffer
|
||||
stdcall push_to_buffers_next_char ; push byte to user or kernel messages ring buffer depending on current state
|
||||
|
||||
stdcall print_next_char
|
||||
|
||||
; append char to logfile, if no logfile then create it
|
||||
stdcall get_file_attrib, [log_file_path], file_info_buf
|
||||
.if eax = 5 ; file not found
|
||||
stdcall create_file, [log_file_path]
|
||||
@@ -193,14 +369,34 @@ start:
|
||||
|
||||
|
||||
; data:
|
||||
title db 'Debug & message board',0
|
||||
title_base:
|
||||
dd title_mode_user
|
||||
dd title_mode_kernel
|
||||
dd title_mode_both
|
||||
title_mode_user db 'Debug board - [Tab] switches mode: USER_kernel_both [F2] opens log file',0
|
||||
title_mode_kernel db 'Debug board - [Tab] switches mode: user_KERNEL_both [F2] opens log file',0
|
||||
title_mode_both db 'Debug board - [Tab] switches mode: user_kernel_BOTH [F2] opens log file',0
|
||||
|
||||
log_file_path dd default_log_file_path
|
||||
default_log_file_path db '/tmp0/1/BOARDLOG.TXT',0
|
||||
|
||||
; to use only in print_next_char
|
||||
chr db 0, 0, 0, 0
|
||||
prefix db 0,0,0,0
|
||||
prefix_index dd 0
|
||||
is_start_line dd 1
|
||||
is_kernel_printing dd 0 ; 1 if kernel is now printing (after K:), else 0
|
||||
|
||||
; to use only in push_to_buffers_next_char
|
||||
__chr db 0, 0, 0, 0
|
||||
__prefix db 0,0,0,0
|
||||
__prefix_index dd 0
|
||||
__is_start_line dd 1
|
||||
|
||||
current_mode dd MODE_BOTH
|
||||
current_rb dd 0
|
||||
|
||||
bytes_written dd 0
|
||||
chr db 0, 0
|
||||
|
||||
struct_open_in_notepad:
|
||||
dd SSF_START_APP
|
||||
@@ -210,6 +406,23 @@ struct_open_in_notepad:
|
||||
dd 0
|
||||
db '/sys/develop/cedit', 0
|
||||
|
||||
rb_base:
|
||||
rb_user:
|
||||
dd rb_user_buf
|
||||
dd RB_CAPACITY
|
||||
dd 0
|
||||
dd 0
|
||||
rb_kernel:
|
||||
dd rb_kernel_buf
|
||||
dd RB_CAPACITY
|
||||
dd 0
|
||||
dd 0
|
||||
rb_both:
|
||||
dd rb_both_buf
|
||||
dd RB_CAPACITY
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
|
||||
; include_debug_strings
|
||||
|
||||
@@ -224,7 +437,9 @@ import console, \
|
||||
con_kbhit, 'con_kbhit', \
|
||||
con_getch2, 'con_getch2', \
|
||||
con_set_flags, 'con_set_flags', \
|
||||
con_get_flags, 'con_get_flags'
|
||||
con_get_flags, 'con_get_flags', \
|
||||
con_set_title, 'con_set_title',\
|
||||
con_cls, 'con_cls'
|
||||
|
||||
align 16
|
||||
_image_end:
|
||||
@@ -237,6 +452,10 @@ _cmdline rb 256
|
||||
thread_info process_information
|
||||
thread_name rb 16
|
||||
|
||||
rb_user_buf rb RB_CAPACITY
|
||||
rb_kernel_buf rb RB_CAPACITY
|
||||
rb_both_buf rb RB_CAPACITY
|
||||
|
||||
; reserve for stack:
|
||||
rb 4096
|
||||
align 16
|
||||
|