Skip to content

Commit d86647a

Browse files
committed
Add %o to print for Bool, some graphics work, add copy to FileMgr
1 parent d44ec0c commit d86647a

22 files changed

+2691
-34
lines changed

05-HomeKeyPlugIns.ZC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Bool MyPutKey(I64 ch, I64 sc)
5858
return TRUE;
5959
}
6060
}
61-
 }
61+
}
6262

6363
if (sc & SCF_ALT && !(sc & SCF_CTRL))
6464
{

08-Display.DD

-1 Bytes
Binary file not shown.

Demo/Graphics/FontEd_8x12.ZC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ U0 FontEd()
140140
if (0 <= k < FONT_WIDTH*FONT_HEIGHT) {
141141
if (mouse.lb||msg_code==MESSAGE_MS_L_DOWN)
142142
Bts(&fp[cur_ch * FONT_HEIGHT],k);
143-
if (mouse.rb||msg_code==MESSAGE_MS_R_DOWN)
143+
if (mouse.rb||msg_code==MESSAGE_MS_R_DOWN)
144144
Btr(&fp[cur_ch * FONT_HEIGHT],k);
145145
}
146146
break;

Doc/Print.DD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ $FG,2$"%Z"$FG$ $LK,"DefineListLoad",A="MN:DefineListLoad"$() subentry. Pass sub_
5252
$FG,2$"%Q"$FG$ convert "\" to "\\" and quote to backslash quote. (For use in creating strs in strs.)
5353

5454
$FG,2$"%q"$FG$ rev a $FG,2$"%Q"$FG$.
55+
56+
$FG,2$"%x"$FG$ Hex number.
57+
58+
$FG,2$"%b"$FG$ Binary number$FG$.
59+
60+
$FG,2$"%o"$FG$ Bool$FG$.
5561
$ID,-2$
5662

5763
$FG,5$$TX+CX,"Print Family"$$FG$

Kernel/KGlobals.ZC

-1 Bytes
Binary file not shown.

Kernel/KStart16.ZC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ SYS_FRAMEBUFFER_LIST:: DU8 sizeof(CVideoInfo) * VBE_MODES_NUM DUP(0);
7171
//REQUESTED_SCREEN_WIDTH: DU16 1024;
7272
//REQUESTED_SCREEN_HEIGHT: DU16 768;
7373
REQUESTED_SCREEN_WIDTH: DU16 1280;
74-
REQUESTED_SCREEN_HEIGHT: DU16 1024;
74+
REQUESTED_SCREEN_HEIGHT: DU16 1024;
7575

7676
VBE_TEMP_MODE: DU8 sizeof(CVBEMode) DUP(0);
7777
VBE_INFO: DU8 sizeof(CVBEInfo) DUP(0);

Kernel/KernelA.HH

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ extern class CTask;
4747
#define F64_MAX (0x7FEFFFFFFFFFFFFF(F64))
4848
#define F64_MIN (0xFFEFFFFFFFFFFFFF(F64))
4949
#define inf (0x7FF0000000000000(F64))
50-
#define (0x7FF0000000000000(F64))
50+
#define ì (0x7FF0000000000000(F64))
5151
#define pi (0x400921FB54442D18(F64))
52-
#define (0x400921FB54442D18(F64))
52+
#define ã (0x400921FB54442D18(F64))
5353
#define exp_1 (0x4005BF0A8B145769(F64)) //The number "e"
5454
#define log2_10 (0x400A934F0979A371(F64))
5555
#define log2_e (0x3FF71547652B82FE(F64))
@@ -1690,7 +1690,7 @@ public class CAutoCompleteDictGlobals
16901690
#define OPTf_KEEP_PRIVATE 7
16911691
#define OPTf_NO_REG_VAR 8 //Applied to functions, not statements
16921692
#define OPTf_GLOBALS_ON_DATA_HEAP 9
1693-
//Disable 10-byte float consts for ,log2_10,log10_2,loge_2
1693+
//Disable 10-byte float consts for ã,log2_10,log10_2,loge_2
16941694
#define OPTf_NO_BUILTIN_CONST 10 //Applied to functions, not statements
16951695
#define OPTf_USE_IMM64 11 //Not completely implemented
16961696
#define OPTf_DECIMAL_ONLY 12 //Only allow decimal numbers (no 0x or 0b prefixed numbers)
@@ -2703,7 +2703,7 @@ class CPCIDev
27032703
//Physical Region Descriptor Table
27042704
#define AHCI_PRD_MAX_BYTES (4 * 1024 * 1024) //Max bytes that can go in one PRD entry ($ER$4 MiB). Section 4.2.3.3 Fig. 17 (DBC)
27052705
#define AHCI_PRDT_MAX_BLOCKS (U16_MAX + 1) //Max blocks you can transfer in one command.
2706-
#define AHCI_PRDT_MAX_LEN 8 //Max PRD entries in one command. This is equal to (MAX_BLOCKS * BLK_SIZE) MAX_BYTES.
2706+
#define AHCI_PRDT_MAX_LEN 8 //Max PRD entries in one command. This is equal to (MAX_BLOCKS * BLK_SIZE) ö MAX_BYTES.
27072707

27082708
//Global Host Control (Controller) flags
27092709
#define AHCI_GHCf_HBA_RESET 0
@@ -3642,7 +3642,7 @@ public class CDevGlobals
36423642
#define ROPF_PROBABILITY_DITHER 0x80000000
36433643

36443644
#help_index "Graphics/Color"
3645-
#define TRANSPARENT32 0xFF000000
3645+
#define TRANSPARENT32 0xFF000000 // one bit is probably better than all bits
36463646
#define TRANSPARENT 0xFF
36473647
#define BLACK 0
36483648
#define BLUE 1
@@ -3682,7 +3682,7 @@ public U32 class CBGR24
36823682
};
36833683
public U32 class CBGR32
36843684
{
3685-
U8 b, g, r, a;
3685+
U8 blue, green, red, rop;
36863686
};
36873687
public I64 class CBGR48
36883688
{
@@ -4394,6 +4394,72 @@ public class CDC
43944394
U8 bitsPerPixel; // 4 (legacy) or 32, 4 is stored in mem as U8
43954395
};
43964396

4397+
public class CDC32
4398+
{// equal to CDC except the:
4399+
// * Color
4400+
// * CDC's
4401+
// Dither etc but the size should be ==
4402+
U0 start;
4403+
CDate cdt;
4404+
I32 x0, y0,
4405+
width, width_internal,
4406+
height,
4407+
flags;
4408+
U0 end;
4409+
CBGR24 palette[COLORS_NUM];
4410+
4411+
//public (Change directly)
4412+
CBGR32 color,
4413+
bkcolor, //Set for use with $LK,"ROP_COLLISION",A="MN:ROP_COLLISION"$
4414+
color2; //Internally used for $LK,"GrFloodFill",A="MN:GrFloodFill"$()
4415+
CD3I32 ls; //Light source (should be normalized to 65536).
4416+
4417+
//dither_probability_i16 is basically a U16.
4418+
//It is activated by $LK,"ROPF_PROBABILITY_DITHER",A="MN:ROPF_PROBABILITY_DITHER"$.
4419+
// a positive value will make things lighter
4420+
// a negitive value will make things darker
4421+
// it only needs to be U8
4422+
//See $LK,"::/Demo/Graphics/SunMoon.ZC"$ and $LK,"::/Demo/Graphics/Shading.ZC"$.
4423+
I64 dither_probability_i16;
4424+
4425+
CDC32 *brush;
4426+
4427+
//Set with $LK,"DCMat4x4Set",A="MN:DCMat4x4Set"$(). $LK,"Free",A="MN:Free"$() before setting.
4428+
I64 *r, //rotation matrix of quads decimal in lo
4429+
r_norm; //shifted 32 bits. Used for scaling thick
4430+
4431+
//public (Change directly)
4432+
I32 x, y, z,
4433+
thick;
4434+
4435+
//Can be changed from the default $LK,"DCTransform",A="MN:DCTransform"$()
4436+
U0 (*transform)(CDC32 *dc, I64 *x, I64 *y, I64 *z);
4437+
4438+
//Can be changed from the default $LK,"DCLighting",A="MN:DCLighting"$()
4439+
U0 (*lighting)(CDC32 *dc, CD3I32 *p1, CD3I32 *p2, CD3I32 *p3, CBGR32 color);
4440+
4441+
//Set by $LK,"DCSymmetrySet",A="MN:DCSymmetrySet"$() or $LK,"DCSymmetry3Set",A="MN:DCSymmetry3Set"$()
4442+
CGrSym sym;
4443+
4444+
I32 cur_x, cur_y, cur_z, pad;
4445+
I64 collision_count;
4446+
4447+
I64 nearest_dist,
4448+
min_x, max_x, min_y, max_y; //Set by $LK,"DCF_RECORD_EXTENTS",A="MN:DCF_RECORD_EXTENTS"$ (screen coordinates)
4449+
4450+
U32 dc_signature, pad;
4451+
CTask *mem_task, *win_task;
4452+
CDC32 *alias;
4453+
U32 *body;
4454+
4455+
//Set by $LK,"DCDepthBufAlloc",A="MN:DCDepthBufAlloc"$()
4456+
I32 *depth_buf;
4457+
I64 db_z; //private
4458+
#assert !($$ & 7)
4459+
U8 bitsPerPixel; // 4 (legacy) or 32, 4 is stored in mem as U8
4460+
};
4461+
4462+
43974463
#define "Char/Input;StdIn"
43984464
//StrGet flags
43994465
#define SGF_SHIFT_ESC_EXIT 1 //This kills task on <SHIFT-ESC>
@@ -4555,6 +4621,20 @@ class CProgress
45554621
#define PRINTF_NEG_AUX_FORMAT_NUM 0x800
45564622

45574623
// toggle whether DoDoc inserts the cusrsor position at save
4558-
#define DD_INSERT_CURSOR 1
4624+
#define DD_NO_INSERT_CURSOR 1
4625+
4626+
#help_index "Package Manager"
4627+
class CInstallerPackage {
4628+
U8* name;
4629+
U8* version;
4630+
U8* dependancies;
4631+
U8* url;
4632+
U8* addFiles;
4633+
U8* removeFiles;
4634+
U8* description;
4635+
Bool rebuildKernel;
4636+
Bool rebuildCompiler;
4637+
Bool reboot;
4638+
};
45594639

4560-
#help_index ""
4640+
#help_index ""

Kernel/Lib/FontStd8x12.ZC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ U8 sys_font_std_8x12[256*12]= {
268268
0x00,0x00,0x1E,0x30,0x1C,0x06,0x3E,0x00,0x00,0x00,0x00,0x00,//�
269269
0x00,0x00,0x00,0x00,0x3C,0x3C,0x3C,0x3C,0x00,0x00,0x00,0x00,//�
270270
0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,//�
271-
};
271+
};
272272
// https://www.zap.org.au/projects/console-fonts-distributed/psftx-centos-7.5/lat0-12.psfu
273273
U8 sys_font_lat0_8x12[256*12]={
274274
0x7e, 0xc3, 0x99, 0x99, 0xcf, 0xe7, 0xe7, 0xff, 0xe7, 0xe7, 0x7e, 0x00, // 0x00

Kernel/StrPrint.ZC

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,11 @@ to avoid this.
438438
throw('StrPrint');
439439
ptr = argv[cur_arg++];
440440
break;
441+
case 'o': // Bool
442+
if (cur_arg >= argc)
443+
throw('StrPrint');
444+
if (argv[cur_arg++]) ptr = "TRUE"; else ptr = "FALSE";
445+
break;
441446

442447
case 'S':
443448
if (cur_arg >= argc)

System/BlkDev/FileMgr.ZC

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,47 @@ U0 FMRename(CDoc *doc)
329329
}
330330
}
331331

