Majhong like SDL game

All about games on the Falcon, TT & clones

Moderators: Mug UK, moondog/.tSCc., [ProToS], lp, Moderator Team

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Mon Dec 19, 2016 7:29 pm

Just test, not work under XaAES, looks work only under MyAES for the moment, sorry, I'm going to check what is wrong in my SDL change.

Olivier

OL wrote:
vido wrote:Thank you Olivier!
But I did just a quick test on my FireBee and V4e version is unplayable while the older version works just fine.
The game starts but then you can not click on the tile ESC, F1 ,F2, F3, Return key just dont work.
Also TERM signal doesnt close the game and the KILL signal takes about a minute to game is killed.

But I had no time to do more tests.


In the previous version you were running with SDL_VIDEODRIVER=gem ?


I'm going to try with XaAES if I can start it

Olivier
OL

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Mon Dec 19, 2016 11:15 pm

Hello Vido,

I'm checking under XaAES, in the previous version does clicks was easy to select a tile? I compare with MyAES on it it's so easy and under XaAES need a bit stay push before react, it's quite strange for me. I'm trying to had better answer, good news I have fixed my bug and in same find a way to unload even more the system.

Olivier

vido wrote:Thank you Olivier!
But I did just a quick test on my FireBee and V4e version is unplayable while the older version works just fine.
The game starts but then you can not click on the tile ESC, F1 ,F2, F3, Return key just dont work.
Also TERM signal doesnt close the game and the KILL signal takes about a minute to game is killed.

But I had no time to do more tests.
OL

vido
Atari Super Hero
Atari Super Hero
Posts: 522
Joined: Mon Jan 31, 2011 7:39 pm

Re: Majhong like SDL game

Postby vido » Tue Dec 20, 2016 3:05 am

OL wrote:I'm checking under XaAES, in the previous version does clicks was easy to select a tile? I compare with MyAES on it it's so easy and under XaAES need a bit stay push before react, it's quite strange for me. I'm trying to had better answer, good news I have fixed my bug and in same find a way to unload even more the system.

Yes, in previous version was easy to select a tile.
Good to hear you did some more fixes! :)
Would the other games like OpenTTD also benefit from those fixes if they would be recompiled?

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Tue Dec 20, 2016 7:37 am

Thanks for answer.

The change I try to do should not impact other game such like OpenTTP (I have to verify)

The change I try to do is for game like Majhong game not redrawing all the time and not interacting highly with input such keyboard or mouse, so should be very classical GEM application but it's not so easy to do in SDL as it is designed!

Olivier

vido wrote:
OL wrote:I'm checking under XaAES, in the previous version does clicks was easy to select a tile? I compare with MyAES on it it's so easy and under XaAES need a bit stay push before react, it's quite strange for me. I'm trying to had better answer, good news I have fixed my bug and in same find a way to unload even more the system.

Yes, in previous version was easy to select a tile.
Good to hear you did some more fixes! :)
Would the other games like OpenTTD also benefit from those fixes if they would be recompiled?
OL

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Tue Dec 20, 2016 7:42 pm

vido wrote:
OL wrote:I'm checking under XaAES, in the previous version does clicks was easy to select a tile? I compare with MyAES on it it's so easy and under XaAES need a bit stay push before react, it's quite strange for me. I'm trying to had better answer, good news I have fixed my bug and in same find a way to unload even more the system.

Yes, in previous version was easy to select a tile.
Good to hear you did some more fixes! :)
Would the other games like OpenTTD also benefit from those fixes if they would be recompiled?


I continue to understand difference between XaAES and MyAES, selection of tile still not work very fast under XaAES and SDL take a lot of ressource under it (difficult to switch to another process, impossible open a folder on desktop while absolutely no problems with MyAES), I not explain this. I have seen too under TOS 4, the GEM driver give bad AES call and stop, I think the best should automatic choice xbios driver under TOS, it's not very easy to do.

I take some hollyday, I will work again after Chrismas.

Olivier
OL

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Tue Dec 20, 2016 11:51 pm

Hello,

Finally for Chrismas I propose a new version I hope working better!

Tested with XaAES, MyAES and Hatari TOS 4 16 bits 15Mhz falcon + FPU (68020-60 and 68000version), and Hatari Falcon configuration with my minimal configuration (mint + MyAES) and it is usable.

