Welcome, Guest. Please login or register.

Author Topic: Making ShapeShifter video drivers work with version 3.11 instead of 3.10  (Read 4926 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline FlashlabTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2005
  • Posts: 1396
    • Show only replies by Flashlab
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?
Amiga 4000D Cyberstorm PPC 060@50 604@200 SCSI 130Mb Ram G-Rex Voodoo3 PicassoIV Paloma Ariadne Delfina Lite

Online Flash version of BoulderDash: Offline...
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
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]
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline FlashlabTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2005
  • Posts: 1396
    • Show only replies by Flashlab
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?
Amiga 4000D Cyberstorm PPC 060@50 604@200 SCSI 130Mb Ram G-Rex Voodoo3 PicassoIV Paloma Ariadne Delfina Lite

Online Flash version of BoulderDash: Offline...
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
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. :-)
 

Offline FlashlabTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2005
  • Posts: 1396
    • Show only replies by Flashlab
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?
Amiga 4000D Cyberstorm PPC 060@50 604@200 SCSI 130Mb Ram G-Rex Voodoo3 PicassoIV Paloma Ariadne Delfina Lite

Online Flash version of BoulderDash: Offline...
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Nah from the backups.

Anyhow, working on it.. Already half way done.
 

Offline FlashlabTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2005
  • Posts: 1396
    • Show only replies by Flashlab
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?
Amiga 4000D Cyberstorm PPC 060@50 604@200 SCSI 130Mb Ram G-Rex Voodoo3 PicassoIV Paloma Ariadne Delfina Lite

Online Flash version of BoulderDash: Offline...
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
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]
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Ok here goes: 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)
 

Offline zipper

...well, now I remember why I kept my 3.10 besides 3.11...
 

Offline FlashlabTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2005
  • Posts: 1396
    • Show only replies by Flashlab
I tested it and no crashes! It is a lot faster than the old CardTrickEVD so I guess the blitter works too.

Thanks Piru!
Amiga 4000D Cyberstorm PPC 060@50 604@200 SCSI 130Mb Ram G-Rex Voodoo3 PicassoIV Paloma Ariadne Delfina Lite

Online Flash version of BoulderDash: Offline...
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
@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

[/EDIT]
 

Offline FlashlabTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2005
  • Posts: 1396
    • Show only replies by Flashlab
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!
Amiga 4000D Cyberstorm PPC 060@50 604@200 SCSI 130Mb Ram G-Rex Voodoo3 PicassoIV Paloma Ariadne Delfina Lite

Online Flash version of BoulderDash: Offline...
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
@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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10