Sonic and Sega Retro Message Board: Gens/GS II planning - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

Gens/GS II planning

#1 User is online GerbilSoft 

Posted 18 April 2010 - 11:47 PM

  • RickRotate'd.
  • Posts: 2021
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:158
I've noticed that there seem to be some unfixable issues in the Gens/GS codebase. Most notably, these issues include random slowdown on various machines.

So, in order to fix these issues, I'm going to attempt to do a partial rewrite, tentatively titled Gens/GS II.

Main features of the rewrite:
- Separated emulation code from UI code. (libgens / gens-qt4)
- Qt4 UI for all major platforms.
- CMake-based build system.
- SDL video, audio, and input handling for all platforms. (no more separate DirectX code on Windows)
- Multithreaded emulation code. (Emulation runs in one thread; UI runs in another.)
- I will probably use pipes for inter-thread communication. Either that or SDL events, but SDL events are one-way. (That is, UI to SDL.)

I haven't started the rewrite yet, but I plan to start working on it sometime this week.
This post has been edited by GerbilSoft: 18 April 2010 - 11:50 PM

#2 User is offline Mad Echidna 

Posted 19 April 2010 - 08:58 AM

  • Gone
  • Posts: 5217
  • Joined: 13-January 03
  • Gender:Male
  • Wiki edits:4
I like the multithreading idea a lot. That was one of the big things on BeOS back in the day was the strong thread support. Some apps used dozens, even the simpler apps.

#3 User is offline Overlord 

Posted 19 April 2010 - 01:59 PM

  • Cat-herder
  • Posts: 13843
  • Joined: 12-January 03
  • Gender:Male
  • Location:Berkshire, England
  • Project:VGDB
  • Wiki edits:3,204
Multithreading would be great, yeah - computers with multiple CPU cores are only going to increase from here on out. One hopes this doesn't end up comparing to Gens/GS how SHWP II compared to SHWP. ;P

#4 User is online GerbilSoft 

Posted 19 April 2010 - 02:08 PM

  • RickRotate'd.
  • Posts: 2021
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:158
QUOTE (Overlord @ Apr 19 2010, 02:59 PM)
Multithreading would be great, yeah - computers with multiple CPU cores are only going to increase from here on out. One hopes this doesn't end up comparing to Gens/GS how SHWP II compared to SHWP. ;P

lol no.

Jeopardy! System, which I mentioned previously on #retro, uses multithreading for various things, including audio and Wii Remote handling. On JS, audio isn't synchronized with video at all, since it isn't necessary. For Gens/GS II, it will be necessary, so I'll have to do that differently.

In other news: http://gs_server.gerbilsoft.ddns.info/cgi-...I.git;a=summary - I managed to get starscream and mdZ80 to build correctly using CMake. Starscream, in particular, is annoying because it's a C program that generates assembly, which is then assembled using NASM. NASM also isn't directly supported by CMake, but someone posted NASM modules for CMake on the CMake bug tracker, so I used that.

The next step will be writing the main libgens code, which will include porting the emulation code from Gens/GS and adding the SDL loop. I also have to add two thread-safe queues for communication between Gens/GS and the UI. (The initial UI for the first preview release will probably be command-line only.)

#5 User is offline Mad Echidna 

Posted 19 April 2010 - 02:48 PM

  • Gone
  • Posts: 5217
  • Joined: 13-January 03
  • Gender:Male
  • Wiki edits:4
QUOTE (GerbilSoft @ Apr 19 2010, 12:08 PM)
QUOTE (Overlord @ Apr 19 2010, 02:59 PM)
Multithreading would be great, yeah - computers with multiple CPU cores are only going to increase from here on out. One hopes this doesn't end up comparing to Gens/GS how SHWP II compared to SHWP. ;P

lol no.

Jeopardy! System, which I mentioned previously on #retro, uses multithreading for various things, including audio and Wii Remote handling. On JS, audio isn't synchronized with video at all, since it isn't necessary. For Gens/GS II, it will be necessary, so I'll have to do that differently.

