Auteur Sujet: hyperspin, lightgun et autocalibrage: la solution  (Lu 7022 fois)

Hors ligne isKa

  • Scotché
  • *
  • Messages: 452
    • Voir le profil
hyperspin, lightgun et autocalibrage: la solution
« le: Samedi 07 Janvier 2012, 15:32:40 pm »
Pour les utilisateurs de hyperspin avec mame en résolution NATIVE, qui veule se lancer, voila un script qui n'est pas complet (faut ajouter les jeux un par un) , mais qui permet de switcher la résolution de l'écran AVANT de lancer la rom, cela permet d'avoir un fond BLANC pour effectuer une autocalibration directement.. (je vais mettre une image similaire à la calibration ps2) avec une bonne résolution (pourquoi pas sous mame? parceque c'est souvent noir.. ce qui peut entraîner pas mal de soucis).

Cela n'est pas utile pour l'aimtrak ou tout pistolet utilisant l' IR !

il faut savoir que tout changement de résolution affecte le calcul de visé, il faut donc changer de résolution sur le bureau et refaire un calibrage. ce qui peut être fastidieux.

les 2 solutions que sont smog et wingun on leur avantages et inconvénients, mais propose toute deux une autocalibrations (non testé avec wingun)



Avec les drivers de SMOG (mais je vérifierais aussi wingun qui le propose aussi apparemment):

Il faut que l'autocalibration soit efficace chez vous, chez moi c'est parfait.
il faut donc cette option de cocher!
pour vérifier, il suffit d'éteindre le pistolet pour deconnecter l'usb (pas besoin de débrancher, un switch mode guncon2-> guncon1 puis on remet en guncon 2 suffit), windows redetectera votre pistolet, votre souris sera folle, on fait haut, bas, gauche droite assez lentement et le curseur va se positionner automatiquement. Parfois ca décale u petit peu mais pas méchant.


le principe est simple, on lance avec hyperlaunch "area 51" par exemple, si vous êtes sous soft 15 khz ou calamity's driver, vous aurez un fond blanc et la résolution va passer en 320*240. on "eteint" le guns en passant du mode guncon 2 vers le mode guncon1, on calibre le joueur 1, qd c bien, on clique sur OK ou entrer, on fait le joueur 2.. ok ou entrer, le jeu se lance.




ATTENTION, UNIQUEMENT POUR UTILISATEURS QUI CONNAISSENT LEURS MODELINES !


Mame.ahk

;----------------------------------------------------------------------------
; MAME
; MAME .140
; by BBB "top gun version"
; 1.0
;
; Info:
; This script is exactly the same as regular mame.  
;
; Since MAME needs to save hi scores and data on exit, then we can't force
; MAME closed with a hotkey. So make sure you have your own exit key setup
; in MAME first.  We will leave the CloseProcess section below blank, but
; it is still required.
;
;----------------------------------------------------------------------------


EncodeInteger( p_value, p_size, p_address, p_offset )
{
   loop, %p_size%
      DllCall( "RtlFillMemory"
         , "uint", p_address+p_offset+A_Index-1
         , "uint", 1
         , "uchar", ( p_value >> ( 8*( A_Index-1 ) ) ) & 0xFF )
}
IniRead, system, %emupath%settings.ini, %RomName%, system, standard
IniRead, windowname, %emupath%settings.ini, %RomName%, windowname, standard
IniRead, class, %emupath%settings.ini, %RomName%, class, standard

If ( system = "area51" )
{
; ChangeDisplaySettings
; http://www.autohotkey.com/forum/viewtopic.php?t=8355

colorDepth = 32 ; bits (quality)
screenWidth = 320 ; pixels ; just change this
screenHeight = 240 ; pixels; ; just change this
refreshRate = 60 ; Hz (frequency)
; Don't change anything below!

struct_devicemode_size = 156
VarSetCapacity(device_mode, struct_devicemode_size, 0)

EncodeInteger(struct_devicemode_size, 2, &device_mode, 36)

success := DllCall("EnumDisplaySettings", "uint", 0, "uint", -1, "uint", &device_mode)

; DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT|DM_DISPLAYFREQUENCY
EncodeInteger(0x00040000|0x00080000|0x00100000|0x00400000, 4, &device_mode, 40)

EncodeInteger(colorDepth, 4, &device_mode, 104)
EncodeInteger(screenWidth, 4, &device_mode, 108)
EncodeInteger(screenHeight, 4, &device_mode, 112)
EncodeInteger(refreshRate, 4, &device_mode, 120)

DllCall("ChangeDisplaySettings", "uint", &device_mode, "uint", 0)

}
 Else If ( system = "ghlpanic" )
{
; ChangeDisplaySettings
; http://www.autohotkey.com/forum/viewtopic.php?t=8355

colorDepth = 32 ; bits (quality)
screenWidth = 640 ; pixels
screenHeight = 480 ; pixels
refreshRate = 60 ; Hz (frequency)
; Don't change anything below!

struct_devicemode_size = 156
VarSetCapacity(device_mode, struct_devicemode_size, 0)

EncodeInteger(struct_devicemode_size, 2, &device_mode, 36)

success := DllCall("EnumDisplaySettings", "uint", 0, "uint", -1, "uint", &device_mode)

; DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT|DM_DISPLAYFREQUENCY
EncodeInteger(0x00040000|0x00080000|0x00100000|0x00400000, 4, &device_mode, 40)

EncodeInteger(colorDepth, 4, &device_mode, 104)
EncodeInteger(screenWidth, 4, &device_mode, 108)
EncodeInteger(screenHeight, 4, &device_mode, 112)
EncodeInteger(refreshRate, 4, &device_mode, 120)

DllCall("ChangeDisplaySettings", "uint", &device_mode, "uint", 0)

}



WinHide ahk_class Shell_TrayWnd
guiheight:=A_ScreenHeight/9*4
Gui, +toolwindow
Gui, -Caption
Gui, Color, white
Gui, Font, S40 CWhite Underline, Verdana
Gui, Add, Text, y%guiheight% W%A_ScreenWidth% H%A_ScreenHeight% Center, Please Wait
Gui, Show, W%A_ScreenWidth% H%A_ScreenHeight%, BlackScreen



MsgBox Calibrate your GUN1! press Ok when finish
MsgBox Calibrate your GUN2! press Ok when finish
;Pause



Process, Close, %executable%
Runwait, %executable% %romName%, %emuPath%, Hide UseErrorLevel

if(ErrorLevel != 0){
  if (ErrorLevel = 1){
    Error = Failed Validity
  }else if(ErrorLevel = 2){
    Error = Missing Files
  }else if(ErrorLevel = 3){
    Error = Fatal Error
  }else if(ErrorLevel = 4){
    Error = Device Error
  }else if(ErrorLevel = 5){
    Error = Game Does Not Exist
  }else if(ErrorLevel = 6){
    Error = Invalid Config
  }else if(ErrorLevel = 7 || ErrorLevel = 8 || ErrorLevel = 9){
    Error = Identification Error
  }else{
    Error = Mame Error
  }
  MsgBox Mame Error - %Error%
}

ExitApp



;Required
CloseProcess:
Run C:\[color=red]vote chemin de l’émulateur[/color]\hyperspin.bat, C:\[color=red]vote chemin de l'emulateur[/color]

  ;Doesnt have to do anything but make sure to have the line before and after this line.
return




fichier a mettre dans le repertoire de l’émulateur
pour revenir en 640*480, modifier le bat pour une autre résolution (à mettre également en démarrage de windows c'est utile parfois qd on se plante de résolution ^^ !).

le settings.ini doit être edité pour ajouter les jeux que vous souhaitez:

exemple, je veux ajouter alien3:

Area 51 area51 360 X 240 @59.922743 Hz
Bang! bang
Bronx bronx 256 X 224
Bubble Trouble bubbletr 288 X 224 From mamedev.org: Hold Service 1 9 then press F2 to enter Service Mode. Shoot at the targets it shows using the crosshair. After you've shot the target
                          press Service 1 9 again to move onto the next one. Once you finished and have returned to the start again  hit F2.

Catch-22 catch22 320 X 240
Cheyenne cheyenne 320 X 240
Chiller   chiller 320 X 240
Clay Pigeon   claypign 320 X 240
Combat   combat 320 X 240
Crackshot   cracksht 320 X 240
Critter Crushe critcrsh 320 X 224 @59.764793 Hz From mamedev.org: After 'ERROR ON CARTRIDGE' press 9
                                  (SERVICE Key) and then F2 (TEST) to get into the TEST MENU.
                            Select 'SYSTEM ASSIGNMENTS' with SERVICE and press TEST
to proceed  then set 'CABINET TYPE' to 1P (one player) and
EXIT the test menu

Crossbow   crossbow 320 X 240
Desert Gun  desertgu 260 X 224 @ 59.541985 Hz
Duck Hunt Pc_duckh 256 X 240
Egg Venture   eggventr 512 X 236 @  61.232460 Hz
Ghost Hunter   ghoshunt 320 X 200 @69.202045 Hz Pressing F2 will enter a service menu  but there may be a bug
where you cannot exit the service menu
Ghoul Panic ghlpanic 640 X 480

Golly! Ghost! gollygho 288 X 224 From mamedev.org: Hold Service 1 (9) then press F2 to enter
Service Mode. Shoot at the targets it shows using the
crosshair. After you've shot the target,  press Service 1 (9)
again to move onto the next one. Once you finished and have

Gun Bullet gunbuletw 288 X 224 @ 59.700000 Hz
Hit n’ Miss hitnmiss 320 X 240
Hogan's Alley Pc_hgaly 256 X 240
Invasion invasnab 400 X 256 @56.665468 Hz Reload by firing at right edge of screen
Lethal Enforcer  lethalen 288 X 224 @59.620000 From mamedev.org: The first time you run the game
the game might complain with the message: Version Error or similar
You must hold down the Test switch F2 and then also
hit F3 to reset the machine. After a short wait , contining [sic], to hold F2,  the game should say “EEPROM INITIALIZE COMPLETE”
Lethal Justice lethalj 512 X 236 @61.973315 Hz
Lord of Gun lordgun 448 X 224
Lucky & Wild luckywld 288 X 224 @ 60.606061 Hz From mamedev.org: Press F2  then press Service 1 9 twice. Shoot at the targets it shows using the crosshair. Once you finished, press F2,
Maximum Force maxforce 360 X 240 @59.922743 Hz
N.Y. Captor nycaptor 256 X 224
Night Stocker Nstocker 256 X 240 @59.185606 Hz
One Shot One Kill oneshot 320 X 240
Point Blank ptblank 288 X 224 @ 59.700000 Hz
Point Blank 2 ptblank2 640 X 480
Police Trainer policetr 394 X 240
Rail Chase rchase 320 X 224
Rapid Fire Rapidfir 320 X 200 @69.202045 Hz
Road Runner roadrunm 260 X 224 @ 59.541985 Hz
Sharpshooter sshooter 394 X 240
Shooting Master shtngmste 256 X 224 @ 60.096154
Tickee Tickats tickee 320 X 200 @  69.202045 Hz
Triple Hunt triplhnt 256 X 240 From mamedev.org: The first time you run the game, it will say 'AIM GUN AT SQUARE AND FIRE'. Calibrate your gun and
assure the Service Mode DIP is OFF. Restart

Tut’s Tomb tutstomb 320 X 200 @ 69.202045 Hz
Vs. Duck Hunt duckhunt 256 X 240
Vs. Freedom force vsfdf 256 X 240
Vs. Gumshoe vsgshoe 256 X 240
Vs. Hogan’s Alley hogalley 256 X 240
Who Dunit whodunit 320 X 240
Wild Gunman Pc_wgnmn 256 X 240
Zero Point zeropnt 384 X 224
Zero Point 2 zeropnt2 384 X 224

2PLAYERS

Beast Busters bbusters 256 X 224 From mamedev.org: For the game to work properly, you
need to calibrate ALL 3 guns! If you try to do only one, as
the manual states,  the eprom has invalid gun data and the
screen go black after rebooting. Fire at indicated spots with
P1,  P2 and P3 controls. Only then will a proper eprom be
made
Born To Fight borntofi 352 X 256 @ 54.000000 Hz
CarnEvil carnevil 640 X 480 @ 57.000000 Hz Requires in-game calibration through the F2 setup menu, before it will work correctly. It should only be required the
first time you run the game

Crypt Killer cryptklr 640 X 480
Deer Hunting USA deerhunt 320 X 240 Reload required before every shot.


Dragon Gun dragngun 320 X 240
Golgo 13 Golgo13 640 X 480
Golgo 13 Knd G13knd 640 X 480


GunBuster gunbustr 320 X 240
Judge Dredd jdredd 640 X 480
Laser Ghost lghost 320 X 224 @ 57.230000
Lethal Enforcers 2 le2 288 X 224 @ 59.185606 Hz From mamedev.org: The first time you run the game, you
must perform the typical Konami F2+F3 procedure to
properly initialize the EEPROM. The problem is this game
does not currently give any types of feedback like the other
Konami games (due to video problems). Simply hold F2
down,  hit F3 - continuing to hold F2 for a couple of seconds
to make sure it takes. Shortly thereafter,  you should see a
test pattern on screen signifying it worked.
Line of Fire loffire 320 X 224 @ 59.637405 Hz
MechanizedAttack mechatt 256 X 224
MobilSuitGundam FinalShooting gdfs 338 X 240 Go into Dipswitches and change "Light Gun Calibration" to, On. Make sure that "Controls" is set to "Light Gun". Reset,
the game pressing F3. Calibrate the guns, and press f3, again. Return the "Light Gun Calibration" switch to Off
Operation Wolf opwolf 320 X 240
Shooting Gallery shootgal 256 X 224 @ 60.606061 Hz Although this game is listed as 2 buttons, the second button, is actually P2 Start

Operation Wolf 3 opwolf3 320 X 224 Positional gun game. May not appear to be work correctly.
Steel Gunner sgunner 288 X 224 @ 60.606061 Hz From mamedev.org: Hold Service 1 (9) then press F2 to
SteelGunner2 sgunner2 288 X 224 @ 60.606061 Hz enter Service Mode. Shoot at the targets it shows using the
crosshair. After you've shot the target,  press Service 1 (9)
again to move onto the next one. Once y
Target  HITS targeth 384 X 240 Initial in-game calibration is required the first time you play
by pressing P1 the first time it is launched (instead of F2).
Calibrate the guns by selecting Setup Carbines
Time Crisis timecris 640 X 480 From mamedev.org: Gunsight Adjustment: Hit 9 (Service
SW) + F2 (Test SW) to enter gun calibration. Hit LEFT ALT
two times then aim for the target,  using LEFT ALT to shoot,
lining up your shot. Test to see that the target is aligned
then hit 9 (Service SW) and then F2 (Test SW) to write
NVRAM and return to game. It's suggested you fully restart
the game after this step as there is sometimes left over
target graphics from procedure


Trophy Hunting trophyh 320 X 240 Reload required before every shot.
TurkeyHunting turkhunt 320 X 240 Reload required before every shot.
Under Fire undrfire 320 X 232
Wild Pilot wildplt 256 X 224 @ 30.000000
Wing Shooting wschamp 320 X 240 To calibrate the guns,  use F2 (Service Mode) and the reset,
F3.  Select the first option and calibrate the guns. To exit
press F2 and then reset agai
Zombie Raid zombraid 384 X 240 From mamedev.org: Use F2 (Service Mode) and then reset
F3 or restart MAME. Use CTRL or ALT and highlight “7. Gun
Adjust Mode”. Hit 1 (P1 Start) two times to begin gun
adjustments. Just follow the directions,  aiming at the,
targets for both guns. When done,  use F2 to shut off Service
Mode and reset F3 or restart MAME

POSITIONAL GAME

Aliens 3 alien3 416 X 224
Jurassic Park jpark 416 X 224
Operation Thunderbolt othunder 320 X 240
Revolution X revx 399 X 253 @ 54.815170 Hz From mamedev.org: The game will automatically ask you to
calibrate the guns when you start the game for the first time.
Simply put,  use your mouse or keyboard to "target" the top
left corner when the game asks so. There aren't any visual
cues to help this,  so you'll have to go by the numerical
coordinates that are visible on the screen. The numbers you
see are in a simple 8-bit scale going from 0 to 255. To
target the top left corner,  keep moving your mouse until
you get P1 X and P1 Y as near to 0 as possible. The middle is
located at about 127, 127,  and the bottom right corner as
close to 255 as possible. Repeat the process for the second
player

Space Gun spacegun 320 X 240 From mamedev.org: Press F2 + F3 to enter test mode. Press
P2 Start 2 to calibrate the guns for Players 1 and 2. Follow
instructions and fire on targets for both players - when
complete, press 2 again to save EEPROM. Reset or Restart


Terminator 2 term2 399 X 253 @ 54.815170 Hz See Revolution X notes

résolution 416x224, on vérifie ses modelines (résolutions disponible). si on l'a c 'est bien sinon on s'approche de celle la plus proche.

ensuite on edit settings.ini:

#System specifies whether the game name
[area51]
system = area51

[ghlpanic]
system = ghlpanic

[alien3]
system = aliens3

on ferme.

Puis on edit mame.ahk:

on prend ce code:

Else If ( system = "[color=red]alien3[/color]" )
{
; ChangeDisplaySettings
; http://www.autohotkey.com/forum/viewtopic.php?t=8355

colorDepth = 32 ; bits (quality)
screenWidth = [color=red]416[/color] ; pixels
screenHeight = [color=red]224[/color] ; pixels
refreshRate = 60 ; Hz (frequency) la on regarde bien ses modelines sinon ca va sauter l'écran !
; Don't change anything below!

struct_devicemode_size = 156
VarSetCapacity(device_mode, struct_devicemode_size, 0)

EncodeInteger(struct_devicemode_size, 2, &device_mode, 36)

success := DllCall("EnumDisplaySettings", "uint", 0, "uint", -1, "uint", &device_mode)

; DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT|DM_DISPLAYFREQUENCY
EncodeInteger(0x00040000|0x00080000|0x00100000|0x00400000, 4, &device_mode, 40)

EncodeInteger(colorDepth, 4, &device_mode, 104)
EncodeInteger(screenWidth, 4, &device_mode, 108)
EncodeInteger(screenHeight, 4, &device_mode, 112)
EncodeInteger(refreshRate, 4, &device_mode, 120)

DllCall("ChangeDisplaySettings", "uint", &device_mode, "uint", 0)

}

on colle cela AVANT cette partie

WinHide ahk_class Shell_TrayWnd
guiheight:=A_ScreenHeight/9*4
Gui, +toolwindow
...
...


Pour vérifier ses modelines si pas de quickres:





c'est par la






« Modifié: Samedi 07 Janvier 2012, 21:17:48 pm par isKa »