Skip to content

Conversation

@HansGR
Copy link

@HansGR HansGR commented Mar 24, 2022

This branch uses the WC memory allocation utilities to add explicit default configuration bytes in generated ff6wc.smc roms. These default configuration bytes allow the use of the included command-line configuration tool, "wc_config.py," to set default configuration options in a patched ff6wc.smc rom. The configuration utility reads the location of the configuration bytes from the ff6wc rom, so this solution should be generally compatible with any further codebase updates using WC memory allocation.

Relevant changes are as follows:

  • settings/init.py: New lines add two default configuration bytes using WC memory allocation & update JSR calls to those configuration bytes
  • wc_config.py: The configuration tool: called from command line as "python wc_config.py -i ff6wc.smc " See Readme for details.
  • config/config.py: Holds functions & constants used by wc_config.py
  • config/wcrom.py: Class to load a patched FF6wc rom. (This is a copy of memory/rom.py with the valid rom check disabled.)

HansGR and others added 12 commits January 19, 2022 12:41
Initial commit.  Code utilizes the memory.rom object from WorldsCollide.  Use config.set_config_rgb(rom, name, values) to change the default window coloration settings in the ROM.  name is "Window1", "Window2", etc., or "Font".  values is the RGB triple shown in the configuration menu [R, G, B].
Proof-of-concept for patching an already-patched FF6wc rom to customize default settings.  Currently supports:
- Bat.Mode (False = "Active", True = "Wait")
- Bat.Speed (1--6)
- Msg.Speed (1--6)
- Cmd.Set  (False = "Window", True = "Short")
- Window palettes (1--8, seven RGB triplets each)
- Font palette (one RGB triplet)
Does not currently support the following, which are all zero by default and therefore have no default value stored in ROM.  Supporting these will require some additional memory use.
- Gauge (on/off)
- Sound (stereo/mono)
- Cursor (reset/Memory)
- Reequip (optimum/Empty)
- Controller (single/multiple)
- Mag.Order (1--6)
Python routine for command-line patching all default configuration options, including:  Bat. Mode, Bat. Speed, Msg. Speed, Cmd.Set, Gauge, Sound, Cursor, Reequip, Mag. Order, Font color, Wallpaper, and Window palettes.  See Readme.md for examples of usage.

Note this uses a version of memory.rom.ROM() that allows bypassing the valid_rom_file check, in order to allow post-patching of FF6wc roms.

Technical notes:
New code was required to save default  configurations to the ROM for several options that were previously just defaulted to zeros.  This code (12 bytes) was added at memory address C3/FC18--C3/FC23, which was free in several patches of wc.py version 1.0.1.
Python routine for command-line patching all default configuration options, including: Bat. Mode, Bat. Speed, Msg. Speed, Cmd.Set, Gauge, Sound, Cursor, Reequip, Mag. Order, Font color, Wallpaper, and Window palettes. See Readme.md for examples of usage.

Note this uses a version of memory.rom.ROM() that allows bypassing the valid_rom_file check, in order to allow post-patching of FF6wc roms.

Technical notes:
New code was required to save default configurations to the ROM for several options that were previously just defaulted to zeros. This code (12 bytes) was added at memory address C3/FC18--C3/FC23, which was free in several patches of wc.py version 1.0.1.
Updated command-line configurator.  Version 2 uses WC-style dynamic memory allocation to add the explicit memory location for all configuration bytes (modification in WorldsCollide/Settings/__init.py).  wc_config.py reads the memory location from the ff6wc.smc rom and updates the configuration bytes as requested.  This should solve all issues with memory conflicts.
Updated command-line configurator. Version 2 uses WC-style dynamic memory allocation to add the explicit memory location for all configuration bytes (modification in WorldsCollide/Settings/__init.py). Running the configuration tool "wc_config.py -i ff6.wc <arguments>" reads the memory location from the ff6wc.smc rom and updates the configuration bytes as requested. This should solve all issues with memory conflicts.
Revert unused changes to rom.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant