pikasurf wrote:
Memblers wrote:
I seem to remember when ripping NSFs, that many games often wrote $0F to $4015 during the init and never touch it again (unless they are using DPCM). In that case it should be possible to use a Game Genie code to disable channels. Change the $0F byte to mask out whatever channels you want. Won't work for everything.
i dont really have any experience with game genie codes, but this sounds cool. i have an everdrive for nes. what is the $0F byte and how do i change it? does this involve looking at game code?
Yeah, you'll have to look at the game code, but using a debug tool such as the breakpoint feature in FCEUX will take you straight to the part you want. You can set a breakpoint on writes to $4015, then the emulation will stop (very likely on a STA $4015 instruction). Then you can look at the code, and the instruction right before that will probably be LDA #$0F. When a game starts up it will usually write zero to $4015 (to disable audio when the player hits the reset button), in that case just press "run" to skip over that one. You'll be able to see the address of that LDA #$0F instruction in memory (in hexadecimal). Add 1 to it (to skip over the LDA), now you've got the address for that $0F byte. FCEUX has a Game Genie encoder/decoder built in (under the debug stuff). Enter that address, put in 0F as the compare byte, and the value you want as the value byte. And it will give you the GG code.
The value you replace 0F with, the lower 4 bits will enable each channel if set, disable if cleared. If you're not familiar with binary and hex notation, you can simply use 1, 2, 4, or 8 and that will enable 1 channel at at time (square 1, square 2, triangle, noise, respectively). Add those numbers together to enable multiple channels (e.g. 3 would be both square channels enabled).
Since you're using an Everdrive it might be easier just to modify the ROM in a hex editor. I'd recommend HxD -
https://mh-nexus.de/en/hxd/1- open ROM, choose Search, then Replace
2- in "search for" field, enter "a9 0f 8d 15 40"
3- in "replace with" field, enter "a9
01 8d 15 40" (the 01 will enable square #1 only)
3- change datatype to "hex-values"
4- hit replace all, if it doesn't find any matches, then the game is doing something differently and it might not be so easy. I took a peek at Alien 3 first and it won't work in that one, I'd guess it's going to work in 80% of games though.