diff --git a/src/Compression.cc b/src/Compression.cc index 24a5b4b7..21bd5ed5 100644 --- a/src/Compression.cc +++ b/src/Compression.cc @@ -1281,15 +1281,15 @@ string bc0_decompress(const void* data, size_t size) { } } - // Control bit 0 means to perform a backreference copy. The offset and - // size are stored in two bytes in the input stream, laid out as follows: - // a1 = 0bBBBBBBBB - // a2 = 0bAAAACCCC - // The offset is the concatenation of bits AAAABBBBBBBB, which refers to a - // position in the memo; the number of bytes to copy is (CCCC + 3). The - // decompressor copies that many bytes from that offset in the memo, and - // writes them to the output and to the current position in the memo. if ((control_stream_bits & 1) == 0) { + // Control bit 0 means to perform a backreference copy. The offset and + // size are stored in two bytes in the input stream, laid out as follows: + // a1 = 0bBBBBBBBB + // a2 = 0bAAAACCCC + // The offset is the concatenation of bits AAAABBBBBBBB, which refers to + // a position in the memo; the number of bytes to copy is (CCCC + 3). The + // decompressor copies that many bytes from that offset in the memo, and + // writes them to the output and to the current position in the memo. uint8_t a1 = r.get_u8(); if (r.eof()) { break; @@ -1304,9 +1304,9 @@ string bc0_decompress(const void* data, size_t size) { memo_offset = (memo_offset + 1) & 0x0FFF; } + } else { // Control bit 1 means to write a byte directly from the input to the // output. As above, the byte is also written to the memo. - } else { uint8_t v = r.get_u8(); w.put_u8(v); memo[memo_offset] = v; diff --git a/src/QuestScript.cc b/src/QuestScript.cc index 67c851ee..8204a681 100644 --- a/src/QuestScript.cc +++ b/src/QuestScript.cc @@ -1053,7 +1053,7 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = { // 15: Wave but not room cleared (set event triggered by another set) // 16: NPC casting Resta or Anti // 17: NPC casting Foie, Zonde, or Barta - // 18: NPC regained sight of player + // 18: NPC regained sight of player (not valid on 11/2000) // strB = string for NPC to say (up to 52 characters) {0xC1, "npc_text", nullptr, {INT32, CSTRING}, F_V05_V4 | F_ARGS}, @@ -1064,8 +1064,9 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = { // Disables PK mode (battle mode) for a specific player. Sends 6x1C. {0xC3, "pl_pkoff", nullptr, {}, F_V05_V4}, - // Specifies which area should be used for a specific floor, and how - // objects and enemies should be populated on that floor. + // Specifies how objects and enemies should be populated for a floor. On + // v2, the ability to reassign areas was added, which can be done with + // map_designate_ex (F80D). // regsA[0] = floor number // regsA[1] = type (0: use layout, 1: use offline template, 2: use online // template, 3: nothing) diff --git a/src/SaveFileFormats.hh b/src/SaveFileFormats.hh index 6caec162..c8a51b6b 100644 --- a/src/SaveFileFormats.hh +++ b/src/SaveFileFormats.hh @@ -529,6 +529,7 @@ struct PSOGCCharacterFile { // ItemPMT.prs, itemrt.gsl, itempt.gsl, and PlyLevelTbl.cpt). For files // larger than 1000000 bytes (decimal), the game only checks the file's // size and skips checksumming its contents. + // It seems that v3 and BB only use flag 00000001 and ignore the rest. /* 041C:0000 */ be_uint32_t validation_flags = 0; /* 0420:0004 */ be_uint32_t creation_timestamp = 0; // The signature field holds the value 0xA205B064, which is 2718281828 in @@ -539,21 +540,25 @@ struct PSOGCCharacterFile { /* 0428:000C */ be_uint32_t play_time_seconds = 0; // This field is a collection of several flags and small values. The known // fields are: - // ------zA BCDEFG-- HHHIIIJJ KLMNOPQR - // z = Function key setting (BB; 0 = menu shortcuts; 1 = chat shortcuts). + // ------AB -----CDD EEEFFFGG HIJKLMNO + // A = Function key setting (BB; 0 = menu shortcuts; 1 = chat shortcuts). // This bit is unused by PSO GC. - // A = Keyboard controls (BB; 0 = on; 1 = off). This field is also used + // B = Keyboard controls (BB; 0 = on; 1 = off). This field is also used // by PSO GC, but its function is currently unknown. - // G = Choice search setting (0 = enabled; 1 = disabled) - // H = Player lobby labels (0 = name; 1 = name, language, and level; + // C = Choice search setting (0 = enabled; 1 = disabled) + // D = Which pane of the shortcut menu was last used + // E = Player lobby labels (0 = name; 1 = name, language, and level; // 2 = W/D counts; 3 = challenge rank; 4 = nothing) - // I = Idle disconnect time (0 = 15 mins; 1 = 30 mins; 2 = 45 mins; + // F = Idle disconnect time (0 = 15 mins; 1 = 30 mins; 2 = 45 mins; // 3 = 60 mins; 4: never; 5-7: undefined behavior due to a missing // bounds check). - // J = Message speed (0 = slow; 1 = normal; 2 = fast; 3 = very fast) - // P = Cursor position (0 = saved; 1 = non-saved) - // Q = Button config (0 = normal; 1 = L/R reversed) - // R = Map direction (0 = non-fixed; 1 = fixed) + // G = Message speed (0 = slow; 1 = normal; 2 = fast; 3 = very fast) + // H, I, J, K = unknown; these appear to be used only during Japanese + // text input. See TWindowKeyBoardBase_read_option_flags + // L = Rumble enabled + // M = Cursor position (0 = saved; 1 = non-saved) + // N = Button config (0 = normal; 1 = L/R reversed) + // O = Map direction (0 = non-fixed; 1 = fixed) /* 042C:0010 */ be_uint32_t option_flags = 0x00040058; /* 0430:0014 */ be_uint32_t save_count = 1; /* 0434:0018 */ pstring ppp_username;