The "A9 3F 85 -> FF FF FF" change caught my eye as being really sketchy because you're changing code to non-code, so I figured we could look at how you can maybe improve the changes here.
At 1C6B4, you try to prevent a sound by changing what value gets passed to a sound-related function. I don't know if there's a reason you chose #$17 or if it's just something you tried that worked, but instead of writing this value that we don't understand, I'd rather avoid writing a value altogether by removing the following call to code that I presume is writing to sound engine variables: 1C6B5 = EA EA EA. It might be that writing something here is necessary for some reason, but without a reason or more knowledge, skipping it entirely seems better.
At 1C6BF, you're changing INC $B0 to INC $00 probably to avoid modifying the value in $B0, but without knowledge of what $00 is at this point, you should be doing this by NOP'ing out the instruction (1C6BF = EA EA) or something equivalent. $00 is probably just a temporary that isn't currently in use, but without more knowledge of the game, you should be programming defensively. LDA #$B0 would probably be the most defensive change because it's equivalent here to a NOP and keeps the second byte the same so that jumping into the middle of the instruction would get the same behavior, but that's pretty atypical behavior.
The changes at 1C6D6 and 1C6D9 are a mess. By changing 1C6D6 to #$00, you're causing this comparison to always set carry (because A is always >= 0) so the following branch is never taken. This branch used to skip over the next two instructions, so those are now always executed, but you apparently don't want this, so you remove them. You do this by setting them to $FF, which is the invalid opcode ISC (see documentation
here). This surely can't be what you intended and causes some really serious changes to control flow because it causes the 4 bytes of those two instructions to become 5 bytes, consuming the RTS instruction as an operand and flowing into the following routine. What used to be this:
Code: Select all
07:C6BA:A5 B1 LDA $00B1 = #$3F
07:C6BC:C9 3F CMP #$3F
07:C6BE:F0 0D BEQ $C6CD
07:C6C0:A5 B1 LDA $00B1 = #$3F
07:C6C2:18 CLC
07:C6C3:69 04 ADC #$04
07:C6C5:C9 3F CMP #$3F
07:C6C7:90 02 BCC $C6CB
07:C6C9:A9 3F LDA #$3F
07:C6CB:85 B1 STA $00B1 = #$3F
07:C6CD:60 RTS -----------------------------------------
becomes this:
Code: Select all
C6BA $A5 $B1 LDA $B1
C6BC $C9 $3F CMP #$3F
C6BE $F0 $0D BEQ $C6CD
C6C0 $A5 $B1 LDA $B1
C6C2 $18 CLC
C6C3 $69 $04 ADC #$04
C6C5 $C9 $00 CMP #$00
C6C7 $90 $02 BCC $C6CB
C6C9 $FF $FF $85 ISC* $85FF,X
C6CC $B1 $60 LDA ($60),Y ; Used to RTS.
C6CE $A9 $10 LDA #$10
C6D0 $85 $B0 STA $B0
C6D2 $A9 $FF LDA #$FF
C6D4 $85 $DB STA $DB
C6D6 $60 RTS
Assuming you don't want the behavior of the code you're now flowing into and your goal is to make sure this code isn't ever executing, were it me, I'd just replace this whole chunk (1C6CA-1C6DC) with RTS instructions, since it's the end of the function and only does behavior I don't want anymore. These are safe because anything reaching this chunk of code is going to return anyway, and RTS is a single-byte instruction, so you don't have to worry about anything jumping into the middle of it (relevant because you don't know if there are calls, jumps, or branches into this code).