2000 cards limit
Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!
PLEASE DO NOT REPORT BUGS HERE!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
2000 cards limit
by Mok » 24 Nov 2011, 02:02
I was asked recently to help with the 2000 cards problem, I refused since I'm no longer interested in the project (not to mention most of my old code/ida database was gone during a hd crash years ago) but I was bored today and decided to take a quick look. It seems there's not much to do really, but I can't really say if it will be enough.
- Main struct loaded from cards.dat (entries are card_ptr_t in your includes, in the past I called it CDAT) needs to be moved and expanded, all references pointing to it must be changed. Currently it's at 0x73BAE0 in your exe (size is 0x98 * 2000 but looks like it was partially overwritten by some of the new code? as it even spans the sections of the new exe file... I have no idea about the changes you made so I'll ignore it). A few references are not pointing to the start of the struct (ie. seems like the code of whimsy accesses some entry directly etc).
- There's another struct that simply contains addresses of each card in the above struct (mostly used originally by my asm macros). It's at 0x55D0E0 (size 4 * 2000). The code filling it is at 0x4022CC and of course needs to be changed from 2000 entries to whatever. This one will have a lot of references that need to be changed of course (after moving it and expanding).
- A small struct that contains addresses of DamageText, EffectTitle, EffectText, LegacyTitle and LegacyText (so 20 bytes per entry * 2000) needs to be moved and expanded and all references to it must be changed. Currently it's at 0x60EFDC with about ~20 places referencing it in the code.
- Another small struct contains the info if the cards are legal ("coded" field in the csv). Each card takes 1 bit so the size is currently 2000/8. This needs to be moved, expanded and references changed. This also requires a small change in my old csv2dat.exe program as it always writes 2000 cards in there. The struct is currently at 0x4EB7F8. The code at 0x4681B4 "cmp eax, 2000" needs to be changed to whatever.
That's all I see at the moment.
Similar changes will most likely be needed in deckdll.dll (as it loads cards.dat and checks if the cards are coded) and DrawCardLib.dll (that one has CDAT on stack, yeah whole 304kb of it O.o) I can probably help fixing these if anyone will attempt it at all.
- Main struct loaded from cards.dat (entries are card_ptr_t in your includes, in the past I called it CDAT) needs to be moved and expanded, all references pointing to it must be changed. Currently it's at 0x73BAE0 in your exe (size is 0x98 * 2000 but looks like it was partially overwritten by some of the new code? as it even spans the sections of the new exe file... I have no idea about the changes you made so I'll ignore it). A few references are not pointing to the start of the struct (ie. seems like the code of whimsy accesses some entry directly etc).
- There's another struct that simply contains addresses of each card in the above struct (mostly used originally by my asm macros). It's at 0x55D0E0 (size 4 * 2000). The code filling it is at 0x4022CC and of course needs to be changed from 2000 entries to whatever. This one will have a lot of references that need to be changed of course (after moving it and expanding).
- A small struct that contains addresses of DamageText, EffectTitle, EffectText, LegacyTitle and LegacyText (so 20 bytes per entry * 2000) needs to be moved and expanded and all references to it must be changed. Currently it's at 0x60EFDC with about ~20 places referencing it in the code.
- Another small struct contains the info if the cards are legal ("coded" field in the csv). Each card takes 1 bit so the size is currently 2000/8. This needs to be moved, expanded and references changed. This also requires a small change in my old csv2dat.exe program as it always writes 2000 cards in there. The struct is currently at 0x4EB7F8. The code at 0x4681B4 "cmp eax, 2000" needs to be changed to whatever.
That's all I see at the moment.
Similar changes will most likely be needed in deckdll.dll (as it loads cards.dat and checks if the cards are coded) and DrawCardLib.dll (that one has CDAT on stack, yeah whole 304kb of it O.o) I can probably help fixing these if anyone will attempt it at all.
Last edited by Aswan jaguar on 01 Jun 2014, 12:04, edited 1 time in total.
Reason: unsticky-not needed to be sticky anymore
Reason: unsticky-not needed to be sticky anymore
Re: 2000 cards limit
by Aswan jaguar » 24 Nov 2011, 12:54
I just want to take this opportunity and thank you, now ,for all the work you put in this project and revived this game we love.Also thank you for the direction as to what is needed to overcome the 2000 cards limit,my best wishes.
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8131
- Joined: 13 May 2010, 12:17
- Has thanked: 748 times
- Been thanked: 479 times
Re: 2000 cards limit
by Gargaroz » 24 Nov 2011, 17:28
Wow, this was really unexpected ! Mok is back !
As the main Manalink mantainer now, I want to thank you for you past and present work, we all owe you a lot for making the updating of Manalink possible.
I hope that our ASM crew will make good use of your suggesions.
As the main Manalink mantainer now, I want to thank you for you past and present work, we all owe you a lot for making the updating of Manalink possible.
I hope that our ASM crew will make good use of your suggesions.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: 2000 cards limit
by Mok » 28 Nov 2011, 20:17
Is there any documentation about the changes done to various game files? I'm not keen on touching magic.exe but I could try modifying some dlls. I managed to get deckbuilder running locally with cards.dat of 5000+ random cards but it's not compatible with the current version. I noticed the ugly hook to magic.exe for loading .bmp files instead of .pics but where are the changes done to the data? Ie. displaying "AVATAR xxx" type cards etc.
Re: 2000 cards limit
by Xenocyde » 28 Nov 2011, 23:42
Yes! Mok's going to fix it! Would love a 2000+ cards version for Christmas 

