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

Author Topic: Atlas will not set Offset on Pointer value  (Read 2448 times)

Soniyx

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Atlas will not set Offset on Pointer value
« on: July 10, 2013, 03:26:58 pm »
Hello,
while I am in translating progress I just wanted to reinsert the first part into the rom.
I just played with the configuration files for Atlas and I am stuck by calculating the right pointer values. Addresses are right as I can see.

My configuration file:
Code: [Select]
#VAR(dialogue,TABLE)
#ADDTBL("ptcg2_ptr.tbl", dialogue)
#ACTIVETBL(dialogue)
#ENDIANSWAP("FALSE")

#VAR(PtrDC000, CUSTOMPOINTER)
#CREATEPTR(PtrDC000, "LINEAR", $-DC000, 32)
#VAR(PtrTblTxt, POINTERTABLE)
#PTRTBL(PtrTblTxt, $DC004, 4, PtrDC000)

#JMP($200002)

//POINTER #1 @ $DC004 - STRING #1 @ $200002
#W32($DC004)
[START]HAND[END]
//POINTER #2 @ $DC008 - STRING #2 @ $200008
#W32($DC008)
[START]CHECK[END]
//POINTER #3 @ $DC00C - STRING #3 @ $20000F
#W32($DC00C)
[START]ATTACK[END]
...

Text is in english, because I thought there were some mistakes in the translated version. Atlas inserts as value 02 00 20 00 but it has to be 02 40 12 00. Setting the offset in #CREATEPTR from $-DC000 to $-C000 does not show any effects, all values are still the same. Changing the text will also change the values, but without offset.

Text starts at $200002, pointers start at $DC000 and points to itself, $DC004 points to the beginng of text.
What's my mistake at this point?

danke

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 2067
    • View Profile
Re: Atlas will not set Offset on Pointer value
« Reply #1 on: July 10, 2013, 03:33:42 pm »
Here's my TCG2 Atlas file.

Code: [Select]
#VAR(Table, TABLE)
#ADDTBL("tcg1.tbl", Table)
#ACTIVETBL(Table)
#SMA("LINEAR")
#HDR($DC000)
#JMP($240000)

//GAME NAME: POKEMON TCG 2 (GBC)

//POINTER #1 @ $DC004 - STRING #1 @ $E24B0
#W32($DC004)
*HAND#

//POINTER #2 @ $DC008 - STRING #2 @ $E24B5
#W32($DC008)
*CHECK#

//POINTER #3 @ $DC00C - STRING #3 @ $E24BB
#W32($DC00C)
*ATTACK#

Try removing the '-' before your DC000.

Soniyx

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Atlas will not set Offset on Pointer value
« Reply #2 on: July 10, 2013, 04:03:02 pm »
Removing the '-' was not successful, nothing happened. Using #HDR instead of #CREATEPTR and #PTRTBL worked. First I thought, #HDR has another function, so I was far away from this solution. By reading the reference guide more carefully I noticed that this command is what I was looking for :-[
Thanks again for your help :)

Klarth

  • Sr. Member
  • ****
  • Posts: 495
    • View Profile
Re: Atlas will not set Offset on Pointer value
« Reply #3 on: July 10, 2013, 04:37:31 pm »
You were using the old one-parameter Wxx commands, which do not take in account custom pointers.  Had you used #WRITE(PtrTblTxt), you would have been more successful as pointer tables are associated with a custom pointer type.