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.
This commit is contained in:
Clownacy 2019-05-13 15:18:33 +01:00
parent a94d9a4367
commit 676ee004fe
37 changed files with 143 additions and 195 deletions

View file

@ -1,6 +1,5 @@
#include "Boss.h" #include "Boss.h"
#include <stdint.h>
#include <string.h> #include <string.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"

View file

@ -45,7 +45,7 @@ int JudgeHitBulletBlock(int x, int y, BULLET *bul)
return hit; 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 i;
int workX; int workX;

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
struct BULLET struct BULLET
@ -20,7 +18,7 @@ struct BULLET
int act_wait; int act_wait;
int ani_wait; int ani_wait;
int ani_no; int ani_no;
uint8_t direct; unsigned char direct;
RECT rect; RECT rect;
int count1; int count1;
int count2; int count2;
@ -36,8 +34,8 @@ struct BULLET
struct BULLET_TABLE struct BULLET_TABLE
{ {
int8_t damage; signed char damage;
int8_t life; signed char life;
int life_count; int life_count;
int bbits; int bbits;
int enemyXL; int enemyXL;

View file

@ -1,5 +1,4 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View file

@ -1,19 +1,17 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
struct CONFIG struct CONFIG
{ {
char proof[0x20]; char proof[0x20];
char font_name[0x40]; char font_name[0x40];
int32_t move_button_mode; long move_button_mode;
int32_t attack_button_mode; long attack_button_mode;
int32_t ok_button_mode; long ok_button_mode;
int32_t display_mode; long display_mode;
int32_t bJoystick; long bJoystick;
int32_t joystick_button[8]; long joystick_button[8];
}; };
BOOL LoadConfigData(CONFIG *conf); BOOL LoadConfigData(CONFIG *conf);

View file

@ -1,5 +1,4 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -57,8 +56,8 @@ BOOL Flip_SystemTask()
return FALSE; return FALSE;
// Framerate limiter // Framerate limiter
static uint32_t timePrev; static Uint32 timePrev;
const uint32_t timeNow = SDL_GetTicks(); const Uint32 timeNow = SDL_GetTicks();
if (timeNow >= timePrev + FRAMERATE) if (timeNow >= timePrev + FRAMERATE)
{ {
@ -485,7 +484,7 @@ unsigned long GetCortBoxColor(unsigned long col)
return col; return col;
} }
void CortBox(RECT *rect, uint32_t col) void CortBox(RECT *rect, unsigned long col)
{ {
// Get rect // Get rect
SDL_Rect destRect = RectToSDLRectScaled(rect); SDL_Rect destRect = RectToSDLRectScaled(rect);
@ -498,7 +497,7 @@ void CortBox(RECT *rect, uint32_t col)
SDL_RenderFillRect(gRenderer, &destRect); 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 // Get rect
SDL_Rect destRect = RectToSDLRectScaled(rect); SDL_Rect destRect = RectToSDLRectScaled(rect);
@ -610,7 +609,7 @@ void InitTextObject(const char *font_name)
gFont = LoadFontFromData(res_data, data_size, fontWidth, fontHeight); 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; int surface_width, surface_height;
SDL_GetRendererOutputSize(gRenderer, &surface_width, &surface_height); SDL_GetRendererOutputSize(gRenderer, &surface_width, &surface_height);
@ -626,7 +625,7 @@ void PutText(int x, int y, const char *text, uint32_t color)
SDL_DestroyTexture(screen_texture); 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)); 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; surf[surf_no].needs_updating = true;

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#ifndef RGB #ifndef RGB
@ -68,9 +66,9 @@ void PutBitmap3(RECT *rcView, int x, int y, RECT *rect, Surface_Ids surf_no);
void PutBitmap4(RECT *rcView, int x, int y, RECT *rect, Surface_Ids surf_no); 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); void Surface2Surface(int x, int y, RECT *rect, int to, int from);
unsigned long GetCortBoxColor(unsigned long col); unsigned long GetCortBoxColor(unsigned long col);
void CortBox(RECT *rect, uint32_t col); void CortBox(RECT *rect, unsigned long col);
void CortBox2(RECT *rect, uint32_t col, Surface_Ids surf_no); void CortBox2(RECT *rect, unsigned long col, Surface_Ids surf_no);
void InitTextObject(const char *font_name); void InitTextObject(const char *font_name);
void PutText(int x, int y, const char *text, uint32_t color); void PutText(int x, int y, const char *text, unsigned long color);
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);
void EndTextObject(); void EndTextObject();

