Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - glennxserge

Pages: [1] 2 3
1
Hey Grobycftw, I'm poking around and wanting to test some of the unknown commands, but I'm only getting halfway started. 

I'll run through the steps I'm imagining I'll need to take to make edits and check commands from the fieldscript files.  I'd love some pointers if you've got em for what's worked for you:
1. Dump disc ISO to files
2. Uncompress fieldscript files
3. Make edits
4. Recompress
5. Build ISO
6. Check behavior in emulator

That's a pretty crude way to iterate but I figured I'd start there. 
I've managed to get the disc dumped, with some modifications to purple cat tools (some windows issues with library paths), but I'm not having any luck rebuilding.  I end up with an ISO that fails to boot, even without any edits.

My backup method is a little more painful to set up, but probably faster to test incrementally:
1. Uncompress a fieldscript file
2. Run Chrono Cross in an emulator with debugger
2. Track disc reads and memory and find where in RAM it ends up
3. Make edits to RAM and observe

If you've got any advice for things that helped you test, I'd be grateful.  In particular if you know of script files that contain a mix of known and unknown opcodes, that would also be super helpful.

2
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: August 08, 2024, 03:39:32 pm »
Poking around the unpacked disk files, it looks like this lzss file is part of the 0008.end_combat_info.cpt, which makes sense since that's when levels increase and slots open up.  It's the second file in that grouping.  I was able to delzss the file and confirm the contents.

Might be worth updating the https://www.chronocompendium.com/Term/0008.html section to include this info, since there's already a page for the drop table list that's part of that cpt file.  I'm happy to help there if it's useful, ZeaLitY.

3
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: July 18, 2024, 03:08:01 am »
Thanks, Grobycftw!  Appreciate the extra help along the way.  With element growth out of the way, I was thinking of helping with the fieldscript unknowns.  I'll probably have more questions for you, but I'll leave them in the other thread.

4
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: May 29, 2024, 04:24:35 am »
OK, I've been able to walk this growth table back to the source on disc.  It lives 0x0016A750 on disc one, and is a lzss compressed file.  Which is why it's been so hard to trace this through a debugger.  The decompression routine made it very hard to find.  The file header indicates the uncompressed size should be 800 bytes, which matches the growth table size.  I was able to pinpoint a literal in that file that aligned with star level 2's slot and was able to change it to unlock any position on the grid.  With proper decompression/compression insertion I think it would be trivial to adjust these. 

At this point, I guess I've answered the question I had which is 'how does element level growth work?'; turns out it's defined in a lookup table.  I was hoping for something simpler edit in place for modding, but I'm satisfied with having an answer.

5
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: May 14, 2024, 07:59:38 pm »
Well, another year has gone by, and I finally had some time to sit down and plug away on this problem again.  Not solved yet, but I'm much closer now.

There's a bunch of weird MIPS stuff in the post battle routine that took a while to sort through, but I was able to unpack the element growth tables and verify that you can alter this table and unlock a slot anywhere in the element grid at any level, provided the character's stat block has the right mask to allow it. 

The growth tables are explicitly defined as 100 consecutive 8 byte strides.  Each 8 bytes represents one star level, with the character's growth stat at 0x03 determining which of the 8 bytes is used for their grid.  I've compiled the standard 8x8 element grid with the table values that correspond to unlocking that slot as a reference, which I'll list below.

Code: [Select]
    Element Grid
1  2  3  4  5  6  7  8
-----------------------
02 0C 16 20 2A 34 3E 48
03 0D 17 21 2B 35 3F 49
04 0E 18 22 2C 36 40 4A
05 0F 19 23 2D 37 41 4B
06 10 1A 24 2E 38 42 4C
07 11 1B 25 2F 39 43 4D
08 12 1C 26 30 3A 44 4E
09 13 1D 27 31 3B 45 4F
These values are actually pretty easily derived, despite the game's obtuseness in how it generates them.  Given a row and column, the slot values is:
column * 10 + row + 2  //Decimal values, indexes start at 0

The table that the game generates ends up at 0x80101448 through some sort of DMA transfer, but I'm unfamiliar with doing traces of DMA requests through emulation.  There's probably some way to find where it's coming from.  That'll be my next test.  In the meantime, here's the full, 100 star level entry, that represents the element growth for all characters:

