Author Topic: Using ChatGPT and other AIs for the development of plugins and other misc.  (Read 10991 times)

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Fantastic!

So here we are at last sort of alive and finally the various planets decided to quit trying to kill me and I'm getting back into a little bit of programming. 😭🤣 It has become necessary because (41, I at times even though as motivated as I can be and super lazy because I'm too f****** erratic to get anything done)... Therefore....

Tool assisted and AI assisted ROM hacking for the m***********g win!

This form will be dedicated as such post experiences or code snippets or other things so that we can get Ron hacking evolve to an area and era where we can do what we want without being frustrated for eons getting nothing done but keep in mind as Romney hacking is a learning experience and has a very very deep near infinite learning curve because mastery of All electronics takes usually several lifetimes... I do suggest that people do continue reading up on new things and doing new things rather than just have an AI do it for you--also though in training AI we have to help it understand that we're not trying to be so lazy that we don't understand how what we want to do and do it but the most efficient way to do that is one of the purposes of this helpful artful intelligence.


Who knows maybe we will have a few polite AI assisted ROM hackers posting on the board with us someday soon. 😎

~Z



Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Re: Using ChatGPT and other AIs for the development of plugins and other misc.
« Reply #1 on: December 22, 2023, 11:23:19 pm »
... This page left intentionally blank in case it is needed for extra non blank stuff later...


~Z

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Re: Using ChatGPT and other AIs for the development of plugins and other misc.
« Reply #2 on: December 22, 2023, 11:26:34 pm »
What follows is a quick conversation I had with chat GPT in the start of exploring this process, ... If some little kid can convince chat GPT to make a Pokemon hack then we can help it understand that we need some plugins cuz I'm lazy and I don't have time to just spend 4,000 hours on this even more I want to do like 40 hours of 4,000 hours of work haha.


Quote
Certainly, it seems you want a C# routine to edit individual hexadecimal data within a string representing items, with each item having 11 bytes of data. For this purpose, you could use C# to manipulate the hexadecimal values. Here's an example of how you might approach editing the data:

```csharp
using System;

class Program
{
    static void Main()
    {
        // Sample data
        string hexData = "0C0B5E0C15CETXTNItem names"; // Your hexadecimal data here
       
        // Split the string into individual 11-byte items
        int itemSize = 11; // 11 bytes per item
        string[] items = SplitIntoItems(hexData, itemSize);

        // Let's say you want to edit the third item's first byte
        int itemIndexToEdit = 2; // Index starts from 0
        int byteIndexToEdit = 0; // Index of the byte to edit within the item
        char newHexValue = 'A'; // Replace with your desired hexadecimal value

        // Modify the data
        string modifiedData = EditHexData(items, itemIndexToEdit, byteIndexToEdit, newHexValue);

        // Display the modified data
        Console.WriteLine("Modified Data: " + modifiedData);
    }

    // Function to split the string into individual items
    static string[] SplitIntoItems(string hexData, int itemSize)
    {
        int numItems = hexData.Length / itemSize;
        string[] items = new string[numItems];

        for (int i = 0; i < numItems; i++)
        {
            items = hexData.Substring(i * itemSize, itemSize);
        }

        return items;
    }

    // Function to edit a specific byte within a specific item
    static string EditHexData(string[] items, int itemIndex, int byteIndex, char newHexValue)
    {
        char[] item = items[itemIndex].ToCharArray();
        item[byteIndex] = newHexValue;

        return string.Join("", item);
    }
}
```

This code demonstrates a simple approach to manipulate individual bytes in a string of hexadecimal data representing items. You can modify the variables like `itemIndexToEdit`, `byteIndexToEdit`, and `newHexValue` to suit your specific editing needs.

~Z


Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1801
  • Nu-chan
    • View Profile
    • Hi trig!
So ChatGPT took that input and spit out an attempt to interpret it, but missed a few points.

It didn't know how to interpret the hexadecimal string at all. It gives advice on editing a specific character in an array of strings split from a larger string.

It's missing the most important part - getting that hex data into a readable format in the first place. Once we get that, rather than editing a specific byte, we present the item name to the user in a readable format.

Addressing the reason you want this in the first place, we'd add a little extra processing on what Temporal Flux already does. So in the case of custom characters added to the font, we'd let users specify {hex 4B} or whatever, and when turning that back into raw data, it would recognize the {hex ??} format, and turn it into just the value 4B.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Yes ChatGPT is coming a long way this is with.3.5.!

We can literally have it help us refine the missing data this shouldn't take long if we teach it the right parameters because it "won't do everything for you", it is a design teaching aid to help people with various tasks programming is one of them I'm sure that over time the more you work with AI the more "trust" you earn with it because I noticed it will do more and more for me on some tasks however some tests I've done a zillion times it will try to skip steps because it "considers" that I should already know that! 😎

I have some new findings all post in the next week or so this is pretty exciting!

~Z

Schala Zeal

  • Radical Dreamer (+2000)
  • *
  • Posts: 2149
  • I like pop tarts
    • View Profile
ChatGPT has become a boon to me as a coder and cybersecurity hacker.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Rewrote from a different post:

To provide you with useful data sets to help you build your own Chrono Trigger TileMap editor, we will cover a few of the key data structures relevant to the game's tilemaps. These data sets include the tile graphics, map data, and other key elements. Keep in mind that some of the information I share is based on general knowledge of the game and how it stores data, but actual data offsets and formats may require more in-depth exploration and reverse-engineering.

### 1. **Tile Data**:
Tile data is used to define the actual graphical tiles that appear in the game world. Each tile is a small image, typically 8x8 pixels. In Chrono Trigger, the tile graphics are stored in specific parts of the ROM in a compressed or encoded format.

- **Tile Graphics Offset**: The tile data is stored in the ROM starting at offset `0x20000` (this is approximate and may vary depending on the specific version of the ROM). The tiles are arranged in a sequence, and the graphics are typically stored in a compressed form (e.g., using LZ compression).

- **Tile Layout**: The graphical tiles are stored as a set of 8x8 or 16x16 blocks in the ROM. The layout is such that each tile's index corresponds to a unique graphic in the game's world.

### 2. **TileMap Data**:
The map data defines how tiles are arranged in the world, and it is usually stored in a different section of the ROM. Each map is a 2D array of tile indices, where each index corresponds to a tile in the graphics data. These indices tell the game which tiles to place in each position on the map.

- **Map Data Offset**: In Chrono Trigger, map data is stored in several locations, often beginning at offset `0x30000` (again, this is approximate). Each map has its own set of map data, and the game uses references to tile indices from the tile graphics section to assemble the map.

- **Map Structure**:
  - **Map Size**: The map data is organized into 2D grids (usually 32x32 or 64x64 tiles, depending on the area).
  - **Tile Indices**: The map data consists of tile indices, which are numbers that point to the corresponding tile graphic in the tile set. These indices may also be offset by specific values.
  - **Layer Data**: Some maps may have multiple layers (e.g., foreground and background), and each layer will have its own map data.

### 3. **Palette Data**:
In addition to tile and map data, each tile can have its own palette (set of colors) that is used for rendering. Palette data defines how the game colors each tile based on a set of 15 colors.

- **Palette Data Offset**: Palette data for map tiles is typically stored around `0x50000` in the ROM. This palette data is referenced by the map data and determines the colors used for each tile.

### 4. **Tile Animation**:
Some tiles in Chrono Trigger (such as water tiles or animated tiles) are animated. These animations are stored as part of the map data or in separate animation data structures.

- **Animation Data**: Animation data is often stored separately in the ROM, with each animated tile referencing a set of tiles that are displayed in sequence to create the animation. The animation frames are typically stored as separate tile indices and are referenced by a special animation table in the map data.

### 5. **Map-Specific Information**:
Each map has additional metadata that helps the game load it correctly. This includes things like object positioning, collision data, and event data.

- **Event Data**: Chrono Trigger uses event flags and object data for interactive elements within the map, such as NPCs or items. These are often stored in the same section as the map data or in a separate structure. Event data is vital for editing maps with TemporalFlux, as it determines how interactive elements function on the map.

- **Collision Data**: Each map has collision information that determines whether the player can walk on certain tiles. This data is stored alongside the map data and must be edited carefully to prevent breaking the game’s logic.

### Known Data Structures (Approximate Offsets):
Here’s a summary of where to find key data in the ROM. Please note these are rough estimates and may vary by ROM version or localization.

| Data Type              | Approximate Offset | Description |
|------------------------|--------------------|-------------|
| **Tile Graphics**       | `0x20000`          | Graphics data for tiles. Often compressed. |
| **Map Data**            | `0x30000`          | Layout of tiles, including indices for the tiles used. |
| **Palette Data**        | `0x50000`          | Color palettes for tiles. |
| **Event Data**          | Varies by map      | Event flags and object data that define interactions. |
| **Animation Data**      | Varies             | Data for animated tiles (e.g., water, animated objects). |
| **Collision Data**      | Varies             | Information about where the player can walk (collision data). |

### Tools You Can Use:

1. **Tile Layer Pro** or **YY-CHR**: These are excellent tools for inspecting tile graphics directly in the ROM. You can view the individual 8x8 or 16x16 tiles and modify them as needed.
 
2. **TemporalFlux**: TemporalFlux will help you manage map data, event data, and tiles in a more user-friendly way. While it abstracts away some of the complexity, understanding how the data is structured at a low level will still be important.

3. **Hex Editors**: A hex editor like **HxD** or **010 Editor** will allow you to manually examine the raw data of the ROM and find the offsets where tiles, maps, and other data are stored.

### Final Notes:
- **Compression**: Chrono Trigger uses a form of compression for storing its tile data, so when extracting or editing the ROM, you might need to decompress or re-compress the data. A popular method for this is LZ77 compression, but the exact method used by Chrono Trigger might be slightly different.
 
- **ROM Version**: Be aware that the ROM version may vary (for example, the Japanese version vs the English version). The exact offsets and data layout might be slightly different across versions, so you should verify the offsets with the ROM you're working with.

Once you identify and understand the data structures, you can start modifying them using TemporalFlux or create your own editor by reading and writing the map and tile data back into the ROM.

If you want further help with reverse-engineering specific sections or creating tools for this, let me know!
/ChatGPT

Z: "We need more information...because some of the graphics have animated tilesets, for instance, Heckran Caverns has a water graphic animation, can you provide more details?"

Quote
You're absolutely right! Some locations in *Chrono Trigger*, like Heckran Caverns, feature animated tiles, and these tiles are handled differently from static ones. This requires a deeper dive into how animated tiles are stored, managed, and referenced in the ROM. Let's break this down further and explore how animated tiles work and where they might be stored.

### Animated Tiles in Chrono Trigger:
Animated tiles in *Chrono Trigger* (such as the flowing water in Heckran Caverns) are tiles that consist of multiple frames and are displayed in sequence to create the illusion of animation. For instance, water tiles might cycle through several different graphical states to simulate movement.

These animated tiles require special handling, both in terms of graphics and map data.

---

### **1. Structure of Animated Tiles**:
Animated tiles in *Chrono Trigger* are stored in a way that allows for multiple frames to be shown in sequence. This is done by referencing a set of tiles and updating the map data at specific intervals.

Here’s how this works in terms of data structures:

- **Tile Sets**: As with regular tiles, animated tiles are stored in the tile set (usually 8x8 or 16x16 pixel blocks). Each frame of an animated tile is simply a reference to a different tile within the set.
- **Tile Animation Data**: The animation is controlled by a table or array that holds the tile indices for each frame of the animation. This table tells the game how to switch between different tiles to create the animation effect.

---

### **2. Offsets for Animated Tile Data**:
While Chrono Trigger’s exact structure for animated tiles is complex and depends on the version of the ROM, we can make some general observations based on how other SNES games store animation data:

- **Animation Table**: This table stores how tiles should change over time. It tells the game which tile index to display at each frame. For example, if a tile is animated in four frames, the animation table will store the indices for these four tiles.
  - The **animation table** is typically stored in the same general area as the map data but is located after the static tile indices for normal tiles.
 
- **Tile Indices for Animation**: The game will reference these tiles from the **tile set** (where the graphical tiles are stored), and each frame of animation corresponds to a different tile. The tile indices are stored in an array, which is updated at regular intervals to change the tile displayed on the screen.

