Unlimited room header! And the RT (Room Transfer) program

Page 2 of 6 Previous  1, 2, 3, 4, 5, 6  Next

View previous topic View next topic Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Wed 24 Jul 2013 - 15:36

Thank you, this tool is going to be awesome! :-)

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Erockbrox on Thu 25 Jul 2013 - 4:33

I don't understand this whole not releasing the source code stuff.

I mean, it would only help everyone here out. By not releasing it, your just pissing everyone off. WTF?
avatar
Erockbrox
          
          

Since : 2013-02-05

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 25 Jul 2013 - 6:46

You should know, Erock, that the only person who has it on this forum is MoN, and he was aked by the author not to release it (the only person who can change that is the author himself sephiroth3, who disappeared from the Net in 2006). So nothing we can do here. Plus, only XaserLe or Conn (or Wiiqwert, if he's still around) could have some benefit from such a release and correct its buggy nature.

Starting fresh (like BM source) or making a custom utility for transporting data in hex are much better choices, then to rewrite the entire source. The only thing it could be usefull is to for instance changing the locations of room hex data (this should be easy to do). The game would then not bug out on room editing, since it would have more space to work. (In general authors don't like giving the source, because then you can alter their work).
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 25 Jul 2013 - 16:20

@XaserLe
 
Here the example of (manual) data extraction for room 56 in Alttp to help you with your custom program.
 
 
1.) objects F8000
 
find pointer = 1+56= 57, 57x3= 171 (dec), select block 171 in dec from position F8000;
last 3 bytes (that are still a part of the selected block) are the pointer!
AE 92 1F = 1F92AE (snes) = F92AE (pc = hex)
 
 
pointer --> jump to data= start of data= F92AE, end is third FF FF after start.
 
all data is:
E1 04 FC 23 00 18 31 01 FC 83 04 20 22 61 FC 81 00 FC 24 81 18 49 02 FC 84 85 22 5B 61 FC 8B 04 18 B1 01 FC 2B 00 FC 2C 81 18 C9 02 FC 8C 85 20 DA 61 FC 8E 81 20 6A 65 69 3A 66 FC E1 38 2F 23 C8 2C 63 C8 34 63 C8 54 63 C8 5C 63 C8 2F AB C8 2C A0 C8 34 A0 C8 54 A0 C8 5C A0 C8 2F 1D 3F 2F 23 79 2F 63 79 2F A3 79 2C E1 79 2F E9 40 6B 23 7A 6B 63 7A 6B A3 7A 68 E1 7A 44 61 41 47 67 7A 44 A5 42 53 67 79 39 EB FE 59 10 F8 4B 67 FA 4B 6F FA 4B 97 FA 4B 9F FA 60 81 FE 01 11 C0 01 5B C0 01 91 C0 01 D9 C0 FF FF FF FF F0 FF 02 2E 22 1C FF FF
 
 
 
2.) header 27502
header (staircase1 is opened)--> header is 11 bytes long
 
find pointer = 1+56= 57, 57x2= 114 (dec), select block 114 in dec from position 27502;
last 2 bytes (that are still a part of the selected block) are the pointer!
46 F9 = add 04 = 46 F9 04 = 04F946 (snes)= 27946 (pc = hex)
 
 
pointer --> jump to data= start of data= 27946, end is examined (11 bytes in this case, because staircase1 is opened in HM)
 
all data is:
80 0A 08 11 00 00 00 00 00 00 28
  
 
3.) sprites 4D62E
find pointer = 1+56= 57, 57x2= 114 (dec), select block 114 in dec from position 4D62E;
last 2 bytes (that are still a part of the selected block) are the pointer!
53 DD = add 09 = 53 DD 09 = 09DD53 (snes)= 4DD53 (pc = hex)
 
pointer --> jump to data= start of data= 4DD53, end is FF.
 
 
all data is:
00 06 0C 81 0A 07 81 0C 0C 9A 10 0C C5 14 06 9A 18 0C 9A 1A 07 81 FF
  
 
4.) items DB69
find pointer = 1+56= 57, 57x2= 114 (dec), select block 114 in dec from position DB69;
last 2 bytes (that are still a part of the selected block) are the pointer!
80 DF = add 01 = 80 DF 01 = 01DF80 (snes)= 00DF80 (pc = hex).
 
pointer --> jump to data= start of data= DF80, end is FF FF.
 
 
all data is:
A4 0C 0A A4 0D 07 A4 12 0A A4 13 08 FF FF
--------------------------------------------------------
 
 
End result for room 56 is
(I hope you can make a custom utility to be able to extract the lower codes into txt automatically)
 
