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

### Author Topic: [Technical] [NDS] Dragon Quest V Finding A,B,C Etc..  (Read 1878 times)

#### q8fft

• Jr. Member
• Posts: 37
##### [Technical] [NDS] Dragon Quest V Finding A,B,C Etc..
« on: June 11, 2019, 05:36:51 am »

I'm looking for pointer Letters after monsters group name like A,B,C,D,E,F,G,H
and I want change them to like J,K,P etc..

If anyone has a trick or a solution to this, I will be grateful and Credited to to him.

thanks.

#### abw

• Sr. Member
• Posts: 303
##### Re: [Technical] [NDS] Dragon Quest V Finding A,B,C Etc..
« Reply #1 on: June 11, 2019, 09:49:02 am »
For something like this, there's a good chance there are no separate pointers for the A-H letters and the game just does a little bit of math instead. Using an example from the same franchise, Dragon Warrior II (NES) accomplishes this by taking the monster number 1, 2, 3, etc. and adding that number to the number for the "A" tile - 1 to get the number for the "A", "B", "C", etc. tiles. Here's the actual code:
Code: [Select]
`0x03FCD7|\$0F:\$FCC7:A9 6A    LDA #\$6A    ; Tile ID #\$6A = "-"0x03FCD9|\$0F:\$FCC9:99 19 61 STA \$6119,Y ; buffer for [name] control code0x03FCDC|\$0F:\$FCCC:C8      INY        ; increment buffer write index0x03FCDD|\$0F:\$FCCD:8A      TXA        ; A = X = monster number within its group0x03FCDE|\$0F:\$FCCE:18      CLC        ; clear the carry flag before starting addition0x03FCDF|\$0F:\$FCCF:69 23    ADC #\$23    ; Tile ID #\$23 = "z" and A > 0, so this is Tile ID #\$24 = "A" or greater; the net effect of this code is to write e.g. "-A", "-B", etc. to the [name] string buffer0x03FCE1|\$0F:\$FCD1:99 19 61 STA \$6119,Y ; buffer for [name] control code`

#### q8fft

• Jr. Member
• Posts: 37
##### Re: [Technical] [NDS] Dragon Quest V Finding A,B,C Etc..
« Reply #2 on: June 11, 2019, 10:56:24 am »
I'm grateful to you, frankly I did not expect it to be that complicated. I thought it was simple.
As I understand. The tiles can not be selected precisely? This is a math process?

June 11, 2019, 11:02:51 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Can I change this from letters to numbers?
« Last Edit: June 11, 2019, 11:02:51 am by q8fft »

#### abw

• Sr. Member
• Posts: 303
##### Re: [Technical] [NDS] Dragon Quest V Finding A,B,C Etc..
« Reply #3 on: June 11, 2019, 08:59:47 pm »
Well, it depends what you mean by simple. When the alternative is something like this:
Code: [Select]
`LDA #\$6A ; Tile ID #\$6A = "-"STA \$6119,Y ; buffer for [name] control codeINY ; increment buffer write indexLDA \$0C ; uh-oh, we have no free RAM; need to move stuff around to make roomPHALDA \$0DPHALDA MonsterNumber2Letter_low ; copy monster number -> monster letter pointerSTA \$0CLDA MonsterNumber2Letter_highSTA \$0DTYA ; oops, monster number is in X but 6502 doesn't have a "Direct Page Indirect Indexed, X" address mode, so need to save Y so we can replace it with XPHATXATAYLDA (\$0C),Y ; monster letterSTA \$6119,Y ; buffer for [name] control codeTYA ; okay, now put everything back the way it was before so we don't screw up the calling codeTAXPLATAYPLASTA \$0DPLASTA \$0C`then simply adding #\$23 starts to look like a pretty good option . Numbers would actually be easier than letters here, since the tilemap is already laid out with the numbers 0 to 9 in positions #\$00 to #\$09, so you could skip the addition and just STA \$6119,Y.

But that's just one way a different game on a different system implements this kind of thing - you'll still have to figure out what your game on your system is actually doing.

#### q8fft

• Jr. Member
• Posts: 37
##### Re: [Technical] [NDS] Dragon Quest V Finding A,B,C Etc..
« Reply #4 on: June 13, 2019, 11:32:03 am »
I really appreciate your response very much, the problem was solved by the easiest way and thanks for help.

#### abw

• Sr. Member
• Posts: 303
##### Re: [Technical] [NDS] Dragon Quest V Finding A,B,C Etc..
« Reply #5 on: June 13, 2019, 09:18:06 pm »
Glad to hear you got it solved! Did you end up going with numbers instead of letters, or did you manage to get the different letters working?

#### q8fft

• Jr. Member
• Posts: 37
##### Re: [Technical] [NDS] Dragon Quest V Finding A,B,C Etc..
« Reply #6 on: November 21, 2019, 03:08:29 am »
Glad to hear you got it solved! Did you end up going with numbers instead of letters, or did you manage to get the different letters working?
No. But I edit the font drew to suit my language.