Amiga.org
Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Flashlab on June 11, 2007, 08:43:09 PM
-
I'm trying to get some external video drivers to work with ShapeShifter. I use version 3.11, but the drivers complain that this version is unsupported. How do the drivers know this?
I tried editing the SS exe with a hex tool and replaced all references to 3.11 to 3.10. Doesn't work... I tried this also in the video drivers themselves; doesn't work.
So my question; how do you fool the drivers into thinking the version number is 3.10? Is this even possible? Or maybe someone still has version 3.10 for me?
-
I hacked the CardTrickEVD for 3.11 once. It involved looking for correct offset for 3.11 and poking it inside the EVD binary.
[EDIT] Let me look into my backups, maybe I still have the stuff about [/EDIT]
-
Maybe the driver uses the size of the executable to determine its version rather than its actual version string. If anyone can tell you the file size of the 3.10 executable then you might be able to search inside the driver for this value and try changing it to the file size for the 3.11 executable :-?
[EDIT]
Should have known Piru would know the answer :-)
[/EDIT]
--
moto
-
Yeah, patching Cardtrik would be great; then the blitter chip would work and we would get better speed I guess.
Could you replicate your hack, Piru or do a small tutorial on how I can do it myself?
-
Ok, it looks like I don't have the hack around anymore.
I can replicate it however, if someone sends me ShapeShifter 3.10 binary (I need to find the offsets from the previous version so I can find the matching ones from 3.11).
Ahh, found shape 3.10, no need to send. Ok, lets see how long it takes to remember all this stuff. :-)
-
That would be great! I'll look around for 3.10. I do have a older version (3.6) on a cover cd from a long time ago though...
Edit: Have you found 3.10 somewhere on the net? If so could you give the link?
-
Nah from the backups.
Anyhow, working on it.. Already half way done.
-
I'm interested in what you exactly patch. You tell the driver binary to look somewhere else in the ShapeShifter binary to verify the version number? So you only change the EVD binary in the end?
Is this easy to do (once you know how to) with other drivers as well; like PippinEVD and WinnerEVD for example? With a hex editor?
-
It's rather complicated stuff. I need to patch the EVD so that it can runtime patch the 3.11 binary. I do this by examining what the EVD does against 3.10, and then applying the same for 3.11.
To give you some idea, here's some notes:
Here's the EVD checking for ShapeShifter 3.10 and then setting the offsets for various things:
...
.not3 move.l (_returnaddr,pc),a0
lea ($194C,a0),a0
cmp.w #$4A39,(a0)
bne.w .not4
cmp.w #$6644,(6,a0)
bne.w .not4
cmp.w #$0C79,(8,a0)
bne.w .not4
cmp.w #$2079,($0012,a0)
bne.w .not4
sub.l #$00010EFE,a0
cmp.l #'.10 ',(a0)
bne.b .not4
move.l (_returnaddr,pc),a0
sub.l #$0000EA74,a0
move.l (a0),a0
tst.l (a0)
bne.b .ok
move.w #$FFFF,(_success)
move.w #310,(_version)
move.l #$0000194C,(_off1)
move.l #$00000010,(_off2)
move.l #$0000036E,(_off3)
move.l #$000000FC,(_off4)
move.l #$00000118,(_off5)
move.l #$00001ADC,(_off6)
move.l #$0000063A,(_off7)
bra.b .ok
...
From the offset usage I've determined what the things are inside ShapeShifter 3.10:
version: $3a2a version in $VER string
retaddr: $12fdc EVD lvo call return addr
func1: retaddr + $194c = $14928 func1
verdelta: func1 - $3a2a = $10EFE ok
indptr: retaddr - $ea74 = $4568 indirect ptr to value determining if func1 is called
func1bne: func1 + $0010 bne inside func1
indcgxptr: func1 + $036e = $14C96 indirect cgxbase ptr
off4: retaddr + $00fc = $130D8 indirect openwindowtags taglist
off5: retaddr + $0118 = $130F4 move.l #$408,d2 after openwindowtags
off6: retaddr + $1adc = $14AB8 move.l (4,a0),a0 / move.l a0,a1
off7: retaddr - $063a = $129A2 tst.l (abs).l
And then derived the same for ShapeShifter 3.11:
version: $3a40
retaddr: $13006
func1: retaddr + $195C = $14962
verdelta: func1 - $3a40 = $10F22
indptr: retaddr - $EA7E = $4588
func1bne: func1 + $0010
indcgxptr: func1 + $0370 = $14CD2
off4: retaddr + $0102 = $13108
off5: retaddr + $011E = $13124
off6: retaddr + $1AEE = $14AF4
off7: retaddr - $0640 = $129c6
...which will give us all the needed values and offsets to poke into the EVD.
Don't worry if you didn't understand that.
This stuff is highly specific to CardTrickEVD, and it isn't directly applicable for other EVDs. I doubt many of those need to patch ShapeShifter binary however...
[EDIT]
Now that I have the offsets needed, I'll go thru all of them yet again and see if I next correct offsets for each offset usage. If I do, I'll prepare a patched CardTrickEVD.
[/EDIT]
-
Ok here goes: CardTrickEVD.bin (http://www.iki.fi/sintonen/temp/CardTrickEVD.bin)
Notes:
- I replaced ShapeShifter 3.9 entry with 3.11 one. So this particular binary will not work with ShapeShifter 3.9 anymore.
- I didn't test it (I'm too lazy to set up ShapeShifter for UAE). Let me know if blitter acceleration doesn't appear to work with ShapeShifter 3.11.
- If I made a mistake it is likely that the system will crash. Be ready for this.
- Installation: Copy this file over the original CardTrickEVD in your ShapeShifter installation. It's a good idea to keep the old one around just in case I made a mistake.
- If it doesn't work I'll prolly have to delay fixing it (I guess in that case I need to build that ShapeShifter UAE thing after all.. :-D)
-
...well, now I remember why I kept my 3.10 besides 3.11...
-
I tested it and no crashes! It is a lot faster than the old CardTrickEVD so I guess the blitter works too.
Thanks Piru!
-
@Flashlab
Oh coolness. Was this difference really visible or did you try some benchmark? (Just trying to rule out the 'blacebo effect' :-D)
As I remember it, the blitter support really made a difference and the speedup was quite visible. It has been a while though, so my memory might serve me wrong.
Anyhoo, since it appears to work I'll prepare a spatch for the thing.
[EDIT]
CardTrickEVD-SS-3.11.lha (http://www.iki.fi/sintonen/sw/CardTrickEVD-SS-3.11.lha)
[/EDIT]
-
I tested it with a benchmark tool (Speedometer 4.02). So it really works.
Now for PippinEVD please ;-). Oh and please make Doubler work as a replacement for the right Amiga key and left mouse button so I can have a working right mouse button.
Haha just kidding; thanks a lot Piru!
-
@Piru
Your next task is to come to my house and get ShapeShifter working with Mac OS 8.1 on my A4000. How's Saturday?
--
moto
-
Hehe Good one Motorollin!
Oh Piru could you put ShapeShifter 3.10 also on your site?
-
Oh Piru could you put ShapeShifter 3.10 also on your site?
I only have the main binary, so I wonder if that'd be of much use.
[EDIT]
But fear not, the 3.10 archive can be found from http://uae.is.free.fr/UAE-archives.htm
[/EDIT]
-
Please do; I'll try.
Edit: Ah thanks! My googling didn't find that link.
-
I must say I'm now playing Settlers 2 with PippinEVD in a window on Workbench on ShapeShifter 3.10 and I'm really impressed with my humble Miggy again. Runs like a charm! God I love my Amiga!
-
I know it sounds greedy but could you do the same thing to the PippinEVD driver Piru? It's by the same author as CardtrickEVD so I guess it's pretty much the same procedure.
-
Sure. It's slightly different code, but shares many things with the CardTrickEVD. Maybe during the weekend (it's quite time consuming work).
-
Flashlab wrote:
I'm trying to get some external video drivers to work with ShapeShifter. I use version 3.11, but the drivers complain that this version is unsupported. How do the drivers know this?
mmh, i tried some esternal video driver with SS 3.11 and they work very well..
-
mmh, i tried some esternal video driver with SS 3.11 and they work very well.
Some drivers patch the ShapeShifter binary for additional speed (but work slower if the binary can't be patched). Some don't even work unless if they can patch the binary.
What I'm doing here is to patch these drivers to work with ShapeShifter 3.11 that wasn't available at the time the drivers were written.
-
Was the original settlers released on the Mac? I was just thinking, if its as good as the Amiga version, but in a higher resolution, then it could be a better way to play the game.
Very nice work Piru, by the way. :)
-
@Flashlab
could you do the same thing to the PippinEVD driver Piru?
Give this a try: PippinEVD.bin (http://www.iki.fi/sintonen/temp/PippinEVD.bin)
Again, the usual caveats apply. Let me know if it works.
-
I wonder if anyone has done any benchmarking on which of the available drivers is the fastest on CGFX and AGA screens..
-
Piru wrote:
What I'm doing here is to patch these drivers to work with ShapeShifter 3.11 that wasn't available at the time the drivers were written.
Good :)
-
@ Piru
Again it works! Woohoo! Thanks a lot again!
-
And the spatch version:
PippinEVD-SS-3.11.lha (http://www.iki.fi/sintonen/sw/PippinEVD-SS-3.11.lha)
-
I don't get it. I just tried the CardTrickEVD from Aminet with ShapeShifter 3.11 and it worked ok. So what does this patch do?
--
moto
-
Some benchmarks: Topic (http://www.amiga.org/forums/showthread.php?t=29714)
The point of the CardTrick patch is to make the blitter support work with 3.11. This makes a huge difference in speed.
-
I understand the point of the CardTrick patch. I meant what is the point of the modification made by Piru since it seems to work fine in ShapeShifter 3.11 for me.
[EDIT]
No disrespect intended to Piru - I just want to understand what his modification does.
[/EDIT]
--
moto
-
@motorollin
I meant what is the point of the modification made by Piru since it seems to work fine in ShapeShifter 3.11 for me.
Read the CardTrickEVD.guide about "Blitter acceleration support"
For the lazy:
CardTrickEVD activates these acceleration routines as well. This requires applying a few run-time patches to ShapeShifter's code because the current EVD interface does not offer this feature yet. CardTrickEVD 1.2 supports the release versions 3.6 to 3.10 of ShapeShifter. Others will work too, but not be accelerated.
Note: ShapeShifter 3.11 doesn't have the acceleration with the original.
My patch enables the acceleration for 3.11 aswell.
-
Understood. Thanks for clearing it up for me :-)
--
moto