Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Help/Question
  • → Pokemon TCG2 disassembly: completing an asm file using known pointers?

#1 2021-01-23 21:17:03

GamerXYZ
New member
Registered: 2021-01-23
Post 1/2

Pokemon TCG2 disassembly: completing an asm file using known pointers?

I hardly know anything about disassembly so I'm possibly asking a really stupid question here, but: is it possible to complete an .asm file using the pointers available (provided I'm using the same baserom obviously)? And if so, how would I do so?

I found 1 TCG2 disassembly, from FrozenLake, incomplete unfortunately but it doesn't surprise me considering how much effort it takes and TCG2 is kind of an obscure game. I'm interested in extracting the game's deck information (I know a guide exists for AI decks, but if able it's nice to get the information from the game and be certain it's correct), completing its deck.asm file, which has the pointers to all decks.

So yeah, can I do something with the information that 1 deck starts at $5637, the next deck starts at $566b etcetera?

Offline

#2 2021-01-23 22:11:58

Rangi
Member
Registered: 2016-05-09
Post 967/968

Re: Pokemon TCG2 disassembly: completing an asm file using known pointers?

If I understand your goal correctly, you can use numbers in place of labels. For example: "ld hl, $5637"; "dw $566b"; "call $6789"; "jp z, $7654".

Offline

#3 2021-01-23 23:18:41

GamerXYZ
New member
Registered: 2021-01-23
Post 2/2

Re: Pokemon TCG2 disassembly: completing an asm file using known pointers?

Rangi wrote:

If I understand your goal correctly, you can use numbers in place of labels. For example: "ld hl, $5637"; "dw $566b"; "call $6789"; "jp z, $7654".

What I'm looking for is how to use those pointers to disassemble the game to get the decklists.

To better explain what I mean: the decks.asm file starts with the following (it goes much further than that of course):

DeckPointers: ; 594AC (16:54ac)
    dw PoisonStormDeck
    dw StrangePsyshockDeck
    dw $57d1 ; SamsPracticeDeck
    dw $571c ; PlayerPracticeDeck
    dw StarterDeck
    dw $5637 ; SweatAntiGR1Deck
    dw $566b ; GiveInAntiGR2Deck
    dw $56a5 ; VengefulAntiGR3Deck
    dw $56e2 ; UnforgivingAntiGR4Deck

They're all decks: the 3 mentioned decks have been disassembled, the others that list their pointers haven't. A disassembled deck (also all in the decks.asm file) looks like this:

PoisonStormDeck: ; 595a4 (16:55a4)
    dbw 11, GRASS_ENERGY
    dbw 10, FIRE_ENERGY
    dbw  4, DOUBLE_COLORLESS_ENERGY
    dbw  4, WEEDLE2
    dbw  4, SCYTHER2
    dbw  4, CHARMANDER2
    dbw  2, CHARMELEON
    dbw  4, MAGMAR4
    dbw  2, KANGASKHAN3
    dbw  3, POTION
    dbw  4, GUST_OF_WIND
    dbw  2, PLUSPOWER
    dbw  2, SWITCH
    dbw  2, BILL
    dbw  2, FULL_HEAL
    db 0

How would I disassemble the others like [dw $57d1 ; SamsPracticeDeck]? Or is the information available either not enough or would it still take a lot of effort? As said, I barely know enough about disassembly, I simply saw the pointers were available and how the result will look like and that made me wonder if that's enough to do the rest or not.

Offline

#4 2021-01-24 16:02:49

Rangi
Member
Registered: 2016-05-09
Post 968/968

Re: Pokemon TCG2 disassembly: completing an asm file using known pointers?

"    dw $57d1 ; SamsPracticeDeck" tells you that SamsPracticeDeck starts at address $57d1. The whole file is in bank $16. Each bank is $4000 bytes. So to find the absolute offset into the ROM file, you calculate (bank × $4000) + (address % $4000), which is $597d1. Then navigate to that offset in a hex editor and start interpreting the bytes.

Offline

  • Index
  • → Help/Question
  • → Pokemon TCG2 disassembly: completing an asm file using known pointers?

Board footer

Powered by FluxBB