projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved gravity compatibility settings to gravity switch properties page
[rocksndiamonds.git]
/
src
/
game_sp
/
Zonk.c
diff --git
a/src/game_sp/Zonk.c
b/src/game_sp/Zonk.c
index 0c00be8e0e6bed064d3f778f2cb3a96359bd6f46..785b9c49310497932112f0a0fbe340f4f3f98036 100644
(file)
--- a/
src/game_sp/Zonk.c
+++ b/
src/game_sp/Zonk.c
@@
-4,6
+4,10
@@
#include "Zonk.h"
#include "Zonk.h"
+
+void subCleanUpForZonksAbove(int si);
+
+
// static char *VB_Name = "modZonk";
// --- Option Explicit
// static char *VB_Name = "modZonk";
// --- Option Explicit
@@
-12,10
+16,8
@@
// Animate Zonks (falling)
// ==========================================================================
// Animate Zonks (falling)
// ==========================================================================
-
int
subAnimateZonks(int si)
+
void
subAnimateZonks(int si)
{
{
- int subAnimateZonks;
-
int tFld;
// PseudoRegisters:
int tFld;
// PseudoRegisters:
@@
-26,12
+28,12
@@
int subAnimateZonks(int si)
tFld = PlayField16[si];
if ((tFld & 0xFF) != fiZonk)
tFld = PlayField16[si];
if ((tFld & 0xFF) != fiZonk)
- return
subAnimateZonks
;
+ return;
if (tFld == fiZonk)
{
if (FreezeZonks == 2) // Do Zonks fall? (debug)
if (tFld == fiZonk)
{
if (FreezeZonks == 2) // Do Zonks fall? (debug)
- return
subAnimateZonks
;
+ return;
ax = PlayField16[si + FieldWidth]; // select case playfield16(si+60)
if (ax == 0)
ax = PlayField16[si + FieldWidth]; // select case playfield16(si+60)
if (ax == 0)
@@
-46,7
+48,7
@@
int subAnimateZonks(int si)
if (ax == fiRAM)
goto loc_g_0D35;
if (ax == fiRAM)
goto loc_g_0D35;
- return
subAnimateZonks
;
+ return;
loc_g_0D35: // Case fiZonk, fiInfotron, fiRAM
ax = PlayField16[si + FieldWidth - 1];
loc_g_0D35: // Case fiZonk, fiInfotron, fiRAM
ax = PlayField16[si + FieldWidth - 1];
@@
-58,7
+60,7
@@
loc_g_0D4C:
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA)
goto loc_g_0D81;
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA)
goto loc_g_0D81;
- return
subAnimateZonks
;
+ return;
loc_g_0D64: // Case fiSpace
MovHighByte(&PlayField16[si], 0x40);
loc_g_0D64: // Case fiSpace
MovHighByte(&PlayField16[si], 0x40);
@@
-80,10
+82,10
@@
loc_g_0D81: // roll right?
goto loc_g_0D98;
if (PlayField16[si + 1] != 0x9999) // wow right is different from left!
goto loc_g_0D98;
if (PlayField16[si + 1] != 0x9999) // wow right is different from left!
- return
subAnimateZonks
;
+ return;
if (LowByte(PlayField16[si - FieldWidth + 1]) != 1)
if (LowByte(PlayField16[si - FieldWidth + 1]) != 1)
- return
subAnimateZonks
;
+ return;
loc_g_0D98:
MovHighByte(&PlayField16[si], 0x60);
loc_g_0D98:
MovHighByte(&PlayField16[si], 0x60);
@@
-108,7
+110,7
@@
loc_g_0DA5:
goto loc_g_0FE8;
if (FreezeZonks == 2)
goto loc_g_0FE8;
if (FreezeZonks == 2)
- return
subAnimateZonks
;
+ return;
if (al == 0x40) // zonk falls straight down
goto loc_g_104D;
if (al == 0x40) // zonk falls straight down
goto loc_g_104D;
@@
-122,7
+124,7
@@
loc_g_0DA5:
if (al == 0x70) // intermediate state
goto loc_g_1157;
if (al == 0x70) // intermediate state
goto loc_g_1157;
- return
subAnimateZonks
;
+ return;
loc_g_0DE8: // zonk comes falling from above
// To Do: draw zonk falling from above
loc_g_0DE8: // zonk comes falling from above
// To Do: draw zonk falling from above
@@
-131,26
+133,27
@@
loc_g_0DE8: // zonk comes falling from above
X = GetStretchX(si);
Y = GetStretchY(si - FieldWidth);
dx = bl & 0x7;
X = GetStretchX(si);
Y = GetStretchY(si - FieldWidth);
dx = bl & 0x7;
-
StretchedSprites.BltEx(X, Y
, 0);
-
StretchedSprites.BltEx(X, Y + TwoPixels * (dx + 1), fiZonk
);
+
DDSpriteBuffer_BltImg(X, Y, aniSpace
, 0);
+
DDSpriteBuffer_BltImg(X, Y + TwoPixels * (dx + 1), aniZonk, dx
);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl == 0x16)
{
MovHighByte(&PlayField16[si], bl);
subCleanUpForZonksAbove(si - FieldWidth);
bl = HighByte(PlayField16[si]) + 1;
if (bl == 0x16)
{
MovHighByte(&PlayField16[si], bl);
subCleanUpForZonksAbove(si - FieldWidth);
- return
subAnimateZonks
;
+ return;
} // loc_g_0E2B:
if (bl < 0x18)
{
MovHighByte(&PlayField16[si], bl);
} // loc_g_0E2B:
if (bl < 0x18)
{
MovHighByte(&PlayField16[si], bl);
- return
subAnimateZonks
;
+ return;
} // loc_g_0E35:
MovHighByte(&PlayField16[si], 0); // zonk arrived at the field
if ((FreezeZonks & 0xFF) == 2)
} // loc_g_0E35:
MovHighByte(&PlayField16[si], 0); // zonk arrived at the field
if ((FreezeZonks & 0xFF) == 2)
- return
subAnimateZonks
;
+ return;
// loc_g_0E42: // now check if the zonk may go on falling somehow
ax = PlayField16[si + FieldWidth];
// loc_g_0E42: // now check if the zonk may go on falling somehow
ax = PlayField16[si + FieldWidth];
@@
-178,10
+181,11
@@
loc_g_0DE8: // zonk comes falling from above
if (ax == fiOrangeDisk) // OrangeDisk explodes 'loc_g_0E95:
goto loc_g_0F75;
if (ax == fiOrangeDisk) // OrangeDisk explodes 'loc_g_0E95:
goto loc_g_0F75;
- subSoundFXZonk(); // play the zonk sound,'cause zonk hits something "hard"
+ // play the zonk sound, 'cause zonk hits something "hard"
+ subSoundFX(si, fiZonk, actImpact);
if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
- return
subAnimateZonks
;
+ return;
// loc_g_0EAE: ' Zonk rolls somewhere
ax = PlayField16[si + FieldWidth - 1];
// loc_g_0EAE: ' Zonk rolls somewhere
ax = PlayField16[si + FieldWidth - 1];
@@
-192,12
+196,12
@@
loc_g_0DE8: // zonk comes falling from above
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) // may roll right
goto loc_g_0F00;
if (ax == 0 || ax == 0x8888 || ax == 0xAAAA) // may roll right
goto loc_g_0F00;
- return
subAnimateZonks
;
+ return;
loc_g_0EDD: // go on falling down?
PlayField16[si] = 0x7001; // go into intermediate waitstate
PlayField16[si + FieldWidth] = 0x9999; // mark as "zonk waiting to access"
loc_g_0EDD: // go on falling down?
PlayField16[si] = 0x7001; // go into intermediate waitstate
PlayField16[si + FieldWidth] = 0x9999; // mark as "zonk waiting to access"
- return
subAnimateZonks
;
+ return;
loc_g_0EEA: // test if zonk may roll left
// This if(if true) jumps up far above
loc_g_0EEA: // test if zonk may roll left
// This if(if true) jumps up far above
@@
-206,24
+210,24
@@
loc_g_0EEA: // test if zonk may roll left
goto loc_g_0D4C;
MovHighByte(&PlayField16[si], 0x50); // zonk rolls left
goto loc_g_0D4C;
MovHighByte(&PlayField16[si], 0x50); // zonk rolls left
-
Mov(&PlayField16[si - 1], 0x8888)
; // mark as zonk accessing?
- return
subAnimateZonks
;
+
PlayField16[si - 1] = 0x8888
; // mark as zonk accessing?
+ return;
loc_g_0F00: // test if zonk may roll right
if (PlayField16[si + 1] != 0) // loc_g_0F08:
loc_g_0F00: // test if zonk may roll right
if (PlayField16[si + 1] != 0) // loc_g_0F08:
- return
subAnimateZonks
;
+ return;
MovHighByte(&PlayField16[si], 0x60); // zonk rolls right
MovHighByte(&PlayField16[si], 0x60); // zonk rolls right
-
Mov(&PlayField16[si + 1], 0x8888)
; // mark as zonk accessing?
- return
subAnimateZonks
;
+
PlayField16[si + 1] = 0x8888
; // mark as zonk accessing?
+ return;
loc_g_0F14: // Murphy dies, but not in any case
bl = HighByte(PlayField16[si + FieldWidth]);
if (bl == 0xE || bl == 0xF || bl == 0x28)
loc_g_0F14: // Murphy dies, but not in any case
bl = HighByte(PlayField16[si + FieldWidth]);
if (bl == 0xE || bl == 0xF || bl == 0x28)
- return
subAnimateZonks
;
+ return;
if (bl == 0x29 || bl == 0x25 || bl == 0x26)
if (bl == 0x29 || bl == 0x25 || bl == 0x26)
- return
subAnimateZonks
;
+ return;
loc_g_0F36: // ??
ax = LowByte(PlayField16[si + FieldWidth - 1]);
loc_g_0F36: // ??
ax = LowByte(PlayField16[si + FieldWidth - 1]);
@@
-248,12
+252,12
@@
loc_g_0F52: // ??
loc_g_0F6E: // someone dies/explodes
si = si + FieldWidth; // 1 field down
ExplodeFieldSP(si); // Explode
loc_g_0F6E: // someone dies/explodes
si = si + FieldWidth; // 1 field down
ExplodeFieldSP(si); // Explode
- return
subAnimateZonks
;
+ return;
loc_g_0F75: // OrangeDisk explodes next cycle
si = si + FieldWidth; // 1 field down
PlayField8[si] = fiHardWare;
loc_g_0F75: // OrangeDisk explodes next cycle
si = si + FieldWidth; // 1 field down
PlayField8[si] = fiHardWare;
- return
subAnimateZonks
;
+ return;
loc_g_0F83: // zonk comes rolling from right to left
// To Do: draw zonk rolling from right
loc_g_0F83: // zonk comes rolling from right to left
// To Do: draw zonk rolling from right
@@
-262,9
+266,10
@@
loc_g_0F83: // zonk comes rolling from right to left
X = GetStretchX(si + 1);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
X = GetStretchX(si + 1);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
-
StretchedSprites.BltEx(X, Y
, 0);
-
StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesZonkRollLeft[dx - 1]
);
+
DDSpriteBuffer_BltImg(X, Y, aniSpace
, 0);
+
DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniZonkRollLeft, dx - 1
);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1; // get and increment sequence#
if (bl == 0x24)
PlayField16[si + 1] = 0xAAAA;
bl = HighByte(PlayField16[si]) + 1; // get and increment sequence#
if (bl == 0x24)
PlayField16[si + 1] = 0xAAAA;
@@
-285,7
+290,7
@@
loc_g_0F83: // zonk comes rolling from right to left
PlayField16[si] = 0x1001; // convert rolling zonk to a falling zonk
}
PlayField16[si] = 0x1001; // convert rolling zonk to a falling zonk
}
- return
subAnimateZonks
;
+ return;
loc_g_0FE8: // zonk comes rolling from left to right
// To Do: draw zonk rolling from left
loc_g_0FE8: // zonk comes rolling from left to right
// To Do: draw zonk rolling from left
@@
-294,9
+299,10
@@
loc_g_0FE8: // zonk comes rolling from left to right
X = GetStretchX(si - 1);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
X = GetStretchX(si - 1);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
-
StretchedSprites.BltEx(X, Y
, 0);
-
StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesZonkRollRight[dx - 1]
);
+
DDSpriteBuffer_BltImg(X, Y, aniSpace
, 0);
+
DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniZonkRollRight, dx - 1
);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl == 0x34)
PlayField16[si - 1] = 0xAAAA;
bl = HighByte(PlayField16[si]) + 1;
if (bl == 0x34)
PlayField16[si - 1] = 0xAAAA;
@@
-317,7
+323,7
@@
loc_g_0FE8: // zonk comes rolling from left to right
PlayField16[si] = 0x1001; // convert rolling zonk to a falling zonk
}
PlayField16[si] = 0x1001; // convert rolling zonk to a falling zonk
}
- return
subAnimateZonks
;
+ return;
loc_g_104D: // zonk falls straight down
bl = bl + 1;
loc_g_104D: // zonk falls straight down
bl = bl + 1;
@@
-337,7
+343,7
@@
loc_g_104D: // zonk falls straight down
PlayField16[si] = 0x1001; // go falling
}
PlayField16[si] = 0x1001; // go falling
}
- return
subAnimateZonks
;
+ return;
loc_g_107B: // zonk rolls left
// To Do: draw zonk rolling to left
loc_g_107B: // zonk rolls left
// To Do: draw zonk rolling to left
@@
-346,14
+352,15
@@
loc_g_107B: // zonk rolls left
X = GetStretchX(si);
Y = GetStretchY(si);
dx = (bl & 0xF) + 1;
X = GetStretchX(si);
Y = GetStretchY(si);
dx = (bl & 0xF) + 1;
-
StretchedSprites.BltEx(X, Y
, 0);
-
StretchedSprites.BltEx(X - (TwoPixels * dx), Y, aniFramesZonkRollLeft[dx - 1]
);
+
DDSpriteBuffer_BltImg(X, Y, aniSpace
, 0);
+
DDSpriteBuffer_BltImg(X - (TwoPixels * dx), Y, aniZonkRollLeft, dx - 1
);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1; // retrieve and increment sequence#
if (bl < 0x52)
{
MovHighByte(&PlayField16[si], bl);
bl = HighByte(PlayField16[si]) + 1; // retrieve and increment sequence#
if (bl < 0x52)
{
MovHighByte(&PlayField16[si], bl);
- return
subAnimateZonks
;
+ return;
}
if (PlayField16[si + FieldWidth - 1] != 0)
}
if (PlayField16[si + FieldWidth - 1] != 0)
@@
-369,12
+376,12
@@
loc_g_107B: // zonk rolls left
si = si - 1; // 1 field left
PlayField16[si] = 0x2201;
PlayField16[si + FieldWidth] = 0xFFFF;
si = si - 1; // 1 field left
PlayField16[si] = 0x2201;
PlayField16[si + FieldWidth] = 0xFFFF;
- return
subAnimateZonks
;
+ return;
loc_g_10E2: // stay waiting
bl = bl - 1;
MovHighByte(&PlayField16[si], bl);
loc_g_10E2: // stay waiting
bl = bl - 1;
MovHighByte(&PlayField16[si], bl);
- return
subAnimateZonks
;
+ return;
loc_g_10E9: // zonk rolls right
// To Do: draw zonk rolling to right
loc_g_10E9: // zonk rolls right
// To Do: draw zonk rolling to right
@@
-383,14
+390,15
@@
loc_g_10E9: // zonk rolls right
X = GetStretchX(si);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
X = GetStretchX(si);
Y = GetStretchY(si);
dx = (bl & 0x7) + 1;
-
StretchedSprites.BltEx(X, Y
, 0);
-
StretchedSprites.BltEx(X + (TwoPixels * dx), Y, aniFramesZonkRollRight[dx - 1]
);
+
DDSpriteBuffer_BltImg(X, Y, aniSpace
, 0);
+
DDSpriteBuffer_BltImg(X + (TwoPixels * dx), Y, aniZonkRollRight, dx - 1
);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++
+
bl = HighByte(PlayField16[si]) + 1;
if (bl < 0x62)
{
MovHighByte(&PlayField16[si], bl);
bl = HighByte(PlayField16[si]) + 1;
if (bl < 0x62)
{
MovHighByte(&PlayField16[si], bl);
- return
subAnimateZonks
;
+ return;
}
if (PlayField16[si + FieldWidth + 1] != 0)
}
if (PlayField16[si + FieldWidth + 1] != 0)
@@
-406,12
+414,12
@@
loc_g_10E9: // zonk rolls right
si = si + 1;
PlayField16[si] = 0x3201;
PlayField16[si + FieldWidth] = 0xFFFF;
si = si + 1;
PlayField16[si] = 0x3201;
PlayField16[si + FieldWidth] = 0xFFFF;
- return
subAnimateZonks
;
+ return;
loc_g_1150: // stay waiting
bl = bl - 1;
MovHighByte(&PlayField16[si], bl);
loc_g_1150: // stay waiting
bl = bl - 1;
MovHighByte(&PlayField16[si], bl);
- return
subAnimateZonks
;
+ return;
loc_g_1157: // intermediate state
ax = PlayField16[si + FieldWidth];
loc_g_1157: // intermediate state
ax = PlayField16[si + FieldWidth];
@@
-423,13
+431,11
@@
loc_g_1157: // intermediate state
goto loc_g_0DE8;
}
goto loc_g_0DE8;
}
- return
subAnimateZonks
;
+ return;
} // subAnimateZonks endp
} // subAnimateZonks endp
-
int
subCleanUpForZonksAbove(int si)
+
void
subCleanUpForZonksAbove(int si)
{
{
- int subCleanUpForZonksAbove;
-
int ax;
if (LowByte(PlayField16[si]) != fiExplosion)
int ax;
if (LowByte(PlayField16[si]) != fiExplosion)
@@
-438,16
+444,16
@@
int subCleanUpForZonksAbove(int si)
if (PlayField16[si - FieldWidth] != 0)
{
if (PlayField16[si - FieldWidth] != 0x9999)
if (PlayField16[si - FieldWidth] != 0)
{
if (PlayField16[si - FieldWidth] != 0x9999)
- return
subCleanUpForZonksAbove
;
+ return;
if (LowByte(PlayField16[si - 2 * FieldWidth]) != fiInfotron)
if (LowByte(PlayField16[si - 2 * FieldWidth]) != fiInfotron)
- return
subCleanUpForZonksAbove
;
+ return;
} // loc_g_1674:
if (PlayField16[si - FieldWidth - 1] != fiZonk)
{
if (PlayField16[si - FieldWidth + 1] != fiZonk)
} // loc_g_1674:
if (PlayField16[si - FieldWidth - 1] != fiZonk)
{
if (PlayField16[si - FieldWidth + 1] != fiZonk)
- return
subCleanUpForZonksAbove
;
+ return;
goto loc_g_16A7;
}
goto loc_g_16A7;
}
@@
-457,11
+463,11
@@
int subCleanUpForZonksAbove(int si)
{
PlayField16[si - FieldWidth - 1] = 0x6001;
PlayField16[si - FieldWidth] = 0x8888;
{
PlayField16[si - FieldWidth - 1] = 0x6001;
PlayField16[si - FieldWidth] = 0x8888;
- return
subCleanUpForZonksAbove
;
+ return;
}
if (PlayField16[si - FieldWidth + 1] != fiZonk)
}
if (PlayField16[si - FieldWidth + 1] != fiZonk)
- return
subCleanUpForZonksAbove
;
+ return;
loc_g_16A7:
ax = PlayField16[si + 1];
loc_g_16A7:
ax = PlayField16[si + 1];
@@
-471,6
+477,5
@@
loc_g_16A7:
PlayField16[si - FieldWidth] = 0x8888;
}
PlayField16[si - FieldWidth] = 0x8888;
}
- return
subCleanUpForZonksAbove
;
+ return;
} // subCleanUpForZonksAbove
} // subCleanUpForZonksAbove
-