Code: [Select]
☆LV Growth Pattern Index
----------------------------------
0 FF FF FF FF FF FF FF FF   <--- 8 FF's mean the level up routine skips entirely
1 07 07 07 FF 08 08 08 07   <--- a single FF means that one growth index skips
2 11 11 11 FF 12 12 12 11
3 1B 1B 1B FF 1C FF 1C 1B
4 08 05 FF FF FF FF 26 05
5 24 0F 24 FF 09 FF 30 0F
6 12 19 FF 07 07 07 07 19
7 05 24 FF 11 11 11 11 24
8 0F FF 25 1B 1B 1B 1B FF
9 19 08 FF 25 25 25 25 08
10 25 25 FF 24 24 24 24 25
11 2E 2E 2E 05 05 05 05 2E
12 04 FF FF 2E 2E 2E 2E FF
13 23 23 FF 0F 0F 0F 0F 23
14 0E 04 FF 19 19 19 19 04
15 2F 2D 2F 2F 2F 2F 2F 2D
16 18 38 FF 04 04 04 04 38
17 09 FF FF 23 23 23 23 FF
18 38 0E 38 0E 0E 0E 0E 0E
19 03 2F FF 2D 2D 2D 2D 2F
20 0D 12 FF 18 18 18 18 12
21 2D 18 39 38 38 38 38 18
22 02 39 FF FF FF FF FF 39
23 22 FF FF 03 03 03 03 FF
24 17 1C 43 0D 0D 0D 0D 1C
25 1C 42 FF 39 39 39 39 43
26 42 03 42 22 22 22 22 03
27 13 37 05 17 17 17 17 37
28 26 22 08 FF 13 1C 42 22
29 39 26 0F FF 37 26 37 26
30 21 FF 19 FF 02 FF FF FF
31 0C 0D 12 FF 42 30 2C 0D
32 1D 41 23 FF FF 37 21 42
33 30 30 2D FF 0C 3A 41 30
34 37 17 37 FF 26 43 FF 17
35 43 02 41 FF 2C FF 36 02
36 2C FF 04 FF FF 02 2B FF
37 4C 4C 4C FF 43 42 43 4C
38 FF 3A 0E FF 30 2C 4C 3A
39 16 2C 1C FF 4C FF 3A 2C
40 3A 43 26 FF FF 4C FF 41
41 4D 21 18 FF 21 17 4B 21
42 FF 44 30 FF FF FF FF 44
43 44 0C 3A FF 4D 41 4D 0C
44 4E 36 4D FF FF FF 40 36
45 FF 4D 22 FF FF 36 35 4D
46 41 2B 2C FF FF 4D 4A 2B
47 27 4E 44 FF FF FF FF 4E
48 4B 40 FF FF FF FF FF 40
49 FF 4B FF FF FF FF FF 4B
50 FF 35 FF FF FF FF FF 35
51 FF 4A FF FF FF FF FF 4A
52 FF FF FF FF FF FF FF FF
53 FF FF FF FF FF FF FF FF
54 FF FF FF FF FF FF FF FF
55 FF FF FF FF FF FF FF FF
56 FF FF FF FF FF FF FF FF
57 FF FF FF FF FF FF FF FF
58 FF FF FF FF FF FF FF FF
59 FF FF FF FF FF FF FF FF
60 36 FF FF FF FF FF FF FF
61 FF FF FF FF FF FF FF FF
62 FF FF FF FF FF FF FF FF
63 40 FF FF FF FF FF FF FF
64 FF FF FF FF FF FF FF FF
65 FF FF FF FF FF FF FF FF
66 4A FF FF FF FF FF FF FF
67 FF FF FF FF FF FF FF FF
68 FF FF FF FF FF FF FF FF
69 3F FF FF FF FF FF FF FF
70 FF FF FF FF FF FF FF FF
71 FF FF FF FF FF FF FF FF
72 49 FF FF FF FF FF FF FF
73 FF FF FF FF FF FF FF FF
74 FF FF FF FF FF FF FF FF
75 4F FF FF FF FF FF FF FF
76 FF FF FF FF FF FF FF FF
77 FF FF FF FF FF FF FF FF
78 48 FF FF FF FF FF FF FF
79 FF FF FF FF FF FF FF FF
80 FF FF FF FF FF FF FF FF
81 FF FF FF FF FF FF FF FF
82 FF FF FF FF FF FF FF FF
83 FF FF FF FF FF FF FF FF
84 FF FF FF FF FF FF FF FF
85 FF FF FF FF FF FF FF FF
86 FF FF FF FF FF FF FF FF
87 FF FF FF FF FF FF FF FF
88 FF FF FF FF FF FF FF FF
89 FF FF FF FF FF FF FF FF
90 FF FF FF FF FF FF FF FF
91 FF FF FF FF FF FF FF FF
92 FF FF FF FF FF FF FF FF
93 FF FF FF FF FF FF FF FF
94 FF FF FF FF FF FF FF FF
95 FF FF FF FF FF FF FF FF
96 FF FF FF FF FF FF FF FF
97 FF FF FF FF FF FF FF FF
98 FF FF FF FF FF FF FF FF
99 FF FF FF FF FF FF FF FF

