From ad9ca0af5d6fb42f3e0ab1a92f27eb6cbb4f8ae7 Mon Sep 17 00:00:00 2001 From: Eric Voirin Date: Mon, 23 Aug 2021 12:51:02 +0200 Subject: [PATCH] formatting... trim trailing whitespaces --- K6.H | 2 +- K6CPU.ASM | 8 ++++---- K6INIT.C | 27 ++++++++++++++------------- MAIN.C | 6 +++--- README.MD | 20 ++++++++++---------- VESA_VBE.H | 2 +- 6 files changed, 33 insertions(+), 32 deletions(-) diff --git a/K6.H b/K6.H index d3e0d75..8e36b5b 100644 --- a/K6.H +++ b/K6.H @@ -32,7 +32,7 @@ extern cpuidProcessorType k6_getCPUProcessorType(void); extern void k6_setMTRR(unsigned short index, unsigned long value); extern unsigned short k6_getVBEInfoBlock(vbeInfo _far *vbeInfoBlockPtr); -extern unsigned short k6_getVBEModeInfo(unsigned short videoMode, +extern unsigned short k6_getVBEModeInfo(unsigned short videoMode, vbeModeInfo _far *vbeModeInfoPtr); // k6init functionality diff --git a/K6CPU.ASM b/K6CPU.ASM index 3cffcbd..49c763d 100644 --- a/K6CPU.ASM +++ b/K6CPU.ASM @@ -37,7 +37,7 @@ k6_getCPUIdentifier PROC C USES eax ebx ecx edx esi,cpuidString:FAR PTR CHAR mov [si+04h], edx mov [si+08h], ecx - ret + ret k6_getCPUIdentifier ENDP @@ -69,7 +69,7 @@ k6_getCPUProcessorType ENDP ; its bitfields must be calculated properly by the caller. ; ; Parameters: MTRR index (0 or 1) -; MTRR value +; MTRR value k6_setMTRR PROC C USES eax ebx ecx edx, mtrrIndex:WORD, mtrrValue:DWORD @@ -122,7 +122,7 @@ k6_getVBEInfoBlock PROC C USES bx cx dx es di,vbeInfoBlockPtr:FAR PTR BYTE int 10h ; AX = Return value of the call - ret + ret k6_getVBEInfoBlock ENDP @@ -131,7 +131,7 @@ k6_getVBEInfoBlock ENDP ; ; reads the mode info for a given VESA mode from the VESA BIOS. ; -; Parameters: mode index +; Parameters: mode index ; pointer to a memory location to copy the VBE Mode Info to. ; Returns: Return value of the call diff --git a/K6INIT.C b/K6INIT.C index e4556e8..9a32789 100644 --- a/K6INIT.C +++ b/K6INIT.C @@ -6,7 +6,7 @@ int checkAuthenticAMD(void) { - char cpuidString[12+1]; // 3 DWORDs + 1 null term byte + char cpuidString[12+1]; // 3 DWORDs + 1 null term byte cpuidString[12] = 0x00; // null terminator @@ -23,9 +23,9 @@ int checkSupportedCPU(void) cpu = k6_getCPUProcessorType(); - printf("CPU Family %02lx model %02lx stepping %02lx\n", - cpu.family, - cpu.model, + printf("CPU Family %02lx model %02lx stepping %02lx\n", + cpu.family, + cpu.model, cpu.stepping); // Supported CPUs @@ -84,7 +84,7 @@ static int findLFBs(mtrrConfigInfo* mtrrConfig) { } printf("Attempting to find Linear Frame Buffer (LFB) region(s)...\n"); - printf("Probing VGA BIOS for VBEs...\n"); + printf("Probing VGA BIOS for VBE support...\n\n"); // Allocate memory for VBE (Mode) Info structures @@ -103,7 +103,7 @@ static int findLFBs(mtrrConfigInfo* mtrrConfig) { memset(oemVersionString, 0, sizeof(oemVersionString)); memset(mtrrConfig, 0, sizeof(mtrrConfigInfo)); - // A VBE Info Block request must happen with the target block's + // A VBE Info Block request must happen with the target block's // Signature field set to "VBE2" memcpy(vbeInfoPtr->vbeSignature, "VBE2", 4); @@ -134,25 +134,25 @@ static int findLFBs(mtrrConfigInfo* mtrrConfig) { printf("VESA BIOS OEM Version String: %s\n", oemVersionString); // If we have VESA version before 2.xx, we have to stop because - // VESA only introduced LFBs starting at 2.xx. + // VESA only introduced LFBs starting at 2.xx. if (vbeVersionMajor < 2) { printf("VBE Version before 2.00. No LFB detection possible.\n"); goto error; } - // Query all video modes to find those with LFBs. + // Query all video modes to find those with LFBs. - printf("Querying VESA modes to find LFB address...\n"); + printf("Querying VESA modes to find LFB address...\n\n"); for (i = 0; vbeInfoPtr->videoModeListPtr[i] != 0xFFFF; i++) { if (i > vbeMaximumModeEntries) { break; } - currentMode = vbeInfoPtr->videoModeListPtr[i]; + currentMode = vbeInfoPtr->videoModeListPtr[i]; - ret = k6_getVBEModeInfo(currentMode, + ret = k6_getVBEModeInfo(currentMode, (vbeModeInfo _far*) vbeModeInfoPtr); // ret = return code from query call @@ -207,8 +207,8 @@ static int findLFBs(mtrrConfigInfo* mtrrConfig) { // TODO: Make this more elegant :/ error: - free(vbeModeInfoPtr); - free(vbeInfoPtr); + free(vbeModeInfoPtr); + free(vbeInfoPtr); return -1; } @@ -301,5 +301,6 @@ int enableWriteCombiningForLFBs(void) { result = setupMTRRs(&mtrrConfig); return result; + } diff --git a/MAIN.C b/MAIN.C index ac8f775..aecb760 100644 --- a/MAIN.C +++ b/MAIN.C @@ -41,17 +41,17 @@ int main (int argc, char **argv) { printf("%s Version %d.%02d\n", k_program_name, k_version_major, k_version_minor); printf("%s\n", k_copyright_text); - printf("%s\n", k_contact_info); + printf("%s\n", k_contact_info); printf("===============================================================================\n"); if (!checkAuthenticAMD()) { - printf("You don't have an AMD CPU. Aborting.\n"); + printf("You don't have an AMD CPU. Aborting.\n"); goto cleanup; } if (!checkSupportedCPU()) { printf("Aborting\n"); - goto cleanup; + goto cleanup; } if (!enableWriteCombiningForLFBs()) { diff --git a/README.MD b/README.MD index 69eb7d8..4c57e63 100644 --- a/README.MD +++ b/README.MD @@ -6,23 +6,23 @@ This is a driver for MS-DOS to replace `k6dos.sys` which is a bit useless and un On the newer K6-2/2+/3+ models there are features that benefit system performance in select applications greatly, such as games. -This driver sets Write allocation and Write Combining for the LFB memory on these models. +This driver sets Write allocation and Write Combining for the LFB memory on these models. -In the future it will also let you set the multiplier on K6-3 models. +In the future it will also let you set the multiplier on K6-3 models. -I'm doing this because I want my K6 machine to be fast. +I'm doing this because I want my K6 machine to be fast. ## Why in C? Because I hate / suck at x86 assembly and I want flexibility, such as more complex(ish) command line parsing which is hard to do in ASM... -Normally you should really do this in assembly. But YOLO. +Normally you should really do this in assembly. But YOLO. # Project Status ## Does this work yet? -NO! I'm still learning. +NO! I'm still learning. ## What does it (not) do so-far? @@ -50,8 +50,8 @@ NO! I'm still learning. * MS-DOS 6.xx or 7.xx or Windows 9x * Microsoft C / C++ Compiler Version 7.00 - * Also works with Microsoft Visual C++ 1.52, but not recommended because that's not really meant for development under pure DOS. - * In this case you need a 32-Bit DOS Extender such as HX-DOS. The DOSXNT that is included doesn't play nice with my machine sadly. + * Also works with Microsoft Visual C++ 1.52, but not recommended because that's not really meant for development under pure DOS. + * In this case you need a 32-Bit DOS Extender such as HX-DOS. The DOSXNT that is included doesn't play nice with my machine sadly. * Microsoft Macro Assembler Version 6.11 * DPMI host (not necessary on Windows) * I use HXDPMI32 ([part of HXDOS by Japheth](https://www.japheth.de/HX.html)). @@ -73,7 +73,7 @@ cd \k6init nmake ``` -That's all. +That's all. ## Build environment issues @@ -83,7 +83,7 @@ I developed this on an AMD K6-II CXT 500MHz. DOS is not the most stable and easy **USE HIMEM.SYS THAT COMES WITH MICROSOFT C/C++ 7.00!** -You'll get weird errors otherwise. It's something to do with XMS size. I can get this to compile with JemmEx when limiting its reported size to 32MiB. +You'll get weird errors otherwise. It's something to do with XMS size. I can get this to compile with JemmEx when limiting its reported size to 32MiB. ### Linker doesn't run when DPMI host is running @@ -105,4 +105,4 @@ Because when I load it, it reboots my computer. %-) # License -[CC-BY-NC 3.0, click here for info](https://creativecommons.org/licenses/by-nc/3.0) \ No newline at end of file +[CC-BY-NC 3.0, click here for info](https://creativecommons.org/licenses/by-nc/3.0) diff --git a/VESA_VBE.H b/VESA_VBE.H index 7a4405a..7a00044 100644 --- a/VESA_VBE.H +++ b/VESA_VBE.H @@ -30,7 +30,7 @@ typedef struct typedef struct { unsigned short supportedInHardware : 1; - unsigned short reserved : 1; + unsigned short reserved : 1; unsigned short ttyBIOSSupport : 1; unsigned short isColorMode : 1; unsigned short isGraphicsMode : 1;