From 01778d3ac79c326263f2807dd7a5e30c5d6c1504 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Sun, 8 Oct 2023 08:39:34 -0400 Subject: [PATCH 1/5] upstream gfx goofing-around (stale working dir) --- src/Kernel/KGlobals.ZC | 2 +- src/Kernel/KStart16.ZC | 2 ++ src/Kernel/KernelA.HH | 5 +++++ src/Kernel/KernelB.HH | 1 + src/System/Gr/GrDC.ZC | 4 +++- src/System/Gr/GrScreen.ZC | 45 +++++++++++++++++++++++++++++++------ src/System/Utils/SysRep.ZC | 17 ++++++++++++++ src/System/Utils/ZXERep.ZC | 33 +++++++++++++++++++++++++++ src/System/WallPaper.ZC | Bin 5438 -> 6988 bytes zealbooter/zealbooter.c | 6 +++++ 10 files changed, 106 insertions(+), 9 deletions(-) diff --git a/src/Kernel/KGlobals.ZC b/src/Kernel/KGlobals.ZC index 34cacbe8..dc72054e 100755 --- a/src/Kernel/KGlobals.ZC +++ b/src/Kernel/KGlobals.ZC @@ -13,7 +13,7 @@ CTask *sys_winmgr_task, U8 *rev_bits_table; //Table with U8 bits reversed CDate local_time_offset; F64 *pow10_I64, - sys_os_version = 2.03; + sys_os_version = 2.04; CAutoCompleteDictGlobals acd; CAutoCompleteGlobals ac; diff --git a/src/Kernel/KStart16.ZC b/src/Kernel/KStart16.ZC index 5729bd18..13fef09e 100755 --- a/src/Kernel/KStart16.ZC +++ b/src/Kernel/KStart16.ZC @@ -64,6 +64,8 @@ SYS_BOOT_STACK:: DU32 BOOT_RAM_LIMIT; SYS_IS_UEFI_BOOTED:: DU8 0; +SYS_BOOTLOADER_ID:: DU8 BL_ZEAL; + SYS_FRAMEBUFFER_LIST:: DU8 sizeof(CVideoInfo) * VBE_MODES_NUM DUP(0); #assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE) diff --git a/src/Kernel/KernelA.HH b/src/Kernel/KernelA.HH index 3bf2f6aa..2760f478 100755 --- a/src/Kernel/KernelA.HH +++ b/src/Kernel/KernelA.HH @@ -574,9 +574,14 @@ class CKernel U64 sys_disk_uuid[2]; U32 sys_boot_stack; Bool sys_is_uefi_booted; + U8 sys_bootloader_id; CVideoInfo sys_framebuffer_list[VBE_MODES_NUM]; }; +// Bootloader IDs +#define BL_ZEAL 0 +#define BL_LIMINE 1 + //Run-Levels #define RLf_16BIT 0 #define RLf_VESA 1 diff --git a/src/Kernel/KernelB.HH b/src/Kernel/KernelB.HH index 94865553..9890ad90 100755 --- a/src/Kernel/KernelB.HH +++ b/src/Kernel/KernelB.HH @@ -258,5 +258,6 @@ public _extern SYS_SMBIOS_ENTRY U8 *sys_smbios_entry; #help_index "" public _extern SYS_DISK_UUID U64 sys_disk_uuid[2]; public _extern SYS_IS_UEFI_BOOTED Bool sys_is_uefi_booted; +public _extern SYS_BOOTLOADER_ID U8 sys_bootloader_id; #help_index "" diff --git a/src/System/Gr/GrDC.ZC b/src/System/Gr/GrDC.ZC index aa65bc61..88bd5803 100755 --- a/src/System/Gr/GrDC.ZC +++ b/src/System/Gr/GrDC.ZC @@ -214,7 +214,9 @@ public CDC *DCNew(I64 width, I64 height, CTask *task=NULL, Bool null_bitmap=FALS res->win_task = task; res->mem_task = task; res->width = width; - res->width_internal = (width + 7) & ~7; +// res->width_internal = (width + 7) & ~7; + res->width_internal = width / 8 * 8; +// res->width_internal = width; res->height = height; if (null_bitmap) res->flags |= DCF_DONT_DRAW; diff --git a/src/System/Gr/GrScreen.ZC b/src/System/Gr/GrScreen.ZC index 1c8e64e6..8c9ed2d8 100755 --- a/src/System/Gr/GrScreen.ZC +++ b/src/System/Gr/GrScreen.ZC @@ -34,7 +34,7 @@ U0 GrUpdateTaskWin(CTask *task) if (gr.fp_wall_paper) (*gr.fp_wall_paper)(task); } - else if (!(task->win_inhibit & WIF_SELF_DOC)) + /*else*/ if (!(task->win_inhibit & WIF_SELF_DOC)) DocUpdateTaskDocs(task); if (TaskValidate(task)) { @@ -360,25 +360,45 @@ U0 DCBlotColor8(CDC *dc, CDC *img) U0 GrCalcScreenUpdates() { U16 *screen, *last_screen = gr.screen_cache; - U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2; + U64 i, j, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2; + U64 w, d;//, p; + + w = GR_WIDTH; +// p = (GR_WIDTH + 7) & ~7; + d = GR_WIDTH / 8 * 8; if (gr.screen_zoom == 1) screen = gr.dc2->body; else screen = gr.zoomed_dc->body; - for (i = 0; i < diffs_size; i++) + for (i = j = 0; i < diffs_size; i++, j++) { + if (j != 0 && j % (d/2) == 0 && d != w) + { + j += (w - d) / 2; + } +// if (screen[j] != last_screen[j]) if (screen[i] != last_screen[i]) - dst[i] = src[i]; +// dst[i] = src[i]; + dst[j] = src[j]; + } MemCopy(gr.screen_cache, screen, diffs_size * 2); } U0 GrUpdateScreen32() { - U64 size, *dst; +// U64 size, *dst; + U64 size; + U32 *dst; U8 *src; + U64 w, i, p, d; + + w = GR_WIDTH; + i = 0; + p = (GR_WIDTH + 7) & ~7; + d = GR_WIDTH / 8 * 8; if (gr.screen_zoom == 1) { @@ -392,8 +412,19 @@ U0 GrUpdateScreen32() size = src + gr.zoomed_dc->height * gr.zoomed_dc->width_internal; } dst = text.raw_screen; - while (src < size) //draw 2 pixels at a time - *dst++ = gr_palette[*src++ & 0xFF] | gr_palette[*src++ & 0xFF] << 32; + while (src < size) + { + *dst++ = gr_palette[*src++ & 0xFF]; + i++; + + if (i == d && d != w) + { + i = w - d; + dst += i; + i = 0; + } + + } GrCalcScreenUpdates; diff --git a/src/System/Utils/SysRep.ZC b/src/System/Utils/SysRep.ZC index d6bf571e..5a15dbdd 100755 --- a/src/System/Utils/SysRep.ZC +++ b/src/System/Utils/SysRep.ZC @@ -1220,3 +1220,20 @@ public U0 BIOSRep() {//Wrapper around $LK,"SysRep",A="MN:SysRep"$() to only show BIOS info. SysRep(SMBIOSt_BIOS); } + +/* +U0 SMBIOSWallPaperInit() +{ + CSMBIOSSystemInfo *sys_info = SMBIOSStructGet(SMBIOSt_SYSTEM); + U8 *company = SMBIOSStr(sys_info, sys_info->manufacturer); + + if (!StrCompare(company, "VMware, Inc.")) + wall->host_ch = 'W'; + else if (!StrCompare(company, "innotek GmbH")) + wall->host_ch = 'V'; + else if (!StrCompare(company, "QEMU")) + wall->host_ch = 'Q'; + else + wall->host_ch = 'M'; +} SMBIOSWallPaperInit; +*/ diff --git a/src/System/Utils/ZXERep.ZC b/src/System/Utils/ZXERep.ZC index c9bc7b62..d6009698 100755 --- a/src/System/Utils/ZXERep.ZC +++ b/src/System/Utils/ZXERep.ZC @@ -33,6 +33,8 @@ public Bool ZXERep(U8 *filename) CZXE *zxe; CHashExport *saved_hash_ptr = NULL; + "%c", 20; + fbuf = ExtDefault(filename, "ZXE"); if (!(zxe = FileRead(fbuf, &size))) @@ -60,6 +62,7 @@ public Bool ZXERep(U8 *filename) ptr = zxe(U8 *) + zxe->patch_table_offset; while (etype = *ptr++) { + saved_hash_ptr = NULL; i = *ptr(U32 *)++; sptr = ptr; ptr += StrLen(sptr) + 1; @@ -71,6 +74,30 @@ public Bool ZXERep(U8 *filename) saved_hash_ptr = HashFind(sptr, Fs->hash_table, HTG_ALL); if (!saved_hash_ptr) "Unresolved Reference:%s\n", sptr; + else + "%s", sptr; + break; + + case IET_REL32_EXPORT: + "$$TR,\"ASM\"$$\n$$ID,2$$"; + Un(i + zxe(U8 *) + sizeof(CZXE)); + "\n$$ID,-2$$\n"; + "ZXERep REL32_EXPORT"; + break; + case IET_IMM32_EXPORT: + "ZXERep IMM32_EXPORT"; + break; + case IET_REL64_EXPORT: + "ZXERep REL64_EXPORT"; + break; + case IET_IMM64_EXPORT: + "ZXERep IMM64_EXPORT"; + break; + case IET_MAIN: + "ZXERep IET_MAIN"; + break; + case IET_END: + "ZXERep IET_END"; break; case IET_ABS_ADDR: @@ -92,6 +119,10 @@ public Bool ZXERep(U8 *filename) for (j = 0; j < i; j++) "%X ", *ptr(U32 *)++; break; + + default: + "ZXERep missing IET:%d", etype; + break; } '\n'; } @@ -102,5 +133,7 @@ br_done2: br_done1: Free(fbuf); + "%c", 20; + return res; } diff --git a/src/System/WallPaper.ZC b/src/System/WallPaper.ZC index 625cc7df5a1d660547887bd107c5b454a0bbf87c..6e036ccc83d8f21819123c9ee97443e90e276dfe 100755 GIT binary patch delta 1494 zcmb_cT~E_c7!FaQB^kSr3!{lSHd$zKj17U15it8GtVv6u-KJtp({-n;u(hN;a}YK2 z-pd+;m)?41;=R8>FZ>nW`V)LlTi7N8z3}cm=RD8zew^o=uXEp4KA$G8pym_V6+o0?({&^pqHCt-){8SVD`262z{w(VekZHhUB!|Yn{ zeXFLMluiQ57yBl0AEufh+zZeU|q$>WXH1|!fpC#bP#+@-U8lD zwWui7JWHiR_%Z}Ofh25^h0wMT=b!kx?dx4^*?Plu32yRJObn_~&=~2yRNYbqVLOd{ za;{Cwh_oM3n%}dD*^2b3Zre4Q*wbw){}M8ohL2HE()Wadl!tZ9-J@KFX?WN;q|q5n z5@m5)h=D2Efi#MQiTtNZb>A~H-PLE==Od-UBy~+K>8c_R)vJtF5!ZW;?Sl~p&8b&{ zD+RS&R>k^Rm$b>sm5g$|JfvP8#fAe(T(AXy$=xk1jGN!?IhswGY#K$DZMijh1+01F-jH>c#={0SV^huJR1@-3w_2Xj!HuqEft`AGle8{w zx3In68d$UHiYrUpBD|H&w(ELa4kF3j&t*gRU(n~EvWr&SvFqzEu;<&ZGc@w$wJ$%D@2~ga3QC$>6ctT7@d@sTj^#3Q;j@MaOcWmy zuWOPmOt@%GbnU5D734^s6s0I6uqHbnCq9mDBbhDo~KB=$fe zcr~-or*5EM%6<6XN>s?hTr8MIY+dfbMjDBZnPGXJf|(IJLDJdBv!SOhSFs%j{-{H= f)oE1zP>~{6QknYSWOfC)_6L2y-UW8>Y3AK;L))k7 delta 74 zcmX?Owohxr4BpAJd3AVwQ**6U4Gaw;6r2M>Ctu}lm>j{^Ir$u`!(?}U2__Ts$qD?) b5K4OTeSRax+RaNurm;-kFR3?qr_^Kswapo2 diff --git a/zealbooter/zealbooter.c b/zealbooter/zealbooter.c index a8a081da..8d70a6d4 100644 --- a/zealbooter/zealbooter.c +++ b/zealbooter/zealbooter.c @@ -123,9 +123,13 @@ struct CKernel { uint64_t sys_disk_uuid[2]; uint32_t sys_boot_stack; uint8_t sys_is_uefi_booted; + uint8_t sys_bootloader_id; struct CVideoInfo sys_framebuffer_list[VBE_MODES_NUM]; } __attribute__((packed)); +#define BL_ZEAL 0 +#define BL_LIMINE 1 + #define BOOT_SRC_RAM 2 #define BOOT_SRC_HDD 3 #define BOOT_SRC_DVD 4 @@ -349,6 +353,8 @@ void _start(void) { kernel->sys_is_uefi_booted = true; } + kernel->sys_bootloader_id = BL_LIMINE; + memcpy(trampoline_phys, trampoline, trampoline_size); memcpy((void *)final_address, kernel, module_kernel->size); From de8482ced73c34e23a570cd62d07b7f52ff5e148 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Fri, 13 Oct 2023 04:45:08 -0400 Subject: [PATCH 2/5] Move SMBIOS code into Kernel, refactor WallPaper BootCode logic --- src/Kernel/KDefine.ZC | 654 ++++++++++++++++++++++++++++++++ src/Kernel/Kernel.PRJ | 1 + src/Kernel/KernelC.HH | 7 +- src/Kernel/SMBIOS.ZC | 75 ++++ src/System/Utils/SysRep.ZC | 746 ------------------------------------- src/System/WallPaper.ZC | Bin 6988 -> 7562 bytes 6 files changed, 736 insertions(+), 747 deletions(-) create mode 100755 src/Kernel/SMBIOS.ZC diff --git a/src/Kernel/KDefine.ZC b/src/Kernel/KDefine.ZC index 9e643a3a..235b628c 100755 --- a/src/Kernel/KDefine.ZC +++ b/src/Kernel/KDefine.ZC @@ -324,6 +324,660 @@ U0 SysDefinesLoad() "MP Crash\0" "Wake\0" "Debug\0"); + + //SMBIOS parsing. See $LK+PU,"SMBIOS.ZC",A="FI:::/Kernel/SMBIOS.ZC"$. + //Based on SMBIOS specification 3.3.0 (document "DSP0134") + //Section 7.1.1 line 925 (BIOS characteristics) + DefineListLoad("ST_SMBIOS_BIOS_FLAGS", + + " \0" + " \0" + " \0" + " \0" + "ISA\0" + "MCA\0" + "EISA\0" + "PCI\0" + "PC Card\0" + "Plug and Play\0" + "APM\0" + "Flashable BIOS\0" + "BIOS shadowing\0" + "VESA Local Bus\0" + "ESCD\0" + "CD Boot\0" + "Selectable boot\0" + "BIOS ROM socketed\0" + "PC Card Boot\0" + "Enhanced Disk Drive Services\0" + " \0" + " \0" + "INT 0x13 5.25\"/360 KB Floppy Support\0" + "INT 0x13 5.25\"/1.2 MB Floppy Support\0" + "INT 0x13 3.5\"/720 KB Floppy Support\0" + "INT 0x13 3.5\"/2.88 MB Floppy Support\0" + "INT 0x05 Screen Printing\0" + "INT 0x09 8042 Keyboard\0" + "INT 0x14 Serial\0" + "INT 0x17 Printer\0" + "INT 0x10 CGA/Mono Video"); + + //Section 7.1.2.1 line 931 (BIOS characteristics extension byte 1) + DefineListLoad("ST_SMBIOS_BIOS_FLAGSEXT1", + + "ACPI\0" + "USB Legacy\0" + " \0" + " \0" + " \0" + " \0" + "Serial Boot\0" + "Smart Battery"); + + //Section 7.1.2.2 line 935 (BIOS characteristics extension byte 2) + DefineListLoad("ST_SMBIOS_BIOS_FLAGSEXT2", + + "BIOS Boot\0" + "Network Boot\0" + "Targeted Content Distribution\0" + "UEFI\0" + "Virtual Machine"); + + //Section 7.2.2 line 959 (system wakeup types) + DefineListLoad("ST_SMBIOS_WAKEUP_TYPES", + + " \0" + "Other\0" + "Unknown\0" + "APM Timer\0" + "Modem Ring\0" + "LAN Remote\0" + "Power Switch\0" + "PCI PME#\0" + "AC Power Restored"); + + //Section 7.3.1 line 972 (baseboard feature flags) + DefineListLoad("ST_SMBIOS_BASEBOARD_FLAGS", + + "Hosting Board (Motherboard)\0" + "Requires Auxilary Board\0" + "Removable\0" + "Replaceable\0" + "Hot Swappable"); + + //Section 7.3.2 line 977 (baseboard board types) + DefineListLoad("ST_SMBIOS_BASEBOARD_TYPES", + + " \0" + "Unknown\0" + "Other\0" + "Server Blade\0" + "Connectivity Switch\0" + "System Management Module\0" + "Processor Module\0" + "I/O Module\0" + "Daughterboard\0" + "Motherboard\0" + "Processor/Memory Module\0" + "Processor/IO Module\0" + "Interconnect Board\0"); + + //Section 7.4.1 line 988 (system enclosure types) + DefineListLoad("ST_SMBIOS_ENCLOSURE_TYPES", + + " \0" + "Other\0" + "Unknown\0" + "Desktop\0" + "Low Profile Desktop\0" + "Pizza Box\0" + "Mini Tower\0" + "Tower\0" + "Portable\0" + "Laptop\0" + "Notebook\0" + "Hand Held\0" + "Docking Station\0" + "All-in-One\0" + "Sub Notebook\0" + "Space-saving\0" + "Lunch box\0" + "Main Server Chassis\0" + "Expansion Chassis\0" + "SubChassis\0" + "Bus Expansion Chassis\0" + "Peripheral Chassis\0" + "RAID Chassis\0" + "Rack Mount Chassis\0" + "Sealed-case PC\0" + "Multi-system Chassis\0" + "Compact PCI\0" + "Advanced TCA\0" + "Blade\0" + "Blade Enclosure\0" + "Tablet\0" + "Convertible\0" + "Detachable\0" + "IoT Gateway\0" + "Embedded PC\0" + "Mini PC\0" + "Stick PC"); + + //Section 7.4.2 line 991 (enclosure states) + DefineListLoad("ST_SMBIOS_ENCLOSURE_STATES", + + " \0" + "Other\0" + "Unknown\0" + "Safe\0" + "Warning\0" + "Critical\0" + "Non-Recoverable"); + + //Section 7.4.3 line 994 (enclosure security status field) + DefineListLoad("ST_SMBIOS_ENCLOSURE_SECURITY_STATUSES", + + " \0" + "Other\0" + "Unknown\0" + "None\0" + "External Interface Locked Out\0" + "External Interface Enabled"); + + //Section 7.5.1 line 1014 (processor type field) + DefineListLoad("ST_SMBIOS_PROCESSOR_TYPES", + + " \0" + "Other\0" + "Unknown\0" + "Central Processor\0" + "Math Processor\0" + "DSP Processor\0" + "Video Processor"); + //Section 7.5.4 line 1050 (processor voltage field) + + DefineListLoad("ST_SMBIOS_PROCESSOR_VOLTAGE_LEVELS", + + "5V\0" + "3.3V\0" + "2.9V"); + + DefineListLoad("ST_CPUID_1_EDX_FLAGS", + + "x87 FPU\0" + "Virtual 8086 Mode Enhancements\0" + "Debugging Extensions\0" + "Page Size Extensions\0" + "Time Stamp Counter\0" + "MSRs\0" + "Page Address Extension\0" + "Machine Check Exceptions\0" + "CMPXCHG8B\0" + "APIC\0" + " \0" + "SYSENTER/SYSEXIT\0" + "Memory Type Range Registers\0" + "Page Global Bit\0" + "Machine Check Architecture\0" + "CMOV Instructions\0" + "Page Attribute Table\0" + "36 Bit Page Size Extension\0" + "Processor Serial Number\0" + "CLFLUSH\0" + " \0" + "Debug Store\0" + "ACPI\0" + "MMX\0" + "FXSAVE/FXRSTOR\0" + "SSE\0" + "SSE2\0" + "Self Snoop\0" + "HTT\0" + "Thermal Monitor\0" + " \0" + "Pending Break Enable\0"); + + DefineListLoad("ST_CPUID_1_ECX_FLAGS", + + "SSE3\0" + "PCLMULQDQ\0" + "64 bit DS AREA\0" + "MONITOR/MWAIT\0" + "CPL Qualified Debug Store\0" + "Virtual Machine Extensions\0" + "Safer Mode Extensions\0" + " \0" + "Thermal Monitor 2\0" + "SSSE3\0" + "L1 Context ID\0" + "IA32_DEBUG_INTERFACE\0" + "FMA Extensions\0" + "CMPXCHG16B\0" + "xTPR Update Control\0" + "Perfmon and Debug Capability\0" + " \0" + "Process Context Identifiers\0" + "MMIO Prefetch\0" + "SSE4.1\0" + "SSE4.2\0" + "x2APIC\0" + "MOVBE\0" + "POPCNT\0" + "TSC Deadline\0" + "AESNI\0" + "XSAVE\0" + "OSXSAVE\0" + "AVX\0" + "F16C\0" + "RDRAND"); + + //Section 7.5.5 line 1058 (upgrade field) + DefineListLoad("ST_SMBIOS_PROCESSOR_UPGRADES", + + " \0" + "Other\0" + "Unknown\0" + "Daughterboard\0" + "ZIF Socket\0" + "Replacable Piggy Back\0" + "None\0" + "LIF Socket\0" + "Slot 1\0" + "Slot2\0" + "370-pin Socket\0" + "Slot A\0" + "Slot M\0" + "Socket 423\0" + "Socket A (Socket 462)\0" + "Socket 478\0" + "754\0" + "940\0" + "939\0" + "mPGA604\0" + "LGA771\0" + "LGA775\0" + "S1\0" + "AM2\0" + "F (1207)\0" + "LGA1366\0" + "G34\0" + "AM3\0" + "C32\0" + "LGA1156\0" + "LGA1567\0" + "PGA988A\0" + "BGA1288\0" + "rPGA988B\0" + "BGA1023\0" + "BGA1224\0" + "LGA1155\0" + "LGA1356\0" + "LGA2011\0" + "FS1\0" + "FS2\0" + "FM1\FM2\0" + "LGA2011-3\0" + "LGA1356-3\0" + "LGA1150\0" + "BGA1168\0" + "BGA1234\BGA1364\0" + "AM4\0" + "LGA1151\0" + "BGA1440\0" + "BGA1515\0" + "LGA3647-1\0" + "SP3\0" + "SP3r2\0" + "LGA2066\0" + "BGA1932\0" + "BGA1510\0" + "BGA1528"); + + //Section 7.5.9 line 1110 (processor characteristics) + DefineListLoad("ST_SMBIOS_PROCESSOR_FLAGS", + + " \0" + " \0" + "64 Bit\0" + "Multicore\0" + "HyperThreading\0" + "NX/XD Protection\0" + "Enhanced Virtualization\0" + "Power/Performance Control\0" + "128 Bit Capable"); + + //Section 7.8.2 line 1178 (cache information SRAM type field) + DefineListLoad("ST_SMBIOS_CACHE_SRAM_TYPES", + + "Other\0" + "Unknown\0" + "Non-Burst\0" + "Burst\0" + "Pipeline Burst\0" + "Synchronous\0" + "Asynchronous"); + + //Section 7.8.6 line 1193 (cache information associativity field) + DefineListLoad("ST_SMBIOS_CACHE_ASSOCIATIVITY", + + " \0" + "Other\0" + "Unknown\0" + "Direct Mapped\0" + "2-way Set-Associative\0" + "4-way Set-Associative\0" + "Fully Associative\0" + "8-way Set-Associative\0" + "16-way Set-Associative\0" + "12-way Set-Associative\0" + "24-way Set-Associative\0" + "32-way Set-Associative\0" + "48-way Set-Associative\0" + "64-way Set-Associative\0" + "20-way Set-Associative"); + + //Section 7.9.2 line 1219 (connector type field) + DefineListLoad("ST_SMBIOS_CONNECTOR_TYPES", + + "None\0" + "Centronics\0" + "Mini Centronics\0" + "Proprietary\0" + "DB-25 Pin Male\0" + "DB-25 Pin Female\0" + "DB-15 Pin Male\0" + "DB-15 Pin Female\0" + "DB-9 Pin Male\0" + "DB-9 Pin Female\0" + "RJ-11\0" + "RJ-45\0" + "50-Pin MiniSCSI\0" + "Mini-DIN\0" + "Micro-DIN\0" + "PS/2\0" + "Infrared\0" + "HP-HIL\0" + "Access Bus (USB)\0" + "SSA SCSI\0" + "Circular DIN-8 Male\0" + "Circular DIN-8 Female\0" + "Onboard IDE\0" + "Onboard Floppy\0" + "9-Pin Dual Inline (Pin 10 Cut)\0" + "25-Pin Dual Inline (Pin 26 Cut)\0" + "50-Pin Dual Inline\0" + "68-Pin Dual Inline\0" + "Onboard CD-ROM Sound Input\0" + "Mini-Centronics Type-14\0" + "Mini-Centronics Type-26\0" + "Mini-Jack (Headphones)\0" + "BNC\0" + "1394\0" + "SAS\SATA Plug\0" + "USB Type-C"); + + //Section 7.9.3 line 1222 (port type field) + DefineListLoad("ST_SMBIOS_PORT_TYPES", + + "None\0" + "Parallel Port XT/AT Compatible\0" + "Parallel Port PS/2\0" + "Parallel Port ECP\0" + "Parallel Port EPP\0" + "Parallel Port ECP/EPP\0" + "Serial Port XT/AT Compatible\0" + "Serial Port 16450 Compatible\0" + "Serial Port 16550 Compatible\0" + "Serial Port 16550A Compatible\0" + "SCSI Port\0" + "MIDI Port\0" + "Joystick Port\0" + "Keyboard Port\0" + "Mouse Port\0" + "SSA SCSI\0" + "USB\0" + "FireWire (IEEE 1394)\0" + "PCMCIA Type I\0" + "PCMCIA Type II\0" + "PCMCIA Type III\0" + "Cardbus\0" + "Access Bus Port\0" + "SCSI II\0" + "SCSI Wide\0" + " \0" + " \0" + " \0" + "Video Port\0" + "Audio Port\0" + "Modem Port\0" + "Network Port\0" + "SATA\0" + "SAS\0" + "MFDP (Multi-Function Display Port\0" + "Thunderbolt\0" + "8251 Compatible\0" + "8251 FIFO Compatible"); + + //Section 7.10.1 line 1229 (slot type) + DefineListLoad("ST_SMBIOS_SLOT_TYPES1", + + " \0" + "Other\0" + "Unknown\0" + "ISA\0" + "MCA\0" + "EISA\0" + "PCI\0" + "PC Card (PCMCIA)\0" + "VESA Local Bus\0" + "Proprietary\0" + "Proprietary Card Slot\0" + "Proprietary Memory Card Slot\0" + "I/O Riser Card Slot\0" + "NuBus\0" + "PCI - 66 MHz Capable\0" + "AGP\0" + "AGP 2X\0" + "AGP 4X\0" + "PCI-X\0" + "AGP 8X\0" + "M.2 Socket 1-DP (Mechanical Key A)\0" + "M.2 Socket 1-SD (Mechanical Key E)\0" + "M.2 Socket 2 (Mechanical Key B)\0" + "M.2 Socket 3 (Mechanical Key M)\0" + "MXM Type I\0" + "MXM Type II\0" + "MXM Type III (Standard Connector)\0" + "MXM Type III (HE Connector)\0" + "MXM Type IV\0" + "MXM 3.0 Type A\0" + "MXM 3.0 Type B\0" + "PCI Express Gen 2 SFF-8639\0" + "PCI Express Gen 3 SFF-8639\0" + "PCI Express Mini 52-Pin with bottom-side keep-outs\0" + "PCI Express Mini 52-Pin without bottom-side keep-outs\0" + "PCI Express Mini 76-Pin\0" + "CXL Flexbus 1.0"); + + DefineListLoad("ST_SMBIOS_SLOT_TYPES2", + + " \0" + " \0" + " \0" + " \0" + " \0" + "PCI Express\0" + "PCI Express 1x\0" + "PCI Express 2x\0" + "PCI Express 4x\0" + "PCI Express 8x\0" + "PCI Express 16x\0" + "PCI Express Gen 2\0" + "PCI Express Gen 2 1x\0" + "PCI Express Gen 2 2x\0" + "PCI Express Gen 2 4x\0" + "PCI Express Gen 2 8x\0" + "PCI Express Gen 2 16x\0" + "PCI Express Gen 3\0" + "PCI Express Gen 3 1x\0" + "PCI Express Gen 3 2x\0" + "PCI Express Gen 3 4x\0" + "PCI Express Gen 3 8x\0" + "PCI Express Gen 3 16x\0" + "PCI Express Gen 4\0" + "PCI Express Gen 4 1x\0" + "PCI Express Gen 4 2x\0" + "PCI Express Gen 4 4x\0" + "PCI Express Gen 4 8x\0" + "PCI Express Gen 4 16x"); + + //Section 7.10.2 line 1244 (slot data bus width field) + DefineListLoad("ST_SMBIOS_SLOT_DATA_BUS_WIDTHS", + + " \0" + "Other\0" + "Unknown\0" + "8 Bit\0" + "16 Bit\0" + "32 Bit\0" + "64 Bit\0" + "128 Bit\0" + "1x\0" + "2x\0" + "4x\0" + "8x\0" + "12x\0" + "16x\0" + "32x"); + + //Section 7.10.6 line 1259 (slot characteristics 1 field) + DefineListLoad("ST_SMBIOS_SLOT_FLAGS1", + + " \0" + "5.0 V\0" + "3.3 V\0" + "Shared Slot Opening\0" + "PC Card 16\0" + "CardBus\0" + "Zoom Video\0" + "Modem Ring Resume"); + + //Section 7.10.7 line 1262 (slot characteristics 2 field) + DefineListLoad("ST_SMBIOS_SLOT_FLAGS2", + + "PCI Power Management Event (PME#) Signal\0" + "HotPlug\0" + "SMBus\0" + "Bifurcation"); + + //Section 7.17.1 line 1523 (memory array location field) + DefineListLoad("ST_SMBIOS_PHYMEM_LOCATIONS", + + " \0" + "Other\0" + "Unknown\0" + "Motherboard\0" + "ISA Add-On Card\0" + "EISA Add-On Card\0" + "PCI Add-On Card\0" + "MCA Add-On Card\0" + "PCMCIA Add-On Card\0" + "Proprietary Add-On Card\0" + "NuBus\0" + " \0" + " \0" + " \0" + " \0" + " \0"); + + //Section 7.17.2 line 1527 (memory array use field) + DefineListLoad("ST_SMBIOS_PHYMEM_USES", + + " \0" + "Other\0" + "Unknown\0" + "System Memory\0" + "Video Memory\0" + "Flash Memory\0" + "Non-Volatile RAM\0" + "Cache Memory"); + + //Section 7.18.1 line 1542 (form factor field) + DefineListLoad("ST_SMBIOS_MEMDEV_FORM_FACTORS", + + " \0" + "Other\0" + "Unknown\0" + "SIMM\0" + "SIP\0" + "DIP\0" + "ZIP\0" + "Proprietary Card\0" + "DIMM\0" + "TSOP\0" + "Row of Chips\0" + "RIMM\0" + "SODIMM\0" + "SRIMM\0" + "FB-DIMM\0" + "Die"); + + //Section 7.18.2 line 1546 (type field) + DefineListLoad("ST_SMBIOS_MEMDEV_TYPES", + + " \0" + "Unknown\0" + "DRAM\0" + "EDRAM\0" + "VRAM\0" + "SRAM\0" + "RAM\0" + "ROM\0" + "FLASH\0" + "EEPROM\0" + "FEPROM\0" + "EPROM\0" + "CDRAM\0" + "3DRAM\0" + "SDRAM\0" + "SGRAM\0" + "RDRAM\0" + "DDR\0" + "DDR2\0" + "DDR2 FB-DIMM\0" + " \0" + " \0" + " \0" + "DDR3\0" + "FBD2\0" + "DDR4\0" + "LPDDR\0" + "LPDDR2\0" + "LPDDR3\0" + "LPDDR4\0" + "Logical Non-Volatile Device\0" + "HBM (High Bandwidth Memory)\0" + "HBM2 (High Bandwidth Memory Gen 2)"); + + //Section 7.18.3 line 1550 (type detail field) + DefineListLoad("ST_SMBIOS_MEMDEV_TYPE_DETAILS", + + " \0" + " \0" + " \0" + "Fast Paged\0" + "Static Column\0" + "Psuedo Static\0" + "RAMBUS\0" + "Synchronous\0" + "CMOS\0" + "EDO\0" + "Window DRAM\0" + "Cache DRAM\0" + "Non Volatile\0" + "Registered (Buffered)\0" + "Unregistered (Unbuffered)\0" + "LRDIMM"); } U8 *Color2Str(U8 *buf, CColorROPU32 c) diff --git a/src/Kernel/Kernel.PRJ b/src/Kernel/Kernel.PRJ index 9487a413..7dda5c80 100755 --- a/src/Kernel/Kernel.PRJ +++ b/src/Kernel/Kernel.PRJ @@ -56,6 +56,7 @@ #include "EdLite" #include "BlkDev/MakeBlkDev" #include "FunSeg" +#include "SMBIOS" #include "KMain" #exe {KConfigDel(kernel_config);}; diff --git a/src/Kernel/KernelC.HH b/src/Kernel/KernelC.HH index 7b0ddfb1..37fb971a 100755 --- a/src/Kernel/KernelC.HH +++ b/src/Kernel/KernelC.HH @@ -637,9 +637,14 @@ public extern I64 IntEntryAlloc(); public extern I64 IntEntryFree(I64 irq); #help_index "ScreenCast;Cmd Line (Typically)" -public extern Bool ScreenCast(Bool val=ON, Bool just_audio=FALSE, U8 *print_format="B:/Tmp/%X.GR") +public extern Bool ScreenCast(Bool val=ON, Bool just_audio=FALSE, U8 *print_format="B:/Tmp/%X.GR"); public extern CScreenCastGlobals screencast; +#help_index "SMBIOS" +extern Bool SMBIOSEntryScan(CSMBIOSEntryPoint **entry); +extern U8 *SMBIOSStr(CSMBIOSHeader *header, I64 str_num, U8 *default="None"); +extern CSMBIOSHeader *SMBIOSStructGet(I64 type=0xFFFFF, I64 handle=0xFFFFF, CSMBIOSHeader *head=NULL); + #help_index "Sound" #help_file "::/Doc/Sound" public extern U0 Beep(I8 ona=62, Bool busy=FALSE); diff --git a/src/Kernel/SMBIOS.ZC b/src/Kernel/SMBIOS.ZC new file mode 100755 index 00000000..25d42ae9 --- /dev/null +++ b/src/Kernel/SMBIOS.ZC @@ -0,0 +1,75 @@ +//SMBIOS parsing. +//See $LK+PU,"KDefine.ZC",A="FF:::/Kernel/KDefine.ZC,SMBIOS"$. +//Based on SMBIOS specification 3.3.0 (document "DSP0134") + +Bool SMBIOSEntryScan(CSMBIOSEntryPoint **entry) +{//Search 0xF0000 - 0x100000 for SMBIOS Entry Point structure. + I64 i; + U8 noreg checksum = 0, *mem = 0xF0000; + + if (sys_smbios_entry) + { + *entry = sys_smbios_entry; + return TRUE; + } + + do + { + if (!MemCompare(mem, "_SM_", 4)) + { + *entry = mem; + for (i = 0; i < (*entry)->length; i++) + checksum += mem[i]; + + if (checksum == 0) //valid checksums sum to zero + break; + } + } + while ((mem += 16) < 0x100000); //anchor sits on 16-byte boundary + + return mem != 0x100000; +} + +U8 *SMBIOSStr(CSMBIOSHeader *header, I64 str_num, U8 *default="None") +{//Get string str_num from end of structure (string section). + I64 i; + U8* ptr = header(U8 *) + header->length; + + if (!str_num) + return default; + + for (i = 1; i < str_num; i++) + { + while (*ptr++); + if (!ptr[0] && !ptr[1]) //structure ends in double NULL + return default; + } + + return ptr; +} + +CSMBIOSHeader *SMBIOSStructGet(I64 type=0xFFFFF, I64 handle=0xFFFFF, CSMBIOSHeader *head=NULL) +{//Search for struct with type or handle. Return NULL if not found. + I64 i; + CSMBIOSEntryPoint *entry; + + if (!head) + { + if (!SMBIOSEntryScan(&entry)) + return NULL; + head = entry->table_address; + } + while (head->type != 127) + { + if (head->handle == handle) + return head; + if (head->type == type) + return head; + + head = head(U8 *) + head->length; + for (i = 1; head(U8 *)[i - 1] || head(U8 *)[i]; i++); + head = head(U8 *) + i + 1; + } + + return NULL; +} diff --git a/src/System/Utils/SysRep.ZC b/src/System/Utils/SysRep.ZC index 5a15dbdd..ca0a7619 100755 --- a/src/System/Utils/SysRep.ZC +++ b/src/System/Utils/SysRep.ZC @@ -1,732 +1,3 @@ -//SMBIOS parsing. -//Based on SMBIOS specification 3.3.0 (document "DSP0134") -U0 SMBIOSInit() -{ - //Section 7.1.1 line 925 (BIOS characteristics) - DefineListLoad("ST_SMBIOS_BIOS_FLAGS", - - " \0" - " \0" - " \0" - " \0" - "ISA\0" - "MCA\0" - "EISA\0" - "PCI\0" - "PC Card\0" - "Plug and Play\0" - "APM\0" - "Flashable BIOS\0" - "BIOS shadowing\0" - "VESA Local Bus\0" - "ESCD\0" - "CD Boot\0" - "Selectable boot\0" - "BIOS ROM socketed\0" - "PC Card Boot\0" - "Enhanced Disk Drive Services\0" - " \0" - " \0" - "INT 0x13 5.25\"/360 KB Floppy Support\0" - "INT 0x13 5.25\"/1.2 MB Floppy Support\0" - "INT 0x13 3.5\"/720 KB Floppy Support\0" - "INT 0x13 3.5\"/2.88 MB Floppy Support\0" - "INT 0x05 Screen Printing\0" - "INT 0x09 8042 Keyboard\0" - "INT 0x14 Serial\0" - "INT 0x17 Printer\0" - "INT 0x10 CGA/Mono Video"); - - //Section 7.1.2.1 line 931 (BIOS characteristics extension byte 1) - DefineListLoad("ST_SMBIOS_BIOS_FLAGSEXT1", - - "ACPI\0" - "USB Legacy\0" - " \0" - " \0" - " \0" - " \0" - "Serial Boot\0" - "Smart Battery"); - - //Section 7.1.2.2 line 935 (BIOS characteristics extension byte 2) - DefineListLoad("ST_SMBIOS_BIOS_FLAGSEXT2", - - "BIOS Boot\0" - "Network Boot\0" - "Targeted Content Distribution\0" - "UEFI\0" - "Virtual Machine"); - - //Section 7.2.2 line 959 (system wakeup types) - DefineListLoad("ST_SMBIOS_WAKEUP_TYPES", - - " \0" - "Other\0" - "Unknown\0" - "APM Timer\0" - "Modem Ring\0" - "LAN Remote\0" - "Power Switch\0" - "PCI PME#\0" - "AC Power Restored"); - - //Section 7.3.1 line 972 (baseboard feature flags) - DefineListLoad("ST_SMBIOS_BASEBOARD_FLAGS", - - "Hosting Board (Motherboard)\0" - "Requires Auxilary Board\0" - "Removable\0" - "Replaceable\0" - "Hot Swappable"); - - //Section 7.3.2 line 977 (baseboard board types) - DefineListLoad("ST_SMBIOS_BASEBOARD_TYPES", - - " \0" - "Unknown\0" - "Other\0" - "Server Blade\0" - "Connectivity Switch\0" - "System Management Module\0" - "Processor Module\0" - "I/O Module\0" - "Daughterboard\0" - "Motherboard\0" - "Processor/Memory Module\0" - "Processor/IO Module\0" - "Interconnect Board\0"); - - //Section 7.4.1 line 988 (system enclosure types) - DefineListLoad("ST_SMBIOS_ENCLOSURE_TYPES", - - " \0" - "Other\0" - "Unknown\0" - "Desktop\0" - "Low Profile Desktop\0" - "Pizza Box\0" - "Mini Tower\0" - "Tower\0" - "Portable\0" - "Laptop\0" - "Notebook\0" - "Hand Held\0" - "Docking Station\0" - "All-in-One\0" - "Sub Notebook\0" - "Space-saving\0" - "Lunch box\0" - "Main Server Chassis\0" - "Expansion Chassis\0" - "SubChassis\0" - "Bus Expansion Chassis\0" - "Peripheral Chassis\0" - "RAID Chassis\0" - "Rack Mount Chassis\0" - "Sealed-case PC\0" - "Multi-system Chassis\0" - "Compact PCI\0" - "Advanced TCA\0" - "Blade\0" - "Blade Enclosure\0" - "Tablet\0" - "Convertible\0" - "Detachable\0" - "IoT Gateway\0" - "Embedded PC\0" - "Mini PC\0" - "Stick PC"); - - //Section 7.4.2 line 991 (enclosure states) - DefineListLoad("ST_SMBIOS_ENCLOSURE_STATES", - - " \0" - "Other\0" - "Unknown\0" - "Safe\0" - "Warning\0" - "Critical\0" - "Non-Recoverable"); - - //Section 7.4.3 line 994 (enclosure security status field) - DefineListLoad("ST_SMBIOS_ENCLOSURE_SECURITY_STATUSES", - - " \0" - "Other\0" - "Unknown\0" - "None\0" - "External Interface Locked Out\0" - "External Interface Enabled"); - - //Section 7.5.1 line 1014 (processor type field) - DefineListLoad("ST_SMBIOS_PROCESSOR_TYPES", - - " \0" - "Other\0" - "Unknown\0" - "Central Processor\0" - "Math Processor\0" - "DSP Processor\0" - "Video Processor"); - //Section 7.5.4 line 1050 (processor voltage field) - - DefineListLoad("ST_SMBIOS_PROCESSOR_VOLTAGE_LEVELS", - - "5V\0" - "3.3V\0" - "2.9V"); - - DefineListLoad("ST_CPUID_1_EDX_FLAGS", - - "x87 FPU\0" - "Virtual 8086 Mode Enhancements\0" - "Debugging Extensions\0" - "Page Size Extensions\0" - "Time Stamp Counter\0" - "MSRs\0" - "Page Address Extension\0" - "Machine Check Exceptions\0" - "CMPXCHG8B\0" - "APIC\0" - " \0" - "SYSENTER/SYSEXIT\0" - "Memory Type Range Registers\0" - "Page Global Bit\0" - "Machine Check Architecture\0" - "CMOV Instructions\0" - "Page Attribute Table\0" - "36 Bit Page Size Extension\0" - "Processor Serial Number\0" - "CLFLUSH\0" - " \0" - "Debug Store\0" - "ACPI\0" - "MMX\0" - "FXSAVE/FXRSTOR\0" - "SSE\0" - "SSE2\0" - "Self Snoop\0" - "HTT\0" - "Thermal Monitor\0" - " \0" - "Pending Break Enable\0"); - - DefineListLoad("ST_CPUID_1_ECX_FLAGS", - - "SSE3\0" - "PCLMULQDQ\0" - "64 bit DS AREA\0" - "MONITOR/MWAIT\0" - "CPL Qualified Debug Store\0" - "Virtual Machine Extensions\0" - "Safer Mode Extensions\0" - " \0" - "Thermal Monitor 2\0" - "SSSE3\0" - "L1 Context ID\0" - "IA32_DEBUG_INTERFACE\0" - "FMA Extensions\0" - "CMPXCHG16B\0" - "xTPR Update Control\0" - "Perfmon and Debug Capability\0" - " \0" - "Process Context Identifiers\0" - "MMIO Prefetch\0" - "SSE4.1\0" - "SSE4.2\0" - "x2APIC\0" - "MOVBE\0" - "POPCNT\0" - "TSC Deadline\0" - "AESNI\0" - "XSAVE\0" - "OSXSAVE\0" - "AVX\0" - "F16C\0" - "RDRAND"); - - //Section 7.5.5 line 1058 (upgrade field) - DefineListLoad("ST_SMBIOS_PROCESSOR_UPGRADES", - - " \0" - "Other\0" - "Unknown\0" - "Daughterboard\0" - "ZIF Socket\0" - "Replacable Piggy Back\0" - "None\0" - "LIF Socket\0" - "Slot 1\0" - "Slot2\0" - "370-pin Socket\0" - "Slot A\0" - "Slot M\0" - "Socket 423\0" - "Socket A (Socket 462)\0" - "Socket 478\0" - "754\0" - "940\0" - "939\0" - "mPGA604\0" - "LGA771\0" - "LGA775\0" - "S1\0" - "AM2\0" - "F (1207)\0" - "LGA1366\0" - "G34\0" - "AM3\0" - "C32\0" - "LGA1156\0" - "LGA1567\0" - "PGA988A\0" - "BGA1288\0" - "rPGA988B\0" - "BGA1023\0" - "BGA1224\0" - "LGA1155\0" - "LGA1356\0" - "LGA2011\0" - "FS1\0" - "FS2\0" - "FM1\FM2\0" - "LGA2011-3\0" - "LGA1356-3\0" - "LGA1150\0" - "BGA1168\0" - "BGA1234\BGA1364\0" - "AM4\0" - "LGA1151\0" - "BGA1440\0" - "BGA1515\0" - "LGA3647-1\0" - "SP3\0" - "SP3r2\0" - "LGA2066\0" - "BGA1932\0" - "BGA1510\0" - "BGA1528"); - - //Section 7.5.9 line 1110 (processor characteristics) - DefineListLoad("ST_SMBIOS_PROCESSOR_FLAGS", - - " \0" - " \0" - "64 Bit\0" - "Multicore\0" - "HyperThreading\0" - "NX/XD Protection\0" - "Enhanced Virtualization\0" - "Power/Performance Control\0" - "128 Bit Capable"); - - //Section 7.8.2 line 1178 (cache information SRAM type field) - DefineListLoad("ST_SMBIOS_CACHE_SRAM_TYPES", - - "Other\0" - "Unknown\0" - "Non-Burst\0" - "Burst\0" - "Pipeline Burst\0" - "Synchronous\0" - "Asynchronous"); - - //Section 7.8.6 line 1193 (cache information associativity field) - DefineListLoad("ST_SMBIOS_CACHE_ASSOCIATIVITY", - - " \0" - "Other\0" - "Unknown\0" - "Direct Mapped\0" - "2-way Set-Associative\0" - "4-way Set-Associative\0" - "Fully Associative\0" - "8-way Set-Associative\0" - "16-way Set-Associative\0" - "12-way Set-Associative\0" - "24-way Set-Associative\0" - "32-way Set-Associative\0" - "48-way Set-Associative\0" - "64-way Set-Associative\0" - "20-way Set-Associative"); - - //Section 7.9.2 line 1219 (connector type field) - DefineListLoad("ST_SMBIOS_CONNECTOR_TYPES", - - "None\0" - "Centronics\0" - "Mini Centronics\0" - "Proprietary\0" - "DB-25 Pin Male\0" - "DB-25 Pin Female\0" - "DB-15 Pin Male\0" - "DB-15 Pin Female\0" - "DB-9 Pin Male\0" - "DB-9 Pin Female\0" - "RJ-11\0" - "RJ-45\0" - "50-Pin MiniSCSI\0" - "Mini-DIN\0" - "Micro-DIN\0" - "PS/2\0" - "Infrared\0" - "HP-HIL\0" - "Access Bus (USB)\0" - "SSA SCSI\0" - "Circular DIN-8 Male\0" - "Circular DIN-8 Female\0" - "Onboard IDE\0" - "Onboard Floppy\0" - "9-Pin Dual Inline (Pin 10 Cut)\0" - "25-Pin Dual Inline (Pin 26 Cut)\0" - "50-Pin Dual Inline\0" - "68-Pin Dual Inline\0" - "Onboard CD-ROM Sound Input\0" - "Mini-Centronics Type-14\0" - "Mini-Centronics Type-26\0" - "Mini-Jack (Headphones)\0" - "BNC\0" - "1394\0" - "SAS\SATA Plug\0" - "USB Type-C"); - - //Section 7.9.3 line 1222 (port type field) - DefineListLoad("ST_SMBIOS_PORT_TYPES", - - "None\0" - "Parallel Port XT/AT Compatible\0" - "Parallel Port PS/2\0" - "Parallel Port ECP\0" - "Parallel Port EPP\0" - "Parallel Port ECP/EPP\0" - "Serial Port XT/AT Compatible\0" - "Serial Port 16450 Compatible\0" - "Serial Port 16550 Compatible\0" - "Serial Port 16550A Compatible\0" - "SCSI Port\0" - "MIDI Port\0" - "Joystick Port\0" - "Keyboard Port\0" - "Mouse Port\0" - "SSA SCSI\0" - "USB\0" - "FireWire (IEEE 1394)\0" - "PCMCIA Type I\0" - "PCMCIA Type II\0" - "PCMCIA Type III\0" - "Cardbus\0" - "Access Bus Port\0" - "SCSI II\0" - "SCSI Wide\0" - " \0" - " \0" - " \0" - "Video Port\0" - "Audio Port\0" - "Modem Port\0" - "Network Port\0" - "SATA\0" - "SAS\0" - "MFDP (Multi-Function Display Port\0" - "Thunderbolt\0" - "8251 Compatible\0" - "8251 FIFO Compatible"); - - //Section 7.10.1 line 1229 (slot type) - DefineListLoad("ST_SMBIOS_SLOT_TYPES1", - - " \0" - "Other\0" - "Unknown\0" - "ISA\0" - "MCA\0" - "EISA\0" - "PCI\0" - "PC Card (PCMCIA)\0" - "VESA Local Bus\0" - "Proprietary\0" - "Proprietary Card Slot\0" - "Proprietary Memory Card Slot\0" - "I/O Riser Card Slot\0" - "NuBus\0" - "PCI - 66 MHz Capable\0" - "AGP\0" - "AGP 2X\0" - "AGP 4X\0" - "PCI-X\0" - "AGP 8X\0" - "M.2 Socket 1-DP (Mechanical Key A)\0" - "M.2 Socket 1-SD (Mechanical Key E)\0" - "M.2 Socket 2 (Mechanical Key B)\0" - "M.2 Socket 3 (Mechanical Key M)\0" - "MXM Type I\0" - "MXM Type II\0" - "MXM Type III (Standard Connector)\0" - "MXM Type III (HE Connector)\0" - "MXM Type IV\0" - "MXM 3.0 Type A\0" - "MXM 3.0 Type B\0" - "PCI Express Gen 2 SFF-8639\0" - "PCI Express Gen 3 SFF-8639\0" - "PCI Express Mini 52-Pin with bottom-side keep-outs\0" - "PCI Express Mini 52-Pin without bottom-side keep-outs\0" - "PCI Express Mini 76-Pin\0" - "CXL Flexbus 1.0"); - - DefineListLoad("ST_SMBIOS_SLOT_TYPES2", - - " \0" - " \0" - " \0" - " \0" - " \0" - "PCI Express\0" - "PCI Express 1x\0" - "PCI Express 2x\0" - "PCI Express 4x\0" - "PCI Express 8x\0" - "PCI Express 16x\0" - "PCI Express Gen 2\0" - "PCI Express Gen 2 1x\0" - "PCI Express Gen 2 2x\0" - "PCI Express Gen 2 4x\0" - "PCI Express Gen 2 8x\0" - "PCI Express Gen 2 16x\0" - "PCI Express Gen 3\0" - "PCI Express Gen 3 1x\0" - "PCI Express Gen 3 2x\0" - "PCI Express Gen 3 4x\0" - "PCI Express Gen 3 8x\0" - "PCI Express Gen 3 16x\0" - "PCI Express Gen 4\0" - "PCI Express Gen 4 1x\0" - "PCI Express Gen 4 2x\0" - "PCI Express Gen 4 4x\0" - "PCI Express Gen 4 8x\0" - "PCI Express Gen 4 16x"); - - //Section 7.10.2 line 1244 (slot data bus width field) - DefineListLoad("ST_SMBIOS_SLOT_DATA_BUS_WIDTHS", - - " \0" - "Other\0" - "Unknown\0" - "8 Bit\0" - "16 Bit\0" - "32 Bit\0" - "64 Bit\0" - "128 Bit\0" - "1x\0" - "2x\0" - "4x\0" - "8x\0" - "12x\0" - "16x\0" - "32x"); - - //Section 7.10.6 line 1259 (slot characteristics 1 field) - DefineListLoad("ST_SMBIOS_SLOT_FLAGS1", - - " \0" - "5.0 V\0" - "3.3 V\0" - "Shared Slot Opening\0" - "PC Card 16\0" - "CardBus\0" - "Zoom Video\0" - "Modem Ring Resume"); - - //Section 7.10.7 line 1262 (slot characteristics 2 field) - DefineListLoad("ST_SMBIOS_SLOT_FLAGS2", - - "PCI Power Management Event (PME#) Signal\0" - "HotPlug\0" - "SMBus\0" - "Bifurcation"); - - //Section 7.17.1 line 1523 (memory array location field) - DefineListLoad("ST_SMBIOS_PHYMEM_LOCATIONS", - - " \0" - "Other\0" - "Unknown\0" - "Motherboard\0" - "ISA Add-On Card\0" - "EISA Add-On Card\0" - "PCI Add-On Card\0" - "MCA Add-On Card\0" - "PCMCIA Add-On Card\0" - "Proprietary Add-On Card\0" - "NuBus\0" - " \0" - " \0" - " \0" - " \0" - " \0"); - - //Section 7.17.2 line 1527 (memory array use field) - DefineListLoad("ST_SMBIOS_PHYMEM_USES", - - " \0" - "Other\0" - "Unknown\0" - "System Memory\0" - "Video Memory\0" - "Flash Memory\0" - "Non-Volatile RAM\0" - "Cache Memory"); - - //Section 7.18.1 line 1542 (form factor field) - DefineListLoad("ST_SMBIOS_MEMDEV_FORM_FACTORS", - - " \0" - "Other\0" - "Unknown\0" - "SIMM\0" - "SIP\0" - "DIP\0" - "ZIP\0" - "Proprietary Card\0" - "DIMM\0" - "TSOP\0" - "Row of Chips\0" - "RIMM\0" - "SODIMM\0" - "SRIMM\0" - "FB-DIMM\0" - "Die"); - - //Section 7.18.2 line 1546 (type field) - DefineListLoad("ST_SMBIOS_MEMDEV_TYPES", - - " \0" - "Unknown\0" - "DRAM\0" - "EDRAM\0" - "VRAM\0" - "SRAM\0" - "RAM\0" - "ROM\0" - "FLASH\0" - "EEPROM\0" - "FEPROM\0" - "EPROM\0" - "CDRAM\0" - "3DRAM\0" - "SDRAM\0" - "SGRAM\0" - "RDRAM\0" - "DDR\0" - "DDR2\0" - "DDR2 FB-DIMM\0" - " \0" - " \0" - " \0" - "DDR3\0" - "FBD2\0" - "DDR4\0" - "LPDDR\0" - "LPDDR2\0" - "LPDDR3\0" - "LPDDR4\0" - "Logical Non-Volatile Device\0" - "HBM (High Bandwidth Memory)\0" - "HBM2 (High Bandwidth Memory Gen 2)"); - - //Section 7.18.3 line 1550 (type detail field) - DefineListLoad("ST_SMBIOS_MEMDEV_TYPE_DETAILS", - - " \0" - " \0" - " \0" - "Fast Paged\0" - "Static Column\0" - "Psuedo Static\0" - "RAMBUS\0" - "Synchronous\0" - "CMOS\0" - "EDO\0" - "Window DRAM\0" - "Cache DRAM\0" - "Non Volatile\0" - "Registered (Buffered)\0" - "Unregistered (Unbuffered)\0" - "LRDIMM"); -} SMBIOSInit; - -Bool SMBIOSEntryScan(CSMBIOSEntryPoint **entry) -{//Search 0xF0000 - 0x100000 for SMBIOS Entry Point structure. - I64 i; - U8 noreg checksum = 0, *mem = 0xF0000; - - if (sys_smbios_entry) - { - *entry = sys_smbios_entry; - return TRUE; - } - - do - { - if (!MemCompare(mem, "_SM_", 4)) - { - *entry = mem; - for (i = 0; i < (*entry)->length; i++) - checksum += mem[i]; - - if (checksum == 0) //valid checksums sum to zero - break; - } - } - while ((mem += 16) < 0x100000); //anchor sits on 16-byte boundary - - return mem != 0x100000; -} - -U8 *SMBIOSStr(CSMBIOSHeader *header, I64 str_num, U8 *default="None") -{//Get string str_num from end of structure (string section). - I64 i; - U8* ptr = header(U8 *) + header->length; - - if (!str_num) - return default; - - for (i = 1; i < str_num; i++) - { - while (*ptr++); - if (!ptr[0] && !ptr[1]) //structure ends in double NULL - return default; - } - - return ptr; -} - -CSMBIOSHeader *SMBIOSStructGet(I64 type=0xFFFFF, I64 handle=0xFFFFF, CSMBIOSHeader *head=NULL) -{//Search for struct with type or handle. Return NULL if not found. - I64 i; - CSMBIOSEntryPoint *entry; - - if (!head) - { - if (!SMBIOSEntryScan(&entry)) - return NULL; - head = entry->table_address; - } - while (head->type != 127) - { - if (head->handle == handle) - return head; - if (head->type == type) - return head; - - head = head(U8 *) + head->length; - for (i = 1; head(U8 *)[i - 1] || head(U8 *)[i]; i++); - head = head(U8 *) + i + 1; - } - - return NULL; -} - U8 *SysRepFlagsMake(U8 *buf) { U8 *str; @@ -1220,20 +491,3 @@ public U0 BIOSRep() {//Wrapper around $LK,"SysRep",A="MN:SysRep"$() to only show BIOS info. SysRep(SMBIOSt_BIOS); } - -/* -U0 SMBIOSWallPaperInit() -{ - CSMBIOSSystemInfo *sys_info = SMBIOSStructGet(SMBIOSt_SYSTEM); - U8 *company = SMBIOSStr(sys_info, sys_info->manufacturer); - - if (!StrCompare(company, "VMware, Inc.")) - wall->host_ch = 'W'; - else if (!StrCompare(company, "innotek GmbH")) - wall->host_ch = 'V'; - else if (!StrCompare(company, "QEMU")) - wall->host_ch = 'Q'; - else - wall->host_ch = 'M'; -} SMBIOSWallPaperInit; -*/ diff --git a/src/System/WallPaper.ZC b/src/System/WallPaper.ZC index 6e036ccc83d8f21819123c9ee97443e90e276dfe..44780192af5ef0d49dca6aa33396aadef4ba82fb 100755 GIT binary patch delta 940 zcma)*J#P~+7{?bR;uBJn^ms`q;voo?D5=7mDnuwR(G?P@r;tKY#1i>Zmzem@<$Ol~ z3D_AB!eT}YEC>eFiG@$V%EX5Nb_VSFswAXBjF0{M{~tdu{<`?Q`tpN|8jI%;3W?~7 zDC`RQm{cv)K95kJi>TY{Cy~c_a zEx~EovMYZR+U(zi_Mar=x9tAC#`BE)o!!csgyXfyefEp3clPT&@?!3ae45*oKXWDd zHa}~x%~zpPfd~E?4vB>b69nY1Ts}>MfJbBi*L|;EC>AYEAL%;OKo6sgv- z+fK*>GupI8{MZ27>Z6y9x~4KMxFo_1D$ouF0Urj?aV>d2J?Bg|3zlHMZB*^$YmLMV zp=qj?csH6iE%`lt_S6W`J=I2c400p(80|US$25SNnkVCUorLmW2A)leR*Yzc`ZOS8 zxP=h%LV^csoM@eF;Fv`h^x?F{v7~^c(osqaJ+Uk#hBQ(SJSiRt`6g4I8yV

