News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Donkey Kong Arcade (NES) help  (Read 4589 times)

124scratch

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Donkey Kong Arcade (NES) help
« on: August 28, 2016, 01:47:31 pm »
Hi everyone!

I have been hacking the graphics of Donkey Kong for NES using YY-CHR and making very minor changes to make the game more faithful to the arcade version. The .nes file of what I have done so far will be attached. What I want to do is hack the sound and music. I would like to edit the pitch of the NES version's sound to make it more like the generally B flat sound of the arcade version. Does anyone know of a program I can use to do this?

...I just realized I can't figure out how to attach a file. Can someone help me on that as well? When I go down to "attachments and other options", there are just checkboxes saying "notify me of replies", "return to this topic", and "don't use smileys". How the heck do I attach a file?

Thanks,
124scratch

Disch

  • Hero Member
  • *****
  • Posts: 2737
  • NES Junkie
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #1 on: August 28, 2016, 03:58:08 pm »
What I want to do is hack the sound and music. I would like to edit the pitch of the NES version's sound to make it more like the generally B flat sound of the arcade version. Does anyone know of a program I can use to do this?

You're trekking into new territory.  Donkey Kong isn't a popular game to be hacked, so I doubt there's a tool specifically for the music/sound.

If you want to make these changes, you'll have to figure out how to do it on your own -- which means getting comfortable with a hex editor and a debugger (FCEUX).

There are some docs on this site that have general information on how to get started... but you'll mostly be flying blind.  This will be quite a bit of work and very confusing if you've never done anything like it before.  I have an hour to kill so I'll take a peek and see what I can find.

As for attaching files -- no clue.  Never needed to.  I usually just throw stuff on dropbox if I need to share it.

124scratch

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #2 on: August 28, 2016, 04:13:19 pm »
I'll just use mediafire. I'll share the main .nes file, as well as a .pal file for an approximation of the arcade colors.

August 28, 2016, 04:23:27 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
As for attaching files -- no clue.  Never needed to.  I usually just throw stuff on dropbox if I need to share it.
I'll just use mediafire. I'll share the main .nes file, as well as a .pal file for an approximation of the arcade colors.

August 28, 2016, 05:17:39 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Here are the NES and PAL files for what I have so far: [removed]
« Last Edit: September 09, 2016, 11:31:21 am by KingMike »

Disch

  • Hero Member
  • *****
  • Posts: 2737
  • NES Junkie
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #3 on: August 28, 2016, 05:26:12 pm »
I've gotten about as far with Donkey Kong's music engine as I care to.

Here's my findings:

Offset 0x3E72 is the start of the song list.  There are 9 songs, each song has 5 bytes in this list:

- byte 0 = "control byte"????  I haven't fully deciphered this, but it seems to be factored in when determining note length and pulse volume.  The value is used for a lookup table, so you probably should only use values that currently exist in the game (0, 8, or F), other values just jumble up the music something fierce

- bytes 1,2 = pointer to the start of the score data.  Little endian.  To convert to an offset, swap the bytes, subtract $C000, then add $10.  So "20 FF" points to offset 3F30

- byte 3 = offset to start of triangle's music data

- byte 4 = offset to start of pulse 2's music data.


Example... the game has these bytes at offset 3E72:

Code: [Select]
00 8F FE 1B 00    <- song 0
08 B0 FE 00 0C    <- song 1
00 CF FE 00 1A
08 05 FF 00 0B
00 AD FF 00 03
00 BE FF 00 00
00 C4 FF 00 00
0F 20 FF 21 3E   <- song 7
00 A1 FF 08 00

Song 7 is the song played at the title screen.

It has a control byte of $0F
The score starts at $FF20  (offset 0x3F30)
Triangle offset is $21
Pulse 2 offset is $3E


So with your 3 audio channels (pulse 1, pulse 2, and triangle), the score for each starts at these addresses:

Pulse 1 @ 0x3F30
Pulse 2 @ 0x3F30 + $3E = 0x3F6E
Triangle @ 0x3F30 + $21 = 0x3F51


Each byte in the score specifies a tone (or a rest) and a length.  Note that for the below I only looked at the score for the pulse channels.  I assume Triangle works the same way but I didn't check so it might be different.

The first few bytes of Pulse 1's score for the title screen (offset 0x3F30) is below:

Code: [Select]
56 56 E0 42 5A 5E 5C 99 58 58 E2 ...

Here's the ugly part... this score is super weird.

Bits 1-5 select the pitch, and bits 6,7,0 select everything else.  So to edit this, you pretty much have to convert each byte to binary to see what it's doing:

Code: [Select]
         bit #
       7654 3210
      __________