View file

@ -1,6 +1,5 @@
#include "Ending.h" #include "Ending.h"
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -184,7 +183,7 @@ bool StartCreditScript()
// Read data // Read data
fread(Credit.pData, 1, Credit.size, fp); fread(Credit.pData, 1, Credit.size, fp);
EncryptionBinaryData2((uint8_t*)Credit.pData, Credit.size); EncryptionBinaryData2((unsigned char*)Credit.pData, Credit.size);
#ifdef FIX_BUGS #ifdef FIX_BUGS
// The original game forgot to close the file // The original game forgot to close the file
@ -229,7 +228,7 @@ void ActionCredit_Read()
while (Credit.offset < Credit.size) while (Credit.offset < Credit.size)
{ {
// Get character // Get character
uint8_t character = Credit.pData[Credit.offset]; unsigned char character = Credit.pData[Credit.offset];
int a, b, len; int a, b, len;
switch (character) switch (character)

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
struct CREDIT struct CREDIT
{ {
int size; int size;

View file

@ -13,7 +13,7 @@ FRAME gFrame;
void MoveFrame3() void MoveFrame3()
{ {
int16_t map_w, map_l; short map_w, map_l;
GetMapData(0, &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 #if WINDOW_WIDTH != 320 || WINDOW_HEIGHT != 240 // TODO - Really need to make this a compiler flag
@ -119,7 +119,7 @@ void SetFramePosition(int fx, int fy)
gFrame.quake2 = 0; gFrame.quake2 = 0;
//Move frame position //Move frame position
int16_t map_w, map_l; short map_w, map_l;
GetMapData(0, &map_w, &map_l); GetMapData(0, &map_w, &map_l);
gFrame.x = fx; gFrame.x = fx;
@ -143,7 +143,7 @@ void SetFrameMyChar()
int mc_x, mc_y; int mc_x, mc_y;
GetMyCharPosition(&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); GetMapData(0, &map_w, &map_l);
gFrame.x = mc_x - (WINDOW_WIDTH << 8); gFrame.x = mc_x - (WINDOW_WIDTH << 8);

View file

@ -1,6 +1,5 @@
#include "Generic.h" #include "Generic.h"
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include "CommonDefines.h" #include "CommonDefines.h"
@ -45,7 +44,7 @@ bool CheckFileExists(const char *name)
return false; return false;
} }
bool IsShiftJIS(uint8_t c) bool IsShiftJIS(unsigned char c)
{ {
if (c > 0x80 && c < 0xA0) if (c > 0x80 && c < 0xA0)
return true; return true;

View file

@ -1,8 +1,6 @@
#pragma once #pragma once
#include <stdint.h>
bool GetCompileVersion(int *v1, int *v2, int *v3, int *v4); bool GetCompileVersion(int *v1, int *v2, int *v3, int *v4);
long GetFileSizeLong(const char *path); long GetFileSizeLong(const char *path);
bool CheckFileExists(const char *name); bool CheckFileExists(const char *name);
bool IsShiftJIS(uint8_t c); bool IsShiftJIS(unsigned char c);

View file

@ -1,7 +1,6 @@
#include "Input.h" #include "Input.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <string.h> #include <string.h>
#include <SDL.h> #include <SDL.h>
@ -51,8 +50,8 @@ bool GetJoystickStatus(JOYSTICK_STATUS *pStatus)
if (joystick) if (joystick)
{ {
int32_t x = SDL_JoystickGetAxis(joystick, 0); Sint16 x = SDL_JoystickGetAxis(joystick, 0);
int32_t y = SDL_JoystickGetAxis(joystick, 1); Sint16 y = SDL_JoystickGetAxis(joystick, 1);
pStatus->bLeft = x <= -JOYSTICK_DEADZONE; pStatus->bLeft = x <= -JOYSTICK_DEADZONE;
pStatus->bRight = x >= JOYSTICK_DEADZONE; pStatus->bRight = x >= JOYSTICK_DEADZONE;
pStatus->bUp = y <= -JOYSTICK_DEADZONE; pStatus->bUp = y <= -JOYSTICK_DEADZONE;

View file

@ -1,7 +1,6 @@
#include "Main.h" #include "Main.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View file

@ -1,7 +1,6 @@
#include "Map.h" #include "Map.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -21,7 +20,7 @@ static const char *code_pxma = "PXM";
BOOL InitMapData2() BOOL InitMapData2()
{ {
gMap.data = (uint8_t*)malloc(PXM_BUFFER_SIZE); gMap.data = (unsigned char*)malloc(PXM_BUFFER_SIZE);
return TRUE; return TRUE;
} }
@ -103,7 +102,7 @@ void ReleasePartsImage()
ReleaseSurface(SURFACE_ID_LEVEL_TILESET); 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) if (data)
*data = gMap.data; *data = gMap.data;
@ -132,7 +131,7 @@ void ShiftMapParts(int x, int y)
*(gMap.data + x + gMap.width * y) -= 1; *(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) if (*(gMap.data + x + gMap.width * y) == no)
return FALSE; return FALSE;

View file

@ -1,15 +1,13 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
struct MAP_DATA struct MAP_DATA
{ {
uint8_t *data; unsigned char *data;
uint8_t atrb[0x101]; //Why is this 257 bytes? unsigned char atrb[0x101]; //Why is this 257 bytes?
int16_t width; short width;
int16_t length; short length;
}; };
extern MAP_DATA gMap; extern MAP_DATA gMap;
@ -19,11 +17,11 @@ BOOL LoadMapData2(const char *path_map);
BOOL LoadAttributeData(const char *path_atrb); BOOL LoadAttributeData(const char *path_atrb);
void EndMapData(); void EndMapData();
void ReleasePartsImage(); 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); unsigned char GetAttribute(int x, int y);
void DeleteMapParts(int x, int y); void DeleteMapParts(int x, int y);
void ShiftMapParts(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_Back(int fx, int fy);
void PutStage_Front(int fx, int fy); void PutStage_Front(int fx, int fy);
void PutMapDataVector(int fx, int fy); void PutMapDataVector(int fx, int fy);

View file

@ -1,6 +1,5 @@
#include "MapName.h" #include "MapName.h"
#include <stdint.h>
#include <string.h> #include <string.h>
#include "CommonDefines.h" #include "CommonDefines.h"

View file

@ -1,6 +1,5 @@
#include "MiniMap.h" #include "MiniMap.h"
#include <stdint.h>
#include <string.h> #include <string.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
@ -127,7 +126,7 @@ int MiniMapLoop()
CortBox2(&rcMiniMap, 0, SURFACE_ID_MAP); CortBox2(&rcMiniMap, 0, SURFACE_ID_MAP);
int line = 0; int line = 0;
uint8_t my_wait = 0; unsigned char my_wait = 0;
while (true) while (true)
{ {
GetTrg(); GetTrg();

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
extern char gMapping[0x80]; extern char gMapping[0x80];

View file

@ -1,6 +1,5 @@
#include "MyChar.h" #include "MyChar.h"
#include <stdint.h>
#include <string.h> #include <string.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
struct MYCHAR struct MYCHAR

View file

@ -1,7 +1,5 @@
#include "MycHit.h" #include "MycHit.h"
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#include "Back.h" #include "Back.h"

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
struct ARMS_LEVEL struct ARMS_LEVEL
@ -11,8 +9,8 @@ struct ARMS_LEVEL
struct REC struct REC
{ {
int32_t counter[4]; long counter[4];
uint8_t random[4]; unsigned char random[4];
}; };
extern ARMS_LEVEL gArmsLevelTable[14]; extern ARMS_LEVEL gArmsLevelTable[14];

View file

@ -1,7 +1,6 @@
#include "NpChar.h" #include "NpChar.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -239,12 +238,11 @@ void SetExpObjects(int x, int y, int exp)
BOOL SetBulletObject(int x, int y, int val) BOOL SetBulletObject(int x, int y, int val)
{ {
int t; int t = 0;
int bullet_no;
int tamakazu_ari[10]; int tamakazu_ari[10];
int n; int n;
int bullet_no;
t = 0;
memset(tamakazu_ari, 0, sizeof(tamakazu_ari)); memset(tamakazu_ari, 0, sizeof(tamakazu_ari));
for (n = 0; n < 8; ++n) for (n = 0; n < 8; ++n)
{ {
@ -297,7 +295,7 @@ BOOL SetLifeObject(int x, int y, int val)
return FALSE; return FALSE;
memset(&gNPC[n], 0, sizeof(NPCHAR)); memset(&gNPC[n], 0, sizeof(NPCHAR));
gNPC[n].cond |= 0x80u; gNPC[n].cond |= 0x80;
gNPC[n].direct = 0; gNPC[n].direct = 0;
gNPC[n].code_char = 87; gNPC[n].code_char = 87;
gNPC[n].x = x; gNPC[n].x = x;

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#include "Draw.h" #include "Draw.h"
@ -29,7 +27,7 @@ enum NPC_flags
struct NPCHAR struct NPCHAR
{ {
uint8_t cond; unsigned char cond;
int flag; int flag;
int x; int x;
int y; int y;
@ -49,7 +47,7 @@ struct NPCHAR
int exp; int exp;
int size; int size;
int direct; int direct;
uint16_t bits; unsigned short bits;
RECT rect; RECT rect;
int ani_wait; int ani_wait;
int ani_no; int ani_no;
@ -59,7 +57,7 @@ struct NPCHAR
int act_wait; int act_wait;
RECT hit; RECT hit;
RECT view; RECT view;
uint8_t shock; unsigned char shock;
int damage_view; int damage_view;
int damage; int damage;
NPCHAR *pNpc; NPCHAR *pNpc;
@ -67,12 +65,12 @@ struct NPCHAR
struct EVENT struct EVENT
{ {
int16_t x; short x;
int16_t y; short y;
int16_t code_flag; short code_flag;
int16_t code_event; short code_event;
int16_t code_char; short code_char;
uint16_t bits; unsigned short bits;
}; };
extern NPCHAR gNPC[NPC_MAX]; extern NPCHAR gNPC[NPC_MAX];

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#include "Draw.h" #include "Draw.h"
@ -9,22 +7,22 @@
struct NPC_TBL_RECT struct NPC_TBL_RECT
{ {
uint8_t front; unsigned char front;
uint8_t top; unsigned char top;
uint8_t back; unsigned char back;
uint8_t bottom; unsigned char bottom;
}; };
struct NPC_TABLE struct NPC_TABLE
{ {
uint16_t bits; unsigned short bits;
uint16_t life; unsigned short life;
uint8_t surf; unsigned char surf;
uint8_t hit_voice; unsigned char hit_voice;
uint8_t destroy_voice; unsigned char destroy_voice;
uint8_t size; unsigned char size;
int32_t exp; long exp;
int32_t damage; long damage;
NPC_TBL_RECT hit; NPC_TBL_RECT hit;
NPC_TBL_RECT view; NPC_TBL_RECT view;
}; };

View file

@ -1,7 +1,6 @@
#include "Organya.h" #include "Organya.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -33,7 +32,7 @@ int gTrackVol[MAXTRACK];
int gOrgVolume = 100; int gOrgVolume = 100;
bool bFadeout = false; bool bFadeout = false;
bool OrganyaNoteAlloc(uint16_t alloc) bool OrganyaNoteAlloc(unsigned short alloc)
{ {
for(int j = 0; j < MAXTRACK; j++) for(int j = 0; j < MAXTRACK; j++)
{ {
@ -110,7 +109,7 @@ OCTWAVE oct_wave[8] = {
{ 8,128, 32 }, //7 Oct { 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++) for (int j = 0; j < 8; j++)
{ {
@ -123,13 +122,13 @@ bool MakeSoundObject8(int8_t *wavep, int8_t track, int8_t pipi)
lpORGANBUFFER[track][j][k] = new SOUNDBUFFER(data_size); lpORGANBUFFER[track][j][k] = new SOUNDBUFFER(data_size);
//Get wave data //Get wave data
uint8_t *wp = new uint8_t[data_size]; unsigned char *wp = new unsigned char[data_size];
uint8_t *wp_sub = wp; unsigned char *wp_sub = wp;
size_t wav_tp = 0; size_t wav_tp = 0;
for (size_t i = 0; i < data_size; i++) for (size_t i = 0; i < data_size; i++)
{ {
uint8_t work = *(wavep+wav_tp); unsigned char work = *(wavep+wav_tp);
work += 0x80; work += 0x80;
*wp_sub = work; *wp_sub = work;
@ -142,7 +141,7 @@ bool MakeSoundObject8(int8_t *wavep, int8_t track, int8_t pipi)
} }
//Copy wave data to sound buffer //Copy wave data to sound buffer
uint8_t *buf; unsigned char *buf;
lpORGANBUFFER[track][j][k]->Lock(&buf, NULL); lpORGANBUFFER[track][j][k]->Lock(&buf, NULL);
memcpy(buf, wp, data_size); memcpy(buf, wp, data_size);
lpORGANBUFFER[track][j][k]->Unlock(); lpORGANBUFFER[track][j][k]->Unlock();
@ -157,7 +156,7 @@ bool MakeSoundObject8(int8_t *wavep, int8_t track, int8_t pipi)
//Playing melody tracks //Playing melody tracks
short freq_tbl[12] = { 262,277,294,311,330,349,370,392,415,440,466,494 }; 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 j = 0; j < 8; j++) {
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
@ -166,24 +165,24 @@ void ChangeOrganFrequency(uint8_t key, int8_t track, int32_t a)
} }
} }
int16_t pan_tbl[13] = {0, 43, 86, 129, 172, 215, 256, 297, 340, 383, 426, 469, 512}; short 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}; unsigned char old_key[MAXTRACK] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
uint8_t key_on[MAXTRACK] = {0}; unsigned char key_on[MAXTRACK] = {0};
uint8_t key_twin[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) if(old_key[track] != PANDUMMY)
lpORGANBUFFER[track][old_key[track]/12][key_twin[track]]->SetPan((pan_tbl[pan] - 0x100) * 10); 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) if(old_key[track] != VOLDUMMY)
lpORGANBUFFER[track][old_key[track]/12][key_twin[track]]->SetVolume((volume - 0xFF) * 8); 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) if (lpORGANBUFFER[track][key/12][key_twin[track]] != NULL)
{ {
@ -240,7 +239,7 @@ void PlayOrganObject(uint8_t key, int mode, int8_t track, int32_t freq)
} }
//Release tracks //Release tracks
void ReleaseOrganyaObject(int8_t track) void ReleaseOrganyaObject(signed char track)
{ {
for(int i = 0; i < 8; i++) for(int i = 0; i < 8; i++)
{ {
@ -258,7 +257,7 @@ void ReleaseOrganyaObject(int8_t track)
} }
//Handling WAVE100 //Handling WAVE100
int8_t wave_data[100][0x100]; signed char wave_data[100][0x100];
BOOL InitWaveData100() BOOL InitWaveData100()
{ {
@ -273,7 +272,7 @@ BOOL InitWaveData100()
} }
//Create org wave //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) if(wave_no > 99)
{ {
@ -287,17 +286,17 @@ bool MakeOrganyaWave(int8_t track, int8_t wave_no, int8_t pipi)
} }
//Dram //Dram
void ChangeDramFrequency(uint8_t key, int8_t track) void ChangeDramFrequency(unsigned char key, signed char track)
{ {
lpDRAMBUFFER[track]->SetFrequency(key * 800 + 100); 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); 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); lpDRAMBUFFER[track]->SetVolume((volume - 0xFF) * 8);
} }
@ -324,9 +323,9 @@ void PlayDramObject(unsigned char key, int mode, signed char track)
} }
//Play data //Play data
int32_t play_p; long play_p;
NOTELIST *play_np[MAXTRACK]; NOTELIST *play_np[MAXTRACK];
int32_t now_leng[MAXMELODY] = {0}; long now_leng[MAXMELODY] = {0};
void OrganyaPlayData() void OrganyaPlayData()
{ {
@ -393,7 +392,7 @@ void OrganyaPlayData()
} }
} }
void SetPlayPointer(int32_t x) void SetPlayPointer(long x)
{ {
for (int i = 0; i < MAXTRACK; i++) for (int i = 0; i < MAXTRACK; i++)
{ {
@ -428,7 +427,7 @@ void LoadOrganya(const char *name)
const unsigned char *p = FindResource(name, "ORG", NULL); const unsigned char *p = FindResource(name, "ORG", NULL);
//Version Check //Version Check
uint8_t ver = 0; unsigned char ver = 0;
char pass_check[6]; char pass_check[6];
memcpy(pass_check, p, 6); memcpy(pass_check, p, 6);
@ -454,7 +453,7 @@ void LoadOrganya(const char *name)
for (int i = 0; i < 16; i++) { for (int i = 0; i < 16; i++) {
info.tdata[i].freq = READ_LE16(p); info.tdata[i].freq = READ_LE16(p);
info.tdata[i].wave_no = *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].pipi = ver == 1 ? 0 : pipi;
info.tdata[i].note_num = READ_LE16(p); info.tdata[i].note_num = READ_LE16(p);
} }
@ -586,7 +585,7 @@ int OrganyaPlayTimer(void *ptr)
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH); SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
//Set time for next step to play //Set time for next step to play
uint32_t NextTick = SDL_GetTicks() + info.wait; Uint32 NextTick = SDL_GetTicks() + info.wait;
while (bEndTimer == false) while (bEndTimer == false)
{ {

View file

@ -1,13 +1,11 @@
#pragma once #pragma once
#include <stdint.h>
//Below are Organya song data structures //Below are Organya song data structures
struct NOTELIST { struct NOTELIST {
NOTELIST *from; //Previous address NOTELIST *from; //Previous address
NOTELIST *to; //Next address NOTELIST *to; //Next address
int32_t x; //Position long x; //Position
unsigned char length; //Sound length unsigned char length; //Sound length
unsigned char y; //Sound height unsigned char y; //Sound height
unsigned char volume; //Volume unsigned char volume; //Volume
@ -16,10 +14,10 @@ struct NOTELIST {
//Track data * 8 //Track data * 8
struct TRACKDATA { struct TRACKDATA {
uint16_t freq; //Frequency (1000 is default) unsigned short freq; //Frequency (1000 is default)
uint8_t wave_no; //Waveform No. unsigned char wave_no; //Waveform No.
int8_t pipi; signed char pipi;
uint16_t note_num; //Number of notes unsigned short note_num; //Number of notes
NOTELIST *note_p; NOTELIST *note_p;
NOTELIST *note_list; NOTELIST *note_list;
@ -27,20 +25,20 @@ struct TRACKDATA {
//Unique information held in songs //Unique information held in songs
struct MUSICINFO { struct MUSICINFO {
uint16_t wait; unsigned short wait;
bool loaded; bool loaded;
bool playing; bool playing;
unsigned char line; //Number of lines in one measure unsigned char line; //Number of lines in one measure
unsigned char dot; //Number of dots per line unsigned char dot; //Number of dots per line
uint16_t alloc_note; //Number of allocated notes unsigned short alloc_note; //Number of allocated notes
int32_t repeat_x; //Repeat long repeat_x; //Repeat
int32_t end_x; //End of song (Return to repeat) long end_x; //End of song (Return to repeat)
TRACKDATA tdata[16]; 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 OrganyaPlayData();
void SetPlayPointer(int32_t x); void SetPlayPointer(long x);
void LoadOrganya(const char *name); void LoadOrganya(const char *name);
void SetOrganyaPosition(unsigned int x); void SetOrganyaPosition(unsigned int x);
unsigned int GetOrganyaPosition(); unsigned int GetOrganyaPosition();

View file

@ -1,7 +1,6 @@
#include "Profile.h" #include "Profile.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#include "ArmsItem.h" #include "ArmsItem.h"
@ -15,10 +13,10 @@ struct PROFILE
int x; int x;
int y; int y;
int direct; int direct;
int16_t max_life; short max_life;
int16_t star; short star;
int16_t life; short life;
int16_t a; short a;
int select_arms; int select_arms;
int select_item; int select_item;
int equip; int equip;
@ -29,7 +27,7 @@ struct PROFILE
PERMIT_STAGE permitstage[8]; PERMIT_STAGE permitstage[8];
signed char permit_mapping[0x80]; signed char permit_mapping[0x80];
char FLAG[4]; char FLAG[4];
uint8_t flags[1000]; unsigned char flags[1000];
}; };
BOOL IsProfile(); BOOL IsProfile();

View file

@ -2,7 +2,6 @@
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
#include <cstring> #include <cstring>
@ -48,7 +47,7 @@ SOUNDBUFFER::SOUNDBUFFER(size_t bufSize)
samplePosition = 0.0; samplePosition = 0.0;
//Create waveform buffer //Create waveform buffer
data = new uint8_t[bufSize]; data = new unsigned char[bufSize];
memset(data, 0x80, bufSize); memset(data, 0x80, bufSize);
//Add to buffer list //Add to buffer list
@ -88,7 +87,7 @@ void SOUNDBUFFER::Release()
delete this; delete this;
} }
void SOUNDBUFFER::Lock(uint8_t **outBuffer, size_t *outSize) void SOUNDBUFFER::Lock(unsigned char **outBuffer, size_t *outSize)
{ {
SDL_LockAudioDevice(audioDevice); SDL_LockAudioDevice(audioDevice);
@ -104,35 +103,35 @@ void SOUNDBUFFER::Unlock()
SDL_UnlockAudioDevice(audioDevice); SDL_UnlockAudioDevice(audioDevice);
} }
void SOUNDBUFFER::SetCurrentPosition(uint32_t dwNewPosition) void SOUNDBUFFER::SetCurrentPosition(unsigned long dwNewPosition)
{ {
SDL_LockAudioDevice(audioDevice); SDL_LockAudioDevice(audioDevice);
samplePosition = dwNewPosition; samplePosition = dwNewPosition;
SDL_UnlockAudioDevice(audioDevice); SDL_UnlockAudioDevice(audioDevice);
} }
void SOUNDBUFFER::SetFrequency(uint32_t dwFrequency) void SOUNDBUFFER::SetFrequency(unsigned long dwFrequency)
{ {
SDL_LockAudioDevice(audioDevice); SDL_LockAudioDevice(audioDevice);
frequency = (double)dwFrequency; frequency = (double)dwFrequency;
SDL_UnlockAudioDevice(audioDevice); SDL_UnlockAudioDevice(audioDevice);
} }
float MillibelToVolume(int32_t lVolume) float MillibelToVolume(long lVolume)
{ {
//Volume is in hundredths of decibels, from 0 to -10000 //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); return (float)pow(10.0, lVolume / 2000.0);
} }
void SOUNDBUFFER::SetVolume(int32_t lVolume) void SOUNDBUFFER::SetVolume(long lVolume)
{ {
SDL_LockAudioDevice(audioDevice); SDL_LockAudioDevice(audioDevice);
volume = MillibelToVolume(lVolume); volume = MillibelToVolume(lVolume);
SDL_UnlockAudioDevice(audioDevice); SDL_UnlockAudioDevice(audioDevice);
} }
void SOUNDBUFFER::SetPan(int32_t lPan) void SOUNDBUFFER::SetPan(long lPan)
{ {
SDL_LockAudioDevice(audioDevice); SDL_LockAudioDevice(audioDevice);
volume_l = MillibelToVolume(-lPan); volume_l = MillibelToVolume(-lPan);
@ -288,19 +287,19 @@ void PlaySoundObject(int no, int mode)
} }
} }
void ChangeSoundFrequency(int no, uint32_t rate) void ChangeSoundFrequency(int no, unsigned long rate)
{ {
if (lpSECONDARYBUFFER[no]) if (lpSECONDARYBUFFER[no])
lpSECONDARYBUFFER[no]->SetFrequency(10 * rate + 100); lpSECONDARYBUFFER[no]->SetFrequency(10 * rate + 100);
} }
void ChangeSoundVolume(int no, int32_t volume) void ChangeSoundVolume(int no, long volume)
{ {
if (lpSECONDARYBUFFER[no]) if (lpSECONDARYBUFFER[no])
lpSECONDARYBUFFER[no]->SetVolume(8 * volume - 2400); lpSECONDARYBUFFER[no]->SetVolume(8 * volume - 2400);
} }
void ChangeSoundPan(int no, int32_t pan) void ChangeSoundPan(int no, long pan)
{ {
if (lpSECONDARYBUFFER[no]) if (lpSECONDARYBUFFER[no])
lpSECONDARYBUFFER[no]->SetPan(10 * (pan - 256)); lpSECONDARYBUFFER[no]->SetPan(10 * (pan - 256));

View file

@ -1,7 +1,6 @@
#pragma once #pragma once
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include "PixTone.h" #include "PixTone.h"
@ -13,13 +12,13 @@ class SOUNDBUFFER
void Release(); void Release();
void Lock(uint8_t **buffer, size_t *size); void Lock(unsigned char **buffer, size_t *size);
void Unlock(); void Unlock();
void SetCurrentPosition(uint32_t dwNewPosition); void SetCurrentPosition(unsigned long dwNewPosition);
void SetFrequency(uint32_t dwFrequency); void SetFrequency(unsigned long dwFrequency);
void SetVolume(int32_t lVolume); void SetVolume(long lVolume);
void SetPan(int32_t lPan); void SetPan(long lPan);
void Play(bool bLooping); void Play(bool bLooping);
void Stop(); void Stop();
@ -28,7 +27,7 @@ class SOUNDBUFFER
SOUNDBUFFER *next; SOUNDBUFFER *next;
private: private:
uint8_t *data; unsigned char *data;
size_t size; size_t size;
bool playing; bool playing;
@ -95,7 +94,7 @@ extern SOUNDBUFFER* lpSECONDARYBUFFER[SOUND_NO];
bool InitDirectSound(); bool InitDirectSound();
void EndDirectSound(); void EndDirectSound();
void PlaySoundObject(int no, int mode); void PlaySoundObject(int no, int mode);
void ChangeSoundFrequency(int no, uint32_t rate); void ChangeSoundFrequency(int no, unsigned long rate);
void ChangeSoundVolume(int no, int32_t volume); void ChangeSoundVolume(int no, long volume);
void ChangeSoundPan(int no, int32_t pan); void ChangeSoundPan(int no, long pan);
int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no); int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no);

View file

@ -1,6 +1,5 @@
#include "Stage.h" #include "Stage.h"
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View file

@ -1,6 +1,5 @@
#include "TextScr.h" #include "TextScr.h"
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -91,7 +90,7 @@ void EndTextScript()
} }
//Decrypt .tsc //Decrypt .tsc
void EncryptionBinaryData2(uint8_t *pData, int size) void EncryptionBinaryData2(unsigned char *pData, int size)
{ {
int val1; int val1;
@ -136,7 +135,7 @@ BOOL LoadTextScript2(const char *name)
strcpy(gTS.path, name); strcpy(gTS.path, name);
//Decrypt data //Decrypt data
EncryptionBinaryData2((uint8_t*)gTS.data, gTS.size); EncryptionBinaryData2((unsigned char*)gTS.data, gTS.size);
return TRUE; return TRUE;
} }
@ -157,7 +156,7 @@ BOOL LoadTextScript_Stage(const char *name)
//Read Head.tsc //Read Head.tsc
fread(gTS.data, 1, head_size, fp); 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; gTS.data[head_size] = 0;
fclose(fp); fclose(fp);
@ -174,7 +173,7 @@ BOOL LoadTextScript_Stage(const char *name)
//Read stage's tsc //Read stage's tsc
fread(&gTS.data[head_size], 1, body_size, fp); 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; gTS.data[head_size + body_size] = 0;
fclose(fp); fclose(fp);

View file

@ -1,7 +1,5 @@
#pragma once #pragma once
#include <stdint.h>
#include "WindowsWrapper.h" #include "WindowsWrapper.h"
#include "CommonDefines.h" #include "CommonDefines.h"
@ -54,12 +52,12 @@ struct TEXT_SCRIPT
int offsetY; int offsetY;
//NOD cursor blink //NOD cursor blink
uint8_t wait_beam; unsigned char wait_beam;
}; };
BOOL InitTextScript2(); BOOL InitTextScript2();
void EndTextScript(); void EndTextScript();
void EncryptionBinaryData2(uint8_t *pData, int size); void EncryptionBinaryData2(unsigned char *pData, int size);
BOOL LoadTextScript2(const char *name); BOOL LoadTextScript2(const char *name);
BOOL LoadTextScript_Stage(const char *name); BOOL LoadTextScript_Stage(const char *name);
void GetTextScriptPath(char *path); void GetTextScriptPath(char *path);

View file

@ -1,10 +1,9 @@
#include "Triangle.h" #include "Triangle.h"
#include <stdint.h>
#include <math.h> #include <math.h>
int gSin[0x100]; int gSin[0x100];
int16_t gTan[0x21]; short gTan[0x21];
void InitTriangleTable() void InitTriangleTable()
{ {
@ -23,27 +22,27 @@ void InitTriangleTable()
{ {
a = (float)(i * 6.2831855f / 256.0f); a = (float)(i * 6.2831855f / 256.0f);
b = sinf(a) / cosf(a); 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]; return gSin[deg];
} }
int GetCos(uint8_t deg) int GetCos(unsigned char deg)
{ {
deg += 0x40; deg += 0x40;
return gSin[deg]; return gSin[deg];
} }
uint8_t GetArktan(int x, int y) unsigned char GetArktan(int x, int y)
{ {
x *= -1; x *= -1;
y *= -1; y *= -1;
uint8_t a = 0; unsigned char a = 0;
int16_t k; short k;
if (x > 0) if (x > 0)
{ {

View file

@ -1,8 +1,6 @@
#pragma once #pragma once
#include <stdint.h>
void InitTriangleTable(); void InitTriangleTable();
int GetSin(uint8_t deg); int GetSin(unsigned char deg);
int GetCos(uint8_t deg); int GetCos(unsigned char deg);
uint8_t GetArktan(int x, int y); unsigned char GetArktan(int x, int y);