- **Timing Data**: In addition to the animation frames, the game needs to know how long each frame should be displayed before moving on to the next one. This timing data could be embedded in the same table as the tile indices or in a separate structure.

---

### **3. Animation Handling for Specific Areas (e.g., Heckran Caverns)**:
Let’s use Heckran Caverns as an example, where water flows in an animated fashion. The animation is composed of a few key elements:

1. **Water Tile Set**: The tiles for water might be stored in a specific area of the ROM. These could be separate tiles that form a "water" tile set (or graphic sheet) in the tile data.
2. **Map Data**: The map data in the Heckran Caverns will reference these water tiles at specific locations in the map. Each map location that has a water tile will reference the animated tile index rather than a static one.
3. **Animation Frames**: The animated water will be composed of several frames that cycle over time, providing the effect of flowing water. These frames will all point to different tile indices, such as:
   - **Frame 1**: A specific tile representing still water.
   - **Frame 2**: A slightly more rippled version of water.
   - **Frame 3**: A more aggressive ripple.
   - **Frame 4**: Water splashing, etc.
   
4. **Animation Timing**: The game logic will update the map or tile data at certain intervals to switch between the frames. Each frame might be displayed for a certain number of cycles (e.g., 1/4th of a second) before moving on to the next frame in the animation.

---

### **4. Offsets and Location of Animated Tile Data**:
Unfortunately, the exact offsets for animated tiles vary depending on the version and localization of the ROM you're working with. However, we can provide more guidance on how to locate and manipulate this data:

- **General ROM Layout**:
  - **Tile Data**: Generally starts around `0x20000` as previously discussed. This is where you can find the raw graphical tiles.
  - **Map Data**: Starts at around `0x30000` and stores the layout of how tiles are arranged on the map.
  - **Animation Data**: Animation tables for specific tiles are often stored after the map data or in a separate section. These may start around the range of `0x40000` or `0x50000`, but you will need to verify these locations using tools like a hex editor or ROM disassembler.
 
- **Identifying Animated Tiles**:
  - Use **Tile Layer Pro** or **YY-CHR** to inspect the tile set around the areas where you know animation occurs (such as water tiles). You should see that there are several tiles that look like they could be animated (e.g., slightly different water ripples).
  - Once you've identified the animated tiles in the tile set, you can cross-reference them with the map data at the relevant offset (such as in Heckran Caverns) to see which tiles are being referenced in the animation.
 
- **Tracking Animation Tables**:
  - If you know the general range of the map data and tile sets, you can search for data tables or arrays that contain multiple references to tile indices. These arrays often contain the animation frames for a specific tile or object.
  - Look for references that are not sequential—this can indicate an animation table where tiles are being cycled between rather than just referenced linearly.

---

### **5. Tools for Managing Animated Tiles**:
- **TemporalFlux**: TemporalFlux has support for editing animated tiles, but you may need to dive deeper into its tools to fully understand how to handle the animation timing and frame data. It should allow you to manipulate animated tiles at the map level, but for a more granular look, you’ll need to explore how it handles the raw tile indices.
 
- **Tile Layer Pro** or **YY-CHR**: These are invaluable for manually inspecting and editing tile graphics. You can view and modify the tile data and make changes to how animated tiles are displayed.

- **Hex Editors**: For more advanced manipulation, you can use a hex editor (like **HxD**) to locate the raw tile data and animation tables in the ROM.

---

### **Final Thoughts**:
Understanding how Chrono Trigger handles animated tiles requires a combination of graphics exploration, map data examination, and understanding how the game cycles between tiles. With animated tiles, the core idea is that multiple tiles (each representing a frame) are displayed in sequence to create the animation.

You can:
- Start by identifying the water tiles and animation data in Heckran Caverns or similar areas.
- Explore the animation tables and frame timing data to control the flow of animation.
- Use tools like **Tile Layer Pro**, **YY-CHR**, and **TemporalFlux** to manage this data.

If you are able to locate the specific areas in the ROM that deal with animation (tile index references, animation tables, timing data), you can modify and extend them to create your own custom animations.

Let me know if you need help diving into specific sections of the ROM or additional examples!


Z: "We need hex values from the ROM"

Quote
To provide specific **hex values** and offsets for animated tile data (such as the water tiles in **Heckran Caverns**) in *Chrono Trigger*, I would normally recommend using a **hex editor** or a specialized tool to explore the ROM data directly. Unfortunately, I cannot provide exact hex values directly from the ROM, but I can guide you through how to extract and explore this data using tools and resources.

### General Approach to Finding Animated Tiles in Chrono Trigger's ROM:

#### 1. **Finding the Water Tiles (Example: Heckran Caverns)**:
The process of finding the animated water tiles in the ROM involves several steps. Here’s how you can proceed:

1. **Identify Tile Set Data**:
   - Start by opening the ROM with a hex editor like **HxD** or **010 Editor**. The tile graphics, including animated tiles like water, are stored starting around `0x20000` in the ROM. This location is where graphical tiles are usually kept.
   - **Look for tile patterns**: By inspecting the data, look for patterns that resemble the graphical representation of water. Water tiles in Heckran Caverns typically look different from normal tiles and may have several variations (such as waves or ripples).

2. **Examine Animated Tiles**:
   - **Water Tiles**: The animated water tiles will likely be sequential in this area of the ROM. If water has multiple frames (such as flowing or rippling), you should see different tile data that slightly changes for each "frame" of the animation. For example, a water ripple effect might have four distinct graphical states.
   - You may notice that each of these variations has a distinct **tile index** (e.g., `0x1234`, `0x1235`, `0x1236`, etc.), and these are referenced in the **map data** to form the animation.

3. **Locate Map Data**:
   - Map data generally begins around `0x30000` in the ROM (this can vary). The map data tells the game how to lay out the tiles on the screen by referencing tile indices from the tile set.
   - In the case of animated tiles, you’ll see that the map data references **multiple tiles** in sequence for each animated tile. For example, if an animated water tile consists of four frames, you might see four sequential tile indices in the map data that correspond to these frames.

4. **Find Animation Tables**:
   - In addition to the tile indices, there is an **animation table** that controls the timing of the frame changes. The game needs to know how long to display each tile before switching to the next one. This is usually stored after the map data.
   - **Search for animation table**: The animation table is an array or list that defines the sequence of tile indices for the animation. The table will reference each animated tile’s frame, and you can edit the timing here (though the format may differ by ROM version).

---

### Hex Values You Might Encounter:

Since you’re working with specific data for **animated water tiles**, here’s a hypothetical breakdown of the kinds of values you might see. This is just a general idea of how the data might be structured and is meant for reference. You’ll need to examine the actual ROM to see the values.

#### Example (Heckran Caverns Animated Water Tiles):

- **Tile Set Data (0x20000 - 0x22000)**:
  - This range might contain graphical data for tiles, including water. Each 8x8 tile or 16x16 tile will have its own sequence of bytes representing the pixel data in a compressed or raw format.

  **Example (Water Tile Indices)**:
  - `0x1234` – Frame 1 of water (still water).
  - `0x1235` – Frame 2 of water (slightly rippled).
  - `0x1236` – Frame 3 of water (strong ripples).
  - `0x1237` – Frame 4 of water (splashing water).
 
  The sequence of values might vary, but each tile index points to a unique graphical frame for the animation.

- **Map Data (0x30000 - 0x32000)**:
  - This section stores the actual layout of the tiles, referencing the tile indices defined earlier.
 
  **Example (Map Data referencing Animated Tiles)**:
  - `0x1234` – Water tile (Frame 1).
  - `0x1235` – Water tile (Frame 2).
  - `0x1236` – Water tile (Frame 3).
  - `0x1237` – Water tile (Frame 4).
 
  The map data is structured as a grid of tile indices. For animated tiles, you might see a similar series of indices placed together in the map data.

- **Animation Table (0x40000 - 0x42000)**:
  - If there’s a dedicated animation table for Heckran Caverns’ water, you may find entries like:
 
  **Example (Animation Table)**:
  - `0x1234` – Frame 1 of water.
  - `0x1235` – Frame 2 of water.
  - `0x1236` – Frame 3 of water.
  - `0x1237` – Frame 4 of water.
 
  Each frame corresponds to one of the previously mentioned tile indices. The timing of these frames will likely be specified by additional timing values in the animation table.

