Skip to content

Commit

Permalink
change pragma onces to ifndef include guards accross emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
noahwooten05 committed Dec 28, 2023
1 parent 6c12b1c commit a77414f
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 12 deletions.
Binary file not shown.
6 changes: 5 additions & 1 deletion plasm2_emu/basetypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _basetypes_h
#define _basetypes_h

typedef unsigned long long WORD64;
typedef unsigned long WORD32;
Expand All @@ -15,3 +17,5 @@ typedef unsigned char BYTE, _bool;

#define TRUE 1
#define FALSE 0

#endif
7 changes: 6 additions & 1 deletion plasm2_emu/cpu/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _cpu_h
#define _cpu_h

#include "../basetypes.h"
#include <time.h>

Expand Down Expand Up @@ -273,3 +276,5 @@ WORD64 CpuTimerGetPreciseTimeNanoseconds(void);
WORD64 CpuTimerGetPreciseTimeMicroseconds(void);
WORD64 CpuTimerGetPreciseTimeMilliseconds(void);
WORD64 CpuTimerGetPreciseTimeSeconds(void);

#endif
7 changes: 6 additions & 1 deletion plasm2_emu/cpu/mmu/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _mmu_h
#define _mmu_h

#include "../../basetypes.h"

#define REASON_EXEC 0x01
Expand Down Expand Up @@ -61,3 +64,5 @@ typedef struct _MMU_CTX {
PMMU_PAGE Pages;
}MMU_CTX, *PMMU_CTX;
extern PMMU_CTX MmuCtx;

#endif
8 changes: 7 additions & 1 deletion plasm2_emu/decoder/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _decoder_h
#define _decoder_h

#include "../basetypes.h"

// decoder, debugger, and disassembler
Expand All @@ -22,4 +25,7 @@ void DecoderPrint(const char* Format);
typedef struct _DCCTX {
WORD64 SpeculativePointer;
}DC_CTX, *PDC_CTX;

extern PDC_CTX DcCtx;

#endif
7 changes: 6 additions & 1 deletion plasm2_emu/devices/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _devices_h
#define _devices_h

#include <stddef.h>
#include "../basetypes.h"

Expand Down Expand Up @@ -64,5 +67,7 @@ typedef struct _DEVICES_CTX {
WORD64 DeviceCount;
PCPU_DEVICE Devices;
}DEVICES_CTX, *PDEVICES_CTX;

extern PDEVICES_CTX DevicesCtx;

#endif
7 changes: 6 additions & 1 deletion plasm2_emu/devices/fdisk/fdisk.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _fdisk_h
#define _fdisk_h

#include "../devices.h"
#include "../../basetypes.h"
#include <stdio.h>
Expand Down Expand Up @@ -136,3 +139,5 @@ void FdiskiDisableFpIncrement(WORD32 DriveId);
void FdiskiDriveSeek(WORD32 DriveId, WORD64 NewPos);
WORD64 FdiskiDriveReadStack(WORD32 DriveId);
void FdiskiDriveWriteStack(WORD32 DriveId, WORD64 Data);

#endif
7 changes: 6 additions & 1 deletion plasm2_emu/devices/kb/kb.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _kb_h
#define _kb_h

#include "../devices.h"
#include "../../basetypes.h"

Expand Down Expand Up @@ -50,3 +53,5 @@ extern PKB_CTX KbCtx;
void KbiSetKeyDownInterrupt(WORD64 Interrupt);
void KbiSetKeyUpInterrupt(WORD64 Interrupt);
WORD64 KbiGetKeyMapPointer(void);

#endif
8 changes: 7 additions & 1 deletion plasm2_emu/devices/sdbg/sdbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _sdbg_h
#define _sdbg_h

#include "../devices.h"
#include "../../basetypes.h"
#include <stdio.h>
Expand Down Expand Up @@ -42,6 +45,7 @@ typedef struct SDBG_CTX {
BYTE AwaitingData;
WORD64 LastCommand;
}SDBG_CTX, *PSDBG_CTX;

extern PSDBG_CTX sdbgctx;

/*
Expand All @@ -53,3 +57,5 @@ extern PSDBG_CTX sdbgctx;
void SdbgSend(void);
void SdbgSetLocation(WORD64 Location);
void SdbgSetSize(WORD64 Size);

#endif
8 changes: 7 additions & 1 deletion plasm2_emu/devices/video/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _video_h
#define _video_h

#include "../devices.h"

void VideoInit(void);
Expand Down Expand Up @@ -60,4 +63,7 @@ typedef struct _VIDEO_CTX {
int w;
int h;
}VIDEO_CTX, *PVIDEO_CTX;

extern PVIDEO_CTX VideoCtx;

#endif
7 changes: 6 additions & 1 deletion plasm2_emu/emu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _emu_h
#define _emu_h

#include "basetypes.h"
#include <stdio.h>
#include <SDL.h>
Expand Down Expand Up @@ -44,3 +47,5 @@ void EmutexUnlock(void* Mutex);
void EmutexDestory(void* Mutex);

extern PEMU_CTX EmuCtx;

#endif
7 changes: 6 additions & 1 deletion plasm2_emu/psin2/psin2.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
//
// Created by Noah Wooten on 4/21/23.
//
#pragma once

#ifndef _psin2_h
#define _psin2_h

#include "../basetypes.h"

void Psin2Init(void);
Expand Down Expand Up @@ -45,3 +48,5 @@ char* Psin2iGetDescription(int Id);
int Psin2iGetOperandCount(int Id);
int Psin2iGetInstructionByName(const char* Operand);
int Psin2iGetInstructionByOpcode(BYTE Opcode);

#endif
5 changes: 4 additions & 1 deletion plasm2_emu/tools/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// Created by Noah Wooten on 4/21/23.
//

#pragma once
#ifndef _tools_h
#define _tools_h

/*
There used to be another project called
Expand All @@ -21,3 +22,5 @@ void ToolsiHddGen(void);
void ToolsiFontGen(void);
void ToolsiFontViewer(void);
void ToolsiBootloader(void);

#endif

0 comments on commit a77414f

Please sign in to comment.