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:
parent
a94d9a4367
commit
676ee004fe
37 changed files with 143 additions and 195 deletions
|
@ -1,6 +1,5 @@
|
|||
#include "Boss.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
|
|
@ -45,7 +45,7 @@ int JudgeHitBulletBlock(int x, int y, BULLET *bul)
|
|||
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;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
struct BULLET
|
||||
|
@ -20,7 +18,7 @@ struct BULLET
|
|||
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
|
|||
|
||||
struct BULLET_TABLE
|
||||
{
|
||||
int8_t damage;
|
||||
int8_t life;
|
||||
signed char damage;
|
||||
signed char life;
|
||||
int life_count;
|
||||
int bbits;
|
||||
int enemyXL;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
14
src/Config.h
14
src/Config.h
|
@ -1,19 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
struct CONFIG
|
||||
{
|
||||
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);
|
||||
|
|
13
src/Draw.cpp
13
src/Draw.cpp
|
@ -1,5 +1,4 @@
|
|||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -57,8 +56,8 @@ BOOL Flip_SystemTask()
|
|||
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 @@ unsigned long GetCortBoxColor(unsigned long col)
|
|||
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 @@ void CortBox(RECT *rect, uint32_t col)
|
|||
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 @@ void InitTextObject(const char *font_name)
|
|||
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 @@ void PutText(int x, int y, const char *text, uint32_t color)
|
|||
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;
|
||||
|
|
10
src/Draw.h
10
src/Draw.h
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
#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 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();
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "Ending.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -184,7 +183,7 @@ bool StartCreditScript()
|
|||
|
||||
// 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 @@ void ActionCredit_Read()
|
|||
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)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct CREDIT
|
||||
{
|
||||
int size;
|
||||
|
|
|
@ -13,7 +13,7 @@ FRAME gFrame;
|
|||
|
||||
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 @@ void SetFramePosition(int fx, int fy)
|
|||
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 @@ void SetFrameMyChar()
|
|||
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);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "Generic.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "CommonDefines.h"
|
||||
|
@ -45,7 +44,7 @@ bool CheckFileExists(const char *name)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool IsShiftJIS(uint8_t c)
|
||||
bool IsShiftJIS(unsigned char c)
|
||||
{
|
||||
if (c > 0x80 && c < 0xA0)
|
||||
return true;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "Input.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <SDL.h>
|
||||
|
@ -51,8 +50,8 @@ bool GetJoystickStatus(JOYSTICK_STATUS *pStatus)
|
|||
|
||||
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;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "Main.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "Map.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -21,7 +20,7 @@ static const char *code_pxma = "PXM";
|
|||
|
||||
BOOL InitMapData2()
|
||||
{
|
||||
gMap.data = (uint8_t*)malloc(PXM_BUFFER_SIZE);
|
||||
gMap.data = (unsigned char*)malloc(PXM_BUFFER_SIZE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -103,7 +102,7 @@ void ReleasePartsImage()
|
|||
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 @@ void ShiftMapParts(int x, int y)
|
|||
*(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;
|
||||
|
|
14
src/Map.h
14
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 LoadMapData2(const char *path_map);
|
|||
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);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "MapName.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "CommonDefines.h"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "MiniMap.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
@ -127,7 +126,7 @@ int MiniMapLoop()
|
|||
CortBox2(&rcMiniMap, 0, SURFACE_ID_MAP);
|
||||
|
||||
int line = 0;
|
||||
uint8_t my_wait = 0;
|
||||
unsigned char my_wait = 0;
|
||||
while (true)
|
||||
{
|
||||
GetTrg();
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
extern char gMapping[0x80];
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "MyChar.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
struct MYCHAR
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "MycHit.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
#include "Back.h"
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
struct ARMS_LEVEL
|
||||
|
@ -11,8 +9,8 @@ struct ARMS_LEVEL
|
|||
|
||||
struct REC
|
||||
{
|
||||
int32_t counter[4];
|
||||
uint8_t random[4];
|
||||
long counter[4];
|
||||
unsigned char random[4];
|
||||
};
|
||||
|
||||
extern ARMS_LEVEL gArmsLevelTable[14];
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "NpChar.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -239,12 +238,11 @@ void SetExpObjects(int x, int y, int exp)
|
|||
|
||||
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 @@ BOOL SetLifeObject(int x, int y, int val)
|
|||
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;
|
||||
|
|
20
src/NpChar.h
20
src/NpChar.h
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
#include "Draw.h"
|
||||
|
@ -29,7 +27,7 @@ enum NPC_flags
|
|||
|
||||
struct NPCHAR
|
||||
{
|
||||
uint8_t cond;
|
||||
unsigned char cond;
|
||||
int flag;
|
||||
int x;
|
||||
int y;
|
||||
|
@ -49,7 +47,7 @@ struct NPCHAR
|
|||
int exp;
|
||||
int size;
|
||||
int direct;
|
||||
uint16_t bits;
|
||||
unsigned short bits;
|
||||
RECT rect;
|
||||
int ani_wait;
|
||||
int ani_no;
|
||||
|
@ -59,7 +57,7 @@ struct NPCHAR
|
|||
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 NPCHAR
|
|||
|
||||
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];
|
||||
|
|
26
src/NpcTbl.h
26
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;
|
||||
};
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "Organya.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -33,7 +32,7 @@ int gTrackVol[MAXTRACK];
|
|||
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 @@ OCTWAVE oct_wave[8] = {
|
|||
{ 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 @@ bool MakeSoundObject8(int8_t *wavep, int8_t track, int8_t pipi)
|
|||
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 @@ bool MakeSoundObject8(int8_t *wavep, int8_t track, int8_t pipi)
|
|||
}
|
||||
|
||||
//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 @@ bool MakeSoundObject8(int8_t *wavep, int8_t track, int8_t pipi)
|
|||
//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 @@ 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};
|
||||
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 @@ void PlayOrganObject(uint8_t key, int mode, int8_t track, int32_t freq)
|
|||
}
|
||||
|
||||
//Release tracks
|
||||
void ReleaseOrganyaObject(int8_t track)
|
||||
void ReleaseOrganyaObject(signed char track)
|
||||
{
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
|
@ -258,7 +257,7 @@ void ReleaseOrganyaObject(int8_t track)
|
|||
}
|
||||
|
||||
//Handling WAVE100
|
||||
int8_t wave_data[100][0x100];
|
||||
signed char wave_data[100][0x100];
|
||||
|
||||
BOOL InitWaveData100()
|
||||
{
|
||||
|
@ -273,7 +272,7 @@ BOOL InitWaveData100()
|
|||
}
|
||||
|
||||
//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 @@ bool MakeOrganyaWave(int8_t track, int8_t wave_no, int8_t pipi)
|
|||
}
|
||||
|
||||
//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 @@ void PlayDramObject(unsigned char key, int mode, signed char track)
|
|||
}
|
||||
|
||||
//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 OrganyaPlayData()
|
|||
}
|
||||
}
|
||||
|
||||
void SetPlayPointer(int32_t x)
|
||||
void SetPlayPointer(long x)
|
||||
{
|
||||
for (int i = 0; i < MAXTRACK; i++)
|
||||
{
|
||||
|
@ -428,7 +427,7 @@ void LoadOrganya(const char *name)
|
|||
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 @@ void LoadOrganya(const char *name)
|
|||
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 @@ int OrganyaPlayTimer(void *ptr)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -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 @@ struct NOTELIST {
|
|||
|
||||
//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 @@ struct TRACKDATA {
|
|||
|
||||
//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();
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "Profile.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
#include "ArmsItem.h"
|
||||
|
@ -15,10 +13,10 @@ struct PROFILE
|
|||
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 @@ struct PROFILE
|
|||
PERMIT_STAGE permitstage[8];
|
||||
signed char permit_mapping[0x80];
|
||||
char FLAG[4];
|
||||
uint8_t flags[1000];
|
||||
unsigned char flags[1000];
|
||||
};
|
||||
|
||||
BOOL IsProfile();
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
@ -48,7 +47,7 @@ SOUNDBUFFER::SOUNDBUFFER(size_t bufSize)
|
|||
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 @@ void SOUNDBUFFER::Release()
|
|||
delete this;
|
||||
}
|
||||
|
||||
void SOUNDBUFFER::Lock(uint8_t **outBuffer, size_t *outSize)
|
||||
void SOUNDBUFFER::Lock(unsigned char **outBuffer, size_t *outSize)
|
||||
{
|
||||
SDL_LockAudioDevice(audioDevice);
|
||||
|
||||
|
@ -104,35 +103,35 @@ void SOUNDBUFFER::Unlock()
|
|||
SDL_UnlockAudioDevice(audioDevice);
|
||||
}
|
||||
|
||||
void SOUNDBUFFER::SetCurrentPosition(uint32_t dwNewPosition)
|
||||
void SOUNDBUFFER::SetCurrentPosition(unsigned long dwNewPosition)
|
||||
{
|
||||
SDL_LockAudioDevice(audioDevice);
|
||||
samplePosition = dwNewPosition;
|
||||
SDL_UnlockAudioDevice(audioDevice);
|
||||
}
|
||||
|
||||
void SOUNDBUFFER::SetFrequency(uint32_t dwFrequency)
|
||||
void SOUNDBUFFER::SetFrequency(unsigned long dwFrequency)
|
||||
{
|
||||
SDL_LockAudioDevice(audioDevice);
|
||||
frequency = (double)dwFrequency;
|
||||
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);
|
||||
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 PlaySoundObject(int no, int mode)
|
|||
}
|
||||
}
|
||||
|
||||
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));
|
||||
|
|
19
src/Sound.h
19
src/Sound.h
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "PixTone.h"
|
||||
|
||||
|
@ -13,13 +12,13 @@ class SOUNDBUFFER
|
|||
|
||||
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 @@ class SOUNDBUFFER
|
|||
SOUNDBUFFER *next;
|
||||
|
||||
private:
|
||||
uint8_t *data;
|
||||
unsigned char *data;
|
||||
size_t size;
|
||||
|
||||
bool playing;
|
||||
|
@ -95,7 +94,7 @@ extern SOUNDBUFFER* lpSECONDARYBUFFER[SOUND_NO];
|
|||
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);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "Stage.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "TextScr.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -91,7 +90,7 @@ void EndTextScript()
|
|||
}
|
||||
|
||||
//Decrypt .tsc
|
||||
void EncryptionBinaryData2(uint8_t *pData, int size)
|
||||
void EncryptionBinaryData2(unsigned char *pData, int size)
|
||||
{
|
||||
int val1;
|
||||
|
||||
|
@ -136,7 +135,7 @@ BOOL LoadTextScript2(const char *name)
|
|||
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 @@ BOOL LoadTextScript_Stage(const char *name)
|
|||
|
||||
//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 @@ BOOL LoadTextScript_Stage(const char *name)
|
|||
|
||||
//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);
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "WindowsWrapper.h"
|
||||
|
||||
#include "CommonDefines.h"
|
||||
|
@ -54,12 +52,12 @@ struct TEXT_SCRIPT
|
|||
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);
|
||||
|
|
|
@ -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 @@ void InitTriangleTable()
|
|||
{
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue