Giter Site home page Giter Site logo

dressupgeekout / lunapurpura Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 346 KB

Reimplementation of Purple Moon's games from the 1990s (WIP)

Home Page: https://dressupgeekout.github.io/lunapurpura/

License: BSD 2-Clause "Simplified" License

CMake 4.45% C 71.29% Ruby 14.99% Lua 9.27%
games reverse-engineering multimedia game-engine

lunapurpura's Introduction

Luna Purpura

This software is totally a work in progress and very few things are actually functional. It's still in a research phase.

Luna Purpura is a portable reimplementation of Purple Moon's classic computer games from the 1990s:

It is a modern interpreter of the original game files. The goal is: if you have the original CD-ROMs, then you can play these games on today's computers, even on platforms which Purple Moon did not originally support. You should also be able to use the engine to make your own games, too!

Support for Secret Paths in the Forest and the other Secret Paths games is planned, but not currently being worked on. Get in touch if you'd like to help out!

Building Luna Purpura

In order to build games and support libraries from Luna Purpura, you must have CMake.

$ mkdir build
$ cd build
$ cmake .. [cmake-options]
$ make

The following CMake configuration options are supported:

  • BOOL LUNAPURPURA_DEBUG -- Enable debug output
  • BOOL LUNAPURPURA_BUILD_LUA_BINDINGS -- Build the Lua 5.1 (or LuaJIT) bindings
  • BOOL LUNAPURPURA_BUILD_MRUBY_BINDINGS -- Build the mruby bindings
  • BOOL LUNAPURPURA_BUILD_TESTS -- Build the test applications
  • BOOL LUNAPURPURA_PNG_SUPPORT -- Enable conversion to PNG

So, for example:

$ cmake .. -DLUNAPURPURA_DEBUG=ON -DLUNAPURPURA_PNG_SUPPORT=OFF

If you turn on the Lua bindings, you need to also define the following:

  • PATH LUA_INCLUDEDIR -- Location of Lua 5.1/LuaJIT's header files
  • PATH LUA_LIBDIR -- Location of Lua 5.1/LuaJIT's library

If you turn on the mruby bindings, you need to also define the following:

  • PATH MRUBY_INCLUDEDIR -- Location of mruby's header files
  • PATH MRUBY_LIBDIR -- Location of mruby's library

build.sh Usage

For the most basic use cases, we provide an easy script that does it all for you:

$ ./build.sh [make(1) args ...]

You can force a fresh, clean rebuild with the 'clean' argument:

$ ./build.sh clean

Using the tools

Currently, the most feature-complete software are the Ruby scripts in the tools/ directory. Most versions of Ruby >= 2.3 should work just fine on them. Note that these are merely prototypes which are designed to make research on Purple Moon's exotic file formats easier. Eventually, the C implementation will become Luna Purpura's reference code.

Actually playing games

Currently, we're targeting LÖVE as the means to creating actually playable games. This means coming up with C code to decode the game files, and then devising Lua bindings so that a LÖVE application can access them.

LÖVE is merely an implementation detail for rapid prototyping. A more sophisticated, portable and standalone implementation -- written in C and likely based on SDL -- will eventually come around. But in any case, we expect that scripts will be used in some capacity, no matter what.

License

Luna Purpura is released under a highly permissive 2-clause BSD-style license. Take a look at the LICENSE document for more details.

Links

lunapurpura's People

Contributors

dressupgeekout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lunapurpura's Issues

Make prx(1) more like mmfw(1) re: memory usage

I tried to do things right with mmfw(1) regarding memory usage. The PRX-reading routines are actually quite the memory hog because they want to obtain all the data for all the members up front, which is not necessary. Gotta cut down on memory usage significantly here.

Decode Dxr files

There's a bunch of "Dxr" files which support Secret Paths in the Forest. Let's try to figure out what those even are.

Decipher the CLU format

It appears to be metadata of some kind, since every CLU file seems to be exactly the same size (on Tricky Decision at least)

Handle "DIRECT 0" XPK files

There's a class of instruction in the XPK format which we're not handling yet: 0x9n

1 entry(ies):
	XPKEntry offset=36 dimensions=160x120 pos=0x0
