Skip to content

Commit

Permalink
Rand Music
Browse files Browse the repository at this point in the history
  • Loading branch information
Veslyquix committed Apr 19, 2024
1 parent cf64408 commit 0613b2b
Show file tree
Hide file tree
Showing 12 changed files with 1,349 additions and 848 deletions.
44 changes: 43 additions & 1 deletion .FE6_Installer.event
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#endif
#endif

#define NeverRandomizeMusic // comment this out if you want music randomized
//#define JankyPalettes // Uncomment if you want to always use char palettes, even with classes randomized

//#define NeverRandomizeMusic // comment this out if you want music randomized
// it only knows of vanilla song IDs though
ALIGN 4
MaxItems_Link:
Expand Down Expand Up @@ -162,6 +164,14 @@ DashText:
BYTE $D6 $E9 $05 $00 $00 $00 $00 $00 $00 $00 $00 $00
PercentText:
BYTE $FD $7B $C1 $5C $2F $00 $00 $00 $00 $00 $00 $00
ClassicRandMusicText:
BYTE $2C $16 $59 $6B $33 $21 $7D $9E $FE $04 $A1 $D6 $E9 $D1 $05 $99 $5E $00 $00 $00 $00 $00 $00 $00
CasualRandMusicText:
BYTE $2C $CA $E2 $52 $42 $FA $3C $FD $09 $42 $AD $D3 $A3 $0B $32 $BD $00 $00 $00 $00 $00 $00 $00 $00
RandomizerText: // "Config"
BYTE $82 $A4 $82 $E9 $82 $E8 $82 $DD $82 $E0 $82 $DE $00 $00
RandomizerDescText:
BYTE $FD $3D $A3 $48 $EC $8A $9F $8F $8F $CF $11 $84 $5A $EF $FE $FB $73 $7B $01 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00

#define setText(textID, offset) "PUSH; ORG (TextTable+4*textID); POIN (offset|0x80000000); POP"
#define setTextWithHuffman(textID, offset) "PUSH; ORG (TextTable+4*textID); POIN (offset); POP"
Expand Down Expand Up @@ -192,6 +202,9 @@ setTextWithHuffman(0xB84, EnemiesText)
setTextWithHuffman(0xB85, PlusText)
setTextWithHuffman(0xB86, DashText)
setTextWithHuffman(0xB87, PercentText)
setTextWithHuffman(0xB88, ClassicRandMusicText)
setTextWithHuffman(0xB89, CasualRandMusicText)
setTextWithHuffman(0xB8A, RandomizerDescText)

PUSH

Expand All @@ -216,10 +229,12 @@ ORG $17BEC
ORG $28f72 // in 28ef0
SHORT $22c0 $4311 // default game/text speed fast

#ifndef JankyPalettes
ORG $4a4A0
jumpToHack(MaybeUseGenericPalette_FE6)
//ORG $4a4b0
//SHORT $2000 // always use generic palette (by Vesly)
#endif

// in 8019600 BuildBestMovementScript
// Fix REDA / MOVE from crashing on impassible terrain
Expand Down Expand Up @@ -282,8 +297,23 @@ ORG $2dc460; BYTE $80 $23 $1B $06 $C0 $1A $02 $78 $0A $70 $01 $31 $01 $30 $00 $2
//8CE4930
ORG $68A08C//$68C30C //68A09C
PROC_CALL_ROUTINE_2(FE6_StartDifficultySelection)

ORG $5C7650
POIN NewChMenu


POP

ALIGN 4
NewChMenu:
BYTE $DC $74 $81 $08 $00 $00 $54 $06 $00 $00 $00 $00 $6D $1E $04 $08 $00 $00 $00 $00 $A5 $EA $01 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $20 $7A $81 $08 $00 $00 $55 $06 $00 $00 $00 $00 $6D $1E $04 $08 $00 $00 $00 $00 $D5 $EA $01 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $2E $7A $81 $08 $00 $00 $56 $06 $00 $00 $00 $00 $6D $1E $04 $08 $00 $00 $00 $00 $C1 $EA $01 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $CC $7A $81 $08 $00 $00 $57 $06 $00 $00 $00 $00 $55 $EA $01 $08 $00 $00 $00 $00 $6D $EA $01 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00
// Config Menu
POIN RandomizerText; BYTE $00 $00; SHORT 0xb8a; BYTE $00 $00 $00 $00 $6D $1E $04 $08 $00 $00 $00 $00; POIN MenuStartConfigMenu; BYTE $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00;
// End
BYTE $08 $75 $81 $08 $00 $00 $58 $06 $00 $00 $00 $00 $6D $1E $04 $08 $00 $00 $00 $00 $91 $EA $01 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00;
FILL(36)


ALIGN 4
CasualMode:
BYTE $10 $B4 $0C $1C $00 $F0 $13 $F8 $00 $28 $01 $D1 $05 $23 $00 $E0 $09 $23 $E0 $68 $05 $21 $C9 $43 $08 $40 $19 $1C $08 $43 $E0 $60 $20 $1C $06 $4B $00 $F0 $02 $F8 $10 $BC $05 $4B $18 $47 $00 $B5 $8C $20 $04 $4B $FF $F7 $FA $FF $00 $BD $00 $00 $61 $2C $02 $08 $FF $7B $01 $08 $5D $BA $06 $08
Expand Down Expand Up @@ -352,4 +382,16 @@ WORD 2
#else
WORD 4
#endif
ALIGN 4
RandValues:
WORD 0x203D974 // Bandit unitID + 0x45 BWL data
RandBitflagsA:
WORD 0x202AA63 // PlaySt + 0x1B (unk, 1 bytes) @ saved on suspend
RandBitflagsB:
WORD 0x202AA67 // PlaySt + 0x1F (unk, 1 bytes) @ saved on suspend
MaxItems:
WORD 0x203D978
MaxClasses:
WORD 0x203D979


43 changes: 40 additions & 3 deletions .FE7_Installer.event
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,25 @@
#include "Patches/FE7_AsmHooks.lyn.event"

//#define TLP // to use this installer on TLP

//#define JankyPalettes // Uncomment if you want to always use char palettes, even with classes randomized

//#define NeverRandomizeMusic // comment this out if you want music randomized
// it only knows of vanilla song IDs though

#ifndef TextTable
#define TextTable 0xB808AC
#endif
#define setText(textID, offset) "PUSH; ORG (TextTable+4*textID); POIN (offset|0x80000000); POP"
ConfigText:
String("Config") ; BYTE 0
ConfigDescText:
String("Reconfigure the randomizer.") ; BYTE 0

setText(0x119f, ConfigText)
setText(0x11a0, ConfigDescText)


ALIGN 4
CasualModeFlag:
WORD 0xA0
Expand Down Expand Up @@ -91,9 +107,6 @@ NeverChangeIntoClass(0x56)
ALIGN 4
ShopText:
String("Shop"); BYTE 0

#define TextTable 0xB808AC // same in TLP
#define setText(textID, offset) "PUSH; ORG (TextTable+4*textID); POIN (offset|0x80000000); POP"
setText(0x1260, ShopText)


Expand Down Expand Up @@ -173,10 +186,12 @@ SHORT $1C28
callHackNew(StatScreenSelectLoop)

#define jumpToHack_r1(offset) "BYTE 0x00 0x49 0x08 0x47; POIN (offset|0x1)"
#ifndef JankyPalettes
ORG $53230
jumpToHack_r1(MaybeUseGenericPalette_FE7)
//ORG $53242
//SHORT $2000 // always use generic palette (by Vesly)
#endif

// in 8019E5C BuildBestMovementScript
// Fix REDA / MOVE from crashing on impassible terrain
Expand Down Expand Up @@ -276,8 +291,19 @@ POIN DisplayPage0|1
// normally it is: POIN 0x807FDf1 0x80800B5 0x8080425 0x0807fdf1
// as page 1, 2, 3, ??

