+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Predator Music in NES
Pages: [1]
Author Topic: Predator Music in NES  (Read 1 times)
Dracula X
Guest
« on: April 21, 2011, 09:07:08 pm »

I'm starting to understand 6502 a little but I'm getting there. This is the best way that I can explain this part.

RAM:

$0000 - I only found this in nsf RAM it's the current music that's being played. You can also look for it in ROM file
to change the music that's playing for the stage.

$0796 - Square 1
$0798 - Square 2
$079A - Triangle
$079C - Noise

ASM:
000147B8:\tAD9507\tLDA $0795
000147BB:\tF030\tBEQ $30
000147BD:\tAD9607\tLDA $0796
000147C0:\t85B1\tSTA $B1
000147C2:\tAD9707\tLDA $0797
000147C5:\t85B2\tSTA $B2
000147C7:\tAD9807\tLDA $0798
000147CA:\t85B3\tSTA $B3
000147CC:\tAD9907\tLDA $0799
000147CF:\t85B4\tSTA $B4
000147D1:\tAD9A07\tLDA $079A
000147D4:\t85B5\tSTA $B5
000147D6:\tAD9B07\tLDA $079B
000147D9:\t85B6\tSTA $B6
000147DB:\tAD9C07\tLDA $079C
000147DE:\t85B7\tSTA $B7
000147E0:\tAD9D07\tLDA $079D
000147E3:\t85B8\tSTA $B8
000147E5:\t203987\tJSR $8739
000147E8:\tA900\tLDA #$00
000147EA:\t8D9507\tSTA $0795
000147ED:\t206F87\tJSR $876F
000147F0:\t209987\tJSR $8799
000147F3:\t60\tRTS

Here what I came up in ROM file:

$14804 - Music 1 FC87-1088-2688-188A
$14B37 - Music 2 2F8B-5F8B-938B-3A8F
$14FE6 - Music 3 DE8F-0F90-5090-5197
$1589F - Music 4 9798-B698-DC98-03A1
$1646B - Music 5 63A4-92A4-9BA4-04A5
$16310 - Music 6 08A3-11A3-1AA3-2EA4
$16B08 - Music 7 00AB-23AB-46AB-49AB
$1653D - Music 8 35A5-36A6-F4A6-90A7
$16539 - Music 9 82A8-01A9-86A9-67AA
Dr. Floppy
Guest
« Reply #1 on: May 02, 2011, 11:37:43 am »

Would you like a translation?


000147B8:   AD9507   LDA $0795
000147BB:   F030   BEQ $30                         If the value at $795 is zero, skip the next 48 bytes (jump to $147ED).
000147BD:   AD9607   LDA $0796
000147C0:   85B1   STA $B1                         Copy the value at $796 over to $00B1.
000147C2:   AD9707   LDA $0797
000147C5:   85B2   STA $B2                         Copy the value at $797 over to $00B2.
000147C7:   AD9807   LDA $0798
000147CA:   85B3   STA $B3                         Copy the value at $798 over to $00B3.
000147CC:   AD9907   LDA $0799
000147CF:   85B4   STA $B4                         Copy the value at $799 over to $00B4.
000147D1:   AD9A07   LDA $079A
000147D4:   85B5   STA $B5                         Copy the value at $79A over to $00B5.
000147D6:   AD9B07   LDA $079B
000147D9:   85B6   STA $B6                         Copy the value at $79B over to $00B6.
000147DB:   AD9C07   LDA $079C
000147DE:   85B7   STA $B7                         Copy the value at $79C over to $00B7.
000147E0:   AD9D07   LDA $079D
000147E3:   85B8   STA $B8                         Copy the value at $79D over to $00B8.
000147E5:   203987   JSR $8739                  Jump to Subroutine at $14749.
000147E8:   A900   LDA #$00
000147EA:   8D9507   STA $0795                 Store a zero at $795.
000147ED:   206F87   JSR $876F                  Jump to Subroutine at $1477F.
000147F0:   209987   JSR $8799                  Jump to Subroutine at $147A9.
000147F3:   60   RTS                                     Return from Subroutine


As for the data from $14804-16539+, it looks like pointers to music data for each sound channel:


$14804 - Music 1 FC87-1088-2688-188A      $1480C; $14820; $14836; $14A28


Offhand, I'd suspect these addresses represent Pulse-2, Pulse-1, Triangle and Noise channel music data (respectively). The relatively large amount of Triangle data this suggests does give me pause... Does the first song in the game have a lot of funky bassline stuff?


Out of curiosity, how long have you been doing this? It's quite impressive for a n00b!
« Last Edit: May 02, 2011, 11:46:09 am by Dr. Floppy »
Dracula X
Guest
« Reply #2 on: May 10, 2011, 07:59:32 pm »

Thanks for the translation!

I've been doing this since 2009 or 2010 when I was looking at the hex viewer on FCEUX it see what's it's doing. Also, I was messing with X816
assembler to understand on how to locate the address.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC