Chrono Compendium Welcome, Guest. Please login or register.Did you miss your activation email? 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length News: Home Help Search Login Register Chrono Compendium » Kajar Laboratories - Fan Works and Submissions » Chrono Trigger Modification » SPC event hacking « previous next » Print Pages: 1 [2] Author Topic: SPC event hacking (Read 5018 times) Myria Iokan (+1) Posts: 15 Re: SPC event hacking « Reply #15 on: October 14, 2007, 10:38:00 pm » If the FF6 format is similar and known, you could dump Frog's note data and see whether there are any unused segments... Logged Zakyrus Entity Magical Dreamer (+1250) Posts: 1358 "Bouncy, bouncy, bouncy... --!!" Re: SPC event hacking « Reply #16 on: October 17, 2007, 12:02:43 am » I'm not going to pretend to understand any of this, but keep up the excellent work everyone! Looks to me like you're all doing a great job! Logged ZeaLitY Entity End of Timer (+10000) Posts: 10797 Spring Breeze Dancin' Re: SPC event hacking « Reply #17 on: October 30, 2007, 01:25:24 am » Forgot to post Myria's notes on unlocking ripped SPCs of 02 Chrono Trigger and 22 The Hidden Truth:QuoteIf you want to change the loop count on either one to 2 instead of 3, openthe .spc file in a hex editor. Go to byte 0xFAE.- For song 02, change that byte from 18 to 0C.- For song 22, change that byte from 20 to 10.I changed both songs' lengths to 3:55 since that was long enough for me towork with. I don't know how to mess with ID666 tags other than that.You'll want to change those =) Also, your song collection's 02a file has anID666 tag that calls the song "Part Two" even though it's part 1. My hackedversion says that as well because your 02a was my base.In final Chrono Trigger songs, the "event enable" variable is at address00D2 (SPC file address 01D2). Set this to 01 and the event will executenext loop. 00D2 is set by command 88 from the game. The difficult part ofmy hack is waiting X number of loops before setting that flag. I think theevent flag in the prerelease was 00D0 (file 01D0).The D2 flag is read in two locations:1d05: MOVZ A,$d21d07: CMPZ A,$a51d2e: MOVZ A,$d21d30: CMPZ A,$a5I couldn't figure out the meaning of A5 - it could be some kind of measurecounter. Each of these functions appears to be called for each channel,with X equalling the channel number times 2. They can also be calledmultiple times on a channel during playback. However, these functions areonly called when the song is about to go a different direction with theevent flag.My solution is to count how many times these functions are called then setthe event flag. 12 (0C) and 16 (10) were experimentally determined withthose songs.At 1D05 and 1D2E, I replaced those opcodes with "nop" followed by "call$0EAB". 0EAA is the handler for game command 87 (change song pitch). Ioverwrite this function with my code; I chose this location because I knowwhat it's for and know it's unused (for SPC playback anyway). At 0EAA I puta "ret" so that calling it would do nothing, but it really doesn't getcalled. I then started my code at 0EAB.This is my replacement assembly code: 0EAB:E8 00 mov a, #$0068 02 cmp a, #$0290 06 bcc normalE8 01 mov a, #$01C4 D2 movz $d2, a2F 03 bra skip_inc normal:AC AC 0E inc $0eab+1 ; 00 in mov instruction skip_inc:E4 D2 movz a, $d2 ; replaced code64 A5 cmpz a, $a56F retI used self-modifying code since it was simpler. I'm not good at SPC700 =) Logged Print Pages: 1 [2] « previous next » Chrono Compendium » Kajar Laboratories - Fan Works and Submissions » Chrono Trigger Modification » SPC event hacking