xpk: ?? unhandled XPK instruction: 91
xpk: ?? unhandled XPK instruction: 19
xpk: ?? unhandled XPK instruction: 91
xpk: ?? unhandled XPK instruction: 91
xpk: ?? unhandled XPK instruction: 91
xpk: ?? unhandled XPK instruction: 9E
xpk: ?? unhandled XPK instruction: 9C
xpk: ?? unhandled XPK instruction: 96
xpk: ?? unhandled XPK instruction: 9C

Let's try to figure out what it could mean

Evaluate LuaJIT's FFI facility

https://luajit.org/ext_ffi.html

Looks like LÖVE supports LuaJIT's foreign function interface feature. This (potentially) means we don't have to make separate C/Lua bindings manually, which could potentially make it way easier to write the LÖVE-based demos.

However, having a proper, old-fashioned Lua binding is nice, because it allows one to use Luna Purpura's functionality in Lua scripts that have nothing to do with LuaJIT.

So, we need to figure out whether this is a path worth going down, or not.

[WINDOWS] Unable to unpack PRX: Debug Assertion Failed - Expression: stream.valid()

FYI @AlanisSmithee

Not able to list the contents of a PRX file from Tricky on Windows at runtime. I wonder if I have to use Windows's "secure" flavors of functions (the *_s() ones) or maybe everything will just go away if I disable debug assertions, somehow? Not sure if that's possible per se.

Nevertheless, I am curious to learn why Windows believes opening the PRX file isn't valid (whatever that means)

out

Target C99 instead of C11?

Sticking to C99 instead of C11 will make Luna Purpura more portable, and it seems that compatibility with Windows is greatly enhanced, too.

Purple Moon vs Mattel Printings

There is evidence that some of the games had multiple print runs. This may cause compatibility issues with LP.

The non-Mattel, Purple Moon exclusive Rockett games (School, Tricky, Secret, Adventure Maker, MAYBE Dance?) had reprintings when the company was sold to Mattel. My guess is these copies are the ones included in the Rockett's Collection bundle. You can easily tell a PM copy apart from a Mattel one by the packaging. PM published copies come in cardboard/plastic jewel cases and feature different colors for the accents on the CD art. Mattel copies come in the traditional glass/plastic jewel cases, have the Mattel Media logo and an ESRB rating on the disc, and use yellow accents for the CD art. Like so:

https://vignette.wikia.nocookie.net/purplemoon/images/5/50/TrickydecisionCD2.png - Purple Moon version of Tricky
https://vignette.wikia.nocookie.net/purplemoon/images/7/71/TrickydecisionCD.jpg - Mattel version of Tricky

According to a "Rockett Talk" article on the Purple Moon website, New School may have also received a printing to change the ending screen. (As players were getting confused by the blank choice screen at the end.) This may or may not be a feature of the Mattel printing, as the article was written around the time Mattel would have control of the company's assets. (October 2000).

In Rockett's New School, when it comes time to make a decision after I walk out of the bathroom, no decision bubbles pop up. Why does this happen? --LysKate

If you're in the girls' bathroom and Rockett has already found the book, then the game is over. I know some early versions of this CD just kind of ended abruptly, like that! And it confused girls. Sorry.

I personally haven't seen a version of New School without the blank ending screen. So I can't tell if it exists for certain or not.

All that said, I don't think there will be that big of an issue. Based on some comparison of the compile dates on the discs that I have (my ISOs (made from physical copies that I own) vs ISOs of Mattel copies I've found on archive.org), the only things Mattel changed were the READMEs (to update the copyright info). But it is still something to consider.

(If you're curious, I have PM copies of Tricky and Secret, and Mattel copies of Dance and Adventure Maker. My physical copy of New School got lost in a move. But the compile dates indicate that it was a Mattel copy. I don't recall what type of jewel case it came in. It ends on the blank bathroom screen. My copies of the PM Secret Paths games are both PM copies.)

Create a RIFF/RIFX unarchiver

The .Dxr and .Cxt files in Secret Paths in the Forest correspond to Macromedia Director. However, Macromedia Director's files are implemented as RIFF archives (technically they're RIFXes to indicate the big-endian data contained within).

This means that, no matter what the bigger Director story ultimately is, we at a minimum have to have the ability to unpack RIFF archives. There definitely already exists code which can do this -- it's a very common archive format -- but I don't see any reason why Luna Purpura can't have its own implementation. This task should be very quick and straightforward.

More info: https://en.wikipedia.org/wiki/Resource_Interchange_File_Format

[Presage] Some extracted archive members have trailing spaces

For example:

