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

Author Topic: Trying to understand U.N. Squadron post-credits messages  (Read 1149 times)

4lorn

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Trying to understand U.N. Squadron post-credits messages
« on: June 12, 2019, 06:51:27 pm »
Hi! Back in 2011, I began translating U.N. Squadron (SNES), but by the end of the year my computer crashed and I lost nearly all of my work on that. But! Fast forward to now and I realize some notes and a handful of graphical edits survived. This means I can recover lost work fairly quickly, but instead of starting the easy way, I thought I'd go straight for the biggest issue I had then.

U.N. Squadron has 4 difficulty modes: Easy, Normal, Hard and Gamer, with the last one only accessible in the Options menu, and by holding A and X on the 2nd controller, then changing the difficulty on the 1st controller. Upon finishing Hard mode (using no continues), the game shows you this message:


Those lil' sprites scroll from right to left, and cycle between 3 animations. It's a nice touch, and a nice reference to the arcade original. When you finish the game on Gamer mode, however, the message is different:


The pattern is still the same: animated scrolling from right to left, the difference being that "Thanks" just scrolls until it's gone and the post-game Gamer mode message will scroll until "Crazy" stays there on the screen.

I checked my notes and it seems younger me was right. "THANKS" begins at offset FC89, while "YOU ARE CRAZY" begins at FCA2. Now... Here's how it works.

Code: [Select]
THANKS @ FC89:
F9 10 84 48 8F 21 11 46 49 10 21 F1 C5 4E 0E 21 12 24 C9 01 21 12 24 48 9E

Code: [Select]
YOU ARE CRAZY @ FCA2:
88 E2 20 10 F1 F0 03 9E 11 F4 40 51 12 20 28 89 00 04 51 28 22 80 21 12 20 38 F1 E0 04 1E 38 41 00 21 12 20 44 89 00 04 51 44 81 00 20 E1 C0 44 89 F0 03 91 45 F1

"Thanks" uses a sequence of from H to S; when the 1st line is done, it moves on to the second line. By this I mean, F9 will draw a sprite on the top left coordinate of "H", 10 will do that on the top left of "A", etc. The coordinates seem simple but depending on the value, it's possible to actually generate an additional sprite next to an already existing one or remove it altogether. For instance, the 24 handles the second sprite counting down on the left leg of the N - but while a value of 25 would add a sprite below the diagonal leg of the N, a value of 23 would shift the original sprite once to the left *and* add the same pixel if the value were 23. The same method applies to "You Are Crazy".

Now, you might be thinking, "Wait. Thanks has 6 letters but you mentioned the sequence goes from H to S. That's only 5 letters. What gives?"

That's the issue I'm having: the "T" in "THANKS" and the first "Y" in "YOU ARE CRAZY" don't seem to be anywhere near the rest of the letters. Either the coordinates are trickier than I'm thinking, and/or there's a table and pointers somewhere but I can't find any pointers here because I'm not sure how the sequence is being read - if from the second letter of each message, if from the initial letters which... Are not there.

Any thoughts? If anyone needs save states before the sequence, I can supply Bsnes and snes9x save states. Thanks in advance! :)


EDIT: Solved, thanks once again slidelljohn! :)
« Last Edit: June 15, 2019, 04:57:41 am by 4lorn »

slidelljohn

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Trying to understand U.N. Squadron post-credits messages
« Reply #1 on: June 14, 2019, 03:16:02 am »
I could take a look at it when I get some free time. Can you post the save states for both of them?

4lorn

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Trying to understand U.N. Squadron post-credits messages
« Reply #2 on: June 14, 2019, 02:07:47 pm »
Hi, thank you for your help! :)

I'm including three save states. The first two are for snes9x (.000 is right before "Thanks", .002 is right before "You are crazy), and the other is for bsnes but only before "Thanks". I can't provide a save state before "You are crazy" for bsnes because it doesn't seem to register the second gamepad input (tried versions 0.4 and 1.07 of bsnes, but none worked), which is required to activate the Gamer difficulty mode.

They're zipped in this file.

For reference, the ROM I'm using for playtesting is the US version, but I've permanently patched it with codes so that it has infinite money, one power-up immediately maxes out a plane's weapon, and the planes are invicible (except against surfaces), but I'm sure none of the codes affect the end messages.

Thank you for any help you can provide!

Also, I've managed to test the sequence a bit further earlier today... It seems that the "T" and "Y" are actually there, in the code snippets I included, which means that I'd probably require very specific values that would rearrange things without breaking them.


slidelljohn

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Trying to understand U.N. Squadron post-credits messages
« Reply #3 on: June 14, 2019, 03:57:28 pm »
I'll have some time to look at it later tonight. I did look into the
gamer setting and if you nop this code ($00/C23C A2 00       LDX #$00)
out you will be able to select gamer mode without requiring to activate it.
Or at least the gamer setting shows in the options. I'm not sure if it
plays in gamer mode but seems like it should.

Just found the T data in thanks.
Code: [Select]
0xF9 = 11111001
0x21 = 00100001
0x21 = 00100001
0x21 = 00100001
0x21 = 00100001

See the T and the left side of the H? 0's are blank and 1's make the pixels.
« Last Edit: June 15, 2019, 03:31:26 am by slidelljohn »

4lorn

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Trying to understand U.N. Squadron post-credits messages
« Reply #4 on: June 15, 2019, 04:44:33 am »
Thank you, slidelljohn!! ;D

So basically, it's binary to hex. The best way is to rearrange the words in binary, convert to hex and apply them. Still have to figure exactly what to write now (but that's a translation chore, not code breaking).

Thank you once again, thatwas a tremendous help ^_____^

slidelljohn

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: Trying to understand U.N. Squadron post-credits messages
« Reply #5 on: June 15, 2019, 04:47:22 am »
You're welcome! ;)