So for example, if you wanted Serge to unlock the most upper right slot in his grid at star level 1, after defeating the Komodo dragon boss, you'd change the first byte on line 2 from 0x07 to 0x48.  Like this:
Code: [Select]
1 48 07 07 FF 08 08 08 07
That's the short of it, but if anyone knows how the DMA stuff works, I'd love a pointer.  no$psx does spit out some debug TTY messages for when the DMA transfers happen and which interrupts get set, I just don't know how to interpret it yet.  Getting a little further here will help me figure out where the table comes from, and hopefully mean we can more easily modify it. 

Edit: Oh and I've compiled this info in a google doc that has a little better formatting.  It can be found here-> Growth Table

6
Woah, great work GrobycFTW !  That must have taken a while to figure out. 
I always wanted Miguel to be a playable character.  I'll have to try it out, and it gives me a good reason to give the purple cat tools another shot (I always run into some problem when I've tried).

7
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: July 26, 2023, 01:17:34 am »
Ah, scratch that.  The data on disc isn't being used in this case, which is really strange because it matches exactly what's in ram.  But, that just means I need to keep tracing this upstream in the game execution.  I think I'm close to finding the answer

8
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: July 23, 2023, 04:53:20 pm »
   Made some progress tracking down the lookup table.  I was able to trace execution through the star level up routine and find where it's pulling data from.  The game reads in a block of data from 0x13B6B370 on disc 1 (sector mm,ss,ff == 31,16,71), and stores it in memory at 0x80101448.  I don't understand how this data is formatted, it seems obfuscated in a way.  But I did verify it's responsible for which slots open up at specific levels.  If anyone wants to step through it in a debugger, the instruction execution for using this table starts here (after a battle if a star is earned): 801EF130

   The best summary I can make is that the game iterates over this data for the number of current star levels in 16 byte strides and uses the table data with some bit manipulation to determine which slot opens.  It then ORs the value onto another table at 0x80071C7C
   This second table is the current state of unlocked slots for all 45 characters in the game.  It's stored as a 2 byte pair of grid bitmasks.  As the star level increases, this table will eventually match the grid bitmasks defined in the character stat blocks
 
   Once this second table has been updated, the routine finishes by iterating across each 2 byte pair, shifting and masking for each slot, and checks the low bit to see if the slot is unlocked.  If that is the case, then the game clears the seventh bit of the character stat block's low byte pair (0x4000 becomes 0x0000), which makes the slot usable.

I still need to dig into that first table to try and understand how it's formatted.  But at least now we know where the data lives on disc.

9
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: July 20, 2023, 04:16:51 pm »
I managed to run the full test on all star levels from 1-99 with all unknown slots checked too.  Ended up with the same result as you, F-man.  So it looks like growth table 0 (Serge, Kid, Guile, etc..) are bound by this leveling chart, regardless of their specific element grid availability:
Code: [Select]
[  22  ][  31  ][  39  ][      ]       ][      ][      ][  78  ]
[  19  ][  20  ][  24  ][  30  ][      ][      ][  69  ][  72  ]
[  12  ][  14  ][  16  ][  23  ][  36  ][  60  ][  63  ][  66  ]
[  07  ][  08  ][  09  ][  13  ][  21  ][  34  ][  46  ][  48  ]
[  00  ][  00  ][  00  ][  05  ][  11  ][  18  ][  26  ][  37  ]
[  01  ][  02  ][  03  ][  10  ][  15  ][  29  ][  35  ][  41  ]
[  04  ][  06  ][  25  ][  28  ][  33  ][  40  ][  43  ][  44  ]
[  17  ][  27  ][  32  ][  47  ][      ][      ][      ][  75  ]

