Manalink update 2009-03-11
The latest Manalink updates are posted here.
PLEASE DO NOT BUMP OLD UPDATES!
PLEASE DO NOT BUMP OLD UPDATES!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
Re: Manalink update 2009-03-11
by HarryPitfall » 11 Mar 2009, 22:45
The signets still make a item on stack, that does nothing... is ugly and strange.
I recoded the signets, now, is just only one code pointer for all signets, that do:
1, tap: add XX to your mana pool.
Is uses the field "Card Color" on magic.exe tab to determine the types of mana to add to pool. I can make the signets add mana without using stack using a small trick, 'cancelling' the processing but tapping and adding mana...
jmp near SignetOfMana ; 020010E7
I notice that all signets have correct card color based on it's color that can produce mana. So, I can use it...
I recoded the signets, now, is just only one code pointer for all signets, that do:
1, tap: add XX to your mana pool.
Is uses the field "Card Color" on magic.exe tab to determine the types of mana to add to pool. I can make the signets add mana without using stack using a small trick, 'cancelling' the processing but tapping and adding mana...
jmp near SignetOfMana ; 020010E7
I notice that all signets have correct card color based on it's color that can produce mana. So, I can use it...
- HarryPitfall
- AI Programmer
- Posts: 175
- Joined: 31 May 2008, 00:14
- Has thanked: 1 time
- Been thanked: 3 times
Re: Manalink update 2009-03-11
by jatill » 11 Mar 2009, 23:35
Installed camelbox. Here's what I get for errors when I run build:
cc1.exe: error: unrecognized command line option "-fcflags"
cc1.exe: error: unrecognized command line option "-flibs`"
gcc: `pkg-config: No such file or directory
gcc: glib-2.0: No such file or directory
and then later...
ld: cannot perform PE operations on non PE output file 'obj/count_graveyard.bin'.
pkg-config in in my bin, so I'm not sure why it would complain about that... Any ideas?
Also, in which file do you map the hard-coded pointed in magic.exe to the variables you create?
Ex: extern int *graveyard_ptr[]; ... how does the compiler know what to turn this into?
cc1.exe: error: unrecognized command line option "-fcflags"
cc1.exe: error: unrecognized command line option "-flibs`"
gcc: `pkg-config: No such file or directory
gcc: glib-2.0: No such file or directory
and then later...
ld: cannot perform PE operations on non PE output file 'obj/count_graveyard.bin'.
pkg-config in in my bin, so I'm not sure why it would complain about that... Any ideas?
Also, in which file do you map the hard-coded pointed in magic.exe to the variables you create?
Ex: extern int *graveyard_ptr[]; ... how does the compiler know what to turn this into?
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Manalink update 2009-03-11
by jed_f » 12 Mar 2009, 07:20
Ei guys ! great job on the updates but i have 1 problem though...after i overwrite my files with the updated manalink files i get a "coudnt initialize card drawing" error...this error comes from magic.exe......any solutions on this? the only everything's working for me now is DOTP ver 3 and manalink ver 1.32. if i play with manalink ver 2 it says your magic.exe is not updated. any reply here will be appreciated. thanks !!
- jed_f
- Posts: 3
- Joined: 12 Mar 2009, 07:15
- Has thanked: 0 time
- Been thanked: 0 time
Re: Manalink update 2009-03-11
by LoneFox » 12 Mar 2009, 07:56
Does it work if you replace do_binject function in build.pl with this? I'm at work, so I can't test it myself just now...jatill wrote:Installed camelbox. Here's what I get for errors when I run build:
cc1.exe: error: unrecognized command line option "-fcflags"
cc1.exe: error: unrecognized command line option "-flibs`"
gcc: `pkg-config: No such file or directory
gcc: glib-2.0: No such file or directory
and then later...
ld: cannot perform PE operations on non PE output file 'obj/count_graveyard.bin'.
pkg-config in in my bin, so I'm not sure why it would complain about that... Any ideas?
- Code: Select all
sub do_binject
{
print "Building binject\n";
my $glib_flags = `pkg-config glib-2.0 --cflags --libs`;
chomp $glib_flags;
my $exe = $^O =~ /Win32/ ? '.exe' : '';
my $extra_flags = $^O =~ /Win32/ ? '-mconsole' : '';
run_command("$config->{cc} -O2 -Wall $glib_flags $extra_flags -o binject$exe binject.c");
}
See manalink.ldsAlso, in which file do you map the hard-coded pointed in magic.exe to the variables you create?
Ex: extern int *graveyard_ptr[]; ... how does the compiler know what to turn this into?
Re: Manalink update 2009-03-11
by jed_f » 12 Mar 2009, 08:16
Lonefox please help me with my problem when i install your update. when i double click on magic.exe i get a "coudn't initialize card drawing" error. im waiting for a reply for this. thanks alot. im new to this so i apologize.
- jed_f
- Posts: 3
- Joined: 12 Mar 2009, 07:15
- Has thanked: 0 time
- Been thanked: 0 time
Re: Manalink update 2009-03-11
by Snacko » 12 Mar 2009, 09:00
@Lonefox
under windows you get
*ld: cannot perform PE operations on non PE output file
under windows you get
*ld: cannot perform PE operations on non PE output file
First link only then something like objcopy -O binary -j .text $out $binThis is a known problem with the linker. It cannot link PE files and
convert to BINARY format at the same time. You will need to link to a PE
format file first and then use OBJCOPY to convert it to BINARY format
afterwards.
Re: Manalink update 2009-03-11
by LoneFox » 12 Mar 2009, 09:51
OUCH!Snacko wrote:@Lonefox
under windows you get
*ld: cannot perform PE operations on non PE output fileFirst link only then something like objcopy -O binary -j .text $out $binThis is a known problem with the linker. It cannot link PE files and
convert to BINARY format at the same time. You will need to link to a PE
format file first and then use OBJCOPY to convert it to BINARY format
afterwards.
I tried that approach first (on linux), but objcopy doesn't seem to have any way to specify start address, so all function calls go wrong. Then I discovered that ld supports raw binary output as well and got things working.
Does Windows version of ld support ELF objects as input? Objcopy (and possibly ld itself as well) can convert PE to ELF.
Also, with the dll file it may be possible to discard all these hacks and kludges and simply compile and link the whole dll as normal (whatever that means on Windows... I know very little about Windows programming).
Re: Manalink update 2009-03-11
by jed_f » 12 Mar 2009, 11:19
nobody here wants to help me. well its ok. i thought people here are helpfull.
- jed_f
- Posts: 3
- Joined: 12 Mar 2009, 07:15
- Has thanked: 0 time
- Been thanked: 0 time
Re: Manalink update 2009-03-11
by jatill » 12 Mar 2009, 11:57
Ok, so I have access to a unix machine and ran build.pl there. There were errors, but at least they were different Any suggestions on approaching this route?
Building binject
binject.c: In function `parse_command_line':
binject.c:18: `G_OPTION_ARG_INT64' undeclared (first use in this function)
binject.c:18: (Each undeclared identifier is reported only once
binject.c:18: for each function it appears in.)
binject.c: In function `save_target':
binject.c:89: warning: implicit declaration of function `g_file_set_contents'
Do I need to pass in command line args to this script?
Building binject
binject.c: In function `parse_command_line':
binject.c:18: `G_OPTION_ARG_INT64' undeclared (first use in this function)
binject.c:18: (Each undeclared identifier is reported only once
binject.c:18: for each function it appears in.)
binject.c: In function `save_target':
binject.c:89: warning: implicit declaration of function `g_file_set_contents'
Do I need to pass in command line args to this script?
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Karoos
by jatill » 12 Mar 2009, 12:07
As expected, the first param to the targeting proc is whether or not to show the cancel button. So if I change the 1 on line 1200513 to a 0, you cannot cancel the bouncing of the land. I'll apply that fix this weekend.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Manalink update 2009-03-11
by LoneFox » 12 Mar 2009, 12:17
This means the system has ancient version of glib, g_file_set_contents was added in 2.8 and G_OPTION_ARG_INT64 in 2.12.jatill wrote:Ok, so I have access to a unix machine and ran build.pl there. There were errors, but at least they were different Any suggestions on approaching this route?
Building binject
binject.c: In function `parse_command_line':
binject.c:18: `G_OPTION_ARG_INT64' undeclared (first use in this function)
binject.c:18: (Each undeclared identifier is reported only once
binject.c:18: for each function it appears in.)
binject.c: In function `save_target':
binject.c:89: warning: implicit declaration of function `g_file_set_contents'
Current is 2.18.4. You can check the version with
- Code: Select all
pkg-config glib-2.0 --modversion
Re: Manalink update 2009-03-11
by jatill » 12 Mar 2009, 13:00
Well, you're right, my glib and pkg-config are both ancient. Unfortunately, I don't have root access, so I'm out of luck for now. Is it an easy change for you to be able to use an older version of glib, or no? If not, I'll keep crossing my fingers that someone either makes a windows version of the compiler or makes some kind of all-in-1 download I can use to run build.pl. Is that even possible, to include all the compiler programs I would need without me having to 'make' them?
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Manalink update 2009-03-11
by Snacko » 12 Mar 2009, 13:06
I was thinking about building a dll as well as a bonus you get the .data section that might be useful for the custom strings in dialogs.
The problem seems to go deeper as you can't even output ELF or anything but PE in one go, you have to link (always PE) then objcopy to ELF/other format.
I tested ld and it accepts ELF as input without a problem.
I can post a c dll template it's basically 3 lines long and you can compile that easily with gcc -shared under mingw.
You could get a cross compiler working under linux, most distros have it under the name mingw.
Once this is fully working I can make a package, but I got other tools / libraries included so it adds up to a ~15MB archive and 100MB decompressed.
The problem seems to go deeper as you can't even output ELF or anything but PE in one go, you have to link (always PE) then objcopy to ELF/other format.
I tested ld and it accepts ELF as input without a problem.
I can post a c dll template it's basically 3 lines long and you can compile that easily with gcc -shared under mingw.
You could get a cross compiler working under linux, most distros have it under the name mingw.
Once this is fully working I can make a package, but I got other tools / libraries included so it adds up to a ~15MB archive and 100MB decompressed.
Re: Manalink update 2009-03-11
by jatill » 12 Mar 2009, 13:21
Wow, all this compiler talk is making me feel really dumb. Snacko, I have no idea what you're talking about, but if the end result is that I can compile in windows, I'm happy. I have no concerns about 100MB files. In the mean time, I'm going to try running build.pl via cygwin. If that doesn't work, I'll throw up my hands and pray to the experts to save me Thanks for your hard work, both of you.Snacko wrote:I was thinking about building a dll as well as a bonus you get the .data section that might be useful for the custom strings in dialogs.
The problem seems to go deeper as you can't even output ELF or anything but PE in one go, you have to link (always PE) then objcopy to ELF/other format.
I tested ld and it accepts ELF as input without a problem.
I can post a c dll template it's basically 3 lines long and you can compile that easily with gcc -shared under mingw.
You could get a cross compiler working under linux, most distros have it under the name mingw.
Once this is fully working I can make a package, but I got other tools / libraries included so it adds up to a ~15MB archive and 100MB decompressed.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Manalink update 2009-03-11
by jatill » 12 Mar 2009, 13:24
So I run the command in cygwin and get the same errors I previously had in windows:
cc1.exe: error: unrecognized command line option "-fcflags"
cc1.exe: error: unrecognized command line option "-flibs`"
gcc: `pkg-config: No such file or directory
gcc: glib-2.0: No such file or directory
By then when I check the glib version, I see 2.16.5. Does that mean anything?
It would seem that my OS knows where those packages are, but gcc doesn't. Do I need to do something to tell gcc where to look, if it's already in my path?
Edit: apparently the shell created by perl doesn't know about my path. So I basically ran the command in my own shell and copied the output into the gcc command to get around this error. Now I get:
binject.c:4:18: glib.h: No such file or directory
binject.c:6: error: syntax error before "position"
binject.c:6: warning: type defaults to `int' in declaration of `position'
binject.c:6: warning: data definition has no type or storage class
binject.c:7: error: syntax error before "target_size"
etc etc
So.... I think I give up.
cc1.exe: error: unrecognized command line option "-fcflags"
cc1.exe: error: unrecognized command line option "-flibs`"
gcc: `pkg-config: No such file or directory
gcc: glib-2.0: No such file or directory
By then when I check the glib version, I see 2.16.5. Does that mean anything?
It would seem that my OS knows where those packages are, but gcc doesn't. Do I need to do something to tell gcc where to look, if it's already in my path?
Edit: apparently the shell created by perl doesn't know about my path. So I basically ran the command in my own shell and copied the output into the gcc command to get around this error. Now I get:
binject.c:4:18: glib.h: No such file or directory
binject.c:6: error: syntax error before "position"
binject.c:6: warning: type defaults to `int' in declaration of `position'
binject.c:6: warning: data definition has no type or storage class
binject.c:7: error: syntax error before "target_size"
etc etc
So.... I think I give up.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
43 posts
• Page 2 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 23 guests