I guess desperate times call for desperate measures. As I've explained before, I'm trying to add one single letter to the "SCORE" readout of UN Squadron. I thought I had it down, but it took me a bit to realize I didn't. So I tried using ASMDEV to see what instructions were being loaded during the game, and I was wondering if my gut feeling (a poor replacement for better ASM knowledge, I know) was right.
Here's the relevant snippet, with notes I took (sorry for the mess, was typing them as I found them):
8F96 - 930A - STA ($0A), y // Store accumulator to memory
(but it's indirect - is it storing 0A to
different addresses? maybe it explains
why SCORE and LEVEL have the same acc.
values?)
(also, repointing this to another offset
without the STA opcode doesn't seem to
carry any problems, but it still requires
the acc. value).
8F98 - 20414C - JSR $4C41 // Jump to subroutine
(4c 41 define horizontal/vertical position)
(20 also defines where "SCORE" begins)
8F9B - 5343 - EOR ($43), y // Exclusive (or accumulator)
(53 43, beginning of "SCORE")
(why isn't 53, the "S", mentioned first?)
8F9D - 4F52450A - EOR $0A4552 // " "
(4f 52 45, middle/end of "SCORE)
8FA1 - 204F4C - JSR $4C4F // Jump to subroutine
(4c 4f define horizontal/vertical position)
(20 also defines where "LEVEL" begins)
8FA4 - 4C4556 - JMP $5645 // Jump to location
(4c 45 56, beginning/middle of "LEVEL")
8FA7 - 454C - EOR $4C // Exc. OR Acc.
(45 4c, end of "LEVEL")
8FA9 - 0220 - COP #$20 // Coprocessor Empowerment (causes interrupt)
8FAB - 8F4C2402 - STA $02244C // Store acc. to mem.
(4c defines screen position; 24 indicates $)
8FAF - 2487 - BIT $87 // Bit Test (this toggles horizontal pos.)
(is it testing against the accumulator?)
(87 defines horizontal position of scores)
8FB1 - 4C3002 - JMP $0230 // Jump to location
(location 0230?)
(4c defines screen position; 24 indicates $)
8FB4 - 2496 - BIT $96 // Bit Test
(96 is another position parameter)
8FB6 - 4C3000 - JMP $0030 // Jump to location
(jump to location 0030?)
8FB9 - 0624 - ASL $24 // Left shifts Accumulator, Memory
(performs a shift left with... 24?)
(06 as unknown as 02)
8FBB - 98 - TYA // Transfer Y to accumulator
(98 is another position parameter)
As you can see, some things aren't clear to me. I'm assuming the first values of all lines are opcodes. But that would mean that in 8F9B, a 53 ("S") is actually required, so a "P" (a 50) would change that to a Branch. Unless that has no effect if there isn't some other required opcode following it, because I did made that change without a problem. It's also not clear to me why it needs to interrupt the processor (8FA9) - is it because it's dealing with a new value to store?
What, if any, optional code might help me here? I was thinking maybe of trying a different STA code, to take into account that one word will be bigger, but I can't think of a way to do this without making the lines even bigger, thus breaking the formatting again. Or a NOP, but then this doesn't seem like it would work either.