Unfortunately, that means, the next test is chasing pointers and disc reads to figure out where that table lives.  Will let you know if I find anything.

10
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: July 19, 2023, 03:49:26 pm »
That's a good test, F-man.  How are you incrementing the star level in game?  I'm taking a look at this again since I'm working through the character customization part of my tool.  I wasn't sure if the growth pattern was explicit, or something like: "at star level 1 an arbitrary first level slot opens", and then the grid layout of the character determined which slot matched that criteria.  So I did a similar test with star levels (but less complete than yours :wink:)

I tested using the grid bit masks in the player stat block to turn off the element slot that Serge learns at star level 1, and then fought the first boss.  The star level didn't yield any slots at all, which seems to imply that element growth is specifically hard coded somewhere.  I guess it's good to know that's the case, but it would be nice to have a better answer for where that information is stored. 

Oh, and one other thing that I discovered.  The stat blocks for characters only seems to apply at the point they are recruited.  So for Serge, making edits to his grid shape only worked if I started from a save state right as he's waking up at the beginning of the game.  There's probably more nuance here, but that's the only reliable way I've been able to test it.

11
Chrono Cross Modification / Re: Drop tables
« on: January 08, 2023, 03:22:46 am »
Thanks F-man for reviving this thread.  Believe it or not, it's rather timely  :lol:
I'm finishing up work on my own tool for editing parts of the game, but it only changes discreet, fixed size blocks of data (no compressed files since I'm poking values directly into the bin).  So I can only edit things like enemies, characters, shops, and elements.  Just yesterday I was thinking I should give the purple cat tools a check to see if I could incorporate battlescript, drop tables, and eins files into my application, but wasn't sure if it would work.  Thanks for confirming!  I'm going to give this a try too.

12
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: December 06, 2022, 02:42:55 am »
Thanks, ZeaLitY, I'm still pluggin' away when I have time.  I'll let you know if I learn anything new, but it's slow going.

13
Chrono Cross Modification / Re: Element Grid Growth Formula
« on: August 26, 2022, 03:26:19 am »
Hey Grobyftw!  Thanks for sharing that, lots of good details in there  :lol:

Yeah, I tried finding some kind of lookup tables that represent the 7 specific growth patterns but I didn't have any luck.  Hard to search for something without knowing how the data is packed.  I should give this another look, after I read through your doc.

14
Thanks, trig.  That's super helpful.  I'll see if I can get that extension built and installed.  Good note about the missing data folder, I think I ran into something similar.  Nice to see though that this is still working in the current release.

Your ghidra output is looking about how I'd expect.  That is to say, all the work left ahead is making sense of the code in context of the game and renaming all the generic symbols :lol:

And thanks, Vehek for the additional signatures, those seem to line up and expand on the ones in trig's output.  These will be helpful in understanding what each function is trying to do.  I'll play around with this some more and see what I can find.

Also stumbled on TDR as well when I was looking around: https://www.beneaththewaves.net/Software/This_Dust_Remembers_What_It_Once_Was.html
An unwieldy name, but seems promising as a tool.

15
I don't have the PC version, but that's definitely worth a shot.  I wonder if the debug symbols you'd get are associated more with the emulation layer than the game execution, but not sure.

I took a look at using Ghidra to start analyzing the game.  I used ISOBuster to pull the game executable out: SLUS_010.41.  You have to set the language architecture to MIPS, default, 32, little endian, but it chugged through and made some sense of it.  I'm not sure it's starting in the right place though as it gets hung up eventually decompiling at 0004E868; constructor error.

I wasn't able to get the PSYQ extension stuff working through ghidra_psx_ldr, but I imagine some of those overlays will make a lot more sense with general PSX engine stuff identified.

Has anyone else successfully built ghidra_psx_ldr for Ghidra 10.1.4?

Pages: [1] 2 3