Skip to content

Commit

Permalink
Better naming for unsigned int typedef.
Browse files Browse the repository at this point in the history
  • Loading branch information
IPlayZed committed Jan 16, 2022
1 parent 2c60226 commit ccc98ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/kernel.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
typedef unsigned short USHORT;
typedef unsigned short uint16_t;

#define HIGH_BYTE 0xFF00
#define VRAM_ADDRS (USHORT*)0xb8000
#define VRAM_ADDRS (uint16_t*)0xb8000
#define MESSAGE (char*)"Kernel main test"
#define TRUE 1==1
#define FALSE !TRUE
Expand All @@ -17,10 +17,10 @@ typedef unsigned short USHORT;
* */
void printf(char* str)
{
USHORT* vram = VRAM_ADDRS;
uint16_t* vram = VRAM_ADDRS;

for(int i = 0; str[i] != '\0'; ++i) {
vram[i] = (USHORT)(vram[i] & HIGH_BYTE) | str[i];
vram[i] = (uint16_t)(vram[i] & HIGH_BYTE) | str[i];
}
}

Expand Down

0 comments on commit ccc98ab

Please sign in to comment.