xVau z!D`cel|3wfWKz2@s|j;eF~wc(>*l`hINHO_rp9XB$>SKt={WyUT_P&nE^IGQGRKNf zg`mM*=wYGON!O?g!2QCy;F&Bd9eplz#Q z2xLH{?SYDaOBzFYQ9xdtl!6#U&PNHTjFU5|C^az~$f}*pD5#6uln+vtP*ePYrks?P zo}3`f0Tl^?ip-bhgNk^7MUXCUk0kS#E r6LWHO?Vx4@!%;n49c%$mkrs9ZVQ>XflWin9B(a(j2vjuro6Hmd+i`K0 From 8c3f160283bd4a3eb21b7cec85c6faa738ff0712 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Fri, 13 Oct 2023 04:46:49 -0400 Subject: [PATCH 3/5] Fix ZXERep ASM disassemble with DocLock/DocUnlock, show progress using progress bars --- src/System/Utils/ZXERep.ZC | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/System/Utils/ZXERep.ZC b/src/System/Utils/ZXERep.ZC index d6009698..ede5122e 100755 --- a/src/System/Utils/ZXERep.ZC +++ b/src/System/Utils/ZXERep.ZC @@ -32,8 +32,7 @@ public Bool ZXERep(U8 *filename) Bool res = FALSE; CZXE *zxe; CHashExport *saved_hash_ptr = NULL; - - "%c", 20; + Bool unlock_doc = DocLock(Fs->put_doc); fbuf = ExtDefault(filename, "ZXE"); @@ -60,12 +59,19 @@ public Bool ZXERep(U8 *filename) " MODULE_ALIGN:%X\n", 1 << zxe->module_align_bits; ptr = zxe(U8 *) + zxe->patch_table_offset; + + progress1_max = size - zxe->patch_table_offset; + progress1 = 0; + while (etype = *ptr++) { + progress1++; saved_hash_ptr = NULL; i = *ptr(U32 *)++; + progress1 += 4; sptr = ptr; ptr += StrLen(sptr) + 1; + progress1 += StrLen(sptr) + 1; "$$LTCYAN$$%16Z:$$GREEN$$%s$$FG$$:%X ", etype, "ST_ZXE_FILE_TYPES", sptr, i; switch (etype) { @@ -104,6 +110,7 @@ public Bool ZXERep(U8 *filename) '\n'; for (j = 0; j < i; j++) "%X ", *ptr(U32 *)++; + progress1 += j * 4; break; case IET_CODE_HEAP: @@ -111,6 +118,7 @@ public Bool ZXERep(U8 *filename) "Size:%X\n", *ptr(U32 *)++; for (j = 0; j < i; j++) "%X ", *ptr(U32 *)++; + progress1 += 4 + j * 4; break; case IET_DATA_HEAP: @@ -118,6 +126,7 @@ public Bool ZXERep(U8 *filename) "Size:%X\n", *ptr(I64 *)++; for (j = 0; j < i; j++) "%X ", *ptr(U32 *)++; + progress1 += 8 + j * 4; break; default: @@ -133,7 +142,10 @@ br_done2: br_done1: Free(fbuf); - "%c", 20; + if (unlock_doc) + DocUnlock(Fs->put_doc); + + progress1_max = 0; return res; } From 4c84a83f3231e5fbb946a822ee301d14c7b2a39e Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Wed, 25 Oct 2023 22:13:19 -0400 Subject: [PATCH 4/5] upstream nonfunctional ZXE patch offset sorting algorithm in stale working directory --- src/System/Utils/ZXERep.ZC | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/System/Utils/ZXERep.ZC b/src/System/Utils/ZXERep.ZC index ede5122e..87d82750 100755 --- a/src/System/Utils/ZXERep.ZC +++ b/src/System/Utils/ZXERep.ZC @@ -33,6 +33,11 @@ public Bool ZXERep(U8 *filename) CZXE *zxe; CHashExport *saved_hash_ptr = NULL; Bool unlock_doc = DocLock(Fs->put_doc); + CQueueD3I32 *patch_offsets_queue = CAlloc(sizeof(CQueueD3I32)); + CQueueD3I32 *patch; // x == i + I32 t; + + QueueInit(patch_offsets_queue); fbuf = ExtDefault(filename, "ZXE"); @@ -72,6 +77,9 @@ public Bool ZXERep(U8 *filename) sptr = ptr; ptr += StrLen(sptr) + 1; progress1 += StrLen(sptr) + 1; + patch = CAlloc(sizeof(CQueueD3I32)); + patch->p.x = i; + QueueInsert(patch, patch_offsets_queue); "$$LTCYAN$$%16Z:$$GREEN$$%s$$FG$$:%X ", etype, "ST_ZXE_FILE_TYPES", sptr, i; switch (etype) { @@ -135,6 +143,30 @@ public Bool ZXERep(U8 *filename) } '\n'; } + + progress2_max = QueueSize(patch_offsets_queue); + progress3_max = QueueSize(patch_offsets_queue); + progress3 = 0; +br_patchloop: + progress2 = 0; + patch = patch_offsets_queue->next; + while (patch != patch_offsets_queue) + { + "%X ?--> %X", patch->p.x, patch->next->p.x; + if (patch->next != patch_offsets_queue && patch->p.x > patch->next->p.x) + { + t = patch->p.x; + patch->p.x = patch->next->p.x; + patch->next->p.x = t; + if (progress3 < progress2) + progress3++; + goto br_patchloop; + } + patch = patch->next; + progress2++; + } + "\n"; + res = TRUE; Free(absname); br_done2: @@ -146,6 +178,8 @@ br_done1: DocUnlock(Fs->put_doc); progress1_max = 0; + progress2_max = 0; + progress3_max = 0; return res; } From b04638921724ecc8f86502f7cc35a488f4bbd014 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Wed, 25 Oct 2023 23:24:46 -0400 Subject: [PATCH 5/5] branch off of gfx-wp-fun, revert to master KGlobals, GrDC, GrScreen, ZXERep --- src/Kernel/KGlobals.ZC | 2 +- src/System/Gr/GrDC.ZC | 4 +- src/System/Gr/GrScreen.ZC | 45 ++++------------------ src/System/Utils/ZXERep.ZC | 79 -------------------------------------- 4 files changed, 9 insertions(+), 121 deletions(-) diff --git a/src/Kernel/KGlobals.ZC b/src/Kernel/KGlobals.ZC index dc72054e..34cacbe8 100755 --- a/src/Kernel/KGlobals.ZC +++ b/src/Kernel/KGlobals.ZC @@ -13,7 +13,7 @@ CTask *sys_winmgr_task, U8 *rev_bits_table; //Table with U8 bits reversed CDate local_time_offset; F64 *pow10_I64, - sys_os_version = 2.04; + sys_os_version = 2.03; CAutoCompleteDictGlobals acd; CAutoCompleteGlobals ac; diff --git a/src/System/Gr/GrDC.ZC b/src/System/Gr/GrDC.ZC index 88bd5803..aa65bc61 100755 --- a/src/System/Gr/GrDC.ZC +++ b/src/System/Gr/GrDC.ZC @@ -214,9 +214,7 @@ public CDC *DCNew(I64 width, I64 height, CTask *task=NULL, Bool null_bitmap=FALS res->win_task = task; res->mem_task = task; res->width = width; -// res->width_internal = (width + 7) & ~7; - res->width_internal = width / 8 * 8; -// res->width_internal = width; + res->width_internal = (width + 7) & ~7; res->height = height; if (null_bitmap) res->flags |= DCF_DONT_DRAW; diff --git a/src/System/Gr/GrScreen.ZC b/src/System/Gr/GrScreen.ZC index 8c9ed2d8..1c8e64e6 100755 --- a/src/System/Gr/GrScreen.ZC +++ b/src/System/Gr/GrScreen.ZC @@ -34,7 +34,7 @@ U0 GrUpdateTaskWin(CTask *task) if (gr.fp_wall_paper) (*gr.fp_wall_paper)(task); } - /*else*/ if (!(task->win_inhibit & WIF_SELF_DOC)) + else if (!(task->win_inhibit & WIF_SELF_DOC)) DocUpdateTaskDocs(task); if (TaskValidate(task)) { @@ -360,45 +360,25 @@ U0 DCBlotColor8(CDC *dc, CDC *img) U0 GrCalcScreenUpdates() { U16 *screen, *last_screen = gr.screen_cache; - U64 i, j, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2; - U64 w, d;//, p; - - w = GR_WIDTH; -// p = (GR_WIDTH + 7) & ~7; - d = GR_WIDTH / 8 * 8; + U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2; if (gr.screen_zoom == 1) screen = gr.dc2->body; else screen = gr.zoomed_dc->body; - for (i = j = 0; i < diffs_size; i++, j++) + for (i = 0; i < diffs_size; i++) { - if (j != 0 && j % (d/2) == 0 && d != w) - { - j += (w - d) / 2; - } -// if (screen[j] != last_screen[j]) if (screen[i] != last_screen[i]) -// dst[i] = src[i]; - dst[j] = src[j]; - + dst[i] = src[i]; } MemCopy(gr.screen_cache, screen, diffs_size * 2); } U0 GrUpdateScreen32() { -// U64 size, *dst; - U64 size; - U32 *dst; + U64 size, *dst; U8 *src; - U64 w, i, p, d; - - w = GR_WIDTH; - i = 0; - p = (GR_WIDTH + 7) & ~7; - d = GR_WIDTH / 8 * 8; if (gr.screen_zoom == 1) { @@ -412,19 +392,8 @@ U0 GrUpdateScreen32() size = src + gr.zoomed_dc->height * gr.zoomed_dc->width_internal; } dst = text.raw_screen; - while (src < size) - { - *dst++ = gr_palette[*src++ & 0xFF]; - i++; - - if (i == d && d != w) - { - i = w - d; - dst += i; - i = 0; - } - - } + while (src < size) //draw 2 pixels at a time + *dst++ = gr_palette[*src++ & 0xFF] | gr_palette[*src++ & 0xFF] << 32; GrCalcScreenUpdates; diff --git a/src/System/Utils/ZXERep.ZC b/src/System/Utils/ZXERep.ZC index 87d82750..c9bc7b62 100755 --- a/src/System/Utils/ZXERep.ZC +++ b/src/System/Utils/ZXERep.ZC @@ -32,12 +32,6 @@ public Bool ZXERep(U8 *filename) Bool res = FALSE; CZXE *zxe; CHashExport *saved_hash_ptr = NULL; - Bool unlock_doc = DocLock(Fs->put_doc); - CQueueD3I32 *patch_offsets_queue = CAlloc(sizeof(CQueueD3I32)); - CQueueD3I32 *patch; // x == i - I32 t; - - QueueInit(patch_offsets_queue); fbuf = ExtDefault(filename, "ZXE"); @@ -64,22 +58,11 @@ public Bool ZXERep(U8 *filename) " MODULE_ALIGN:%X\n", 1 << zxe->module_align_bits; ptr = zxe(U8 *) + zxe->patch_table_offset; - - progress1_max = size - zxe->patch_table_offset; - progress1 = 0; - while (etype = *ptr++) { - progress1++; - saved_hash_ptr = NULL; i = *ptr(U32 *)++; - progress1 += 4; sptr = ptr; ptr += StrLen(sptr) + 1; - progress1 += StrLen(sptr) + 1; - patch = CAlloc(sizeof(CQueueD3I32)); - patch->p.x = i; - QueueInsert(patch, patch_offsets_queue); "$$LTCYAN$$%16Z:$$GREEN$$%s$$FG$$:%X ", etype, "ST_ZXE_FILE_TYPES", sptr, i; switch (etype) { @@ -88,37 +71,12 @@ public Bool ZXERep(U8 *filename) saved_hash_ptr = HashFind(sptr, Fs->hash_table, HTG_ALL); if (!saved_hash_ptr) "Unresolved Reference:%s\n", sptr; - else - "%s", sptr; - break; - - case IET_REL32_EXPORT: - "$$TR,\"ASM\"$$\n$$ID,2$$"; - Un(i + zxe(U8 *) + sizeof(CZXE)); - "\n$$ID,-2$$\n"; - "ZXERep REL32_EXPORT"; - break; - case IET_IMM32_EXPORT: - "ZXERep IMM32_EXPORT"; - break; - case IET_REL64_EXPORT: - "ZXERep REL64_EXPORT"; - break; - case IET_IMM64_EXPORT: - "ZXERep IMM64_EXPORT"; - break; - case IET_MAIN: - "ZXERep IET_MAIN"; - break; - case IET_END: - "ZXERep IET_END"; break; case IET_ABS_ADDR: '\n'; for (j = 0; j < i; j++) "%X ", *ptr(U32 *)++; - progress1 += j * 4; break; case IET_CODE_HEAP: @@ -126,7 +84,6 @@ public Bool ZXERep(U8 *filename) "Size:%X\n", *ptr(U32 *)++; for (j = 0; j < i; j++) "%X ", *ptr(U32 *)++; - progress1 += 4 + j * 4; break; case IET_DATA_HEAP: @@ -134,39 +91,10 @@ public Bool ZXERep(U8 *filename) "Size:%X\n", *ptr(I64 *)++; for (j = 0; j < i; j++) "%X ", *ptr(U32 *)++; - progress1 += 8 + j * 4; - break; - - default: - "ZXERep missing IET:%d", etype; break; } '\n'; } - - progress2_max = QueueSize(patch_offsets_queue); - progress3_max = QueueSize(patch_offsets_queue); - progress3 = 0; -br_patchloop: - progress2 = 0; - patch = patch_offsets_queue->next; - while (patch != patch_offsets_queue) - { - "%X ?--> %X", patch->p.x, patch->next->p.x; - if (patch->next != patch_offsets_queue && patch->p.x > patch->next->p.x) - { - t = patch->p.x; - patch->p.x = patch->next->p.x; - patch->next->p.x = t; - if (progress3 < progress2) - progress3++; - goto br_patchloop; - } - patch = patch->next; - progress2++; - } - "\n"; - res = TRUE; Free(absname); br_done2: @@ -174,12 +102,5 @@ br_done2: br_done1: Free(fbuf); - if (unlock_doc) - DocUnlock(Fs->put_doc); - - progress1_max = 0; - progress2_max = 0; - progress3_max = 0; - return res; }