1) objects
E1 04 FC 23 00 18 31 01 FC 83 04 20 22 61 FC 81 00 FC 24 81 18 49 02 FC 84 85 22 5B 61 FC 8B 04 18 B1 01 FC 2B 00 FC 2C 81 18 C9 02 FC 8C 85 20 DA 61 FC 8E 81 20 6A 65 69 3A 66 FC E1 38 2F 23 C8 2C 63 C8 34 63 C8 54 63 C8 5C 63 C8 2F AB C8 2C A0 C8 34 A0 C8 54 A0 C8 5C A0 C8 2F 1D 3F 2F 23 79 2F 63 79 2F A3 79 2C E1 79 2F E9 40 6B 23 7A 6B 63 7A 6B A3 7A 68 E1 7A 44 61 41 47 67 7A 44 A5 42 53 67 79 39 EB FE 59 10 F8 4B 67 FA 4B 6F FA 4B 97 FA 4B 9F FA 60 81 FE 01 11 C0 01 5B C0 01 91 C0 01 D9 C0 FF FF FF FF F0 FF 02 2E 22 1C FF FF
 
2) header
80 0A 08 11 00 00 00 00 00 00 28
 
3) sprites
00 06 0C 81 0A 07 81 0C 0C 9A 10 0C C5 14 06 9A 18 0C 9A 1A 07 81 FF
 
4) items
A4 0C 0A A4 0D 07 A4 12 0A A4 13 08 FF FF
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 25 Jul 2013 - 16:27

Great, well made, thank you, that will help a lot.
Next Thursday is my last test for this semester, after passing it i will begin :-)

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 25 Jul 2013 - 16:44

Nice. This is my other document for data extraction:
 
data extraction TXT
https://www.dropbox.com/s/y809qw1iukc908q/Data%20extraction.txt
 
 
Test in end july, this reminds me on the time, when I was still studying.
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 25 Jul 2013 - 16:56

Wow, it seems you hold a whole treasure of hex data from this game :-)
Yes the semesters a really hard (computer science) and i am glad if the tests are done and i have 2 months of freetime.
What did you study?

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 25 Jul 2013 - 17:04

Regarding the hex data. I made those documents a while back (they are similar though, but this one is more focused on extraction). I used Hyrule Magic and reverse engeneering.
 
I studied European (and partially world) history. (But forgot a lot of it also Smile ).


Last edited by Puzzledude on Thu 25 Jul 2013 - 17:31; edited 1 time in total
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 25 Jul 2013 - 17:22

Good strategy. A few yeara ago i recoded the mapeditor of the game "Settlers 2" (under the pseudo Xaser) and did the same. Used the original editor, changed something and searched via hex editor what happend :-)

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 1 Aug 2013 - 12:00

Ok the semester is done :-D, i am free for two months!
I will start immediately!

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 1 Aug 2013 - 12:16

Nice. Meanwhile we have also decoded the sprites. Since Conn made a entirely new routine to transfer indoor sprites. It seems like the third byte 09, which has defined the global bank was "somewhere inside" and the entire new code was necessary, which loads the new 29 bank separately. This byte can of course be changed to anything.
 
So now we can officially move all data, that is connected to the indoors. Of course this is actually needed for putting data back in, but for now we can concentrate to extraction only.
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 1 Aug 2013 - 12:34

Yes i read this in the other thread, perfect.
But my main goal was rather to move data than extract. But no problem, i can also extract them cause this step is anyway necessary.
Could you update you indoor dungeon data describition with the sprite extraction? In the meanwhile i will start with the tool.

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 1 Aug 2013 - 12:54

Could you update you indoor dungeon data describition with the sprite extraction.
  
I've updated the original document here
http://zeldix.openphpbb.com/t58-vital-dungeon-hex-data#301


The extraction is just the first step. The second step is to insert, so basically all together is a transfer. However inserting can be done with precalculated pointers, giving the rooms enough space, so that they can not run out even on very filled room. The pointers would then be fixed, and would not change (so no bugs possible and quick restore of all pointers is possible).
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 1 Aug 2013 - 13:07

This will be a lot of work. Coding such things like reading pointers in little endian an follow them is much harder as writing "normal" software, but i will manage this.
How do you want me to extract the data? To a text file with description like "Room xx - Sprites:..."?

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 1 Aug 2013 - 13:37

I thought so. Maybe this is why HM never reads any pointers. Regarding the data extraction. Can be a standard txt, with the Room xx and then Objects followed by data, Header followed by data etc.

You could for instance simplify to read only secondary pointers for all data except sprites. These sec. pointers remain on place. Bigger problem with sprites, where the primary pointer remains, but secondary ones move.
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 1 Aug 2013 - 13:50