Whats news :
- Fix most issues with XaAES, now XaAES is not overloaded, the selection of tile is still a bit long (compare with MyAES) and really I don't know why, if you want have far faster tile selection run ztask and it work very well! Why????? I suppose it help AES to update mouse state in AES if not called.
- Under TOS without any configuration the Xbios driver is used (I know it can crash under some configuration but work fine on Hatari TOS4). If it crash you can try several configuration:
SDL_ATARI_EVENTSDRIVER=ikbd
or
SDL_ATARI_EVENTSDRIVER=bios
or
SDL_ATARI_EVENTSDRIVER=gemdos

depending of cookie generally the ikbd driver is used

- By default GEM driver driver is used under multitask system

Coldfire version include but not tested hope ok.

Known bugs : Under TOS if you try force the GEM driver it will crash by wrong AES call no time to find the issue at this time, but I think it is not usefull.

I have updated the file

Have fun and happy Chrismas

Olivier


vido wrote:
OL wrote:I'm checking under XaAES, in the previous version does clicks was easy to select a tile? I compare with MyAES on it it's so easy and under XaAES need a bit stay push before react, it's quite strange for me. I'm trying to had better answer, good news I have fixed my bug and in same find a way to unload even more the system.

Yes, in previous version was easy to select a tile.
Good to hear you did some more fixes! :)
Would the other games like OpenTTD also benefit from those fixes if they would be recompiled?
OL

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1512
Joined: Sun Jul 31, 2011 1:11 pm

Re: Majhong like SDL game

Postby Eero Tamminen » Wed Dec 21, 2016 10:07 pm

OL wrote:Finally for Chrismas I propose a new version I hope working better!

Tested with XaAES, MyAES and Hatari TOS 4 16 bits 15Mhz falcon + FPU (68020-60 and 68000version), and Hatari Falcon configuration with my minimal configuration (mint + MyAES) and it is usable.

Whats news :
- Fix most issues with XaAES, now XaAES is not overloaded, the selection of tile is still a bit long (compare with MyAES) and really I don't know why, if you want have far faster tile selection run ztask and it work very well! Why????? I suppose it help AES to update mouse state in AES if not called.


Have you tried Hatari profiler to see where the time is spent?

See: https://hg.tuxfamily.org/mercurialroot/ ... #Profiling

jury
Captain Atari
Captain Atari
Posts: 161
Joined: Tue Sep 21, 2004 11:11 am
Location: Poland

Re: Majhong like SDL game

Postby jury » Thu Dec 22, 2016 6:31 am

OL wrote:Hello,

Finally for Chrismas I propose a new version I hope working better!

Tested with XaAES, MyAES and Hatari TOS 4 16 bits 15Mhz falcon + FPU (68020-60 and 68000version), and Hatari Falcon configuration with my minimal configuration (mint + MyAES) and it is usable.

Whats news :
- Fix most issues with XaAES, now XaAES is not overloaded, the selection of tile is still a bit long (compare with MyAES) and really I don't know why, if you want have far faster tile selection run ztask and it work very well! Why????? I suppose it help AES to update mouse state in AES if not called.
- Under TOS without any configuration the Xbios driver is used (I know it can crash under some configuration but work fine on Hatari TOS4). If it crash you can try several configuration:
SDL_ATARI_EVENTSDRIVER=ikbd
or
SDL_ATARI_EVENTSDRIVER=bios
or
SDL_ATARI_EVENTSDRIVER=gemdos

depending of cookie generally the ikbd driver is used

- By default GEM driver driver is used under multitask system



Tried this version on Falcon + CT63, Easymint 1.9 with desktop replaced to Teradesk and yes, its much better than the first version I tried. Its as you write, usable :) Although selection of tiles is still slow, I have to click left mouse button and hold it for almost a second to select the tile. I downloaded zTask and run it, but it didn't make any difference in time needed for tile selection, . I will try to setup MyAES and SuperVidel ( as fidzen suggests ) after Christmas.
And under TOS mouse is still frozen, no move. How to set SDL_ATARI_EVENTSDRIVER in TOS?

Thanks for your work on this title.

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Tue Dec 27, 2016 5:55 pm

hello,

to set environment under TOS, I have 2 software :environ.prg and gemenv.prg, I never test.

You can find this 2 software here:
http://cd.textfiles.com/geminiatari/FILES/UTILITY/

Olivier

jury wrote:
OL wrote:Hello,