---

### Using Tools to Extract Data:

#### **Hex Editor (HxD or 010 Editor)**:
- Open the ROM in the hex editor and navigate to the relevant offset, such as `0x20000` for tile graphics.
- Search for repeating patterns or familiar tile data to find where animated tiles are stored.
- Once you identify the water tiles, cross-reference them with the map data at `0x30000` or similar areas.

#### **Tile Editing Tools**:
- **Tile Layer Pro** and **YY-CHR** can be used to visually inspect and modify the tile graphics. They allow you to easily view the 8x8 or 16x16 tiles and spot which ones belong to the animated sequences.

#### **TemporalFlux**:
- TemporalFlux will handle the map layout and animation data more easily, especially if you use it to modify the game’s data directly. Check TemporalFlux’s documentation for specific support related to animated tiles.

---

### How to Edit and Test:

1. **Extract Data**: Use a hex editor or tile editing tool to locate the animated tiles (such as the water tiles) and their corresponding tile indices.
2. **Modify Animation Frames**: If you're adding or modifying animation, update the sequence of tile indices that represent the animation.
3. **Update Map Data**: If necessary, update the map data to reference the new or modified animated tiles.
4. **Test in Game**: Once you've made changes to the ROM, load it in an emulator (such as **SNES9x**) to test and verify that the animation is working as expected.

---

### Final Notes:

- **Compression**: Some of the tile data may be compressed, so you might need to decompress it before editing. This is common in SNES games. You can use decompression tools or write custom scripts if you're comfortable with reverse engineering.
- **Offsets**: The exact values for offsets and data structures can vary slightly depending on the version or localization of the ROM. You'll need to cross-check with your specific ROM to find precise locations for tile sets, map data, and animation tables.

---

If you need further assistance with identifying the exact byte values or offsets in your ROM, I recommend using a combination of tools like **HxD**, **Tile Layer Pro**, and **TemporalFlux**, and testing with a debugger to pinpoint the exact locations of animated tiles.

/ChatGPT

This might be useful...

~Z

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1801
  • Nu-chan
    • View Profile
    • Hi trig!
Quote
The tile data is stored in the ROM starting at offset `0x20000` (this is approximate and may vary depending on the specific version of the ROM).
That area of the ROM is mostly menu and overworld code in all known SNES ROM versions.
Quote
Palette data for map tiles is typically stored around `0x50000` in the ROM. This palette data is referenced by the map data and determines the colors used for each tile.
That area is all overworld sprites.

Quote
In Chrono Trigger, map data is stored in several locations, often beginning at offset `0x30000` (again, this is approximate). Each map has its own set of map data, and the game uses references to tile indices from the tile graphics section to assemble the map.
Decompression Routine, overworld animations, overworld events, overworld palettes, etc.

Most of the specific information it provided is wrong. Probably looks good in a post that supports markdown though.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Quote
The tile data is stored in the ROM starting at offset `0x20000` (this is approximate and may vary depending on the specific version of the ROM).
That area of the ROM is mostly menu and overworld code in all known SNES ROM versions.
Quote
Palette data for map tiles is typically stored around `0x50000` in the ROM. This palette data is referenced by the map data and determines the colors used for each tile.
That area is all overworld sprites.

Quote
In Chrono Trigger, map data is stored in several locations, often beginning at offset `0x30000` (again, this is approximate). Each map has its own set of map data, and the game uses references to tile indices from the tile graphics section to assemble the map.
Decompression Routine, overworld animations, overworld events, overworld palettes, etc.

Most of the specific information it provided is wrong. Probably looks good in a post that supports markdown though.

Perfect. This is the documentation we needed to prove that AI is not yet up to it's (StarTrek Capabilities)  this WILL BE recompensated to recallibration, THANK YOU!

~Z

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Quote
The tile data is stored in the ROM starting at offset `0x20000` (this is approximate and may vary depending on the specific version of the ROM).
That area of the ROM is mostly menu and overworld code in all known SNES ROM versions.
Quote
Palette data for map tiles is typically stored around `0x50000` in the ROM. This palette data is referenced by the map data and determines the colors used for each tile.
That area is all overworld sprites.

