Update of /cvsroot/freevo/freevo/src/games
In directory sc8-pr-cvs1:/tmp/cvs-serv2336
Modified Files:
game.py genericitem.py genesisitem.py mameitem.py snesitem.py
Log Message:
.
Index: game.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/games/game.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** game.py 29 Nov 2003 11:39:38 -0000 1.13
--- game.py 14 Jan 2004 18:29:49 -0000 1.14
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.14 2004/01/14 18:29:49 mikeruelle
+ # .
+ #
# Revision 1.13 2003/11/29 11:39:38 dischi
# use the given menuw abd not a global one
***************
*** 90,96 ****
def __init__(self):
- self.thread = Game_Thread()
- self.thread.setDaemon(1)
- self.thread.start()
self.mode = None
self.app_mode = 'games'
--- 93,96 ----
***************
*** 115,232 ****
plugin.getbyname('MIXER').reset()
- # clear the screen for mame
- osd.clearscreen(color=osd.COL_BLACK)
- osd.update()
-
- self.thread.play_mode = self.mode
- self.thread.item = item
- self.item = item
-
if DEBUG:
print 'Game.play(): Starting thread, cmd=%s' % self.command
-
- self.thread.mode = 'play'
-
- self.thread.command = self.command
- self.thread.mode_flag.set()
- rc.app(self)
def stop(self):
! self.thread.mode = 'stop'
! self.thread.mode_flag.set()
! rc.app(None)
! while self.thread.mode == 'stop':
! time.sleep(0.3)
!
def eventhandler(self, event, menuw=None):
! return self.item.eventhandler(event, self.menuw, self.thread)
# ======================================================================
! class GameApp(childapp.ChildApp):
def kill(self):
childapp.ChildApp.kill(self, signal.SIGINT)
- osd.update()
-
-
- # ======================================================================
- class Game_Thread(threading.Thread):
-
- def __init__(self):
- threading.Thread.__init__(self)
-
- self.mode = 'idle'
- self.mode_flag = threading.Event()
- self.command = ''
- self.app = None
-
- def run(self):
- while 1:
- if self.mode == 'idle':
- self.mode_flag.wait()
- self.mode_flag.clear()
-
- elif self.mode == 'play':
-
- if DEBUG:
- print 'Game_Thread.run(): Started, cmd=%s' % self.command
-
- osd.stopdisplay()
- self.app = GameApp(self.command)
-
- while self.mode == 'play' and self.app.isAlive():
- time.sleep(0.5)
-
- print('Game_Thread::run: GAME OVER')
-
- self.app.kill()
-
- if config.OSD_SDL_EXEC_AFTER_STARTUP:
- os.system(config.OSD_SDL_EXEC_AFTER_STARTUP)
-
- osd.restartdisplay()
-
- if self.mode == 'play':
- rc.post_event(em.STOP)
-
- self.mode = 'idle'
-
- else:
- self.mode = 'idle'
-
-
- def cmd(self, command):
- print "In cmd going to do: " + command
- str = ''
- if command == 'config':
- str = gameKey('CONFIGMENU')
- elif command == 'pause':
- str = gameKey('PAUSE')
- elif command == 'reset':
- str = gameKey('RESET')
- elif command == 'exit':
- str = gameKey('EXIT')
- elif command == 'snapshot':
- str = gameKey('SNAPSHOT')
-
- self.app.write(str)
-
-
- #
- # Translate an abstract remote control command to an mame
- # command key
- #
- # I should add a hook back to whatever Item was passed here.
- #
- def gameKey(rcCommand):
- gameKeys = {
- 'EXIT' : '\x1b',
- }
-
- key = gameKeys.get(rcCommand, '')
-
- return key
--- 115,139 ----
plugin.getbyname('MIXER').reset()
if DEBUG:
print 'Game.play(): Starting thread, cmd=%s' % self.command
+ self.app=GameApp(self.command, stop_osd=1)
+ self.prev_app = rc.app()
+ rc.app(self)
def stop(self):
! self.app.stop()
! rc.app(None)
def eventhandler(self, event, menuw=None):
! return self.item.eventhandler(event, self.menuw)
# ======================================================================
! class GameApp(childapp.ChildApp2):
! def stop_event(self):
! return em.STOP
def kill(self):
childapp.ChildApp.kill(self, signal.SIGINT)
Index: genericitem.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/games/genericitem.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** genericitem.py 29 Dec 2003 22:30:35 -0000 1.4
--- genericitem.py 14 Jan 2004 18:29:49 -0000 1.5
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.5 2004/01/14 18:29:49 mikeruelle
+ # .
+ #
# Revision 1.4 2003/12/29 22:30:35 dischi
# move to new Item attributes
***************
*** 131,157 ****
! def eventhandler(self, event, menuw=None, mythread=None):
!
! if not mythread == None:
! if event == em.STOP:
! self.stop()
! rc.app(None)
! if not menuw == None:
! menuw.refresh(reload=1)
!
! elif event == em.MENU:
! mythread.app.write('M')
!
! elif event == em.GAMES_CONFIG:
! mythread.cmd( 'config' )
!
! elif event == em.PAUSE or event == em.PLAY:
! mythread.cmd('pause')
!
! elif event == em.GAMES_RESET:
! mythread.cmd('reset')
! elif event == em.GAMES_SNAPSHOT:
! mythread.cmd('snapshot')
# give the event to the next eventhandler in the list
--- 134,144 ----
! def eventhandler(self, event, menuw=None):
! if event == em.STOP:
! self.stop()
! rc.app(None)
! if not menuw == None:
! menuw.refresh(reload=1)
# give the event to the next eventhandler in the list
Index: genesisitem.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/games/genesisitem.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** genesisitem.py 10 Jan 2004 21:25:01 -0000 1.5
--- genesisitem.py 14 Jan 2004 18:29:49 -0000 1.6
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.6 2004/01/14 18:29:49 mikeruelle
+ # .
+ #
# Revision 1.5 2004/01/10 21:25:01 mikeruelle
# zipped rom support for snes and genesis
***************
*** 166,192 ****
! def eventhandler(self, event, menuw=None, mythread=None):
!
! if not mythread == None:
! if event == em.STOP:
! self.stop()
! rc.app(None)
! if not menuw == None:
! menuw.refresh(reload=1)
!
! elif event == em.MENU:
! mythread.app.write('M')
!
! elif event == em.GAMES_CONFIG:
! mythread.cmd( 'config' )
!
! elif event == em.PAUSE or event == em.PLAY:
! mythread.cmd('pause')
!
! elif event == em.GAMES_RESET:
! mythread.cmd('reset')
! elif event == em.GAMES_SNAPSHOT:
! mythread.cmd('snapshot')
# give the event to the next eventhandler in the list
--- 169,179 ----
! def eventhandler(self, event, menuw=None):
! if event == em.STOP:
! self.stop()
! rc.app(None)
! if not menuw == None:
! menuw.refresh(reload=1)
# give the event to the next eventhandler in the list
Index: mameitem.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/games/mameitem.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** mameitem.py 29 Dec 2003 22:30:35 -0000 1.15
--- mameitem.py 14 Jan 2004 18:29:49 -0000 1.16
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.16 2004/01/14 18:29:49 mikeruelle
+ # .
+ #
# Revision 1.15 2003/12/29 22:30:35 dischi
# move to new Item attributes
***************
*** 144,170 ****
! def eventhandler(self, event, menuw=None, mythread=None):
!
! if not mythread == None:
! if event == em.STOP:
! self.stop()
! rc.app(None)
! if not menuw == None:
! menuw.refresh(reload=1)
!
! elif event == em.MENU:
! mythread.app.write('M')
!
! elif event == em.GAMES_CONFIG:
! mythread.cmd( 'config' )
!
! elif event == em.PAUSE or event == em.PLAY:
! mythread.cmd('pause')
!
! elif event == em.GAMES_RESET:
! mythread.cmd('reset')
! elif event == em.GAMES_SNAPSHOT:
! mythread.cmd('snapshot')
# give the event to the next eventhandler in the list
--- 147,157 ----
! def eventhandler(self, event, menuw=None):
! if event == em.STOP:
! self.stop()
! rc.app(None)
! if not menuw == None:
! menuw.refresh(reload=1)
# give the event to the next eventhandler in the list
Index: snesitem.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/games/snesitem.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** snesitem.py 10 Jan 2004 21:25:01 -0000 1.14
--- snesitem.py 14 Jan 2004 18:29:49 -0000 1.15
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.15 2004/01/14 18:29:49 mikeruelle
+ # .
+ #
# Revision 1.14 2004/01/10 21:25:01 mikeruelle
# zipped rom support for snes and genesis
***************
*** 325,351 ****
! def eventhandler(self, event, menuw=None, mythread=None):
!
! if not mythread == None:
! if event == em.STOP:
! self.stop()
! rc.app(None)
! if not menuw == None:
! menuw.refresh(reload=1)
!
! elif event == em.MENU:
! mythread.app.write('M')
!
! elif event == em.GAMES_CONFIG:
! mythread.cmd( 'config' )
!
! elif event == em.PAUSE or event == em.PLAY:
! mythread.cmd('pause')
!
! elif event == em.GAMES_RESET:
! mythread.cmd('reset')
! elif event == em.GAMES_SNAPSHOT:
! mythread.cmd('snapshot')
# give the event to the next eventhandler in the list
--- 328,338 ----
! def eventhandler(self, event, menuw=None):
! if event == em.STOP:
! self.stop()
! rc.app(None)
! if not menuw == None:
! menuw.refresh(reload=1)
# give the event to the next eventhandler in the list
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog