+
    Ki  c                   s    ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHtHt  ! R R	]4      tR# )
i    N)Counter)RawConfigParser)gettext)settings)Runner)joypadsystemc            
       s   a a ] tR t^t o]! R4      t]! R4      t]! R4      .tRtRt	Rt
RtRRR	R
R]! R4      R]! R4      /.tRV 3R lltRV 3R lltR t]R 4       tR tRtVtV ;t# )reicastZReicastzSega Dreamcast emulatorzSega Dreamcastzreicast/reicast.elfisozorg.flycast.FlycastNoptiontypeZfilelabelzDisc image fileZhelpz*The game data.
Supported formats: ISO, CDIc                s  < \         SV `  V4       R RRRR\        R4      RR/R RRR	R
\        R4      R\        R4      RV P                  RR/R RRR	R
\        R4      R\        R4      RV P                  RR/R RRR	R
\        R4      R\        R4      RV P                  RR/R RRR	R
\        R4      R\        R4      RV P                  RR/.V n        R# )r	   
fullscreenr
   Zboolr   Z
FullscreenZdefaultFZdevice_id_1ZchoicesectionZGamepadsz	Gamepad 1Zchoices-1Zdevice_id_2z	Gamepad 2Zdevice_id_3z	Gamepad 3Zdevice_id_4z	Gamepad 4N)super__init___get_joypadsrunner_options)selfconfig	__class__s   &&;/usr/lib/python3.14/site-packages/lutris/runners/reicast.pyr   Zreicast.__init__!   s     ,<5	 -1Z=;4++4 -1Z=;4++4 -1Z=;4++4 -1Z=;4++4?'
    c                s.   < R  p\         SV `  WV4       R# )c                  s\   \         P                  ! R 4      p\        P                  P	                  \
        P                  R4      p\        P                  ! V4       F7  p\        P                  ! \        P                  P	                  W#4      V4       K9  	  \         P                  ! R4       R# )z~/.reicast/mappingszreicast/mappingsz~/.reicast/dataN)
r   Zcreate_folderospathZjoinr   Z
RUNNER_DIRZlistdirshutilZcopy)ZargsZmapping_pathZmapping_sourceZmapping_files   *   r   on_runner_installedZ,reicast.install.<locals>.on_runner_installedN   sk    !//0EFLWW\\(*=*=?QRN "

> :BGGLLFU !;  !23r   N)r   install)r   Zinstall_ui_delegateZversionZcallbackr   r   s   &&&& r   r   Zreicast.installM   s    	4 	+6IJr   c                s   V P                   '       d   V P                   # R.p\        P                  ! 4       p\        V Uu. uF  q3^,          NK  	  up4      p/ pV Fy  w  rg\        P
                  ! RV4      ^ ,          pWG,          ^8  d   Wu9  d   ^p	MWW,          ^,           p	WV&   M^ p	V	'       d   VRV	,          ,          pVP                  Wx34       K{  	  Wn         V# u upi )z7Return list of joypad in a format usable in the optionsz(\d+)z (%d))zNo joystickr   )joypadsr   r   r    reZfindallZappend)
r   Zjoypad_listZjoypad_devicesZjZname_counterZname_indexesZdevZjoy_nameZdev_idindexs
   &         r   r   Zreicast.get_joypadsW   s    <<<<<,-++-n=n!n=>+MCZZ#.q1F%)/E(2Q6E).X&GeO+12 , #!  >s    C!c           	     s   \        4       pR  Vn        \        P                  P	                  R4      p\
        P                  ! V4      '       d1   \        VRRR7      ;_uu_ 4       pVP                  V4       RRR4       V  Fe  pVP                  V4      '       g   VP                  V4       W,          P                  4        F   w  rVVP                  WE\        V4      4       K"  	  Kg  	  \        VRRR7      ;_uu_ 4       pVP                  V4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)c                 s    V # N )r	   s   &r   Z<lambda>Z&reicast.write_config.<locals>.<lambda>u   s    Fr   z~/.reicast/emu.cfgZrzutf-8)ZencodingNZw)r   Zoptionxformr   r   Z
expanduserr   Zpath_existsZopenZ	read_fileZhas_sectionZadd_sectionZitemsZsetZstrZwrite)r   ZparserZconfig_pathZconfig_filer   ZkeyZvalues   &      r   write_configZreicast.write_configo   s    
 !"2gg(()=>k**k399[  - : G%%g..""7+$o335


7U4 6  +sW55LL% 65 :9 655s   $D?D.D+	.D?	c                s   V P                   P                  R 4      '       d   RMRpRR V/R/ RRR//p^p/ VR&   \        ^^4       Ff  pRV,          pV P                   P                  V4      ;'       g    RpWbR,          R	P                  V4      &   V^8  g   KT  VR8w  g   K]  V^,          pKh  	  W2R,          R&   V P	                  V4       V P
                  P                  R
4      pRV P                  4       RRV 2.,           /# )r   Z1Z0Zx11ZinputplayersZnbzdevice_id_%dr   zevdev_{}r   Zcommandz-configzconfig:image=)Zrunner_configZgetZrangeZformatr#   Zgame_configZget_command)r   r   Zreicast_configr$   r    Zconfig_stringZjoy_idr   s   &       r   playZreicast.play   s    ..22<@@Sc
L*-Rc{

 "$w1a[E*U2M''++M:BBdFHN7#J$5$5m$DEqyVt^1 ! +2y!$'.)""5)4++-mC5<Q0RRSSr   )r   r   r!   )NN)Z__name__Z
__module__Z__qualname__Z__firstlineno__r   Z
human_nameZdescriptionZ	platformsZrunner_executableZentry_point_optionZ
flatpak_idr   Zgame_optionsr   r   r   Zstaticmethodr#   r%   Z__static_attributes__Z__classdictcell__Z__classcell__)r   Z__classdict__s   @@r   r   r      s     9J-.K#$%I-&JG eFQ()ACD		
L*
XK0 & &*T Tr   r   )r   r   r   Zcollectionsr    Zconfigparserr   r   r   Zlutrisr   Zlutris.runners.runnerr   Zlutris.utilr   r   r   r"   r   r   <module>r&      s2    	 	   (    ( &JTf JTr   