In other news: http://gs_server.gerbilsoft.ddns.info/cgi-...I.git;a=summary - I managed to get starscream and mdZ80 to build correctly using CMake. Starscream, in particular, is annoying because it's a C program that generates assembly, which is then assembled using NASM. NASM also isn't directly supported by CMake, but someone posted NASM modules for CMake on the CMake bug tracker, so I used that.

The next step will be writing the main libgens code, which will include porting the emulation code from Gens/GS and adding the SDL loop. I also have to add two thread-safe queues for communication between Gens/GS and the UI. (The initial UI for the first preview release will probably be command-line only.)


Good stuff Gerb, I look forward to hearing more about this.


#6 User is offline Xaklse 

Posted 20 April 2010 - 09:38 AM

  • Posts: 260
  • Joined: 02-February 10
  • Gender:Male
  • Location:Madrid, Spain
  • Wiki edits:11
Don't know shit about emulators code and what are exactly your needs, but did you consider using SFML 1.6 instead of SDL? Seems to me some features would be really useful for you.

#7 User is online GerbilSoft 

Posted 20 April 2010 - 11:50 AM

  • RickRotate'd.
  • Posts: 2021
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:158
QUOTE (Xaklse @ Apr 20 2010, 10:38 AM)
Don't know shit about emulators code and what are exactly your needs, but did you consider using SFML 1.6 instead of SDL? Seems to me some features would be really useful for you.

SFML actually does look kinda interesting, so I might consider it. Ubuntu has SFML, but it seems to be an old version (1.5 in Ubuntu 10.04), so I guess I might include a statically-linked copy if I decide to use it.

EDIT: It seems that the current version of SFML has some joystick limitations. (Specifically, it only supports two joysticks.) It also looks harder to integrate with the Qt4 UI unless I use Qt code in libgens, which I don't want to do. So I guess I'll stick with SDL for now. (I can always port everything to SFML later on if the need arises.)

EDIT 2: I can't seem to find a source code download for SFML that isn't SVN. All I see are "SDK" downloads, so I'm guessing SFML was primarily developed for Windows systems, and Linux support was added as an afterthought.
This post has been edited by GerbilSoft: 20 April 2010 - 12:14 PM

#8 User is offline Xaklse 

Posted 20 April 2010 - 12:29 PM

  • Posts: 260
  • Joined: 02-February 10
  • Gender:Male
  • Location:Madrid, Spain
  • Wiki edits:11
QUOTE (GerbilSoft @ Apr 20 2010, 06:50 PM)
EDIT 2: I can't seem to find a source code download for SFML that isn't SVN. All I see are "SDK" downloads, so I'm guessing SFML was primarily developed for Windows systems, and Linux support was added as an afterthought.

(?) The full SDK has the source codes; well, I guess so because when I downloaded the 1.5 SDK it had the sources.

Also, keep in mind that SFML is flexible, I mean you can choose one of the small packages like for instance the System one for threads.

#9 User is online GerbilSoft 

Posted 25 April 2010 - 09:40 PM

  • RickRotate'd.
  • Posts: 2021
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:158
I now have an initial Qt4-based UI. I'm currently using the QX11EmbedWidget for embedding SDL, since other widgets had issues with BadWindow errors, but I'll get it working with a standard widget for other platforms.

In the meantime, Gens/GS II is currently only buildable on Linux. Source code is available at http://gs_server.gerbilsoft.ddns.info/cgi-...I.git;a=summary .

#10 User is offline Andlabs 

Posted 02 May 2010 - 03:07 PM

  • 「いっきまーす」
  • Posts: 2175
  • Joined: 11-July 08
  • Gender:Male
  • Project:Writing my own MD/Genesis sound driver :D
  • Wiki edits:7,061
