freesci-develop
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [freesci-develop] State of Glutton on Win32


From: Christoph Reichenbach
Subject: Re: [freesci-develop] State of Glutton on Win32
Date: Mon, 24 Oct 2005 23:46:02 -0600
User-agent: Mutt/1.5.4i

Jim,

> Since the glutton development is nearing a release I thought I'd try 
> getting it to compile and run on Win32, here's my results so far:

Thanks for that, by the way! It's good to hear that Win32 isn't
completely broken now ;-)

>    * I removed the old sound system from the Win32 project files and
>      added the new sound system, there probably won't be any sound
>      support for Win32 in the new release though.
> 
>    UPDATE: Wow, never mind, I just tried running the King's Quest I
>    remake, and my speakers started blaring out the theme song.  Granted
>    it was adlib and not general midi, but heck, I'll take whatever I
>    can get.

  We only have PCM-based sound support and untranslated MIDI for Linux/ALSA
(for MT-32 on Linux) at the moment. No-one is currently working on porting
our MT32->GM mapper or even adding the MT-32 emulator that has been floating
around (before you get your hopes up, people: A ROM dump is required to run
this thing), so if anyone wants to work on this: You won't be stepping on the
toes of any of the known developers anytime soon.

>    * I encountered some nonstandard c code.  Christoph explained that
>      this is the new C98 standard.  Microsoft is "supposed" to support
>      this standard in their new visual studio 2005, but that is still
>      in beta and the support is unconfirmed.  The only problem the
>      compiler can't handle is declaring variables midway through a
>      function.  I'd suggest keeping with the C89 standard, but there's
>      only about a dozen cases of this through all of the source and the
>      problem's easy enough to fix.

  I personally like the midway declaration feature (or, let's put it
this way, there aren't many languages in use that don't have it), but
if it helps a lot with a platform, changing a handful of places makes
perfect sense.

>    * in seq_manager.c there are four macros:
> 
>        DEFINE_ALLOC_DEALLOC(, clone, MEM_OBJ_CLONES, clones);
>        DEFINE_ALLOC_DEALLOC(, list, MEM_OBJ_LISTS, lists);
>        DEFINE_ALLOC_DEALLOC(, node, MEM_OBJ_NODES, nodes);
>        DEFINE_ALLOC_DEALLOC(static, hunk, MEM_OBJ_HUNK, hunks);
> 
>    MSVC can't handle the blank first argument so I changed this to:
> 
>        DEFINE_ALLOC_DEALLOC(auto, clone, MEM_OBJ_CLONES, clones);
>        DEFINE_ALLOC_DEALLOC(auto, list, MEM_OBJ_LISTS, lists);
>        DEFINE_ALLOC_DEALLOC(auto, node, MEM_OBJ_NODES, nodes);
>        DEFINE_ALLOC_DEALLOC(static, hunk, MEM_OBJ_HUNK, hunks);
> 
>    to get it to compile.  Since it's blank, I'm not sure what the first
>    argument's supposed to be,

  Empty-- we don't want these functions to be static.

> and I don't even know if "auto" is
>    supported outside of MSVC.

  I don't think it is.

>  If anyone could explain what the desired
>    functionality is supposed to be I'll find a keyword to use there
>    and, if necessary, write a special Win32 case.

  We just want it not to be static. My guess is that passing EMPTY and doing

#define EMPTY

earlier on maight work, but I haven't tried that.

>    * In exe_lzexe.c, the function lzexe_read calls memcpy(buf + done,
>      handle->buffer, copy);.  buf is a void *, and because the size of
>      each pointer is unknown the compiler can't do the pointer
>      arithmetic.  buf needs to be typecasted, I'd guess to (char*), but
>      I'm not sure what type it's supposed to be.

  I don't know what's supposed to happen there.

>    * Obviously there's no sound support (UPDATE: I don't know why it
>      worked in KQ1 but not the other games I tested), but I think the
>      complete absence of sound support is causing some crashes in and
>      of itself.  If somebody could explain how the null driver works so
>      that I can just use that in Win32, I'd appreciate it.

  The sound subsystem configuration is very ad-hoc at the moment-- it just
picks the first driver out of a list that's compiled in. Unlike 'stable',
a working sound subsystem is (theoretically) not needed to get a game to
fully work-- sound cues (messages delivered from the sound subsystem to
the game engine) are now handled by iterating through songs silently;
if a sound subsystem is present, it is handed a copy of the song.
  Within sfx, there are a couple of subdirectories for various subsystems:

- mixer         For mixing audio streams. Currently, only a manual linear
                interpolation mixer (unlimited input channels) is
                present. This uses lots of integer divisions and may be slow
                on some hardware.
- pcm_device    PCM output devices for playing sound effects or
                software-sequenced music; currently ALSA and SDL
- player        High-level song player, gets a song and is supposed to play
                it. We currently have a "real-time" player, which schedules
                notes ahead of time, and a "polled" player, which expects to
                be called back from somewhere
- seq           Sequencers. Currently, we have OSS-ADLIB, which plays Adlib
                sound effects directly on Linux/OSS, and MT-32, which uses a
                'device' and plays MT-32 music.
- device        Audio devices for playing MIDI directly; currently only ALSA
- softseq       Software sequencers. Currently, we have OPL/2, PC-Speaker and
                Tandy (3 voice) software sequencers. These require PCM
                support and a mixer (if sound effects are also desired).
- timer         Used by the "real-time" song player, and schedules it in
                irregular intervals (not used with software sequencing).

  The file 'core.c' contains a global variable 'player', which contains the
song player (which then may reference other subsystems), and 'mixer', which
contains the PCM mixer (which uses a pcm_device). Both should be allowed to be
NULL, which corresponds to not producing any sound. If them being NULL results
in problems, that's a bug.

  Still, you should be able to get general sound support with SDL-- when
running with an SDL PCM output device, you can use the mixer with the 'polled'
player (which, by the way, should give a much more accurate rendering--
timing-wise-- of songs). I haven't tried sound support recently, though, so it
may be broken in general (can't test now, I'm afraid).

>    * Both the KQ1 remake and QFG2 enter error loops. Both games load
>      correctly, but start looping either during the introduction or
>      after starting a new game .  The output is:
> 
>        (KQ1, New Game)
>        Script error in file [SLC-LU] C:\freesciglutton\src\engine\vm.c,
>        line 1652: Attempt to send to non-object or invalid script
>        Address was 0000:0000
>        Send to invalid selector 0x5e of object at 0000:0000
>        On-screen console disabled and driver claims not to support
>        windowed mode.

The SDL driver currently doesn't know whether it is windowed or not, thus,
you're not dumped to the debug console. You can enable the on-screen console
by ensuring that WANT_CONSOLE is defined, but that's mostly of interest if
you want to exit sanely or debug that matter.

  I'm not sure what this precise issue is, but it may be a new problem that
Lars (IIRC) fixed very recently. I'm not sure if you noticed, but we added
automatic mark & sweep garbage collection to the FreeSCI memory subsystem;
this introduced a handful of new bugs.
  If you haven't updated since Lars' LSL1 Hooker fix, I strongly suggest
you do so and try again.

[...]
>        (QFG2: Intro - no loop, just stops, probably sound related)
>        [sfx-mixer] Your timer is too slow for your PCM output device
>        (1189/4096), free=4955.
>        [sfx-mixer] You might want to try changing the device, timer, or
>        mixer, if possible.

  I think it's a bit too sensitive about those issues ATM, really...

>        Looking up song handle 00010804 failed in
>        C:\freesciglutton\src\sfx\core.c, L737
>        Warning: Selector 'state' of object at 8040001 could not be
>        written to (C:\freesciglutton\src\engine\ksound.c L243)

  Matt noted that there is an issue with the owner objects of songs getting
removed behind their back. The solution for this is obvious: Add song owner
locations to the GC's root set (hasn't been done yet).

> I never learned how to use CVS correctly, the client I tried never 
> seemed to work, so all I ever do is download the current src using the 
> guest login.  That being said, I just installed subversion and a windows 
> client, so whenever the source moves over to that system I'll try to 
> start uploaded changes myself.

  I have no idea about the "when" of the subversion switch, sorry.

> Also, the stable branch runs fine on Win32, so at the very least is 
> there's a new stable release soon then it'll run on Win32.

  That's good to hear!


-- Christoph




reply via email to

[Prev in Thread] Current Thread [Next in Thread]