Quote
In Chrono Trigger, map data is stored in several locations, often beginning at offset `0x30000` (again, this is approximate). Each map has its own set of map data, and the game uses references to tile indices from the tile graphics section to assemble the map.
Decompression Routine, overworld animations, overworld events, overworld palettes, etc.

Most of the specific information it provided is wrong. Probably looks good in a post that supports markdown though.

This will also help us: Can you provide more information on the subject matter that I have 'misprovided' I think that will help us in ROMHACKING (because someone made a GAMEBOY hack using ONLY chatGPT, and it would be super-useful to program AI with the CORRECT INFORMATION. :D

Also Meaning: We NEED TO UDPATE THE CT documents, ARCHIVES, INFOS etc. to a NEW UNIFIED STANDARD. THIS WOULD BE INEVITABLE and INVALUABLE to do. MAY AS WELL BE US. :)


~Z
« Last Edit: January 07, 2025, 03:31:20 pm by Zakyrus »

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Re: Using ChatGPT and other AIs for the development of plugins and other misc.
« Reply #10 on: January 17, 2025, 02:17:26 pm »
Still (wip):
Quote
1. **File Handling:** In C++, we can open a binary file (e.g., a `.ROM` file for SNES) using file streams.
2. **Hexadecimal Data Manipulation:** Instead of manipulating a string, we will be working directly with bytes.
3. **Flexible Editing:** We'll allow the user to edit specific bytes within the ROM data.

Here’s a more diversified and complete C++ program that opens a `.ROM` file, allows you to read its hexadecimal data, and edit bytes within the file. The program will:
- Load the ROM file into memory.
- Allow the user to view a section of the ROM file in hexadecimal format.
- Edit specific bytes within the ROM.
- Save the modified ROM file back.

### Example C++ Code:
Code: [Select]
#include <iostream>
#include <fstream>
#include <vector>
#include <iomanip>  // For formatting hex output

using namespace std;

// Function to display a portion of the ROM file in hexadecimal
void displayHex(const vector<unsigned char>& romData, size_t start, size_t length) {
    for (size_t i = start; i < start + length && i < romData.size(); ++i) {
        cout << hex << setw(2) << setfill('0') << (int)romData[i] << " ";
        if ((i - start + 1) % 16 == 0) {
            cout << endl;
        }
    }
    cout << endl;
}

// Function to load the ROM file into memory
vector<unsigned char> loadROM(const string& filename) {
    ifstream file(filename, ios::binary | ios::ate);
    if (!file.is_open()) {
        cerr << "Error opening file!" << endl;
        exit(1);
    }

    size_t size = file.tellg();
    file.seekg(0, ios::beg);
    vector<unsigned char> romData(size);
    file.read(reinterpret_cast<char*>(romData.data()), size);
    file.close();

    return romData;
}

// Function to save the modified ROM data back to the file
void saveROM(const string& filename, const vector<unsigned char>& romData) {
    ofstream file(filename, ios::binary);
    if (!file.is_open()) {
        cerr << "Error saving file!" << endl;
        exit(1);
    }

    file.write(reinterpret_cast<const char*>(romData.data()), romData.size());
    file.close();
}

// Function to edit a byte at a specific location in the ROM data
void editByte(vector<unsigned char>& romData, size_t index, unsigned char newValue) {
    if (index >= romData.size()) {
        cerr << "Invalid index!" << endl;
        exit(1);
    }
    romData[index] = newValue;
}