Finally for Chrismas I propose a new version I hope working better!

Tested with XaAES, MyAES and Hatari TOS 4 16 bits 15Mhz falcon + FPU (68020-60 and 68000version), and Hatari Falcon configuration with my minimal configuration (mint + MyAES) and it is usable.

Whats news :
- Fix most issues with XaAES, now XaAES is not overloaded, the selection of tile is still a bit long (compare with MyAES) and really I don't know why, if you want have far faster tile selection run ztask and it work very well! Why????? I suppose it help AES to update mouse state in AES if not called.
- Under TOS without any configuration the Xbios driver is used (I know it can crash under some configuration but work fine on Hatari TOS4). If it crash you can try several configuration:
SDL_ATARI_EVENTSDRIVER=ikbd
or
SDL_ATARI_EVENTSDRIVER=bios
or
SDL_ATARI_EVENTSDRIVER=gemdos

depending of cookie generally the ikbd driver is used

- By default GEM driver driver is used under multitask system



Tried this version on Falcon + CT63, Easymint 1.9 with desktop replaced to Teradesk and yes, its much better than the first version I tried. Its as you write, usable :) Although selection of tiles is still slow, I have to click left mouse button and hold it for almost a second to select the tile. I downloaded zTask and run it, but it didn't make any difference in time needed for tile selection, . I will try to setup MyAES and SuperVidel ( as fidzen suggests ) after Christmas.
And under TOS mouse is still frozen, no move. How to set SDL_ATARI_EVENTSDRIVER in TOS?

Thanks for your work on this title.
OL

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Tue Dec 27, 2016 6:00 pm

Eero Tamminen wrote:
OL wrote:Finally for Chrismas I propose a new version I hope working better!

Tested with XaAES, MyAES and Hatari TOS 4 16 bits 15Mhz falcon + FPU (68020-60 and 68000version), and Hatari Falcon configuration with my minimal configuration (mint + MyAES) and it is usable.

Whats news :
- Fix most issues with XaAES, now XaAES is not overloaded, the selection of tile is still a bit long (compare with MyAES) and really I don't know why, if you want have far faster tile selection run ztask and it work very well! Why????? I suppose it help AES to update mouse state in AES if not called.


Have you tried Hatari profiler to see where the time is spent?

See: https://hg.tuxfamily.org/mercurialroot/ ... #Profiling


This is not an issue of spare time, there is the same problem time delay under Hatari with Falcon emulation at 16Mhz and under Aranym JIT that is far faster case. The issue is update of mouse event under XaAES when event is not often call as I understand (graf_mkstate()) not report quickly mouse event state. There is not this delay under MyAES or with the direct mouse evaluation of SDL under TOS (not able for the moment to test GEM driver under TOS, I need to find the reason of bad AES call before!).

Olivier
OL

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1512
Joined: Sun Jul 31, 2011 1:11 pm

Re: Majhong like SDL game

Postby Eero Tamminen » Tue Dec 27, 2016 6:56 pm

Hatari measures both instructions & cycles, so you will see also where sleeping (e.g. stop instruction) is happening. And with symbols, you can get also callgraphs, i.e. what is calling the sleeping functionality.

Problem with multitasking environment is that there are multiple programs running, and to get good callgraphs, you would need to load symbols for everything relevant, use the correct base address for those, and provide the symbols for them in format understood by Hatari (ASCII or DRI symbol table). Although profiler post-processor accepts multiple (ASCII) debug symbol files, Hatari debugger/profiler supports only single one being active at the same time (loaded symbols tell profiler which addresses are tracked for callgraphs). I.e. you would need to process symbols for everything relevant into a single (ASCII) file, and therefore you would need to use same base offset for them (= use absolute/physical addresses).

If sleeping is happening in (on OS) function that is called from many different places, that makes tracking the culprit harder.

jury
Captain Atari
Captain Atari
Posts: 161
Joined: Tue Sep 21, 2004 11:11 am
Location: Poland

Re: Majhong like SDL game

Postby jury » Wed Dec 28, 2016 8:18 pm

fidzen wrote:Hi.
I have tested it with different configs and I found this result on my Falcon.
CT63+SV+TOS: Both versions works fine and are fast.
CT63+TOS: Both versions freezes the mouse at startup.
CT63+SV+EasyMINT 1.9: Both versions are slower and the mouse freezes after some seconds of playing.