charlotte@dawnchorus:~/devel/lunapurpura/TRICKY/j/IDNav ls -1 *\ .XPK
50031-NAV_EAST_3 .XPK
50074-AN_ODN .XPK
50113-BN_ODN .XPK
50151-CN_ODN .XPK
50190-DN_ODN .XPK
50811-DN_BULTN_2 .XPK
50813-DN_BULTN_4 .XPK

Observe the space character before the dot.

I can confirm this isn't a bug per se, but rather, that's how the file name is actually stored in the PRX. Notice the ASCII 0x20, which is the space character.

4E 41 56 5F 45 41 53 54 5F 33 20 00 00 00 00 00 00 00
N  A  V  _  E  A  S  T  _  3  ' '

Perhaps our PRX reader ought to trim all trailing whitespace unconditionally.

This won't actually affect games from running, this is only a convenience or a concession for human beings extracting individual files.

[Forest] Come up w/ a strategy re: playing the MOV files

The MOV files which ship with Secret Paths in the Forest (and perhaps Sea, too, but I don't have the game) come in several different formats. They all seem to be of super old Apple formats, ones that I used to see all the time when I was younger.

For example, here's how FFmpeg interprets GRDN.SHARE.MOV, Darnetta's intro story:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GRDN.SHARE.MOV':
  Metadata:
    creation_time   : 1997-07-25T16:22:22.000000Z
  Duration: 00:00:33.47, start: 0.000000, bitrate: 514 kb/s
    Stream #0:0(eng): Video: smc (smc  / 0x20636D73), pal8, 640x480, 159 kb/s, 0.36 fps, 10 tbr, 600 tbn, 600 tbc (default)
    Metadata:
      creation_time   : 1997-07-25T16:22:22.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Graphics
    Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 22050 Hz, 1 channels, s16, 352 kb/s (default)
    Metadata:
      creation_time   : 1997-07-25T16:22:22.000000Z
      handler_name    : Apple Sound Media Handler

The goal of this issue is to identify the best way to get these movies playable within Luna Purpura, given the fact they're already decodeable. But that doesn't mean we necessarily want to link Luna Purpura against libavformat and libavcodec.

  • Do we go ahead and make libavformat/libavcodec straight up dependencies of Luna Purpura? This reduces the work we need to do, but I'm not sure if that's an agreeable or portable way of doing it.
  • Do we go through the trouble to understand the file formats and come up with our own decoder? This will basically let us play these movies inside of a LOVE game, and/or any other platform we decide to introduce Luna Purpura to.

Tl;DR it's time to make a Big Decision™.

Need to store only the CLU's basename

We store the CLU's name in the CLU structure. Whether or not that's actually the right thing to do in the first place, we're definitely doing one thing wrong right now: We take the first 16 characters of the path by which we referred to the CLU, which might include slashes from a full path:

RESOURCE/_IDGLo   # stops after 16 chars

Instead, we should be storing only the basename:

_IDGlobal.CLU

Compiling in Windows 10

Note: I am not a programmer and don't have a deep knowledge of coding. I'm sorry if anything in this post is downright insulting to any seasoned programmer.

I have the latest stable versions of CMake and Git Bash, and Visual Studio 16 (2019 Community Edition, with C++ support enabled) installed.

Using Git Bash, I ran the build.sh file with no modifiers. Running the version with PNG support disabled by default appeared to successfully compile all of the files. There was, however, a minor error.

/h/lunapupura/build /h/lunapupura
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.26.28806.0
-- The CXX compiler identification is MSVC 19.26.28806.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- DEBUG macro enabled
-- XPK hack enabled
-- Configuring done
-- Generating done
-- Build files have been written to: H:/lunapupura/build
./build.sh: line 24: make: command not found

Trying it with various make commands that were originally detailed in the README file gave me the same results. Though there is a chance I got the syntax wrong.

build.sh generated a bunch of files that appear to be Visual Studio project files to my system.

lunapurpurabuild1
lunapurpurabuild2

Let's load ALL_BUILD into Visual Studio and try "Build ALL_BUILD".

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
2>------ Build started: Project: lpclu, Configuration: Debug x64 ------
3>------ Build started: Project: lputil, Configuration: Debug x64 ------
4>------ Build started: Project: lpprd, Configuration: Debug x64 ------
5>------ Build started: Project: lpdib, Configuration: Debug x64 ------
2>Building Custom Rule H:/lunapupura/src/clu/CMakeLists.txt
3>Building Custom Rule H:/lunapupura/src/lputil/CMakeLists.txt
2>cl : command line warning D9002: ignoring unknown option '-g'
2>clu.c
4>Building Custom Rule H:/lunapupura/src/prd/CMakeLists.txt
2>H:\lunapupura\src\clu\clu.c(27,12): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>H:\lunapupura\src\clu\clu.c(83,20): warning C4388: '<': signed/unsigned mismatch
2>H:\lunapupura\src\clu\clu.c(84,21): warning C4388: '<': signed/unsigned mismatch
2>H:\lunapupura\src\clu\clu.c(81,1): warning C4244: 'initializing': conversion from 'double' to 'size_t', possible loss of data
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(828,37): warning C4710: 'int fprintf(FILE *const ,const char *const ,...)': function not inlined
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(828): message : see declaration of 'fprintf'
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(1940,37): warning C4710: 'int snprintf(char *const ,const size_t,const char *const ,...)': function not inlined
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(1940): message : see declaration of 'snprintf'
5>Building Custom Rule H:/lunapupura/src/dib/CMakeLists.txt
3>cl : command line warning D9002: ignoring unknown option '-g'
2>H:\lunapupura\src\clu\clu.c(57): warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
3>lputil.c
3>H:\lunapupura\src\lputil\lputil.c(7,10): fatal error C1083: Cannot open include file: 'err.h': No such file or directory
3>Done building project "lputil.vcxproj" -- FAILED.
4>cl : command line warning D9002: ignoring unknown option '-g'
2>H:\lunapupura\src\clu\clu.c(43): message : index 'i' range checked by comparison on this line
2>H:\lunapupura\src\clu\clu.c(57): message : feeds call on this line
2>H:\lunapupura\src\clu\clu.c(86): warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
2>H:\lunapupura\src\clu\clu.c(84): message : index '' range checked by comparison on this line
2>H:\lunapupura\src\clu\clu.c(91): message : feeds call on this line
4>prd.c
4>H:\lunapupura\src\prd\prdentry.h(18,14): warning C4820: 'PRDEntry': '1' bytes padding added after data member 'ext'
4>H:\lunapupura\src\prd\prdentry.h(23,25): warning C4255: 'PRDEntry_New': no function prototype given: converting '()' to '(void)'
4>H:\lunapupura\src\prd\prd.c(39,20): warning C4388: '<': signed/unsigned mismatch
4>H:\lunapupura\src\prd\prd.c(21,12): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
4>H:\lunapupura\src\prd\prd.c(50,20): warning C4388: '<': signed/unsigned mismatch
4>prdentry.c
4>H:\lunapupura\src\prd\prdentry.h(18,14): warning C4820: 'PRDEntry': '1' bytes padding added after data member 'ext'
4>H:\lunapupura\src\prd\prdentry.h(23,25): warning C4255: 'PRDEntry_New': no function prototype given: converting '()' to '(void)'
4>H:\lunapupura\src\prd\prdentry.c(11,1): warning C4255: 'PRDEntry_New': no function prototype given: converting '()' to '(void)'
4>Generating Code...
4>H:\lunapupura\src\prd\prd.c(51): warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
4>H:\lunapupura\src\prd\prd.c(50): message : index '' range checked by comparison on this line
4>H:\lunapupura\src\prd\prd.c(51): message : feeds call on this line
6>------ Build started: Project: lpprx, Configuration: Debug x64 ------
5>cl : command line warning D9002: ignoring unknown option '-g'
5>dib.c
5>H:\lunapupura\src\dib\dib.h(20,14): warning C4820: 'BITMAPFILEHEADER': '2' bytes padding added after data member 'bfType'
6>Building Custom Rule H:/lunapupura/src/prx/CMakeLists.txt
4>lpprd.vcxproj -> H:\lunapupura\build\src\prd\Debug\lpprd.lib
6>cl : command line warning D9002: ignoring unknown option '-g'
6>prx.c
2>lpclu.vcxproj -> H:\lunapupura\build\src\clu\Debug\lpclu.lib
5>lpdib.vcxproj -> H:\lunapupura\build\src\dib\Debug\lpdib.lib
6>H:\lunapupura\src\prx\prx.c(7,10): fatal error C1083: Cannot open include file: 'err.h': No such file or directory
6>prxmember.c
6>H:\lunapupura\src\prx\prxmember.h(27,17): warning C4820: 'PRXMember': '2' bytes padding added after data member 'internal_id'
6>H:\lunapupura\src\prx\prxmember.h(31,12): warning C4820: 'PRXMember': '4' bytes padding added after data member 'name'
6>H:\lunapupura\src\prx\prx.h(22,28): warning C4820: 'PRX': '2' bytes padding added after data member 'n_entries'
6>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(1940,37): warning C4710: 'int snprintf(char *const ,const size_t,const char *const ,...)': function not inlined
6>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(1940): message : see declaration of 'snprintf'
6>Generating Code...
6>Done building project "lpprx.vcxproj" -- FAILED.
4>Done building project "lpprd.vcxproj".
5>Done building project "lpdib.vcxproj".
2>Done building project "lpclu.vcxproj".
7>------ Build started: Project: lpsmf, Configuration: Debug x64 ------
8>------ Build started: Project: prd, Configuration: Debug x64 ------
9>------ Build started: Project: lpxpk, Configuration: Debug x64 ------
10>------ Build started: Project: clu, Configuration: Debug x64 ------
9>Building Custom Rule H:/lunapupura/src/xpk/CMakeLists.txt
10>Building Custom Rule H:/lunapupura/src/clu/CMakeLists.txt
8>Building Custom Rule H:/lunapupura/src/prd/CMakeLists.txt
10>cl : command line warning D9002: ignoring unknown option '-g'
11>------ Build started: Project: prx, Configuration: Debug x64 ------
10>main.c
10>H:\lunapupura\src\clu\main.c(7,10): fatal error C1083: Cannot open include file: 'err.h': No such file or directory
10>Done building project "clu.vcxproj" -- FAILED.
12>------ Build started: Project: smf, Configuration: Debug x64 ------
9>cl : command line warning D9002: ignoring unknown option '-g'
9>xpk.c
9>H:\lunapupura\src\xpk\xpk.h(34,12): warning C4820: 'XPKEntry': '4' bytes padding added after data member 'y'
9>H:\lunapupura\src\xpk\xpk.h(51,10): warning C4820: 'XPK': '4' bytes padding added after data member 'next_section'
9>H:\lunapupura\src\xpk\xpkdecoder.h(42,21): warning C4820: 'XPKDecoder': '2' bytes padding added after data member 'next_holder'
9>H:\lunapupura\src\xpk\xpkdecoder.h(46,14): warning C4820: 'XPKDecoder': '4' bytes padding added after data member 'line_repeat_loc'
9>H:\lunapupura\src\xpk\xpk.c(28,22): warning C4267: '=': conversion from 'size_t' to 'uint16_t', possible loss of data
9>H:\lunapupura\src\xpk\xpk.c(29,24): warning C4267: '=': conversion from 'size_t' to 'uint16_t', possible loss of data
9>H:\lunapupura\src\xpk\xpk.c(30,14): warning C4242: '=': conversion from 'const int' to 'uint16_t', possible loss of data
9>H:\lunapupura\src\xpk\xpk.c(31,14): warning C4242: '=': conversion from 'const int' to 'uint16_t', possible loss of data
9>H:\lunapupura\src\xpk\xpk.c(64,12): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
9>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(948,37): warning C4710: 'int printf(const char *const ,...)': function not inlined
9>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\stdio.h(948): message : see declaration of 'printf'
9>xpkdecoder.c
9>H:\lunapupura\src\xpk\xpkdecoder.c(7,10): fatal error C1083: Cannot open include file: 'err.h': No such file or directory
9>Generating Code...
9>H:\lunapupura\src\xpk\xpk.c(145): warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
9>H:\lunapupura\src\xpk\xpk.c(96): message : index 'i' range checked by comparison on this line
9>H:\lunapupura\src\xpk\xpk.c(145): message : feeds call on this line
9>H:\lunapupura\src\xpk\xpk.c(140): warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
9>H:\lunapupura\src\xpk\xpk.c(135): message : index 'i' range checked by comparison on this line
9>H:\lunapupura\src\xpk\xpk.c(140): message : feeds memory load on this line
9>H:\lunapupura\src\xpk\xpk.c(113): warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
9>H:\lunapupura\src\xpk\xpk.c(96): message : index 'i' range checked by comparison on this line
9>H:\lunapupura\src\xpk\xpk.c(113): message : feeds call on this line
9>H:\lunapupura\src\xpk\xpk.c(106): warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
9>H:\lunapupura\src\xpk\xpk.c(96): message : index 'i' range checked by comparison on this line
9>H:\lunapupura\src\xpk\xpk.c(106): message : feeds call on this line
9>H:\lunapupura\src\xpk\xpk.c(154): warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
9>H:\lunapupura\src\xpk\xpk.c(153): message : index 'i' range checked by comparison on this line
9>H:\lunapupura\src\xpk\xpk.c(154): message : feeds call on this line
9>Done building project "lpxpk.vcxproj" -- FAILED.
13>------ Build started: Project: xpk, Configuration: Debug x64 ------
11>Building Custom Rule H:/lunapupura/src/prx/CMakeLists.txt
8>cl : command line warning D9002: ignoring unknown option '-g'
8>main.c
8>H:\lunapupura\src\prd\main.c(5,10): fatal error C1083: Cannot open include file: 'err.h': No such file or directory
8>Done building project "prd.vcxproj" -- FAILED.
13>Building Custom Rule H:/lunapupura/src/xpk/CMakeLists.txt
12>Building Custom Rule H:/lunapupura/src/smf/CMakeLists.txt
11>cl : command line warning D9002: ignoring unknown option '-g'
11>main.c
11>H:\lunapupura\src\prx\main.c(7,10): fatal error C1083: Cannot open include file: 'err.h': No such file or directory
11>Done building project "prx.vcxproj" -- FAILED.
12>cl : command line warning D9002: ignoring unknown option '-g'
13>cl : command line warning D9002: ignoring unknown option '-g'
12>main.c
12>H:\lunapupura\src\smf\main.c(5,10): fatal error C1083: Cannot open include file: 'err.h': No such file or directory
12>Done building project "smf.vcxproj" -- FAILED.
13>main.c
13>H:\lunapupura\src\xpk\main.c(5,10): fatal error C1083: Cannot open include file: 'err.h': No such file or directory
13>Done building project "xpk.vcxproj" -- FAILED.
14>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
14>Building Custom Rule H:/lunapupura/CMakeLists.txt
========== Build: 5 succeeded, 9 failed, 0 up-to-date, 0 skipped ==========

¯_(ツ)_/¯

As an aside, I have also installed Ruby. Is it possible to just run the Ruby scripts (specifically, the unpack_entire_game script) on files from the games without compiling anything?

[Tricky/Invitation] Not All Audio Is Compressed

So bit of good news. Not all of the audio in both games is compressed. In Tricky, pretty much all of the sound effect files and some of the background loops (the main Hidden Hallway one and the teachers' lounge are two example, IIRC) are uncompressed. Whereas pretty much anything voice acted and the character specific background loops are compressed along with the smfs audio.

In Invitation, much to my relief, the truth glasses VOs were left uncompressed. As are what appear to be the background loops for all of the decision screens. (Possibly some other things too. I haven't looked too deeply.) All other voice-acting is compressed (won't play in VLC), as is a lot of the sound effects that were carried over from the previous game.

My guess is they just didn't bother compressing any new audio for whatever reason. I'm currently testing the prx tool out with First Dance. I'll update if I can get stuff unpacked and see what the deal is with that game.

[Secret Invitation] "Phantom" Members in IDL Archives

Three character IDL archives appear to have "phantom" members when you list them with the prx tool, and give a "permission denied" error when you extract them. Bo and Chaz have two (Internal IDs 117/118 and 122/123, respectively). Whitney has a startling four. (160 to 163). Whitney's archive also appears to have two members with an internal ID of 163. (One is a phantom, the other is a valid file: WHIT_hair1.xmv) All of them occur at the bottom of the list and give no file name, no file type, no resource ID, and a file size of 0. All of the other files in the archives will extract normally.

157   WHIT_hair3        XMV   47855   1624
158   WHIT_hair2        XMV   47844   1176
163   WHIT_hair1        XMV   47843   1176
160                           0       0
161                           0       0
162                           0       0
163                           0       0

PRX tool can list and extract files from "First Dance", with some bugs

The biggest being that the List command may be showing duplicates of various files and some files are just not extracted. CHOIC2.PRX is a good example.

$ ./prx -t ./dance/RESOURCE/CHOIC2.PRX
>> 37 entries:
1     SCENE_2_2_BG      XPK   1200    217802
2     LEFT_HEAD         XPK   1001    18117
3     RIGHT_BALLOON_H   XPK   1030    1690
4     MC_2_2_NO         XPK   2220    7441
5     MC_2_1_POSITIVE   XPK   2110    6838
6     UP_HEAD           XPK   1002    18758
7     LEFT_BALLOON      XPK   1011    1453
8     LEFT_BALLOON      XPK   1012    1515
9     LEFT_BALLOON      XPK   1013    1546
10    RELIEVED          Aif   2320    193054
11    NEGATIVE          Aif   2120    336202
12    UNSURE            Aif   2230    203902
13    FEISTY            Aif   2330    245962
14    MC_2_1_NEGATIVE   XPK   2120    7168
15    SCENE_2_3_BG      XPK   1300    198149
16    MC_2_1_INDIFFER   XPK   2130    7367
17    MC_2_2_UNSURE     XPK   2230    6881
18    MC_2_2_YES        XPK   2210    6711
19    CENTER_BALLOON    XPK   1021    1408
20    CENTER_BALLOON    XPK   1022    1753
21    CENTER_BALLOON    XPK   1023    1574
22    LEFT_BALLOON_HI   XPK   1010    1463
23    MC_2_3_DISAPPOI   XPK   2310    6881
24    CENTER_BALLOON_   XPK   1020    1396
25    INDIFFERENT       Aif   2130    345928
26    DISAPPOINTED      Aif   2310    286442
27    MC_2_3_RELIEVE    XPK   2320    7113
28    SCENE_2_1_BG      XPK   1100    254679
29    CENTER_HEAD       XPK   1000    19125
30    RIGHT_BALLOON     XPK   1031    1719
31    RIGHT_BALLOON     XPK   1032    1662
32    RIGHT_BALLOON     XPK   1033    1534
33    RIGHT_HEAD        XPK   1003    18493
34    MC_2_3_FIESTY     XPK   2330    7292
35    POSITIVE          Aif   2110    204850
36    YES               Aif   2210    227300
37    NO                Aif   2220    161180

Here's what was extracted. 30 files vs 37.

choic2filelist

IDGLASS.PRX is even funnier.

$ ./prx -t ./dance/RESOURCE/IDL/IDGLASS.PRX
>> 18 entries:
1     DFTG_GENERICFIN   Aif   32027   162906
2     DFTG_GENERICFIN   Aif   32024   193874
3     DFTG_GENERICFIN   Aif   32033   269270
4     DFTG_GENERICFIN   Aif   32021   446634
5     DFTG_GENERICFIN   Aif   32030   282030
6     TG_ANIMATED       XPK   20705   1359874
7     TG_ANIMATED       XMV   20705   1416
8     DFTG_GENERICFIN   Aif   32029   162906
9     DFTG_GENERICFIN   Aif   32026   429764
10    DFTG_GENERICFIN   Aif   32035   128146
11    DFTG_GENERICFIN   Aif   32023   189784
12    DFTG_GENERICFIN   Aif   32032   345446
13    DFTG_GENERICFIN   Aif   32028   242698
14    DFTG_GENERICFIN   Aif   32025   164122
15    DFTG_GENERICFIN   Aif   32034   239810
16    DFTG_GENERICFIN   Aif   32022   278840
17    DFTG_GENERICFIN   Aif   32031   192110
18    TG_ANIMATED       Aif   20705   477654

IDGLASSfilelist

Some of the character archives also have the "phantom member" problem that shows up in some of "Secret Invitation"'s archives. I'll put those in that thread.

Locker Text File Background Indicators

File names for locker texts in the Rockett games always include a letter or group of letters that determine which "book" (i.e. background, hence the thread title) they appear in. This is always the second group of characters in the file name. In Tricky, there's a handful of these, but by Dance, most of them were dropped in favor of the Whistling Pines journals. (Whether this was because development was rushed or to make things more streamlined, I can't say.)

Not all locker items with text in them are included as text files. Some non-journal/diary items (the Camp Pine-Away brochures, Viva's astrology book, etc.) appear to just be stored as graphic files.

Also of note: There is one locker text file in Tricky that doesn't follow the normal naming format: a journal entry from Nicole vowing revenge against Rockett and everyone who humiliated her in the gym scene; labeled "~1.txt".

Here are the ones I've encountered, for easy reference.

  • AB - "Address book", used by multiple students.
  • BB - Nicole's "boy book".
  • CJ - "CSG Journal". Miko's customized journal with the CSG logo on it (not to be confused with the private report book).
  • D - Nicole's "diary" in Tricky; Mavis' secret notebook in Invitation and Dance.
  • FJ - Nakili's private journal in Tricky. "Family journal"?
  • J - "Journal". Specifically, the green Whistling Pines planner found in almost everyone's lockers. Most text written by characters are labeled with this.
  • LB - "Log book". Used exclusively by teachers. The teacher version of "J" texts.
  • MJ - "Main journal", entries for Rockett's personal journal (in her backpack) in Invitation and Dance.
  • N - "Note", anything written to a character (students and teachers), not by them. Can be anything from notes sent by other people to official school correspondence. The background used for any given note seems to be determined elsewhere in the game's coding.
  • NB - Mr. Pill's personal "notebook".
  • PJ - Sharla's "private journal".
  • PRB - The CSGs' "Private Report Book".
  • RB - Ruben's (blue spiral) notebook.
  • SB - Mavis' "Secret [Note]Book" in Tricky.
  • T - To-do lists written by Max and Whitney. Presumably uses one of the notepad backgrounds.
  • TD - Nicole's to-do lists.
  • TG - Hints for the "truth glasses" scavenger hunt segment.

The text for Rockett's backpack journal are kept in a separate folder (RESOURCE/shared2 in Tricky, RESOURCE/idbackpk in Invitation and Dance) and use a different file name format in Tricky. ("bpjournal_[scene#][emotion abbreviation]" or "pbjournal_[scene#[emotionabbrev.]"). In Invitation and Dance, they follow the same naming scheme as other locker texts.

Presumably, New School uses a similar scheme to Tricky for its graphic files, but I haven't been able to dig into those yet.

Decode Cxt files

There's a bunch of "Cxt" files in Secret Paths in the Forest. Let's figure out what those are.

Decode the XPK format

PRX archives contain "XPK" files which I'm convinced are raster graphics. Let's figure out how to decode it so that we can blit pixels to the screen!

[Tricky Decision] "Bad magic" in Bo.PRX

+ cd /tmp/qqq/IDL/Bo && /Users/charlotte/devel/lunapurpura/build/src/prx/prx -x -a /Volumes/SHARED/games/dist/rocketts_tricky_decision/Rockett\'s\ Tricky\ Decision/RESOURCE/IDL/Bo.PRX
prx: error: /Volumes/SHARED/games/dist/rocketts_tricky_decision/Rockett's Tricky Decision/RESOURCE/IDL/Bo.PRX: Bad magic

Rather odd. Need to investigate

Fix the "internal ID" in PRXes

Notice how the last PRX member is always listed as -1. This is because it's actually stored as zero, but I subtract one because we purposefully ignore the zeroeth "dummy" member. It's weird.

$ ../../build/src/prx/prx -t ../../data/tricky/IDBackPk.PRX  | tail
215   ROC_packtake_v7   Aif   45087   43572   
216   ROC_sidepock_v3   Aif   45088   26932   
217   ROC_mainpock_v3   Aif   45089   45822   
218   ROC_ZipOpen_t1    Aif   45090   22182   
219   ROC_ZipClose_t1   Aif   45091   25838   
220   ROC_Camera_t1     Aif   45092   18320   
221   ROC_PDAforward_   Aif   45093   42934   
222   ROC_PDAmessage_   Aif   45094   20206   
223   ROC_PDArewind_t   Aif   45095   48396   
-1    ROC_PDAstart_t1   Aif   45096   15962   

To be clear, this bug is about: making sure the last member's "internal ID" is actually NOT zero.

Make a PRX writer

This one's primarily for those who want to make mods, but it will be beneficial for the Luna Purpura project as a whole to have both readers and writers, for sure.

Be able to get PRX entry, given a resource ID

We need an API which will return the data for a PRX entry, given its resource ID.

I guess the user also has to specify which file type they want, since there are several resources which numerically have the same ID

Make a XPK encoder/writer

This one's mostly for people who want to make mods, but seeing a reader AND a writer could be helpful for Luna Purpura development as a whole. You know, so that we have an even more complete understanding of the XPK format.

Make Ruby (MRI) bindings

Maybe it's more advantageous to create "normal" Ruby bindings (for the default MRI implementation of Ruby) rather than mruby bindings. The truth is, I've been putting the focus on mruby because the C interface is more familiar to me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.