Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Flashlab on June 11, 2007, 08:43:09 PM

Title: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post 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?
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 11, 2007, 08:46:38 PM
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]
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: motorollin on June 11, 2007, 08:47:27 PM
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
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 11, 2007, 08:49:10 PM
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?
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 11, 2007, 09:02:12 PM
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. :-)
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 11, 2007, 09:07:31 PM
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?
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 11, 2007, 09:45:12 PM
Nah from the backups.

Anyhow, working on it.. Already half way done.
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 11, 2007, 09:51:02 PM
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?
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 11, 2007, 10:28:32 PM
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:
Code: [Select]

                ...
.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:
Code: [Select]

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:
Code: [Select]

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]
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 11, 2007, 11:04:51 PM
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)
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: zipper on June 12, 2007, 06:40:41 AM
...well, now I remember why I kept my 3.10 besides 3.11...
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 12, 2007, 06:57:07 AM
I tested it and no crashes! It is a lot faster than the old CardTrickEVD so I guess the blitter works too.

Thanks Piru!
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 12, 2007, 09:58:14 AM
@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]
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 12, 2007, 05:55:53 PM
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!
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: motorollin on June 12, 2007, 05:59:32 PM
@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
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 12, 2007, 06:04:08 PM
Hehe Good one Motorollin!

Oh Piru could you put ShapeShifter 3.10 also on your site?
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 12, 2007, 06:06:59 PM
Quote
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]
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 12, 2007, 06:10:07 PM
Please do; I'll try.

Edit: Ah thanks! My googling didn't find that link.
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 12, 2007, 09:23:39 PM
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!
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 13, 2007, 07:09:02 AM
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.
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 13, 2007, 07:37:00 AM
Sure. It's slightly different code, but shares many things with the CardTrickEVD. Maybe during the weekend (it's quite time consuming work).
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Seiya on June 13, 2007, 08:32:59 AM
Quote

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..
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 13, 2007, 08:56:32 AM
Quote
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.
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Angus on June 13, 2007, 10:45:00 AM
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.  :)
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 13, 2007, 04:44:01 PM
@Flashlab
Quote
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.
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: AmigaMance on June 13, 2007, 04:56:41 PM
I wonder if anyone has done any benchmarking on which of the available drivers is the fastest on CGFX and AGA screens..
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Seiya on June 13, 2007, 05:18:21 PM
Quote

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 :)
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 13, 2007, 06:22:08 PM
@ Piru

Again it works! Woohoo! Thanks a lot again!
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 13, 2007, 06:27:08 PM
And the spatch version:

PippinEVD-SS-3.11.lha (http://www.iki.fi/sintonen/sw/PippinEVD-SS-3.11.lha)
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: motorollin on June 13, 2007, 06:30:36 PM
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
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Flashlab on June 13, 2007, 06:34:10 PM
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.
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: motorollin on June 13, 2007, 06:37:32 PM
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
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: Piru on June 13, 2007, 06:39:14 PM
@motorollin
Quote
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:
Quote
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.
Title: Re: Making ShapeShifter video drivers work with version 3.11 instead of 3.10
Post by: motorollin on June 13, 2007, 06:42:21 PM
Understood. Thanks for clearing it up for me :-)

--
moto