ORG $B95AFC
POIN NewChMenu
POP

ALIGN 4
NewChMenu:
BYTE $C4 $3F $1C $08 $E2 $10 $70 $03 $00 $6A $00 $00 $F9 $A8 $04 $08 $00 $00 $00 $00 $95 $15 $02 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $A8 $3E $1C $08 $E3 $10 $71 $03 $00 $6B $00 $00 $F9 $A8 $04 $08 $00 $00 $00 $00 $C5 $15 $02 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $BC $3F $1C $08 $E4 $10 $72 $03 $00 $6C $00 $00 $F9 $A8 $04 $08 $00 $00 $00 $00 $B1 $15 $02 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $B4 $3F $1C $08 $E5 $10 $73 $03 $00 $6D $00 $00 $45 $15 $02 $08 $00 $00 $00 $00 $5D $15 $02 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00


BYTE $AC $3F $1C $08 ; SHORT $119f $11a0; BYTE $00 $71 $00 $00 $F9 $A8 $04 $08 $00 $00 $00 $00; POIN MenuStartConfigMenu; BYTE $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00
// End
BYTE $AC $3F $1C $08 $E9 $10 $74 $03 $00 $71 $00 $00 $F9 $A8 $04 $08 $00 $00 $00 $00 $81 $15 $02 $08 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $FF $FF $FF $FF


ALIGN 4
NullifyMov:
Expand Down Expand Up @@ -510,3 +536,14 @@ WORD 2
#else
WORD 4
#endif
ALIGN 4
RandValues:
WORD 0x202BC3C // GameOptions + 0x44 (unk, 4 bytes)
RandBitflagsA:
WORD 0x202BC16 // GameOptions + 0x1E (unk, 2 bytes)
RandBitflagsB:
WORD 0x202BC17 // GameOptions + 0x1E (unk, 2 bytes)
MaxItems:
WORD 0x203eb34 // BWL + 0x3a Bramimond +4
MaxClasses:
WORD 0x203eb35
34 changes: 26 additions & 8 deletions .FE8_Installer.event
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ MESSAGE Open FE8_Installer and read / config things please
//asdf // add two slashes to comment out this line
#endif

#define NeverRandomizeMusic // comment this out if you want music randomized
// it only knows of vanilla song IDs though
//#define JankyPalettes // Uncomment if you want to always use char palettes, even with classes randomized
#ifndef VeslyBuildfile
#define NeverRandomizeMusic // comment this out if you want music randomized
// it only knows of vanilla song IDs though
#endif

#ifndef RandomizerRam
#define RandomizerRam 0x203EC24 // 8 bytes of 0x3A unit BWL data
//#define RandomizerRam 0x30017AC // alternative: 8 bytes of Valni records
#endif

ALIGN 4
CasualModeFlag:
WORD 0xB0
RandomizePrepShop:
Expand Down Expand Up @@ -233,16 +240,13 @@ SHORT $1C28 $1C28
callHackNew(StatScreenSelectLoop)


#ifndef JankyPalettes
ORG $579C4
callHackNew(MaybeUseGenericPalette_FE8)
SHORT $46c0 $46c0 $46c0 $46c0 $46c0
//[203e1dc..203e1df]!!
ORG $57380
//callHackNew(MaybeUseGenericPalette_FE8)
ORG $57398
//callHackNew(MaybeUseGenericPalette_FE8_2)
//ORG $5739E
//SHORT $2100 // always use generic palette (by Vesly)
#endif

// in BuildBestMovementScript
// Fix REDA / MOVE from crashing on impassible terrain
Expand Down Expand Up @@ -322,3 +326,17 @@ WORD 2
#else
WORD 4
#endif


ALIGN 4
RandValues:
WORD RandomizerRam
RandBitflagsA:
WORD RandomizerRam+4
RandBitflagsB:
WORD RandomizerRam+5
MaxItems:
WORD RandomizerRam+6
MaxClasses:
WORD RandomizerRam+7

Loading

0 comments on commit 0613b2b

Please sign in to comment.