News:

11 March 2016 - Forum Rules

Main Menu

[NES] Captain Tsubasa II DTE Hack

Started by Kunio, June 03, 2014, 01:54:50 AM

Previous topic - Next topic

Kunio

Thanks to KingMike and his impressive tutorial : Ys III DTE (2010)  :thumbsup:

I have done DTE Hack on "Captain Tsubasa Vol. II - Super Striker (J) [!].nes"

Code 1 (Original) :
$84E7 --> $04F7
A0 00 B1 4D

84E7:A0 00     LDY #$00
84E9:B1 4D     LDA ($4D),Y @ $A2AE

********************************************************
Code 2 (Jump) :
$84E7 --> $04F7
4C D0 FF EA

84E7:4C D0 FF  JMP $FFD0
84EA:EA        NOP

********************************************************
Code 3 (PRG Bank Switch) :
$FFD0 --> $3FFE0
A9 06 8D 00 80 A9 07 8D 01 80 20 00 9E 48 A9 06 8D 00 80 A9 00 8D 01 80 68 4C EA 84

FFD0:A9 06     LDA #$06
FFD2:8D 00 80  STA $8000
FFD5:A9 07     LDA #$07
FFD7:8D 01 80  STA $8001
FFDA:20 00 9E  JSR $9E00
FFDD:48        PHA
FFDE:A9 06     LDA #$06
FFE0:8D 00 80  STA $8000
FFE3:A9 00     LDA #$00
FFE5:8D 01 80  STA $8001
FFE8:68        PLA
FFE9:4C EA 84  JMP $84EA

********************************************************
Code 4 (DTE Routine) :
$9E00 --> $FE10
A5 BF C9 00 D0 26 A0 00 B1 4D C9 6F 10 03 B1 4D 60 B1 4D C9 7F 10 F7 E6 BF 8A 48 B1 4D 38 E9 70 0A AA BD 50 9E 85 BE 68 AA A5 BE 60 C6 BF C6 4D A5 4D C9 FF D0 02 C6 4E 8A 48 A0 00 B1 4D 38 E9 70 0A AA BD 51 9E 85 BE 68 AA A5 BE 60

Free Ram : BE BF

9E00:A5 BF     LDA $00BF
9E02:C9 00     CMP #$00
9E04:D0 26     BNE $9E2C
9E06:A0 00     LDY #$00
9E08:B1 4D     LDA ($4D),Y @ $A020
9E0A:C9 6F     CMP #$6F
9E0C:10 03     BPL $9E11
9E0E:B1 4D     LDA ($4D),Y @ $A020
9E10:60        RTS
9E11:B1 4D     LDA ($4D),Y @ $A020
9E13:C9 7F     CMP #$7F
9E15:10 F7     BPL $9E0E
9E17:E6 BF     INC $00BF
9E19:8A        TXA
9E1A:48        PHA
9E1B:B1 4D     LDA ($4D),Y @ $A020
9E1D:38        SEC
9E1E:E9 70     SBC #$70
9E20:0A        ASL
9E21:AA        TAX
9E22:BD 50 9E  LDA $9E50,X @ $9E53
9E25:85 BE     STA $00BE
9E27:68        PLA
9E28:AA        TAX
9E29:A5 BE     LDA $00BE
9E2B:60        RTS
9E2C:C6 BF     DEC $00BF
9E2E:C6 4D     DEC $004D
9E30:A5 4D     LDA $004D
9E32:C9 FF     CMP #$FF
9E34:D0 02     BNE $9E38
9E36:C6 4E     DEC $004E
9E38:8A        TXA
9E39:48        PHA
9E3A:A0 00     LDY #$00
9E3C:B1 4D     LDA ($4D),Y @ $A020
9E3E:38        SEC
9E3F:E9 70     SBC #$70
9E41:0A        ASL
9E42:AA        TAX
9E43:BD 51 9E  LDA $9E51,X @ $9E54
9E46:85 BE     STA $00BE
9E48:68        PLA
9E49:AA        TAX
9E4A:A5 BE     LDA $00BE
9E4C:60        RTS

********************************************************
Code 5 (DTE Table) :
$9E50 --> $FE60
56 56 57 57 58 58 59 59 5A 5A 5B 5B 5C 5C 5D 5D 5E 5E 5F 5F 60 60 61 61 62 62 63 63 64 64 65 65

70 : 56 56 : A A
71 : 57 57 : B B
72 : 58 58 : C C
73 : 59 59 : D D
74 : 5A 5A : E E
75 : 5B 5B : F F
76 : 5C 5C : G G
77 : 5D 5D : H H
78 : 5E 5E : I I
79 : 5F 5F : J J
7A : 60 60 : K K
7B : 61 61 : L L
7C : 62 62 : M M
7D : 63 63 : N N
7E : 64 64 : O O
7F : 65 65 : P P


It works perfect :





Any Idea to improve it?

I am asking for improvement because in the future I have a plan to make a toolbox DTE patch.

Lets say give the toolbox the free ram byte and other addresses and click on "patch the game" button and bingo!

In the output there will the game with DTE implemented in it!

********************************

I noticed some mistakes along the way it would be great to fix them in the next edition :





Also there are two "ASL A" which should be just "ASL"


KingMike

Good catch on the TXA/TAX mixup.

As to whether or not A should be implied in an ASL opcode without an argument (as shifts can be used on A or memory) or if that should be considered an error, that's probably an interpretation difference. Not sure if it's official or not.
"My watch says 30 chickens" Google, 2018

Kunio

#2
Thanks for the comment

What do you think about the PRG bank switch code?

Can you explain about this please :

QuoteNow, you'll want to use the RAM you speficied as a DTE table previously. Specify the address of the first byte of the first DTE table, and the math (DTE index x 2) should take care of the rest.
Alternately, if you chose to make a seperate table for the first letter of each tile, and a sperate table for the second letter of each tile, you'd skip the ASL A (0A) command. (You might want to do this, since you can have only 256 connected bytes, so one table will allow you 128 pairs, while using two seperate tables will allow you 256 pairs)

How is it possible to have double amount of pairs with using two DTE tables?

Edit :
Please delete one of these docs :
Ys III DTE v1.1 (2010)
DTE - You can do it, we can help v2.0 (2008)
Their version number is badly misleading!
I would like to see your next DTE doc under this title :
DTE - You can do it, we can help v3.0 (2014)

And : Add a revision history to the doc itself.

And : This tutorial is not game specific, it teaches about DTE by using Ys III as an example!

Thanks again

KingMike

You can double the number of pairs by using two tables (make one table of the first character in every pair, and another table with the second character in each).

So like to read pair 5:
on a single-table DTE, you'd read character 10 (5 x 2) on pass 1 and character 11 (5x2 + 1) on pass 2.
on a two-table DTE, you'd read character 5 in table 1 on pass 1 and character 5 on table 2 on pass 2.

The limit is increased because DTE routines use X to read into the table, so on NES (which has only 8-bit registers) it is only possible to read up to 255 bytes ahead from the start of the table. Since a single-table DTE takes two bytes per pair, that means you can only have half as many pairs.
"My watch says 30 chickens" Google, 2018

Kunio

Oh, I think I get it now
Having two DTE tables is useful when there is a need for more than 128 pairs!
For example 129 pairs or so ....
And at most it is possible to have 256 pairs!
But I think having 128 pairs is more than enough!