int main() {
    string romFile = "yourfile.rom";  // Replace with your ROM file path
    vector<unsigned char> romData = loadROM(romFile);

    size_t startAddress = 0x1000;  // Example starting address for display
    size_t length = 64;  // Display length in bytes
    cout << "Displaying ROM data starting from address 0x" << hex << startAddress << ":" << endl;
    displayHex(romData, startAddress, length);

    // Ask user for byte to modify
    size_t indexToEdit;
    cout << "Enter the index (in decimal) of the byte you want to edit: ";
    cin >> indexToEdit;
    unsigned char newHexValue;
    cout << "Enter the new value (in hex, e.g., 0xAA): ";
    cin >> hex >> newHexValue;  // Input in hexadecimal format

    // Edit the byte at the specified index
    editByte(romData, indexToEdit, newHexValue);

    // Save the modified ROM back to the file
    saveROM(romFile, romData);

    cout << "ROM modified and saved successfully!" << endl;

    return 0;
}
```

### Breakdown of the Code:

1. **Loading the ROM File:**
   - We use `ifstream` to open the `.ROM` file in binary mode and read it into a `vector<unsigned char>`, which stores the file's data in memory.
   
2. **Displaying Hexadecimal Data:**
   - The `displayHex` function prints the ROM data from a given start address, showing a specified number of bytes in hexadecimal format.
   - `setw(2)` ensures each byte is printed as two hex digits.

3. **Editing a Byte:**
   - We use `editByte` to modify the byte at a specific index in the vector.
   - The user inputs the index and the new hexadecimal value, which is parsed and stored in the `newHexValue`.

4. **Saving the Modified ROM:**
   - After making the changes, we use `ofstream` to overwrite the original `.ROM` file with the updated data.

### Notes:
- **File Size**: This program loads the entire ROM into memory, which may not be efficient for very large ROM files. If you're working with very large files, you might need to modify the code to work with chunks instead of loading the entire file.
- **Index Input**: The program expects the user to enter a valid index. It performs basic error handling for index validation.
- **Hexadecimal Input**: The user provides the new byte value in hexadecimal format (`0xAA`, for example).
 
### Example Output:

```
Displaying ROM data starting from address 0x1000:
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...
Enter the index (in decimal) of the byte you want to edit: 20
Enter the new value (in hex, e.g., 0xAA): 0xFF
ROM modified and saved successfully!
```
This provides a flexible base(simple) to manipulate SNES ROM files in C++.

~Z
« Last Edit: January 17, 2025, 02:18:31 pm by Zakyrus »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1801
  • Nu-chan
    • View Profile
    • Hi trig!
Re: Using ChatGPT and other AIs for the development of plugins and other misc.
« Reply #11 on: January 17, 2025, 05:17:24 pm »
Tell me, in your own words, what that program does.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Re: Using ChatGPT and other AIs for the development of plugins and other misc.
« Reply #12 on: January 19, 2025, 06:14:48 pm »
Code: [Select]
size_t indexToEdit;
    cout << "Enter the index (in decimal) of the byte you want to edit: ";
    cin >> indexToEdit;
    unsigned char newHexValue;
    cout << "Enter the new value (in hex, e.g., 0xAA): ";
    cin >> hex >> newHexValue;  // Input in hexadecimal format

The gist of it is here: Basically cout(c->out) outputs the input of what the user is required to enter for the variable, which cin(c->in) accepts and sends to variable(indexToEdit), then again with (newHexValue)-->which is BASICALLY an 'ENTER hex value to replace with other hex value'.

This is the pre-lude to the HEXIDIXER(which will have 50 hex values as a TemporalFlux .import/.export system per "sheet")--could do more but 50 at a time seems logical per window without being to convoluted.

~Z

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1801
  • Nu-chan
    • View Profile
    • Hi trig!
Re: Using ChatGPT and other AIs for the development of plugins and other misc.
« Reply #13 on: January 20, 2025, 02:57:32 pm »
Ok, that is a decent summary of what it does - arbitrary editing of a specific address.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1413
  • ...is trying to become a better MAN, and demi-god!
    • View Profile
Re: Using ChatGPT and other AIs for the development of plugins and other misc.
« Reply #14 on: January 22, 2025, 01:41:09 pm »
Ok, that is a decent summary of what it does - arbitrary editing of a specific address.

Yes!! YUS!! YESS!!!! THAT is what we are hoping to ACCOMPLISH with AI assist(without extra "miscreant B.S.!" yes!! haha!

I'll continue doing this stuff(*AS LONG AS* it can be easiliy refined from having AI do less then useful, then we can get OUR JOBS done faster with -0(divided by)/ B.S.! heheheeeee! --WHATEVER THE FAWK that means, lol >:-}


~Z
« Last Edit: January 22, 2025, 01:42:26 pm by Zakyrus »