Skip to content

Commit

Permalink
Merge 0.2.9 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
usineur committed May 4, 2020
2 parents 6ca3e20 + 1d20dd4 commit 456ef78
Show file tree
Hide file tree
Showing 39 changed files with 2,115 additions and 593 deletions.
9 changes: 8 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
* release 0.2.9
- added PSP and Wii platforms specific code
- added support for PC demo v1.0 data files
- fixed screen state for 'fort' screens 16 and 17
- fixed checkpoint for 'pwr1' screen 21
- fixed PAF animation glitches with last frame

* release 0.2.8
- added PSX background overlays (MDEC)
- fixed crash playing paf animation #3 with Italian PC data files
- fixed crash playing PAF animation #3 with Italian PC data files

* release 0.2.7
- added 'projection' submenu
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include_directories(
)

file(GLOB SRC *.cpp 3p/inih/ini.c 3p/libxbr-standalone/xbr.c)
list(FILTER SRC EXCLUDE REGEX ".*android.cpp")
list(FILTER SRC EXCLUDE REGEX ".*android.cpp|system_psp.cpp|system_wii.cpp")
add_executable(${CMAKE_PROJECT_NAME}
${SRC}
)
Expand All @@ -32,7 +32,7 @@ if(SWITCH_LIBNX)
add_definitions(-D__SWITCH__)
add_custom_target(${CMAKE_PROJECT_NAME}.nro
DEPENDS ${CMAKE_PROJECT_NAME}
COMMAND nacptool --create "Heart of Darkness" "cyx, usineur" "0.2.8" ${CMAKE_PROJECT_NAME}.nacp
COMMAND nacptool --create "Heart of Darkness" "cyx, usineur" "0.2.9" ${CMAKE_PROJECT_NAME}.nacp
COMMAND elf2nro ${CMAKE_PROJECT_NAME} ${CMAKE_PROJECT_NAME}.nro --icon=${CMAKE_SOURCE_DIR}/3p/res/icon.jpg --nacp=${CMAKE_PROJECT_NAME}.nacp
)
add_custom_target(nxlink
Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

hode README
Release version: 0.2.8
Release version: 0.2.9
-------------------------------------------------------------------------------


Expand Down
25 changes: 25 additions & 0 deletions RELEASES.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- fort_hod.lvl: 82456ed6e29780b5b8031a67ba3dddb8da813c19
- fort_hod.mst: ce55095902ade9f1d8a198f271d0946d6228b90d
- fort_hod.sss: 6ff572b553d93040c9cad74891db05b2cc8267c6
- hod.dem: 5d40f812b6ed1385b7e502527911023f28136341
- hod.paf: 6df823a778ed0df275217692fd814a7408b725cb
- hodwin32.exe: 02ae85c179f175c5a42fadb22ba9edaf4f62be14
securom: true
Expand Down Expand Up @@ -99,6 +100,7 @@
- fort_hod.lvl: 82456ed6e29780b5b8031a67ba3dddb8da813c19
- fort_hod.mst: ce55095902ade9f1d8a198f271d0946d6228b90d
- fort_hod.sss: 6ff572b553d93040c9cad74891db05b2cc8267c6
- hod.dem: 5d40f812b6ed1385b7e502527911023f28136341
- hod.paf: fe75aff52c879aa5cc84a87babbca2ce0affec23
- hodwin32.exe: eb0f032f343e2c27d60291c79ae667034a0c7389
securom: false
Expand Down Expand Up @@ -137,6 +139,28 @@
- rock_hod.mst: 5b49637348f6c6a2737a64cacf01f9bcef8e83f6
- rock_hod.sss: 55c841f6c091c2ae68f0636c075c66405d00cc6a
- setup.dat: 5cb36223a3fc5561d9c9d945fe3261cd188b5665
- name: Heart of Darkness Demo V1.0 (Win32)
files:
- hod_demo.paf: c1b46680b9e8596d72f998fb2b56d723a28a06af
- hodwin32.exe: c649d4365a2c9f6280bc4deb50a7c3ffb73baaad
securom: false
version_info:
- Comments: Demo 1 level
- CompanyName: Amazing Studio - 9 rue d' Enhgien - 75010 Paris FRANCE - Email: [email protected]
- FileDescription: Heart Of Darkness
- FileVersion: 0, 9, 8, 2
- InternalName: Heart Of Darkness
- LegalCopyright: (c) 1998 by Amazing Studio & Infogrames
- LegalTrademarks: by Amazing Studio - All rights reserved
- OriginalFilename: Heart Of Darkness
- PrivateBuild: 0
- ProductName: Heart Of Darkness - Windows 95 / 98 & NT - DirectX 3.x or greater
- ProductVersion: 0, 9, 8, 2
- SpecialBuild: VC5.0 Sp3
- rock_hod.lvl: c514afa2137b434cdd8da0024c1e4f20bff1cdb7
- rock_hod.mst: fa3fd22005a859abdae3b6d8b4f5ecb061a16e37
- rock_hod.sss: 855d5b4b4fec7c8d8d64575d8a1ce5ee27d8e2d5
- setup.dat: 56fd54d28074657b947e165134f044d9a91cef47
- name: Heart of Darkness Demo V1.2 (Win32)
files:
- hod_demo.paf: 50a0942256b17ed26f3b0f59f4cf7570a6eb8688
Expand Down Expand Up @@ -223,6 +247,7 @@
- dark_hod.mst: a97ac13edde17fd33cb06e9907139949c8b79cdb
- fort_hod.lvl: e94a21bc4f779dba658ef5ab45f1ad15880913d8
- fort_hod.mst: f7423c3d277650ac36378f09f59034cec28b6b34
- hod.dem: ba5060778a9f5391a8fa9a4928473cf7797df15a
- isld_hod.lvl: c0fbd02deea136d57b60bc8a7c3df69741491335
- isld_hod.mst: 9ff92346444a66833eb2f8a1b3853ad788d1777b
- lar1_hod.lvl: 575dde976affeedfa5f1637a34d5efdda3218778
Expand Down
3 changes: 1 addition & 2 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct SetupConfig {
uint8_t difficulty;
uint8_t stereo;
uint8_t volume;
uint8_t currentLevel;
uint8_t lastLevelNum;
} players[4]; // sizeof == 52
uint8_t unkD0;
uint8_t currentPlayer; // 0xD1
Expand Down Expand Up @@ -230,7 +230,6 @@ struct Sprite {
const uint8_t *bitmapBits;
Sprite *nextPtr;
uint16_t num;
uint16_t flags;
uint16_t w, h;
};

Expand Down
36 changes: 19 additions & 17 deletions fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
#include "fileio.h"
#include "util.h"

static const bool kCheckSectorFileCrc = true;
static const bool kCheckSectorFileCrc = false;

#ifdef PSP
static const bool kSeekAbsolutePosition = true;
#else
static const bool kSeekAbsolutePosition = false;
#endif

File::File()
: _fp(0) {
Expand All @@ -20,11 +26,15 @@ void File::setFp(FILE *fp) {
_fp = fp;
}

void File::seekAlign(int pos) {
void File::seekAlign(uint32_t pos) {
fseek(_fp, pos, SEEK_SET);
}

void File::seek(int pos, int whence) {
if (kSeekAbsolutePosition && whence == SEEK_CUR) {
pos += ftell(_fp);
whence = SEEK_SET;
}
fseek(_fp, pos, whence);
}

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

void File::flush() {
}

SectorFile::SectorFile() {
memset(_buf, 0, sizeof(_buf));
_bufPos = 2044;
Expand Down Expand Up @@ -93,13 +100,14 @@ void SectorFile::refillBuffer(uint8_t *ptr) {
}
}

void SectorFile::seekAlign(int pos) {
void SectorFile::seekAlign(uint32_t pos) {
pos += (pos / 2048) * 4;
const int alignPos = (pos / 2048) * 2048;
fseek(_fp, alignPos, SEEK_SET);
refillBuffer();
const int skipCount = pos - alignPos;
_bufPos += skipCount;
const long alignPos = pos & ~2047;
if (alignPos != (ftell(_fp) - 2048)) {
fseek(_fp, alignPos, SEEK_SET);
refillBuffer();
}
_bufPos = pos - alignPos;
}

void SectorFile::seek(int pos, int whence) {
Expand Down Expand Up @@ -148,9 +156,3 @@ int SectorFile::read(uint8_t *ptr, int size) {
}
return 0;
}

void SectorFile::flush() {
const int currentPos = ftell(_fp);
assert((currentPos & 2047) == 0);
_bufPos = 2044;
}
6 changes: 2 additions & 4 deletions fileio.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ struct File {

void setFp(FILE *fp);

virtual void seekAlign(int pos);
virtual void seekAlign(uint32_t pos);
virtual void seek(int pos, int whence);
virtual int read(uint8_t *ptr, int size);
uint8_t readByte();
uint16_t readUint16();
uint32_t readUint32();
virtual void flush();

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

void refillBuffer(uint8_t *ptr = 0);
virtual void seekAlign(int pos);
virtual void seekAlign(uint32_t pos);
virtual void seek(int pos, int whence);
virtual int read(uint8_t *ptr, int size);
virtual void flush();
};

int fioAlignSizeTo2048(int size);
Expand Down
1 change: 1 addition & 0 deletions fs_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "util.h"

static const char *_suffixes[] = {
"hod.dem",
"setup.dat",
"setup.dax",
".paf",
Expand Down
Loading

0 comments on commit 456ef78

Please sign in to comment.