Ok, somehow this will work even if it's the last thing I'll ever do :-D

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 8 Aug 2013 - 6:50

Ok, the first alpha version. It moves room headers and recalculates header pointers. Next version will move room objects. I use the 3rd MegaByte of the ROM (0x200000 - 0x2FFFFF) for the data. Should work with all roms, cause nothing is hardcoded (except the pointer locations like 0xB5E7 and so on), the tool follows all pointers. Works also with ROMs that have the pointers moved with MathOnNapkins version of HM (by the way Math, thank you for cutting the pointers after room 295, that made it more complicated :-D).
I think that was the hardest part for now, the rest should be more paste and copy than coding (i hope so).

https://www.dropbox.com/s/gn68y40ndk26hif/RT.zip

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 8 Aug 2013 - 9:37

I've tested this out. Smart move with leaving the pointers in place, but moving the data only.
 
I found one problem though. It seem the read area is also maximum, which is 14 bytes, but the read area is changing (room0 of Alttp only has 10 bytes, next room has 14, next 11, then 7 etc, but it seems that RT always reeds 14).
 
Similar with RHE. But different problem there. RT is better, it just can not set the end of reading (I guess this is dufficult to do, since there's no FF indicator). The only way to se where it ends, is with original pointers. First one points to 82, next on on 8C, so 10 bytes long (for room 0).
 
 
 
Original Alttp (from room 0 to room 7)
pt---values
82---41 21 13 22 07 3D 00 00 00 10
8C---C0 00 00 04 00 00 00 00 00 00 72 00 50 52
9A---C0 1D 04 06 00 14 00 00 00 00 11
F0---C0 07 06 19 00 00 00
A5---00 18 0D 26 00 26 14 00 00 00 B5
B0---00 08 08 14 00 25 00
B0---00 08 08 14 00 25 00
B7---20 06 05 0C 00 25 00 00 00 17 17
 
 
Result of RT
 
60---41 21 13 22 07 3D 00 00 00 10 C0 00 00 04
6E---C0 00 00 04 00 00 00 00 00 00 72 00 50 52
7C---C0 1D 04 06 00 14 00 00 00 00 11 00 18 0D
8A---C0 07 06 19 00 00 00 00 0C 02 12 00 00 00
98---00 18 0D 26 00 26 14 00 00 00 B5 00 08 08
A6---00 08 08 14 00 25 00 20 06 05 0C 00 25 00
B4---00 08 08 14 00 25 00 20 06 05 0C 00 25 00
C2---20 06 05 0C 00 25 00 00 00 17 17 C0 07 06
 
 
Result of RHE
 
B0---41 21 13 22 07 3D 00 00 00 10 00 00 00 00
BE---C0 00 00 04 00 00 00 00 00 00 72 00 50 52
CC---C0 1D 04 06 00 14 00 00 00 00 11 00 18 0D
DA---00 00 00 00 00 00 00 00 00 00 00 00 00 00
E8---26 00 26 14 00 00 00 B5 00 00 00 00 00 00
F6---00 00 00 00 00 00 00 00 00 00 00 00 00 00
04---00 08 08 14 00 25 00 00 00 00 00 00 00 00
12---20 06 05 0C 00 25 00 00 00 17 17 00 00 00
20---C0 07 06 07 00 00 00 00 00 00 00 00 00 00
 
 
 
Should be like this (FF must be 00!)
 
60---41 21 13 22 07 3D 00 00 00 10 FF FF FF FF
6E---C0 00 00 04 00 00 00 00 00 00 72 00 50 52
7C---C0 1D 04 06 00 14 00 00 00 00 11 FF FF FF
8A---C0 07 06 19 00 00 00 FF FF FF FF FF FF FF
98---00 18 0D 26 00 26 14 00 00 00 B5 FF FF FF
A6---00 08 08 14 00 25 00 FF FF FF FF FF FF FF
B4---00 08 08 14 00 25 00 FF FF FF FF FF FF FF
C2---20 06 05 0C 00 25 00 00 00 17 17 FF FF FF
 
 
so it will look like this (similar to RT, but extra space must be 00)
 
60---41 21 13 22 07 3D 00 00 00 10 00 00 00 00
6E---C0 00 00 04 00 00 00 00 00 00 72 00 50 52
7C---C0 1D 04 06 00 14 00 00 00 00 11 00 00 00
8A---C0 07 06 19 00 00 00 00 00 00 00 00 00 00
98---00 18 0D 26 00 26 14 00 00 00 B5 00 00 00
A6---00 08 08 14 00 25 00 00 00 00 00 00 00 00
B4---00 08 08 14 00 25 00 00 00 00 00 00 00 00
C2---20 06 05 0C 00 25 00 00 00 17 17 00 00 00
 
 
one row version
(this is optimal for fast viewing and easy pointer calculation), (FF must be 00!)
 
60---41 21 13 22 07 3D 00 00 00 10 FF FF FF FF FF FF
70---C0 00 00 04 00 00 00 00 00 00 72 00 50 52 FF FF
80---C0 1D 04 06 00 14 00 00 00 00 11 FF FF FF FF FF
90---C0 07 06 19 00 00 00 FF FF FF FF FF FF FF FF FF
A0---00 18 0D 26 00 26 14 00 00 00 B5 FF FF FF FF FF
B0---00 08 08 14 00 25 00 FF FF FF FF FF FF FF FF FF
C0---00 08 08 14 00 25 00 FF FF FF FF FF FF FF FF FF
D0---20 06 05 0C 00 25 00 00 00 17 17 FF FF FF FF FF
 
Last two bytes of each row will be ignored (since they go over maximum). Also FF must be 00 (I've just put it on FF to see the extra space).
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 8 Aug 2013 - 11:04

Yes i use the full 14 bytes for the header and if one is shorter i read the data behind (header of the next room). Not the best way cause like you said, it is nearly impossible to see the end. I would need to check all pointers to see if the actual read header is shorter than 14 bytes. MathOnNapkins' HM version uses 14 bytes too, but it seems it sets 0xFF for unused data. I will try to manage this.

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 8 Aug 2013 - 11:06

I forgot: The Problem to see the end of a pointer is that it is possible to re-use them. The original game does this in some rooms. Therefore it is really hard.

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 8 Aug 2013 - 12:28

It is ok, if this can't be changed to 00. I think it does not affect the actual game. Since if only 7 bytes are used, there's no staircase in the room (which will then be set to some other value, if 00, this staircase will lead to room 0, if it is random, it would lead to random room).

And if the staircase is additionally put in the room, the actual value is set.

I haven't really thought of that, but it doesn't matter if it is random, since a value must be set. So 00 will only put it to room 0, rather then random.

The only problem, which might occur, is when adding new values manually, so it is better to always use the HM on another rom, to set the values.
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 8 Aug 2013 - 17:13

I thought so. No matter which value is there, the game ignores it. But there is one case that could be a problem. The doors normally lead to the room above, left, right or bottom if there is no header data for it. But when extending the data, the header data is there and so the door leads to the specific room given. But since this extending is done by using MathOnNapkins HM version, one need to correct these rooms anyway, so we shouldn't care about this.

This tool modifies the rom this way, that it will be unusual with HM, so it is there to merge roms together after editing. But i think this will be the most important tool alongside HM, cause when HM lacks of room space, you can simply use another rom and edit new rooms there with lots of chests, objects and sprites and finally merge it to one rom. Of course, only if it works as i excpect.


XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Thu 8 Aug 2013 - 17:27

Do you have an idea about this 4 pointers for the object data of rooms?

*Primary pointers at:
1. 8746, 01 80 1F --> F8001
2. 874C, 00 80 1F --> F8000
3. 883F, 01 80 1F --> F8001
4. 8845, 00 80 1F --> F8000 (all corespond to F8000)

Why are there 4 pointers?

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by Puzzledude on Thu 8 Aug 2013 - 17:36

No matter which value is there, the game ignores it. But there is one case that could be a problem. The doors normally lead to the room above, left, right or bottom if there is no header data for it. But when extending the data, the header data is there and so the door leads to the specific room given.
In this case the specific room given should match the natural door transit. I guess the manual edit would do.
 

Do you have an idea about this 4 pointers for the object data of rooms?

*Primary pointers at:
1. 8746, 01 80 1F --> F8001
2. 874C, 00 80 1F --> F8000
3. 883F, 01 80 1F --> F8001
4. 8845, 00 80 1F --> F8000 (all corespond to F8000)

Why are there 4 pointers?
You need to change all 4 pointers (the 1F only) to move the data. I guess looking at the actual code could tell us why. I guess 4 diffrent routines are being loaded. But that really doesn't matter, since this is a primary pointer(s). The secondary at F8000 are the importaint ones, and all have 3 bytes and can point anywhere.
avatar
Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Unlimited room header! And the RT (Room Transfer) program

Post by XaserLE on Fri 9 Aug 2013 - 4:03

Ok. This is the next thing i'll do.
By the way, you're right, this pointers don't matter. I forgot there is no need to move the pointer table since there is space for all 320 :-D

XaserLE
   
   

Since : 2013-01-22

Back to top Go down

Page 2 of 6 Previous  1, 2, 3, 4, 5, 6  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum