Modified FileRead, FileWrite, and FileFind

No more .Z double searching
Removed ASCII 5 cursor from all files
This commit is contained in:
xmm15 2020-02-23 01:54:39 -06:00
parent 3c56fa3096
commit 5514ca2e8a
72 changed files with 794 additions and 892 deletions

Binary file not shown.

View file

@ -2,31 +2,34 @@ Bool ParseAsmImm(CCompCtrl *cc,CAsmArg *arg)
{
if (arg->imm_or_off_present)
LexExcept(cc,"Already one immediate at ");
arg->imm_or_off_present=TRUE;
arg->num.local_asm_undef_hash=NULL;
arg->num.glbl_asm_undef_hash=NULL;
cc->asm_undef_hash=NULL;
cc->abs_counts=0;
cc->flags&=~(CCF_UNRESOLVED+CCF_LOCAL);
if (!IsLexExpression2Bin(cc,&arg->num.machine_code))
arg->imm_or_off_present = TRUE;
arg->num.local_asm_undef_hash = NULL;
arg->num.glbl_asm_undef_hash = NULL;
cc->asm_undef_hash = NULL;
cc->abs_counts = 0;
cc->flags &= ~(CCF_UNRESOLVED + CCF_LOCAL);
if (!IsLexExpression2Bin(cc, &arg->num.machine_code))
LexSkipEol(cc);
else {
else
{
if (cc->abs_counts.externs)
LexExcept(cc,"Extern Not Allowed at ");
if (cc->flags & CCF_UNRESOLVED) {
if (cc->flags & CCF_LOCAL) {
arg->num.local_asm_undef_hash=cc->asm_undef_hash;
cc->asm_undef_hash=NULL;
} else {
arg->num.glbl_asm_undef_hash=cc->asm_undef_hash;
cc->asm_undef_hash=NULL;
}
} else {
arg->num.i=Call(arg->num.machine_code);
arg->num.glbl_asm_undef_hash=cc->asm_undef_hash;
if (cc->flags & CCF_UNRESOLVED)
{
if (cc->flags & CCF_LOCAL)
arg->num.local_asm_undef_hash = cc->asm_undef_hash;
else
arg->num.glbl_asm_undef_hash = cc->asm_undef_hash;
cc->asm_undef_hash=NULL;
}
else
{
arg->num.i = Call(arg->num.machine_code);
arg->num.glbl_asm_undef_hash = cc->asm_undef_hash;
cc->asm_undef_hash = NULL;
Free(arg->num.machine_code);
arg->num.machine_code=NULL;
arg->num.machine_code = NULL;
}
}
return TRUE;
@ -36,11 +39,11 @@ U0 ParseAsmArg(CCompCtrl *cc,CAsmArg *arg,Bool rel)
{
CHashGeneric *tmph,*tmph1;
CHashReg *tmpr;
MemSet(arg,0,sizeof(CAsmArg));
arg->seg =REG_NONE;
arg->reg1=REG_NONE;
arg->reg2=REG_NONE;
arg->scale=1;
MemSet(arg, 0, sizeof(CAsmArg));
arg->seg = REG_NONE;
arg->reg1 = REG_NONE;
arg->reg2 = REG_NONE;
arg->scale = 1;
while (TRUE)
{
if (cc->token == TK_IDENT)

View file

@ -22,7 +22,7 @@ U0 AsmParseInsFlags(CCompCtrl *cc,CInst *tmpins)
case '/':
if (Lex(cc)==TK_I64 && cc->cur_i64<8)
tmpins->slash_val=cc->cur_i64;
 else if (cc->token==TK_IDENT) {
else if (cc->token==TK_IDENT) {
if (!StrCompare(cc->cur_str,"R"))
tmpins->slash_val=SV_R_REG;
else if (!StrCompare(cc->cur_str,"I"))

View file

@ -404,7 +404,7 @@ U0 CompLoadDefines()
"M16\0"
"M32\0"
"M64\0"
 "M1632\0"
"M1632\0"
"M16N32\0"
"M16N16\0"
"M32N32\0"

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -131,7 +131,7 @@ MM MM7 7;
XMM XMM0 0;
XMM XMM1 1;
XMM XMM2 2;
XMM XMM3 3;
XMM XMM3 3;
XMM XMM4 4;
XMM XMM5 5;
XMM XMM6 6;
@ -1307,3 +1307,5 @@ OPCODE MOV_CR3_RAX 0x0F 0x22 0xD8, 32=;
OPCODE MOV_RAX_CR3 0x0F 0x20 0xD8, 32=;
OPCODE MOV_CR4_RAX 0x0F 0x22 0xE0, 32=;
OPCODE MOV_RAX_CR4 0x0F 0x20 0xE0, 32=;
OPCODE MULPD 0x66 0x0F 0x59,/R XMM XMM;

View file

@ -15,7 +15,7 @@
"Blink: $BK,1$Test$BK,0$\n\n"
"Invert: $IV,1$Test$IV,0$\n\n"
"UnderLine: $UL,1$Test$UL,0$\n\n"
//<CTRL-SHIFT-T> on this link to toggle individual commands.
//<CTRL-SHIFT-T> on this link to toggle individual commands.
"Link: $LK,"KStart16.CC",A="::/Kernel/KStart16.CC"$\n\n\n"
"Bttn:$BT,"OKAY",LE=1$\n\n\n\n";

View file

@ -25,4 +25,4 @@ I0 Color32Demo()
}
}
Color32Demo;
Color32Demo;

View file

@ -16,7 +16,7 @@ U0 PanText()
Sleep(30);
}
 for (i=0;i<=7;i++) {
for (i=0;i<=7;i++) {
gr.pan_text_y=i;
Sleep(30);
}

View file

@ -1,7 +1,7 @@
U0 MemDemo()
{
I64 i;
"$$HL,1$$$$BLACK$$
"$$HL,1$$$$BLACK$$
#define MEM_PAG_BITS 9
#define MEM_PAG_SIZE (1<<MEM_PAG_BITS)
#define MEM_HEAP_HASH_SIZE 1024

View file

@ -93,4 +93,4 @@ U0 Palindrome(U8 *filename)
"Time:%9.5f\n",tS-t0;
}
Palindrome("/Misc/Vocab.DD");
Palindrome("/Misc/Vocab.DD");

View file

@ -15,4 +15,3 @@ d=2`(3`2);
d=-d1`(d+d2);
Option(OPTf_WARN_PAREN,OFF);


View file

@ -20,4 +20,3 @@ q1=q.i32[1].u8[2];
"q.i32[1].u8[2]\t=%016X\n",q1;
q1=q.i32[0].i8[1];
"q.i32[0].i8[1]\t=%016X\n",q1;


View file

@ -25,7 +25,7 @@ $FG,4$LABEL$FG,2$:
$FG$ Defines an non-exported global label.
$FG,2$@@$FG,4$LABEL$FG,2$:
$FG$ Defines a local label with scope valid between two global labels.
$FG$ Defines a local label with scope valid between two global labels.
$FG,2$DU8$FG$, $FG,2$DU16$FG$, $FG,2$DU32$FG$, $FG,2$DU64$FG$
Define BYTE, WORD, DWORD or QWORD. Can be used with $FG,2$DUP()$FG$ and ASCII strings. For your convenience, the ASCII strings do not have terminating zeros. Define cmds must end with a semicolon.

View file

@ -6,7 +6,7 @@ The $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system does not allow files to gr
Doing whole file operations is the ZenithOS way of doing thinks. It is the simplest and, ironically, the fastest. It is obnoxious in the characteristic way that ZenithOS is obnoxious, flaunting massive modern resources in a way that makes old programmers protest.
When doing large, whole-file operations, immediately memory fragmentation is a serious problem, but not so for allocations in the range under a Meg (with occasional larger ones).
When doing large, whole-file operations, immediately memory fragmentation is a serious problem, but not so for allocations in the range under a Meg (with occasional larger ones).
The file compression scheme in ZenithOS only works on whole file operations and the $LK,"DolDoc",A="FI:::/Doc/DolDoc.DD"$ format cannot have text tacked onto the end, since binary data is at the end.

View file

@ -159,7 +159,7 @@ $BK,1$* Zenith 1.0 released.$BK,0$
* Functions starting with 'A' for Adam now start with 'Z' for Zenith.
* $UL$Decompressed all files.$UL,0$ Removed Zip(), Unzip(), and ZipRep(). Slightly modified $LK,"FileRead",A="MN:FileRead"$() to disable reading compressed files. Removal of compression planned for the future.
* $UL$Decompressed all files.$UL,0$ Removed Zip(), Unzip(), and ZipRep(). Slightly modified $LK,"FileRead",A="MN:FileRead"$() to disable reading compressed files. Removal of compression planned for the future.
* $UL$Renamed all files from .HC -> .CC to reflect language name change.$UL,0$

View file

@ -26,7 +26,7 @@ $FG,5$$WW,1$$TX+CX,"ZenithOS Charter"$$FG$
* $FG,2$Single-address-map$FG$ as though paging is not used. Long mode requires paging, however, so the nearest thing is keeping all memory $FG,2$identity-mapped$FG$.
* No encryption or passwords.
* No encryption or passwords.
* $FG,2$Free$FG$ and $FG,2$public domain$FG$.

View file

@ -1,6 +1,6 @@
$WW,1$$FG,5$$TX+CX,"CosmiC"$$FG$
* See $LK,"::/Doc/CompilerOverview.DD"$.
* See $LK,"::/Doc/CompilerOverview.DD"$.
* See $LK,"Scoping and Linkage",A="FI:::/Doc/ScopingLinkage.DD"$ for details on $FG,2$extern$FG$, $FG,2$import$FG$, $FG,2$_extern$FG$, $FG,2$_import$FG$, etc.

View file

@ -30,7 +30,7 @@ I, $FG,2$Terry A. Davis$FG$, wrote all of TempleOS over the past 15.4 years (ful
*) God told me to stick with 640x480 16 color and single-voice 8-bit signed MIDI-like sample for sound. He kept me from zombie-walking into making child windows like $FG,2$Windows$FG$. Instead, I made one window per task with no child windows. He also guided my progress, very obviously.
*) I got $FG,4$$TX,"Webster's Dictionary",HTML="http://www.templeos.org/files/DICTIONARY.DD"$$FG$ from $FG,4$$TX,"Project Gutenberg",HTML="http://web.archive.org/web/20110730111436/http://promo.net/pg/"$$FG$.
*) I got $FG,4$$TX,"Webster's Dictionary",HTML="http://www.templeos.org/files/DICTIONARY.DD"$$FG$ from $FG,4$$TX,"Project Gutenberg",HTML="http://web.archive.org/web/20110730111436/http://promo.net/pg/"$$FG$.
*) John Carmack inspired me to use "$LK,"Clamp",A="MN:Clamp"$" as a name instead of "Limit". He inspired me to use "needle" and "haystack" as names. He inspired me to simplify my Frames-Per-Second code.

View file

@ -52,7 +52,7 @@ $LK,"::/Demo/Graphics/3DPoly.CC"$
$LK,"::/Demo/Graphics/BSpline.CC"$
$LK,"::/Demo/Graphics/Extents.CC"$
$LK,"::/Demo/Graphics/SpritePlot3D.CC"$
$LK,"::/Demo/Graphics/RotateTank.CC"$
$LK,"::/Demo/Graphics/RotateTank.CC"$
$LK,"::/Demo/Games/Wenceslas.CC"$
$LK,"::/Demo/ScreenCodes.CC"$
$LK,"::/Demo/Graphics/PanText.CC"$

View file

@ -99,7 +99,7 @@ See $LK,"::/Demo/DolDoc/CursorMove.CC"$.
$ID,-2$$TR,"AN Anchor"$
$ID,2$The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the anchor. I don't use these very often, but they're good sometimes.
$ID,-2$$TR,"LK Link"$
$ID,-2$$TR,"LK Link"$
$ID,2$The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the link text. With no aux the tag becomes the link text, as in example 3.
See $LK,"Link Types",A="MN:LK_FILE"$.

View file

@ -43,7 +43,7 @@ $ID,2$ZenithOS allocs mem as more items are displayed in the window. Also, Zenit
$ID,-2$$TR,"Why do I get a memory leak when editing big files?"$
$ID,2$The editor periodically takes a snap-shot of the document for $FG,2$UNDO$FG$ and this looks like a memory leak.
$ID,-2$$TR-C,"Why is it in text mode?"$
$ID,2$ZenithOS runs in $FG,2$High-res 32-bit color VBE$FG$ graphics modes, not text mode. It changes to this mode with a $LK,"BIOS call",A="FF:::/Kernel/KStart16.CC,INT:9"$ while in real-mode before it switches to 64-bit mode. The text is $LK,"drawn by hand",A="MN:GrUpdateTextFG"$. See $LK,"::/Kernel/FontStd.CC"$.
$ID,2$ZenithOS runs in $FG,2$High-res 32-bit color VBE$FG$ graphics modes, not text mode. It changes to this mode with a $LK,"BIOS call",A="FF:::/Kernel/KStart16.CC,INT:9"$ while in real-mode before it switches to 64-bit mode. The text is $LK,"drawn by hand",A="MN:GrUpdateTextFG"$. See $LK,"::/Kernel/FontStd.CC"$.
$ID,-2$$TR,"Where is the kernel memory?"$
$ID,2$ZenithOS identity-maps all memory, all the time. It is like paging is not used. There is no special kernel $FG,2$high half$FG$ memory space. ZenithOS is ring-0-only, so everything is kernel, even user programs. There is a special task called $FG,2$Zenith$FG$ and he doesn't die, so his heap never gets freed. That's as close to $FG,2$kernel memory$FG$ as it gets. All code goes in the lowest 2Gig of addresses, known as the $LK,"Code Heap",A="FF:::/Doc/Glossary.DD,Code and Data Heaps"$, so that the $FG,2$REL32$FG$ addressing mode can be used. See $LK,"MemoryOverview",A="FI:::/Doc/MemoryOverview.DD"$.
$ID,-2$$TR,"Why does it run code from stack addresses?"$

View file

@ -35,7 +35,7 @@
* Real-time fancy $FG,2$differential-equation solver$FG$ for physics engines, to use in games. (Adaptive step-size Runge-Kutta, interpolated for real-time.)
* Auto-completion, jump-to-source tool called $FG,2$AutoComplete$FG$ with Dictionary.

* Window Manager. Pan screen with $FG,2$<CTRL-LeftDrag>$FG$. Zoom screen on mouse cursor with $FG,2$<CTRL-ALT-z>$FG$/$FG,2$<CTRL-ALT-SHIFT-Z>$FG$.
* File Manager, $FG,2$<CTRL-d>$FG$.

View file

@ -146,7 +146,7 @@ $ID,-2$$TR,"Task/Process/Thread"$
$ID,2$There is no distinction between $FG,2$task$FG$, $FG,2$process$FG$ or $FG,2$thread$FG$. The $FG,2$Fs$FG$ segment reg is kept pointing to the current task's $LK,"CTask",A="MN:CTask"$. There is only one window per task, and only $FG,2$Core0$FG$ tasks can have windows. Each task has a code and data heap so memory is returned when it dies. Each task has a $LK,"hash",A="HI:Hash"$ symbol table.
Since there is not friendly disk sharing and all tasks have the same address map, it might be accurate to call ZenithOS, "multi-thread/single-process". You run a single application process on $FG,2$Core0$FG$ and it can create threads on the same core or others. If you run multiple processes, it should be safe, but one process will wait until another completely finishes a long disk access.
$ID,-2$$TR,"Zenith Task"$
$ID,-2$$TR,"Zenith Task"$
$ID,2$This is Zenith, as in the $MA-X+PU,"most important task",LM="ACDDefsPut(DocPut, \"Zenith\");View;"$. Zenith is immortal. The zenith task is created at start-up and appears in the small window at the top beneath the user terminal windows. Since the Zenith task is immortal, on Zenith's heap go all memory objects which you don't want destroyed by any single task's death. When created, Zenith runs the file $LK,"::/StartOS.CC"$. When start-up is finished, the zenith task enters a server mode where it accepts requests from other tasks. The $LK,"Zenith",A="MN:Zenith"$("") routine will make Zenith compile and run text src code. $FG,2$#include$FG$ statements can be sent to $LK,"Zenith",A="MN:Zenith"$(""), creating system-wide code and data which are immortal.
$ID,-2$$TR,"Daemon Tasks"$
$ID,2$Each CPU core has an executive task called $FG,2$Daemon$FG$ that is immortal. The Zenith task on $FG,2$Core0$FG$ is also its $FG,2$Daemon$FG$ task.

View file

@ -43,7 +43,7 @@ MESSAGE: DU8 "Hello World\n",0;
//The convention is underscore on C callable.
//Two colons means exported symbol.
_HELLO_WORLD::
//You can only clobber RAX,RBX,RCX,RDX
//You can only clobber RAX,RBX,RCX,RDX
PUSH RSI
MOV RSI,MESSAGE
CALL PUT_STR

Binary file not shown.

View file

@ -59,4 +59,4 @@ In 2016, I came-up with an alternate idea. I double mapped the lowest memory wit
Then, I switched to 1Gig page sizes. For the lowest 4Gig, I set-up an alias up at the top of address space. See $LK,"UncachedAliasAlloc",A="MN:UncachedAliasAlloc"$(). Not all computers support 1Gig page tables, however, so I also support 2Meg.
My original plan was to allow changing the page tables as needed, so I had code for taking control of 2Meg pages and marking them uncached or whatever. When I did a HDAudio driver, I requested some 32-bit address space as uncached. Today, all of the first 4Gig can be accessed without caching at the $LK,"dev.uncached_alias",A="FF:::/Kernel/MultiProc.CC,dev.uncached_alias"$.
My original plan was to allow changing the page tables as needed, so I had code for taking control of 2Meg pages and marking them uncached or whatever. When I did a HDAudio driver, I requested some 32-bit address space as uncached. Today, all of the first 4Gig can be accessed without caching at the $LK,"dev.uncached_alias",A="FF:::/Kernel/MultiProc.CC,dev.uncached_alias"$.

View file

@ -4,7 +4,7 @@ It has 3 channels:
$LK,"Channel 0",A="MN:PIT0"$ can generate an interrupt, IRQ 0, at a defined frequency. We set it up in $LK,"TimerInit",A="MN:TimerInit"$(), and use it in $LK,"SysTimerRead",A="MN:SysTimerRead"$().
Channel 1 was used historically to refresh the DRAM, but now it is obsolete as the hardware does this itself. Channel 1 is useless and might not even be implemented anymore on modern machines.
Channel 1 was used historically to refresh the DRAM, but now it is obsolete as the hardware does this itself. Channel 1 is useless and might not even be implemented anymore on modern machines.
$LK,"Channel 2",A="MN:PIT2"$'s output is connected to the PC speaker.

View file

@ -13,7 +13,7 @@ $FG,2$#else
#endif
#ifdef,#ifndef $FG$Include code if a sym is defined.
$FG,2$#ifaot,#ifjit $FG$Include code if in $FG,2$AOT$FG$ compiler mode.
$FG,2$defined()$FG$ Is a function that can be used in expressions.
$FG,2$defined()$FG$ Is a function that can be used in expressions.
$FG,2$#help_index$FG$, $FG,2$#help_file$FG$ See $LK,"Help System",A="FI:::/Doc/HelpSystem.DD"$.
See $LK,"PreProcessor",A="FF:::/Compiler/Lex.CC,KW_DEFINE"$.

View file

@ -8,7 +8,7 @@ $FG,2$ <F1> $FG$ Help
$FG,2$ <CTRL-m> $FG$ Personal Menu
$FG,2$ <ESC> $FG$ Save & Exit
$FG,2$ <SHIFT-ESC> $FG$ Abort & Exit
$FG,2$<CTRL+ALT+X>$FG$ Kill Window
$FG,2$<CTRL+ALT+X>$FG$ Kill Window
$FG,2$<ALT-SHIFT-N> $FG$Focus Next Win
$FG,2$ <WINDOWS> $FG$ Pull-Down Menu
$FG,2$ <CTRL-D>$FG$ File Manager

View file

@ -69,7 +69,7 @@ $FG$I didn't like that, so I made parentheses optional on calls with no args and
The syntax change created an ambiguity when specifying function addresses, like for calling $LK,"QuickSort",A="MN:QuickSort"$(). To resolve it, I made a '$FG,2$&$FG$' required in front of function names when specifying an address of a function, which is better anyway.
Once I was no longer using standard C/C++ syntax, I decided to change everything I didn't like and call it $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$. Here are the new $LK,"operator precedence",A="FF:::/Doc/CosmiC.DD,operator precedence"$ rules.
Once I was no longer using standard C/C++ syntax, I decided to change everything I didn't like and call it $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$. Here are the new $LK,"operator precedence",A="FF:::/Doc/CosmiC.DD,operator precedence"$ rules.
There are no object files in ZenithOS and, normally, you don't make executable files either, but you can. That's known as $LK,"Ahead-of-Time",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ compilation. Instead, you $LK,"Just in Time",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ compile.

View file

@ -3,7 +3,7 @@ asm {
HELLO: DU8 "Hello, World!\n",0;
_TEST::
PUSH HELLO
PUSH HELLO
CALL &PutS
RET
};

View file

@ -31,7 +31,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
CopyTree("/Kernel", "/Distro/Kernel");
CopyTree("/Misc", "/Distro/Misc");
//To save space, optionally delete dictionary.
//To save space, optionally delete dictionary.
//Del("/Distro/Zenith/AutoComplete/ACDefs.DATA");
CopyTree("/Downloads","/Distro/Downloads"); //You can leave this out.
DirMake("/Distro/Tmp");

View file

@ -3,7 +3,6 @@ BootHDIns;
"\n\nSuccessful?";
if(YorN)
{
Once("#include\"DoDistro\";;if(DriveIsWritable){Del(\"~/Registry.CC\");OutU16(0x4004, 0x3400);}");
Once("CursorRemove(\"/*\");;;#include\"DoDistro\";;if(DriveIsWritable){Del(\"~/Registry.CC\");OutU16(0x4004, 0x3400);}");
Reboot;
}


View file

@ -1,10 +1,8 @@
U0 Test()
{
MOV XMM12, 30
}
MULPD XMM0, XMM15
}
Uf("Test");
Test;
//Test;

View file

@ -55,7 +55,7 @@ class CVBoxHGCMPtr
};

class CVBoxGuestInfo
{
CVBoxHeader header;

View file

@ -146,7 +146,7 @@ Bool MyPutKey(I64 ch,I64 sc)
else {
ClipDel;
st=FileNameAbs(DocPut->filename.name);
DocPrint(sys_clip_doc,"$$LK,\"FL:%s,%d\"$$", st,DocPut->cur_entry->y+1);
DocPrint(sys_clip_doc,"$$LK,\"FL:%s,%d\"$$", st,DocPut->cur_entry->y+1);
Free(st);
}
return TRUE;

Binary file not shown.

View file

@ -1,109 +1,103 @@
U8 *FileRead(U8 *filename,I64 *_size=NULL,I64 *_attr=NULL)
U8 *FileRead(U8 *filename, I64 *_size=NULL, I64 *_attr=NULL)
{//Read whole file from disk.
CHashGeneric *tmph;
U8 *absname,*altname,*curname,*res=NULL;
I64 i,size=0,attr=0;
U8 *absname, *res = NULL;
I64 size= 0 , attr = 0;
CDirContext *dirc;
CArcCompress *arc;
absname=FileNameAbs(filename);
altname=ToggleZorNotZ(absname);
if ((tmph=HashFind(absname,zenith_task->hash_table,HTT_FILE))||
(tmph=HashFind(altname,zenith_task->hash_table,HTT_FILE))) {
size=tmph->user_data1;
res=MAlloc(size+1);
MemCopy(res,tmph->user_data0,size);
res[size]=0; //Terminate
attr=FileAttr(tmph->str,attr);
} else {
for (i=0;i<2 && !res;i++) {//Try name, then altname
if (!i)
curname=absname;
else
curname=altname;
if (dirc=DirContextNew(curname)) {
switch (dirc->drive->fs_type) {
absname = FileNameAbs(filename);
if (tmph = HashFind(absname, zenith_task->hash_table, HTT_FILE))
{
size = tmph->user_data1;
res = MAlloc(size + 1);
MemCopy(res , tmph->user_data0, size);
res[size] = 0; //Terminate
attr = FileAttr(tmph->str, attr);
}
else
{
if (dirc = DirContextNew(absname))
{
switch (dirc->drive->fs_type)
{
case FSt_REDSEA:
res = RedSeaFileRead(dirc->drive, Fs->cur_dir, dirc->mask, &size, &attr);
break;
case FSt_FAT32:
res = FAT32FileRead(dirc->drive, Fs->cur_dir, dirc->mask, &size, &attr);
break;
default:
PrintErr("File System Not Supported\n");
}
DirContextDel(dirc);
}
}
if (!res)
{
if (dirc=DirContextNew(absname))
{
while (!res && StrCompare(Fs->cur_dir, "/"))
{
Cd("..");
switch (Fs->cur_dv->fs_type) {
case FSt_REDSEA:
res=RedSeaFileRead(dirc->drive,Fs->cur_dir,dirc->mask,&size,&attr);
res = RedSeaFileRead(dirc->drive, Fs->cur_dir, dirc->mask, &size, &attr);
break;
case FSt_FAT32:
res=FAT32FileRead(dirc->drive,Fs->cur_dir,dirc->mask,&size,&attr);
res = FAT32FileRead(dirc->drive, Fs->cur_dir, dirc->mask, &size, &attr);
break;
default:
PrintErr("File System Not Supported\n");
}
DirContextDel(dirc);
}
DirContextDel(dirc);
}
}
if (!res)
PrintErr("File not found: \"%s\".\n", filename);
if (res && attr & RS_ATTR_RESIDENT)
HashGenericAdd(absname, HTT_FILE, ZMAllocIdent(res), size, 0, zenith_task);
//Search parent directories.
for (i=0;i<2 && !res;i++) {//Try name, then altname
if (!i)
curname=absname;
else
curname=altname;
if (dirc=DirContextNew(curname)) {
while (!res && StrCompare(Fs->cur_dir,"/")) {
Cd("..");
switch (Fs->cur_dv->fs_type) {
case FSt_REDSEA:
res=RedSeaFileRead(dirc->drive,Fs->cur_dir,dirc->mask,&size,&attr);
break;
case FSt_FAT32:
res=FAT32FileRead(dirc->drive,Fs->cur_dir,dirc->mask,&size,&attr);
break;
default:
PrintErr("File System Not Supported\n");
}
}
DirContextDel(dirc);
}
}
if (!res)
PrintErr("File not found: \"%s\".\n",filename);
if (res && attr & RS_ATTR_RESIDENT)
HashGenericAdd(curname,HTT_FILE,ZMAllocIdent(res),size,0,zenith_task);
}
if (res && attr & RS_ATTR_COMPRESSED) {
arc=res;
size=arc->expanded_size;
res=ExpandBuf(arc);
Free(arc);
}
if (_attr) *_attr=attr;
if (_size) *_size=size;
Free(absname);
Free(altname);
return res;
}
I64 FileWrite(U8 *filename,U8 *fbuf,I64 size,CDate cdt=0,I64 attr=0)
I64 FileWrite(U8 *filename, U8 *fbuf, I64 size, CDate cdt=0, I64 attr=0)
{//Write whole file to disk.
I64 c=0;
I64 c = 0;
CHashGeneric *tmph;
CDirContext *dirc;
U8 *absname=FileNameAbs(filename);
if (dirc=DirContextNew(filename,FALSE,TRUE)) {
attr=FileAttr(dirc->mask,attr);
if (!cdt) cdt=Now;
switch (dirc->drive->fs_type) {
U8 *absname = FileNameAbs(filename);
if (dirc = DirContextNew(filename, FALSE, TRUE))
{
attr = FileAttr(dirc->mask, attr);
if (!cdt)
cdt=Now;
switch (dirc->drive->fs_type)
{
case FSt_REDSEA:
c=RedSeaFileWrite(dirc->drive,Fs->cur_dir,dirc->mask,fbuf,size,cdt,attr);
c = RedSeaFileWrite(dirc->drive, Fs->cur_dir, dirc->mask, fbuf, size, cdt, attr);
break;
case FSt_FAT32:
c=FAT32FileWrite(dirc->drive,Fs->cur_dir,dirc->mask,fbuf,size,cdt,attr);
c = FAT32FileWrite(dirc->drive, Fs->cur_dir, dirc->mask, fbuf, size, cdt, attr);
break;
default:
PrintErr("File System Not Supported\n");
}
if (tmph=HashFind(absname,zenith_task->hash_table,HTT_FILE)) {
if (attr & RS_ATTR_RESIDENT) {
if (tmph = HashFind(absname, zenith_task->hash_table, HTT_FILE))
{
if (attr & RS_ATTR_RESIDENT)
{
Free(tmph->user_data0);
tmph->user_data0=ZMAllocIdent(fbuf);
tmph->user_data1=size;
} else
HashRemDel(tmph,zenith_task->hash_table);
tmph->user_data0 = ZMAllocIdent(fbuf);
tmph->user_data1 = size;
}
else
HashRemDel(tmph, zenith_task->hash_table);
} else if (attr & RS_ATTR_RESIDENT)
HashGenericAdd(absname,HTT_FILE,ZMAllocIdent(fbuf),size,0,zenith_task);
HashGenericAdd(absname, HTT_FILE, ZMAllocIdent(fbuf), size, 0, zenith_task);
DirContextDel(dirc);
}
Free(absname);

View file

@ -1,35 +1,35 @@
CDirEntry *FilesFind2(U8 *files_find_mask,I64 fuf_flags)
CDirEntry *FilesFind2(U8 *files_find_mask, I64 fuf_flags)
{
CDrive *drive=Fs->cur_dv;
CDirEntry *res=NULL;
DriveCheck(drive);
switch (drive->fs_type) {
case FSt_REDSEA:
res=RedSeaFilesFind(files_find_mask,fuf_flags);
res=RedSeaFilesFind(files_find_mask, fuf_flags);
break;
case FSt_FAT32:
res=FAT32FilesFind(files_find_mask,fuf_flags);
res=FAT32FilesFind(files_find_mask, fuf_flags);
break;
default:
PrintErr("File System Not Supported\n");
res=NULL;
}
if (res) {
DirFilesSort(&res,SK_NAME);
DirFilesSort(&res, SK_NAME);
if (fuf_flags&(FUF_FLATTEN_TREE|FUF_JUST_FILES))
DirFilesFlatten(res,&res,fuf_flags);
DirFilesFlatten(res, &res, fuf_flags);
if (fuf_flags&FUF_CLUS_ORDER)
DirFilesSort(&res,SK_CLUS);
DirFilesSort(&res, SK_CLUS);
}
return res;
}
CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0)
CDirEntry *FilesFind(U8 *files_find_mask, I64 fuf_flags=0)
{/* See $LK,"::/Doc/FileUtils.DD"$.
Find files and make a directory tree in memory.
When done, you free with $LK,"DirEntryDel",A="MN:DirEntryDel"$(),$LK,"DirEntryDel2",A="MN:DirEntryDel2"$(),
When done, you free with $LK,"DirEntryDel",A="MN:DirEntryDel"$(), $LK,"DirEntryDel2",A="MN:DirEntryDel2"$(),
$LK,"DirTreeDel",A="MN:DirTreeDel"$() or $LK,"DirTreeDel2",A="MN:DirTreeDel2"$().
*/
@ -39,113 +39,88 @@ $LK,"DirTreeDel",A="MN:DirTreeDel"$() or $LK,"DirTreeDel2",A="MN:DirTreeDel2"$()
throw('FUF');
if (fuf_flags&FUF_SINGLE) {
res=MAlloc(sizeof(CDirEntry));
if (!FileFind(files_find_mask,res)) {
if (!FileFind(files_find_mask, res)) {
Free(res);
return NULL;
}
} else if (dirc=DirContextNew(files_find_mask,TRUE)) {
res=FilesFind2(dirc->mask,fuf_flags);
} else if (dirc=DirContextNew(files_find_mask, TRUE)) {
res=FilesFind2(dirc->mask, fuf_flags);
DirContextDel(dirc);
} else
return NULL;
return res;
}
Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0)
{//$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$, $LK,"FUF_Z_OR_NOT_Z",A="MN:FUF_Z_OR_NOT_Z"$, $LK,"FUF_SCAN_PARENTS",A="MN:FUF_SCAN_PARENTS"$
//If you pass _de, you must Free(_de->full_name);
I64 i,j,cur_dir_clus;
U8 *altname,*curname,*full_name=NULL;
Bool FileFind(U8 *filename, CDirEntry *_de=NULL, I64 fuf_flags=0)
{//$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$, $LK,"FUF_SCAN_PARENTS",A="MN:FUF_SCAN_PARENTS"$
//If you pass _de, you must Free(_de->full_name);
I64 cur_dir_clus;
U8 *full_name = NULL;
CDirEntry de;
CDirContext *dirc;
Bool res=FALSE,old_silent;
Bool res = FALSE;
if (fuf_flags&~FUG_FILE_FIND)
throw('FUF');
if (!filename || *filename && filename[1]==':' && !Letter2Drive(*filename,FALSE))
if (!filename || *filename && filename[1] == ':' && !Letter2Drive(*filename, FALSE))
return FALSE;
altname=ToggleZorNotZ(filename);
if (fuf_flags&FUF_Z_OR_NOT_Z)
j=2;
else
j=1;
for (i=0;i<j && !res;i++) {
if (!i)
curname=filename;
else
curname=altname;
old_silent=Silent;
if (!(dirc=DirContextNew(curname)))
Silent(old_silent);
else {
Silent(old_silent);
cur_dir_clus=Name2DirClus(dirc->drive,Fs->cur_dir);
switch (dirc->drive->fs_type) {
case FSt_REDSEA:
res=RedSeaFileFind(dirc->drive,cur_dir_clus,dirc->mask,
&de,fuf_flags);
break;
case FSt_FAT32:
res=FAT32FileFind(dirc->drive,cur_dir_clus,dirc->mask,
&de,fuf_flags);
break;
default:
PrintErr("File System Not Supported\n");
}
if (res && _de) {
if (StrCompare(Fs->cur_dir,"/"))
full_name=MStrPrint("%C:%s/%s",
Drive2Letter(Fs->cur_dv),Fs->cur_dir,de.name);
else
full_name=MStrPrint("%C:/%s",Drive2Letter(Fs->cur_dv),de.name);
}
DirContextDel(dirc);
if (dirc = DirContextNew(filename))
{
cur_dir_clus=Name2DirClus(dirc->drive, Fs->cur_dir);
switch (dirc->drive->fs_type)
{
case FSt_REDSEA:
res=RedSeaFileFind(dirc->drive, cur_dir_clus, dirc->mask, &de, fuf_flags);
break;
case FSt_FAT32:
res=FAT32FileFind(dirc->drive, cur_dir_clus, dirc->mask, &de, fuf_flags);
break;
default:
PrintErr("File System Not Supported\n");
}
if (res && _de)
{
if (StrCompare(Fs->cur_dir, "/"))
full_name=MStrPrint("%C:%s/%s", Drive2Letter(Fs->cur_dv), Fs->cur_dir, de.name);
else
full_name=MStrPrint("%C:/%s", Drive2Letter(Fs->cur_dv), de.name);
}
DirContextDel(dirc);
}
for (i=0;i<j && !res && fuf_flags&FUF_SCAN_PARENTS;i++) {
if (!i)
curname=filename;
else
curname=altname;
old_silent=Silent;
if (!(dirc=DirContextNew(curname)))
Silent(old_silent);
else {
Silent(old_silent);
cur_dir_clus=Name2DirClus(dirc->drive,Fs->cur_dir);
while (!res && StrCompare(Fs->cur_dir,"/")) {
if (!res && fuf_flags & FUF_SCAN_PARENTS)
{
if (dirc=DirContextNew(filename))
{
cur_dir_clus=Name2DirClus(dirc->drive, Fs->cur_dir);
while (!res && StrCompare(Fs->cur_dir, "/")) {
Cd("..");
cur_dir_clus=Name2DirClus(dirc->drive,Fs->cur_dir);
cur_dir_clus=Name2DirClus(dirc->drive, Fs->cur_dir);
switch (dirc->drive->fs_type) {
case FSt_REDSEA:
res=RedSeaFileFind(dirc->drive,cur_dir_clus,
dirc->mask,&de,fuf_flags);
res=RedSeaFileFind(dirc->drive, cur_dir_clus, dirc->mask, &de, fuf_flags);
break;
case FSt_FAT32:
res=FAT32FileFind(dirc->drive,cur_dir_clus,
dirc->mask,&de,fuf_flags);
res=FAT32FileFind(dirc->drive, cur_dir_clus, dirc->mask, &de, fuf_flags);
break;
default:
PrintErr("File System Not Supported\n");
}
}
if (res && _de) {
if (StrCompare(Fs->cur_dir,"/"))
full_name=MStrPrint("%C:%s/%s",
Drive2Letter(Fs->cur_dv),Fs->cur_dir,de.name);
if (StrCompare(Fs->cur_dir, "/"))
full_name=MStrPrint("%C:%s/%s", Drive2Letter(Fs->cur_dv), Fs->cur_dir, de.name);
else
full_name=MStrPrint("%C:/%s",
Drive2Letter(Fs->cur_dv),de.name);
full_name=MStrPrint("%C:/%s", Drive2Letter(Fs->cur_dv), de.name);
}
DirContextDel(dirc);
}
}
if (_de) {
if (res) {
MemCopy(_de,&de,sizeof(CDirEntry));
MemCopy(_de, &de, sizeof(CDirEntry));
_de->full_name=full_name;
} else
MemSet(_de,0,sizeof(CDirEntry));
MemSet(_de, 0, sizeof(CDirEntry));
}
Free(altname);
return res;
}

View file

@ -19,15 +19,6 @@ U8 *FileExtRemove(U8 *src,U8 *dst=NULL)
return dst;
}
Bool IsDotZ(U8 *filename)
{//Does name end in ?
I64 i=StrLen(filename);
if (StrOcc(filename,'.')>1 && filename[i-1]=='Z' && filename[i-2]=='.')
return TRUE;
else
return FALSE;
}
Bool IsDotC(U8 *filename)
{//Does name end in .C?
I64 i=StrLen(filename);
@ -237,10 +228,7 @@ CDirEntry *Cd2DirEntry(CDirEntry *tmpde,U8 *abs_name)
I64 FileAttr(U8 *name,I64 attr=0)
{
if (IsDotZ(name))
attr|=RS_ATTR_COMPRESSED;
else
attr&=~RS_ATTR_COMPRESSED;
attr&=~RS_ATTR_COMPRESSED;
if (IsDotC(name))
attr|=RS_ATTR_CONTIGUOUS;
return attr;
@ -262,17 +250,6 @@ Bool FileNameCheck(U8 *filename)
return TRUE;
}
U8 *ToggleZorNotZ(U8 *name)
{//MAlloc name with Z if not Z or vice versa.
U8 *res;
if (IsDotZ(name)) {
res=StrNew(name);
res[StrLen(name)-2]=0;
} else
res=MStrPrint("%s",name);
return res;
}
U8 *FileNameTmpTxt()
{//Make pretty-safe tmp filename in home dir.
return MStrPrint("~/SysTmp%X.DD",GetTSC>>8&0xFFFFFFFF);

View file

@ -33,7 +33,7 @@ U0 EdLiteUpdate(CLine *head,CLine *cur_line,I64 cur_col,I64 line_start_col)
if (ch=='\t')
k2=(k+4)&~3;
else
 k2=k+1;
k2=k+1;
if (line_start_col<=k<line_start_col+text.cols) {
'' ch;
j=k2-line_start_col;

View file

@ -255,4 +255,4 @@ public U64 sys_font_std[256] = {
0x0000003E061C301E,//ý
0x00003C3C3C3C0000,//þ
0xFFFFFFFFFFFFFFFF,//ÿ
};
};

View file

@ -29,7 +29,7 @@ I64 DayOfWeek(I64 i)
{//Day of week, given 32-bit day since AD 0.
i+=CDATE_BASE_DAY_OF_WEEK;
if (i>=0)
 return i % 7;
return i % 7;
else
return 6-(6-i)%7;
}

View file

@ -2,7 +2,7 @@ I64 HashTypeNum(CHash *tmph)
{//Return bit num of hash type, limited to just types.
if (tmph)
return Bsf(tmph->type & HTG_TYPE_MASK);
 return -1;
return -1;
}
I64 HashVal(CHash *tmph)

View file

@ -1,6 +1,6 @@
asm {
INT_MP_CRASH_ADDR:: //Forward reference to work around compiler
 DU32 &IntMPCrash;
DU32 &IntMPCrash;
INT_WAKE::
PUSH RDX

View file

@ -224,7 +224,7 @@ CBinFile *Load(U8 *filename,I64 ld_flags=0,CBinFile *bfh_addr=INVALID_PTR)
module_base=bfh_addr(U8 *)+sizeof(CBinFile);
absname=FileNameAbs(fbuf);
 Free(fbuf);
Free(fbuf);
fbuf=StrNew(absname);
FileExtRemove(fbuf);
if (fbuf[1]==':' && StrLen(fbuf)>2)

View file

@ -84,7 +84,7 @@ U0 SysGrInit()
text.font = sys_font_std;
//patch some chars
//patch some chars
text.aux_font[10] = text.font[10]; //"Return" symbol
text.aux_font['' - 1] = text.font['' - 1]; //Shift-space 
text.aux_font[255] = text.font[255]; //Block symbol ÿ

View file

@ -40,7 +40,7 @@ GDT_BOOT_DS: DU64 0x00CF92000000FFFF,0; //Gets patched.
GDT_BOOT_CS: DU64 0x00CF9A000000FFFF,0; //Gets patched.
GDT_CS32: DU64 0x00CF9A000000FFFF,0;
GDT_CS64: DU64 0x00209A0000000000,0; //The $LK,"Charter",A="FI:::/Doc/Charter.DD"$ says just ring0.
GDT_CS64_RING3: DU64 0x0020FA0000000000,0; //$LK,"Ring3",A="FI:::/Demo/Lectures/Ring3.CC"$, so you can play with.
GDT_CS64_RING3: DU64 0x0020FA0000000000,0; //$LK,"Ring3",A="FI:::/Demo/Lectures/Ring3.CC"$, so you can play with.
GDT_DS: DU64 0x00CF92000000FFFF,0;
GDT_DS_RING3: DU64 0x00CFF2000000FFFF,0;
GDT_TR: DU8 MP_PROCESSORS_NUM*16 DUP(0);

File diff suppressed because it is too large Load diff

View file

@ -30,7 +30,7 @@
#include "Sched"
#include "Memory/MakeMemory"
#include "FontStd"
#include "StrB"
#include "StrB"
#include "KHashA"
#include "KInterrupts"
#include "KDataTypes"

View file

@ -2716,15 +2716,15 @@ public class CDirEntry
#help_index "File/Program Routines"
//File Util Flags
//See $LK,"ST_FILE_UTIL_FLAGS",A="MN:ST_FILE_UTIL_FLAGS"$
#define FUf_RECURSE 0
#define FUf_DIFF 1
#define FUf_DEL 1
#define FUf_IGNORE 2
#define FUf_ALL 3
#define FUf_CANCEL 4
#define FUf_REPLACE 5
#define FUf_RISKY 5
#define FUf_PUBLIC 6
#define FUf_RECURSE 0
#define FUf_DIFF 1
#define FUf_DEL 1
#define FUf_IGNORE 2
#define FUf_ALL 3
#define FUf_CANCEL 4
#define FUf_REPLACE 5
#define FUf_RISKY 5
#define FUf_PUBLIC 6
#define FUf_MAP 7
#define FUf_EXPAND 8
#define FUf_SINGLE 9
@ -3599,7 +3599,7 @@ public class CCPU //The Gs segment reg points to current CCPU.
};
#help_index "Memory/Page Tables"
#define MEM_MIN_MEG 256 //256 Meg minimum.
#define MEM_MIN_MEG 256 //256 Meg minimum.
#define SYS_FIXED_AREA 0x100000
#define SYS_16MEG_AREA_LIMIT 0x1000000

View file

@ -15,7 +15,7 @@ public _intern IC_BTS Bool Bts(U8 *bit_field,I64 bit); //Bit test and set to one
public _intern IC_LBTC Bool LBtc(U8 *bit_field,I64 bit); //Locked bit test and complement (xor with 1).
public _intern IC_LBTR Bool LBtr(U8 *bit_field,I64 bit); //Locked bit test and reset to zero.
public _intern IC_LBTS Bool LBts(U8 *bit_field,I64 bit); //Locked bit test and set to one.
public _intern IC_POPCNT I64 PopCount(I64 bit_field_val); //Count number of set bits in number.
public _intern IC_POPCNT I64 PopCount(I64 bit_field_val); //Count number of set bits in number.
public _extern _BEQUAL Bool BEqual(U8 *bit_field,I64 bit,Bool val);//Set bit equ to val.
public _extern _BIT_FIELD_EXT_U32 U32 BFieldExtU32(U8 *bit_field,I64 bit,I64 size); //Extract U32 from bit field.
public _extern _BIT_FIELD_OR_U32 U0 BFieldOrU32(U8 *bit_field,I64 bit,U32 pattern); //Or U32 into bit field.

View file

@ -304,12 +304,10 @@ public extern Bool FilesFindMatch(U8 *_test_name,
U8 *files_find_mask,I64 fuf_flags=0);
public extern Bool IsDir(U8 *dir_name);
public extern Bool IsDotC(U8 *filename);
public extern Bool IsDotZ(U8 *filename);
public extern U0 PutDirLink(U8 *dirname,U8 *full_name=NULL);
public extern U0 PutFileLink(U8 *filename,U8 *full_name=NULL,
I64 line=0,Bool plain_text=FALSE);
public extern U0 ToFileLine(U8 *_fl_file_line,U8 **_filename,I64 *_linenum);
public extern U8 *ToggleZorNotZ(U8 *name);
#help_index "File/FileNames;Misc"
public extern U8 *FileNameTmpTxt();

View file

@ -446,7 +446,7 @@ U8 *CAllocAligned(I64 size,I64 alignment,
U8 *ReAlloc(U8 *ptr, U64 new_size, CTask *mem_task=NULL)
{//Resize previously MAlloc'ed chunk. If new_size is zero then act as Free.
//If ptr is NULL then act as MAlloc. if both are NULL/0 does nothing (Free(NULL))
//Useless for changing chunk sizes smaller than 8 bytes because MAlloc allocs 8 bytes at a time.
//Useless for changing chunk sizes smaller than 8 bytes because MAlloc allocs 8 bytes at a time.
U8 *res;
if(!new_size)

View file

@ -510,7 +510,7 @@ I64 Spaces2Tabs(U8 *dst,U8 *src)
} else
break;
}
 src=++src2;
src=++src2;
}
*dst=0;
return chged;

View file

@ -52,6 +52,3 @@ U0 Tmp()
}
}
Tmp;
PaletteSetSmooth;
SwapI64(&text.font,&text.aux_font);


View file

@ -266,7 +266,7 @@ public U0 MemBIOSRep()
case MEM_E820t_PERM_MEM:
"Perm memory:";
case MEM_E820t_RESERVED:
default:
default:
"Reserved :";
break;
}

View file

@ -77,7 +77,7 @@ U0 DocDataFormat(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
case RT_I16: d=*ptr(I16 *); break;
case RT_U16: d=*ptr(U16 *); break;
case RT_I32: d=*ptr(I32 *); break;
 case RT_U32: d=*ptr(U32 *); break;
case RT_U32: d=*ptr(U32 *); break;
default: d=*ptr(I64 *);
}
}

View file

@ -349,7 +349,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
FifoU8Flush(divine.fifo);
DivineBitsInsert(DIVN_GOOD_BITS, KbdMouseEventTime >> DIVN_BAD_BITS);
DivineWord;
}
}
break;
}
}

View file

@ -31,7 +31,7 @@ public class CDolDocGlobals
} doldoc;
MemSet(&doldoc,0,sizeof(CDolDocGlobals));
#include "DocExterns"
#include "DocExterns"
#include "DocBin"
#include "DocNew"
#include "DocForm"

View file

@ -302,7 +302,7 @@ public U0 DrawStdMouse(CDC *dc,I64 x,I64 y)
dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);
dc->thick=1;
GrArrow3(dc,x+8,y+8,0,x,y,0);
}
}
gr.fp_draw_mouse=&DrawStdMouse;

View file

@ -168,7 +168,7 @@ U0 GrInit2()
HashDefineListAdd("ST_SPRITE_ELEM_CODES",SPHT_ELEM_CODE,gr.sprite_hash);
gr.screen_zoom=1;
PaletteSetPastel;
PaletteSetPastel;
gr.to_8_bits =MAlloc(256*sizeof(I64));
gr.to_8_colors=MAlloc(256*sizeof(I64));

View file

@ -11,7 +11,7 @@ Cd(__DIR__);;
#include "Win"
#include "WinMgr"
#include "ZDebug"
#include "Divination"
#include "Divination"
#include "DolDoc/MakeDoc"
LBts(&sys_run_level,RLf_DOC);
#include "Ctrls/MakeCtrls"

View file

@ -118,4 +118,3 @@ public U0 SettingsPop(CTask *task=NULL,I64 flags=0)
Free(tmpse);
}
}


View file

@ -41,10 +41,10 @@ public U0 Collapse(U8 *files_find_mask="*",
DirTreeDel(tmpde1);
}
I64 DocOptEntry(CDoc *,CDocEntry *doc_e,I64 fuf_flags)
I64 DocOptEntry(CDoc *,CDocEntry *doc_e)
{
U8 *st,*st2,**_dst;
I64 i,res=0;
U8 **_dst;
I64 res=0;
if (doc_e->de_flags&DOCEF_LINK && doc_e->de_flags&(DOCEF_AUX_STR|DOCEF_TAG)) {
if (doc_e->de_flags & DOCEF_AUX_STR && doc_e->de_flags & DOCEF_TAG &&
@ -59,37 +59,10 @@ I64 DocOptEntry(CDoc *,CDocEntry *doc_e,I64 fuf_flags)
_dst=&doc_e->aux_str;
else
_dst=&doc_e->tag;
if (StrMatch(".Z",*_dst)) {
st=DocLinkFile(*_dst);
if (FileFind(st)) {
if (IsDotZ(st))
st[StrLen(st)-2]=0;
i=StrLen(st);
if ((st2=StrMatch(st,*_dst)) && st2[i]=='.' && st2[i+1]=='Z') {
StrCopy(st2+i,st2+i+2);
res++;
}
}
Free(st);
}
if (fuf_flags&FUF_RISKY) {
if (doc_e->de_flags & DOCEF_AUX_STR) {
if (st=StrMatch(".Z",doc_e->aux_str)) {
StrCopy(st,st+2);
res++;
}
}
if (doc_e->de_flags&DOCEF_TAG) {
if (st=StrMatch(".Z",doc_e->tag)) {
StrCopy(st,st+2);
res++;
}
}
}
}
return res;
}
I64 DocOptDoc(CDoc *doc,I64 fuf_flags)
I64 DocOptDoc(CDoc *doc)
{//Optimize Doc.
Bool unlock=DocLock(doc);
I64 res=0;
@ -99,8 +72,8 @@ I64 DocOptDoc(CDoc *doc,I64 fuf_flags)
doc_e=doc->head.next;
while (doc_e!=doc) {
doc_e1=doc_e->next;
if (res+=DocOptEntry(doc,doc_e,fuf_flags))
res+=DocOptEntry(doc,doc_e,fuf_flags);
if (res+=DocOptEntry(doc,doc_e))
res+=DocOptEntry(doc,doc_e);
if (doc_e_last && doc_e_last->type&~0xFF00==doc_e->type&~0xFF00 &&
doc_e_last->de_flags==doc_e->de_flags &&
Bt(doldoc.type_flags_chk_dup,doc_e->type_u8) &&
@ -116,18 +89,18 @@ I64 DocOptDoc(CDoc *doc,I64 fuf_flags)
DocUnlock(doc);
return res;
}
I64 DocOptFile(U8 *filename,I64 fuf_flags)
I64 DocOptFile(U8 *filename)
{//Optimize file.
I64 res;
CDoc *doc=DocRead(filename);
if (res=DocOptDoc(doc,fuf_flags)) {
if (res=DocOptDoc(doc)) {
"-%d:%s\n",res,doc->filename.name;
DocWrite(doc);
}
DocDel(doc);
return res;
}
I64 DocOptList(CDirEntry *tmpde,I64 fuf_flags)
I64 DocOptList(CDirEntry *tmpde)
{
I64 res=0;
CDirEntry *tmpde1;
@ -136,10 +109,10 @@ I64 DocOptList(CDirEntry *tmpde,I64 fuf_flags)
if (tmpde->attr & RS_ATTR_DIR) {
if (tmpde->sub) {
"Scanning Directory: %s\n",tmpde->full_name;
res+=DocOptList(tmpde->sub,fuf_flags);
res+=DocOptList(tmpde->sub);
}
} else
res+=DocOptFile(tmpde->full_name,fuf_flags);
res+=DocOptFile(tmpde->full_name);
DirEntryDel(tmpde);
tmpde=tmpde1;
}
@ -151,6 +124,5 @@ public I64 DocOpt(U8 *files_find_mask="*",U8 *fu_flags=NULL)
I64 fuf_flags=0;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$$");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
return DocOptList(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND),
fuf_flags&~FUG_FILES_FIND);
return DocOptList(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND));
}

View file

@ -14,5 +14,5 @@ Cd(__DIR__);;
#include "TaskRep"
#include "ToDolDoc"
#include "ToTXT"
#include "VideoRep"
#include "VideoRep"
Cd("..");;

View file

@ -206,7 +206,7 @@ public U0 MemRep()
"$LK,"VBE framebuffer",A="FF:::/Kernel/KernelA.HH,framebuffer"$\t:%08X-%08X\n", text.fb_alias, text.fb_alias(U8 *) + text.buffer_size - 1;
if (sys_data_bp)
{
"$$BLACK$$Code Heap\t:%010X/%010X$$FG$$\n",sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;
"$$BLACK$$Code Heap\t:%010X/%010X$$FG$$\n",sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;
"$$BLACK$$Data Heap\t:%010X/%010X$$FG$$\n", sys_data_bp->used_u8s,sys_data_bp->alloced_u8s;
} else
"$$BLACK$$Code/Data Heap\t:%08X/%08X$$FG$$\n",sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;

View file

@ -10,7 +10,7 @@ public I64 VideoRep(Bool full=TRUE)
"Vendor name : $$BLACK$$%s$$FG$$\n", sys_vbe_info.vendor;
"Product name : $$BLACK$$%s$$FG$$\n", sys_vbe_info.product_name;
"Product revision : $$BLACK$$%s$$FG$$\n", sys_vbe_info.product_revision;
"Software revision : $$BLACK$$%X.%X$$FG$$\n", sys_vbe_info.software_revision.u8[1], sys_vbe_info.software_revision.u8[0];
"Software revision : $$BLACK$$%X.%X$$FG$$\n", sys_vbe_info.software_revision.u8[1], sys_vbe_info.software_revision.u8[0];
"Hardware memory : $$BLACK$$%d MiB$$FG$$\n", sys_vbe_info.total_memory * 64 / 1024;
"\n\nAll modes shown are 32-bit color.\n\n";
}