332+
U0 FMCopyFile(CDoc *doc)
333+
{
334+
CEdFileName fn;
335+
CDocEntry *doc_e = doc->cur_entry;
336+
CDirEntry *tmpde = NULL, *parent;
337+
338+
if (doc_e->type_u8 == DOCT_MENU_VAL)
339+
{
340+
tmpde = doc_e->user_data;
341+
if (parent = tmpde->parent)
342+
{
343+
Cd(parent->full_name);
344+
StrCopy(fn.name, tmpde->name);
345+
if (DocForm(&fn))
346+
{
347+
Silent;
348+
Copy(tmpde->name, fn.name);
349+
Silent(OFF);
350+
}
351+
}
352+
}
353+
else if (doc_e->type_u8 == DOCT_TREE)
354+
{
355+
tmpde = doc_e->user_data;
356+
if (parent = tmpde->parent)
357+
{
358+
Cd(parent->full_name);
359+
StrCopy(fn.name, tmpde->name);
360+
if (DocForm(&fn))
361+
{
362+
if (StrCompare(tmpde->name, fn.name))
363+
{
364+
Silent;
365+
CopyTree(tmpde->name, fn.name);
366+
Silent(OFF);
367+
}
368+
}
369+
}
370+
}
371+
}
372+
332373
U0 FMMkDir(CDoc *doc)
333374
{
334375
CEdFileName fn;
@@ -588,6 +629,7 @@ U0 FMCopy(CDoc *doc)
588629
#define FMR_MAKE_ISO9660 11
589630
#define FMR_BURN_ISO 12
590631
#define FMR_HELP 13
632+
#define FMR_COPY 14
591633

592634
I64 PopUpFMRight(U8 *header=NULL, U8 *footer=NULL)
593635
{
@@ -610,8 +652,11 @@ I64 PopUpFMRight(U8 *header=NULL, U8 *footer=NULL)
610652
"$$CM+LX,1,3 $$$$BT,\"MAKE ISO.C (CD/DVD) FILE\",LE=FMR_MAKE_REDSEA_ISO_C$$"
611653
"$$CM+LX,29,0$$$$BT,\"MAKE ISO (CD/DVD) FILE \",LE=FMR_MAKE_ISO9660$$"
612654
"$$CM+LX,1,3 $$$$BT,\"BURN ISO (CD/DVD) FILE \",LE=FMR_BURN_ISO$$"
613-
"$$CM+LX,29,0$$$$BT,\"HELP \",LE=FMR_HELP$$"
614-
"$$CM+LX,1,3 $$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$\n");
655+
"$$CM+LX,29,0$$$$BT,\"COPY FILE \",LE=FMR_COPY$$"
656+
"$$CM+LX,1,3 $$$$BT,\"HELP \",LE=FMR_HELP$$"
657+
"$$CM+LX,29,0$$$$BT,\"CANCEL \",LE=DOCM_CANCEL\n$$"
658+
659+
);
615660

616661
if (footer)
617662
DocPrint(doc, "%s", footer);
@@ -677,6 +722,10 @@ U0 FMRightClick()
677722
Message(MESSAGE_KEY_DOWN, 'B', 0);
678723
break;
679724

725+
case FMR_COPY:
726+
Message(MESSAGE_KEY_DOWN, 'C', 0);
727+
break;
728+
680729
case FMR_HELP:
681730
PopUpEd("::/Doc/FileMgr.DD");
682731
break;
@@ -841,6 +890,10 @@ public U8 *FileMgr(I64 mode=FM_NORMAL, CTask *mem_task=NULL)
841890
FMRename(doc);
842891
break;
843892

893+
case 'C':
894+
FMCopyFile(doc);
895+
break;
896+
844897
case 'd':
845898
FMMkDir(doc);
846899
break;

0 commit comments

Comments
 (0)