Re: 2000 cards limit
by Mok » 29 Nov 2011, 00:09
No, I won't. The changes made during last years (the main exe file) are too big for me to bother. But I can help, assuming there's someone willing to put some work into it. I can try to fix the additional files (deckbuilder, other dlls) but I will need someone with the knowledge about the changes as some hacks are hard to spot. I hope some people responsible for direct changes are still around.
Re: 2000 cards limit
by 0rion79 » 29 Nov 2011, 09:46
Mok, big thanks from me too: you did an awesome job with this game years ago and you've inspired most of us to keep it alive. Thanks for coming back and providing assistance.
-
0rion79 - Posts: 1520
- Joined: 24 Feb 2009, 18:33
- Location: Italy
- Has thanked: 94 times
- Been thanked: 61 times
Re: 2000 cards limit
by Dave » 29 Nov 2011, 12:41
Mok, you mean something like this ?I can try to fix the additional files (deckbuilder, other dlls) but I will need someone with the knowledge about the changes as some hacks are hard to spot
i found this here : http://www.slightlymagic.net/forum/viewtopic.php?f=56&t=911by HarryPitfall » 01 Mar 2009, 03:43
Magic.exe
ManalinkEx.dll => for hand made code, 2 mb of size, load at $1001000
ManalinkEh.dll => compiled by code, no size restriction, load at $2001000
Re: 2000 cards limit
by gmzombie » 29 Nov 2011, 12:59
holy crap man this is a great way to get back into the forum and see you here man. I'm very happy that you have decided to help and we will do what we can to make this happen. As for the ugly hook on the .pic to .bmp i would say that I helped locate that exact problem and did a lot to get the game to accept bmps in the deckdll due to the fact that we wanted to update the graphics of the game. I couldn't quite figure out how to add the bmp code from magic.exe to the dll and make it work right..Also the avatars in the current game are recreated through the csv and are probably in the C side of the manalinkeh.dll. If you need pre hacked deckdll.dll i can give it i have most of the patches all the way back to your original patch...some things must be kept safe
As you may have already read on the forum Snacko one of the big time coders has recoded Cardartlib along with help i belive from Foolsopher and Snacko has also recoded drawcardlib. of course those are the 2 he has done. with the addition of Lonefoxes being able to code cards into C, the addition of cards went through the roof with some great coders along the way. If you need anything patch wise i will be here to help.

can I maze of ith your snowstorm?
http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
- gmzombie
- Posts: 857
- Joined: 26 Feb 2009, 01:05
- Location: Wyoming, Mi
- Has thanked: 200 times
- Been thanked: 51 times
Re: 2000 cards limit
by 0rion79 » 29 Nov 2011, 13:06
Mok, may you satisfy my curiosity about a side matter? When you did empower the original game, why did you choose to code the whole 8th edition rather than any other expansion set? 

-
0rion79 - Posts: 1520
- Joined: 24 Feb 2009, 18:33
- Location: Italy
- Has thanked: 94 times
- Been thanked: 61 times
Re: 2000 cards limit
by jatill » 29 Nov 2011, 13:42
I did a lot of Magic.exe hacking, but none of what I did is pertinant here, I think. The main changes were by LoneFox, SkyMarshall, and HarryPitfall.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: 2000 cards limit
by Gargaroz » 29 Nov 2011, 14:17
I got too a question for Mok, but it's unrelated to the 2000 card limit : have you decrypted the "Reserved Infos" field of the editor ? And what is the "Secret byte" ?
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: 2000 cards limit
by Mok » 29 Nov 2011, 17:45
That's not the problem, the bmp hack is easy to remove (I have added some code that loads images in db from different types of files and it seems to work, I just wanted deck.exe to work again to test db with more cards that magic.exe can accept), but the problem is: if I replace deckdll.dll with a new version, the avatar cards don't show up when the db is started from magic.exe. It seems the new code (manalinkeh.dll? no idea) is modifying something directly and I don't know where to look for the hack. It does not seem to be done inside deckdll.dll, so it must be somewhere else.gmzombie wrote:As for the ugly hook on the .pic to .bmp i would say that I helped locate that exact problem and did a lot to get the game to accept bmps in the deckdll due to the fact that we wanted to update the graphics of the game. I couldn't quite figure out how to add the bmp code from magic.exe to the dll and make it work right..Also the avatars in the current game are recreated through the csv and are probably in the C side of the manalinkeh.dll.
Re: 2000 cards limit
by Mok » 29 Nov 2011, 17:52
What editor?Gargaroz wrote:I got too a question for Mok, but it's unrelated to the 2000 card limit : have you decrypted the "Reserved Infos" field of the editor ? And what is the "Secret byte" ?

Who is online
Users browsing this forum: No registered users and 7 guests