Finally installed SV in my new setup and yes, in TOS Lopan works absolutely fine! No mouse freeze and the speed is faaaast :)
Thanks again for this test, as it has motivated me to finally install SV on the current setup ( after a disk crash almost a year ago! ) because I like Mahjong games :)

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Thu Dec 29, 2016 11:27 am

jury wrote:
fidzen wrote:Hi.
I have tested it with different configs and I found this result on my Falcon.
CT63+SV+TOS: Both versions works fine and are fast.
CT63+TOS: Both versions freezes the mouse at startup.
CT63+SV+EasyMINT 1.9: Both versions are slower and the mouse freezes after some seconds of playing.


Finally installed SV in my new setup and yes, in TOS Lopan works absolutely fine! No mouse freeze and the speed is faaaast :)
Thanks again for this test, as it has motivated me to finally install SV on the current setup ( after a disk crash almost a year ago! ) because I like Mahjong games :)


Should be nice too with MyAES + Mint with SV or Radeon

I can't check for NAES or Magic but I think should be fine too.

Olivier
OL

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Thu Dec 29, 2016 11:29 am

Eero Tamminen wrote:Hatari measures both instructions & cycles, so you will see also where sleeping (e.g. stop instruction) is happening. And with symbols, you can get also callgraphs, i.e. what is calling the sleeping functionality.

Problem with multitasking environment is that there are multiple programs running, and to get good callgraphs, you would need to load symbols for everything relevant, use the correct base address for those, and provide the symbols for them in format understood by Hatari (ASCII or DRI symbol table). Although profiler post-processor accepts multiple (ASCII) debug symbol files, Hatari debugger/profiler supports only single one being active at the same time (loaded symbols tell profiler which addresses are tracked for callgraphs). I.e. you would need to process symbols for everything relevant into a single (ASCII) file, and therefore you would need to use same base offset for them (= use absolute/physical addresses).

If sleeping is happening in (on OS) function that is called from many different places, that makes tracking the culprit harder.


My point of view it's not an issue of speed as already said, it is simple an issue of update of the mouse state, I don't know why and really not want to look in XaAES code.

Olivier
OL

jury
Captain Atari
Captain Atari
Posts: 161
Joined: Tue Sep 21, 2004 11:11 am
Location: Poland

Re: Majhong like SDL game

Postby jury » Fri Dec 30, 2016 10:11 am

When playing Lopan for a while I have regulary a quite annoying thing.
It sometimes changes colors for a some period time. And this period ranges from few seconds to few minutes.
Attaching how it looks with those broken colors ( + good colors as a compare )
You do not have the required permissions to view the files attached to this post.

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Fri Dec 30, 2016 1:04 pm

jury wrote:When playing Lopan for a while I have regulary a quite annoying thing.
It sometimes changes colors for a some period time. And this period ranges from few seconds to few minutes.
Attaching how it looks with those broken colors ( + good colors as a compare )


Strange, I suppose you are in 256 colors? To speed up redraw during game I translate at start each card, and the redraw looks not corrupted, so looks like a change of palette. At start the palette is fixed in 256 colors, I going to check if it is possible it restore the previous palette color for some reason (should not in single tos) or another software change it (but why?) or this is an hardware issue. Is it the same in true color?

Olivier
OL

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11936
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Majhong like SDL game

Postby wongck » Fri Dec 30, 2016 2:02 pm

Mmm.... my father's MaJhong set tiles looks like the bottom photo (broken colors), especially the 1st tile at the bottom row ( the 1).
That tile color does not looked like the top photo.

Just my 2 cents. :mrgreen:
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

ldv-01
Atari maniac
Atari maniac
Posts: 94
Joined: Wed Jun 01, 2011 10:14 pm
Location: Italy

Re: Majhong like SDL game

Postby ldv-01 » Fri Dec 30, 2016 3:59 pm

Looks like Lopan switched the tileset from set1 to set2. Also possible via the F1 key.

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Fri Dec 30, 2016 6:12 pm

ldv-01 wrote:Looks like Lopan switched the tileset from set1 to set2. Also possible via the F1 key.


Oh yes you are true. I think now need to know why the system think there is F1 key pressed under TOS never test this feature before, this is in SDL. I don't know how keyboard is managed in this case.

Olivier
OL

jury
Captain Atari
Captain Atari
Posts: 161
Joined: Tue Sep 21, 2004 11:11 am
Location: Poland

Re: Majhong like SDL game

Postby jury » Fri Dec 30, 2016 6:24 pm

Yeap, right. Its not breaking colors, its just switching the tileset. And its not only the problem of 'pressing F1' by a ghost, same thing goes for F2 ( change of the background ). It changes randomly during play.

OL wrote:Strange, I suppose you are in 256 colors?

Nope, when I have SV hooked up I always use 16-bit mode :)

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Fri Dec 30, 2016 6:58 pm

jury wrote:Yeap, right. Its not breaking colors, its just switching the tileset. And its not only the problem of 'pressing F1' by a ghost, same thing goes for F2 ( change of the background ). It changes randomly during play.

OL wrote:Strange, I suppose you are in 256 colors?

Nope, when I have SV hooked up I always use 16-bit mode :)


Ok we have found the root cause, now I need to look at this but probably not easy.
The good news I think I could remove the F1 control and not load all tiles at start so reduce time of load on slow configuration, the second set of tiles looks not very nice, if all are ok for this?

Olivier
OL

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Tue Jan 03, 2017 9:13 pm

Hello

could you try this?

http://gem.lutece.net/download/lopan2060.zip

It use by default the gemdos driver for keyboard, it's a bit slower but I think far more compatible. Let me know if you have still the issue.

Olivier

jury wrote:Yeap, right. Its not breaking colors, its just switching the tileset. And its not only the problem of 'pressing F1' by a ghost, same thing goes for F2 ( change of the background ). It changes randomly during play.

OL wrote:Strange, I suppose you are in 256 colors?

Nope, when I have SV hooked up I always use 16-bit mode :)
OL

jury
Captain Atari
Captain Atari
Posts: 161
Joined: Tue Sep 21, 2004 11:11 am
Location: Poland

Re: Majhong like SDL game

Postby jury » Wed Jan 04, 2017 7:15 pm

Sure. I usually play one game everyday, so will let you know after some time if it behaves properly now.

User avatar
Ektus
Captain Atari
Captain Atari
Posts: 191
Joined: Mon May 24, 2010 2:58 am
Location: Germany
Contact:

Re: Majhong like SDL game

Postby Ektus » Wed Jan 04, 2017 8:06 pm

I tried it on my CT2A Falcon in 256 colours, started from MagiC. It switches resolution, runs and is playable, doesn't detect when a game is finished (remains with the "select a tile" message), exits gracefully back to the desktop when pressing "ESC" on the keyboard.

On the CT63+CTPCI, it won't run. At all. Neither the 68000 nor the 2060 versions from december 21st and january 3rd. Exception #2, Access Fault with PC at $3C. That's on the graphics card displaying 1920x1200 pixels in 16M colours.


Regards
Ektus.
Schneider CPC464 (long retired), Atari Mega ST4 (retired), Falcon+CT2A, Falcon+CT63+CTPCI+Radeon 9250, Milan040+SCSI+Rage

OL
Captain Atari
Captain Atari
Posts: 461
Joined: Fri Apr 01, 2005 6:59 am
Contact:

Re: Majhong like SDL game

Postby OL » Wed Jan 04, 2017 10:31 pm

Thanks reports

and there is an issue for me, because under Magic it should not switch resolution and should display in a window as it is under multitask system, the detection is done appl_init(), could it be possible global[1] not return -1? looks quite strange for me because in the past I was working under MagicMac and already I detected multitask AES by this way. This is available since December 21st.

For CTPCI, if you are under Magic set env:
SDL_VIDEODRIVER=gem

should force the gem version, so should run, this is the most compatible version, I not understand why it is not in gem version except if you set env
SDL_VIDEODRIVER=xbios


Thanks

Olivier

Ektus wrote:I tried it on my CT2A Falcon in 256 colours, started from MagiC. It switches resolution, runs and is playable, doesn't detect when a game is finished (remains with the "select a tile" message), exits gracefully back to the desktop when pressing "ESC" on the keyboard.

On the CT63+CTPCI, it won't run. At all. Neither the 68000 nor the 2060 versions from december 21st and january 3rd. Exception #2, Access Fault with PC at $3C. That's on the graphics card displaying 1920x1200 pixels in 16M colours.


Regards
Ektus.
OL


Social Media

     

Return to “Games”

Who is online

Users browsing this forum: No registered users and 2 guests