shithub: cstory

Download patch

ref: 676ee004fe43502db25ec598b346fd7185644c73
parent: a94d9a4367c5d08e769b9c35a8d366cfcd8d7bec
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon May 13 11:18:33 EDT 2019

Removed the dependency on stdint.h

This doesn't exist in MSVC2003, and nothing in the Linux port's debug
symbols indicate Pixel used it.

--- a/src/Boss.cpp
+++ b/src/Boss.cpp
@@ -1,6 +1,5 @@
 #include "Boss.h"
 
-#include <stdint.h>
 #include <string.h>
 
 #include "WindowsWrapper.h"
--- a/src/BulHit.cpp
+++ b/src/BulHit.cpp
@@ -45,7 +45,7 @@
 	return hit;
 }
 
-int JudgeHitBulletBlock2(int x, int y, uint8_t *atrb, BULLET *bul)
+int JudgeHitBulletBlock2(int x, int y, unsigned char *atrb, BULLET *bul)
 {
 	int i;
 	int workX;
--- a/src/Bullet.h
+++ b/src/Bullet.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 struct BULLET
@@ -20,7 +18,7 @@
 	int act_wait;
 	int ani_wait;
 	int ani_no;
-	uint8_t direct;
+	unsigned char direct;
 	RECT rect;
 	int count1;
 	int count2;
@@ -36,8 +34,8 @@
 
 struct BULLET_TABLE
 {
-	int8_t damage;
-	int8_t life;
+	signed char damage;
+	signed char life;
 	int life_count;
 	int bbits;
 	int enemyXL;
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -1,5 +1,4 @@
 #include <stddef.h>
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 
--- a/src/Config.h
+++ b/src/Config.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 struct CONFIG
@@ -8,12 +6,12 @@
 {
 	char proof[0x20];
 	char font_name[0x40];
-	int32_t move_button_mode;
-	int32_t attack_button_mode;
-	int32_t ok_button_mode;
-	int32_t display_mode;
-	int32_t bJoystick;
-	int32_t joystick_button[8];
+	long move_button_mode;
+	long attack_button_mode;
+	long ok_button_mode;
+	long display_mode;
+	long bJoystick;
+	long joystick_button[8];
 };
 
 BOOL LoadConfigData(CONFIG *conf);
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -1,5 +1,4 @@
 #include <stddef.h>
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -57,8 +56,8 @@
 			return FALSE;
 
 		// Framerate limiter
-		static uint32_t timePrev;
-		const uint32_t timeNow = SDL_GetTicks();
+		static Uint32 timePrev;
+		const Uint32 timeNow = SDL_GetTicks();
 
 		if (timeNow >= timePrev + FRAMERATE)
 		{
@@ -485,7 +484,7 @@
 	return col;
 }
 
-void CortBox(RECT *rect, uint32_t col)
+void CortBox(RECT *rect, unsigned long col)
 {
 	// Get rect
 	SDL_Rect destRect = RectToSDLRectScaled(rect);
@@ -498,7 +497,7 @@
 	SDL_RenderFillRect(gRenderer, &destRect);
 }
 
-void CortBox2(RECT *rect, uint32_t col, Surface_Ids surf_no)
+void CortBox2(RECT *rect, unsigned long col, Surface_Ids surf_no)
 {
 	// Get rect
 	SDL_Rect destRect = RectToSDLRectScaled(rect);
@@ -610,7 +609,7 @@
 		gFont = LoadFontFromData(res_data, data_size, fontWidth, fontHeight);
 }
 
-void PutText(int x, int y, const char *text, uint32_t color)
+void PutText(int x, int y, const char *text, unsigned long color)
 {
 	int surface_width, surface_height;
 	SDL_GetRendererOutputSize(gRenderer, &surface_width, &surface_height);
@@ -626,7 +625,7 @@
 	SDL_DestroyTexture(screen_texture);
 }
 
-void PutText2(int x, int y, const char *text, uint32_t color, Surface_Ids surf_no)
+void PutText2(int x, int y, const char *text, unsigned long color, Surface_Ids surf_no)
 {
 	DrawText(gFont, (unsigned char*)surf[surf_no].surface->pixels, surf[surf_no].surface->pitch, surf[surf_no].surface->w, surf[surf_no].surface->h, x * magnification, y * magnification, color, text, strlen(text));
 	surf[surf_no].needs_updating = true;
--- a/src/Draw.h
+++ b/src/Draw.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 #ifndef RGB
@@ -68,9 +66,9 @@
 void PutBitmap4(RECT *rcView, int x, int y, RECT *rect, Surface_Ids surf_no);
 void Surface2Surface(int x, int y, RECT *rect, int to, int from);
 unsigned long GetCortBoxColor(unsigned long col);
-void CortBox(RECT *rect, uint32_t col);
-void CortBox2(RECT *rect, uint32_t col, Surface_Ids surf_no);
+void CortBox(RECT *rect, unsigned long col);
+void CortBox2(RECT *rect, unsigned long col, Surface_Ids surf_no);
 void InitTextObject(const char *font_name);
-void PutText(int x, int y, const char *text, uint32_t color);
-void PutText2(int x, int y, const char *text, uint32_t color, Surface_Ids surf_no);
+void PutText(int x, int y, const char *text, unsigned long color);
+void PutText2(int x, int y, const char *text, unsigned long color, Surface_Ids surf_no);
 void EndTextObject();
--- a/src/Ending.cpp
+++ b/src/Ending.cpp
@@ -1,6 +1,5 @@
 #include "Ending.h"
 
-#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -184,7 +183,7 @@
 
 	// Read data
 	fread(Credit.pData, 1, Credit.size, fp);
-	EncryptionBinaryData2((uint8_t*)Credit.pData, Credit.size);
+	EncryptionBinaryData2((unsigned char*)Credit.pData, Credit.size);
 
 #ifdef FIX_BUGS
 	// The original game forgot to close the file
@@ -229,7 +228,7 @@
 	while (Credit.offset < Credit.size)
 	{
 		// Get character
-		uint8_t character = Credit.pData[Credit.offset];
+		unsigned char character = Credit.pData[Credit.offset];
 
 		int a, b, len;
 		switch (character)
--- a/src/Ending.h
+++ b/src/Ending.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 struct CREDIT
 {
 	int size;
--- a/src/Frame.cpp
+++ b/src/Frame.cpp
@@ -13,7 +13,7 @@
 
 void MoveFrame3()
 {
-	int16_t map_w, map_l;
+	short map_w, map_l;
 	GetMapData(0, &map_w, &map_l);
 
 #if WINDOW_WIDTH != 320 || WINDOW_HEIGHT != 240	// TODO - Really need to make this a compiler flag
@@ -119,7 +119,7 @@
 	gFrame.quake2 = 0;
 
 	//Move frame position
-	int16_t map_w, map_l;
+	short map_w, map_l;
 	GetMapData(0, &map_w, &map_l);
 
 	gFrame.x = fx;
@@ -143,7 +143,7 @@
 	int mc_x, mc_y;
 	GetMyCharPosition(&mc_x, &mc_y);
 
-	int16_t map_w, map_l;
+	short map_w, map_l;
 	GetMapData(0, &map_w, &map_l);
 
 	gFrame.x = mc_x - (WINDOW_WIDTH << 8);
--- a/src/Generic.cpp
+++ b/src/Generic.cpp
@@ -1,6 +1,5 @@
 #include "Generic.h"
 
-#include <stdint.h>
 #include <stdio.h>
 
 #include "CommonDefines.h"
@@ -45,7 +44,7 @@
 	return false;
 }
 
-bool IsShiftJIS(uint8_t c)
+bool IsShiftJIS(unsigned char c)
 {
 	if (c > 0x80 && c < 0xA0)
 		return true;
--- a/src/Generic.h
+++ b/src/Generic.h
@@ -1,8 +1,6 @@
 #pragma once
 
-#include <stdint.h>
-
 bool GetCompileVersion(int *v1, int *v2, int *v3, int *v4);
 long GetFileSizeLong(const char *path);
 bool CheckFileExists(const char *name);
-bool IsShiftJIS(uint8_t c);
+bool IsShiftJIS(unsigned char c);
--- a/src/Input.cpp
+++ b/src/Input.cpp
@@ -1,7 +1,6 @@
 #include "Input.h"
 
 #include <stddef.h>
-#include <stdint.h>
 #include <string.h>
 
 #include <SDL.h>
@@ -51,8 +50,8 @@
 
 	if (joystick)
 	{
-		int32_t x = SDL_JoystickGetAxis(joystick, 0);
-		int32_t y = SDL_JoystickGetAxis(joystick, 1);
+		Sint16 x = SDL_JoystickGetAxis(joystick, 0);
+		Sint16 y = SDL_JoystickGetAxis(joystick, 1);
 		pStatus->bLeft = x <= -JOYSTICK_DEADZONE;
 		pStatus->bRight = x >= JOYSTICK_DEADZONE;
 		pStatus->bUp = y <= -JOYSTICK_DEADZONE;
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -1,7 +1,6 @@
 #include "Main.h"
 
 #include <stddef.h>
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 
--- a/src/Map.cpp
+++ b/src/Map.cpp
@@ -1,7 +1,6 @@
 #include "Map.h"
 
 #include <stddef.h>
-#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -21,7 +20,7 @@
 
 BOOL InitMapData2()
 {
-	gMap.data = (uint8_t*)malloc(PXM_BUFFER_SIZE);
+	gMap.data = (unsigned char*)malloc(PXM_BUFFER_SIZE);
 	return TRUE;
 }
 
@@ -103,7 +102,7 @@
 	ReleaseSurface(SURFACE_ID_LEVEL_TILESET);
 }
 
-void GetMapData(uint8_t **data, int16_t *mw, int16_t *ml)
+void GetMapData(unsigned char **data, short *mw, short *ml)
 {
 	if (data)
 		*data = gMap.data;
@@ -132,7 +131,7 @@
 	*(gMap.data + x + gMap.width * y) -= 1;
 }
 
-BOOL ChangeMapParts(int x, int y, uint8_t no)
+BOOL ChangeMapParts(int x, int y, unsigned char no)
 {
 	if (*(gMap.data + x + gMap.width * y) == no)
 		return FALSE;
--- a/src/Map.h
+++ b/src/Map.h
@@ -1,15 +1,13 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 struct MAP_DATA
 {
-	uint8_t *data;
-	uint8_t atrb[0x101]; //Why is this 257 bytes?
-	int16_t width;
-	int16_t length;
+	unsigned char *data;
+	unsigned char atrb[0x101]; //Why is this 257 bytes?
+	short width;
+	short length;
 };
 
 extern MAP_DATA gMap;
@@ -19,11 +17,11 @@
 BOOL LoadAttributeData(const char *path_atrb);
 void EndMapData();
 void ReleasePartsImage();
-void GetMapData(uint8_t **data, int16_t *mw, int16_t *ml);
+void GetMapData(unsigned char **data, short *mw, short *ml);
 unsigned char GetAttribute(int x, int y);
 void DeleteMapParts(int x, int y);
 void ShiftMapParts(int x, int y);
-BOOL ChangeMapParts(int x, int y, uint8_t no);
+BOOL ChangeMapParts(int x, int y, unsigned char no);
 void PutStage_Back(int fx, int fy);
 void PutStage_Front(int fx, int fy);
 void PutMapDataVector(int fx, int fy);
--- a/src/MapName.cpp
+++ b/src/MapName.cpp
@@ -1,6 +1,5 @@
 #include "MapName.h"
 
-#include <stdint.h>
 #include <string.h>
 
 #include "CommonDefines.h"
--- a/src/MiniMap.cpp
+++ b/src/MiniMap.cpp
@@ -1,6 +1,5 @@
 #include "MiniMap.h"
 
-#include <stdint.h>
 #include <string.h>
 
 #include "WindowsWrapper.h"
@@ -127,7 +126,7 @@
 	CortBox2(&rcMiniMap, 0, SURFACE_ID_MAP);
 
 	int line = 0;
-	uint8_t my_wait = 0;
+	unsigned char my_wait = 0;
 	while (true)
 	{
 		GetTrg();
--- a/src/MiniMap.h
+++ b/src/MiniMap.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 extern char gMapping[0x80];
--- a/src/MyChar.cpp
+++ b/src/MyChar.cpp
@@ -1,6 +1,5 @@
 #include "MyChar.h"
 
-#include <stdint.h>
 #include <string.h>
 
 #include "WindowsWrapper.h"
--- a/src/MyChar.h
+++ b/src/MyChar.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 struct MYCHAR
--- a/src/MycHit.cpp
+++ b/src/MycHit.cpp
@@ -1,7 +1,5 @@
 #include "MycHit.h"
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 #include "Back.h"
--- a/src/MycParam.h
+++ b/src/MycParam.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 struct ARMS_LEVEL
@@ -11,8 +9,8 @@
 
 struct REC
 {
-	int32_t counter[4];
-	uint8_t random[4];
+	long counter[4];
+	unsigned char random[4];
 };
 
 extern ARMS_LEVEL gArmsLevelTable[14];
--- a/src/NpChar.cpp
+++ b/src/NpChar.cpp
@@ -1,7 +1,6 @@
 #include "NpChar.h"
 
 #include <stddef.h>
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -239,12 +238,11 @@
 
 BOOL SetBulletObject(int x, int y, int val)
 {
-	int t;
+	int t = 0;
+	int bullet_no;
 	int tamakazu_ari[10];
 	int n;
-	int bullet_no;
 
-	t = 0;
 	memset(tamakazu_ari, 0, sizeof(tamakazu_ari));
 	for (n = 0; n < 8; ++n)
 	{
@@ -297,7 +295,7 @@
 		return FALSE;
 
 	memset(&gNPC[n], 0, sizeof(NPCHAR));
-	gNPC[n].cond |= 0x80u;
+	gNPC[n].cond |= 0x80;
 	gNPC[n].direct = 0;
 	gNPC[n].code_char = 87;
 	gNPC[n].x = x;
--- a/src/NpChar.h
+++ b/src/NpChar.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 #include "Draw.h"
@@ -29,7 +27,7 @@
 
 struct NPCHAR
 {
-	uint8_t cond;
+	unsigned char cond;
 	int flag;
 	int x;
 	int y;
@@ -49,7 +47,7 @@
 	int exp;
 	int size;
 	int direct;
-	uint16_t bits;
+	unsigned short bits;
 	RECT rect;
 	int ani_wait;
 	int ani_no;
@@ -59,7 +57,7 @@
 	int act_wait;
 	RECT hit;
 	RECT view;
-	uint8_t shock;
+	unsigned char shock;
 	int damage_view;
 	int damage;
 	NPCHAR *pNpc;
@@ -67,12 +65,12 @@
 
 struct EVENT
 {
-  int16_t x;
-  int16_t y;
-  int16_t code_flag;
-  int16_t code_event;
-  int16_t code_char;
-  uint16_t bits;
+	short x;
+	short y;
+	short code_flag;
+	short code_event;
+	short code_char;
+	unsigned short bits;
 };
 
 extern NPCHAR gNPC[NPC_MAX];
--- a/src/NpcTbl.h
+++ b/src/NpcTbl.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 #include "Draw.h"
@@ -9,22 +7,22 @@
 
 struct NPC_TBL_RECT
 {
-  uint8_t front;
-  uint8_t top;
-  uint8_t back;
-  uint8_t bottom;
+	unsigned char front;
+	unsigned char top;
+	unsigned char back;
+	unsigned char bottom;
 };
 
 struct NPC_TABLE
 {
-	uint16_t bits;
-	uint16_t life;
-	uint8_t surf;
-	uint8_t hit_voice;
-	uint8_t destroy_voice;
-	uint8_t size;
-	int32_t exp;
-	int32_t damage;
+	unsigned short bits;
+	unsigned short life;
+	unsigned char surf;
+	unsigned char hit_voice;
+	unsigned char destroy_voice;
+	unsigned char size;
+	long exp;
+	long damage;
 	NPC_TBL_RECT hit;
 	NPC_TBL_RECT view;
 };
--- a/src/Organya.cpp
+++ b/src/Organya.cpp
@@ -1,7 +1,6 @@
 #include "Organya.h"
 
 #include <stddef.h>
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -33,7 +32,7 @@
 int gOrgVolume = 100;
 bool bFadeout = false;
 
-bool OrganyaNoteAlloc(uint16_t alloc)
+bool OrganyaNoteAlloc(unsigned short alloc)
 {
 	for(int j = 0; j < MAXTRACK; j++)
 	{
@@ -110,7 +109,7 @@
 	{   8,128, 32 }, //7 Oct
 };
 
-bool MakeSoundObject8(int8_t *wavep, int8_t track, int8_t pipi)
+bool MakeSoundObject8(signed char *wavep, signed char track, signed char pipi)
 {
 	for (int j = 0; j < 8; j++)
 	{
@@ -123,13 +122,13 @@
 			lpORGANBUFFER[track][j][k] = new SOUNDBUFFER(data_size);
 
 			//Get wave data
-			uint8_t *wp = new uint8_t[data_size];
-			uint8_t *wp_sub = wp;
+			unsigned char *wp = new unsigned char[data_size];
+			unsigned char *wp_sub = wp;
 			size_t wav_tp = 0;
 
 			for (size_t i = 0; i < data_size; i++)
 			{
-				uint8_t work = *(wavep+wav_tp);
+				unsigned char work = *(wavep+wav_tp);
 				work += 0x80;
 
 				*wp_sub = work;
@@ -142,7 +141,7 @@
 			}
 
 			//Copy wave data to sound buffer
-			uint8_t *buf;
+			unsigned char *buf;
 			lpORGANBUFFER[track][j][k]->Lock(&buf, NULL);
 			memcpy(buf, wp, data_size);
 			lpORGANBUFFER[track][j][k]->Unlock();
@@ -157,7 +156,7 @@
 //Playing melody tracks
 short freq_tbl[12] = { 262,277,294,311,330,349,370,392,415,440,466,494 };
 
-void ChangeOrganFrequency(uint8_t key, int8_t track, int32_t a)
+void ChangeOrganFrequency(unsigned char key, signed char track, long a)
 {
 	for (int j = 0; j < 8; j++) {
 		for (int i = 0; i < 2; i++) {
@@ -166,24 +165,24 @@
 	}
 }
 
-int16_t pan_tbl[13] = {0, 43, 86, 129, 172, 215, 256, 297, 340, 383, 426, 469, 512};
-uint8_t old_key[MAXTRACK] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
-uint8_t key_on[MAXTRACK] = {0};
-uint8_t key_twin[MAXTRACK] = {0};
+short pan_tbl[13] = {0, 43, 86, 129, 172, 215, 256, 297, 340, 383, 426, 469, 512};
+unsigned char old_key[MAXTRACK] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
+unsigned char key_on[MAXTRACK] = {0};
+unsigned char key_twin[MAXTRACK] = {0};
 
-void ChangeOrganPan(uint8_t key, uint8_t pan, int8_t track)
+void ChangeOrganPan(unsigned char key, unsigned char pan, signed char track)
 {
 	if(old_key[track] != PANDUMMY)
 		lpORGANBUFFER[track][old_key[track]/12][key_twin[track]]->SetPan((pan_tbl[pan] - 0x100) * 10);
 }
 
-void ChangeOrganVolume(int no, int32_t volume, int8_t track)
+void ChangeOrganVolume(int no, long volume, signed char track)
 {
 	if(old_key[track] != VOLDUMMY)
 		lpORGANBUFFER[track][old_key[track]/12][key_twin[track]]->SetVolume((volume - 0xFF) * 8);
 }
 
-void PlayOrganObject(uint8_t key, int mode, int8_t track, int32_t freq)
+void PlayOrganObject(unsigned char key, int mode, signed char track, long freq)
 {
 	if (lpORGANBUFFER[track][key/12][key_twin[track]] != NULL)
 	{
@@ -240,7 +239,7 @@
 }
 
 //Release tracks
-void ReleaseOrganyaObject(int8_t track)
+void ReleaseOrganyaObject(signed char track)
 {
 	for(int i = 0; i < 8; i++)
 	{
@@ -258,7 +257,7 @@
 }
 
 //Handling WAVE100
-int8_t wave_data[100][0x100];
+signed char wave_data[100][0x100];
 
 BOOL InitWaveData100()
 {
@@ -273,7 +272,7 @@
 }
 
 //Create org wave
-bool MakeOrganyaWave(int8_t track, int8_t wave_no, int8_t pipi)
+bool MakeOrganyaWave(signed char track, signed char wave_no, signed char pipi)
 {
 	if(wave_no > 99)
 	{
@@ -287,17 +286,17 @@
 }
 
 //Dram
-void ChangeDramFrequency(uint8_t key, int8_t track)
+void ChangeDramFrequency(unsigned char key, signed char track)
 {
 	lpDRAMBUFFER[track]->SetFrequency(key * 800 + 100);
 }
 
-void ChangeDramPan(uint8_t pan, int8_t track)
+void ChangeDramPan(unsigned char pan, signed char track)
 {
 	lpDRAMBUFFER[track]->SetPan((pan_tbl[pan] - 0x100) * 10);
 }
 
-void ChangeDramVolume(int32_t volume, int8_t track)
+void ChangeDramVolume(long volume, signed char track)
 {
 	lpDRAMBUFFER[track]->SetVolume((volume - 0xFF) * 8);
 }
@@ -324,9 +323,9 @@
 }
 
 //Play data
-int32_t play_p;
+long play_p;
 NOTELIST *play_np[MAXTRACK];
-int32_t now_leng[MAXMELODY] = {0};
+long now_leng[MAXMELODY] = {0};
 
 void OrganyaPlayData()
 {
@@ -393,7 +392,7 @@
 	}
 }
 
-void SetPlayPointer(int32_t x)
+void SetPlayPointer(long x)
 {
 	for (int i = 0; i < MAXTRACK; i++)
 	{
@@ -428,7 +427,7 @@
 	const unsigned char *p = FindResource(name, "ORG", NULL);
 
 	//Version Check
-	uint8_t ver = 0;
+	unsigned char ver = 0;
 	char pass_check[6];
 
 	memcpy(pass_check, p, 6);
@@ -454,7 +453,7 @@
 	for (int i = 0; i < 16; i++) {
 		info.tdata[i].freq = READ_LE16(p);
 		info.tdata[i].wave_no = *p++;
-		const int8_t pipi = *p++;
+		const signed char pipi = *p++;
 		info.tdata[i].pipi = ver == 1 ? 0 : pipi;
 		info.tdata[i].note_num = READ_LE16(p);
 	}
@@ -586,7 +585,7 @@
 	SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
 
 	//Set time for next step to play
-	uint32_t NextTick = SDL_GetTicks() + info.wait;
+	Uint32 NextTick = SDL_GetTicks() + info.wait;
 
 	while (bEndTimer == false)
 	{
--- a/src/Organya.h
+++ b/src/Organya.h
@@ -1,13 +1,11 @@
 #pragma once
 
-#include <stdint.h>
-
 //Below are Organya song data structures
 struct NOTELIST {
 	NOTELIST *from; //Previous address
 	NOTELIST *to; //Next address
 
-	int32_t x; //Position
+	long x; //Position
 	unsigned char length; //Sound length
 	unsigned char y; //Sound height
 	unsigned char volume; //Volume
@@ -16,10 +14,10 @@
 
 //Track data * 8
 struct TRACKDATA {
-	uint16_t freq; //Frequency (1000 is default)
-	uint8_t wave_no; //Waveform No.
-	int8_t pipi;
-	uint16_t note_num; //Number of notes
+	unsigned short freq; //Frequency (1000 is default)
+	unsigned char wave_no; //Waveform No.
+	signed char pipi;
+	unsigned short note_num; //Number of notes
 
 	NOTELIST *note_p;
 	NOTELIST *note_list;
@@ -27,20 +25,20 @@
 
 //Unique information held in songs
 struct MUSICINFO {
-	uint16_t wait;
+	unsigned short wait;
 	bool loaded;
 	bool playing;
 	unsigned char line; //Number of lines in one measure
 	unsigned char dot; //Number of dots per line
-	uint16_t alloc_note; //Number of allocated notes
-	int32_t repeat_x; //Repeat
-	int32_t end_x; //End of song (Return to repeat)
+	unsigned short alloc_note; //Number of allocated notes
+	long repeat_x; //Repeat
+	long end_x; //End of song (Return to repeat)
 	TRACKDATA tdata[16];
 };
 
-bool MakeOrganyaWave(int8_t track, int8_t wave_no, int8_t pipi);
+bool MakeOrganyaWave(signed char track, signed char wave_no, signed char pipi);
 void OrganyaPlayData();
-void SetPlayPointer(int32_t x);
+void SetPlayPointer(long x);
 void LoadOrganya(const char *name);
 void SetOrganyaPosition(unsigned int x);
 unsigned int GetOrganyaPosition();
--- a/src/Profile.cpp
+++ b/src/Profile.cpp
@@ -1,7 +1,6 @@
 #include "Profile.h"
 
 #include <stddef.h>
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 
--- a/src/Profile.h
+++ b/src/Profile.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 #include "ArmsItem.h"
@@ -15,10 +13,10 @@
 	int x;
 	int y;
 	int direct;
-	int16_t max_life;
-	int16_t star;
-	int16_t life;
-	int16_t a;
+	short max_life;
+	short star;
+	short life;
+	short a;
 	int select_arms;
 	int select_item;
 	int equip;
@@ -29,7 +27,7 @@
 	PERMIT_STAGE permitstage[8];
 	signed char permit_mapping[0x80];
 	char FLAG[4];
-	uint8_t flags[1000];
+	unsigned char flags[1000];
 };
 
 BOOL IsProfile();
--- a/src/Sound.cpp
+++ b/src/Sound.cpp
@@ -2,7 +2,6 @@
 
 #include <algorithm>
 #include <cmath>
-#include <stdint.h>
 #include <stdio.h>
 #include <string>
 #include <cstring>
@@ -48,7 +47,7 @@
 	samplePosition = 0.0;
 
 	//Create waveform buffer
-	data = new uint8_t[bufSize];
+	data = new unsigned char[bufSize];
 	memset(data, 0x80, bufSize);
 
 	//Add to buffer list
@@ -88,7 +87,7 @@
 	delete this;
 }
 
-void SOUNDBUFFER::Lock(uint8_t **outBuffer, size_t *outSize)
+void SOUNDBUFFER::Lock(unsigned char **outBuffer, size_t *outSize)
 {
 	SDL_LockAudioDevice(audioDevice);
 
@@ -104,7 +103,7 @@
 	SDL_UnlockAudioDevice(audioDevice);
 }
 
-void SOUNDBUFFER::SetCurrentPosition(uint32_t dwNewPosition)
+void SOUNDBUFFER::SetCurrentPosition(unsigned long dwNewPosition)
 {
 	SDL_LockAudioDevice(audioDevice);
 	samplePosition = dwNewPosition;
@@ -111,7 +110,7 @@
 	SDL_UnlockAudioDevice(audioDevice);
 }
 
-void SOUNDBUFFER::SetFrequency(uint32_t dwFrequency)
+void SOUNDBUFFER::SetFrequency(unsigned long dwFrequency)
 {
 	SDL_LockAudioDevice(audioDevice);
 	frequency = (double)dwFrequency;
@@ -118,14 +117,14 @@
 	SDL_UnlockAudioDevice(audioDevice);
 }
 
-float MillibelToVolume(int32_t lVolume)
+float MillibelToVolume(long lVolume)
 {
 	//Volume is in hundredths of decibels, from 0 to -10000
-	lVolume = clamp(lVolume, (int32_t)-10000, (int32_t)0);
+	lVolume = clamp(lVolume, (long)-10000, (long)0);
 	return (float)pow(10.0, lVolume / 2000.0);
 }
 
-void SOUNDBUFFER::SetVolume(int32_t lVolume)
+void SOUNDBUFFER::SetVolume(long lVolume)
 {
 	SDL_LockAudioDevice(audioDevice);
 	volume = MillibelToVolume(lVolume);
@@ -132,7 +131,7 @@
 	SDL_UnlockAudioDevice(audioDevice);
 }
 
-void SOUNDBUFFER::SetPan(int32_t lPan)
+void SOUNDBUFFER::SetPan(long lPan)
 {
 	SDL_LockAudioDevice(audioDevice);
 	volume_l = MillibelToVolume(-lPan);
@@ -288,19 +287,19 @@
 	}
 }
 
-void ChangeSoundFrequency(int no, uint32_t rate)
+void ChangeSoundFrequency(int no, unsigned long rate)
 {
 	if (lpSECONDARYBUFFER[no])
 		lpSECONDARYBUFFER[no]->SetFrequency(10 * rate + 100);
 }
 
-void ChangeSoundVolume(int no, int32_t volume)
+void ChangeSoundVolume(int no, long volume)
 {
 	if (lpSECONDARYBUFFER[no])
 		lpSECONDARYBUFFER[no]->SetVolume(8 * volume - 2400);
 }
 
-void ChangeSoundPan(int no, int32_t pan)
+void ChangeSoundPan(int no, long pan)
 {
 	if (lpSECONDARYBUFFER[no])
 		lpSECONDARYBUFFER[no]->SetPan(10 * (pan - 256));
--- a/src/Sound.h
+++ b/src/Sound.h
@@ -1,7 +1,6 @@
 #pragma once
 
 #include <stddef.h>
-#include <stdint.h>
 
 #include "PixTone.h"
 
@@ -13,13 +12,13 @@
 
 		void Release();
 
-		void Lock(uint8_t **buffer, size_t *size);
+		void Lock(unsigned char **buffer, size_t *size);
 		void Unlock();
 
-		void SetCurrentPosition(uint32_t dwNewPosition);
-		void SetFrequency(uint32_t dwFrequency);
-		void SetVolume(int32_t lVolume);
-		void SetPan(int32_t lPan);
+		void SetCurrentPosition(unsigned long dwNewPosition);
+		void SetFrequency(unsigned long dwFrequency);
+		void SetVolume(long lVolume);
+		void SetPan(long lPan);
 		void Play(bool bLooping);
 		void Stop();
 
@@ -28,7 +27,7 @@
 		SOUNDBUFFER *next;
 
 	private:
-		uint8_t *data;
+		unsigned char *data;
 		size_t size;
 
 		bool playing;
@@ -95,7 +94,7 @@
 bool InitDirectSound();
 void EndDirectSound();
 void PlaySoundObject(int no, int mode);
-void ChangeSoundFrequency(int no, uint32_t rate);
-void ChangeSoundVolume(int no, int32_t volume);
-void ChangeSoundPan(int no, int32_t pan);
+void ChangeSoundFrequency(int no, unsigned long rate);
+void ChangeSoundVolume(int no, long volume);
+void ChangeSoundPan(int no, long pan);
 int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no);
--- a/src/Stage.cpp
+++ b/src/Stage.cpp
@@ -1,6 +1,5 @@
 #include "Stage.h"
 
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 
--- a/src/TextScr.cpp
+++ b/src/TextScr.cpp
@@ -1,6 +1,5 @@
 #include "TextScr.h"
 
-#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -91,7 +90,7 @@
 }
 
 //Decrypt .tsc
-void EncryptionBinaryData2(uint8_t *pData, int size)
+void EncryptionBinaryData2(unsigned char *pData, int size)
 {
 	int val1;
 
@@ -136,7 +135,7 @@
 	strcpy(gTS.path, name);
 
 	//Decrypt data
-	EncryptionBinaryData2((uint8_t*)gTS.data, gTS.size);
+	EncryptionBinaryData2((unsigned char*)gTS.data, gTS.size);
 	return TRUE;
 }
 
@@ -157,7 +156,7 @@
 
 	//Read Head.tsc
 	fread(gTS.data, 1, head_size, fp);
-	EncryptionBinaryData2((uint8_t*)gTS.data, head_size);
+	EncryptionBinaryData2((unsigned char*)gTS.data, head_size);
 	gTS.data[head_size] = 0;
 	fclose(fp);
 
@@ -174,7 +173,7 @@
 
 	//Read stage's tsc
 	fread(&gTS.data[head_size], 1, body_size, fp);
-	EncryptionBinaryData2((uint8_t*)&gTS.data[head_size], body_size);
+	EncryptionBinaryData2((unsigned char*)&gTS.data[head_size], body_size);
 	gTS.data[head_size + body_size] = 0;
 	fclose(fp);
 
--- a/src/TextScr.h
+++ b/src/TextScr.h
@@ -1,7 +1,5 @@
 #pragma once
 
-#include <stdint.h>
-
 #include "WindowsWrapper.h"
 
 #include "CommonDefines.h"
@@ -54,12 +52,12 @@
 	int offsetY;
 
 	//NOD cursor blink
-	uint8_t wait_beam;
+	unsigned char wait_beam;
 };
 
 BOOL InitTextScript2();
 void EndTextScript();
-void EncryptionBinaryData2(uint8_t *pData, int size);
+void EncryptionBinaryData2(unsigned char *pData, int size);
 BOOL LoadTextScript2(const char *name);
 BOOL LoadTextScript_Stage(const char *name);
 void GetTextScriptPath(char *path);
--- a/src/Triangle.cpp
+++ b/src/Triangle.cpp
@@ -1,10 +1,9 @@
 #include "Triangle.h"
 
-#include <stdint.h>
 #include <math.h>
 
 int gSin[0x100];
-int16_t gTan[0x21];
+short gTan[0x21];
 
 void InitTriangleTable()
 {
@@ -23,27 +22,27 @@
 	{
 		a = (float)(i * 6.2831855f / 256.0f);
 		b = sinf(a) / cosf(a);
-		gTan[i] = (int16_t)(b * 8192.0f);
+		gTan[i] = (short)(b * 8192.0f);
 	}
 }
 
-int GetSin(uint8_t deg)
+int GetSin(unsigned char deg)
 {
 	return gSin[deg];
 }
 
-int GetCos(uint8_t deg)
+int GetCos(unsigned char deg)
 {
 	deg += 0x40;
 	return gSin[deg];
 }
 
-uint8_t GetArktan(int x, int y)
+unsigned char GetArktan(int x, int y)
 {
 	x *= -1;
 	y *= -1;
-	uint8_t a = 0;
-	int16_t k;
+	unsigned char a = 0;
+	short k;
 
 	if (x > 0)
 	{
--- a/src/Triangle.h
+++ b/src/Triangle.h
@@ -1,8 +1,6 @@
 #pragma once
 
-#include <stdint.h>
-
 void InitTriangleTable();
-int GetSin(uint8_t deg);
-int GetCos(uint8_t deg);
-uint8_t GetArktan(int x, int y);
+int GetSin(unsigned char deg);
+int GetCos(unsigned char deg);
+unsigned char GetArktan(int x, int y);