Skip to content

Commit 1d20dd4

Browse files
committed
Import hode 0.2.9
1 parent a2f2773 commit 1d20dd4

39 files changed

+2116
-589
lines changed

CHANGES.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
* release 0.2.9
2+
- added PSP and Wii platforms specific code
3+
- added support for PC demo v1.0 data files
4+
- fixed screen state for 'fort' screens 16 and 17
5+
- fixed checkpoint for 'pwr1' screen 21
6+
- fixed PAF animation glitches with last frame
7+
18
* release 0.2.8
29
- added PSX background overlays (MDEC)
3-
- fixed crash playing paf animation #3 with Italian PC data files
10+
- fixed crash playing PAF animation #3 with Italian PC data files
411

512
* release 0.2.7
613
- added 'projection' submenu

README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
hode README
3-
Release version: 0.2.8
3+
Release version: 0.2.9
44
-------------------------------------------------------------------------------
55

66

RELEASES.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- fort_hod.lvl: 82456ed6e29780b5b8031a67ba3dddb8da813c19
88
- fort_hod.mst: ce55095902ade9f1d8a198f271d0946d6228b90d
99
- fort_hod.sss: 6ff572b553d93040c9cad74891db05b2cc8267c6
10+
- hod.dem: 5d40f812b6ed1385b7e502527911023f28136341
1011
- hod.paf: 6df823a778ed0df275217692fd814a7408b725cb
1112
- hodwin32.exe: 02ae85c179f175c5a42fadb22ba9edaf4f62be14
1213
securom: true
@@ -99,6 +100,7 @@
99100
- fort_hod.lvl: 82456ed6e29780b5b8031a67ba3dddb8da813c19
100101
- fort_hod.mst: ce55095902ade9f1d8a198f271d0946d6228b90d
101102
- fort_hod.sss: 6ff572b553d93040c9cad74891db05b2cc8267c6
103+
- hod.dem: 5d40f812b6ed1385b7e502527911023f28136341
102104
- hod.paf: fe75aff52c879aa5cc84a87babbca2ce0affec23
103105
- hodwin32.exe: eb0f032f343e2c27d60291c79ae667034a0c7389
104106
securom: false
@@ -137,6 +139,28 @@
137139
- rock_hod.mst: 5b49637348f6c6a2737a64cacf01f9bcef8e83f6
138140
- rock_hod.sss: 55c841f6c091c2ae68f0636c075c66405d00cc6a
139141
- setup.dat: 5cb36223a3fc5561d9c9d945fe3261cd188b5665
142+
- name: Heart of Darkness Demo V1.0 (Win32)
143+
files:
144+
- hod_demo.paf: c1b46680b9e8596d72f998fb2b56d723a28a06af
145+
- hodwin32.exe: c649d4365a2c9f6280bc4deb50a7c3ffb73baaad
146+
securom: false
147+
version_info:
148+
- Comments: Demo 1 level
149+
- CompanyName: Amazing Studio - 9 rue d' Enhgien - 75010 Paris FRANCE - Email: hod@amazingstudio.com
150+
- FileDescription: Heart Of Darkness
151+
- FileVersion: 0, 9, 8, 2
152+
- InternalName: Heart Of Darkness
153+
- LegalCopyright: (c) 1998 by Amazing Studio & Infogrames
154+
- LegalTrademarks: by Amazing Studio - All rights reserved
155+
- OriginalFilename: Heart Of Darkness
156+
- PrivateBuild: 0
157+
- ProductName: Heart Of Darkness - Windows 95 / 98 & NT - DirectX 3.x or greater
158+
- ProductVersion: 0, 9, 8, 2
159+
- SpecialBuild: VC5.0 Sp3
160+
- rock_hod.lvl: c514afa2137b434cdd8da0024c1e4f20bff1cdb7
161+
- rock_hod.mst: fa3fd22005a859abdae3b6d8b4f5ecb061a16e37
162+
- rock_hod.sss: 855d5b4b4fec7c8d8d64575d8a1ce5ee27d8e2d5
163+
- setup.dat: 56fd54d28074657b947e165134f044d9a91cef47
140164
- name: Heart of Darkness Demo V1.2 (Win32)
141165
files:
142166
- hod_demo.paf: 50a0942256b17ed26f3b0f59f4cf7570a6eb8688
@@ -223,6 +247,7 @@
223247
- dark_hod.mst: a97ac13edde17fd33cb06e9907139949c8b79cdb
224248
- fort_hod.lvl: e94a21bc4f779dba658ef5ab45f1ad15880913d8
225249
- fort_hod.mst: f7423c3d277650ac36378f09f59034cec28b6b34
250+
- hod.dem: ba5060778a9f5391a8fa9a4928473cf7797df15a
226251
- isld_hod.lvl: c0fbd02deea136d57b60bc8a7c3df69741491335
227252
- isld_hod.mst: 9ff92346444a66833eb2f8a1b3853ad788d1777b
228253
- lar1_hod.lvl: 575dde976affeedfa5f1637a34d5efdda3218778

defs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct SetupConfig {
6060
uint8_t difficulty;
6161
uint8_t stereo;
6262
uint8_t volume;
63-
uint8_t currentLevel;
63+
uint8_t lastLevelNum;
6464
} players[4]; // sizeof == 52
6565
uint8_t unkD0;
6666
uint8_t currentPlayer; // 0xD1
@@ -230,7 +230,6 @@ struct Sprite {
230230
const uint8_t *bitmapBits;
231231
Sprite *nextPtr;
232232
uint16_t num;
233-
uint16_t flags;
234233
uint16_t w, h;
235234
};
236235

fileio.cpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
#include "fileio.h"
88
#include "util.h"
99

10-
static const bool kCheckSectorFileCrc = true;
10+
static const bool kCheckSectorFileCrc = false;
11+
12+
#ifdef PSP
13+
static const bool kSeekAbsolutePosition = true;
14+
#else
15+
static const bool kSeekAbsolutePosition = false;
16+
#endif
1117

1218
File::File()
1319
: _fp(0) {
@@ -20,11 +26,15 @@ void File::setFp(FILE *fp) {
2026
_fp = fp;
2127
}
2228

23-
void File::seekAlign(int pos) {
29+
void File::seekAlign(uint32_t pos) {
2430
fseek(_fp, pos, SEEK_SET);
2531
}
2632

2733
void File::seek(int pos, int whence) {
34+
if (kSeekAbsolutePosition && whence == SEEK_CUR) {
35+
pos += ftell(_fp);
36+
whence = SEEK_SET;
37+
}
2838
fseek(_fp, pos, whence);
2939
}
3040

@@ -50,9 +60,6 @@ uint32_t File::readUint32() {
5060
return READ_LE_UINT32(buf);
5161
}
5262

53-
void File::flush() {
54-
}
55-
5663
SectorFile::SectorFile() {
5764
memset(_buf, 0, sizeof(_buf));
5865
_bufPos = 2044;
@@ -93,13 +100,14 @@ void SectorFile::refillBuffer(uint8_t *ptr) {
93100
}
94101
}
95102

96-
void SectorFile::seekAlign(int pos) {
103+
void SectorFile::seekAlign(uint32_t pos) {
97104
pos += (pos / 2048) * 4;
98-
const int alignPos = (pos / 2048) * 2048;
99-
fseek(_fp, alignPos, SEEK_SET);
100-
refillBuffer();
101-
const int skipCount = pos - alignPos;
102-
_bufPos += skipCount;
105+
const long alignPos = pos & ~2047;
106+
if (alignPos != (ftell(_fp) - 2048)) {
107+
fseek(_fp, alignPos, SEEK_SET);
108+
refillBuffer();
109+
}
110+
_bufPos = pos - alignPos;
103111
}
104112

105113
void SectorFile::seek(int pos, int whence) {
@@ -148,9 +156,3 @@ int SectorFile::read(uint8_t *ptr, int size) {
148156
}
149157
return 0;
150158
}
151-
152-
void SectorFile::flush() {
153-
const int currentPos = ftell(_fp);
154-
assert((currentPos & 2047) == 0);
155-
_bufPos = 2044;
156-
}

fileio.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ struct File {
1717

1818
void setFp(FILE *fp);
1919

20-
virtual void seekAlign(int pos);
20+
virtual void seekAlign(uint32_t pos);
2121
virtual void seek(int pos, int whence);
2222
virtual int read(uint8_t *ptr, int size);
2323
uint8_t readByte();
2424
uint16_t readUint16();
2525
uint32_t readUint32();
26-
virtual void flush();
2726

2827
void skipByte() { seek(1, SEEK_CUR); }
2928
void skipUint16() { seek(2, SEEK_CUR); }
@@ -42,10 +41,9 @@ struct SectorFile : File {
4241
SectorFile();
4342

4443
void refillBuffer(uint8_t *ptr = 0);
45-
virtual void seekAlign(int pos);
44+
virtual void seekAlign(uint32_t pos);
4645
virtual void seek(int pos, int whence);
4746
virtual int read(uint8_t *ptr, int size);
48-
virtual void flush();
4947
};
5048

5149
int fioAlignSizeTo2048(int size);

fs_posix.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "util.h"
99

1010
static const char *_suffixes[] = {
11+
"hod.dem",
1112
"setup.dat",
1213
"setup.dax",
1314
".paf",

0 commit comments

Comments
 (0)