ref: 71970c1f74151bf7a0dd363f90c88e9983dc140d
parent: 845ee1b96f76a9a322992152f1a2e9930ff396e9
parent: 20cbb8cc733f10d5156cf8fa6f2e165d0a3fccbb
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sat Aug 29 13:11:28 EDT 2020
Merge branch 'accurate' into portable
--- a/README.md
+++ b/README.md
@@ -2,22 +2,19 @@
## Table of Contents
-This repo has multiple branches:
+This repo has two main branches:
Branch | Description
--------|--------
-[accurate](https://www.github.com/Clownacy/CSE2/tree/accurate) | The main decompilation branch. The code intended to be as close to the original as possible, down to all the bugs and platform-dependencies.
+[accurate](https://www.github.com/Clownacy/CSE2/tree/accurate) | The main decompilation branch. The code is intended to be as close to the original as possible, down to all the bugs and platform-dependencies.
[portable](https://www.github.com/Clownacy/CSE2/tree/portable) | This branch ports the engine away from WinAPI and DirectX, and addresses numerous portability issues, allowing it to run on other platforms.
-[enhanced-lite](https://www.github.com/Clownacy/CSE2/tree/enhanced-lite) | Based on the `portable` branch, this branch is **intended for modders**, and adds several enhancements and features to the engine.
-[enhanced](https://www.github.com/Clownacy/CSE2/tree/enhanced) | Based on the `enhanced-lite` branch, this branch is **intended for players**, and adds further enhancements and features to the engine.
-[emscripten](https://www.github.com/Clownacy/CSE2/tree/emscripten) | Modifies the engine to build with Emscripten, [allowing it to run in web browsers](http://sonicresearch.org/clownacy/cave.html) (no longer maintained).
-[wii](https://www.github.com/Clownacy/CSE2/tree/wii) | Ports the engine to the Nintendo Wii (no longer maintained).
# CSE2 (Portable)
CSE2 is a decompilation of Cave Story.
-This branch migrates the engine away from WinAPI and DirectX, and addresses numerous portability issues, allowing it to run on other platforms.
+This branch migrates the engine away from WinAPI and DirectX, and addresses
+numerous portability issues, allowing it to run on other platforms.
Supported platforms include...
* Windows
@@ -29,19 +26,39 @@
## Background
-When Pixel made Cave Story, he compiled the original Windows EXE with no optimisations. This left the generated assembly code extremely verbose and easy to read. It also made the code very decompiler-friendly, since the assembly could be mapped directly back to the original C(++) code.
+When Pixel made Cave Story, he compiled the original Windows EXE with no
+optimisations. This left the generated assembly code extremely verbose and easy
+to read. It also made the code very decompiler-friendly, since the assembly
+could be mapped directly back to the original C(++) code.
-Technically, this alone made a decompilation feasible, as was the case for [the Super Mario 64 decompilation project](https://github.com/n64decomp/sm64) - however, there was more to be found...
+Technically, this alone made a decompilation feasible, as was the case for [the
+Super Mario 64 decompilation project](https://github.com/n64decomp/sm64) -
+however, there was more to be found...
-In 2007, a Linux port of Cave Story was made by Peter Mackay and Simon Parzer. Details about it can be found on [Peter's old blog](https://web.archive.org/web/20070911202919/http://aaiiee.wordpress.com:80/). This port received an update in 2011, including two shiny new executables. What Peter and Simon didn't realise was that they left huge amounts of debugging information in these executables, including the names of every C++ source file, as well as the variables, functions, and structs they contained.
+In 2007, a Linux port of Cave Story was made by Peter Mackay and Simon Parzer.
+Details about it can be found on [Peter's old blog](https://web.archive.org/web/20070911202919/http://aaiiee.wordpress.com:80/).
+This port received an update in 2011, including two shiny new executables. What
+Peter and Simon didn't realise was that they left huge amounts of debugging
+information in these executables, including the names of every C++ source file,
+as well as the variables, functions, and structs they contained.
-This was a goldmine of information about not just the game's inner-workings, but its _source code._ This is the same lucky-break [the Diablo decompilation project](https://github.com/diasurgical/devilution) had. With it, much of the game's code was pre-documented and explained _for_ us, saving us the effort of doing it ourselves. In fact, the combination of easy-to-decompile code, and a near-full set of function/variable names, reduced much of the decompilation process to mere copy-paste.
+This was a goldmine of information about not just the game's inner-workings, but
+its _source code._ This is the same lucky-break [the Diablo decompilation project](https://github.com/diasurgical/devilution)
+had. With it, much of the game's code was pre-documented and explained _for_ us,
+saving us the effort of doing it ourselves. In fact, the combination of
+easy-to-decompile code, and a near-full set of function/variable names, reduced
+much of the decompilation process to mere copy-paste.
-To top it all off, some of Cave Story's original source code would eventually see the light of day...
+To top it all off, some of Cave Story's original source code would eventually
+see the light of day...
-In early 2018, the Organya music engine was [released on GitHub](https://github.com/shbow/organya) by an old friend of Pixel's. On top of providing an insight into Pixel's coding style, this helped with figuring out one of the most complex parts of Cave Story's codebase.
+In early 2018, the Organya music engine was [released on GitHub](https://github.com/shbow/organya)
+by an old friend of Pixel's. On top of providing an insight into Pixel's coding
+style, this helped with figuring out one of the most complex parts of Cave
+Story's codebase.
-And... that's it! It's not often that a game this decompilable comes along, so I'm glad that Cave Story was one of them. [Patching a dusty old executable from 2004 has its downsides](https://github.com/Clownacy/Cave-Story-Mod-Loader/blob/master/src/mods/graphics_enhancement/widescreen/patch_camera.c).
+And... that's it! It's not often that a game this decompilable comes along, so
+I'm glad that Cave Story was one of them. [Patching a dusty old executable from 2004 has its downsides](https://github.com/Clownacy/Cave-Story-Mod-Loader/blob/master/src/mods/graphics_enhancement/widescreen/patch_camera.c).
## Dependencies
@@ -59,7 +76,9 @@
This project uses CMake, allowing it to be built with a range of compilers.
-Switch to the terminal (Visual Studio users should open the [Developer Command Prompt](https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs)) and `cd` into this folder. After that, generate the files for your build system with:
+Switch to the terminal (Visual Studio users should open the [Developer Command Prompt](https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs))
+and `cd` into this folder. After that, generate the files for your build system
+with:
```
cmake -B build -DCMAKE_BUILD_TYPE=Release
@@ -104,15 +123,18 @@
cmake --build build --config Release
```
-If you're a Visual Studio user, you can open the generated `CSE2.sln` file instead, which can be found in the `build` folder.
+If you're a Visual Studio user, you can open the generated `CSE2.sln` file
+instead, which can be found in the `build` folder.
-Once built, the executables can be found in the `game_english`/`game_japanese` folder, depending on the selected language.
+Once built, the executables can be found in the `game_english`/`game_japanese`
+folder, depending on the selected language.
### Building for the Wii U
To target the Wii U, you'll need devkitPro, and WUT.
-First, add the devkitPPC tools directory to your PATH (because WUT's CMake support is broken, as of writing):
+First, add the devkitPPC tools directory to your PATH (because WUT's CMake
+support is broken, as of writing):
```
PATH=$PATH:$DEVKITPPC/bin
@@ -130,7 +152,8 @@
cmake --build buildwiiu
```
-This will build a binary, but you still need to convert it to an `.rpx` file that can be ran on your Wii U.
+This will build a binary, but you still need to convert it to an `.rpx` file
+that can be ran on your Wii U.
First, we need to strip the binary:
@@ -143,8 +166,12 @@
elf2rpl game_english/CSE2 game_english/CSE2.rpx
```
-`game_english/CSE2.rpx` is now ready to be ran on your Wii U. This port expects the data folder to be in a folder called `CSE2-portable-en`/`CSE2-portable-jp` on the root of your SD card.
+`game_english/CSE2.rpx` is now ready to be ran on your Wii U. This port expects
+the data folder to be in a folder called `CSE2-portable-en`/`CSE2-portable-jp`
+on the root of your SD card.
## Licensing
-Being a decompilation, the majority of the code in this project belongs to Daisuke "Pixel" Amaya - not us. We've yet to agree on a licence for our own code.
+Being a decompilation, the majority of the code in this project belongs to
+Daisuke "Pixel" Amaya - not us. We've yet to agree on a licence for our own
+code.
--- a/src/Back.cpp
+++ b/src/Back.cpp
@@ -18,10 +18,9 @@
// TODO - Another function that has an incorrect stack frame
BOOL InitBack(const char *fName, int type)
{
- // Unused
- color_black = GetCortBoxColor(RGB(0, 0, 0x10));
+ color_black = GetCortBoxColor(RGB(0, 0, 0x10)); // Unused. This may have once been used by background type 4 (the solid black background)
- // Get width and height
+ // We're not actually loading the bitmap here - we're just reading its width/height and making sure it's really a BMP file
std::string path = gDataPath + '/' + fName + ".pbm";
FILE *fp = fopen(path.c_str(), "rb");
@@ -39,12 +38,14 @@
fseek(fp, 18, SEEK_SET);
+ // Get bitmap width and height
gBack.partsW = File_ReadLE32(fp);
gBack.partsH = File_ReadLE32(fp);
fclose(fp);
- // Set background stuff and load texture
- gBack.flag = TRUE;
+ gBack.flag = TRUE; // This variable is otherwise unused
+
+ // *Now* we actually load the bitmap
if (!ReloadBitmap_File(fName, SURFACE_ID_LEVEL_BACKGROUND))
return FALSE;
@@ -57,12 +58,12 @@
{
switch (gBack.type)
{
- case 5:
+ case BACKGROUND_TYPE_AUTOSCROLL:
gBack.fx += 6 * 0x200;
break;
- case 6:
- case 7:
+ case BACKGROUND_TYPE_OUTSIDE_WITH_WIND:
+ case BACKGROUND_TYPE_OUTSIDE:
++gBack.fx;
gBack.fx %= 640;
break;
@@ -69,6 +70,7 @@
}
}
+/// Draw background background elements
void PutBack(int fx, int fy)
{
int x, y;
@@ -76,7 +78,7 @@
switch (gBack.type)
{
- case 0:
+ case BACKGROUND_TYPE_STATIONARY:
for (y = 0; y < WINDOW_HEIGHT; y += gBack.partsH)
for (x = 0; x < WINDOW_WIDTH; x += gBack.partsW)
PutBitmap4(&grcGame, x, y, &rect, SURFACE_ID_LEVEL_BACKGROUND);
@@ -83,7 +85,7 @@
break;
- case 1:
+ case BACKGROUND_TYPE_MOVE_DISTANT:
for (y = -((fy / 2 / 0x200) % gBack.partsH); y < WINDOW_HEIGHT; y += gBack.partsH)
for (x = -((fx / 2 / 0x200) % gBack.partsW); x < WINDOW_WIDTH; x += gBack.partsW)
PutBitmap4(&grcGame, x, y, &rect, SURFACE_ID_LEVEL_BACKGROUND);
@@ -90,7 +92,7 @@
break;
- case 2:
+ case BACKGROUND_TYPE_MOVE_NEAR:
for (y = -((fy / 0x200) % gBack.partsH); y < WINDOW_HEIGHT; y += gBack.partsH)
for (x = -((fx / 0x200) % gBack.partsW); x < WINDOW_WIDTH; x += gBack.partsW)
PutBitmap4(&grcGame, x, y, &rect, SURFACE_ID_LEVEL_BACKGROUND);
@@ -97,7 +99,7 @@
break;
- case 5:
+ case BACKGROUND_TYPE_AUTOSCROLL:
for (y = -gBack.partsH; y < WINDOW_HEIGHT; y += gBack.partsH)
for (x = -((gBack.fx / 0x200) % gBack.partsW); x < WINDOW_WIDTH; x += gBack.partsW)
PutBitmap4(&grcGame, x, y, &rect, SURFACE_ID_LEVEL_BACKGROUND);
@@ -104,8 +106,9 @@
break;
- case 6:
- case 7:
+ case BACKGROUND_TYPE_OUTSIDE_WITH_WIND:
+ case BACKGROUND_TYPE_OUTSIDE:
+ // Draw sky
rect.top = 0;
rect.bottom = 88;
rect.left = 0;
@@ -112,6 +115,7 @@
rect.right = 320;
PutBitmap4(&grcGame, 0, 0, &rect, SURFACE_ID_LEVEL_BACKGROUND);
+ // Draw first cloud layer
rect.top = 88;
rect.bottom = 123;
rect.left = gBack.fx / 2;
@@ -121,6 +125,7 @@
rect.left = 0;
PutBitmap4(&grcGame, 320 - ((gBack.fx / 2) % 320), 88, &rect, SURFACE_ID_LEVEL_BACKGROUND);
+ // Draw second cloud layer
rect.top = 123;
rect.bottom = 146;
rect.left = gBack.fx % 320;
@@ -130,6 +135,7 @@
rect.left = 0;
PutBitmap4(&grcGame, 320 - (gBack.fx % 320), 123, &rect, SURFACE_ID_LEVEL_BACKGROUND);
+ // Draw third cloud layer
rect.top = 146;
rect.bottom = 176;
rect.left = 2 * gBack.fx % 320;
@@ -139,6 +145,7 @@
rect.left = 0;
PutBitmap4(&grcGame, 320 - ((gBack.fx * 2) % 320), 146, &rect, SURFACE_ID_LEVEL_BACKGROUND);
+ // Draw fourth cloud layer
rect.top = 176;
rect.bottom = 240;
rect.left = 4 * gBack.fx % 320;
@@ -152,6 +159,7 @@
}
}
+/// Draw background foreground elements - only the water background type makes use of this
void PutFront(int fx, int fy)
{
int xpos, ypos;
@@ -164,7 +172,7 @@
switch (gBack.type)
{
- case 3:
+ case BACKGROUND_TYPE_WATER:
x_1 = fx / (32 * 0x200);
x_2 = x_1 + (((WINDOW_WIDTH + (32 - 1)) / 32) + 1);
y_1 = 0;
--- a/src/Back.h
+++ b/src/Back.h
@@ -2,9 +2,21 @@
#include "WindowsWrapper.h"
+enum
+{
+ BACKGROUND_TYPE_STATIONARY = 0, // Doesn't move at all
+ BACKGROUND_TYPE_MOVE_DISTANT = 1, // Moves at half the speed of the foreground
+ BACKGROUND_TYPE_MOVE_NEAR = 2, // Moves at the same speed as the foreground
+ BACKGROUND_TYPE_WATER = 3, // No background - draws a water foreground layer instead
+ BACKGROUND_TYPE_BLACK = 4, // No background - just black
+ BACKGROUND_TYPE_AUTOSCROLL = 5, // Constantly scrolls to the left (used by Ironhead)
+ BACKGROUND_TYPE_OUTSIDE_WITH_WIND = 6, // Fancy parallax scrolling, items are blown to the left (used by bkMoon)
+ BACKGROUND_TYPE_OUTSIDE = 7 // Fancy parallax scrolling (used by bkFog)
+};
+
typedef struct BACK
{
- BOOL flag; // Basically unused
+ BOOL flag; // Unused - purpose unknown
int partsW;
int partsH;
int numX;
--- a/src/Boss.cpp
+++ b/src/Boss.cpp
@@ -15,6 +15,7 @@
#include "BossX.h"
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Draw.h"
#include "Map.h"
#include "MyChar.h"
@@ -158,9 +159,9 @@
{
if (gBoss[bos].shock < 14)
{
- SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
- SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
- SetCaret(gBul[bul].x, gBul[bul].y, 11, 0);
+ SetCaret(gBul[bul].x, gBul[bul].y, CARET_HURT_PARTICLES, DIR_LEFT);
+ SetCaret(gBul[bul].x, gBul[bul].y, CARET_HURT_PARTICLES, DIR_LEFT);
+ SetCaret(gBul[bul].x, gBul[bul].y, CARET_HURT_PARTICLES, DIR_LEFT);
PlaySoundObject(gBoss[bos_].hit_voice, SOUND_MODE_PLAY);
}
@@ -187,7 +188,7 @@
{
if (!(gBul[bul].bbits & 0x10))
{
- SetCaret(gBul[bul].x, gBul[bul].y, 2, 2);
+ SetCaret(gBul[bul].x, gBul[bul].y, CARET_PROJECTILE_DISSIPATION, DIR_RIGHT);
PlaySoundObject(31, SOUND_MODE_PLAY);
gBul[bul].cond = 0;
continue;
--- a/src/BossFrog.cpp
+++ b/src/BossFrog.cpp
@@ -385,7 +385,7 @@
else
SetNpChar(NPC_PROJECTILE_BALFROG_SPITBALL, boss->x + 2 * (0x200 * 0x10), boss->y - 8 * 0x200, xm, ym, DIR_LEFT, NULL, 0x100);
- PlaySoundObject(SND_ENEMY_SHOOT_PROJETILE, SOUND_MODE_PLAY);
+ PlaySoundObject(SND_ENEMY_SHOOT_PROJECTILE, SOUND_MODE_PLAY);
if (boss->count1 == 0 || boss->life < boss->tgt_x - 90)
{
--- a/src/BulHit.cpp
+++ b/src/BulHit.cpp
@@ -6,6 +6,7 @@
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Game.h"
#include "Map.h"
#include "NpChar.h"
@@ -16,10 +17,10 @@
if (bul->code_bullet != 37 && bul->code_bullet != 38 && bul->code_bullet != 39)
PlaySoundObject(28, SOUND_MODE_PLAY);
else
- SetCaret(bul->x, bul->y, 2, 1);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_UP);
bul->cond = 0;
- SetCaret(bul->x, bul->y, 2, 2);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_RIGHT);
}
int JudgeHitBulletBlock(int x, int y, BULLET *bul)
@@ -37,7 +38,7 @@
if (!(bul->bbits & 0x40))
bul->cond = 0;
- SetCaret(bul->x, bul->y, 2, 0);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
--- a/src/Bullet.cpp
+++ b/src/Bullet.cpp
@@ -7,6 +7,7 @@
#include "Draw.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Game.h"
#include "KeyControl.h"
#include "MyChar.h"
@@ -78,19 +79,19 @@
{
switch (gBul[i].direct)
{
- case 0:
+ case DIR_LEFT:
x = gBul[i].x - gBul[i].view.front;
y = gBul[i].y - gBul[i].view.top;
break;
- case 1:
+ case DIR_UP:
x = gBul[i].x - gBul[i].view.top;
y = gBul[i].y - gBul[i].view.front;
break;
- case 2:
+ case DIR_RIGHT:
x = gBul[i].x - gBul[i].view.back;
y = gBul[i].y - gBul[i].view.top;
break;
- case 3:
+ case DIR_DOWN:
x = gBul[i].x - gBul[i].view.top;
y = gBul[i].y - gBul[i].view.back;
break;
@@ -204,7 +205,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -215,16 +216,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x600;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x600;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x600;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x600;
break;
}
@@ -258,7 +259,7 @@
{136, 80, 152, 80},
};
- if (bul->direct == 0)
+ if (bul->direct == DIR_LEFT)
bul->rect = rcLeft[bul->ani_no];
else
bul->rect = rcRight[bul->ani_no];
@@ -271,7 +272,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -282,16 +283,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x200;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x200;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x200;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x200;
break;
}
@@ -300,8 +301,8 @@
switch (bul->direct)
{
- case 0:
- case 2:
+ case DIR_LEFT:
+ case DIR_RIGHT:
if (inc % 2)
bul->ym = 0x400;
else
@@ -309,8 +310,8 @@
break;
- case 1:
- case 3:
+ case DIR_UP:
+ case DIR_DOWN:
if (inc % 2)
bul->xm = 0x400;
else
@@ -323,16 +324,16 @@
{
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm -= 0x80;
break;
- case 1:
+ case DIR_UP:
bul->ym -= 0x80;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm += 0x80;
break;
- case 3:
+ case DIR_DOWN:
bul->ym += 0x80;
break;
}
@@ -339,8 +340,8 @@
switch (bul->direct)
{
- case 0:
- case 2:
+ case DIR_LEFT:
+ case DIR_RIGHT:
if (bul->count1 % 5 == 2)
{
if (bul->ym < 0)
@@ -351,8 +352,8 @@
break;
- case 1u:
- case 3u:
+ case DIR_UP:
+ case DIR_DOWN:
if (bul->count1 % 5 == 2)
{
if (bul->xm < 0)
@@ -396,7 +397,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -407,16 +408,16 @@
// Set speed
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x1000;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x1000;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x1000;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x1000;
break;
}
@@ -427,16 +428,16 @@
case 1:
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->enemyYL = 0x400;
break;
- case 1:
+ case DIR_UP:
bul->enemyXL = 0x400;
break;
- case 2:
+ case DIR_RIGHT:
bul->enemyYL = 0x400;
break;
- case 3:
+ case DIR_DOWN:
bul->enemyXL = 0x400;
break;
}
@@ -444,16 +445,16 @@
case 2:
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->enemyYL = 0x800;
break;
- case 1:
+ case DIR_UP:
bul->enemyXL = 0x800;
break;
- case 2:
+ case DIR_RIGHT:
bul->enemyYL = 0x800;
break;
- case 3:
+ case DIR_DOWN:
bul->enemyXL = 0x800;
break;
}
@@ -486,7 +487,7 @@
switch (level)
{
case 1:
- if (bul->direct == 1 || bul->direct == 3)
+ if (bul->direct == DIR_UP || bul->direct == DIR_DOWN)
bul->rect = rect1[1];
else
bul->rect = rect1[0];
@@ -494,7 +495,7 @@
break;
case 2:
- if (bul->direct == 1 || bul->direct == 3)
+ if (bul->direct == DIR_UP || bul->direct == DIR_DOWN)
bul->rect = rect2[1];
else
bul->rect = rect2[0];
@@ -502,7 +503,7 @@
break;
case 3:
- if (bul->direct == 1 || bul->direct == 3)
+ if (bul->direct == DIR_UP || bul->direct == DIR_DOWN)
bul->rect = rect3[1];
else
bul->rect = rect3[0];
@@ -518,7 +519,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -528,15 +529,15 @@
if (bul->flag & 1 && bul->flag & 4)
bBreak = TRUE;
- if (bul->direct == 0 && bul->flag & 1)
- bul->direct = 2;
- if (bul->direct == 2 && bul->flag & 4)
- bul->direct = 0;
+ if (bul->direct == DIR_LEFT && bul->flag & 1)
+ bul->direct = DIR_RIGHT;
+ if (bul->direct == DIR_RIGHT && bul->flag & 4)
+ bul->direct = DIR_LEFT;
if (bBreak)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 2, 0);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
PlaySoundObject(28, SOUND_MODE_PLAY);
return;
}
@@ -547,19 +548,19 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x400;
break;
- case 1:
+ case DIR_UP:
bul->xm = gMC.xm;
if (gMC.xm < 0)
- bul->direct = 0;
+ bul->direct = DIR_LEFT;
else
- bul->direct = 2;
+ bul->direct = DIR_RIGHT;
- if (gMC.direct == 0)
+ if (gMC.direct == DIR_LEFT)
bul->xm -= 0x80;
else
bul->xm += 0x80;
@@ -567,17 +568,17 @@
bul->ym = -0x5FF;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x400;
break;
- case 3:
+ case DIR_DOWN:
bul->xm = gMC.xm;
if (gMC.xm < 0)
- bul->direct = 0;
+ bul->direct = DIR_LEFT;
else
- bul->direct = 2;
+ bul->direct = DIR_RIGHT;
bul->ym = 0x5FF;
@@ -637,7 +638,7 @@
if (bul->ani_no > 3)
bul->ani_no = 0;
- if (bul->direct == 0)
+ if (bul->direct == DIR_LEFT)
bul->rect = rect_left1[bul->ani_no];
else
bul->rect = rect_right1[bul->ani_no];
@@ -647,7 +648,7 @@
if (bul->ani_no > 2)
bul->ani_no = 0;
- if (bul->direct == 0)
+ if (bul->direct == DIR_LEFT)
bul->rect = rect_left2[bul->ani_no];
else
bul->rect = rect_right2[bul->ani_no];
@@ -687,7 +688,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -710,19 +711,19 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -move;
bul->ym = Random(-0xAA, 0xAA);
break;
- case 1:
+ case DIR_UP:
bul->ym = -move;
bul->xm = Random(-0xAA, 0xAA);
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = move;
bul->ym = Random(-0xAA, 0xAA);
break;
- case 3:
+ case DIR_DOWN:
bul->ym = move;
bul->xm = Random(-0xAA, 0xAA);
break;
@@ -742,10 +743,10 @@
case 2:
bul->rect = rect2[bul->direct];
- if (bul->direct == 1 || bul->direct == 3)
- SetNpChar(127, bul->x, bul->y, 0, 0, 1, NULL, 0x100);
+ if (bul->direct == DIR_UP || bul->direct == DIR_DOWN)
+ SetNpChar(127, bul->x, bul->y, 0, 0, DIR_UP, NULL, 0x100);
else
- SetNpChar(127, bul->x, bul->y, 0, 0, 0, NULL, 0x100);
+ SetNpChar(127, bul->x, bul->y, 0, 0, DIR_LEFT, NULL, 0x100);
break;
@@ -766,7 +767,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -774,26 +775,26 @@
if (bul->life != 10)
bHit = TRUE;
- if (bul->direct == 0 && bul->flag & 1)
+ if (bul->direct == DIR_LEFT && bul->flag & 1)
bHit = TRUE;
- if (bul->direct == 2 && bul->flag & 4)
+ if (bul->direct == DIR_RIGHT && bul->flag & 4)
bHit = TRUE;
- if (bul->direct == 1 && bul->flag & 2)
+ if (bul->direct == DIR_UP && bul->flag & 2)
bHit = TRUE;
- if (bul->direct == 3 && bul->flag & 8)
+ if (bul->direct == DIR_DOWN && bul->flag & 8)
bHit = TRUE;
- if (bul->direct == 0 && bul->flag & 0x80)
+ if (bul->direct == DIR_LEFT && bul->flag & 0x80)
bHit = TRUE;
- if (bul->direct == 0 && bul->flag & 0x20)
+ if (bul->direct == DIR_LEFT && bul->flag & 0x20)
bHit = TRUE;
- if (bul->direct == 2 && bul->flag & 0x40)
+ if (bul->direct == DIR_RIGHT && bul->flag & 0x40)
bHit = TRUE;
- if (bul->direct == 2 && bul->flag & 0x10)
+ if (bul->direct == DIR_RIGHT && bul->flag & 0x10)
bHit = TRUE;
if (bHit)
{
- SetBullet(level + 15, bul->x, bul->y, 0);
+ SetBullet(level + 15, bul->x, bul->y, DIR_LEFT);
bul->cond = 0;
}
@@ -804,12 +805,12 @@
switch (bul->direct)
{
- case 0:
- case 2:
+ case DIR_LEFT:
+ case DIR_RIGHT:
bul->tgt_y = bul->y;
break;
- case 1:
- case 3:
+ case DIR_UP:
+ case DIR_DOWN:
bul->tgt_x = bul->x;
break;
}
@@ -818,8 +819,8 @@
{
switch (bul->direct)
{
- case 0:
- case 2:
+ case DIR_LEFT:
+ case DIR_RIGHT:
if (bul->y > gMC.y)
bul->ym = 0x100;
else
@@ -828,8 +829,8 @@
bul->xm = Random(-0x200, 0x200);
break;
- case 1:
- case 3:
+ case DIR_UP:
+ case DIR_DOWN:
if (bul->x > gMC.x)
bul->xm = 0x100;
else
@@ -860,16 +861,16 @@
case 1:
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm += -bul->ani_no;
break;
- case 1:
+ case DIR_UP:
bul->ym += -bul->ani_no;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm += bul->ani_no;
break;
- case 3:
+ case DIR_DOWN:
bul->ym += bul->ani_no;
break;
}
@@ -878,8 +879,8 @@
{
switch (bul->direct)
{
- case 0:
- case 2:
+ case DIR_LEFT:
+ case DIR_RIGHT:
if (bul->y < bul->tgt_y)
bul->ym += 0x20;
else
@@ -887,8 +888,8 @@
break;
- case 1:
- case 3:
+ case DIR_UP:
+ case DIR_DOWN:
if (bul->x < bul->tgt_x)
bul->xm += 0x20;
else
@@ -919,17 +920,17 @@
switch (bul->direct)
{
- case 0:
- SetCaret(bul->x + (8 * 0x200), bul->y, 7, 2);
+ case DIR_LEFT:
+ SetCaret(bul->x + (8 * 0x200), bul->y, CARET_EXHAUST, DIR_RIGHT);
break;
- case 1:
- SetCaret(bul->x, bul->y + (8 * 0x200), 7, 3);
+ case DIR_UP:
+ SetCaret(bul->x, bul->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
break;
- case 2:
- SetCaret(bul->x - (8 * 0x200), bul->y, 7, 0);
+ case DIR_RIGHT:
+ SetCaret(bul->x - (8 * 0x200), bul->y, CARET_EXHAUST, DIR_LEFT);
break;
- case 3:
- SetCaret(bul->x, bul->y - (8 * 0x200), 7, 1);
+ case DIR_DOWN:
+ SetCaret(bul->x, bul->y - (8 * 0x200), CARET_EXHAUST, DIR_UP);
break;
}
}
@@ -1022,7 +1023,7 @@
if (bul->flag & 0x2FF)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 2, 0);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
return;
}
@@ -1033,16 +1034,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x600;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x600;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x600;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x600;
break;
}
@@ -1052,16 +1053,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm += 0x2A;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm -= 0x2A;
break;
- case 1:
+ case DIR_UP:
bul->ym += 0x2A;
break;
- case 3:
+ case DIR_DOWN:
bul->ym -= 0x2A;
break;
}
@@ -1072,7 +1073,7 @@
if (++bul->act_wait > 40)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 15, 0);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION_TINY, DIR_LEFT);
}
RECT rect[4] = {
@@ -1098,19 +1099,19 @@
{
BOOL bDelete = FALSE;
- if (bul->direct == 0 && bul->flag & 1)
+ if (bul->direct == DIR_LEFT && bul->flag & 1)
bDelete = TRUE;
- if (bul->direct == 2 && bul->flag & 4)
+ if (bul->direct == DIR_RIGHT && bul->flag & 4)
bDelete = TRUE;
- if (bul->direct == 1 && bul->flag & 2)
+ if (bul->direct == DIR_UP && bul->flag & 2)
bDelete = TRUE;
- if (bul->direct == 3 && bul->flag & 8)
+ if (bul->direct == DIR_DOWN && bul->flag & 8)
bDelete = TRUE;
if (bDelete)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 2, 0);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
return;
}
@@ -1121,19 +1122,19 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x600;
bul->ym = Random(-0x100, 0x100);
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x600;
bul->ym = Random(-0x100, 0x100);
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x600;
bul->xm = Random(-0x100, 0x100);
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x600;
bul->xm = Random(-0x100, 0x100);
break;
@@ -1144,16 +1145,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm += 0x10;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm -= 0x10;
break;
- case 1:
+ case DIR_UP:
bul->ym += 0x10;
break;
- case 3:
+ case DIR_DOWN:
bul->ym -= 0x10;
break;
}
@@ -1164,7 +1165,7 @@
if (++bul->act_wait > 60)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 15, 0);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION_TINY, DIR_LEFT);
}
RECT rect[4] = {
@@ -1191,13 +1192,13 @@
if (++bul->act_wait > 100 || !(gKey & gKeyShot))
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 2, 0);
+ SetCaret(bul->x, bul->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
PlaySoundObject(100, SOUND_MODE_PLAY);
if (gMC.up)
- SetBullet(22, bul->x, bul->y, 1);
+ SetBullet(22, bul->x, bul->y, DIR_UP);
else if (gMC.down)
- SetBullet(22, bul->x, bul->y, 3);
+ SetBullet(22, bul->x, bul->y, DIR_DOWN);
else
SetBullet(22, bul->x, bul->y, gMC.direct);
@@ -1211,19 +1212,19 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = Random(-0x400, -0x200);
bul->ym = (Random(-4, 4) * 0x200) / 2;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = Random(0x200, 0x400);
bul->ym = (Random(-4, 4) * 0x200) / 2;
break;
- case 1:
+ case DIR_UP:
bul->ym = Random(-0x400, -0x200);
bul->xm = (Random(-4, 4) * 0x200) / 2;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = Random(0x80, 0x100);
bul->xm = (Random(-4, 4) * 0x200) / 2;
break;
@@ -1279,7 +1280,7 @@
if (++bul->count1 > bul->life_count || bul->flag & 8)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -1289,16 +1290,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = (-Random(10, 16) * 0x200) / 2;
break;
- case 1:
+ case DIR_UP:
bul->ym = (-Random(10, 16) * 0x200) / 2;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = (Random(10, 16) * 0x200) / 2;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = (Random(10, 16) * 0x200) / 2;
break;
}
@@ -1335,16 +1336,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->rect = rcLeft[bul->ani_no];
break;
- case 1:
+ case DIR_UP:
bul->rect = rcDown[bul->ani_no];
break;
- case 2:
+ case DIR_RIGHT:
bul->rect = rcRight[bul->ani_no];
break;
- case 3:
+ case DIR_DOWN:
bul->rect = rcDown[bul->ani_no];
break;
}
@@ -1355,7 +1356,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -1371,16 +1372,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x800;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x800;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x800;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x800;
break;
}
@@ -1414,7 +1415,7 @@
if (bul->ani_no > 3)
bul->ani_no = 0;
- if (bul->direct == 0)
+ if (bul->direct == DIR_LEFT)
bul->rect = rcLeft[bul->ani_no];
else
bul->rect = rcRight[bul->ani_no];
@@ -1425,7 +1426,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -1441,16 +1442,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x800;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x800;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x800;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x800;
break;
}
@@ -1484,7 +1485,7 @@
if (bul->ani_no > 3)
bul->ani_no = 0;
- if (bul->direct == 0)
+ if (bul->direct == DIR_LEFT)
bul->rect = rcLeft[bul->ani_no];
else
bul->rect = rcRight[bul->ani_no];
@@ -1522,16 +1523,16 @@
case 1:
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x800;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x800;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x800;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x800;
break;
}
@@ -1549,9 +1550,9 @@
PlaySoundObject(106, SOUND_MODE_PLAY);
if (++bul->count1 % 2)
- SetBullet(23, bul->x, bul->y, 0);
+ SetBullet(23, bul->x, bul->y, DIR_LEFT);
else
- SetBullet(23, bul->x, bul->y, 2);
+ SetBullet(23, bul->x, bul->y, DIR_RIGHT);
}
if (++bul->count1 == 5)
@@ -1560,7 +1561,7 @@
if (bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -1576,9 +1577,9 @@
PlaySoundObject(106, SOUND_MODE_PLAY);
if (Random(0, 1) % 2)
- SetBullet(23, bul->x + (Random(-0x40, 0x40) * 0x200), bul->y + (Random(-0x40, 0x40) * 0x200), 0);
+ SetBullet(23, bul->x + (Random(-0x40, 0x40) * 0x200), bul->y + (Random(-0x40, 0x40) * 0x200), DIR_LEFT);
else
- SetBullet(23, bul->x + (Random(-0x40, 0x40) * 0x200), bul->y + (Random(-0x40, 0x40) * 0x200), 2);
+ SetBullet(23, bul->x + (Random(-0x40, 0x40) * 0x200), bul->y + (Random(-0x40, 0x40) * 0x200), DIR_RIGHT);
}
if (bul->act_wait > 50)
@@ -1590,16 +1591,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->rect = rcLeft[bul->ani_no];
break;
- case 1:
+ case DIR_UP:
bul->rect = rcUp[bul->ani_no];
break;
- case 2:
+ case DIR_RIGHT:
bul->rect = rcRight[bul->ani_no];
break;
- case 3:
+ case DIR_DOWN:
bul->rect = rcDown[bul->ani_no];
break;
}
@@ -1616,7 +1617,7 @@
bul->act_no = 1;
bul->y -= 12 * 0x200;
- if (bul->direct == 0)
+ if (bul->direct == DIR_LEFT)
bul->x += 16 * 0x200;
else
bul->x -= 16 * 0x200;
@@ -1628,7 +1629,7 @@
++bul->ani_no;
}
- if (bul->direct == 0)
+ if (bul->direct == DIR_LEFT)
bul->x -= 2 * 0x200;
else
bul->x += 2 * 0x200;
@@ -1667,7 +1668,7 @@
{96, 88, 120, 112},
};
- if (bul->direct == 0)
+ if (bul->direct == DIR_LEFT)
bul->rect = rcLeft[bul->ani_no];
else
bul->rect = rcRight[bul->ani_no];
@@ -1692,7 +1693,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -1700,26 +1701,26 @@
if (bul->life != 10)
bHit = TRUE;
- if (bul->direct == 0 && bul->flag & 1)
+ if (bul->direct == DIR_LEFT && bul->flag & 1)
bHit = TRUE;
- if (bul->direct == 2 && bul->flag & 4)
+ if (bul->direct == DIR_RIGHT && bul->flag & 4)
bHit = TRUE;
- if (bul->direct == 1 && bul->flag & 2)
+ if (bul->direct == DIR_UP && bul->flag & 2)
bHit = TRUE;
- if (bul->direct == 3 && bul->flag & 8)
+ if (bul->direct == DIR_DOWN && bul->flag & 8)
bHit = TRUE;
- if (bul->direct == 0 && bul->flag & 0x80)
+ if (bul->direct == DIR_LEFT && bul->flag & 0x80)
bHit = TRUE;
- if (bul->direct == 0 && bul->flag & 0x20)
+ if (bul->direct == DIR_LEFT && bul->flag & 0x20)
bHit = TRUE;
- if (bul->direct == 2 && bul->flag & 0x40)
+ if (bul->direct == DIR_RIGHT && bul->flag & 0x40)
bHit = TRUE;
- if (bul->direct == 2 && bul->flag & 0x10)
+ if (bul->direct == DIR_RIGHT && bul->flag & 0x10)
bHit = TRUE;
if (bHit)
{
- SetBullet(level + 30, bul->x, bul->y, 0);
+ SetBullet(level + 30, bul->x, bul->y, DIR_LEFT);
bul->cond = 0;
}
@@ -1730,15 +1731,15 @@
switch (bul->direct)
{
- case 0:
- case 2:
+ case DIR_LEFT:
+ case DIR_RIGHT:
bul->tgt_y = bul->y;
bul->enemyXL = 0x1000;
bul->blockXL = 0x1000;
break;
- case 1:
- case 3:
+ case DIR_UP:
+ case DIR_DOWN:
bul->tgt_x = bul->x;
bul->enemyYL = 0x1000;
bul->blockYL = 0x1000;
@@ -1749,8 +1750,8 @@
{
switch (bul->direct)
{
- case 0:
- case 2:
+ case DIR_LEFT:
+ case DIR_RIGHT:
if (bul->y > gMC.y)
bul->ym = 0x100;
else
@@ -1759,8 +1760,8 @@
bul->xm = Random(-0x200, 0x200);
break;
- case 1:
- case 3:
+ case DIR_UP:
+ case DIR_DOWN:
if (bul->x > gMC.x)
bul->xm = 0x100;
else
@@ -1791,16 +1792,16 @@
case 1:
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm += -bul->ani_no;
break;
- case 1:
+ case DIR_UP:
bul->ym += -bul->ani_no;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm += bul->ani_no;
break;
- case 3:
+ case DIR_DOWN:
bul->ym += bul->ani_no;
break;
}
@@ -1809,8 +1810,8 @@
{
switch (bul->direct)
{
- case 0:
- case 2:
+ case DIR_LEFT:
+ case DIR_RIGHT:
if (bul->y < bul->tgt_y)
bul->ym += 0x40;
else
@@ -1817,8 +1818,8 @@
bul->ym -= 0x40;
break;
- case 1:
- case 3:
+ case DIR_UP:
+ case DIR_DOWN:
if (bul->x < bul->tgt_x)
bul->xm += 0x40;
else
@@ -1850,17 +1851,17 @@
switch (bul->direct)
{
- case 0:
- SetCaret(bul->x + (8 * 0x200), bul->y, 7, 2);
+ case DIR_LEFT:
+ SetCaret(bul->x + (8 * 0x200), bul->y, CARET_EXHAUST, DIR_RIGHT);
break;
- case 1:
- SetCaret(bul->x, bul->y + (8 * 0x200), 7, 3);
+ case DIR_UP:
+ SetCaret(bul->x, bul->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
break;
- case 2:
- SetCaret(bul->x - (8 * 0x200), bul->y, 7, 0);
+ case DIR_RIGHT:
+ SetCaret(bul->x - (8 * 0x200), bul->y, CARET_EXHAUST, DIR_LEFT);
break;
- case 3:
- SetCaret(bul->x, bul->y - (8 * 0x200), 7, 1);
+ case DIR_DOWN:
+ SetCaret(bul->x, bul->y - (8 * 0x200), CARET_EXHAUST, DIR_UP);
break;
}
}
@@ -1944,7 +1945,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -1955,16 +1956,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x1000;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x1000;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x1000;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x1000;
break;
}
@@ -1983,17 +1984,17 @@
{
switch (bul->direct)
{
- case 0:
- SetNpChar(4, bul->x, bul->y, -0x200, Random(-0x200, 0x200), 2, NULL, 0x100);
+ case DIR_LEFT:
+ SetNpChar(4, bul->x, bul->y, -0x200, Random(-0x200, 0x200), DIR_RIGHT, NULL, 0x100);
break;
- case 1:
- SetNpChar(4, bul->x, bul->y, Random(-0x200, 0x200), -0x200, 2, NULL, 0x100);
+ case DIR_UP:
+ SetNpChar(4, bul->x, bul->y, Random(-0x200, 0x200), -0x200, DIR_RIGHT, NULL, 0x100);
break;
- case 2:
- SetNpChar(4, bul->x, bul->y, 0x200, Random(-0x200, 0x200), 2, NULL, 0x100);
+ case DIR_RIGHT:
+ SetNpChar(4, bul->x, bul->y, 0x200, Random(-0x200, 0x200), DIR_RIGHT, NULL, 0x100);
break;
- case 3:
- SetNpChar(4, bul->x, bul->y, Random(-0x200, 0x200), 0x200, 2, NULL, 0x100);
+ case DIR_DOWN:
+ SetNpChar(4, bul->x, bul->y, Random(-0x200, 0x200), 0x200, DIR_RIGHT, NULL, 0x100);
break;
}
}
@@ -2027,16 +2028,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->rect = rcL[bul->ani_no];
break;
- case 1:
+ case DIR_UP:
bul->rect = rcU[bul->ani_no];
break;
- case 2:
+ case DIR_RIGHT:
bul->rect = rcR[bul->ani_no];
break;
- case 3:
+ case DIR_DOWN:
bul->rect = rcD[bul->ani_no];
break;
}
@@ -2052,7 +2053,7 @@
if (++bul->count1 > bul->life_count)
{
bul->cond = 0;
- SetCaret(bul->x, bul->y, 3, 0);
+ SetCaret(bul->x, bul->y, CARET_SHOOT, DIR_LEFT);
return;
}
@@ -2065,16 +2066,16 @@
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->xm = -0x1000;
break;
- case 1:
+ case DIR_UP:
bul->ym = -0x1000;
break;
- case 2:
+ case DIR_RIGHT:
bul->xm = 0x1000;
break;
- case 3:
+ case DIR_DOWN:
bul->ym = 0x1000;
break;
}
@@ -2084,16 +2085,16 @@
case 1:
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->enemyYL = 0x400;
break;
- case 1:
+ case DIR_UP:
bul->enemyXL = 0x400;
break;
- case 2:
+ case DIR_RIGHT:
bul->enemyYL = 0x400;
break;
- case 3:
+ case DIR_DOWN:
bul->enemyXL = 0x400;
break;
}
@@ -2103,16 +2104,16 @@
case 2:
switch (bul->direct)
{
- case 0:
+ case DIR_LEFT:
bul->enemyYL = 0x800;
break;
- case 1:
+ case DIR_UP:
bul->enemyXL = 0x800;
break;
- case 2:
+ case DIR_RIGHT:
bul->enemyYL = 0x800;
break;
- case 3:
+ case DIR_DOWN:
bul->enemyXL = 0x800;
break;
}
@@ -2146,7 +2147,7 @@
switch (level)
{
case 1:
- if (bul->direct == 1 || bul->direct == 3)
+ if (bul->direct == DIR_UP || bul->direct == DIR_DOWN)
bul->rect = rect1[1];
else
bul->rect = rect1[0];
@@ -2154,7 +2155,7 @@
break;
case 2:
- if (bul->direct == 1 || bul->direct == 3)
+ if (bul->direct == DIR_UP || bul->direct == DIR_DOWN)
bul->rect = rect2[1];
else
bul->rect = rect2[0];
@@ -2162,7 +2163,7 @@
break;
case 3:
- if (bul->direct == 1 || bul->direct == 3)
+ if (bul->direct == DIR_UP || bul->direct == DIR_DOWN)
bul->rect = rect3[1];
else
bul->rect = rect3[0];
@@ -2228,7 +2229,7 @@
switch (level)
{
case 1:
- if (bul->direct == 0 || bul->direct == 2)
+ if (bul->direct == DIR_LEFT || bul->direct == DIR_RIGHT)
bul->rect = rc_h_lv1[bul->ani_no];
else
bul->rect = rc_v_lv1[bul->ani_no];
@@ -2236,7 +2237,7 @@
break;
case 2:
- if (bul->direct == 0 || bul->direct == 2)
+ if (bul->direct == DIR_LEFT || bul->direct == DIR_RIGHT)
bul->rect = rc_h_lv2[bul->ani_no];
else
bul->rect = rc_v_lv2[bul->ani_no];
@@ -2244,7 +2245,7 @@
break;
case 3:
- if (bul->direct == 0 || bul->direct == 2)
+ if (bul->direct == DIR_LEFT || bul->direct == DIR_RIGHT)
bul->rect = rc_h_lv3[bul->ani_no];
else
bul->rect = rc_v_lv3[bul->ani_no];
--- a/src/Caret.cpp
+++ b/src/Caret.cpp
@@ -4,31 +4,59 @@
#include "WindowsWrapper.h"
+#include "CommonDefines.h"
#include "Draw.h"
#include "Game.h"
#include "Triangle.h"
+#define CARET_MAX 0x40
+
+struct CARET
+{
+ int cond;
+ int code;
+ int direct;
+ int x;
+ int y;
+ int xm;
+ int ym;
+ int act_no;
+ int act_wait;
+ int ani_no;
+ int ani_wait;
+ int view_left;
+ int view_top;
+ RECT rect;
+};
+
+struct CARET_TABLE
+{
+ int view_left;
+ int view_top;
+};
+
CARET gCrt[CARET_MAX];
+// Sprite offsets
CARET_TABLE gCaretTable[18] = {
- {0, 0},
- {0x800, 0x800},
- {0x1000, 0x1000},
- {0x1000, 0x1000},
- {0x1000, 0x1000},
- {0x800, 0x800},
- {0x1000, 0x1000},
- {0x800, 0x800},
- {0x1000, 0x1000},
- {0x1000, 0x1000},
- {0x3800, 0x1000},
- {0x800, 0x800},
- {0x2000, 0x2000},
- {0x800, 0x800},
- {0x2800, 0x2800},
- {0x800, 0x800},
- {0x2800, 0x800},
- {0x6800, 0x800}
+ {0, 0}, // CARET_NULL
+ { 4 * 0x200, 4 * 0x200}, // CARET_BUBBLE
+ { 8 * 0x200, 8 * 0x200}, // CARET_PROJECTILE_DISSIPATION
+ { 8 * 0x200, 8 * 0x200}, // CARET_SHOOT
+ { 8 * 0x200, 8 * 0x200}, // CARET_SNAKE_AFTERIMAGE
+ { 4 * 0x200, 4 * 0x200}, // CARET_ZZZ
+ { 8 * 0x200, 8 * 0x200}, // CARET_SNAKE_AFTERIMAGE_DUPLICATE
+ { 4 * 0x200, 4 * 0x200}, // CARET_EXHAUST
+ { 8 * 0x200, 8 * 0x200}, // CARET_DROWNED_QUOTE
+ { 8 * 0x200, 8 * 0x200}, // CARET_QUESTION_MARK
+ {28 * 0x200, 8 * 0x200}, // CARET_LEVEL_UP
+ { 4 * 0x200, 4 * 0x200}, // CARET_HURT_PARTICLES
+ {16 * 0x200, 16 * 0x200}, // CARET_EXPLOSION
+ { 4 * 0x200, 4 * 0x200}, // CARET_TINY_PARTICLES
+ {20 * 0x200, 20 * 0x200}, // CARET_UNKNOWN
+ { 4 * 0x200, 4 * 0x200}, // CARET_PROJECTILE_DISSIPATION_TINY
+ {20 * 0x200, 4 * 0x200}, // CARET_EMPTY
+ {52 * 0x200, 4 * 0x200} // CARET_PUSH_JUMP_KEY
};
void InitCaret(void)
@@ -36,16 +64,18 @@
memset(gCrt, 0, sizeof(gCrt));
}
+// Null
void ActCaret00(CARET *crt)
{
(void)crt;
}
+// Bubble
void ActCaret01(CARET *crt)
{
RECT rcLeft[4] = {
- {0, 64, 8, 72},
- {8, 64, 16, 72},
+ { 0, 64, 8, 72},
+ { 8, 64, 16, 72},
{16, 64, 24, 72},
{24, 64, 32, 72},
};
@@ -81,16 +111,17 @@
}
}
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
crt->rect = rcLeft[crt->ani_no];
else
crt->rect = rcRight[crt->ani_no];
}
+// Projectile dissipation
void ActCaret02(CARET *crt)
{
RECT rect_left[4] = {
- {0, 32, 16, 48},
+ { 0, 32, 16, 48},
{16, 32, 32, 48},
{32, 32, 48, 48},
{48, 32, 64, 48},
@@ -104,7 +135,7 @@
};
RECT rect_up[3] = {
- {0, 32, 16, 48},
+ { 0, 32, 16, 48},
{32, 32, 48, 48},
{16, 32, 32, 48},
};
@@ -111,7 +142,7 @@
switch (crt->direct)
{
- case 0:
+ case DIR_LEFT:
crt->ym -= 0x10;
crt->y += crt->ym;
@@ -132,7 +163,7 @@
crt->rect = rect_left[crt->ani_no];
break;
- case 2:
+ case DIR_RIGHT:
if (++crt->ani_wait > 2)
{
crt->ani_wait = 0;
@@ -150,7 +181,7 @@
crt->rect = rect_right[crt->ani_no];
break;
- case 1:
+ case DIR_UP:
crt->rect = rect_up[++crt->ani_wait / 2 % 3];
if (crt->ani_wait > 24)
@@ -160,10 +191,11 @@
}
}
+// Shoot
void ActCaret03(CARET *crt)
{
RECT rect[4] = {
- {0, 48, 16, 64},
+ { 0, 48, 16, 64},
{16, 48, 32, 64},
{32, 48, 48, 64},
{48, 48, 64, 64},
@@ -185,19 +217,21 @@
crt->rect = rect[crt->ani_no];
}
+// Snake after-image? This doesn't seem to be used.
void ActCaret04(CARET *crt)
{
RECT rect[9] = {
- {64, 32, 80, 48},
- {80, 32, 96, 48},
+ // Left
+ {64, 32, 80, 48},
+ {80, 32, 96, 48},
{96, 32, 112, 48},
-
- {64, 48, 80, 64},
- {80, 48, 96, 64},
+ // Up
+ {64, 48, 80, 64},
+ {80, 48, 96, 64},
{96, 48, 112, 64},
-
- {64, 64, 80, 80},
- {80, 64, 96, 80},
+ // Right
+ {64, 64, 80, 80},
+ {80, 64, 96, 80},
{96, 64, 112, 80},
};
@@ -217,6 +251,7 @@
crt->rect = rect[(crt->direct * 3) + crt->ani_no];
}
+// 'Zzz' - snoring
void ActCaret05(CARET *crt)
{
RECT rect[7] = {
@@ -249,15 +284,18 @@
crt->rect = rect[crt->ani_no];
}
+// No ActCaret06...
+
+// Exhaust (used by the Booster and hoverbike)
void ActCaret07(CARET *crt)
{
RECT rcLeft[7] = {
- {56, 0, 64, 8},
- {64, 0, 72, 8},
- {72, 0, 80, 8},
- {80, 0, 88, 8},
- {88, 0, 96, 8},
- {96, 0, 104, 8},
+ { 56, 0, 64, 8},
+ { 64, 0, 72, 8},
+ { 72, 0, 80, 8},
+ { 80, 0, 88, 8},
+ { 88, 0, 96, 8},
+ { 96, 0, 104, 8},
{104, 0, 112, 8},
};
@@ -278,32 +316,34 @@
switch (crt->direct)
{
- case 0:
+ case DIR_LEFT:
crt->x -= 2 * 0x200;
break;
- case 1:
+ case DIR_UP:
crt->y -= 2 * 0x200;
break;
- case 2:
+ case DIR_RIGHT:
crt->x += 2 * 0x200;
break;
- case 3:
+ case DIR_DOWN:
crt->y += 2 * 0x200;
break;
}
}
+// Drowned Quote
void ActCaret08(CARET *crt)
{
RECT rcLeft = {16, 80, 32, 96};
RECT rcRight = {32, 80, 48, 96};
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
crt->rect = rcLeft;
else
crt->rect = rcRight;
}
+// The '?' that appears when you press the down key
void ActCaret09(CARET *crt)
{
RECT rcLeft = {0, 80, 16, 96};
@@ -315,27 +355,28 @@
if (crt->ani_wait == 32)
crt->cond = 0;
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
crt->rect = rcLeft;
else
crt->rect = rcRight;
}
+// 'Level Up!'
void ActCaret10(CARET *crt)
{
RECT rcLeft[2] = {
- {0, 0, 56, 16},
+ {0, 0, 56, 16},
{0, 16, 56, 32},
};
RECT rcRight[2] = {
- {0, 96, 56, 112},
+ {0, 96, 56, 112},
{0, 112, 56, 128},
};
++crt->ani_wait;
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
{
if (crt->ani_wait < 20)
crt->y -= 2 * 0x200;
@@ -352,12 +393,13 @@
crt->cond = 0;
}
- if (crt->direct == 0)
+ if (crt->direct == DIR_LEFT)
crt->rect = rcLeft[crt->ani_wait / 2 % 2];
else
crt->rect = rcRight[crt->ani_wait / 2 % 2];
}
+// Red hurt particles (used by bosses and invisible hidden pickups)
void ActCaret11(CARET *crt)
{
unsigned char deg;
@@ -374,12 +416,12 @@
crt->y += crt->ym;
RECT rcRight[7] = {
- {56, 8, 64, 16},
- {64, 8, 72, 16},
- {72, 8, 80, 16},
- {80, 8, 88, 16},
- {88, 8, 96, 16},
- {96, 8, 104, 16},
+ { 56, 8, 64, 16},
+ { 64, 8, 72, 16},
+ { 72, 8, 80, 16},
+ { 80, 8, 88, 16},
+ { 88, 8, 96, 16},
+ { 96, 8, 104, 16},
{104, 8, 112, 16},
};
@@ -399,6 +441,7 @@
crt->rect = rcRight[crt->ani_no];
}
+// Missile Launcher explosion flash
void ActCaret12(CARET *crt)
{
RECT rcLeft[2] = {
@@ -422,6 +465,7 @@
crt->rect = rcLeft[crt->ani_no];
}
+// Particles used when Quote jumps into the ceiling, and also used by the Demon Crown and Ballos's puppy
void ActCaret13(CARET *crt)
{
RECT rcLeft[2] = {
@@ -435,12 +479,12 @@
switch (crt->direct)
{
- case 0:
+ case DIR_LEFT:
crt->xm = Random(-0x600, 0x600);
crt->ym = Random(-0x200, 0x200);
break;
- case 1:
+ case DIR_UP:
crt->ym = -0x200 * Random(1, 3);
break;
}
@@ -448,7 +492,7 @@
switch (crt->direct)
{
- case 0:
+ case DIR_LEFT:
crt->xm = (crt->xm * 4) / 5;
crt->ym = (crt->ym * 4) / 5;
break;
@@ -462,12 +506,16 @@
crt->rect = rcLeft[crt->ani_wait / 2 % 2];
- if (crt->direct == 5)
+ if (crt->direct == DIR_OTHER)
crt->x -= 4 * 0x200;
}
+// Broken (unknown and unused)
void ActCaret14(CARET *crt)
{
+ // These rects are invalid.
+ // However, notably, there are 5 unused 40x40 sprites at the bottom of Caret.pbm.
+ // Perhaps those were originally at these coordinates.
RECT rect[5] = {
{0, 96, 40, 136},
{40, 96, 80, 136},
@@ -492,11 +540,12 @@
crt->rect = rect[crt->ani_no];
}
+// Tiny version of the projectile dissipation effect
void ActCaret15(CARET *crt)
{
RECT rcLeft[4] = {
- {0, 72, 8, 80},
- {8, 72, 16, 80},
+ { 0, 72, 8, 80},
+ { 8, 72, 16, 80},
{16, 72, 24, 80},
{24, 72, 32, 80},
};
@@ -517,10 +566,11 @@
crt->rect = rcLeft[crt->ani_no];
}
+// 'Empty!'
void ActCaret16(CARET *crt)
{
RECT rcLeft[2] = {
- {104, 96, 144, 104},
+ {104, 96, 144, 104},
{104, 104, 144, 112},
};
@@ -533,6 +583,7 @@
crt->rect = rcLeft[crt->ani_wait / 2 % 2];
}
+// 'PUSH JUMP KEY!' (unused)
void ActCaret17(CARET *crt)
{
RECT rcLeft[2] = {
@@ -558,7 +609,7 @@
ActCaret03,
ActCaret04,
ActCaret05,
- ActCaret04,
+ ActCaret04, // Interestingly, this slot is a duplicate
ActCaret07,
ActCaret08,
ActCaret09,
@@ -569,7 +620,7 @@
ActCaret14,
ActCaret15,
ActCaret16,
- ActCaret17,
+ ActCaret17
};
void ActCaret(void)
--- a/src/Caret.h
+++ b/src/Caret.h
@@ -2,34 +2,27 @@
#include "WindowsWrapper.h"
-#define CARET_MAX 0x40
-
-struct CARET_TABLE
+enum
{
- int view_left;
- int view_top;
+ CARET_NULL = 0,
+ CARET_BUBBLE = 1,
+ CARET_PROJECTILE_DISSIPATION = 2,
+ CARET_SHOOT = 3,
+ CARET_SNAKE_AFTERIMAGE = 4,
+ CARET_ZZZ = 5,
+ CARET_SNAKE_AFTERIMAGE_DUPLICATE = 6,
+ CARET_EXHAUST = 7,
+ CARET_DROWNED_QUOTE = 8,
+ CARET_QUESTION_MARK = 9,
+ CARET_LEVEL_UP = 10,
+ CARET_HURT_PARTICLES = 11,
+ CARET_EXPLOSION = 12,
+ CARET_TINY_PARTICLES = 13,
+ CARET_UNKNOWN = 14,
+ CARET_PROJECTILE_DISSIPATION_TINY = 15,
+ CARET_EMPTY = 16,
+ CARET_PUSH_JUMP_KEY = 17
};
-
-struct CARET
-{
- int cond;
- int code;
- int direct;
- int x;
- int y;
- int xm;
- int ym;
- int act_no;
- int act_wait;
- int ani_no;
- int ani_wait;
- int view_left;
- int view_top;
- RECT rect;
-};
-
-extern CARET gCrt[CARET_MAX];
-extern CARET_TABLE gCaretTable[18];
void InitCaret(void);
void ActCaret(void);
--- a/src/CommonDefines.h
+++ b/src/CommonDefines.h
@@ -18,7 +18,8 @@
DIR_UP = 1,
DIR_RIGHT = 2,
DIR_DOWN = 3,
- DIR_AUTO = 4
+ DIR_AUTO = 4,
+ DIR_OTHER = 5
};
struct OTHER_RECT // The original name for this struct is unknown
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -12,10 +12,10 @@
const char* const gConfigName = "Config.dat";
const char* const gProof = "DOUKUTSU20041206";
-BOOL LoadConfigData(CONFIG *conf)
+BOOL LoadConfigData(CONFIGDATA *conf)
{
// Clear old configuration data
- memset(conf, 0, sizeof(CONFIG));
+ memset(conf, 0, sizeof(CONFIGDATA));
// Get path
std::string path = gModulePath + '/' + gConfigName;
@@ -48,7 +48,7 @@
// Check if version is not correct, and return if it failed
if (strcmp(conf->proof, gProof))
{
- memset(conf, 0, sizeof(CONFIG));
+ memset(conf, 0, sizeof(CONFIGDATA));
return FALSE;
}
@@ -55,10 +55,10 @@
return TRUE;
}
-void DefaultConfigData(CONFIG *conf)
+void DefaultConfigData(CONFIGDATA *conf)
{
// Clear old configuration data
- memset(conf, 0, sizeof(CONFIG));
+ memset(conf, 0, sizeof(CONFIGDATA));
// Fun fact: The Linux port added this line:
// conf->display_mode = 1;
--- a/src/Config.h
+++ b/src/Config.h
@@ -2,7 +2,7 @@
#include "WindowsWrapper.h"
-struct CONFIG
+struct CONFIGDATA
{
char proof[0x20];
char font_name[0x40];
@@ -17,5 +17,5 @@
extern const char* const gConfigName;
extern const char* const gProof;
-BOOL LoadConfigData(CONFIG *conf);
-void DefaultConfigData(CONFIG *conf);
+BOOL LoadConfigData(CONFIGDATA *conf);
+void DefaultConfigData(CONFIGDATA *conf);
--- a/src/Input.cpp
+++ b/src/Input.cpp
@@ -17,7 +17,7 @@
return ControllerBackend_Init();
}
-BOOL GetJoystickStatus(JOYSTICK_STATUS *status)
+BOOL GetJoystickStatus(DIRECTINPUTSTATUS *status)
{
bool *buttons;
unsigned int button_count;
--- a/src/Input.h
+++ b/src/Input.h
@@ -2,7 +2,7 @@
#include "WindowsWrapper.h"
-struct JOYSTICK_STATUS
+struct DIRECTINPUTSTATUS
{
BOOL bLeft;
BOOL bRight;
@@ -13,5 +13,5 @@
void ReleaseDirectInput(void);
BOOL InitDirectInput(void);
-BOOL GetJoystickStatus(JOYSTICK_STATUS *status);
+BOOL GetJoystickStatus(DIRECTINPUTSTATUS *status);
BOOL ResetJoystickStatus(void);
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -108,7 +108,7 @@
// Get path of the data folder
gDataPath = gModulePath + "/data";
- CONFIG conf;
+ CONFIGDATA conf;
if (!LoadConfigData(&conf))
DefaultConfigData(&conf);
@@ -578,7 +578,7 @@
void JoystickProc(void)
{
int i;
- JOYSTICK_STATUS status;
+ DIRECTINPUTSTATUS status;
if (!GetJoystickStatus(&status))
return;
--- a/src/MyChar.cpp
+++ b/src/MyChar.cpp
@@ -7,6 +7,7 @@
#include "ArmsItem.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Draw.h"
#include "Flags.h"
#include "Game.h"
@@ -494,9 +495,9 @@
if (gKeyTrg & gKeyJump || gMC.boost_cnt % 3 == 1)
{
if (gMC.direct == 0)
- SetCaret(gMC.x + (2 * 0x200), gMC.y + (2 * 0x200), 7, 2);
+ SetCaret(gMC.x + (2 * 0x200), gMC.y + (2 * 0x200), CARET_EXHAUST, DIR_RIGHT);
if (gMC.direct == 2)
- SetCaret(gMC.x - (2 * 0x200), gMC.y + (2 * 0x200), 7, 0);
+ SetCaret(gMC.x - (2 * 0x200), gMC.y + (2 * 0x200), CARET_EXHAUST, DIR_LEFT);
PlaySoundObject(113, SOUND_MODE_PLAY);
}
@@ -509,7 +510,7 @@
// Boost particles (and sound)
if (gKeyTrg & gKeyJump || gMC.boost_cnt % 3 == 1)
{
- SetCaret(gMC.x, gMC.y + (6 * 0x200), 7, 3);
+ SetCaret(gMC.x, gMC.y + (6 * 0x200), CARET_EXHAUST, DIR_DOWN);
PlaySoundObject(113, SOUND_MODE_PLAY);
}
}
@@ -516,7 +517,7 @@
else if (gMC.boost_sw == 3 && (gKeyTrg & gKeyJump || gMC.boost_cnt % 3 == 1))
{
// Boost particles (and sound)
- SetCaret(gMC.x, gMC.y - (6 * 0x200), 7, 1);
+ SetCaret(gMC.x, gMC.y - (6 * 0x200), CARET_EXHAUST, DIR_UP);
PlaySoundObject(113, SOUND_MODE_PLAY);
}
}
@@ -533,7 +534,7 @@
if (gMC.boost_cnt % 3 == 0)
{
- SetCaret(gMC.x, gMC.y + (gMC.hit.bottom / 2), 7, 3);
+ SetCaret(gMC.x, gMC.y + (gMC.hit.bottom / 2), CARET_EXHAUST, DIR_DOWN);
PlaySoundObject(113, SOUND_MODE_PLAY);
}
@@ -758,9 +759,9 @@
}
if (gMC.ym < -0x200 && gMC.flag & 2)
- SetCaret(gMC.x, gMC.y - gMC.hit.top, 13, 5);
+ SetCaret(gMC.x, gMC.y - gMC.hit.top, CARET_TINY_PARTICLES, DIR_OTHER);
if (gMC.ym > 0x200 && gMC.flag & 8)
- SetCaret(gMC.x, gMC.y + gMC.hit.bottom, 13, 5);
+ SetCaret(gMC.x, gMC.y + gMC.hit.bottom, CARET_TINY_PARTICLES, DIR_OTHER);
if (gMC.xm > 0x400)
gMC.xm = 0x400;
@@ -836,9 +837,9 @@
StartTextScript(41);
if (gMC.direct == 0)
- SetCaret(gMC.x, gMC.y, 8, 0);
+ SetCaret(gMC.x, gMC.y, CARET_DROWNED_QUOTE, DIR_LEFT);
else
- SetCaret(gMC.x, gMC.y, 8, 2);
+ SetCaret(gMC.x, gMC.y, CARET_DROWNED_QUOTE, DIR_RIGHT);
gMC.cond &= ~0x80;
}
--- a/src/MycHit.cpp
+++ b/src/MycHit.cpp
@@ -5,6 +5,7 @@
#include "Back.h"
#include "Boss.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Game.h"
#include "KeyControl.h"
#include "Map.h"
@@ -24,8 +25,8 @@
if (!(gMC.cond & 2) && gMC.ym < -0x200)
{
PlaySoundObject(3, SOUND_MODE_PLAY);
- SetCaret(gMC.x, gMC.y - gMC.hit.top, 13, 0);
- SetCaret(gMC.x, gMC.y - gMC.hit.top, 13, 0);
+ SetCaret(gMC.x, gMC.y - gMC.hit.top, CARET_TINY_PARTICLES, DIR_LEFT);
+ SetCaret(gMC.x, gMC.y - gMC.hit.top, CARET_TINY_PARTICLES, DIR_LEFT);
}
}
@@ -853,7 +854,7 @@
// Create question mark when NPC hasn't been interacted with
if (gMC.ques)
- SetCaret(gMC.x, gMC.y, 9, 0);
+ SetCaret(gMC.x, gMC.y, CARET_QUESTION_MARK, DIR_LEFT);
}
void HitMyCharBoss(void)
@@ -913,5 +914,5 @@
}
if (gMC.ques)
- SetCaret(gMC.x, gMC.y, 9, 0);
+ SetCaret(gMC.x, gMC.y, CARET_QUESTION_MARK, DIR_LEFT);
}
--- a/src/MycParam.cpp
+++ b/src/MycParam.cpp
@@ -69,7 +69,7 @@
if (gArmsData[gSelectedArms].code != 13)
{
PlaySoundObject(27, SOUND_MODE_PLAY);
- SetCaret(gMC.x, gMC.y, 10, 0);
+ SetCaret(gMC.x, gMC.y, CARET_LEVEL_UP, DIR_LEFT);
}
}
}
@@ -159,7 +159,7 @@
gArmsData[gSelectedArms].exp = gArmsLevelTable[arms_code].exp[lv] + gArmsData[gSelectedArms].exp;
if (gMC.life > 0 && gArmsData[gSelectedArms].code != 13)
- SetCaret(gMC.x, gMC.y, 10, 2);
+ SetCaret(gMC.x, gMC.y, CARET_LEVEL_UP, DIR_RIGHT);
}
else
{
--- a/src/NpChar.cpp
+++ b/src/NpChar.cpp
@@ -9,6 +9,7 @@
#include "ArmsItem.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Draw.h"
#include "File.h"
#include "Flags.h"
@@ -170,7 +171,7 @@
}
// Flash effect
- SetCaret(x, y, 12, 0);
+ SetCaret(x, y, CARET_EXPLOSION, DIR_LEFT);
}
void SetDestroyNpCharUp(int x, int y, int w, int num)
@@ -189,7 +190,7 @@
}
// Flash effect
- SetCaret(x, y, 12, 0);
+ SetCaret(x, y, CARET_EXPLOSION, DIR_LEFT);
}
void SetExpObjects(int x, int y, int exp)
--- a/src/NpcAct000.cpp
+++ b/src/NpcAct000.cpp
@@ -6,6 +6,7 @@
#include "Back.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "Map.h"
@@ -17,7 +18,7 @@
// Null
void ActNpc000(NPCHAR *npc)
{
- RECT rect = {0x00, 0x00, 0x10, 0x10};
+ RECT rect = {0, 0, 16, 16};
if (npc->act_no == 0)
{
@@ -34,7 +35,7 @@
void ActNpc001(NPCHAR *npc)
{
// In wind
- if (gBack.type == 5 || gBack.type == 6)
+ if (gBack.type == BACKGROUND_TYPE_AUTOSCROLL || gBack.type == BACKGROUND_TYPE_OUTSIDE_WITH_WIND)
{
if (npc->act_no == 0)
{
@@ -144,12 +145,12 @@
// Get framerects
RECT rect[6] = {
- {0x00, 0x10, 0x10, 0x20},
- {0x10, 0x10, 0x20, 0x20},
- {0x20, 0x10, 0x30, 0x20},
- {0x30, 0x10, 0x40, 0x20},
- {0x40, 0x10, 0x50, 0x20},
- {0x50, 0x10, 0x60, 0x20},
+ { 0, 16, 16, 32},
+ {16, 16, 32, 32},
+ {32, 16, 48, 32},
+ {48, 16, 64, 32},
+ {64, 16, 80, 32},
+ {80, 16, 96, 32},
};
RECT rcNo = {0, 0, 0, 0};
@@ -214,21 +215,21 @@
{
// Rects
RECT rcLeft[7] = {
- {32, 0, 64, 24},
- {0, 0, 32, 24},
- {32, 0, 64, 24},
- {64, 0, 96, 24},
- {96, 0, 128, 24},
+ { 32, 0, 64, 24},
+ { 0, 0, 32, 24},
+ { 32, 0, 64, 24},
+ { 64, 0, 96, 24},
+ { 96, 0, 128, 24},
{128, 0, 160, 24},
{160, 0, 192, 24},
};
RECT rcRight[7] = {
- {32, 24, 64, 48},
- {0, 24, 32, 48},
- {32, 24, 64, 48},
- {64, 24, 96, 48},
- {96, 24, 128, 48},
+ { 32, 24, 64, 48},
+ { 0, 24, 32, 48},
+ { 32, 24, 64, 48},
+ { 64, 24, 96, 48},
+ { 96, 24, 128, 48},
{128, 24, 160, 48},
{160, 24, 192, 48},
};
@@ -346,20 +347,20 @@
void ActNpc004(NPCHAR *npc)
{
RECT rcLeft[8] = {
- {16, 0, 17, 1},
- {16, 0, 32, 16},
- {32, 0, 48, 16},
- {48, 0, 64, 16},
- {64, 0, 80, 16},
- {80, 0, 96, 16},
- {96, 0, 112, 16},
+ { 16, 0, 17, 1},
+ { 16, 0, 32, 16},
+ { 32, 0, 48, 16},
+ { 48, 0, 64, 16},
+ { 64, 0, 80, 16},
+ { 80, 0, 96, 16},
+ { 96, 0, 112, 16},
{112, 0, 128, 16},
};
RECT rcUp[8] = {
- {16, 0, 17, 1},
- {80, 48, 96, 64},
- {0, 128, 16, 144},
+ {16, 0, 17, 1},
+ {80, 48, 96, 64},
+ { 0, 128, 16, 144},
{16, 128, 32, 144},
{32, 128, 48, 144},
{48, 128, 64, 144},
@@ -423,13 +424,13 @@
void ActNpc005(NPCHAR *npc)
{
RECT rcLeft[3] = {
- {0, 48, 16, 64},
+ { 0, 48, 16, 64},
{16, 48, 32, 64},
{32, 48, 48, 64},
};
RECT rcRight[3] = {
- {0, 64, 16, 80},
+ { 0, 64, 16, 80},
{16, 64, 32, 80},
{32, 64, 48, 80},
};
@@ -532,7 +533,7 @@
void ActNpc006(NPCHAR *npc)
{
RECT rcLeft[5] = {
- {0, 80, 16, 96},
+ { 0, 80, 16, 96},
{16, 80, 32, 96},
{32, 80, 48, 96},
{48, 80, 64, 96},
@@ -540,7 +541,7 @@
};
RECT rcRight[5] = {
- {0, 96, 16, 112},
+ { 0, 96, 16, 112},
{16, 96, 32, 112},
{32, 96, 48, 112},
{48, 96, 64, 112},
@@ -656,14 +657,14 @@
void ActNpc007(NPCHAR *npc)
{
RECT rcLeft[3] = {
- {256, 64, 288, 80},
- {256, 80, 288, 96},
+ {256, 64, 288, 80},
+ {256, 80, 288, 96},
{256, 96, 288, 112},
};
RECT rcRight[3] = {
- {288, 64, 320, 80},
- {288, 80, 320, 96},
+ {288, 64, 320, 80},
+ {288, 80, 320, 96},
{288, 96, 320, 112},
};
@@ -670,7 +671,7 @@
switch (npc->act_no)
{
case 0:
- npc->x = gMC.x;
+ npc->x = gMC.x; // Spawn beneath player
if (npc->direct == 0)
npc->act_no = 1;
@@ -679,12 +680,14 @@
break;
- case 1:
+ case 1: // Going left
npc->xm -= 0x40;
+ // Turn around if far enough away from the player
if (npc->x < gMC.x - (192 * 0x200))
npc->act_no = 2;
+ // Turn around if touching a wall
if (npc->flag & 1)
{
npc->xm = 0;
@@ -693,12 +696,14 @@
break;
- case 2:
+ case 2: // Going right
npc->xm += 0x40;
+ // Turn around if far enough away from the player
if (npc->x > gMC.x + (192 * 0x200))
npc->act_no = 1;
+ // Turn around if touching a wall
if (npc->flag & 4)
{
npc->xm = 0;
@@ -708,18 +713,22 @@
break;
}
+ // Face direction Bazil is moving
if (npc->xm < 0)
npc->direct = 0;
else
npc->direct = 2;
+ // Cap speed
if (npc->xm > 0x5FF)
npc->xm = 0x5FF;
if (npc->xm < -0x5FF)
npc->xm = -0x5FF;
+ // Apply momentum
npc->x += npc->xm;
+ // Increment animation
if (++npc->ani_wait > 1)
{
npc->ani_wait = 0;
@@ -726,9 +735,11 @@
++npc->ani_no;
}
+ // Loop animation
if (npc->ani_no > 2)
npc->ani_no = 0;
+ // Update sprite
if (npc->direct == 0)
npc->rect = rcLeft[npc->ani_no];
else
@@ -739,12 +750,12 @@
void ActNpc008(NPCHAR *npc)
{
RECT rcLeft[2] = {
- {80, 80, 96, 96},
+ {80, 80, 96, 96},
{96, 80, 112, 96},
};
RECT rcRight[2] = {
- {80, 96, 96, 112},
+ {80, 96, 96, 112},
{96, 96, 112, 112},
};
@@ -1041,7 +1052,7 @@
if (npc->flag & 0xFF)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->y += npc->ym;
@@ -1065,7 +1076,7 @@
if (++npc->count1 > 150)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
--- a/src/NpcAct020.cpp
+++ b/src/NpcAct020.cpp
@@ -5,6 +5,7 @@
#include "WindowsWrapper.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Game.h"
#include "Frame.h"
#include "MyChar.h"
@@ -803,7 +804,7 @@
if (++npc->act_wait > 100)
{
npc->act_wait = 0;
- SetCaret(npc->x, npc->y - (2 * 0x200), 5, 0);
+ SetCaret(npc->x, npc->y - (2 * 0x200), CARET_ZZZ, DIR_LEFT);
}
}
@@ -970,7 +971,7 @@
{
if (npc->flag & 5)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
else if (npc->flag & 8)
@@ -1000,7 +1001,7 @@
if (++npc->act_wait > 250)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
--- a/src/NpcAct040.cpp
+++ b/src/NpcAct040.cpp
@@ -819,7 +819,7 @@
if (++npc->count1 > 2 || npc->direct == 2)
{
VanishNpChar(npc);
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
else
{
@@ -856,7 +856,7 @@
if (++npc->act_wait > 750)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@@ -1064,7 +1064,7 @@
{
if (++npc->count1 > 1)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
--- a/src/NpcAct080.cpp
+++ b/src/NpcAct080.cpp
@@ -637,7 +637,7 @@
{
if (npc->flag & 0xFF)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@@ -664,7 +664,7 @@
if (++npc->count1 > 300)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
@@ -737,7 +737,7 @@
npc->ani_no = 0;
}
- if (gBack.type == 5 || gBack.type == 6)
+ if (gBack.type == BACKGROUND_TYPE_AUTOSCROLL || gBack.type == BACKGROUND_TYPE_OUTSIDE_WITH_WIND)
{
if (npc->act_no == 0)
{
@@ -818,7 +818,7 @@
npc->ani_no = 0;
}
- if (gBack.type == 5 || gBack.type == 6)
+ if (gBack.type == BACKGROUND_TYPE_AUTOSCROLL || gBack.type == BACKGROUND_TYPE_OUTSIDE_WITH_WIND)
{
if (npc->act_no == 0)
{
@@ -1410,7 +1410,7 @@
if (++npc->act_wait > 200)
{
npc->act_wait = 0;
- SetCaret(npc->x, npc->y, 5, 0);
+ SetCaret(npc->x, npc->y, CARET_ZZZ, DIR_LEFT);
}
break;
--- a/src/NpcAct100.cpp
+++ b/src/NpcAct100.cpp
@@ -6,6 +6,7 @@
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "MyChar.h"
@@ -500,7 +501,7 @@
{
if (npc->flag & 0xFF)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@@ -526,7 +527,7 @@
if (++npc->count1 > 300)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
--- a/src/NpcAct120.cpp
+++ b/src/NpcAct120.cpp
@@ -7,6 +7,7 @@
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "KeyControl.h"
@@ -75,7 +76,7 @@
if (++npc->act_wait > 100)
{
npc->act_wait = 0;
- SetCaret(npc->x, npc->y, 5, 0);
+ SetCaret(npc->x, npc->y, CARET_ZZZ, DIR_LEFT);
}
}
}
@@ -285,7 +286,7 @@
{
case 0:
npc->act_no = 1;
- SetCaret(npc->x, npc->y, 3, 0);
+ SetCaret(npc->x, npc->y, CARET_SHOOT, DIR_LEFT);
PlaySoundObject(32, SOUND_MODE_PLAY);
switch (npc->direct)
@@ -345,7 +346,7 @@
if (bBreak)
{
- SetCaret(npc->x, npc->y, 2, 2);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_RIGHT);
PlaySoundObject(28, SOUND_MODE_PLAY);
npc->cond = 0;
}
@@ -819,7 +820,7 @@
if (++npc->act_wait > 100)
{
npc->act_wait = 0;
- SetCaret(npc->x, npc->y, 5, 0);
+ SetCaret(npc->x, npc->y, CARET_ZZZ, DIR_LEFT);
}
if (npc->direct == 0)
--- a/src/NpcAct140.cpp
+++ b/src/NpcAct140.cpp
@@ -413,7 +413,7 @@
{
npc->act_no = 20;
npc->act_wait = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
PlaySoundObject(12, SOUND_MODE_PLAY);
for (i = 0; i < 4; ++i)
@@ -952,7 +952,7 @@
{
if (npc->flag & 0xFF)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@@ -971,7 +971,7 @@
if (++npc->count1 > 300)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
@@ -1734,7 +1734,7 @@
{
if (npc->flag & 0xFF)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@@ -1754,7 +1754,7 @@
if (++npc->count1 > 300)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
@@ -1956,7 +1956,7 @@
if (++npc->ani_wait > 2)
{
npc->ani_wait = 0;
- SetCaret(npc->x, npc->y, 7, 4);
+ SetCaret(npc->x, npc->y, CARET_EXHAUST, DIR_AUTO);
}
npc->ani_no = (npc->count1 + 0x10) / 0x20;
--- a/src/NpcAct160.cpp
+++ b/src/NpcAct160.cpp
@@ -896,7 +896,7 @@
npc->xm -= 0x20;
if (npc->count1 % 3 == 1)
- SetCaret(npc->x + (8 * 0x200), npc->y, 7, 2);
+ SetCaret(npc->x + (8 * 0x200), npc->y, CARET_EXHAUST, DIR_RIGHT);
}
else
{
@@ -903,7 +903,7 @@
npc->xm += 0x20;
if (npc->count1 % 3 == 1)
- SetCaret(npc->x - (8 * 0x200), npc->y, 7, 0);
+ SetCaret(npc->x - (8 * 0x200), npc->y, CARET_EXHAUST, DIR_LEFT);
}
if (npc->count1 < 50)
@@ -1056,7 +1056,7 @@
if (npc->flag & 1 || npc->flag & 4)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
VanishNpChar(npc);
return;
}
@@ -1294,7 +1294,7 @@
{
if (++npc->count1 > 1)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
}
@@ -1474,7 +1474,7 @@
if (npc->flag & 0xFF)
{
- SetCaret(npc->x, npc->y, 3, 0);
+ SetCaret(npc->x, npc->y, CARET_SHOOT, DIR_LEFT);
npc->cond = 0;
return;
}
@@ -1521,7 +1521,7 @@
if (++npc->act_wait > 300)
{
- SetCaret(npc->x, npc->y, 3, 0);
+ SetCaret(npc->x, npc->y, CARET_SHOOT, DIR_LEFT);
npc->cond = 0;
return;
}
@@ -1564,7 +1564,7 @@
{
if (npc->flag & 0xFF)
{
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
npc->cond = 0;
}
@@ -1599,7 +1599,7 @@
if (++npc->count1 > 150)
{
VanishNpChar(npc);
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}
@@ -1609,7 +1609,7 @@
if (npc->flag & 0xFF)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->xm -= 0x20;
@@ -1641,6 +1641,6 @@
if (++npc->count1 > 300)
{
VanishNpChar(npc);
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}
--- a/src/NpcAct180.cpp
+++ b/src/NpcAct180.cpp
@@ -7,6 +7,7 @@
#include "Back.h"
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Flags.h"
#include "Frame.h"
#include "Game.h"
@@ -386,12 +387,12 @@
if (npc->direct == 0)
{
SetBullet(12, npc->x - (4 * 0x200), npc->y + (3 * 0x200), 0);
- SetCaret(npc->x - (4 * 0x200), npc->y + (3 * 0x200), 3, 0);
+ SetCaret(npc->x - (4 * 0x200), npc->y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(12, npc->x + (4 * 0x200), npc->y + (3 * 0x200), 2);
- SetCaret(npc->x + (4 * 0x200), npc->y + (3 * 0x200), 3, 0);
+ SetCaret(npc->x + (4 * 0x200), npc->y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -399,12 +400,12 @@
if (npc->direct == 0)
{
SetBullet(12, npc->x - (2 * 0x200), npc->y - (4 * 0x200), 1);
- SetCaret(npc->x - (2 * 0x200), npc->y - (4 * 0x200), 3, 0);
+ SetCaret(npc->x - (2 * 0x200), npc->y - (4 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(12, npc->x + (2 * 0x200), npc->y - (4 * 0x200), 1);
- SetCaret(npc->x + (2 * 0x200), npc->y - (4 * 0x200), 3, 0);
+ SetCaret(npc->x + (2 * 0x200), npc->y - (4 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
}
@@ -493,12 +494,12 @@
if (npc->direct == 0)
{
SetBullet(6, npc->x - (4 * 0x200), npc->y + (3 * 0x200), 0);
- SetCaret(npc->x - (4 * 0x200), npc->y + (3 * 0x200), 3, 0);
+ SetCaret(npc->x - (4 * 0x200), npc->y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(6, npc->x + (4 * 0x200), npc->y + (3 * 0x200), 2);
- SetCaret(npc->x + (4 * 0x200), npc->y + (3 * 0x200), 3, 0);
+ SetCaret(npc->x + (4 * 0x200), npc->y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -506,12 +507,12 @@
if (npc->direct == 0)
{
SetBullet(6, npc->x - (2 * 0x200), npc->y - (4 * 0x200), 1);
- SetCaret(npc->x - (2 * 0x200), npc->y - (4 * 0x200), 3, 0);
+ SetCaret(npc->x - (2 * 0x200), npc->y - (4 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(6, npc->x + (2 * 0x200), npc->y - (4 * 0x200), 1);
- SetCaret(npc->x + (2 * 0x200), npc->y - (4 * 0x200), 3, 0);
+ SetCaret(npc->x + (2 * 0x200), npc->y - (4 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
}
@@ -1184,9 +1185,9 @@
PlaySoundObject(34, SOUND_MODE_PLAY);
if (npc->direct == 0)
- SetCaret(npc->x + (10 * 0x200), npc->y + (10 * 0x200), 7, 2);
+ SetCaret(npc->x + (10 * 0x200), npc->y + (10 * 0x200), CARET_EXHAUST, DIR_RIGHT);
else
- SetCaret(npc->x - (10 * 0x200), npc->y + (10 * 0x200), 7, 0);
+ SetCaret(npc->x - (10 * 0x200), npc->y + (10 * 0x200), CARET_EXHAUST, DIR_LEFT);
}
RECT rcLeft[2] = {
--- a/src/NpcAct200.cpp
+++ b/src/NpcAct200.cpp
@@ -6,6 +6,7 @@
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "MyChar.h"
@@ -163,7 +164,7 @@
if (npc->flag & 0xFF)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->y += npc->ym;
@@ -189,7 +190,7 @@
if (++npc->count1 > 300)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}
@@ -750,7 +751,7 @@
if (npc->flag & 0xFF)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->y += npc->ym;
@@ -777,7 +778,7 @@
if (++npc->count1 > 300)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}
--- a/src/NpcAct220.cpp
+++ b/src/NpcAct220.cpp
@@ -5,6 +5,7 @@
#include "WindowsWrapper.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Game.h"
#include "MyChar.h"
#include "NpChar.h"
@@ -617,9 +618,9 @@
++npc->act_wait;
if (npc->act_wait % 2 == 0)
- SetCaret(npc->x - (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
+ SetCaret(npc->x - (10 * 0x200), npc->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
if (npc->act_wait % 2 == 1)
- SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
+ SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
if (npc->act_wait % 4 == 1)
PlaySoundObject(34, SOUND_MODE_PLAY);
@@ -647,10 +648,10 @@
if (npc->ym < 0)
{
if (npc->act_wait % 8 == 0)
- SetCaret(npc->x - (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
+ SetCaret(npc->x - (10 * 0x200), npc->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
if (npc->act_wait % 8 == 4)
- SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), 7, 3);
+ SetCaret(npc->x + (10 * 0x200), npc->y + (8 * 0x200), CARET_EXHAUST, DIR_DOWN);
if (npc->act_wait % 16 == 1)
PlaySoundObject(34, SOUND_MODE_PLAY);
@@ -1153,7 +1154,7 @@
if (bHit)
{
for (i = 0; i < 5; ++i)
- SetCaret(npc->x, npc->y, 1, 0);
+ SetCaret(npc->x, npc->y, CARET_BUBBLE, DIR_LEFT);
PlaySoundObject(21, SOUND_MODE_PLAY);
npc->cond = 0;
--- a/src/NpcAct240.cpp
+++ b/src/NpcAct240.cpp
@@ -5,6 +5,7 @@
#include "WindowsWrapper.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "Map.h"
@@ -338,7 +339,7 @@
if (bHit)
{
for (i = 0; i < 3; ++i)
- SetCaret(npc->x, npc->y + (4 * 0x200), 1, 2);
+ SetCaret(npc->x, npc->y + (4 * 0x200), CARET_BUBBLE, DIR_RIGHT);
if (npc->x > gMC.x - (256 * 0x200) && npc->x < gMC.x + (256 * 0x200) && npc->y > gMC.y - (160 * 0x200) && npc->y < gMC.y + (160 * 0x200))
PlaySoundObject(21, SOUND_MODE_PLAY);
@@ -831,7 +832,7 @@
if (npc->flag & 0xFF)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
npc->y += npc->ym;
@@ -856,7 +857,7 @@
if (++npc->count1 > 300)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
}
--- a/src/NpcAct260.cpp
+++ b/src/NpcAct260.cpp
@@ -5,6 +5,7 @@
#include "WindowsWrapper.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "Map.h"
@@ -1527,15 +1528,15 @@
if (npc->ym < 0 && npc->y - npc->hit.top < 8 * 0x200)
{
npc->ym *= -1;
- SetCaret(npc->x, npc->y - (8 * 0x200), 13, 0);
- SetCaret(npc->x, npc->y - (8 * 0x200), 13, 0);
+ SetCaret(npc->x, npc->y - (8 * 0x200), CARET_TINY_PARTICLES, DIR_LEFT);
+ SetCaret(npc->x, npc->y - (8 * 0x200), CARET_TINY_PARTICLES, DIR_LEFT);
}
if (npc->ym > 0 && npc->y + npc->hit.bottom > 232 * 0x200)
{
npc->ym *= -1;
- SetCaret(npc->x, npc->y + (8 * 0x200), 13, 0);
- SetCaret(npc->x, npc->y + (8 * 0x200), 13, 0);
+ SetCaret(npc->x, npc->y + (8 * 0x200), CARET_TINY_PARTICLES, DIR_LEFT);
+ SetCaret(npc->x, npc->y + (8 * 0x200), CARET_TINY_PARTICLES, DIR_LEFT);
}
npc->x += npc->xm;
--- a/src/NpcAct300.cpp
+++ b/src/NpcAct300.cpp
@@ -7,6 +7,7 @@
#include "Boss.h"
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "Map.h"
@@ -27,7 +28,7 @@
}
if (++npc->ani_wait % 8 == 1)
- SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + (8 * 0x200), 13, 1);
+ SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + (8 * 0x200), CARET_TINY_PARTICLES, DIR_UP);
npc->rect = rc;
}
@@ -89,7 +90,7 @@
if (++npc->ani_wait > 2)
{
npc->ani_wait = 0;
- SetCaret(npc->x, npc->y, 7, 4);
+ SetCaret(npc->x, npc->y, CARET_EXHAUST, DIR_AUTO);
}
npc->ani_no = (npc->count1 + 0x10) / 0x20;
--- a/src/NpcAct320.cpp
+++ b/src/NpcAct320.cpp
@@ -6,6 +6,7 @@
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Frame.h"
#include "Game.h"
#include "KeyControl.h"
@@ -167,7 +168,7 @@
if (g_GameFlags & 2 && CountBulletNum(43) < 2 && gKeyTrg & gKeyShot)
{
SetBullet(43, npc->pNpc->x, npc->pNpc->y, direct);
- SetCaret(npc->pNpc->x, npc->pNpc->y, 3, 0);
+ SetCaret(npc->pNpc->x, npc->pNpc->y, CARET_SHOOT, DIR_LEFT);
PlaySoundObject(117, SOUND_MODE_PLAY);
}
@@ -767,7 +768,7 @@
if (npc->flag & 8)
{
npc->cond = 0;
- SetCaret(npc->x, npc->y, 2, 0);
+ SetCaret(npc->x, npc->y, CARET_PROJECTILE_DISSIPATION, DIR_LEFT);
}
break;
--- a/src/NpcAct340.cpp
+++ b/src/NpcAct340.cpp
@@ -1917,7 +1917,7 @@
}
if (npc->act_wait % 8 == 1)
- SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + 0x1000, 13, 1);
+ SetCaret(npc->x + (Random(-8, 8) * 0x200), npc->y + 0x1000, CARET_TINY_PARTICLES, DIR_UP);
}
// Misery (stood in the wind during the credits)
--- a/src/NpcHit.cpp
+++ b/src/NpcHit.cpp
@@ -5,6 +5,7 @@
#include "Back.h"
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "Flags.h"
#include "Game.h"
#include "Map.h"
@@ -591,9 +592,9 @@
{
if (gNPC[n].shock < 14)
{
- SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
- SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
- SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 11, 0);
+ SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, CARET_HURT_PARTICLES, DIR_LEFT);
+ SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, CARET_HURT_PARTICLES, DIR_LEFT);
+ SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, CARET_HURT_PARTICLES, DIR_LEFT);
PlaySoundObject(gNPC[n].hit_voice, SOUND_MODE_PLAY);
gNPC[n].shock = 16;
}
@@ -614,7 +615,7 @@
else if (!(gBul[b].bbits & 0x10))
{
// Hit invulnerable NPC
- SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, 2, 2);
+ SetCaret((gBul[b].x + gNPC[n].x) / 2, (gBul[b].y + gNPC[n].y) / 2, CARET_PROJECTILE_DISSIPATION, DIR_RIGHT);
PlaySoundObject(31, SOUND_MODE_PLAY);
gBul[b].life = 0;
continue;
--- a/src/PixTone.cpp
+++ b/src/PixTone.cpp
@@ -157,12 +157,12 @@
+ 128;
if (gWaveModelTable[ptp->oPitch.model][b] < 0)
- dMain = d1 - d1 * 0.5 * -gWaveModelTable[ptp->oPitch.model][b] * ptp->oPitch.top / 64.0 / 64.0 + dMain;
+ dMain += d1 - d1 * 0.5 * -gWaveModelTable[ptp->oPitch.model][b] * ptp->oPitch.top / 64.0 / 64.0;
else
- dMain = d1 + d1 * 2.0 * gWaveModelTable[ptp->oPitch.model][b] * ptp->oPitch.top / 64.0 / 64.0 + dMain;
+ dMain += d1 + d1 * 2.0 * gWaveModelTable[ptp->oPitch.model][b] * ptp->oPitch.top / 64.0 / 64.0;
- dPitch = dPitch + d2;
- dVolume = dVolume + d3;
+ dPitch += d2;
+ dVolume += d3;
}
return TRUE;
--- a/src/Profile.cpp
+++ b/src/Profile.cpp
@@ -42,7 +42,7 @@
BOOL SaveProfile(const char *name)
{
FILE *fp;
- PROFILE profile;
+ PROFILEDATA profile;
const char *FLAG = "FLAG";
std::string path;
@@ -59,7 +59,7 @@
return FALSE;
// Set up profile
- memset(&profile, 0, sizeof(PROFILE));
+ memset(&profile, 0, sizeof(PROFILEDATA));
memcpy(profile.code, gProfileCode, sizeof(profile.code));
memcpy(profile.FLAG, FLAG, sizeof(profile.FLAG));
profile.stage = gStageNo;
@@ -123,7 +123,7 @@
BOOL LoadProfile(const char *name)
{
FILE *fp;
- PROFILE profile;
+ PROFILEDATA profile;
std::string path;
// Get path
@@ -149,7 +149,7 @@
// Read data
fseek(fp, 0, SEEK_SET);
- memset(&profile, 0, sizeof(PROFILE));
+ memset(&profile, 0, sizeof(PROFILEDATA));
fread(profile.code, 8, 1, fp);
profile.stage = File_ReadLE32(fp);
profile.music = (MusicID)File_ReadLE32(fp);
--- a/src/Profile.h
+++ b/src/Profile.h
@@ -6,7 +6,7 @@
#include "SelStage.h"
#include "Stage.h"
-typedef struct PROFILE
+typedef struct PROFILEDATA
{
char code[8];
int stage;
@@ -29,7 +29,7 @@
signed char permit_mapping[0x80];
char FLAG[4];
unsigned char flags[1000];
-} PROFILE;
+} PROFILEDATA;
extern const char* const gDefaultName;
extern const char* const gProfileCode;
--- a/src/Shoot.cpp
+++ b/src/Shoot.cpp
@@ -5,6 +5,7 @@
#include "ArmsItem.h"
#include "Bullet.h"
#include "Caret.h"
+#include "CommonDefines.h"
#include "KeyControl.h"
#include "MyChar.h"
#include "MycParam.h"
@@ -47,12 +48,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y - (10 * 0x200), 1);
- SetCaret(gMC.x - (3 * 0x200), gMC.y - (10 * 0x200), 3, 0);
+ SetCaret(gMC.x - (3 * 0x200), gMC.y - (10 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y - (10 * 0x200), 1);
- SetCaret(gMC.x + (3 * 0x200), gMC.y - (10 * 0x200), 3, 0);
+ SetCaret(gMC.x + (3 * 0x200), gMC.y - (10 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -60,12 +61,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y + (10 * 0x200), 3);
- SetCaret(gMC.x - (3 * 0x200), gMC.y + (10 * 0x200), 3, 0);
+ SetCaret(gMC.x - (3 * 0x200), gMC.y + (10 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y + (10 * 0x200), 3);
- SetCaret(gMC.x + (3 * 0x200), gMC.y + (10 * 0x200), 3, 0);
+ SetCaret(gMC.x + (3 * 0x200), gMC.y + (10 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -73,12 +74,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (2 * 0x200), 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y + (2 * 0x200), 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (2 * 0x200), 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y + (2 * 0x200), 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@@ -122,12 +123,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -135,12 +136,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -148,12 +149,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (3 * 0x200), 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (3 * 0x200), 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@@ -206,12 +207,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (4 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x - (4 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (4 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (4 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x + (4 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (4 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -219,12 +220,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (4 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x - (4 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (4 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (4 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x + (4 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (4 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -232,12 +233,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (2 * 0x200), 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y + (2 * 0x200), 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (2 * 0x200), 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y + (2 * 0x200), 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@@ -285,7 +286,7 @@
if (empty == 0)
{
- SetCaret(gMC.x, gMC.y, 16, 0);
+ SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@@ -300,12 +301,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x - (3 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (3 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x + (3 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (3 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -326,12 +327,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x - (3 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (3 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x + (3 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (3 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -339,12 +340,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@@ -486,7 +487,7 @@
if (empty == 0)
{
- SetCaret(gMC.x, gMC.y, 16, 0);
+ SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@@ -498,12 +499,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -511,12 +512,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -524,12 +525,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y, 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y, 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y, CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y, 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y, 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y, CARET_SHOOT, DIR_LEFT);
}
}
}
@@ -541,7 +542,7 @@
if (empty == 0)
{
- SetCaret(gMC.x, gMC.y, 16, 0);
+ SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@@ -553,7 +554,7 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y, 1);
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y, 1);
}
@@ -560,7 +561,7 @@
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y, 1);
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y, 1);
}
@@ -570,7 +571,7 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y, 3);
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y, 3);
}
@@ -577,7 +578,7 @@
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x - (3 * 0x200), gMC.y, 3);
SetBullet(bul_no, gMC.x + (3 * 0x200), gMC.y, 3);
}
@@ -587,7 +588,7 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (1 * 0x200), 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y + (1 * 0x200), 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y + (1 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x, gMC.y - (8 * 0x200), 0);
SetBullet(bul_no, gMC.x + (4 * 0x200), gMC.y - (1 * 0x200), 0);
}
@@ -594,7 +595,7 @@
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (1 * 0x200), 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y + (1 * 0x200), 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y + (1 * 0x200), CARET_SHOOT, DIR_LEFT);
SetBullet(bul_no, gMC.x, gMC.y - (8 * 0x200), 2);
SetBullet(bul_no, gMC.x - (4 * 0x200), gMC.y - (1 * 0x200), 2);
}
@@ -620,7 +621,7 @@
if (empty == 0)
{
- SetCaret(gMC.x, gMC.y, 16, 0);
+ SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@@ -632,12 +633,12 @@
if (gMC.direct == 0)
{
SetBullet(19, gMC.x - (1 * 0x200), gMC.y - (2 * 0x200), 1);
- SetCaret(gMC.x - (1 * 0x200), gMC.y - (2 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y - (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(19, gMC.x + (1 * 0x200), gMC.y - (2 * 0x200), 1);
- SetCaret(gMC.x + (1 * 0x200), gMC.y - (2 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y - (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -645,12 +646,12 @@
if (gMC.direct == 0)
{
SetBullet(19, gMC.x - (1 * 0x200), gMC.y + (2 * 0x200), 3);
- SetCaret(gMC.x - (1 * 0x200), gMC.y + (2 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(19, gMC.x + (1 * 0x200), gMC.y + (2 * 0x200), 3);
- SetCaret(gMC.x + (1 * 0x200), gMC.y + (2 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y + (2 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -658,12 +659,12 @@
if (gMC.direct == 0)
{
SetBullet(19, gMC.x - (6 * 0x200), gMC.y + (3 * 0x200), 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(19, gMC.x + (6 * 0x200), gMC.y + (3 * 0x200), 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@@ -701,7 +702,7 @@
if (empty == 0)
{
- SetCaret(gMC.x, gMC.y, 16, 0);
+ SetCaret(gMC.x, gMC.y, CARET_EMPTY, DIR_LEFT);
empty = 50;
}
@@ -713,12 +714,12 @@
if (gMC.direct == 0)
{
SetBullet(level, gMC.x - (3 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x - (3 * 0x200), gMC.y - (16 * 0x200), 3, 0);
+ SetCaret(gMC.x - (3 * 0x200), gMC.y - (16 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(level, gMC.x + (3 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x + (3 * 0x200), gMC.y - (16 * 0x200), 3, 0);
+ SetCaret(gMC.x + (3 * 0x200), gMC.y - (16 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -726,12 +727,12 @@
if (gMC.direct == 0)
{
SetBullet(level, gMC.x - (3 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x - (3 * 0x200), gMC.y + (16 * 0x200), 3, 0);
+ SetCaret(gMC.x - (3 * 0x200), gMC.y + (16 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(level, gMC.x + (3 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x + (3 * 0x200), gMC.y + (16 * 0x200), 3, 0);
+ SetCaret(gMC.x + (3 * 0x200), gMC.y + (16 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -739,12 +740,12 @@
if (gMC.direct == 0)
{
SetBullet(level, gMC.x - (6 * 0x200), gMC.y + (3 * 0x200), 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(level, gMC.x + (6 * 0x200), gMC.y + (3 * 0x200), 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@@ -842,12 +843,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (12 * 0x200), 1);
- SetCaret(gMC.x - (1 * 0x200), gMC.y - (12 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y - (12 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (12 * 0x200), 1);
- SetCaret(gMC.x + (1 * 0x200), gMC.y - (12 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y - (12 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -855,12 +856,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (12 * 0x200), 3);
- SetCaret(gMC.x - (1 * 0x200), gMC.y + (12 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y + (12 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (12 * 0x200), 3);
- SetCaret(gMC.x + (1 * 0x200), gMC.y + (12 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y + (12 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -868,12 +869,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (22 * 0x200), gMC.y + (3 * 0x200), 0);
- SetCaret(gMC.x - (16 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x - (16 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (22 * 0x200), gMC.y + (3 * 0x200), 2);
- SetCaret(gMC.x + (16 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x + (16 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
@@ -1000,12 +1001,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 1);
- SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y - (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else if (gMC.down)
@@ -1013,12 +1014,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x - (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3);
- SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), 3, 0);
+ SetCaret(gMC.x + (1 * 0x200), gMC.y + (8 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
else
@@ -1026,12 +1027,12 @@
if (gMC.direct == 0)
{
SetBullet(bul_no, gMC.x - (6 * 0x200), gMC.y + (3 * 0x200), 0);
- SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x - (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
else
{
SetBullet(bul_no, gMC.x + (6 * 0x200), gMC.y + (3 * 0x200), 2);
- SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), 3, 0);
+ SetCaret(gMC.x + (12 * 0x200), gMC.y + (3 * 0x200), CARET_SHOOT, DIR_LEFT);
}
}
--- a/src/Sound.h
+++ b/src/Sound.h
@@ -18,7 +18,7 @@
SND_SILLY_EXPLOSION = 25,
SND_LARGE_OBJECT_HIT_GROUND = 26,
// To be continued
- SND_ENEMY_SHOOT_PROJETILE = 39,
+ SND_ENEMY_SHOOT_PROJECTILE = 39,
// To be continued
SND_BEHEMOTH_LARGE_HURT = 52,
// To be continued