I'm just going to say that if this is going to be a raw rewrite then then 32X emulation code in the old Gens is a joke and we both agreed it needs to be replaced. I'll start writing a new one once Gens/GS II can do MD emulation. I have been thinking ahead and I don't think the G BIOS would be needed unless it does something that I don't know about, but that's just what I can tell. After all, we already have everything set up on the emulator side =P
This post has been edited by Andlabs: 02 May 2010 - 03:10 PM

#11 User is online sonicblur 

Posted 02 May 2010 - 05:11 PM

  • Posts: 742
  • Joined: 18-February 08
  • Gender:Male
  • Wiki edits:6
QUOTE (GerbilSoft @ Apr 18 2010, 11:47 PM)
Main features of the rewrite:
- Separated emulation code from UI code. (libgens / gens-qt4)


With these changes, will it be possible to easily compile Gens without a UI?
It sounds like it, but I just wanted to confirm. (Since your current repository has SDL and Win32 stuff still mixed in with libgens)
This post has been edited by sonicblur: 02 May 2010 - 05:15 PM

#12 User is offline Mad Echidna 

Posted 03 May 2010 - 04:33 PM

  • Gone
  • Posts: 5217
  • Joined: 13-January 03
  • Gender:Male
  • Wiki edits:4
Hey Gerbilsoft, how seriously do you take the Haiku port? If it reaches your quality standards will it be an "official" port at some point? How do you view this?

#13 User is online GerbilSoft 

Posted 03 May 2010 - 09:18 PM

  • RickRotate'd.
  • Posts: 2021
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:158
QUOTE (sonicblur @ May 2 2010, 06:11 PM)
With these changes, will it be possible to easily compile Gens without a UI?
It sounds like it, but I just wanted to confirm. (Since your current repository has SDL and Win32 stuff still mixed in with libgens)

It would still need a "UI", but that UI could easily be a command line interface.

QUOTE (Mad Echidna @ May 3 2010, 05:33 PM)
Hey Gerbilsoft, how seriously do you take the Haiku port? If it reaches your quality standards will it be an "official" port at some point? How do you view this?

Considering that very few people use Haiku, I don't know. The initial Haiku port will be Qt4, but a Haiku-native UI could be written later on.

#14 User is offline Mad Echidna 

Posted 03 May 2010 - 11:29 PM

  • Gone
  • Posts: 5217
  • Joined: 13-January 03
  • Gender:Male
  • Wiki edits:4
QUOTE (GerbilSoft @ May 3 2010, 07:18 PM)
QUOTE (Mad Echidna @ May 3 2010, 05:33 PM)
Hey Gerbilsoft, how seriously do you take the Haiku port? If it reaches your quality standards will it be an "official" port at some point? How do you view this?

Considering that very few people use Haiku, I don't know. The initial Haiku port will be Qt4, but a Haiku-native UI could be written later on.



That's true, very few people do use Haiku, an OS that's still in alpha

:P

#15 User is offline Conan Kudo 

Posted 03 May 2010 - 11:51 PM

  • 「真実はいつも一つ!」工藤新一
  • Posts: 477
  • Joined: 12-January 09
  • Gender:Male
  • Wiki edits:14
QUOTE (Mad Echidna @ May 3 2010, 11:29 PM)
QUOTE (GerbilSoft @ May 3 2010, 07:18 PM)
QUOTE (Mad Echidna @ May 3 2010, 05:33 PM)
Hey Gerbilsoft, how seriously do you take the Haiku port? If it reaches your quality standards will it be an "official" port at some point? How do you view this?

Considering that very few people use Haiku, I don't know. The initial Haiku port will be Qt4, but a Haiku-native UI could be written later on.



That's true, very few people do use Haiku, an OS that's still in alpha

:P


I'm surprised nobody's brought up AROS yet...

Also, I thought Starscream was supposed to be replaced, since it isn't GPL compatible?

I'm no expert on m68k, but I found some GPLv2+ code that emulated an m68k CPU. I don't know how good it is or whatever, but here it is.
This post has been edited by King InuYasha: 04 May 2010 - 02:17 AM

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users