$56 = %0101 0110
       ^^^^ ^^^^
       |||| ||||
       ||\| ||/|
       || tone |
       ||      |
       \|      /
         length
        & volume

So $56 and $57 will play the same tone, but with a different length/volume
Whereas $56 and $58 will play different tones, but with the same length/volume



Good luck with this.   :thumbsup: ;)

This does not seem like it would be fun to edit.   :crazy:

AitsuRules404

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #4 on: September 04, 2016, 10:18:51 am »
I was trying the same thing a few months ago, and I couldn't find any resources and seemed too complicated, so I stopped. Now with this, I might try to look into it and just try different values and try to find something that works. I did, however, get pretty far with the graphics, or at least the palettes. Maybe someday I'll post it.

I also recommend that you use DK: Original Edition since it has the pie factory stage.

124scratch

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #5 on: September 04, 2016, 11:30:18 am »
I also recommend that you use DK: Original Edition since it has the pie factory stage.

I would use Original Edition, if I could find any ROMs of it.

freem

  • Jr. Member
  • **
  • Posts: 19
  • ɯǝǝɹɟ
    • View Profile
    • AJWorld
Re: Donkey Kong Arcade (NES) help
« Reply #6 on: September 04, 2016, 11:32:27 am »
I would use Original Edition, if I could find any ROMs of it.

grab this hack, which includes a patch that converts USA PRG1 version to DK:OE.

124scratch

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #7 on: September 04, 2016, 11:33:17 am »
grab this hack, which includes a patch that converts USA PRG1 version to DK:OE.

Ok!

September 04, 2016, 08:25:18 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
grab this hack, which includes a patch that converts USA PRG1 version to DK:OE.
Nice try, but this is an XDelta patch that lets you play as Pauline in Original Edition. You need the Original Edition ROM first.

EDIT: Wait, an OE patch is also available in the zip.

EDIT 2: I can't seem to find the PRG1 ROM anywhere...
« Last Edit: September 04, 2016, 08:35:24 pm by 124scratch »

AitsuRules404

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #8 on: September 10, 2016, 07:23:24 pm »
It shouldn't be hard to find the rom. Just searching through a few Google pages should land you it, without having to use the patch.

Also, how would one go about hacking the title screen of this game?
« Last Edit: September 13, 2016, 01:32:08 pm by AitsuRules404 »

124scratch

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #9 on: December 17, 2016, 11:53:19 am »
Hey guys, it's been a while, hasn't it?
I was able to get my hands on the DK Original Edition ROM and touched up the graphics like I did with the ROM I posted that got me a warning (oops!) and made a BPS patch for DKOE.
Here it is: https://drive.google.com/file/d/0ByVwi1rXaDnuYmVlR0g0VE84Skk/view?usp=sharing
(I was unable to edit DK's animations after hittting the ground at the end of 100m because the tile arrangement won't fit.)

Zeikar

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #10 on: December 17, 2016, 08:34:56 pm »
Hey guys, it's been a while, hasn't it?
I was able to get my hands on the DK Original Edition ROM and touched up the graphics like I did with the ROM I posted that got me a warning (oops!) and made a BPS patch for DKOE.
Here it is: https://drive.google.com/file/d/0ByVwi1rXaDnuYmVlR0g0VE84Skk/view?usp=sharing
(I was unable to edit DK's animations after hittting the ground at the end of 100m because the tile arrangement won't fit.)
Are you going to submit this hack through RHDN submissions?

124scratch

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #11 on: December 17, 2016, 09:07:02 pm »
Are you going to submit this hack through RHDN submissions?
I probably should.

MathUser2929

  • Hero Member
  • *****
  • Posts: 1565
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #12 on: December 18, 2016, 09:15:42 am »
Well, I look forward to some screenshots when you get a chance.

124scratch

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #13 on: December 19, 2016, 10:02:38 am »
I just compiled a graphics comparison of the unmodified Original Edition graphics and my modified "Arcade Edition" graphics. Very minor changes, and some are even re-creations of errors in the original graphics  :laugh:
The unmodified graphics are on the left, and the modified graphics are on the right.

NES Boy

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #14 on: December 20, 2016, 02:10:57 am »
It seems you forgot to post the actual comparison image...

124scratch

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Donkey Kong Arcade (NES) help
« Reply #15 on: December 20, 2016, 10:25:42 am »
It seems you forgot to post the actual comparison image...
Whoops, I meant to put an imgur link. Here it is: http://imgur.com/a/uDJ3f

December 20, 2016, 10:29:14 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Also, just for fun, I made a not-entirely-finished Crazy Kong color hack.http://imgur.com/a/dpOrw